Update overlays

Add PPS overlays
Add overlays for A10 SoC
This commit is contained in:
zador-blood-stained 2017-03-21 20:26:38 +03:00
parent c24d10c4b1
commit ff98a0098f
2 changed files with 1514 additions and 30 deletions

View File

@ -12,10 +12,10 @@ index 01d178a2..bfba239c 100644
+dts-dirs += overlay
diff --git a/arch/arm/boot/dts/overlay/Makefile b/arch/arm/boot/dts/overlay/Makefile
new file mode 100644
index 00000000..e4d038d5
index 00000000..0543d20d
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/Makefile
@@ -0,0 +1,30 @@
@@ -0,0 +1,31 @@
+ifeq ($(CONFIG_OF_CONFIGFS),y)
+
+dtbo-$(CONFIG_MACH_SUN8I) += \
@ -25,6 +25,7 @@ index 00000000..e4d038d5
+ sun8i-h3-i2c1.dtbo \
+ sun8i-h3-i2c2.dtbo \
+ sun8i-h3-i2c-ds1307.dtbo \
+ sun8i-h3-pps-gpio.dtbo \
+ sun8i-h3-spi-jedec-nor.dtbo \
+ sun8i-h3-spi-mcp2515.dtbo \
+ sun8i-h3-spi-spidev.dtbo \
@ -48,10 +49,10 @@ index 00000000..e4d038d5
+clean-files := *.dtbo *.scr
diff --git a/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays b/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays
new file mode 100644
index 00000000..195a25d2
index 00000000..956be7b5
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays
@@ -0,0 +1,214 @@
@@ -0,0 +1,242 @@
+This document describes overlays provided in the kernel packages
+For generic Armbian overlays documentation please see
+https://docs.armbian.com/Hardware_Allwinner_overlays/
@ -79,6 +80,7 @@ index 00000000..195a25d2
+- i2c1
+- i2c2
+- i2c-ds1307
+- pps-gpio
+- spi-jedec-nor
+- spi-mcp2515
+- spi-spidev
@ -134,6 +136,24 @@ index 00000000..195a25d2
+ Required
+ Supported values: 0, 1, 2
+
+### pps-gpio
+
+Activates pulse-per-second GPIO client
+
+Parameters:
+
+param_pps_pin (pin)
+ Pin PPS source is connected to
+ Optional
+ Default: PD14
+
+param_pps_falling_edge (bool)
+ Assert by falling edge
+ Optional
+ Default: 0
+ When set (to 1), assert is indicated by a falling edge
+ (instead of by a rising edge)
+
+### spi-jedec-nor
+
+Activates MTD support for JEDEC compatible SPI NOR flash chips on SPI bus
@ -151,6 +171,7 @@ index 00000000..195a25d2
+
+param_spinor_max_freq (int)
+ Maximum SPI frequency
+ Optional
+ Default: 1000000
+ Range: 3000 - 100000000
+
@ -170,11 +191,13 @@ index 00000000..195a25d2
+
+param_mcp2515_clk_freq (int)
+ Onboard oscillator clock frequency
+ Optional
+ Default: 8000000
+ Typical values: 8000000, 16000000
+
+param_mcp2515_int_pin (pin)
+ Interrupt pin
+ Optional
+ Default: PA7
+ Selected pin should support interrupts (EINT)
+
@ -195,6 +218,7 @@ index 00000000..195a25d2
+
+param_spidev_max_freq (int)
+ Maximum SPIdev frequency
+ Optional
+ Default: 1000000
+ Range: 3000 - 100000000
+
@ -208,6 +232,7 @@ index 00000000..195a25d2
+
+param_uart1_rtscts (bool)
+ Enable RTS and CTS pins
+ Optional
+ Default: 0
+ Set to 1 to enable
+
@ -221,6 +246,7 @@ index 00000000..195a25d2
+
+param_uart2_rtscts (bool)
+ Enable RTS and CTS pins
+ Optional
+ Default: 0
+ Set to 1 to enable CTS and RTS pins
+
@ -234,6 +260,7 @@ index 00000000..195a25d2
+
+param_uart3_rtscts (bool)
+ Enable RTS and CTS pins
+ Optional
+ Default: 0
+ Set to 1 to enable CTS and RTS pins
+
@ -258,14 +285,16 @@ index 00000000..195a25d2
+
+param_w1_pin (pin)
+ Data pin for 1-Wire master
+ Optional
+ Default: PD14
+
+param_w1_pin_int_pullup (bool)
+ Enable internal pull-up for the data pin
+ This option should not be used with multiple devices, parasite power setup
+ or long wires - please use external pull-up resistor instead
+ Optional
+ Default: 0
+ Set to 1 to enable the pull-up
+ This option should not be used with multiple devices, parasite power setup
+ or long wires - please use external pull-up resistor instead
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-analog-codec.dts b/arch/arm/boot/dts/overlay/sun8i-h3-analog-codec.dts
new file mode 100644
index 00000000..ddcd8e84
@ -310,10 +339,10 @@ index 00000000..f611d823
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd b/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd
new file mode 100644
index 00000000..9d6540ed
index 00000000..5d9b5d5d
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd
@@ -0,0 +1,137 @@
@@ -0,0 +1,151 @@
+# overlays fixup script
+# implements (or rather substitutes) overlay arguments functionality
+# using u-boot scripting, environment variables and "fdt" command
@ -411,6 +440,20 @@ index 00000000..9d6540ed
+ env delete tmp_spi_path
+fi
+
+if test -n "${param_pps_pin}"; then
+ setenv tmp_bank "${param_pps_pin}"
+ setenv tmp_pin "${param_pps_pin}"
+ run decompose_pin
+ fdt set /soc/pinctrl@01c20800/pps_pins pins "${param_pps_pin}"
+ fdt get value tmp_phandle /soc/pinctrl@01c20800 phandle
+ fdt set /pps@0 gpios "<${tmp_phandle} ${tmp_bank} ${tmp_pin} 0>"
+ env delete tmp_pin tmp_bank tmp_phandle
+fi
+
+if test "${param_pps_falling_edge}" = "1"; then
+ fdt set /pps@0 assert-falling-edge
+fi
+
+if test -n "${param_w1_pin}"; then
+ setenv tmp_bank "${param_w1_pin}"
+ setenv tmp_pin "${param_w1_pin}"
@ -585,6 +628,40 @@ index 00000000..0e1de089
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-pps-gpio.dts b/arch/arm/boot/dts/overlay/sun8i-h3-pps-gpio.dts
new file mode 100644
index 00000000..79459304
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-pps-gpio.dts
@@ -0,0 +1,28 @@
+/dts-v1/ /plugin/;
+
+/ {
+ compatible = "allwinner,sun8i-h3";
+
+ fragment@0 {
+ target = <&pio>;
+ __overlay__ {
+ pps_pins: pps_pins {
+ pins = "PD14";
+ function = "gpio_in";
+ };
+ };
+ };
+
+ fragment@1 {
+ target-path = "/";
+ __overlay__ {
+ pps@0 {
+ compatible = "pps-gpio";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pps_pins>;
+ gpios = <&pio 3 14 0>; /* PD14 */
+ status = "okay";
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi-jedec-nor.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi-jedec-nor.dts
new file mode 100644
index 00000000..4df8a5ee

File diff suppressed because it is too large Load Diff