1 U-Boot FDT Overlay usage
2 =============================================
7 Overlays require slightly different syntax compared to traditional overlays.
8 Please refer to dt-object-internal.txt in the dtc sources for information
9 regarding the internal format of overlays:
10 https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tree/Documentation/dt-object-internal.txt
15 In a nutshell overlays provides a means to manipulate a symbol a previous dtb
16 or overlay has defined. It requires both the base and all the overlays
17 to be compiled with the -@ command line switch so that symbol information is
20 Note support for -@ option can only be found in dtc version 1.4.4 or newer.
21 Only version 4.14 or higher of the Linux kernel includes a built in version
22 of dtc that meets this requirement.
24 Building an overlay follows the same process as building a traditional dtb.
38 $ dtc -@ -I dts -O dtb -o base.dtb base.dts
57 $ dtc -@ -I dts -O dtb -o bar.dtb bar.dts
59 Ways to Utilize Overlays in U-boot
60 ----------------------------------
62 There are two ways to apply overlays in U-boot.
63 1. Include and define overlays within a FIT image and have overlays
64 automatically applied.
66 2. Manually load and apply overlays
68 The remainder of this document will discuss using overlays via the manual
69 approach. For information on using overlays as part of a FIT image please see:
70 doc/uImage.FIT/overlay-fdt-boot.txt
72 Manually Loading and Applying Overlays
73 --------------------------------------
75 1. Figure out where to place both the base device tree blob and the
76 overlay. Make sure you have enough space to grow the base tree without
79 => setenv fdtaddr 0x87f00000
80 => setenv fdtovaddr 0x87fc0000
82 2. Load the base blob and overlay blobs
84 => load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/base.dtb
85 => load ${devtype} ${bootpart} ${fdtovaddr} ${bootdir}/overlay.dtb
87 3. Set it as the working fdt tree.
91 4. Grow it enough so it can 'fit' all the applied overlays
95 5. You are now ready to apply the overlay.
97 => fdt apply $fdtovaddr
99 6. Boot system like you would do with a traditional dtb.
103 => bootm ${kerneladdr} - ${fdtaddr}
107 => bootz ${kerneladdr} - ${fdtaddr}
109 Please note that in case of an error, both the base and overlays are going
110 to be invalidated, so keep copies to avoid reloading.
113 pantelis.antoniou@konsulko.com