Add new H3 overlays with parameters and documentation

This commit is contained in:
zador-blood-stained 2017-03-10 17:10:24 +03:00
parent ed72ce2bc0
commit 2ae0eabd25
2 changed files with 457 additions and 53 deletions

View file

@ -1,18 +1,8 @@
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 01d178a2..714998d1 100644
index 01d178a2..bfba239c 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -984,10 +984,17 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
dtb-$(CONFIG_ARCH_ASPEED) += aspeed-bmc-opp-palmetto.dtb \
aspeed-ast2500-evb.dtb
+
+targets += dtbs dtbs_install
+targets += $(dtb-y)
+
endif
dtstree := $(srctree)/$(src)
@@ -990,4 +990,7 @@ dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
always := $(dtb-y)
@ -22,18 +12,21 @@ index 01d178a2..714998d1 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..a86987ea
index 00000000..52d804db
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/Makefile
@@ -0,0 +1,25 @@
@@ -0,0 +1,31 @@
+ifeq ($(CONFIG_OF_CONFIGFS),y)
+
+dtbo-$(CONFIG_MACH_SUN8I) += \
+ sun8i-h3-analog-codec.dtbo \
+ sun8i-h3-i2c0.dtbo \
+ sun8i-h3-i2c1.dtbo \
+ sun8i-h3-i2c2.dtbo \
+ sun8i-h3-spi0-jedec-nor.dtbo \
+ sun8i-h3-spi0-spidev.dtbo \
+ sun8i-h3-spi0-mcp2515.dtbo \
+ sun8i-h3-spi1-jedec-nor.dtbo \
+ sun8i-h3-spi1-spidev.dtbo \
+ sun8i-h3-spi1-mcp2515.dtbo \
+ sun8i-h3-uart1.dtbo \
@ -42,15 +35,214 @@ index 00000000..a86987ea
+ sun8i-h3-usbhost0.dtbo \
+ sun8i-h3-usbhost2.dtbo \
+ sun8i-h3-usbhost3.dtbo \
+ sun8i-h3-w1.dtbo
+ sun8i-h3-w1-gpio.dtbo
+
+targets += dtbs dtbs_install
+targets += $(dtbo-y)
+scr-$(CONFIG_MACH_SUN8I) += sun8i-h3-fixup.scr
+
+dtbotxt-$(CONFIG_MACH_SUN8I) += README.sun8i-h3-overlays
+
+targets += $(dtbo-y) $(scr-y) $(dtbotxt-y)
+
+endif
+
+always := $(dtbo-y)
+clean-files := *.dtbo
+always := $(dtbo-y) $(scr-y) $(dtbotxt-y)
+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..bd373226
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays
@@ -0,0 +1,190 @@
+This document describes overlays provided in the kernel packages
+For generic Armbian overlays documentation please see
+https://docs.armbian.com/Hardware_Allwinner_overlays/
+
+### Platform:
+
+sun8i-h3 (Allwinner H3)
+
+### Platform details:
+
+Supported pin banks: PA, PC, PD, PG
+
+Both SPI controllers have only one hardware CS,
+so SPI chip select is always set to 0
+
+### Provided overlays:
+
+- analog-codec
+- i2c0
+- i2c1
+- i2c2
+- spi0-jedec-nor
+- spi0-mcp2515
+- spi0-spidev
+- spi1-jedec-nor
+- spi1-mcp2515
+- spi1-spidev
+- uart1
+- uart2
+- uart3
+- usbhost0
+- usbhost2
+- usbhost3
+- w1-gpio
+
+### Overlay details:
+
+### analog-codec
+
+Activates SoC analog codec driver that provides Line Out and Mic In
+functionality
+
+### i2c0
+
+Activates TWI/I2C bus 0, exposed on pins PA11 and PA12
+
+### i2c1
+
+Activates TWI/I2C bus 1, exposed on pins PA18 and PA19
+
+### i2c2
+
+Activates TWI/I2C bus 2, exposed on pins PE12 and PE13
+On most board this but is wired to Camera (CSI) socket
+
+### spi0-jedec-nor
+
+Activates MTD support for JEDEC compatible SPI NOR flash chips on SPI bus 0
+supported by the kernel SPI NOR driver
+SPI 0 pins (MOSI, MISO, SCK, CS): PC0, PC1, PC2, PC3
+
+Parameters:
+
+param_spinor_max_freq (int)
+ Maximum SPI frequency
+ Default: 1000000
+ Range: 3000 - 100000000
+
+### spi0-mcp2515
+
+Activates mcp2515 SPI CAN controller connected to SPI bus 0
+SPI 0 pins (MOSI, MISO, SCK, CS): PC0, PC1, PC2, PC3
+
+Parameters:
+
+param_mcp2515_clk_freq (int)
+ Onboard oscillator clock frequency
+ Default: 8000000
+ Typical values: 8000000, 16000000
+
+param_mcp2515_int_pin (pin)
+ Interrupt pin
+ Default: PA7
+ Selected pin should support interrupts (EINT)
+
+### spi0-spidev
+
+Activates SPIdev device node (/dev/spidev0.0) for userspace SPI access
+SPI 0 pins (MOSI, MISO, SCK, CS): PC0, PC1, PC2, PC3
+
+Parameters:
+
+param_spidev_max_freq (int)
+ Maximum SPIdev frequency
+ Default: 1000000
+ Range: 3000 - 100000000
+
+### spi1-jedec-nor
+
+Activates MTD support for JEDEC compatible SPI NOR flash chips on SPI bus 1
+supported by the kernel SPI NOR driver
+SPI 1 pins (MOSI, MISO, SCK, CS): PA15, PA16, PA14, PA13
+
+Parameters:
+
+param_spinor_max_freq (int)
+ Maximum SPI frequency
+ Default: 1000000
+ Range: 3000 - 100000000
+
+### spi1-mcp2515
+
+Activates mcp2515 SPI CAN controller connected to SPI bus 1
+SPI 1 pins (MOSI, MISO, SCK, CS): PA15, PA16, PA14, PA13
+
+See spi0-mcp2515 description for supported parameters
+
+### spi1-spidev
+
+Activates SPIdev device node (/dev/spidev1.0) for userspace SPI access
+SPI 1 pins (MOSI, MISO, SCK, CS): PA15, PA16, PA14, PA13
+Chip select is hardcoded to 0 (Pin PA13)
+
+See spi0-spidev description for supported parameters
+
+### uart1
+
+Activates serial port 1 (/dev/ttyS1)
+UART 1 pins (TX, RX, RTS, CTS): PG6, PG7, PG8, PG9
+
+Parameters:
+
+param_uart1_rtscts (bool)
+ Enable RTS and CTS pins
+ Default: 0
+ Set to 1 to enable
+
+### uart2
+
+Activates serial port 2 (/dev/ttyS2)
+UART 2 pins (TX, RX, RTS, CTS): PA0, PA1, PA2, PA3
+
+Parameters:
+
+param_uart2_rtscts (bool)
+ Enable RTS and CTS pins
+ Default: 0
+ Set to 1 to enable CTS and RTS pins
+
+### uart3
+
+Activates serial port 3 (/dev/ttyS3)
+UART 3 pins (TX, RX, RTS, CTS): PA13, PA14, PA15, PA16
+
+Parameters:
+
+param_uart3_rtscts (bool)
+ Enable RTS and CTS pins
+ Default: 0
+ Set to 1 to enable CTS and RTS pins
+
+### usbhost0
+
+Activates USB host controller 0
+
+### usbhost2
+
+Activates USB host controller 2
+
+### usbhost3
+
+Activates USB host controller 3
+
+### w1-gpio
+
+Activates 1-Wire GPIO master
+Requires external pull-up resistor on data pin
+
+Parameters:
+
+param_w1_pin (pin)
+ Data pin for 1-Wire master
+ Default: PD14
+
+param_w1_pin_int_pullup (bool)
+ Enable internal pull-up for the data pin
+ This option should not be used with multiple sensors or long wires -
+ please use external pull-up resistor instead
+ Default: 0
+ Set to 1 to enable the pull-up
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
@ -73,6 +265,109 @@ index 00000000..ddcd8e84
+ };
+ };
+};
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..302536f8
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd
@@ -0,0 +1,97 @@
+# overlays fixup script
+# implements (or rather substitutes) overlay arguments functionality
+# using u-boot scripting, environment variables and "fdt" command
+
+# setexpr test_var ${tmp_bank} - A
+# works only for hex numbers (A-F)
+
+setenv decompose_pin 'setexpr tmp_bank sub "P(A|C|D|G)\\d+" "\\1";
+setexpr tmp_pin sub "P\\S(\\d+)" "\\1";
+test "${tmp_bank}" = "A" && setenv tmp_bank 0;
+test "${tmp_bank}" = "C" && setenv tmp_bank 2;
+test "${tmp_bank}" = "D" && setenv tmp_bank 3;
+test "${tmp_bank}" = "G" && setenv tmp_bank 6'
+
+if test -n "${param_mcp2515_clk_freq}"; then
+ for overlay in ${overlays}; do
+ if test "${overlay}" = "spi0-mcp2515" || test "${overlay}" = "spi1-mcp2515"; then
+ fdt set /clocks/can0_osc_fixed clock-frequency "<${param_mcp2515_clk_freq}>"
+ fi
+ done
+fi
+if test -n "${param_mcp2515_int_pin}"; then
+ setenv tmp_bank "${param_mcp2515_int_pin}"
+ setenv tmp_pin "${param_mcp2515_int_pin}"
+ run decompose_pin
+ fdt set /soc/pinctrl@01c20800/can0_pin_irq pins "${param_mcp2515_int_pin}"
+ for overlay in ${overlays}; do
+ if test "${overlay}" = "spi0-mcp2515"; then
+ setenv tmp_spi_path "spi@01c68000"
+ fi
+ if test "${overlay}" = "spi1-mcp2515"; then
+ setenv tmp_spi_path "spi@01c69000"
+ fi
+ done
+ fdt set /soc/${tmp_spi_path}/mcp2515@0 interrupts "<${tmp_bank} ${tmp_pin} 0x2>"
+ env delete tmp_pin tmp_bank tmp_spi_path
+fi
+if test -n "${param_spidev_max_freq}"; then
+ for overlay in ${overlays}; do
+ if test "${overlay}" = "spi0-mcp2515"; then
+ setenv tmp_spi_path "spi@01c68000"
+ fi
+ if test "${overlay}" = "spi1-mcp2515"; then
+ setenv tmp_spi_path "spi@01c69000"
+ fi
+ done
+ fdt set /soc/${tmp_spi_path}/spidev@0 spi-max-frequency "<${param_spidev_max_freq}>"
+ env delete tmp_spi_path
+fi
+if test -n "${param_spinor_max_freq}"; then
+ for overlay in ${overlays}; do
+ if test "${overlay}" = "spi0-jedec-nor"; then
+ setenv tmp_spi_path "spi@01c68000"
+ fi
+ if test "${overlay}" = "spi1-jedec-nor"; then
+ setenv tmp_spi_path "spi@01c69000"
+ fi
+ done
+ fdt set /soc/${tmp_spi_path}/spiflash@0 spi-max-frequency "<${param_spinor_max_freq}>"
+ env delete tmp_spi_path
+fi
+if test -n "${param_w1_pin}"; then
+ setenv tmp_bank "${param_w1_pin}"
+ setenv tmp_pin "${param_w1_pin}"
+ run decompose_pin
+ fdt set /soc/pinctrl@01c20800/w1_pins pins "${param_w1_pin}"
+ fdt get value tmp_phandle /soc/pinctrl@01c20800 phandle
+ fdt set /onewire@0 gpios "<${tmp_phandle} ${tmp_bank} ${tmp_pin} 0>"
+ env delete tmp_pin tmp_bank tmp_phandle
+fi
+if test "${param_w1_pin_int_pullup}" = "1"; then
+ fdt set /soc/pinctrl@01c20800/w1_pins bias-pull-up
+fi
+if test "${param_uart1_rtscts}" = "1"; then
+ fdt get value tmp_phandle1 /soc/pinctrl@01c20800/uart1 phandle
+ fdt get value tmp_phandle2 /soc/pinctrl@01c20800/uart1_rts_cts phandle
+ fdt set /soc/serial@01c28400 pinctrl-names "default" "default"
+ fdt set /soc/serial@01c28400 pinctrl-0 "<${tmp_phandle1}>"
+ fdt set /soc/serial@01c28400 pinctrl-1 "<${tmp_phandle2}>"
+ env delete tmp_phandle1 tmp_phandle2
+fi
+if test "${param_uart2_rtscts}" = "1"; then
+ fdt get value tmp_phandle1 /soc/pinctrl@01c20800/uart2 phandle
+ fdt get value tmp_phandle2 /soc/pinctrl@01c20800/uart2_rts_cts phandle
+ fdt set /soc/serial@01c28800 pinctrl-names "default" "default"
+ fdt set /soc/serial@01c28800 pinctrl-0 "<${tmp_phandle1}>"
+ fdt set /soc/serial@01c28800 pinctrl-1 "<${tmp_phandle2}>"
+ env delete tmp_phandle1 tmp_phandle2
+fi
+if test "${param_uart3_rtscts}" = "1"; then
+ fdt get value tmp_phandle1 /soc/pinctrl@01c20800/uart3 phandle
+ fdt get value tmp_phandle2 /soc/pinctrl@01c20800/uart3_rts_cts phandle
+ fdt set /soc/serial@01c28c00 pinctrl-names "default" "default"
+ fdt set /soc/serial@01c28c00 pinctrl-0 "<${tmp_phandle1}>"
+ fdt set /soc/serial@01c28c00 pinctrl-1 "<${tmp_phandle2}>"
+ env delete tmp_phandle1 tmp_phandle2
+fi
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-i2c0.dts b/arch/arm/boot/dts/overlay/sun8i-h3-i2c0.dts
new file mode 100644
index 00000000..5377cc67
@ -123,12 +418,70 @@ index 00000000..36291c51
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-i2c2.dts b/arch/arm/boot/dts/overlay/sun8i-h3-i2c2.dts
new file mode 100644
index 00000000..0e1de089
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-i2c2.dts
@@ -0,0 +1,19 @@
+/dts-v1/ /plugin/;
+
+/ {
+ compatible = "allwinner,sun8i-h3";
+
+ fragment@0 {
+ target-path = "/aliases";
+ __overlay__ {
+ i2c2 = "/soc/i2c@01c2b400";
+ };
+ };
+
+ fragment@1 {
+ target = <&i2c2>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi0-jedec-nor.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi0-jedec-nor.dts
new file mode 100644
index 00000000..5fea00c7
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi0-jedec-nor.dts
@@ -0,0 +1,27 @@
+/dts-v1/ /plugin/;
+
+/ {
+ compatible = "allwinner,sun8i-h3";
+
+ fragment@0 {
+ target-path = "/aliases";
+ __overlay__ {
+ spi0 = "/soc/spi@01c68000";
+ };
+ };
+
+ fragment@1 {
+ target = <&spi0>;
+ __overlay__ {
+ status = "okay";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ spiflash@0 {
+ compatible = "jedec,spi-nor";
+ status = "okay";
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi0-mcp2515.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi0-mcp2515.dts
new file mode 100644
index 00000000..b7c3e85b
index 00000000..8297379f
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi0-mcp2515.dts
@@ -0,0 +1,59 @@
@@ -0,0 +1,58 @@
+/dts-v1/ /plugin/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
@ -159,11 +512,10 @@ index 00000000..b7c3e85b
+ fragment@2 {
+ target = <&pio>;
+ __overlay__ {
+ can0_pin_irq: can0_pin_irq@0 {
+ allwinner,pins = "PA7";
+ allwinner,function = "irq";
+ allwinner,drive = <0>;
+ allwinner,pull = <1>; /* Pull up */
+ can0_pin_irq: can0_pin_irq {
+ pins = "PA7";
+ function = "irq";
+ bias-pull-up;
+ };
+ };
+ };
@ -220,12 +572,45 @@ index 00000000..8eacf1b2
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi1-jedec-nor.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi1-jedec-nor.dts
new file mode 100644
index 00000000..4df90cd9
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi1-jedec-nor.dts
@@ -0,0 +1,27 @@
+/dts-v1/ /plugin/;
+
+/ {
+ compatible = "allwinner,sun8i-h3";
+
+ fragment@0 {
+ target-path = "/aliases";
+ __overlay__ {
+ spi1 = "/soc/spi@01c69000";
+ };
+ };
+
+ fragment@1 {
+ target = <&spi1>;
+ __overlay__ {
+ status = "okay";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ spiflash@0 {
+ compatible = "jedec,spi-nor";
+ status = "okay";
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi1-mcp2515.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi1-mcp2515.dts
new file mode 100644
index 00000000..66be392d
index 00000000..18f7ac0b
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi1-mcp2515.dts
@@ -0,0 +1,59 @@
@@ -0,0 +1,58 @@
+/dts-v1/ /plugin/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
@ -256,11 +641,10 @@ index 00000000..66be392d
+ fragment@2 {
+ target = <&pio>;
+ __overlay__ {
+ can0_pin_irq: can0_pin_irq@0 {
+ allwinner,pins = "PA7";
+ allwinner,function = "irq";
+ allwinner,drive = <0>;
+ allwinner,pull = <1>; /* Pull up */
+ can0_pin_irq: can0_pin_irq {
+ pins = "PA7";
+ function = "irq";
+ bias-pull-up;
+ };
+ };
+ };
@ -319,7 +703,7 @@ index 00000000..9491c426
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-uart1.dts b/arch/arm/boot/dts/overlay/sun8i-h3-uart1.dts
new file mode 100644
index 00000000..5081c234
index 00000000..902e3e5a
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-uart1.dts
@@ -0,0 +1,21 @@
@ -339,7 +723,7 @@ index 00000000..5081c234
+ target = <&uart1>;
+ __overlay__ {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ pinctrl-0 = <&uart1_pins>;
+ status = "okay";
+ };
+ };
@ -473,12 +857,12 @@ index 00000000..99155b16
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-w1.dts b/arch/arm/boot/dts/overlay/sun8i-h3-w1.dts
diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-w1-gpio.dts b/arch/arm/boot/dts/overlay/sun8i-h3-w1-gpio.dts
new file mode 100644
index 00000000..7642ef03
index 00000000..0e38e9e3
--- /dev/null
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-w1.dts
@@ -0,0 +1,30 @@
+++ b/arch/arm/boot/dts/overlay/sun8i-h3-w1-gpio.dts
@@ -0,0 +1,28 @@
+/dts-v1/ /plugin/;
+
+/ {
@ -488,10 +872,8 @@ index 00000000..7642ef03
+ target = <&pio>;
+ __overlay__ {
+ w1_pins: w1_pins {
+ allwinner,pins = "PD14";
+ allwinner,function = "gpio_in";
+ allwinner,drive = <0>;
+ allwinner,pull = <0>;
+ pins = "PD14";
+ function = "gpio_in";
+ };
+ };
+ };

View file

@ -2,12 +2,15 @@ diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab30cc63..cc176797 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,6 +339,9 @@ $(INSTALL_TARGETS):
@@ -339,6 +339,12 @@ $(INSTALL_TARGETS):
%.dtb: | scripts
$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+%.dtbo: | scripts
+ $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+
+%.scr: | scripts
+ $(Q)$(MAKE) $(build)=$(boot)/dts ARCH=$(ARCH) $(boot)/dts/$@
+
PHONY += dtbs dtbs_install
@ -16,22 +19,26 @@ diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
index 3c79f859..eaaeb17e 100644
--- a/arch/arm/boot/.gitignore
+++ b/arch/arm/boot/.gitignore
@@ -3,4 +3,4 @@ zImage
@@ -3,4 +3,5 @@ zImage
xipImage
bootpImage
uImage
-*.dtb
+*.dtb*
+*.scr
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b9a4a934..54e3c38d 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -119,6 +119,9 @@ zinstall install:
@@ -119,6 +119,12 @@ zinstall install:
%.dtb: scripts
$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+%.dtbo: | scripts
+ $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+
+%.scr: | scripts
+ $(Q)$(MAKE) $(build)=$(boot)/dts ARCH=$(ARCH) $(boot)/dts/$@
+
PHONY += dtbs dtbs_install
@ -40,48 +47,57 @@ diff --git a/arch/arm64/boot/dts/.gitignore b/arch/arm64/boot/dts/.gitignore
index b60ed208..5d65b54b 100644
--- a/arch/arm64/boot/dts/.gitignore
+++ b/arch/arm64/boot/dts/.gitignore
@@ -1 +1 @@
@@ -1 +1,2 @@
-*.dtb
+*.dtb*
+*.scr
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index a1be75d0..ad8dc1c9 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -27,6 +27,7 @@ ifeq ("$(dtbinst-root)", "$(obj)")
@@ -27,6 +27,9 @@ ifeq ("$(dtbinst-root)", "$(obj)")
endif
dtbinst-files := $(dtb-y)
+dtboinst-files := $(dtbo-y)
+script-files := $(scr-y)
+readme-files := $(dtbotxt-y)
dtbinst-dirs := $(dts-dirs)
# Helper targets for Installing DTBs into the boot directory
@@ -35,15 +36,18 @@ quiet_cmd_dtb_install = INSTALL $<
@@ -35,15 +38,24 @@ quiet_cmd_dtb_install = INSTALL $<
install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj))
-$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep
+$(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs): | __dtbs_install_prep
+$(dtbinst-files) $(dtboinst-files) $(readme-files) $(script-files) $(dtbinst-dirs): | __dtbs_install_prep
$(dtbinst-files): %.dtb: $(obj)/%.dtb
$(call cmd,dtb_install,$(install-dir))
+$(dtboinst-files): %.dtbo: $(obj)/%.dtbo
+ $(call cmd,dtb_install,$(install-dir))
+
+$(script-files): %.scr: $(obj)/%.scr
+ $(call cmd,dtb_install,$(install-dir))
+
+$(readme-files): %: $(src)/%
+ $(call cmd,dtb_install,$(install-dir))
+
$(dtbinst-dirs):
$(Q)$(MAKE) $(dtbinst)=$(obj)/$@
-PHONY += $(dtbinst-files) $(dtbinst-dirs)
-__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
+PHONY += $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
+__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
+PHONY += $(dtbinst-files) $(dtboinst-files) $(script-files) $(readme-files) $(dtbinst-dirs)
+__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(script-files) $(readme-files) $(dtbinst-dirs)
.PHONY: $(PHONY)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0a07f901..5ccd3490 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -312,6 +312,17 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
@@ -312,6 +312,23 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)
@ -95,6 +111,12 @@ index 0a07f901..5ccd3490 100644
+
+$(obj)/%.dtbo: $(src)/%.dts FORCE
+ $(call if_changed_dep,dtco)
+
+quiet_cmd_scr = MKIMAGE $@
+cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
+
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE
+ $(call if_changed,scr)
+
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)