Skip to content

Commit 56fc703

Browse files
fcoopertisjg20
authored andcommitted
doc: overlays: Tweak documentation regarding overlays
Pull some information regarding overlays from commit messages and put them directly within the documentation. Also add some information regarding required dtc version to properly use overlays. Signed-off-by: Franklin S Cooper Jr <[email protected]> Acked-by: Simon Glass <[email protected]>
1 parent d80162c commit 56fc703

File tree

2 files changed

+87
-6
lines changed

2 files changed

+87
-6
lines changed

doc/README.fdt-overlays

+81-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,76 @@
1-
U-Boot FDT Overlay usage (without FIT images)
1+
U-Boot FDT Overlay usage
22
=============================================
33

4-
FDT overlays are now available for use even without FIT images.
5-
It is not as automagic as with FIT images though and require a few
6-
manual steps.
4+
Overlays Syntax
5+
---------------
6+
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
11+
12+
Building Overlays
13+
-----------------
14+
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
18+
included.
19+
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.
23+
24+
Building an overlay follows the same process as building a traditional dtb.
25+
26+
For example:
27+
28+
base.dts
29+
--------
30+
31+
/dts-v1/;
32+
/ {
33+
foo: foonode {
34+
foo-property;
35+
};
36+
};
37+
38+
$ dtc -@ -I dts -O dtb -o base.dtb base.dts
39+
40+
bar.dts
41+
-------
42+
43+
/dts-v1/;
44+
/plugin/;
45+
/ {
46+
fragment@1 {
47+
target = <&foo>;
48+
__overlay__ {
49+
overlay-1-property;
50+
bar: barnode {
51+
bar-property;
52+
};
53+
};
54+
};
55+
};
56+
57+
$ dtc -@ -I dts -O dtb -o bar.dtb bar.dts
58+
59+
Ways to Utilize Overlays in U-boot
60+
----------------------------------
61+
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.
65+
66+
2. Manually load and apply overlays
67+
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
71+
72+
Manually Loading and Applying Overlays
73+
--------------------------------------
774

875
1. Figure out where to place both the base device tree blob and the
976
overlay. Make sure you have enough space to grow the base tree without
@@ -29,6 +96,16 @@ overlapping anything.
2996

3097
=> fdt apply $fdtovaddr
3198

99+
6. Boot system like you would do with a traditional dtb.
100+
101+
For bootm:
102+
103+
=> bootm ${kerneladdr} - ${fdtaddr}
104+
105+
For bootz:
106+
107+
=> bootz ${kerneladdr} - ${fdtaddr}
108+
32109
Please note that in case of an error, both the base and overlays are going
33110
to be invalidated, so keep copies to avoid reloading.
34111

doc/uImage.FIT/overlay-fdt-boot.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
U-Boot FDT Overlay usage
2-
========================
1+
U-Boot FDT Overlay FIT usage
2+
============================
33

44
Introduction
55
------------
@@ -8,6 +8,10 @@ of similar boards and their expansion options. The same kernel on DT enabled
88
platforms can support this easily enough by providing a DT blob upon boot
99
that matches the desired configuration.
1010

11+
This document focuses on specifically using overlays as part of a FIT image.
12+
General information regarding overlays including its syntax and building it
13+
can be found in doc/README.fdt-overlays
14+
1115
Configuration without overlays
1216
------------------------------
1317

0 commit comments

Comments
 (0)