blob: 6a5141b56e97859b9abc9e3880837ed0e174991b [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
Masahiro Yamada87247af2017-10-17 13:42:44 +09008config PYLIBFDT
9 bool
10
11config DTOC
12 bool
13 select PYLIBFDT
14
15config BINMAN
16 bool
17 select DTOC
18
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090019menu "Device Tree Control"
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090020 depends on SUPPORT_OF_CONTROL
21
22config OF_CONTROL
23 bool "Run-time configuration via Device Tree"
Simon Glass1501a832023-02-01 13:20:27 -070024 select OF_LIBFDT
25 select OF_REAL
Masahiro Yamada9fadbc82014-09-22 19:59:05 +090026 help
27 This feature provides for run-time configuration of U-Boot
28 via a flattened device tree.
29
Simon Glass7c4ba162021-08-07 07:24:02 -060030config OF_REAL
Simon Glass3580f6d2021-08-07 07:24:03 -060031 bool
Simon Glass7c4ba162021-08-07 07:24:02 -060032 help
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.
37
mario.six@gdsys.cc7e9b9d62017-02-22 16:07:22 +010038config OF_BOARD_FIXUP
39 bool "Board-specific manipulation of Device Tree"
40 help
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.
47
Masahiro Yamada1e35f392015-08-12 07:31:54 +090048config SPL_OF_CONTROL
49 bool "Enable run-time configuration via Device Tree in SPL"
50 depends on SPL && OF_CONTROL
Sean Anderson08c854a2019-12-17 21:40:09 -050051 select SPL_OF_LIBFDT if !SPL_OF_PLATDATA
Simon Glass7c4ba162021-08-07 07:24:02 -060052 select SPL_OF_REAL if !SPL_OF_PLATDATA
Simon Glass400d0402015-02-27 22:06:38 -070053 help
54 Some boards use device tree in U-Boot but only have 4KB of SRAM
Walter Lozano7b3d2582019-10-22 11:50:19 -030055 which is not enough to support device tree. Disable this option to
Simon Glass400d0402015-02-27 22:06:38 -070056 allow such boards to be supported by U-Boot SPL.
57
Philipp Tomsich2341dc62017-06-29 11:11:21 +020058config TPL_OF_CONTROL
59 bool "Enable run-time configuration via Device Tree in TPL"
60 depends on TPL && OF_CONTROL
Sean Anderson08c854a2019-12-17 21:40:09 -050061 select TPL_OF_LIBFDT if !TPL_OF_PLATDATA
Simon Glass7c4ba162021-08-07 07:24:02 -060062 select TPL_OF_REAL if !TPL_OF_PLATDATA
Philipp Tomsich2341dc62017-06-29 11:11:21 +020063 help
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.
67
Simon Glasse7ca7da2022-04-30 00:56:53 -060068config VPL_OF_CONTROL
69 bool "Enable run-time configuration via Device Tree in VPL"
70 depends on VPL && OF_CONTROL
71 default y if SPL_OF_CONTROL
72 help
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.
76
Simon Glassa6eedb82017-05-18 20:08:53 -060077config OF_LIVE
78 bool "Enable use of a live tree"
Bin Meng85f737b2021-02-03 21:20:03 +080079 depends on DM && OF_CONTROL
Simon Glassa6eedb82017-05-18 20:08:53 -060080 help
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
Michal Simek97a0e492018-08-17 10:16:36 +020083 tree does not support modification from within U-Boot since it
Simon Glassa6eedb82017-05-18 20:08:53 -060084 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.
87
Sumit Gargf7e52842024-02-22 15:06:01 +053088config OF_UPSTREAM
89 bool "Enable use of devicetree imported from Linux kernel release"
90 help
91 Traditionally, U-Boot platforms used to have their custom devicetree
92 files or copy devicetree files from Linux kernel which are hard to
93 maintain and can usually get out-of-sync from Linux kernel. This
94 option enables platforms to migrate to devicetree-rebasing repo where
95 a regular sync will be maintained every major Linux kernel release
96 cycle. However, platforms can still have some custom u-boot specific
97 bits maintained as part of *-u-boot.dtsi files.
98
99 Note: This option should be set in Kconfig, for the SoC as a whole.
100 However, newer boards whose devicetree source files haven't landed in
101 the dts/upstream subtree, they can override this option to have the
102 DT build from existing U-Boot tree location instead.
103
Caleb Connolly90b7b392024-04-18 19:39:58 +0100104config OF_UPSTREAM_BUILD_VENDOR
105 bool "Build all devicetree files for a particular vendor"
106 depends on OF_UPSTREAM
107 help
108 Enable building all devicetree files for a particular vendor. This
109 is useful for generic U-Boot configurations where many boards can
110 be supported with a single binary.
111
112 This is only available for platforms using upstream devicetree.
113
114config OF_UPSTREAM_VENDOR
115 string "Vendor to build all upstream devicetree files for"
116 depends on OF_UPSTREAM_BUILD_VENDOR
117 default "qcom" if ARCH_SNAPDRAGON
118 default "rockchip" if ARCH_ROCKCHIP
119 default "amlogic" if ARCH_MESON
120 default "allwinner" if ARCH_SUNXI
121 default "mediatek" if ARCH_MEDIATEK
122 default "marvell" if ARCH_MVEBU || ARCH_KIRKWOOD
123 default "xilinx" if ARCH_VERSAL || ARCH_ZYNQ
124 default "nvidia" if ARCH_TEGRA
125 help
126 Select the vendor to build all devicetree files for.
127
Marek Vasutb5abbf82024-10-17 03:08:40 +0200128config OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS
129 bool "Build local DTBOs as fallback for DTBOs missing upstream"
130 default n
131 depends on OF_UPSTREAM
132 help
133 Enable building DTBOs from arch/$(ARCH)/dts as a fallback for
134 DTBOs which are not part of Linux kernel upstream yet. This is
135 a stopgap measure to expedite OF_UPSTREAM switch for platforms
136 which already have main DT in Linux kernel upstream, but still
137 have leftover DTBOs in U-Boot tree.
138
139 Do not use this option, upstream your DTs and DTBOs instead.
140 If the upstreaming is in progress, use with utmost caution.
141
142 If unsure, say N.
143
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900144choice
145 prompt "Provider of DTB for DT control"
146 depends on OF_CONTROL
147
148config OF_SEPARATE
149 bool "Separate DTB for DT control"
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900150 help
151 If this option is enabled, the device tree will be built and
152 placed as a separate u-boot.dtb file alongside the U-Boot image.
153
154config OF_EMBED
155 bool "Embedded DTB for DT control"
156 help
157 If this option is enabled, the device tree will be picked up and
Simon Glassd9b64ea2015-08-31 18:47:52 -0600158 built into the U-Boot image. This is suitable for local debugging
159 and development only and is not recommended for production devices.
160 Boards in the mainline U-Boot tree should not use it.
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900161
Simon Glass4cea97f2021-12-16 20:59:21 -0700162endchoice
163
Pali Rohár64a15c82024-06-06 18:33:21 +0200164config OF_INITIAL_DTB_READONLY
165 bool "Initial DTB for DT control is read-only"
166 help
167 If initial DTB for DT control is read-only (e.g. points to
168 memory-mapped flash memory), then set this option.
169
Alex Deymo5b661ec2017-04-02 01:25:20 -0700170config OF_BOARD
Ilias Apalodimasdc35df42021-10-12 00:00:13 +0300171 bool "Provided by the board (e.g a previous loader) at runtime"
Simon Glass37604392021-12-16 20:59:35 -0700172 default y if SANDBOX || OF_HAS_PRIOR_STAGE
Alex Deymo5b661ec2017-04-02 01:25:20 -0700173 help
Simon Glass37604392021-12-16 20:59:35 -0700174 If this option is enabled, the device tree is provided at runtime by
175 a custom function called board_fdt_blob_setup(). The board must
176 implement this function if it wishes to provide special behaviour.
177
178 With this option, the device tree build by U-Boot may be overridden or
179 ignored. See OF_HAS_PRIOR_STAGE.
180
181 Note: Boards which use this to handle a device tree passed from an
182 earlier stage should enable OF_HAS_PRIOR_STAGE.
183
184config OF_HAS_PRIOR_STAGE
185 bool
186 help
187 Indicates that a prior stage of the firmware (before U-Boot proper)
188 makes use of device tree and this board normally boots with that prior
189 stage, that provides a devicetree to U-Boot.
190
191 This means that the device tree built in U-Boot should not be packaged
192 in the firmware image. Instead, the prior stage's device tree should
193 be so packaged. At runtime, the prior stage reads this, does any
194 necessary fix-ups, then passes it to U-Boot. See OF_BOARD.
195
196 This option does not preclude using the U-Boot device tree, e.g. for
197 development purposes, but it is not recommended, and likely will not
198 even work, for production systems.
Alex Deymo5b661ec2017-04-02 01:25:20 -0700199
Simon Glass37604392021-12-16 20:59:35 -0700200 Note: This option must be set in Kconfig and cannot be enabled or
201 disabled in the board's defconfig file.
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900202
Simon Glass944f8d82021-12-16 20:59:38 -0700203config OF_OMIT_DTB
204 bool "Omit the device tree output when building"
205 default y if OF_HAS_PRIOR_STAGE && !BINMAN
206 help
207 As a special case, avoid writing a device tree file u-boot.dtb when
208 building. Also don't include that file in u-boot.bin
209
210 This is used for boards which normally provide a devicetree via a
211 runtime mechanism (such as OF_BOARD), to avoid confusion.
212
Masahiro Yamada8c65b9d2014-09-22 19:59:06 +0900213config DEFAULT_DEVICE_TREE
214 string "Default Device Tree for DT control"
Simon Glass644f5bc2016-02-22 22:55:44 -0700215 depends on OF_CONTROL
Masahiro Yamada8c65b9d2014-09-22 19:59:06 +0900216 help
217 This option specifies the default Device Tree used for DT control.
Robert P. J. Dayeb61df52014-10-21 16:44:32 -0400218 It can be overridden from the command line:
Masahiro Yamada8c65b9d2014-09-22 19:59:06 +0900219 $ make DEVICE_TREE=<device-tree-name>
220
Rasmus Villemoes303d98d2021-11-21 14:52:51 +0100221config DEVICE_TREE_INCLUDES
222 string "Extra .dtsi files to include when building DT control"
223 depends on OF_CONTROL
224 help
225 U-Boot's control .dtb is usually built from an in-tree .dts
226 file, plus (if available) an in-tree U-Boot-specific .dtsi
227 file. This option specifies a space-separated list of extra
228 .dtsi files that will also be used.
229
Simon Glass963817b2016-02-22 22:55:57 -0700230config OF_LIST
Rasmus Villemoesc8481ef2022-01-10 14:34:41 +0100231 string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT
232 depends on OF_CONTROL
Michal Simek9b2e95a2016-05-04 15:14:11 +0200233 default DEFAULT_DEVICE_TREE
Simon Glass963817b2016-02-22 22:55:57 -0700234 help
235 This option specifies a list of device tree files to use for DT
Michal Simek50fa1182023-05-17 09:17:16 +0200236 control. These will be packaged into a FIT. At run-time, U-Boot
Cooper Jr., Franklin06c7b622017-06-16 17:25:09 -0500237 or SPL will select the correct DT to use by examining the
238 hardware (e.g. reading a board ID value). This is a list of
239 device tree files (without the directory or .dtb suffix)
240 separated by <space>.
Simon Glass963817b2016-02-22 22:55:57 -0700241
Jean-Jacques Hiblot985cec32019-10-22 16:39:21 +0200242config OF_OVERLAY_LIST
243 string "List of device tree overlays to include for DT control"
Jean-Jacques Hiblot985cec32019-10-22 16:39:21 +0200244 help
245 This option specifies a list of device tree overlays to use for DT
246 control. This option can then be used by a FIT generator to include
Jan Kiszkaf9ac68d2024-09-30 12:20:36 +0200247 the overlays in the FIT image or by binman when assembling an image
248 that uses overlays during DT fixup.
Jean-Jacques Hiblot985cec32019-10-22 16:39:21 +0200249
Marek Vasutaeaa29d2019-03-08 16:06:55 +0100250choice
Baruch Siach45508fc2019-10-07 15:05:47 +0300251 prompt "OF LIST compression"
Marek Vasutaeaa29d2019-03-08 16:06:55 +0100252 depends on MULTI_DTB_FIT
253 default MULTI_DTB_FIT_NO_COMPRESSION
254
255config MULTI_DTB_FIT_LZO
256 bool "LZO"
257 depends on SYS_MALLOC_F
258 select LZO
259 help
260 Compress the FIT image containing the DTBs available for the SPL
261 using LZO compression. (requires lzop on host).
262
263config MULTI_DTB_FIT_GZIP
264 bool "GZIP"
265 depends on SYS_MALLOC_F
266 select GZIP
267 help
268 Compress the FIT image containing the DTBs available for the SPL
269 using GZIP compression. (requires gzip on host)
270
271config MULTI_DTB_FIT_NO_COMPRESSION
272 bool "No compression"
273 help
274 Do not compress the FIT image containing the DTBs available for the SPL.
275 Use this options only if LZO is not available and the DTBs are very small.
276endchoice
277
278choice
279 prompt "Location of uncompressed DTBs"
280 depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
281 default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
282
283config MULTI_DTB_FIT_DYN_ALLOC
284 bool "Dynamically allocate the memory"
285 depends on SYS_MALLOC_F
286
287config MULTI_DTB_FIT_USER_DEFINED_AREA
288 bool "User-defined location"
289endchoice
290
291config MULTI_DTB_FIT_UNCOMPRESS_SZ
292 hex "Size of memory reserved to uncompress the DTBs"
Marek Vasutaeaa29d2019-03-08 16:06:55 +0100293 default 0x8000
294 help
295 This is the size of this area where the DTBs are uncompressed.
296 If this area is dynamically allocated, make sure that
297 SYS_MALLOC_F_LEN is big enough to contain it.
298
299config MULTI_DTB_FIT_USER_DEF_ADDR
300 hex "Address of memory where dtbs are uncompressed"
301 depends on MULTI_DTB_FIT_USER_DEFINED_AREA
302 help
303 the FIT image containing the DTBs is uncompressed in an area defined
304 at compilation time. This is the address of this area. It must be
305 aligned on 2-byte boundary.
Jean-Jacques Hiblot2037fa42017-09-15 12:57:24 +0200306
307config DTB_RESELECT
308 bool "Support swapping dtbs at a later point in boot"
309 depends on MULTI_DTB_FIT
310 help
311 It is possible during initial boot you may need to use a generic
312 dtb until you can fully determine the board your running on. This
313 config allows boards to implement a function at a later point
314 during boot to switch to the "correct" dtb.
315
316config MULTI_DTB_FIT
317 bool "Support embedding several DTBs in a FIT image for u-boot"
318 help
Michal Simek50fa1182023-05-17 09:17:16 +0200319 This option provides hooks to allow U-Boot to parse an
Jean-Jacques Hiblot2037fa42017-09-15 12:57:24 +0200320 appended FIT image and enable board specific code to then select
321 the correct DTB to be used. Use this if you need to support
322 multiple DTBs but don't use the SPL.
323
Jean-Jacques Hiblota2fee162017-09-15 12:57:32 +0200324
325config SPL_MULTI_DTB_FIT
Simon Glass7c4ba162021-08-07 07:24:02 -0600326 depends on SPL_LOAD_FIT && SPL_OF_REAL
Jean-Jacques Hiblota2fee162017-09-15 12:57:32 +0200327 bool "Support embedding several DTBs in a FIT image for the SPL"
328 help
329 This option provides the SPL with the ability to select its own
330 DTB at runtime from an appended FIT image containing several DTBs.
331 This allows using the same SPL binary on multiple platforms.
332 The primary purpose is to handle different versions of
333 the same platform without tweaking the platform code if the
334 differences can be expressed in the DTBs (common examples are: bus
335 capabilities, pad configurations).
336
337config SPL_OF_LIST
Rasmus Villemoesc8481ef2022-01-10 14:34:41 +0100338 string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT
339 depends on SPL_OF_CONTROL
Jean-Jacques Hiblota2fee162017-09-15 12:57:32 +0200340 default OF_LIST
341 help
342 This option specifies a list of device tree files to use for DT
343 control in the SPL. These will be packaged into a FIT. At run-time,
344 the SPL will select the correct DT to use by examining the
345 hardware (e.g. reading a board ID value). This is a list of
346 device tree files (without the directory or .dtb suffix)
347 separated by <space>.
348
349choice
350 prompt "SPL OF LIST compression"
351 depends on SPL_MULTI_DTB_FIT
352 default SPL_MULTI_DTB_FIT_LZO
353
354config SPL_MULTI_DTB_FIT_LZO
355 bool "LZO"
356 depends on SYS_MALLOC_F
357 select SPL_LZO
358 help
359 Compress the FIT image containing the DTBs available for the SPL
360 using LZO compression. (requires lzop on host).
361
362config SPL_MULTI_DTB_FIT_GZIP
363 bool "GZIP"
364 depends on SYS_MALLOC_F
365 select SPL_GZIP
366 help
367 Compress the FIT image containing the DTBs available for the SPL
368 using GZIP compression. (requires gzip on host)
369
370config SPL_MULTI_DTB_FIT_NO_COMPRESSION
371 bool "No compression"
372 help
373 Do not compress the FIT image containing the DTBs available for the SPL.
374 Use this options only if LZO is not available and the DTBs are very small.
375endchoice
376
377choice
Michal Simekc7df3a22018-07-23 08:38:56 +0200378 prompt "Location of uncompressed DTBs"
Jean-Jacques Hiblota2fee162017-09-15 12:57:32 +0200379 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
380 default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
381
382config SPL_MULTI_DTB_FIT_DYN_ALLOC
383 bool "Dynamically allocate the memory"
384 depends on SYS_MALLOC_F
385
386config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
387 bool "User-defined location"
388endchoice
389
390config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
391 hex "Size of memory reserved to uncompress the DTBs"
392 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
393 default 0x8000
394 help
395 This is the size of this area where the DTBs are uncompressed.
396 If this area is dynamically allocated, make sure that
397 SPL_SYS_MALLOC_F_LEN is big enough to contain it.
398
399config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
400 hex "Address of memory where dtbs are uncompressed"
401 depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
402 help
403 the FIT image containing the DTBs is uncompressed in an area defined
404 at compilation time. This is the address of this area. It must be
405 aligned on 2-byte boundary.
406
Simon Glassc2727e52023-02-13 08:56:32 -0700407config OF_TAG_MIGRATE
408 bool "Ease migration from old device trees with u-boot,dm- tags"
409 default y
410 help
411 U-Boot moved over to use new tags to mark device tree nodes which need
412 to be processed in SPL, before relocation, etc. Enable this option to
413 detect old tags and handle them.
414
415 Note: This option will be removed after the 2023.07 release.
416
Simon Glass89caf332015-06-23 15:38:29 -0600417config OF_SPL_REMOVE_PROPS
418 string "List of device tree properties to drop for SPL"
Masahiro Yamadaddb9aa972015-08-28 20:28:42 +0900419 depends on SPL_OF_CONTROL
Michal Simekde218072019-02-22 10:50:23 +0100420 default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
421 default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
422 default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
423 default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
Simon Glass89caf332015-06-23 15:38:29 -0600424 help
425 Since SPL normally runs in a reduced memory space, the device tree
426 is cut down to only what is needed to load and start U-Boot. Only
Simon Glassfc1aa352023-02-13 08:56:34 -0700427 nodes marked with the property "bootph-all" will be
Simon Glass89caf332015-06-23 15:38:29 -0600428 included. In addition, some properties are not used by U-Boot and
429 can be discarded. This option defines the list of properties to
430 discard.
431
Anatolij Gustschin08568342020-01-12 15:57:42 +0100432config OF_DTB_PROPS_REMOVE
433 bool "Enable removal of device tree properties"
434 depends on OF_CONTROL
435 help
436 Some boards have restricted amount of storage for U-Boot image.
437 If the generated binary doesn't fit into available image storage,
438 the built-in device tree could probably be cut down by removing
439 some not required device tree properties to reduce the image size.
440 Enable this option and define the properties to be removed in the
441 CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
442 pass the built-in DTB directly to the kernel!
443
444config OF_REMOVE_PROPS
445 string "List of device tree properties to drop"
446 depends on OF_DTB_PROPS_REMOVE
447 default "interrupt-parent interrupts" if PINCTRL
448 help
449 Some properties are not used by U-Boot and can be discarded.
450 This option defines the list of properties to discard.
451
Simon Glass7bc65f32016-07-04 11:58:06 -0600452config SPL_OF_PLATDATA
453 bool "Generate platform data for use in SPL"
454 depends on SPL_OF_CONTROL
Masahiro Yamada87247af2017-10-17 13:42:44 +0900455 select DTOC
Simon Glass8beeb282021-03-15 17:25:36 +1300456 select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST
Simon Glass7bc65f32016-07-04 11:58:06 -0600457 help
458 For very constrained SPL environments the overhead of decoding
459 device tree nodes and converting their contents into platform data
460 is too large. This overhead includes libfdt code as well as the
461 device tree contents itself. The latter is fairly compact, but the
462 former can add 3KB or more to a Thumb 2 Image.
463
464 This option enables generation of platform data from the device
Simon Glass1d8364a2020-12-28 20:34:54 -0700465 tree as C code. This code creates devices using U_BOOT_DRVINFO()
Simon Glass7bc65f32016-07-04 11:58:06 -0600466 declarations. The benefit is that it allows driver code to access
467 the platform data directly in C structures, avoidin the libfdt
468 overhead.
469
470 This option works by generating C structure declarations for each
Simon Glass1d8364a2020-12-28 20:34:54 -0700471 compatible string, then adding platform data and U_BOOT_DRVINFO
Simon Goldschmidt49ce8ca2019-01-16 20:40:18 +0100472 declarations for each node. See of-plat.txt for more information.
Simon Glass7bc65f32016-07-04 11:58:06 -0600473
Simon Glass7c4ba162021-08-07 07:24:02 -0600474config SPL_OF_REAL
Sean Anderson7bf2f8c2023-10-14 16:47:46 -0400475 bool "Support a real devicetree in SPL" if SANDBOX
476 depends on SPL_OF_CONTROL
477 select SPL_OF_LIBFDT
Simon Glass7c4ba162021-08-07 07:24:02 -0600478 help
479 Indicates that a real devicetree is available which can be accessed
480 at runtime. This means that dev_read_...() functions can be used to
Sean Anderson7bf2f8c2023-10-14 16:47:46 -0400481 read data from the devicetree for each device. You do not need to
482 enable this option if you have enabled SPL_OF_PLATDATA.
Simon Glass7c4ba162021-08-07 07:24:02 -0600483
Simon Glass240d5f62021-02-03 06:01:13 -0700484if SPL_OF_PLATDATA
485
Simon Glass36b15e22020-10-03 11:31:35 -0600486config SPL_OF_PLATDATA_PARENT
487 bool "Support parent information in devices"
Simon Glass36b15e22020-10-03 11:31:35 -0600488 default y
489 help
490 Generally it is useful to be able to access the parent of a device
491 with of-platdata. To save space this can be disabled, but in that
492 case dev_get_parent() will always return NULL;
493
Simon Glass240d5f62021-02-03 06:01:13 -0700494config SPL_OF_PLATDATA_INST
495 bool "Declare devices at build time"
496 help
497 Declare devices as udevice instances so that they do not need to be
498 bound when U-Boot starts. This can save time and code space.
499
Simon Glass47fd4a22021-03-15 17:25:15 +1300500config SPL_OF_PLATDATA_NO_BIND
501 bool "Don't allow run-time binding of devices"
502 depends on SPL_OF_PLATDATA_INST
503 default y
504 help
505 This removes the ability to bind devices at run time, thus saving
506 some code space in U-Boot. This can be disabled if binding is needed,
507 at the code of some code size increase.
508
Simon Glass5b21b342021-03-15 17:25:35 +1300509config SPL_OF_PLATDATA_RT
510 bool "Use a separate struct for device runtime data"
511 depends on SPL_OF_PLATDATA_INST
512 default y
513 help
514 For systems running SPL from read-only memory it is convenient to
515 separate out the runtime information, so that the devices don't need
516 to be copied before being used. This moves the read-write parts of
517 struct udevice (at present just the flags) into a separate struct,
518 which is allocated at runtime.
519
Simon Glass8beeb282021-03-15 17:25:36 +1300520config SPL_OF_PLATDATA_DRIVER_RT
521 bool
522 help
523 Use a separate struct for driver runtime data.
524
525 This enables the driver_rt information, used with of-platdata when
526 of-platdata-inst is not used. It allows finding devices by their
527 driver data.
528
Simon Glass240d5f62021-02-03 06:01:13 -0700529endif
530
Simon Glass7c4ba162021-08-07 07:24:02 -0600531config TPL_OF_REAL
532 bool
533 help
534 Indicates that a real devicetree is available which can be accessed
535 at runtime. This means that dev_read_...() functions can be used to
536 read data from the devicetree for each device. This is true if
537 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
538
Philipp Tomsich2341dc62017-06-29 11:11:21 +0200539config TPL_OF_PLATDATA
540 bool "Generate platform data for use in TPL"
541 depends on TPL_OF_CONTROL
Masahiro Yamada87247af2017-10-17 13:42:44 +0900542 select DTOC
Simon Glass8beeb282021-03-15 17:25:36 +1300543 select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST
Philipp Tomsich2341dc62017-06-29 11:11:21 +0200544 help
545 For very constrained SPL environments the overhead of decoding
546 device tree nodes and converting their contents into platform data
547 is too large. This overhead includes libfdt code as well as the
548 device tree contents itself. The latter is fairly compact, but the
549 former can add 3KB or more to a Thumb 2 Image.
550
551 This option enables generation of platform data from the device
Simon Glass1d8364a2020-12-28 20:34:54 -0700552 tree as C code. This code creates devices using U_BOOT_DRVINFO()
Philipp Tomsich2341dc62017-06-29 11:11:21 +0200553 declarations. The benefit is that it allows driver code to access
554 the platform data directly in C structures, avoidin the libfdt
555 overhead.
556
557 This option works by generating C structure declarations for each
Simon Glass1d8364a2020-12-28 20:34:54 -0700558 compatible string, then adding platform data and U_BOOT_DRVINFO
Simon Goldschmidt49ce8ca2019-01-16 20:40:18 +0100559 declarations for each node. See of-plat.txt for more information.
Philipp Tomsich2341dc62017-06-29 11:11:21 +0200560
Simon Glass240d5f62021-02-03 06:01:13 -0700561if TPL_OF_PLATDATA
562
Simon Glass36b15e22020-10-03 11:31:35 -0600563config TPL_OF_PLATDATA_PARENT
564 bool "Support parent information in devices"
Simon Glass36b15e22020-10-03 11:31:35 -0600565 default y
566 help
567 Generally it is useful to be able to access the parent of a device
568 with of-platdata. To save space this can be disabled, but in that
569 case dev_get_parent() will always return NULL;
570
Simon Glass240d5f62021-02-03 06:01:13 -0700571config TPL_OF_PLATDATA_INST
572 bool "Declare devices at build time"
573
574 help
575 Declare devices as udevice instances so that they do not need to be
576 bound when U-Boot starts. This can save time and code space.
577
Simon Glass47fd4a22021-03-15 17:25:15 +1300578config TPL_OF_PLATDATA_NO_BIND
579 bool "Don't allow run-time binding of devices"
580 depends on TPL_OF_PLATDATA_INST
581 default y
582 help
583 This removes the ability to bind devices at run time, thus saving
584 some code space in U-Boot. This can be disabled if binding is needed,
585 at the code of some code size increase.
586
Simon Glass5b21b342021-03-15 17:25:35 +1300587config TPL_OF_PLATDATA_RT
588 bool "Use a separate struct for device runtime data"
589 depends on TPL_OF_PLATDATA_INST
590 default y
591 help
592 For systems running TPL from read-only memory it is convenient to
593 separate out the runtime information, so that the devices don't need
594 to be copied before being used. This moves the read-write parts of
595 struct udevice (at present just the flags) into a separate struct,
596 which is allocated at runtime.
597
Simon Glass8beeb282021-03-15 17:25:36 +1300598config TPL_OF_PLATDATA_DRIVER_RT
599 bool
600 help
601 Use a separate struct for driver runtime data.
602
603 This enables the driver_rt information, used with of-platdata when
604 of-platdata-inst is not used. It allows finding devices by their
605 driver data.
606
Simon Glass240d5f62021-02-03 06:01:13 -0700607endif
608
Simon Glasse7ca7da2022-04-30 00:56:53 -0600609config VPL_OF_REAL
610 def_bool y
Tom Rini7fb323b2022-06-08 08:24:40 -0400611 depends on VPL
Simon Glasse7ca7da2022-04-30 00:56:53 -0600612 help
613 Indicates that a real devicetree is available which can be accessed
614 at runtime. This means that dev_read_...() functions can be used to
615 read data from the devicetree for each device. This is true if
616 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
617
Masahiro Yamada9fadbc82014-09-22 19:59:05 +0900618endmenu