blob: 6883a000a05252988339c22b9c66d253395f1f13 [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
Sumit Garge3a98292024-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 Connolly0525cb22024-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
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900128choice
129 prompt "Provider of DTB for DT control"
130 depends on OF_CONTROL
131
132config OF_SEPARATE
133 bool "Separate DTB for DT control"
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900134 help
135 If this option is enabled, the device tree will be built and
136 placed as a separate u-boot.dtb file alongside the U-Boot image.
137
138config OF_EMBED
139 bool "Embedded DTB for DT control"
140 help
141 If this option is enabled, the device tree will be picked up and
Simon Glass3d3f60c2015-08-31 18:47:52 -0600142 built into the U-Boot image. This is suitable for local debugging
143 and development only and is not recommended for production devices.
144 Boards in the mainline U-Boot tree should not use it.
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900145
Simon Glass836eac72021-12-16 20:59:21 -0700146endchoice
147
Alex Deymo82f766d2017-04-02 01:25:20 -0700148config OF_BOARD
Ilias Apalodimas2e8d2f82021-10-12 00:00:13 +0300149 bool "Provided by the board (e.g a previous loader) at runtime"
Simon Glass275b4832021-12-16 20:59:35 -0700150 default y if SANDBOX || OF_HAS_PRIOR_STAGE
Alex Deymo82f766d2017-04-02 01:25:20 -0700151 help
Simon Glass275b4832021-12-16 20:59:35 -0700152 If this option is enabled, the device tree is provided at runtime by
153 a custom function called board_fdt_blob_setup(). The board must
154 implement this function if it wishes to provide special behaviour.
Alex Deymo82f766d2017-04-02 01:25:20 -0700155
Simon Glass275b4832021-12-16 20:59:35 -0700156 With this option, the device tree build by U-Boot may be overridden or
157 ignored. See OF_HAS_PRIOR_STAGE.
158
159 Note: Boards which use this to handle a device tree passed from an
160 earlier stage should enable OF_HAS_PRIOR_STAGE.
161
162config OF_HAS_PRIOR_STAGE
163 bool
Raymond Mao2b714702024-02-03 08:36:27 -0800164 depends on !BLOBLIST
Simon Glass275b4832021-12-16 20:59:35 -0700165 help
166 Indicates that a prior stage of the firmware (before U-Boot proper)
167 makes use of device tree and this board normally boots with that prior
168 stage, that provides a devicetree to U-Boot.
169
170 This means that the device tree built in U-Boot should not be packaged
171 in the firmware image. Instead, the prior stage's device tree should
172 be so packaged. At runtime, the prior stage reads this, does any
173 necessary fix-ups, then passes it to U-Boot. See OF_BOARD.
174
175 This option does not preclude using the U-Boot device tree, e.g. for
176 development purposes, but it is not recommended, and likely will not
177 even work, for production systems.
178
179 Note: This option must be set in Kconfig and cannot be enabled or
180 disabled in the board's defconfig file.
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900181
Simon Glassb7d8e852021-12-16 20:59:38 -0700182config OF_OMIT_DTB
183 bool "Omit the device tree output when building"
184 default y if OF_HAS_PRIOR_STAGE && !BINMAN
185 help
186 As a special case, avoid writing a device tree file u-boot.dtb when
187 building. Also don't include that file in u-boot.bin
188
189 This is used for boards which normally provide a devicetree via a
190 runtime mechanism (such as OF_BOARD), to avoid confusion.
191
Masahiro Yamadaf1ef2b62014-09-22 19:59:06 +0900192config DEFAULT_DEVICE_TREE
193 string "Default Device Tree for DT control"
Simon Glass70d41092016-02-22 22:55:44 -0700194 depends on OF_CONTROL
Masahiro Yamadaf1ef2b62014-09-22 19:59:06 +0900195 help
196 This option specifies the default Device Tree used for DT control.
Robert P. J. Day5699ea62014-10-21 16:44:32 -0400197 It can be overridden from the command line:
Masahiro Yamadaf1ef2b62014-09-22 19:59:06 +0900198 $ make DEVICE_TREE=<device-tree-name>
199
Rasmus Villemoesa77f4682021-11-21 14:52:51 +0100200config DEVICE_TREE_INCLUDES
201 string "Extra .dtsi files to include when building DT control"
202 depends on OF_CONTROL
203 help
204 U-Boot's control .dtb is usually built from an in-tree .dts
205 file, plus (if available) an in-tree U-Boot-specific .dtsi
206 file. This option specifies a space-separated list of extra
207 .dtsi files that will also be used.
208
Simon Glasscdf17242016-02-22 22:55:57 -0700209config OF_LIST
Rasmus Villemoes3609e1d2022-01-10 14:34:41 +0100210 string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT
211 depends on OF_CONTROL
Michal Simekc409bd02016-05-04 15:14:11 +0200212 default DEFAULT_DEVICE_TREE
Simon Glasscdf17242016-02-22 22:55:57 -0700213 help
214 This option specifies a list of device tree files to use for DT
Michal Simek1be82af2023-05-17 09:17:16 +0200215 control. These will be packaged into a FIT. At run-time, U-Boot
Cooper Jr., Franklind9797402017-06-16 17:25:09 -0500216 or SPL will select the correct DT to use by examining the
217 hardware (e.g. reading a board ID value). This is a list of
218 device tree files (without the directory or .dtb suffix)
219 separated by <space>.
Simon Glasscdf17242016-02-22 22:55:57 -0700220
Jean-Jacques Hiblot557bc972019-10-22 16:39:21 +0200221config OF_OVERLAY_LIST
222 string "List of device tree overlays to include for DT control"
223 depends on SPL_LOAD_FIT_APPLY_OVERLAY
224 help
225 This option specifies a list of device tree overlays to use for DT
226 control. This option can then be used by a FIT generator to include
227 the overlays in the FIT image.
228
Marek Vasut95f4bbd2019-03-08 16:06:55 +0100229choice
Baruch Siach574e3862019-10-07 15:05:47 +0300230 prompt "OF LIST compression"
Marek Vasut95f4bbd2019-03-08 16:06:55 +0100231 depends on MULTI_DTB_FIT
232 default MULTI_DTB_FIT_NO_COMPRESSION
233
234config MULTI_DTB_FIT_LZO
235 bool "LZO"
236 depends on SYS_MALLOC_F
237 select LZO
238 help
239 Compress the FIT image containing the DTBs available for the SPL
240 using LZO compression. (requires lzop on host).
241
242config MULTI_DTB_FIT_GZIP
243 bool "GZIP"
244 depends on SYS_MALLOC_F
245 select GZIP
246 help
247 Compress the FIT image containing the DTBs available for the SPL
248 using GZIP compression. (requires gzip on host)
249
250config MULTI_DTB_FIT_NO_COMPRESSION
251 bool "No compression"
252 help
253 Do not compress the FIT image containing the DTBs available for the SPL.
254 Use this options only if LZO is not available and the DTBs are very small.
255endchoice
256
257choice
258 prompt "Location of uncompressed DTBs"
259 depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
260 default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
261
262config MULTI_DTB_FIT_DYN_ALLOC
263 bool "Dynamically allocate the memory"
264 depends on SYS_MALLOC_F
265
266config MULTI_DTB_FIT_USER_DEFINED_AREA
267 bool "User-defined location"
268endchoice
269
270config MULTI_DTB_FIT_UNCOMPRESS_SZ
271 hex "Size of memory reserved to uncompress the DTBs"
Marek Vasut95f4bbd2019-03-08 16:06:55 +0100272 default 0x8000
273 help
274 This is the size of this area where the DTBs are uncompressed.
275 If this area is dynamically allocated, make sure that
276 SYS_MALLOC_F_LEN is big enough to contain it.
277
278config MULTI_DTB_FIT_USER_DEF_ADDR
279 hex "Address of memory where dtbs are uncompressed"
280 depends on MULTI_DTB_FIT_USER_DEFINED_AREA
281 help
282 the FIT image containing the DTBs is uncompressed in an area defined
283 at compilation time. This is the address of this area. It must be
284 aligned on 2-byte boundary.
Jean-Jacques Hiblot11955592017-09-15 12:57:24 +0200285
286config DTB_RESELECT
287 bool "Support swapping dtbs at a later point in boot"
288 depends on MULTI_DTB_FIT
289 help
290 It is possible during initial boot you may need to use a generic
291 dtb until you can fully determine the board your running on. This
292 config allows boards to implement a function at a later point
293 during boot to switch to the "correct" dtb.
294
295config MULTI_DTB_FIT
296 bool "Support embedding several DTBs in a FIT image for u-boot"
297 help
Michal Simek1be82af2023-05-17 09:17:16 +0200298 This option provides hooks to allow U-Boot to parse an
Jean-Jacques Hiblot11955592017-09-15 12:57:24 +0200299 appended FIT image and enable board specific code to then select
300 the correct DTB to be used. Use this if you need to support
301 multiple DTBs but don't use the SPL.
302
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200303
304config SPL_MULTI_DTB_FIT
Simon Glasseaad01a2021-08-07 07:24:02 -0600305 depends on SPL_LOAD_FIT && SPL_OF_REAL
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200306 bool "Support embedding several DTBs in a FIT image for the SPL"
307 help
308 This option provides the SPL with the ability to select its own
309 DTB at runtime from an appended FIT image containing several DTBs.
310 This allows using the same SPL binary on multiple platforms.
311 The primary purpose is to handle different versions of
312 the same platform without tweaking the platform code if the
313 differences can be expressed in the DTBs (common examples are: bus
314 capabilities, pad configurations).
315
316config SPL_OF_LIST
Rasmus Villemoes3609e1d2022-01-10 14:34:41 +0100317 string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT
318 depends on SPL_OF_CONTROL
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200319 default OF_LIST
320 help
321 This option specifies a list of device tree files to use for DT
322 control in the SPL. These will be packaged into a FIT. At run-time,
323 the SPL will select the correct DT to use by examining the
324 hardware (e.g. reading a board ID value). This is a list of
325 device tree files (without the directory or .dtb suffix)
326 separated by <space>.
327
328choice
329 prompt "SPL OF LIST compression"
330 depends on SPL_MULTI_DTB_FIT
331 default SPL_MULTI_DTB_FIT_LZO
332
333config SPL_MULTI_DTB_FIT_LZO
334 bool "LZO"
335 depends on SYS_MALLOC_F
336 select SPL_LZO
337 help
338 Compress the FIT image containing the DTBs available for the SPL
339 using LZO compression. (requires lzop on host).
340
341config SPL_MULTI_DTB_FIT_GZIP
342 bool "GZIP"
343 depends on SYS_MALLOC_F
344 select SPL_GZIP
345 help
346 Compress the FIT image containing the DTBs available for the SPL
347 using GZIP compression. (requires gzip on host)
348
349config SPL_MULTI_DTB_FIT_NO_COMPRESSION
350 bool "No compression"
351 help
352 Do not compress the FIT image containing the DTBs available for the SPL.
353 Use this options only if LZO is not available and the DTBs are very small.
354endchoice
355
356choice
Michal Simekb8448052018-07-23 08:38:56 +0200357 prompt "Location of uncompressed DTBs"
Jean-Jacques Hiblot2f57c952017-09-15 12:57:32 +0200358 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
359 default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
360
361config SPL_MULTI_DTB_FIT_DYN_ALLOC
362 bool "Dynamically allocate the memory"
363 depends on SYS_MALLOC_F
364
365config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
366 bool "User-defined location"
367endchoice
368
369config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
370 hex "Size of memory reserved to uncompress the DTBs"
371 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
372 default 0x8000
373 help
374 This is the size of this area where the DTBs are uncompressed.
375 If this area is dynamically allocated, make sure that
376 SPL_SYS_MALLOC_F_LEN is big enough to contain it.
377
378config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
379 hex "Address of memory where dtbs are uncompressed"
380 depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
381 help
382 the FIT image containing the DTBs is uncompressed in an area defined
383 at compilation time. This is the address of this area. It must be
384 aligned on 2-byte boundary.
385
Simon Glassc74e0342023-02-13 08:56:32 -0700386config OF_TAG_MIGRATE
387 bool "Ease migration from old device trees with u-boot,dm- tags"
388 default y
389 help
390 U-Boot moved over to use new tags to mark device tree nodes which need
391 to be processed in SPL, before relocation, etc. Enable this option to
392 detect old tags and handle them.
393
394 Note: This option will be removed after the 2023.07 release.
395
Simon Glassfa78e0a2015-06-23 15:38:29 -0600396config OF_SPL_REMOVE_PROPS
397 string "List of device tree properties to drop for SPL"
Masahiro Yamada897705e2015-08-28 20:28:42 +0900398 depends on SPL_OF_CONTROL
Michal Simekf00d89f2019-02-22 10:50:23 +0100399 default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK
400 default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL
401 default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK
402 default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts"
Simon Glassfa78e0a2015-06-23 15:38:29 -0600403 help
404 Since SPL normally runs in a reduced memory space, the device tree
405 is cut down to only what is needed to load and start U-Boot. Only
Simon Glasse316fba2023-02-13 08:56:34 -0700406 nodes marked with the property "bootph-all" will be
Simon Glassfa78e0a2015-06-23 15:38:29 -0600407 included. In addition, some properties are not used by U-Boot and
408 can be discarded. This option defines the list of properties to
409 discard.
410
Anatolij Gustschin43b6e382020-01-12 15:57:42 +0100411config OF_DTB_PROPS_REMOVE
412 bool "Enable removal of device tree properties"
413 depends on OF_CONTROL
414 help
415 Some boards have restricted amount of storage for U-Boot image.
416 If the generated binary doesn't fit into available image storage,
417 the built-in device tree could probably be cut down by removing
418 some not required device tree properties to reduce the image size.
419 Enable this option and define the properties to be removed in the
420 CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must
421 pass the built-in DTB directly to the kernel!
422
423config OF_REMOVE_PROPS
424 string "List of device tree properties to drop"
425 depends on OF_DTB_PROPS_REMOVE
426 default "interrupt-parent interrupts" if PINCTRL
427 help
428 Some properties are not used by U-Boot and can be discarded.
429 This option defines the list of properties to discard.
430
Simon Glass2789ddb2016-07-04 11:58:06 -0600431config SPL_OF_PLATDATA
432 bool "Generate platform data for use in SPL"
433 depends on SPL_OF_CONTROL
Masahiro Yamadad6a0c782017-10-17 13:42:44 +0900434 select DTOC
Simon Glassab933d82021-03-15 17:25:36 +1300435 select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST
Simon Glass2789ddb2016-07-04 11:58:06 -0600436 help
437 For very constrained SPL environments the overhead of decoding
438 device tree nodes and converting their contents into platform data
439 is too large. This overhead includes libfdt code as well as the
440 device tree contents itself. The latter is fairly compact, but the
441 former can add 3KB or more to a Thumb 2 Image.
442
443 This option enables generation of platform data from the device
Simon Glass20e442a2020-12-28 20:34:54 -0700444 tree as C code. This code creates devices using U_BOOT_DRVINFO()
Simon Glass2789ddb2016-07-04 11:58:06 -0600445 declarations. The benefit is that it allows driver code to access
446 the platform data directly in C structures, avoidin the libfdt
447 overhead.
448
449 This option works by generating C structure declarations for each
Simon Glass20e442a2020-12-28 20:34:54 -0700450 compatible string, then adding platform data and U_BOOT_DRVINFO
Simon Goldschmidt3600b462019-01-16 20:40:18 +0100451 declarations for each node. See of-plat.txt for more information.
Simon Glass2789ddb2016-07-04 11:58:06 -0600452
Simon Glasseaad01a2021-08-07 07:24:02 -0600453config SPL_OF_REAL
Sean Andersoneaf73852023-10-14 16:47:46 -0400454 bool "Support a real devicetree in SPL" if SANDBOX
455 depends on SPL_OF_CONTROL
456 select SPL_OF_LIBFDT
Simon Glasseaad01a2021-08-07 07:24:02 -0600457 help
458 Indicates that a real devicetree is available which can be accessed
459 at runtime. This means that dev_read_...() functions can be used to
Sean Andersoneaf73852023-10-14 16:47:46 -0400460 read data from the devicetree for each device. You do not need to
461 enable this option if you have enabled SPL_OF_PLATDATA.
Simon Glasseaad01a2021-08-07 07:24:02 -0600462
Simon Glass5a1b25c2021-02-03 06:01:13 -0700463if SPL_OF_PLATDATA
464
Simon Glasse41651f2020-10-03 11:31:35 -0600465config SPL_OF_PLATDATA_PARENT
466 bool "Support parent information in devices"
Simon Glasse41651f2020-10-03 11:31:35 -0600467 default y
468 help
469 Generally it is useful to be able to access the parent of a device
470 with of-platdata. To save space this can be disabled, but in that
471 case dev_get_parent() will always return NULL;
472
Simon Glass5a1b25c2021-02-03 06:01:13 -0700473config SPL_OF_PLATDATA_INST
474 bool "Declare devices at build time"
475 help
476 Declare devices as udevice instances so that they do not need to be
477 bound when U-Boot starts. This can save time and code space.
478
Simon Glass1ef3af32021-03-15 17:25:15 +1300479config SPL_OF_PLATDATA_NO_BIND
480 bool "Don't allow run-time binding of devices"
481 depends on SPL_OF_PLATDATA_INST
482 default y
483 help
484 This removes the ability to bind devices at run time, thus saving
485 some code space in U-Boot. This can be disabled if binding is needed,
486 at the code of some code size increase.
487
Simon Glass95a58252021-03-15 17:25:35 +1300488config SPL_OF_PLATDATA_RT
489 bool "Use a separate struct for device runtime data"
490 depends on SPL_OF_PLATDATA_INST
491 default y
492 help
493 For systems running SPL from read-only memory it is convenient to
494 separate out the runtime information, so that the devices don't need
495 to be copied before being used. This moves the read-write parts of
496 struct udevice (at present just the flags) into a separate struct,
497 which is allocated at runtime.
498
Simon Glassab933d82021-03-15 17:25:36 +1300499config SPL_OF_PLATDATA_DRIVER_RT
500 bool
501 help
502 Use a separate struct for driver runtime data.
503
504 This enables the driver_rt information, used with of-platdata when
505 of-platdata-inst is not used. It allows finding devices by their
506 driver data.
507
Simon Glass5a1b25c2021-02-03 06:01:13 -0700508endif
509
Simon Glasseaad01a2021-08-07 07:24:02 -0600510config TPL_OF_REAL
511 bool
512 help
513 Indicates that a real devicetree is available which can be accessed
514 at runtime. This means that dev_read_...() functions can be used to
515 read data from the devicetree for each device. This is true if
516 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
517
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200518config TPL_OF_PLATDATA
519 bool "Generate platform data for use in TPL"
520 depends on TPL_OF_CONTROL
Masahiro Yamadad6a0c782017-10-17 13:42:44 +0900521 select DTOC
Simon Glassab933d82021-03-15 17:25:36 +1300522 select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200523 help
524 For very constrained SPL environments the overhead of decoding
525 device tree nodes and converting their contents into platform data
526 is too large. This overhead includes libfdt code as well as the
527 device tree contents itself. The latter is fairly compact, but the
528 former can add 3KB or more to a Thumb 2 Image.
529
530 This option enables generation of platform data from the device
Simon Glass20e442a2020-12-28 20:34:54 -0700531 tree as C code. This code creates devices using U_BOOT_DRVINFO()
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200532 declarations. The benefit is that it allows driver code to access
533 the platform data directly in C structures, avoidin the libfdt
534 overhead.
535
536 This option works by generating C structure declarations for each
Simon Glass20e442a2020-12-28 20:34:54 -0700537 compatible string, then adding platform data and U_BOOT_DRVINFO
Simon Goldschmidt3600b462019-01-16 20:40:18 +0100538 declarations for each node. See of-plat.txt for more information.
Philipp Tomsichf291ce12017-06-29 11:11:21 +0200539
Simon Glass5a1b25c2021-02-03 06:01:13 -0700540if TPL_OF_PLATDATA
541
Simon Glasse41651f2020-10-03 11:31:35 -0600542config TPL_OF_PLATDATA_PARENT
543 bool "Support parent information in devices"
Simon Glasse41651f2020-10-03 11:31:35 -0600544 default y
545 help
546 Generally it is useful to be able to access the parent of a device
547 with of-platdata. To save space this can be disabled, but in that
548 case dev_get_parent() will always return NULL;
549
Simon Glass5a1b25c2021-02-03 06:01:13 -0700550config TPL_OF_PLATDATA_INST
551 bool "Declare devices at build time"
552
553 help
554 Declare devices as udevice instances so that they do not need to be
555 bound when U-Boot starts. This can save time and code space.
556
Simon Glass1ef3af32021-03-15 17:25:15 +1300557config TPL_OF_PLATDATA_NO_BIND
558 bool "Don't allow run-time binding of devices"
559 depends on TPL_OF_PLATDATA_INST
560 default y
561 help
562 This removes the ability to bind devices at run time, thus saving
563 some code space in U-Boot. This can be disabled if binding is needed,
564 at the code of some code size increase.
565
Simon Glass95a58252021-03-15 17:25:35 +1300566config TPL_OF_PLATDATA_RT
567 bool "Use a separate struct for device runtime data"
568 depends on TPL_OF_PLATDATA_INST
569 default y
570 help
571 For systems running TPL from read-only memory it is convenient to
572 separate out the runtime information, so that the devices don't need
573 to be copied before being used. This moves the read-write parts of
574 struct udevice (at present just the flags) into a separate struct,
575 which is allocated at runtime.
576
Simon Glassab933d82021-03-15 17:25:36 +1300577config TPL_OF_PLATDATA_DRIVER_RT
578 bool
579 help
580 Use a separate struct for driver runtime data.
581
582 This enables the driver_rt information, used with of-platdata when
583 of-platdata-inst is not used. It allows finding devices by their
584 driver data.
585
Simon Glass5a1b25c2021-02-03 06:01:13 -0700586endif
587
Simon Glass747093d2022-04-30 00:56:53 -0600588config VPL_OF_REAL
589 def_bool y
Tom Rini13ce3512022-06-08 08:24:40 -0400590 depends on VPL
Simon Glass747093d2022-04-30 00:56:53 -0600591 help
592 Indicates that a real devicetree is available which can be accessed
593 at runtime. This means that dev_read_...() functions can be used to
594 read data from the devicetree for each device. This is true if
595 TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA
596
Masahiro Yamada783e6a72014-09-22 19:59:05 +0900597endmenu