Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 1 | # |
| 2 | # Device Tree Control |
| 3 | # |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 4 | |
| 5 | config SUPPORT_OF_CONTROL |
| 6 | bool |
| 7 | |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 8 | config PYLIBFDT |
| 9 | bool |
| 10 | |
| 11 | config DTOC |
| 12 | bool |
| 13 | select PYLIBFDT |
| 14 | |
| 15 | config BINMAN |
| 16 | bool |
| 17 | select DTOC |
| 18 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 19 | menu "Device Tree Control" |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 20 | depends on SUPPORT_OF_CONTROL |
| 21 | |
| 22 | config OF_CONTROL |
| 23 | bool "Run-time configuration via Device Tree" |
Simon Glass | d727ace | 2023-02-01 13:20:27 -0700 | [diff] [blame] | 24 | select OF_LIBFDT |
| 25 | select OF_REAL |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 26 | help |
| 27 | This feature provides for run-time configuration of U-Boot |
| 28 | via a flattened device tree. |
| 29 | |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 30 | config OF_REAL |
Simon Glass | 414cc15 | 2021-08-07 07:24:03 -0600 | [diff] [blame] | 31 | bool |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 32 | 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.cc | 2a79275 | 2017-02-22 16:07:22 +0100 | [diff] [blame] | 38 | config 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 Yamada | dffb86e | 2015-08-12 07:31:54 +0900 | [diff] [blame] | 48 | config SPL_OF_CONTROL |
| 49 | bool "Enable run-time configuration via Device Tree in SPL" |
| 50 | depends on SPL && OF_CONTROL |
Sean Anderson | 327bb3b | 2019-12-17 21:40:09 -0500 | [diff] [blame] | 51 | select SPL_OF_LIBFDT if !SPL_OF_PLATDATA |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 52 | select SPL_OF_REAL if !SPL_OF_PLATDATA |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 53 | help |
| 54 | Some boards use device tree in U-Boot but only have 4KB of SRAM |
Walter Lozano | c9acae3 | 2019-10-22 11:50:19 -0300 | [diff] [blame] | 55 | which is not enough to support device tree. Disable this option to |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 56 | allow such boards to be supported by U-Boot SPL. |
| 57 | |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 58 | config TPL_OF_CONTROL |
| 59 | bool "Enable run-time configuration via Device Tree in TPL" |
| 60 | depends on TPL && OF_CONTROL |
Sean Anderson | 327bb3b | 2019-12-17 21:40:09 -0500 | [diff] [blame] | 61 | select TPL_OF_LIBFDT if !TPL_OF_PLATDATA |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 62 | select TPL_OF_REAL if !TPL_OF_PLATDATA |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 63 | 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 Glass | 747093d | 2022-04-30 00:56:53 -0600 | [diff] [blame] | 68 | config 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 Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 77 | config OF_LIVE |
| 78 | bool "Enable use of a live tree" |
Bin Meng | ced4c31 | 2021-02-03 21:20:03 +0800 | [diff] [blame] | 79 | depends on DM && OF_CONTROL |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 80 | 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 Simek | 4adc660 | 2018-08-17 10:16:36 +0200 | [diff] [blame] | 83 | tree does not support modification from within U-Boot since it |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 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. |
| 87 | |
Sumit Garg | e3a9829 | 2024-02-22 15:06:01 +0530 | [diff] [blame] | 88 | config 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 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 104 | choice |
| 105 | prompt "Provider of DTB for DT control" |
| 106 | depends on OF_CONTROL |
| 107 | |
| 108 | config OF_SEPARATE |
| 109 | bool "Separate DTB for DT control" |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 110 | help |
| 111 | If this option is enabled, the device tree will be built and |
| 112 | placed as a separate u-boot.dtb file alongside the U-Boot image. |
| 113 | |
| 114 | config OF_EMBED |
| 115 | bool "Embedded DTB for DT control" |
| 116 | help |
| 117 | If this option is enabled, the device tree will be picked up and |
Simon Glass | 3d3f60c | 2015-08-31 18:47:52 -0600 | [diff] [blame] | 118 | built into the U-Boot image. This is suitable for local debugging |
| 119 | and development only and is not recommended for production devices. |
| 120 | Boards in the mainline U-Boot tree should not use it. |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 121 | |
Simon Glass | 836eac7 | 2021-12-16 20:59:21 -0700 | [diff] [blame] | 122 | endchoice |
| 123 | |
Alex Deymo | 82f766d | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 124 | config OF_BOARD |
Ilias Apalodimas | 2e8d2f8 | 2021-10-12 00:00:13 +0300 | [diff] [blame] | 125 | bool "Provided by the board (e.g a previous loader) at runtime" |
Simon Glass | 275b483 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 126 | default y if SANDBOX || OF_HAS_PRIOR_STAGE |
Alex Deymo | 82f766d | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 127 | help |
Simon Glass | 275b483 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 128 | If this option is enabled, the device tree is provided at runtime by |
| 129 | a custom function called board_fdt_blob_setup(). The board must |
| 130 | implement this function if it wishes to provide special behaviour. |
Alex Deymo | 82f766d | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 131 | |
Simon Glass | 275b483 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 132 | With this option, the device tree build by U-Boot may be overridden or |
| 133 | ignored. See OF_HAS_PRIOR_STAGE. |
| 134 | |
| 135 | Note: Boards which use this to handle a device tree passed from an |
| 136 | earlier stage should enable OF_HAS_PRIOR_STAGE. |
| 137 | |
| 138 | config OF_HAS_PRIOR_STAGE |
| 139 | bool |
Raymond Mao | 2b71470 | 2024-02-03 08:36:27 -0800 | [diff] [blame] | 140 | depends on !BLOBLIST |
Simon Glass | 275b483 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 141 | help |
| 142 | Indicates that a prior stage of the firmware (before U-Boot proper) |
| 143 | makes use of device tree and this board normally boots with that prior |
| 144 | stage, that provides a devicetree to U-Boot. |
| 145 | |
| 146 | This means that the device tree built in U-Boot should not be packaged |
| 147 | in the firmware image. Instead, the prior stage's device tree should |
| 148 | be so packaged. At runtime, the prior stage reads this, does any |
| 149 | necessary fix-ups, then passes it to U-Boot. See OF_BOARD. |
| 150 | |
| 151 | This option does not preclude using the U-Boot device tree, e.g. for |
| 152 | development purposes, but it is not recommended, and likely will not |
| 153 | even work, for production systems. |
| 154 | |
| 155 | Note: This option must be set in Kconfig and cannot be enabled or |
| 156 | disabled in the board's defconfig file. |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 157 | |
Simon Glass | b7d8e85 | 2021-12-16 20:59:38 -0700 | [diff] [blame] | 158 | config OF_OMIT_DTB |
| 159 | bool "Omit the device tree output when building" |
| 160 | default y if OF_HAS_PRIOR_STAGE && !BINMAN |
| 161 | help |
| 162 | As a special case, avoid writing a device tree file u-boot.dtb when |
| 163 | building. Also don't include that file in u-boot.bin |
| 164 | |
| 165 | This is used for boards which normally provide a devicetree via a |
| 166 | runtime mechanism (such as OF_BOARD), to avoid confusion. |
| 167 | |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 168 | config DEFAULT_DEVICE_TREE |
| 169 | string "Default Device Tree for DT control" |
Simon Glass | 70d4109 | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 170 | depends on OF_CONTROL |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 171 | help |
| 172 | This option specifies the default Device Tree used for DT control. |
Robert P. J. Day | 5699ea6 | 2014-10-21 16:44:32 -0400 | [diff] [blame] | 173 | It can be overridden from the command line: |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 174 | $ make DEVICE_TREE=<device-tree-name> |
| 175 | |
Rasmus Villemoes | a77f468 | 2021-11-21 14:52:51 +0100 | [diff] [blame] | 176 | config DEVICE_TREE_INCLUDES |
| 177 | string "Extra .dtsi files to include when building DT control" |
| 178 | depends on OF_CONTROL |
| 179 | help |
| 180 | U-Boot's control .dtb is usually built from an in-tree .dts |
| 181 | file, plus (if available) an in-tree U-Boot-specific .dtsi |
| 182 | file. This option specifies a space-separated list of extra |
| 183 | .dtsi files that will also be used. |
| 184 | |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 185 | config OF_LIST |
Rasmus Villemoes | 3609e1d | 2022-01-10 14:34:41 +0100 | [diff] [blame] | 186 | string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT |
| 187 | depends on OF_CONTROL |
Michal Simek | c409bd0 | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 188 | default DEFAULT_DEVICE_TREE |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 189 | help |
| 190 | This option specifies a list of device tree files to use for DT |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 191 | control. These will be packaged into a FIT. At run-time, U-Boot |
Cooper Jr., Franklin | d979740 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 192 | or SPL will select the correct DT to use by examining the |
| 193 | hardware (e.g. reading a board ID value). This is a list of |
| 194 | device tree files (without the directory or .dtb suffix) |
| 195 | separated by <space>. |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 196 | |
Jean-Jacques Hiblot | 557bc97 | 2019-10-22 16:39:21 +0200 | [diff] [blame] | 197 | config OF_OVERLAY_LIST |
| 198 | string "List of device tree overlays to include for DT control" |
| 199 | depends on SPL_LOAD_FIT_APPLY_OVERLAY |
| 200 | help |
| 201 | This option specifies a list of device tree overlays to use for DT |
| 202 | control. This option can then be used by a FIT generator to include |
| 203 | the overlays in the FIT image. |
| 204 | |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 205 | choice |
Baruch Siach | 574e386 | 2019-10-07 15:05:47 +0300 | [diff] [blame] | 206 | prompt "OF LIST compression" |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 207 | depends on MULTI_DTB_FIT |
| 208 | default MULTI_DTB_FIT_NO_COMPRESSION |
| 209 | |
| 210 | config MULTI_DTB_FIT_LZO |
| 211 | bool "LZO" |
| 212 | depends on SYS_MALLOC_F |
| 213 | select LZO |
| 214 | help |
| 215 | Compress the FIT image containing the DTBs available for the SPL |
| 216 | using LZO compression. (requires lzop on host). |
| 217 | |
| 218 | config MULTI_DTB_FIT_GZIP |
| 219 | bool "GZIP" |
| 220 | depends on SYS_MALLOC_F |
| 221 | select GZIP |
| 222 | help |
| 223 | Compress the FIT image containing the DTBs available for the SPL |
| 224 | using GZIP compression. (requires gzip on host) |
| 225 | |
| 226 | config MULTI_DTB_FIT_NO_COMPRESSION |
| 227 | bool "No compression" |
| 228 | help |
| 229 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 230 | Use this options only if LZO is not available and the DTBs are very small. |
| 231 | endchoice |
| 232 | |
| 233 | choice |
| 234 | prompt "Location of uncompressed DTBs" |
| 235 | depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO) |
| 236 | default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 237 | |
| 238 | config MULTI_DTB_FIT_DYN_ALLOC |
| 239 | bool "Dynamically allocate the memory" |
| 240 | depends on SYS_MALLOC_F |
| 241 | |
| 242 | config MULTI_DTB_FIT_USER_DEFINED_AREA |
| 243 | bool "User-defined location" |
| 244 | endchoice |
| 245 | |
| 246 | config MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 247 | hex "Size of memory reserved to uncompress the DTBs" |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 248 | default 0x8000 |
| 249 | help |
| 250 | This is the size of this area where the DTBs are uncompressed. |
| 251 | If this area is dynamically allocated, make sure that |
| 252 | SYS_MALLOC_F_LEN is big enough to contain it. |
| 253 | |
| 254 | config MULTI_DTB_FIT_USER_DEF_ADDR |
| 255 | hex "Address of memory where dtbs are uncompressed" |
| 256 | depends on MULTI_DTB_FIT_USER_DEFINED_AREA |
| 257 | help |
| 258 | the FIT image containing the DTBs is uncompressed in an area defined |
| 259 | at compilation time. This is the address of this area. It must be |
| 260 | aligned on 2-byte boundary. |
Jean-Jacques Hiblot | 1195559 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 261 | |
| 262 | config DTB_RESELECT |
| 263 | bool "Support swapping dtbs at a later point in boot" |
| 264 | depends on MULTI_DTB_FIT |
| 265 | help |
| 266 | It is possible during initial boot you may need to use a generic |
| 267 | dtb until you can fully determine the board your running on. This |
| 268 | config allows boards to implement a function at a later point |
| 269 | during boot to switch to the "correct" dtb. |
| 270 | |
| 271 | config MULTI_DTB_FIT |
| 272 | bool "Support embedding several DTBs in a FIT image for u-boot" |
| 273 | help |
Michal Simek | 1be82af | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 274 | This option provides hooks to allow U-Boot to parse an |
Jean-Jacques Hiblot | 1195559 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 275 | appended FIT image and enable board specific code to then select |
| 276 | the correct DTB to be used. Use this if you need to support |
| 277 | multiple DTBs but don't use the SPL. |
| 278 | |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 279 | |
| 280 | config SPL_MULTI_DTB_FIT |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 281 | depends on SPL_LOAD_FIT && SPL_OF_REAL |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 282 | bool "Support embedding several DTBs in a FIT image for the SPL" |
| 283 | help |
| 284 | This option provides the SPL with the ability to select its own |
| 285 | DTB at runtime from an appended FIT image containing several DTBs. |
| 286 | This allows using the same SPL binary on multiple platforms. |
| 287 | The primary purpose is to handle different versions of |
| 288 | the same platform without tweaking the platform code if the |
| 289 | differences can be expressed in the DTBs (common examples are: bus |
| 290 | capabilities, pad configurations). |
| 291 | |
| 292 | config SPL_OF_LIST |
Rasmus Villemoes | 3609e1d | 2022-01-10 14:34:41 +0100 | [diff] [blame] | 293 | string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT |
| 294 | depends on SPL_OF_CONTROL |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 295 | default OF_LIST |
| 296 | help |
| 297 | This option specifies a list of device tree files to use for DT |
| 298 | control in the SPL. These will be packaged into a FIT. At run-time, |
| 299 | the SPL will select the correct DT to use by examining the |
| 300 | hardware (e.g. reading a board ID value). This is a list of |
| 301 | device tree files (without the directory or .dtb suffix) |
| 302 | separated by <space>. |
| 303 | |
| 304 | choice |
| 305 | prompt "SPL OF LIST compression" |
| 306 | depends on SPL_MULTI_DTB_FIT |
| 307 | default SPL_MULTI_DTB_FIT_LZO |
| 308 | |
| 309 | config SPL_MULTI_DTB_FIT_LZO |
| 310 | bool "LZO" |
| 311 | depends on SYS_MALLOC_F |
| 312 | select SPL_LZO |
| 313 | help |
| 314 | Compress the FIT image containing the DTBs available for the SPL |
| 315 | using LZO compression. (requires lzop on host). |
| 316 | |
| 317 | config SPL_MULTI_DTB_FIT_GZIP |
| 318 | bool "GZIP" |
| 319 | depends on SYS_MALLOC_F |
| 320 | select SPL_GZIP |
| 321 | help |
| 322 | Compress the FIT image containing the DTBs available for the SPL |
| 323 | using GZIP compression. (requires gzip on host) |
| 324 | |
| 325 | config SPL_MULTI_DTB_FIT_NO_COMPRESSION |
| 326 | bool "No compression" |
| 327 | help |
| 328 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 329 | Use this options only if LZO is not available and the DTBs are very small. |
| 330 | endchoice |
| 331 | |
| 332 | choice |
Michal Simek | b844805 | 2018-07-23 08:38:56 +0200 | [diff] [blame] | 333 | prompt "Location of uncompressed DTBs" |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 334 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 335 | default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 336 | |
| 337 | config SPL_MULTI_DTB_FIT_DYN_ALLOC |
| 338 | bool "Dynamically allocate the memory" |
| 339 | depends on SYS_MALLOC_F |
| 340 | |
| 341 | config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 342 | bool "User-defined location" |
| 343 | endchoice |
| 344 | |
| 345 | config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 346 | hex "Size of memory reserved to uncompress the DTBs" |
| 347 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 348 | default 0x8000 |
| 349 | help |
| 350 | This is the size of this area where the DTBs are uncompressed. |
| 351 | If this area is dynamically allocated, make sure that |
| 352 | SPL_SYS_MALLOC_F_LEN is big enough to contain it. |
| 353 | |
| 354 | config SPL_MULTI_DTB_FIT_USER_DEF_ADDR |
| 355 | hex "Address of memory where dtbs are uncompressed" |
| 356 | depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 357 | help |
| 358 | the FIT image containing the DTBs is uncompressed in an area defined |
| 359 | at compilation time. This is the address of this area. It must be |
| 360 | aligned on 2-byte boundary. |
| 361 | |
Simon Glass | c74e034 | 2023-02-13 08:56:32 -0700 | [diff] [blame] | 362 | config OF_TAG_MIGRATE |
| 363 | bool "Ease migration from old device trees with u-boot,dm- tags" |
| 364 | default y |
| 365 | help |
| 366 | U-Boot moved over to use new tags to mark device tree nodes which need |
| 367 | to be processed in SPL, before relocation, etc. Enable this option to |
| 368 | detect old tags and handle them. |
| 369 | |
| 370 | Note: This option will be removed after the 2023.07 release. |
| 371 | |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 372 | config OF_SPL_REMOVE_PROPS |
| 373 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | 897705e | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 374 | depends on SPL_OF_CONTROL |
Michal Simek | f00d89f | 2019-02-22 10:50:23 +0100 | [diff] [blame] | 375 | default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK |
| 376 | default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL |
| 377 | default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK |
| 378 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts" |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 379 | help |
| 380 | Since SPL normally runs in a reduced memory space, the device tree |
| 381 | is cut down to only what is needed to load and start U-Boot. Only |
Simon Glass | e316fba | 2023-02-13 08:56:34 -0700 | [diff] [blame] | 382 | nodes marked with the property "bootph-all" will be |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 383 | included. In addition, some properties are not used by U-Boot and |
| 384 | can be discarded. This option defines the list of properties to |
| 385 | discard. |
| 386 | |
Anatolij Gustschin | 43b6e38 | 2020-01-12 15:57:42 +0100 | [diff] [blame] | 387 | config OF_DTB_PROPS_REMOVE |
| 388 | bool "Enable removal of device tree properties" |
| 389 | depends on OF_CONTROL |
| 390 | help |
| 391 | Some boards have restricted amount of storage for U-Boot image. |
| 392 | If the generated binary doesn't fit into available image storage, |
| 393 | the built-in device tree could probably be cut down by removing |
| 394 | some not required device tree properties to reduce the image size. |
| 395 | Enable this option and define the properties to be removed in the |
| 396 | CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must |
| 397 | pass the built-in DTB directly to the kernel! |
| 398 | |
| 399 | config OF_REMOVE_PROPS |
| 400 | string "List of device tree properties to drop" |
| 401 | depends on OF_DTB_PROPS_REMOVE |
| 402 | default "interrupt-parent interrupts" if PINCTRL |
| 403 | help |
| 404 | Some properties are not used by U-Boot and can be discarded. |
| 405 | This option defines the list of properties to discard. |
| 406 | |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 407 | config SPL_OF_PLATDATA |
| 408 | bool "Generate platform data for use in SPL" |
| 409 | depends on SPL_OF_CONTROL |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 410 | select DTOC |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 411 | select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 412 | help |
| 413 | For very constrained SPL environments the overhead of decoding |
| 414 | device tree nodes and converting their contents into platform data |
| 415 | is too large. This overhead includes libfdt code as well as the |
| 416 | device tree contents itself. The latter is fairly compact, but the |
| 417 | former can add 3KB or more to a Thumb 2 Image. |
| 418 | |
| 419 | This option enables generation of platform data from the device |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 420 | tree as C code. This code creates devices using U_BOOT_DRVINFO() |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 421 | declarations. The benefit is that it allows driver code to access |
| 422 | the platform data directly in C structures, avoidin the libfdt |
| 423 | overhead. |
| 424 | |
| 425 | This option works by generating C structure declarations for each |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 426 | compatible string, then adding platform data and U_BOOT_DRVINFO |
Simon Goldschmidt | 3600b46 | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 427 | declarations for each node. See of-plat.txt for more information. |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 428 | |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 429 | config SPL_OF_REAL |
Sean Anderson | eaf7385 | 2023-10-14 16:47:46 -0400 | [diff] [blame] | 430 | bool "Support a real devicetree in SPL" if SANDBOX |
| 431 | depends on SPL_OF_CONTROL |
| 432 | select SPL_OF_LIBFDT |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 433 | help |
| 434 | Indicates that a real devicetree is available which can be accessed |
| 435 | at runtime. This means that dev_read_...() functions can be used to |
Sean Anderson | eaf7385 | 2023-10-14 16:47:46 -0400 | [diff] [blame] | 436 | read data from the devicetree for each device. You do not need to |
| 437 | enable this option if you have enabled SPL_OF_PLATDATA. |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 438 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 439 | if SPL_OF_PLATDATA |
| 440 | |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 441 | config SPL_OF_PLATDATA_PARENT |
| 442 | bool "Support parent information in devices" |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 443 | default y |
| 444 | help |
| 445 | Generally it is useful to be able to access the parent of a device |
| 446 | with of-platdata. To save space this can be disabled, but in that |
| 447 | case dev_get_parent() will always return NULL; |
| 448 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 449 | config SPL_OF_PLATDATA_INST |
| 450 | bool "Declare devices at build time" |
| 451 | help |
| 452 | Declare devices as udevice instances so that they do not need to be |
| 453 | bound when U-Boot starts. This can save time and code space. |
| 454 | |
Simon Glass | 1ef3af3 | 2021-03-15 17:25:15 +1300 | [diff] [blame] | 455 | config SPL_OF_PLATDATA_NO_BIND |
| 456 | bool "Don't allow run-time binding of devices" |
| 457 | depends on SPL_OF_PLATDATA_INST |
| 458 | default y |
| 459 | help |
| 460 | This removes the ability to bind devices at run time, thus saving |
| 461 | some code space in U-Boot. This can be disabled if binding is needed, |
| 462 | at the code of some code size increase. |
| 463 | |
Simon Glass | 95a5825 | 2021-03-15 17:25:35 +1300 | [diff] [blame] | 464 | config SPL_OF_PLATDATA_RT |
| 465 | bool "Use a separate struct for device runtime data" |
| 466 | depends on SPL_OF_PLATDATA_INST |
| 467 | default y |
| 468 | help |
| 469 | For systems running SPL from read-only memory it is convenient to |
| 470 | separate out the runtime information, so that the devices don't need |
| 471 | to be copied before being used. This moves the read-write parts of |
| 472 | struct udevice (at present just the flags) into a separate struct, |
| 473 | which is allocated at runtime. |
| 474 | |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 475 | config SPL_OF_PLATDATA_DRIVER_RT |
| 476 | bool |
| 477 | help |
| 478 | Use a separate struct for driver runtime data. |
| 479 | |
| 480 | This enables the driver_rt information, used with of-platdata when |
| 481 | of-platdata-inst is not used. It allows finding devices by their |
| 482 | driver data. |
| 483 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 484 | endif |
| 485 | |
Simon Glass | eaad01a | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 486 | config TPL_OF_REAL |
| 487 | bool |
| 488 | help |
| 489 | Indicates that a real devicetree is available which can be accessed |
| 490 | at runtime. This means that dev_read_...() functions can be used to |
| 491 | read data from the devicetree for each device. This is true if |
| 492 | TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA |
| 493 | |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 494 | config TPL_OF_PLATDATA |
| 495 | bool "Generate platform data for use in TPL" |
| 496 | depends on TPL_OF_CONTROL |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 497 | select DTOC |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 498 | select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 499 | help |
| 500 | For very constrained SPL environments the overhead of decoding |
| 501 | device tree nodes and converting their contents into platform data |
| 502 | is too large. This overhead includes libfdt code as well as the |
| 503 | device tree contents itself. The latter is fairly compact, but the |
| 504 | former can add 3KB or more to a Thumb 2 Image. |
| 505 | |
| 506 | This option enables generation of platform data from the device |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 507 | tree as C code. This code creates devices using U_BOOT_DRVINFO() |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 508 | declarations. The benefit is that it allows driver code to access |
| 509 | the platform data directly in C structures, avoidin the libfdt |
| 510 | overhead. |
| 511 | |
| 512 | This option works by generating C structure declarations for each |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 513 | compatible string, then adding platform data and U_BOOT_DRVINFO |
Simon Goldschmidt | 3600b46 | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 514 | declarations for each node. See of-plat.txt for more information. |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 515 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 516 | if TPL_OF_PLATDATA |
| 517 | |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 518 | config TPL_OF_PLATDATA_PARENT |
| 519 | bool "Support parent information in devices" |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 520 | default y |
| 521 | help |
| 522 | Generally it is useful to be able to access the parent of a device |
| 523 | with of-platdata. To save space this can be disabled, but in that |
| 524 | case dev_get_parent() will always return NULL; |
| 525 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 526 | config TPL_OF_PLATDATA_INST |
| 527 | bool "Declare devices at build time" |
| 528 | |
| 529 | help |
| 530 | Declare devices as udevice instances so that they do not need to be |
| 531 | bound when U-Boot starts. This can save time and code space. |
| 532 | |
Simon Glass | 1ef3af3 | 2021-03-15 17:25:15 +1300 | [diff] [blame] | 533 | config TPL_OF_PLATDATA_NO_BIND |
| 534 | bool "Don't allow run-time binding of devices" |
| 535 | depends on TPL_OF_PLATDATA_INST |
| 536 | default y |
| 537 | help |
| 538 | This removes the ability to bind devices at run time, thus saving |
| 539 | some code space in U-Boot. This can be disabled if binding is needed, |
| 540 | at the code of some code size increase. |
| 541 | |
Simon Glass | 95a5825 | 2021-03-15 17:25:35 +1300 | [diff] [blame] | 542 | config TPL_OF_PLATDATA_RT |
| 543 | bool "Use a separate struct for device runtime data" |
| 544 | depends on TPL_OF_PLATDATA_INST |
| 545 | default y |
| 546 | help |
| 547 | For systems running TPL from read-only memory it is convenient to |
| 548 | separate out the runtime information, so that the devices don't need |
| 549 | to be copied before being used. This moves the read-write parts of |
| 550 | struct udevice (at present just the flags) into a separate struct, |
| 551 | which is allocated at runtime. |
| 552 | |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 553 | config TPL_OF_PLATDATA_DRIVER_RT |
| 554 | bool |
| 555 | help |
| 556 | Use a separate struct for driver runtime data. |
| 557 | |
| 558 | This enables the driver_rt information, used with of-platdata when |
| 559 | of-platdata-inst is not used. It allows finding devices by their |
| 560 | driver data. |
| 561 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 562 | endif |
| 563 | |
Simon Glass | 747093d | 2022-04-30 00:56:53 -0600 | [diff] [blame] | 564 | config VPL_OF_REAL |
| 565 | def_bool y |
Tom Rini | 13ce351 | 2022-06-08 08:24:40 -0400 | [diff] [blame] | 566 | depends on VPL |
Simon Glass | 747093d | 2022-04-30 00:56:53 -0600 | [diff] [blame] | 567 | help |
| 568 | Indicates that a real devicetree is available which can be accessed |
| 569 | at runtime. This means that dev_read_...() functions can be used to |
| 570 | read data from the devicetree for each device. This is true if |
| 571 | TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA |
| 572 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 573 | endmenu |