notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

How to use DT overlays in mainline?

Tue May 09, 2017 10:47 am

I need to test drivers in mainline and would like to have overlays working there.
What bits are necessary to make that work?
I don't need dynamic loading, only the bootloader magic.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2576
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: How to use DT overlays in mainline?

Tue May 09, 2017 10:55 am

I haven't tried it, but the only requirements ought to be that the base DTB is built with symbols enabled (use the "[email protected]" option on the dtc command line) and that the overlays don't reference symbols that aren't present.

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: How to use DT overlays in mainline?

Tue May 09, 2017 3:03 pm

Thanks Phil, that worked.

Code: Select all

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0118084..fbf9cc0 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1017,3 +1017,5 @@ dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dts

 always         := $(dtb-y)
 clean-files    := *.dtb
+
+DTC_FLAGS ?= [email protected] -H epapr
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index a3106aa..e3d382a 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -358,7 +358,7 @@
                        status = "disabled";
                };

-               spi: [email protected] {
+               spi0: [email protected] {
                        compatible = "brcm,bcm2835-spi";
                        reg = <0x7e204000 0x1000>;
                        interrupts = <2 22>;

Return to “Device Tree”