blob: def0e172412f50354da9be8cc47b0492bb496e08 [file] [log] [blame]
Masahiro Yamada783e6a72014-09-22 19:59:05 +09001#
2# Device Tree Control
3#
Masahiro Yamada783e6a72014-09-22 19:59:05 +09004
5config SUPPORT_OF_CONTROL
6 bool
7
Masahiro Yamadad6a0c782017-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 Yamada783e6a72014-09-22 19:59:05 +090019menu "Device Tree Control"
Masahiro Yamada783e6a72014-09-22 19:59:05 +090020 depends on SUPPORT_OF_CONTROL
21
22config OF_CONTROL
23 bool "Run-time configuration via Device Tree"
Simon Glassd727ace2023-02-01 13:20:27 -070024 select OF_LIBFDT
25 select OF_REAL
Masahiro Yamada783e6a72014-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 Glasseaad01a2021-08-07 07:24:02 -060030config OF_REAL
Simon Glass414cc152021-08-07 07:24:03 -060031 bool
Simon Glasseaad01a2021-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.cc2a792752017-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 Yamadadffb86e2015-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 Anderson327bb3b2019-12-17 21:40:09 -050051 select SPL_OF_LIBFDT if !SPL_OF_PLATDATA
Simon Glasseaad01a2021-08-07 07:24:02 -060052 select SPL_OF_REAL if !SPL_OF_PLATDATA
Simon Glass2860f032015-02-27 22:06:38 -070053 help
54 Some boards use device tree in U-Boot but only have 4KB of SRAM
Walter Lozanoc9acae32019-10-22 11:50:19 -030055 which is not enough to support device tree. Disable this option to
Simon Glass2860f032015-02-27 22:06:38 -070056 allow such boards to be supported by U-Boot SPL.
57
Philipp Tomsichf291ce12017-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 Anderson327bb3b2019-12-17 21:40:09 -050061 select TPL_OF_LIBFDT if !TPL_OF_PLATDATA
Simon Glasseaad01a2021-08-07 07:24:02 -060062 select TPL_OF_REAL if !TPL_OF_PLATDATA
Philipp Tomsichf291ce12017-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 Glass747093d2022-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 Glass5e060d82017-05-18 20:08:53 -060077config OF_LIVE
78 bool "Enable use of a live tree"
Bin Mengced4c312021-02-03 21:20:03 +080079 depends on DM && OF_CONTROL
Simon Glass5e060d82017-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 Simek4adc6602018-08-17 10:16:36 +020083 tree does not support modification from within U-Boot since it
Simon Glass5e060d82017-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
Masahiro Yamada783e6a72014-09-22 19:59:05 +090088choice
89 prompt "Provider of DTB for DT control"
90 depends on OF_CONTROL
91
92config OF_SEPARATE
93 bool "Separate DTB for DT control"
Masahiro Yamada783e6a72014-09-22 19:59:05 +090094 help
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.
97
98config OF_EMBED
99 bool "Embedded DTB for DT control"
100 help
101 If this option is enabled, the device tree will be picked up and
Simon Glass3d3f60c2015-08-31 18:47:52 -0600102 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.
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900105
Simon Glass836eac72021-12-16 20:59:21 -0700106endchoice
107
Alex Deymo82f766d2017-04-02 01:25:20 -0700108config OF_BOARD
Ilias Apalodimas2e8d2f82021-10-12 00:00:13 +0300109 bool "Provided by the board (e.g a previous loader) at runtime"
Simon Glass275b4832021-12-16 20:59:35 -0700110 default y if SANDBOX || OF_HAS_PRIOR_STAGE
Alex Deymo82f766d2017-04-02 01:25:20 -0700111 help
Simon Glass275b4832021-12-16 20:59:35 -0700112 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.
Alex Deymo82f766d2017-04-02 01:25:20 -0700115
Simon Glass275b4832021-12-16 20:59:35 -0700116 With this option, the device tree build by U-Boot may be overridden or
117 ignored. See OF_HAS_PRIOR_STAGE.
118
119 Note: Boards which use this to handle a device tree passed from an
120 earlier stage should enable OF_HAS_PRIOR_STAGE.
121
122config OF_HAS_PRIOR_STAGE
123 bool
Raymond Mao2b714702024-02-03 08:36:27 -0800124 depends on !BLOBLIST
Simon Glass275b4832021-12-16 20:59:35 -0700125 help
126 Indicates that a prior stage of the firmware (before U-Boot proper)
127 makes use of device tree and this board normally boots with that prior
128 stage, that provides a devicetree to U-Boot.
129
130 This means that the device tree built in U-Boot should not be packaged
131 in the firmware image. Instead, the prior stage's device tree should
132 be so packaged. At runtime, the prior stage reads this, does any
133 necessary fix-ups, then passes it to U-Boot. See OF_BOARD.
134
135 This option does not preclude using the U-Boot device tree, e.g. for
136 development purposes, but it is not recommended, and likely will not
137 even work, for production systems.
138
139 Note: This option must be set in Kconfig and cannot be enabled or
140 disabled in the board's defconfig file.
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900141
Simon Glassb7d8e852021-12-16 20:59:38 -0700142config OF_OMIT_DTB
143 bool "Omit the device tree output when building"
144 default y if OF_HAS_PRIOR_STAGE && !BINMAN
145 help
146 As a special case, avoid writing a device tree file u-boot.dtb when
147 building. Also don't include that file in u-boot.bin
148
149 This is used for boards which normally provide a devicetree via a
150 runtime mechanism (such as OF_BOARD), to avoid confusion.
151
Masahiro Yamadaf1ef2b62014-09-22 19:59:06 +0900152config DEFAULT_DEVICE_TREE
153 string "Default Device Tree for DT control"
Simon Glass70d41092016-02-22 22:55:44 -0700154 depends on OF_CONTROL
Masahiro Yamadaf1ef2b62014-09-22 19:59:06 +0900155 help
156 This option specifies the default Device Tree used for DT control.
Robert P. J. Day5699ea62014-10-21 16:44:32 -0400157 It can be overridden from the command line:
Masahiro Yamadaf1ef2b62014-09-22 19:59:06 +0900158 $ make DEVICE_TREE=<device-tree-name>
159
Rasmus Villemoesa77f4682021-11-21 14:52:51 +0100160config DEVICE_TREE_INCLUDES
161 string "Extra .dtsi files to include when building DT control"
162 depends on OF_CONTROL
163 help
164 U-Boot's control .dtb is usually built from an in-tree .dts
165 file, plus (if available) an in-tree U-Boot-specific .dtsi
166 file. This option specifies a space-separated list of extra
167 .dtsi files that will also be used.
168
Simon Glasscdf17242016-02-22 22:55:57 -0700169config OF_LIST
Rasmus Villemoes3609e1d2022-01-10 14:34:41 +0100170 string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT
171 depends on OF_CONTROL
Michal Simekc409bd02016-05-04 15:14:11 +0200172 default DEFAULT_DEVICE_TREE
Simon Glasscdf17242016-02-22 22:55:57 -0700173 help
174 This option specifies a list of device tree files to use for DT
Michal Simek1be82af2023-05-17 09:17:16 +0200175 control. These will be packaged into a FIT. At run-time, U-Boot
Cooper Jr., Franklind9797402017-06-16 17:25:09 -0500176 or SPL will select the correct DT to use by examining the
177 hardware (e.g. reading a board ID value). This is a list of
178 device tree files (without the directory or .dtb suffix)
179 separated by <space>.
Simon Glasscdf17242016-02-22 22:55:57 -0700180
Jean-Jacques Hiblot557bc972019-10-22 16:39:21 +0200181config OF_OVERLAY_LIST
182 string "List of device tree overlays to include for DT control"
183 depends on SPL_LOAD_FIT_APPLY_OVERLAY
184 help
185 This option specifies a list of device tree overlays to use for DT
186 control. This option can then be used by a FIT generator to include
187 the overlays in the FIT image.
188
Marek Vasut95f4bbd2019-03-08 16:06:55 +0100189choice
Baruch Siach574e3862019-10-07 15:05:47 +0300190 prompt "OF LIST compression"
Marek Vasut95f4bbd2019-03-08 16:06:55 +0100191 depends on MULTI_DTB_FIT
192 default MULTI_DTB_FIT_NO_COMPRESSION
193
194config MULTI_DTB_FIT_LZO
195 bool "LZO"
196 depends on SYS_MALLOC_F
197 select LZO
198 help
199 Compress the FIT image containing the DTBs available for the SPL
200 using LZO compression. (requires lzop on host).
201
202config MULTI_DTB_FIT_GZIP
203 bool "GZIP"
204 depends on SYS_MALLOC_F
205 select GZIP
206 help
207 Compress the FIT image containing the DTBs available for the SPL
208 using GZIP compression. (requires gzip on host)
209
210config MULTI_DTB_FIT_NO_COMPRESSION
211 bool "No compression"
212 help
213 Do not compress the FIT image containing the DTBs available for the SPL.
214 Use this options only if LZO is not available and the DTBs are very small.
215endchoice
216
217choice
218 prompt "Location of uncompressed DTBs"
219 depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
220 default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
221
222config MULTI_DTB_FIT_DYN_ALLOC
223 bool "Dynamically allocate the memory"
224 depends on SYS_MALLOC_F
225
226config MULTI_DTB_FIT_USER_DEFINED_AREA
227 bool "User-defined location"
228endchoice
229
230config MULTI_DTB_FIT_UNCOMPRESS_SZ
231 hex "Size of memory reserved to uncompress the DTBs"
Marek Vasut95f4bbd2019-03-08 16:06:55 +0100232 default 0x8000
233 help
234 This is the size of this area where the DTBs are uncompressed.
235 If this area is dynamically allocated, make sure that
236 SYS_MALLOC_F_LEN is big enough to contain it.
237
238config MULTI_DTB_FIT_USER_DEF_ADDR
239 hex "Address of memory where dtbs are uncompressed"
240 depends on MULTI_DTB_FIT_USER_DEFINED_AREA
241 help
242 the FIT image containing the DTBs is uncompressed in an area defined
243 at compilation time. This is the address of this area. It must be
244 aligned on 2-byte boundary.
Jean-Jacques Hiblot11955592017-09-15 12:57:24 +0200245
246config DTB_RESELECT
247 bool "Support swapping dtbs at a later point in boot"
248 depends on MULTI_DTB_FIT
249 help
250 It is possible during initial boot you may need to use a generic
251 dtb until you can fully determine the board your running on. This
252 config allows boards to implement a function at a later point
253 during boot to switch to the "correct" dtb.
254
255config MULTI_DTB_FIT
256 bool "Support embedding several DTBs in a FIT image for u-boot"
257 help
Michal Simek1be82af2023-05-17 09:17:16 +0200258 This option provides hooks to allow U-Boot to parse an
Jean-Jacques Hiblot11955592017-09-15 12:57:24 +0200259 appended FIT image and enable board specific code to then select
260 the correct DTB to be used. Use this if you need to support
261 multiple DTBs but don't use the SPL.
262
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200263
264config SPL_MULTI_DTB_FIT
Simon Glasseaad01a2021-08-07 07:24:02 -0600265 depends on SPL_LOAD_FIT && SPL_OF_REAL
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200266 bool "Support embedding several DTBs in a FIT image for the SPL"
267 help
268 This option provides the SPL with the ability to select its own
269 DTB at runtime from an appended FIT image containing several DTBs.
270 This allows using the same SPL binary on multiple platforms.
271 The primary purpose is to handle different versions of
272 the same platform without tweaking the platform code if the
273 differences can be expressed in the DTBs (common examples are: bus
274 capabilities, pad configurations).
275
276config SPL_OF_LIST
Rasmus Villemoes3609e1d2022-01-10 14:34:41 +0100277 string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT
278 depends on SPL_OF_CONTROL
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200279 default OF_LIST
280 help
281 This option specifies a list of device tree files to use for DT
282 control in the SPL. These will be packaged into a FIT. At run-time,
283 the SPL will select the correct DT to use by examining the
284 hardware (e.g. reading a board ID value). This is a list of
285 device tree files (without the directory or .dtb suffix)
286 separated by <space>.
287
288choice
289 prompt "SPL OF LIST compression"
290 depends on SPL_MULTI_DTB_FIT
291 default SPL_MULTI_DTB_FIT_LZO
292
293config SPL_MULTI_DTB_FIT_LZO
294 bool "LZO"
295 depends on SYS_MALLOC_F
296 select SPL_LZO
297 help
298 Compress the FIT image containing the DTBs available for the SPL
299 using LZO compression. (requires lzop on host).
300
301config SPL_MULTI_DTB_FIT_GZIP
302 bool "GZIP"
303 depends on SYS_MALLOC_F
304 select SPL_GZIP
305 help
306 Compress the FIT image containing the DTBs available for the SPL
307 using GZIP compression. (requires gzip on host)
308
309config SPL_MULTI_DTB_FIT_NO_COMPRESSION
310 bool "No compression"
311 help
312 Do not compress the FIT image containing the DTBs available for the SPL.
313 Use this options only if LZO is not available and the DTBs are very small.
314endchoice
315
316choice
Michal Simekb8448052018-07-23 08:38:56 +0200317 prompt "Location of uncompressed DTBs"
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200318 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
319 default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
320
321config SPL_MULTI_DTB_FIT_DYN_ALLOC
322 bool "Dynamically allocate the memory"
323 depends on SYS_MALLOC_F
324
325config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
326 bool "User-defined location"
327endchoice
328
329config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
330 hex "Size of memory reserved to uncompress the DTBs"
331 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
332 default 0x8000
333 help
334 This is the size of this area where the DTBs are uncompressed.
335 If this area is dynamically allocated, make sure that
336 SPL_SYS_MALLOC_F_LEN is big enough to contain it.
337
338config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
339 hex "Address of memory where dtbs are uncompressed"
340 depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
341 help
342 the FIT image containing the DTBs is uncompressed in an area defined
343 at compilation time. This is the address of this area. It must be
344 aligned on 2-byte boundary.
345
Simon Glassc74e0342023-02-13 08:56:32 -0700346config OF_TAG_MIGRATE
347 bool "Ease migration from old device trees with u-boot,dm- tags"
348 default y
349 help
350 U-Boot moved over to use new tags to mark device tree nodes which need
351 to be processed in SPL, before relocation, etc. Enable this option to
352 detect old tags and handle them.
353
354 Note: This option will be removed after the 2023.07 release.
355
Simon Glassfa78e0a2015-06-23 15:38:29 -0600356config OF_SPL_REMOVE_PROPS
357 string "List of device tree properties to drop for SPL"
Masahiro Yamada897705e2015-08-28 20:28:42 +0900358 depends on SPL_OF_CONTROL
Michal Simekf00d89f2019-02-22 10:50:23 +0100359 default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
360 default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
361 default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
362 default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
Simon Glassfa78e0a2015-06-23 15:38:29 -0600363 help
364 Since SPL normally runs in a reduced memory space, the device tree
365 is cut down to only what is needed to load and start U-Boot. Only
Simon Glasse316fba2023-02-13 08:56:34 -0700366 nodes marked with the property "bootph-all" will be
Simon Glassfa78e0a2015-06-23 15:38:29 -0600367 included. In addition, some properties are not used by U-Boot and
368 can be discarded. This option defines the list of properties to
369 discard.
370
Anatolij Gustschin43b6e382020-01-12 15:57:42 +0100371config OF_DTB_PROPS_REMOVE
372 bool "Enable removal of device tree properties"
373 depends on OF_CONTROL
374 help
375 Some boards have restricted amount of storage for U-Boot image.
376 If the generated binary doesn't fit into available image storage,
377 the built-in device tree could probably be cut down by removing
378 some not required device tree properties to reduce the image size.
379 Enable this option and define the properties to be removed in the
380 CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
381 pass the built-in DTB directly to the kernel!
382
383config OF_REMOVE_PROPS
384 string "List of device tree properties to drop"
385 depends on OF_DTB_PROPS_REMOVE
386 default "interrupt-parent interrupts" if PINCTRL
387 help
388 Some properties are not used by U-Boot and can be discarded.
389 This option defines the list of properties to discard.
390
Simon Glass2789ddb2016-07-04 11:58:06 -0600391config SPL_OF_PLATDATA
392 bool "Generate platform data for use in SPL"
393 depends on SPL_OF_CONTROL
Masahiro Yamadad6a0c782017-10-17 13:42:44 +0900394 select DTOC
Simon Glassab933d82021-03-15 17:25:36 +1300395 select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST
Simon Glass2789ddb2016-07-04 11:58:06 -0600396 help
397 For very constrained SPL environments the overhead of decoding
398 device tree nodes and converting their contents into platform data
399 is too large. This overhead includes libfdt code as well as the
400 device tree contents itself. The latter is fairly compact, but the
401 former can add 3KB or more to a Thumb 2 Image.
402
403 This option enables generation of platform data from the device
Simon Glass20e442a2020-12-28 20:34:54 -0700404 tree as C code. This code creates devices using U_BOOT_DRVINFO()
Simon Glass2789ddb2016-07-04 11:58:06 -0600405 declarations. The benefit is that it allows driver code to access
406 the platform data directly in C structures, avoidin the libfdt
407 overhead.
408
409 This option works by generating C structure declarations for each
Simon Glass20e442a2020-12-28 20:34:54 -0700410 compatible string, then adding platform data and U_BOOT_DRVINFO
Simon Goldschmidt3600b462019-01-16 20:40:18 +0100411 declarations for each node. See of-plat.txt for more information.
Simon Glass2789ddb2016-07-04 11:58:06 -0600412
Simon Glasseaad01a2021-08-07 07:24:02 -0600413config SPL_OF_REAL
Sean Andersoneaf73852023-10-14 16:47:46 -0400414 bool "Support a real devicetree in SPL" if SANDBOX
415 depends on SPL_OF_CONTROL
416 select SPL_OF_LIBFDT
Simon Glasseaad01a2021-08-07 07:24:02 -0600417 help
418 Indicates that a real devicetree is available which can be accessed
419 at runtime. This means that dev_read_...() functions can be used to
Sean Andersoneaf73852023-10-14 16:47:46 -0400420 read data from the devicetree for each device. You do not need to
421 enable this option if you have enabled SPL_OF_PLATDATA.
Simon Glasseaad01a2021-08-07 07:24:02 -0600422
Simon Glass5a1b25c2021-02-03 06:01:13 -0700423if SPL_OF_PLATDATA
424
Simon Glasse41651f2020-10-03 11:31:35 -0600425config SPL_OF_PLATDATA_PARENT
426 bool "Support parent information in devices"
Simon Glasse41651f2020-10-03 11:31:35 -0600427 default y
428 help
429 Generally it is useful to be able to access the parent of a device
430 with of-platdata. To save space this can be disabled, but in that
431 case dev_get_parent() will always return NULL;
432
Simon Glass5a1b25c2021-02-03 06:01:13 -0700433config SPL_OF_PLATDATA_INST
434 bool "Declare devices at build time"
435 help
436 Declare devices as udevice instances so that they do not need to be
437 bound when U-Boot starts. This can save time and code space.
438
Simon Glass1ef3af32021-03-15 17:25:15 +1300439config SPL_OF_PLATDATA_NO_BIND
440 bool "Don't allow run-time binding of devices"
441 depends on SPL_OF_PLATDATA_INST
442 default y
443 help
444 This removes the ability to bind devices at run time, thus saving
445 some code space in U-Boot. This can be disabled if binding is needed,
446 at the code of some code size increase.
447
Simon Glass95a58252021-03-15 17:25:35 +1300448config SPL_OF_PLATDATA_RT
449 bool "Use a separate struct for device runtime data"
450 depends on SPL_OF_PLATDATA_INST
451 default y
452 help
453 For systems running SPL from read-only memory it is convenient to
454 separate out the runtime information, so that the devices don't need
455 to be copied before being used. This moves the read-write parts of
456 struct udevice (at present just the flags) into a separate struct,
457 which is allocated at runtime.
458
Simon Glassab933d82021-03-15 17:25:36 +1300459config SPL_OF_PLATDATA_DRIVER_RT
460 bool
461 help
462 Use a separate struct for driver runtime data.
463
464 This enables the driver_rt information, used with of-platdata when
465 of-platdata-inst is not used. It allows finding devices by their
466 driver data.
467
Simon Glass5a1b25c2021-02-03 06:01:13 -0700468endif
469
Simon Glasseaad01a2021-08-07 07:24:02 -0600470config TPL_OF_REAL
471 bool
472 help
473 Indicates that a real devicetree is available which can be accessed
474 at runtime. This means that dev_read_...() functions can be used to
475 read data from the devicetree for each device. This is true if
476 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
477
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200478config TPL_OF_PLATDATA
479 bool "Generate platform data for use in TPL"
480 depends on TPL_OF_CONTROL
Masahiro Yamadad6a0c782017-10-17 13:42:44 +0900481 select DTOC
Simon Glassab933d82021-03-15 17:25:36 +1300482 select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200483 help
484 For very constrained SPL environments the overhead of decoding
485 device tree nodes and converting their contents into platform data
486 is too large. This overhead includes libfdt code as well as the
487 device tree contents itself. The latter is fairly compact, but the
488 former can add 3KB or more to a Thumb 2 Image.
489
490 This option enables generation of platform data from the device
Simon Glass20e442a2020-12-28 20:34:54 -0700491 tree as C code. This code creates devices using U_BOOT_DRVINFO()
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200492 declarations. The benefit is that it allows driver code to access
493 the platform data directly in C structures, avoidin the libfdt
494 overhead.
495
496 This option works by generating C structure declarations for each
Simon Glass20e442a2020-12-28 20:34:54 -0700497 compatible string, then adding platform data and U_BOOT_DRVINFO
Simon Goldschmidt3600b462019-01-16 20:40:18 +0100498 declarations for each node. See of-plat.txt for more information.
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200499
Simon Glass5a1b25c2021-02-03 06:01:13 -0700500if TPL_OF_PLATDATA
501
Simon Glasse41651f2020-10-03 11:31:35 -0600502config TPL_OF_PLATDATA_PARENT
503 bool "Support parent information in devices"
Simon Glasse41651f2020-10-03 11:31:35 -0600504 default y
505 help
506 Generally it is useful to be able to access the parent of a device
507 with of-platdata. To save space this can be disabled, but in that
508 case dev_get_parent() will always return NULL;
509
Simon Glass5a1b25c2021-02-03 06:01:13 -0700510config TPL_OF_PLATDATA_INST
511 bool "Declare devices at build time"
512
513 help
514 Declare devices as udevice instances so that they do not need to be
515 bound when U-Boot starts. This can save time and code space.
516
Simon Glass1ef3af32021-03-15 17:25:15 +1300517config TPL_OF_PLATDATA_NO_BIND
518 bool "Don't allow run-time binding of devices"
519 depends on TPL_OF_PLATDATA_INST
520 default y
521 help
522 This removes the ability to bind devices at run time, thus saving
523 some code space in U-Boot. This can be disabled if binding is needed,
524 at the code of some code size increase.
525
Simon Glass95a58252021-03-15 17:25:35 +1300526config TPL_OF_PLATDATA_RT
527 bool "Use a separate struct for device runtime data"
528 depends on TPL_OF_PLATDATA_INST
529 default y
530 help
531 For systems running TPL from read-only memory it is convenient to
532 separate out the runtime information, so that the devices don't need
533 to be copied before being used. This moves the read-write parts of
534 struct udevice (at present just the flags) into a separate struct,
535 which is allocated at runtime.
536
Simon Glassab933d82021-03-15 17:25:36 +1300537config TPL_OF_PLATDATA_DRIVER_RT
538 bool
539 help
540 Use a separate struct for driver runtime data.
541
542 This enables the driver_rt information, used with of-platdata when
543 of-platdata-inst is not used. It allows finding devices by their
544 driver data.
545
Simon Glass5a1b25c2021-02-03 06:01:13 -0700546endif
547
Simon Glass747093d2022-04-30 00:56:53 -0600548config VPL_OF_REAL
549 def_bool y
Tom Rini13ce3512022-06-08 08:24:40 -0400550 depends on VPL
Simon Glass747093d2022-04-30 00:56:53 -0600551 help
552 Indicates that a real devicetree is available which can be accessed
553 at runtime. This means that dev_read_...() functions can be used to
554 read data from the devicetree for each device. This is true if
555 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
556
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900557endmenu