add param_w1_pin management to rockchip-fixup.scr
This commit is contained in:
parent
aba46df742
commit
e4e34c7f15
@ -35,7 +35,7 @@ diff --git a/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays b/arc
|
||||
index e69de29..9512445 100644
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
|
||||
@@ -0,0 +1,48 @@
|
||||
@@ -0,0 +1,61 @@
|
||||
+This document describes overlays provided in the kernel packages
|
||||
+For generic Armbian overlays documentation please see
|
||||
+https://docs.armbian.com/User-Guide_Allwinner_overlays/
|
||||
@ -84,16 +84,40 @@ index e69de29..9512445 100644
|
||||
+ Default: 1000000
|
||||
+ Range: 3000 - 100000000
|
||||
+
|
||||
+### w1-gpio
|
||||
+
|
||||
+Activates 1-Wire GPIO master
|
||||
+Requires an external pull-up resistor on the data pin
|
||||
+or enabling the internal pull-up
|
||||
+
|
||||
+Parameters:
|
||||
+
|
||||
+param_w1_pin (pin)
|
||||
+ Data pin for 1-Wire master
|
||||
+ Optional
|
||||
+ Default: PD14
|
||||
+
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-fixup.scr-cmd b/arch/arm64/boot/dts/rockchip/overlay/rockchip-fixup.scr-cmd
|
||||
new file mode 100644
|
||||
index 0000000..d4c39e2
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-fixup.scr-cmd
|
||||
@@ -0,0 +1,17 @@
|
||||
@@ -0,0 +1,44 @@
|
||||
+# overlays fixup script
|
||||
+# implements (or rather substitutes) overlay arguments functionality
|
||||
+# using u-boot scripting, environment variables and "fdt" command
|
||||
+
|
||||
+setenv decompose_pin 'setexpr tmp_pinctrl sub "GPIO(0|1|2|3|4)_\\S\\d+" "\\1";
|
||||
+setexpr tmp_bank sub "GPIO\\d_(\\S)\\d+" "\\1";
|
||||
+test "${tmp_bank}" = "A" && setenv tmp_bank 0;
|
||||
+test "${tmp_bank}" = "B" && setenv tmp_bank 1;
|
||||
+test "${tmp_bank}" = "C" && setenv tmp_bank 2;
|
||||
+test "${tmp_bank}" = "D" && setenv tmp_bank 3;
|
||||
+setexpr tmp_pin sub "GPIO\\d_\\S(\\d+)" "\\1";
|
||||
+setexpr tmp_bank ${tmp_bank} * 8;
|
||||
+setexpr tmp_pin ${tmp_bank} + ${tmp_pin}'
|
||||
+
|
||||
+
|
||||
+if test -n "${param_spidev_spi_bus}"; then
|
||||
+ test "${param_spidev_spi_bus}" = "0" && setenv tmp_spi_path "spi@ff1c0000"
|
||||
+ test "${param_spidev_spi_bus}" = "1" && setenv tmp_spi_path "spi@ff1d0000"
|
||||
@ -107,6 +131,22 @@ index 0000000..d4c39e2
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if test -n "${param_w1_pin}"; then
|
||||
+ setenv tmp_pinctrl "${param_w1_pin}"
|
||||
+ setenv tmp_bank "${param_w1_pin}"
|
||||
+ setenv tmp_pin "${param_w1_pin}"
|
||||
+ run decompose_pin
|
||||
+ #echo "${param_w1_pin} ---> pinctrl = ${tmp_pinctrl}"
|
||||
+ #echo "${param_w1_pin} ---> bank = ${tmp_bank}"
|
||||
+ #echo "${param_w1_pin} ---> pin = ${tmp_pin}"
|
||||
+ fdt get value tmp_pinctrl /__symbols__ gpio${tmp_pinctrl}
|
||||
+ #echo "${param_w1_pin} ---> tmp_pinctrl = ${tmp_pinctrl}"
|
||||
+ fdt get value tmp_phandle ${tmp_pinctrl} phandle
|
||||
+ #echo "${param_w1_pin} ---> tmp_phandle = ${tmp_phandle}"
|
||||
+ fdt set /onewire@0 gpios "<${tmp_phandle} 0x000000${tmp_pin} 0 0>"
|
||||
+ env delete tmp_pinctrl tmp_bank tmp_pin tmp_phandle
|
||||
+fi
|
||||
+
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-i2c8.dts b/arch/arm64/boot/dts/rockchip/overlay/rockchip-i2c8.dts
|
||||
new file mode 100644
|
||||
index 0000000..54bc844
|
||||
|
||||
Loading…
Reference in New Issue
Block a user