5 config SUPPORT_OF_CONTROL
19 menu "Device Tree Control"
20 depends on SUPPORT_OF_CONTROL
23 bool "Run-time configuration via Device Tree"
27 This feature provides for run-time configuration of U-Boot
28 via a flattened device tree.
33 Indicates that a real devicetree is available which can be accessed
34 at runtime. This means that dev_read_...() functions can be used to
35 read data from the devicetree for each device. This is true if
36 OF_CONTROL is enabled in U-Boot proper.
39 bool "Board-specific manipulation of Device Tree"
41 In certain circumstances it is necessary to be able to modify
42 U-Boot's device tree (e.g. to delete device from it). This option
43 make the Device Tree writeable and provides a board-specific
44 "board_fix_fdt" callback (called during pre-relocation time), which
45 enables the board initialization to modifiy the Device Tree. The
46 modified copy is subsequently used by U-Boot after relocation.
49 bool "Enable run-time configuration via Device Tree in SPL"
50 depends on SPL && OF_CONTROL
51 select SPL_OF_LIBFDT if !SPL_OF_PLATDATA
52 select SPL_OF_REAL if !SPL_OF_PLATDATA
54 Some boards use device tree in U-Boot but only have 4KB of SRAM
55 which is not enough to support device tree. Disable this option to
56 allow such boards to be supported by U-Boot SPL.
59 bool "Enable run-time configuration via Device Tree in TPL"
60 depends on TPL && OF_CONTROL
61 select TPL_OF_LIBFDT if !TPL_OF_PLATDATA
62 select TPL_OF_REAL if !TPL_OF_PLATDATA
64 Some boards use device tree in U-Boot but only have 4KB of SRAM
65 which is not enough to support device tree. Enable this option to
66 allow such boards to be supported by U-Boot TPL.
69 bool "Enable run-time configuration via Device Tree in VPL"
70 depends on VPL && OF_CONTROL
71 default y if SPL_OF_CONTROL
73 Some boards use device tree in U-Boot but only have 4KB of SRAM
74 which is not enough to support device tree. Enable this option to
75 allow such boards to be supported by U-Boot VPL.
78 bool "Enable use of a live tree"
79 depends on DM && OF_CONTROL
81 Normally U-Boot uses a flat device tree which saves space and
82 avoids the need to unpack the tree before use. However a flat
83 tree does not support modification from within U-Boot since it
84 can invalidate driver-model device tree offsets. This option
85 enables a live tree which is available after relocation,
86 and can be adjusted as needed.
89 prompt "Provider of DTB for DT control"
93 bool "Separate DTB for DT control"
95 If this option is enabled, the device tree will be built and
96 placed as a separate u-boot.dtb file alongside the U-Boot image.
99 bool "Embedded DTB for DT control"
101 If this option is enabled, the device tree will be picked up and
102 built into the U-Boot image. This is suitable for local debugging
103 and development only and is not recommended for production devices.
104 Boards in the mainline U-Boot tree should not use it.
109 bool "Provided by the board (e.g a previous loader) at runtime"
110 default y if SANDBOX || OF_HAS_PRIOR_STAGE
112 If this option is enabled, the device tree is provided at runtime by
113 a custom function called board_fdt_blob_setup(). The board must
114 implement this function if it wishes to provide special behaviour.
116 With this option, the device tree build by U-Boot may be overridden or
117 ignored. See OF_HAS_PRIOR_STAGE.
119 Note: Boards which use this to handle a device tree passed from an
120 earlier stage should enable OF_HAS_PRIOR_STAGE.
122 config OF_HAS_PRIOR_STAGE
125 Indicates that a prior stage of the firmware (before U-Boot proper)
126 makes use of device tree and this board normally boots with that prior
127 stage, that provides a devicetree to U-Boot.
129 This means that the device tree built in U-Boot should not be packaged
130 in the firmware image. Instead, the prior stage's device tree should
131 be so packaged. At runtime, the prior stage reads this, does any
132 necessary fix-ups, then passes it to U-Boot. See OF_BOARD.
134 This option does not preclude using the U-Boot device tree, e.g. for
135 development purposes, but it is not recommended, and likely will not
136 even work, for production systems.
138 Note: This option must be set in Kconfig and cannot be enabled or
139 disabled in the board's defconfig file.
142 bool "Omit the device tree output when building"
143 default y if OF_HAS_PRIOR_STAGE && !BINMAN
145 As a special case, avoid writing a device tree file u-boot.dtb when
146 building. Also don't include that file in u-boot.bin
148 This is used for boards which normally provide a devicetree via a
149 runtime mechanism (such as OF_BOARD), to avoid confusion.
151 config DEFAULT_DEVICE_TREE
152 string "Default Device Tree for DT control"
153 depends on OF_CONTROL
155 This option specifies the default Device Tree used for DT control.
156 It can be overridden from the command line:
157 $ make DEVICE_TREE=<device-tree-name>
159 config DEVICE_TREE_INCLUDES
160 string "Extra .dtsi files to include when building DT control"
161 depends on OF_CONTROL
163 U-Boot's control .dtb is usually built from an in-tree .dts
164 file, plus (if available) an in-tree U-Boot-specific .dtsi
165 file. This option specifies a space-separated list of extra
166 .dtsi files that will also be used.
169 string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT
170 depends on OF_CONTROL
171 default DEFAULT_DEVICE_TREE
173 This option specifies a list of device tree files to use for DT
174 control. These will be packaged into a FIT. At run-time, U-boot
175 or SPL will select the correct DT to use by examining the
176 hardware (e.g. reading a board ID value). This is a list of
177 device tree files (without the directory or .dtb suffix)
178 separated by <space>.
180 config OF_OVERLAY_LIST
181 string "List of device tree overlays to include for DT control"
182 depends on SPL_LOAD_FIT_APPLY_OVERLAY
184 This option specifies a list of device tree overlays to use for DT
185 control. This option can then be used by a FIT generator to include
186 the overlays in the FIT image.
189 prompt "OF LIST compression"
190 depends on MULTI_DTB_FIT
191 default MULTI_DTB_FIT_NO_COMPRESSION
193 config MULTI_DTB_FIT_LZO
195 depends on SYS_MALLOC_F
198 Compress the FIT image containing the DTBs available for the SPL
199 using LZO compression. (requires lzop on host).
201 config MULTI_DTB_FIT_GZIP
203 depends on SYS_MALLOC_F
206 Compress the FIT image containing the DTBs available for the SPL
207 using GZIP compression. (requires gzip on host)
209 config MULTI_DTB_FIT_NO_COMPRESSION
210 bool "No compression"
212 Do not compress the FIT image containing the DTBs available for the SPL.
213 Use this options only if LZO is not available and the DTBs are very small.
217 prompt "Location of uncompressed DTBs"
218 depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
219 default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
221 config MULTI_DTB_FIT_DYN_ALLOC
222 bool "Dynamically allocate the memory"
223 depends on SYS_MALLOC_F
225 config MULTI_DTB_FIT_USER_DEFINED_AREA
226 bool "User-defined location"
229 config MULTI_DTB_FIT_UNCOMPRESS_SZ
230 hex "Size of memory reserved to uncompress the DTBs"
233 This is the size of this area where the DTBs are uncompressed.
234 If this area is dynamically allocated, make sure that
235 SYS_MALLOC_F_LEN is big enough to contain it.
237 config MULTI_DTB_FIT_USER_DEF_ADDR
238 hex "Address of memory where dtbs are uncompressed"
239 depends on MULTI_DTB_FIT_USER_DEFINED_AREA
241 the FIT image containing the DTBs is uncompressed in an area defined
242 at compilation time. This is the address of this area. It must be
243 aligned on 2-byte boundary.
246 bool "Support swapping dtbs at a later point in boot"
247 depends on MULTI_DTB_FIT
249 It is possible during initial boot you may need to use a generic
250 dtb until you can fully determine the board your running on. This
251 config allows boards to implement a function at a later point
252 during boot to switch to the "correct" dtb.
255 bool "Support embedding several DTBs in a FIT image for u-boot"
257 This option provides hooks to allow U-boot to parse an
258 appended FIT image and enable board specific code to then select
259 the correct DTB to be used. Use this if you need to support
260 multiple DTBs but don't use the SPL.
263 config SPL_MULTI_DTB_FIT
264 depends on SPL_LOAD_FIT && SPL_OF_REAL
265 bool "Support embedding several DTBs in a FIT image for the SPL"
267 This option provides the SPL with the ability to select its own
268 DTB at runtime from an appended FIT image containing several DTBs.
269 This allows using the same SPL binary on multiple platforms.
270 The primary purpose is to handle different versions of
271 the same platform without tweaking the platform code if the
272 differences can be expressed in the DTBs (common examples are: bus
273 capabilities, pad configurations).
276 string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT
277 depends on SPL_OF_CONTROL
280 This option specifies a list of device tree files to use for DT
281 control in the SPL. These will be packaged into a FIT. At run-time,
282 the SPL will select the correct DT to use by examining the
283 hardware (e.g. reading a board ID value). This is a list of
284 device tree files (without the directory or .dtb suffix)
285 separated by <space>.
288 prompt "SPL OF LIST compression"
289 depends on SPL_MULTI_DTB_FIT
290 default SPL_MULTI_DTB_FIT_LZO
292 config SPL_MULTI_DTB_FIT_LZO
294 depends on SYS_MALLOC_F
297 Compress the FIT image containing the DTBs available for the SPL
298 using LZO compression. (requires lzop on host).
300 config SPL_MULTI_DTB_FIT_GZIP
302 depends on SYS_MALLOC_F
305 Compress the FIT image containing the DTBs available for the SPL
306 using GZIP compression. (requires gzip on host)
308 config SPL_MULTI_DTB_FIT_NO_COMPRESSION
309 bool "No compression"
311 Do not compress the FIT image containing the DTBs available for the SPL.
312 Use this options only if LZO is not available and the DTBs are very small.
316 prompt "Location of uncompressed DTBs"
317 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
318 default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
320 config SPL_MULTI_DTB_FIT_DYN_ALLOC
321 bool "Dynamically allocate the memory"
322 depends on SYS_MALLOC_F
324 config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
325 bool "User-defined location"
328 config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
329 hex "Size of memory reserved to uncompress the DTBs"
330 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
333 This is the size of this area where the DTBs are uncompressed.
334 If this area is dynamically allocated, make sure that
335 SPL_SYS_MALLOC_F_LEN is big enough to contain it.
337 config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
338 hex "Address of memory where dtbs are uncompressed"
339 depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
341 the FIT image containing the DTBs is uncompressed in an area defined
342 at compilation time. This is the address of this area. It must be
343 aligned on 2-byte boundary.
345 config OF_SPL_REMOVE_PROPS
346 string "List of device tree properties to drop for SPL"
347 depends on SPL_OF_CONTROL
348 default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
349 default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
350 default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
351 default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
353 Since SPL normally runs in a reduced memory space, the device tree
354 is cut down to only what is needed to load and start U-Boot. Only
355 nodes marked with the property "u-boot,dm-pre-reloc" will be
356 included. In addition, some properties are not used by U-Boot and
357 can be discarded. This option defines the list of properties to
360 config OF_DTB_PROPS_REMOVE
361 bool "Enable removal of device tree properties"
362 depends on OF_CONTROL
364 Some boards have restricted amount of storage for U-Boot image.
365 If the generated binary doesn't fit into available image storage,
366 the built-in device tree could probably be cut down by removing
367 some not required device tree properties to reduce the image size.
368 Enable this option and define the properties to be removed in the
369 CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
370 pass the built-in DTB directly to the kernel!
372 config OF_REMOVE_PROPS
373 string "List of device tree properties to drop"
374 depends on OF_DTB_PROPS_REMOVE
375 default "interrupt-parent interrupts" if PINCTRL
377 Some properties are not used by U-Boot and can be discarded.
378 This option defines the list of properties to discard.
380 config SPL_OF_PLATDATA
381 bool "Generate platform data for use in SPL"
382 depends on SPL_OF_CONTROL
384 select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST
386 For very constrained SPL environments the overhead of decoding
387 device tree nodes and converting their contents into platform data
388 is too large. This overhead includes libfdt code as well as the
389 device tree contents itself. The latter is fairly compact, but the
390 former can add 3KB or more to a Thumb 2 Image.
392 This option enables generation of platform data from the device
393 tree as C code. This code creates devices using U_BOOT_DRVINFO()
394 declarations. The benefit is that it allows driver code to access
395 the platform data directly in C structures, avoidin the libfdt
398 This option works by generating C structure declarations for each
399 compatible string, then adding platform data and U_BOOT_DRVINFO
400 declarations for each node. See of-plat.txt for more information.
405 Indicates that a real devicetree is available which can be accessed
406 at runtime. This means that dev_read_...() functions can be used to
407 read data from the devicetree for each device. This is true if
408 SPL_OF_CONTROL is enabled and not SPL_OF_PLATDATA
412 config SPL_OF_PLATDATA_PARENT
413 bool "Support parent information in devices"
416 Generally it is useful to be able to access the parent of a device
417 with of-platdata. To save space this can be disabled, but in that
418 case dev_get_parent() will always return NULL;
420 config SPL_OF_PLATDATA_INST
421 bool "Declare devices at build time"
423 Declare devices as udevice instances so that they do not need to be
424 bound when U-Boot starts. This can save time and code space.
426 config SPL_OF_PLATDATA_NO_BIND
427 bool "Don't allow run-time binding of devices"
428 depends on SPL_OF_PLATDATA_INST
431 This removes the ability to bind devices at run time, thus saving
432 some code space in U-Boot. This can be disabled if binding is needed,
433 at the code of some code size increase.
435 config SPL_OF_PLATDATA_RT
436 bool "Use a separate struct for device runtime data"
437 depends on SPL_OF_PLATDATA_INST
440 For systems running SPL from read-only memory it is convenient to
441 separate out the runtime information, so that the devices don't need
442 to be copied before being used. This moves the read-write parts of
443 struct udevice (at present just the flags) into a separate struct,
444 which is allocated at runtime.
446 config SPL_OF_PLATDATA_DRIVER_RT
449 Use a separate struct for driver runtime data.
451 This enables the driver_rt information, used with of-platdata when
452 of-platdata-inst is not used. It allows finding devices by their
460 Indicates that a real devicetree is available which can be accessed
461 at runtime. This means that dev_read_...() functions can be used to
462 read data from the devicetree for each device. This is true if
463 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
465 config TPL_OF_PLATDATA
466 bool "Generate platform data for use in TPL"
467 depends on TPL_OF_CONTROL
469 select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST
471 For very constrained SPL environments the overhead of decoding
472 device tree nodes and converting their contents into platform data
473 is too large. This overhead includes libfdt code as well as the
474 device tree contents itself. The latter is fairly compact, but the
475 former can add 3KB or more to a Thumb 2 Image.
477 This option enables generation of platform data from the device
478 tree as C code. This code creates devices using U_BOOT_DRVINFO()
479 declarations. The benefit is that it allows driver code to access
480 the platform data directly in C structures, avoidin the libfdt
483 This option works by generating C structure declarations for each
484 compatible string, then adding platform data and U_BOOT_DRVINFO
485 declarations for each node. See of-plat.txt for more information.
489 config TPL_OF_PLATDATA_PARENT
490 bool "Support parent information in devices"
493 Generally it is useful to be able to access the parent of a device
494 with of-platdata. To save space this can be disabled, but in that
495 case dev_get_parent() will always return NULL;
497 config TPL_OF_PLATDATA_INST
498 bool "Declare devices at build time"
501 Declare devices as udevice instances so that they do not need to be
502 bound when U-Boot starts. This can save time and code space.
504 config TPL_OF_PLATDATA_NO_BIND
505 bool "Don't allow run-time binding of devices"
506 depends on TPL_OF_PLATDATA_INST
509 This removes the ability to bind devices at run time, thus saving
510 some code space in U-Boot. This can be disabled if binding is needed,
511 at the code of some code size increase.
513 config TPL_OF_PLATDATA_RT
514 bool "Use a separate struct for device runtime data"
515 depends on TPL_OF_PLATDATA_INST
518 For systems running TPL from read-only memory it is convenient to
519 separate out the runtime information, so that the devices don't need
520 to be copied before being used. This moves the read-write parts of
521 struct udevice (at present just the flags) into a separate struct,
522 which is allocated at runtime.
524 config TPL_OF_PLATDATA_DRIVER_RT
527 Use a separate struct for driver runtime data.
529 This enables the driver_rt information, used with of-platdata when
530 of-platdata-inst is not used. It allows finding devices by their
539 Indicates that a real devicetree is available which can be accessed
540 at runtime. This means that dev_read_...() functions can be used to
541 read data from the devicetree for each device. This is true if
542 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA