blob: a1a92f2bbd4144bf708a73a677d95bb995e79822 [file] [log] [blame]
Masahiro Yamada9fadbc82014-09-22 19:59:05 +09001#
2# Device Tree Control
3#
Masahiro Yamada9fadbc82014-09-22 19:59:05 +09004
5config SUPPORT_OF_CONTROL
6 bool
7
Tom Rini61d0fac2017-09-23 13:00:57 -04008config DTC
9 bool
10
Masahiro Yamada87247af2017-10-17 13:42:44 +090011config PYLIBFDT
12 bool
13
14config DTOC
15 bool
16 select PYLIBFDT
17
18config BINMAN
19 bool
20 select DTOC
21
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090022menu "Device Tree Control"
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090023 depends on SUPPORT_OF_CONTROL
24
25config OF_CONTROL
26 bool "Run-time configuration via Device Tree"
Tom Rini61d0fac2017-09-23 13:00:57 -040027 select DTC
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090028 help
29 This feature provides for run-time configuration of U-Boot
30 via a flattened device tree.
31
mario.six@gdsys.cc7e9b9d62017-02-22 16:07:22 +010032config OF_BOARD_FIXUP
33 bool "Board-specific manipulation of Device Tree"
34 help
35 In certain circumstances it is necessary to be able to modify
36 U-Boot's device tree (e.g. to delete device from it). This option
37 make the Device Tree writeable and provides a board-specific
38 "board_fix_fdt" callback (called during pre-relocation time), which
39 enables the board initialization to modifiy the Device Tree. The
40 modified copy is subsequently used by U-Boot after relocation.
41
Masahiro Yamada1e35f392015-08-12 07:31:54 +090042config SPL_OF_CONTROL
43 bool "Enable run-time configuration via Device Tree in SPL"
44 depends on SPL && OF_CONTROL
Simon Glass400d0402015-02-27 22:06:38 -070045 help
46 Some boards use device tree in U-Boot but only have 4KB of SRAM
47 which is not enough to support device tree. Enable this option to
48 allow such boards to be supported by U-Boot SPL.
49
Philipp Tomsich2341dc62017-06-29 11:11:21 +020050config TPL_OF_CONTROL
51 bool "Enable run-time configuration via Device Tree in TPL"
52 depends on TPL && OF_CONTROL
53 help
54 Some boards use device tree in U-Boot but only have 4KB of SRAM
55 which is not enough to support device tree. Enable this option to
56 allow such boards to be supported by U-Boot TPL.
57
Simon Glassa6eedb82017-05-18 20:08:53 -060058config OF_LIVE
59 bool "Enable use of a live tree"
60 depends on OF_CONTROL
61 help
62 Normally U-Boot uses a flat device tree which saves space and
63 avoids the need to unpack the tree before use. However a flat
64 tree does not support modifcation from within U-Boot since it
65 can invalidate driver-model device tree offsets. This option
66 enables a live tree which is available after relocation,
67 and can be adjusted as needed.
68
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090069choice
70 prompt "Provider of DTB for DT control"
71 depends on OF_CONTROL
72
73config OF_SEPARATE
74 bool "Separate DTB for DT control"
75 depends on !SANDBOX
76 help
77 If this option is enabled, the device tree will be built and
78 placed as a separate u-boot.dtb file alongside the U-Boot image.
79
80config OF_EMBED
81 bool "Embedded DTB for DT control"
82 help
83 If this option is enabled, the device tree will be picked up and
Simon Glassd9b64ea2015-08-31 18:47:52 -060084 built into the U-Boot image. This is suitable for local debugging
85 and development only and is not recommended for production devices.
86 Boards in the mainline U-Boot tree should not use it.
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090087
Alex Deymo5b661ec2017-04-02 01:25:20 -070088config OF_BOARD
89 bool "Provided by the board at runtime"
90 depends on !SANDBOX
91 help
92 If this option is enabled, the device tree will be provided by
93 the board at runtime if the board supports it, instead of being
94 bundled with the image.
95
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090096config OF_HOSTFILE
97 bool "Host filed DTB for DT control"
98 depends on SANDBOX
99 help
100 If this option is enabled, DTB will be read from a file on startup.
101 This is only useful for Sandbox. Use the -d flag to U-Boot to
102 specify the file to read.
103
Thomas Fitzsimmons919646d2018-06-08 17:59:45 -0400104config OF_PRIOR_STAGE
105 bool "Prior stage bootloader DTB for DT control"
106 help
107 If this option is enabled, the device tree used for DT
108 control will be read from a device tree binary, at a memory
109 location passed to U-Boot by the prior stage bootloader.
110
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900111endchoice
112
Masahiro Yamada8c65b9d2014-09-22 19:59:06 +0900113config DEFAULT_DEVICE_TREE
114 string "Default Device Tree for DT control"
Simon Glass644f5bc2016-02-22 22:55:44 -0700115 depends on OF_CONTROL
Masahiro Yamada8c65b9d2014-09-22 19:59:06 +0900116 help
117 This option specifies the default Device Tree used for DT control.
Robert P. J. Dayeb61df52014-10-21 16:44:32 -0400118 It can be overridden from the command line:
Masahiro Yamada8c65b9d2014-09-22 19:59:06 +0900119 $ make DEVICE_TREE=<device-tree-name>
120
Simon Glass963817b2016-02-22 22:55:57 -0700121config OF_LIST
122 string "List of device tree files to include for DT control"
Jean-Jacques Hiblot2037fa42017-09-15 12:57:24 +0200123 depends on SPL_LOAD_FIT || MULTI_DTB_FIT
Michal Simek9b2e95a2016-05-04 15:14:11 +0200124 default DEFAULT_DEVICE_TREE
Simon Glass963817b2016-02-22 22:55:57 -0700125 help
126 This option specifies a list of device tree files to use for DT
Cooper Jr., Franklin06c7b622017-06-16 17:25:09 -0500127 control. These will be packaged into a FIT. At run-time, U-boot
128 or SPL will select the correct DT to use by examining the
129 hardware (e.g. reading a board ID value). This is a list of
130 device tree files (without the directory or .dtb suffix)
131 separated by <space>.
Simon Glass963817b2016-02-22 22:55:57 -0700132
Jean-Jacques Hiblot2037fa42017-09-15 12:57:24 +0200133
134config DTB_RESELECT
135 bool "Support swapping dtbs at a later point in boot"
136 depends on MULTI_DTB_FIT
137 help
138 It is possible during initial boot you may need to use a generic
139 dtb until you can fully determine the board your running on. This
140 config allows boards to implement a function at a later point
141 during boot to switch to the "correct" dtb.
142
143config MULTI_DTB_FIT
144 bool "Support embedding several DTBs in a FIT image for u-boot"
145 help
146 This option provides hooks to allow U-boot to parse an
147 appended FIT image and enable board specific code to then select
148 the correct DTB to be used. Use this if you need to support
149 multiple DTBs but don't use the SPL.
150
Jean-Jacques Hiblota2fee162017-09-15 12:57:32 +0200151
152config SPL_MULTI_DTB_FIT
153 depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA
154 bool "Support embedding several DTBs in a FIT image for the SPL"
155 help
156 This option provides the SPL with the ability to select its own
157 DTB at runtime from an appended FIT image containing several DTBs.
158 This allows using the same SPL binary on multiple platforms.
159 The primary purpose is to handle different versions of
160 the same platform without tweaking the platform code if the
161 differences can be expressed in the DTBs (common examples are: bus
162 capabilities, pad configurations).
163
164config SPL_OF_LIST
165 string "List of device tree files to include for DT control in SPL"
166 depends on SPL_MULTI_DTB_FIT
167 default OF_LIST
168 help
169 This option specifies a list of device tree files to use for DT
170 control in the SPL. These will be packaged into a FIT. At run-time,
171 the SPL will select the correct DT to use by examining the
172 hardware (e.g. reading a board ID value). This is a list of
173 device tree files (without the directory or .dtb suffix)
174 separated by <space>.
175
176choice
177 prompt "SPL OF LIST compression"
178 depends on SPL_MULTI_DTB_FIT
179 default SPL_MULTI_DTB_FIT_LZO
180
181config SPL_MULTI_DTB_FIT_LZO
182 bool "LZO"
183 depends on SYS_MALLOC_F
184 select SPL_LZO
185 help
186 Compress the FIT image containing the DTBs available for the SPL
187 using LZO compression. (requires lzop on host).
188
189config SPL_MULTI_DTB_FIT_GZIP
190 bool "GZIP"
191 depends on SYS_MALLOC_F
192 select SPL_GZIP
193 help
194 Compress the FIT image containing the DTBs available for the SPL
195 using GZIP compression. (requires gzip on host)
196
197config SPL_MULTI_DTB_FIT_NO_COMPRESSION
198 bool "No compression"
199 help
200 Do not compress the FIT image containing the DTBs available for the SPL.
201 Use this options only if LZO is not available and the DTBs are very small.
202endchoice
203
204choice
205 prompt "Location of uncompressed DTBs "
206 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
207 default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
208
209config SPL_MULTI_DTB_FIT_DYN_ALLOC
210 bool "Dynamically allocate the memory"
211 depends on SYS_MALLOC_F
212
213config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
214 bool "User-defined location"
215endchoice
216
217config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
218 hex "Size of memory reserved to uncompress the DTBs"
219 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
220 default 0x8000
221 help
222 This is the size of this area where the DTBs are uncompressed.
223 If this area is dynamically allocated, make sure that
224 SPL_SYS_MALLOC_F_LEN is big enough to contain it.
225
226config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
227 hex "Address of memory where dtbs are uncompressed"
228 depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
229 help
230 the FIT image containing the DTBs is uncompressed in an area defined
231 at compilation time. This is the address of this area. It must be
232 aligned on 2-byte boundary.
233
Simon Glass89caf332015-06-23 15:38:29 -0600234config OF_SPL_REMOVE_PROPS
235 string "List of device tree properties to drop for SPL"
Masahiro Yamadaddb9aa972015-08-28 20:28:42 +0900236 depends on SPL_OF_CONTROL
Vikas Manochab6cca7d2017-03-24 14:47:44 -0700237 default "interrupt-parent" if SPL_PINCTRL && SPL_CLK
238 default "clocks clock-names interrupt-parent" if SPL_PINCTRL
Masahiro Yamadaf03811c2016-02-03 20:51:36 +0900239 default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK
Simon Glass89caf332015-06-23 15:38:29 -0600240 default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent"
241 help
242 Since SPL normally runs in a reduced memory space, the device tree
243 is cut down to only what is needed to load and start U-Boot. Only
244 nodes marked with the property "u-boot,dm-pre-reloc" will be
245 included. In addition, some properties are not used by U-Boot and
246 can be discarded. This option defines the list of properties to
247 discard.
248
Simon Glass7bc65f32016-07-04 11:58:06 -0600249config SPL_OF_PLATDATA
250 bool "Generate platform data for use in SPL"
251 depends on SPL_OF_CONTROL
Masahiro Yamada87247af2017-10-17 13:42:44 +0900252 select DTOC
Simon Glass7bc65f32016-07-04 11:58:06 -0600253 help
254 For very constrained SPL environments the overhead of decoding
255 device tree nodes and converting their contents into platform data
256 is too large. This overhead includes libfdt code as well as the
257 device tree contents itself. The latter is fairly compact, but the
258 former can add 3KB or more to a Thumb 2 Image.
259
260 This option enables generation of platform data from the device
261 tree as C code. This code creates devices using U_BOOT_DEVICE()
262 declarations. The benefit is that it allows driver code to access
263 the platform data directly in C structures, avoidin the libfdt
264 overhead.
265
266 This option works by generating C structure declarations for each
267 compatible string, then adding platform data and U_BOOT_DEVICE
268 declarations for each node. See README.platdata for more
269 information.
270
Philipp Tomsich2341dc62017-06-29 11:11:21 +0200271config TPL_OF_PLATDATA
272 bool "Generate platform data for use in TPL"
273 depends on TPL_OF_CONTROL
Masahiro Yamada87247af2017-10-17 13:42:44 +0900274 select DTOC
Philipp Tomsich2341dc62017-06-29 11:11:21 +0200275 help
276 For very constrained SPL environments the overhead of decoding
277 device tree nodes and converting their contents into platform data
278 is too large. This overhead includes libfdt code as well as the
279 device tree contents itself. The latter is fairly compact, but the
280 former can add 3KB or more to a Thumb 2 Image.
281
282 This option enables generation of platform data from the device
283 tree as C code. This code creates devices using U_BOOT_DEVICE()
284 declarations. The benefit is that it allows driver code to access
285 the platform data directly in C structures, avoidin the libfdt
286 overhead.
287
288 This option works by generating C structure declarations for each
289 compatible string, then adding platform data and U_BOOT_DEVICE
290 declarations for each node. See README.platdata for more
291 information.
292
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900293endmenu
Tom Rini0e17fc72017-09-23 23:14:33 -0400294
295config MKIMAGE_DTC_PATH
296 string "Path to dtc binary for use within mkimage"
297 default "dtc"
298 help
299 The mkimage host tool will, in order to generate FIT images make
300 calls to the dtc application in order to create the output. In
301 some cases the system dtc may not support all required features
302 and the path to a different version should be given here.