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 | |
Tom Rini | 36dd5f1 | 2017-09-23 13:00:57 -0400 | [diff] [blame] | 8 | config DTC |
| 9 | bool |
| 10 | |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 11 | config PYLIBFDT |
| 12 | bool |
| 13 | |
| 14 | config DTOC |
| 15 | bool |
| 16 | select PYLIBFDT |
| 17 | |
| 18 | config BINMAN |
| 19 | bool |
| 20 | select DTOC |
| 21 | |
Bin Meng | 31eefd4 | 2021-05-10 20:23:37 +0800 | [diff] [blame] | 22 | config BINMAN_STANDALONE_FDT |
| 23 | bool |
| 24 | depends on BINMAN |
| 25 | default y if OF_BOARD || OF_PRIOR_STAGE |
| 26 | help |
| 27 | This option tells U-Boot build system that a standalone device tree |
| 28 | source is explicitly required when using binman to package U-Boot. |
| 29 | |
| 30 | This is not necessary in a common scenario where a device tree source |
| 31 | that contains the binman node is provided in the arch/<arch>/dts |
| 32 | directory for a specific board. Such device tree sources are built for |
| 33 | OF_SEPARATE or OF_EMBED. However for a scenario like the board device |
| 34 | tree blob is not provided in the U-Boot build tree, but fed to U-Boot |
| 35 | in the runtime, e.g.: in the OF_PRIOR_STAGE case that it is passed by |
| 36 | a prior stage bootloader. For such scenario, a standalone device tree |
| 37 | blob containing binman node to describe how to package U-Boot should |
| 38 | be provided explicitly. |
| 39 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 40 | menu "Device Tree Control" |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 41 | depends on SUPPORT_OF_CONTROL |
| 42 | |
| 43 | config OF_CONTROL |
| 44 | bool "Run-time configuration via Device Tree" |
Tom Rini | 36dd5f1 | 2017-09-23 13:00:57 -0400 | [diff] [blame] | 45 | select DTC |
Sean Anderson | 327bb3b | 2019-12-17 21:40:09 -0500 | [diff] [blame] | 46 | select OF_LIBFDT if !OF_PLATDATA |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 47 | help |
| 48 | This feature provides for run-time configuration of U-Boot |
| 49 | via a flattened device tree. |
| 50 | |
mario.six@gdsys.cc | 2a79275 | 2017-02-22 16:07:22 +0100 | [diff] [blame] | 51 | config OF_BOARD_FIXUP |
| 52 | bool "Board-specific manipulation of Device Tree" |
| 53 | help |
| 54 | In certain circumstances it is necessary to be able to modify |
| 55 | U-Boot's device tree (e.g. to delete device from it). This option |
| 56 | make the Device Tree writeable and provides a board-specific |
| 57 | "board_fix_fdt" callback (called during pre-relocation time), which |
| 58 | enables the board initialization to modifiy the Device Tree. The |
| 59 | modified copy is subsequently used by U-Boot after relocation. |
| 60 | |
Masahiro Yamada | dffb86e | 2015-08-12 07:31:54 +0900 | [diff] [blame] | 61 | config SPL_OF_CONTROL |
| 62 | bool "Enable run-time configuration via Device Tree in SPL" |
| 63 | depends on SPL && OF_CONTROL |
Sean Anderson | 327bb3b | 2019-12-17 21:40:09 -0500 | [diff] [blame] | 64 | select SPL_OF_LIBFDT if !SPL_OF_PLATDATA |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 65 | help |
| 66 | 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] | 67 | which is not enough to support device tree. Disable this option to |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 68 | allow such boards to be supported by U-Boot SPL. |
| 69 | |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 70 | config TPL_OF_CONTROL |
| 71 | bool "Enable run-time configuration via Device Tree in TPL" |
| 72 | depends on TPL && OF_CONTROL |
Sean Anderson | 327bb3b | 2019-12-17 21:40:09 -0500 | [diff] [blame] | 73 | select TPL_OF_LIBFDT if !TPL_OF_PLATDATA |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 74 | help |
| 75 | Some boards use device tree in U-Boot but only have 4KB of SRAM |
| 76 | which is not enough to support device tree. Enable this option to |
| 77 | allow such boards to be supported by U-Boot TPL. |
| 78 | |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 79 | config OF_LIVE |
| 80 | bool "Enable use of a live tree" |
Bin Meng | ced4c31 | 2021-02-03 21:20:03 +0800 | [diff] [blame] | 81 | depends on DM && OF_CONTROL |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 82 | help |
| 83 | Normally U-Boot uses a flat device tree which saves space and |
| 84 | avoids the need to unpack the tree before use. However a flat |
Michal Simek | 4adc660 | 2018-08-17 10:16:36 +0200 | [diff] [blame] | 85 | tree does not support modification from within U-Boot since it |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 86 | can invalidate driver-model device tree offsets. This option |
| 87 | enables a live tree which is available after relocation, |
| 88 | and can be adjusted as needed. |
| 89 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 90 | choice |
| 91 | prompt "Provider of DTB for DT control" |
| 92 | depends on OF_CONTROL |
| 93 | |
| 94 | config OF_SEPARATE |
| 95 | bool "Separate DTB for DT control" |
| 96 | depends on !SANDBOX |
| 97 | help |
| 98 | If this option is enabled, the device tree will be built and |
| 99 | placed as a separate u-boot.dtb file alongside the U-Boot image. |
| 100 | |
| 101 | config OF_EMBED |
| 102 | bool "Embedded DTB for DT control" |
| 103 | help |
| 104 | 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] | 105 | built into the U-Boot image. This is suitable for local debugging |
| 106 | and development only and is not recommended for production devices. |
| 107 | Boards in the mainline U-Boot tree should not use it. |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 108 | |
Alex Deymo | 82f766d | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 109 | config OF_BOARD |
| 110 | bool "Provided by the board at runtime" |
| 111 | depends on !SANDBOX |
| 112 | help |
| 113 | If this option is enabled, the device tree will be provided by |
| 114 | the board at runtime if the board supports it, instead of being |
| 115 | bundled with the image. |
| 116 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 117 | config OF_HOSTFILE |
| 118 | bool "Host filed DTB for DT control" |
| 119 | depends on SANDBOX |
| 120 | help |
| 121 | If this option is enabled, DTB will be read from a file on startup. |
| 122 | This is only useful for Sandbox. Use the -d flag to U-Boot to |
| 123 | specify the file to read. |
| 124 | |
Thomas Fitzsimmons | 894c3ad | 2018-06-08 17:59:45 -0400 | [diff] [blame] | 125 | config OF_PRIOR_STAGE |
| 126 | bool "Prior stage bootloader DTB for DT control" |
| 127 | help |
| 128 | If this option is enabled, the device tree used for DT |
| 129 | control will be read from a device tree binary, at a memory |
| 130 | location passed to U-Boot by the prior stage bootloader. |
| 131 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 132 | endchoice |
| 133 | |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 134 | config DEFAULT_DEVICE_TREE |
| 135 | string "Default Device Tree for DT control" |
Simon Glass | 70d4109 | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 136 | depends on OF_CONTROL |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 137 | help |
| 138 | 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] | 139 | It can be overridden from the command line: |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 140 | $ make DEVICE_TREE=<device-tree-name> |
| 141 | |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 142 | config OF_LIST |
| 143 | string "List of device tree files to include for DT control" |
Jean-Jacques Hiblot | 1195559 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 144 | depends on SPL_LOAD_FIT || MULTI_DTB_FIT |
Michal Simek | c409bd0 | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 145 | default DEFAULT_DEVICE_TREE |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 146 | help |
| 147 | This option specifies a list of device tree files to use for DT |
Cooper Jr., Franklin | d979740 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 148 | control. These will be packaged into a FIT. At run-time, U-boot |
| 149 | or SPL will select the correct DT to use by examining the |
| 150 | hardware (e.g. reading a board ID value). This is a list of |
| 151 | device tree files (without the directory or .dtb suffix) |
| 152 | separated by <space>. |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 153 | |
Jean-Jacques Hiblot | 557bc97 | 2019-10-22 16:39:21 +0200 | [diff] [blame] | 154 | config OF_OVERLAY_LIST |
| 155 | string "List of device tree overlays to include for DT control" |
| 156 | depends on SPL_LOAD_FIT_APPLY_OVERLAY |
| 157 | help |
| 158 | This option specifies a list of device tree overlays to use for DT |
| 159 | control. This option can then be used by a FIT generator to include |
| 160 | the overlays in the FIT image. |
| 161 | |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 162 | choice |
Baruch Siach | 574e386 | 2019-10-07 15:05:47 +0300 | [diff] [blame] | 163 | prompt "OF LIST compression" |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 164 | depends on MULTI_DTB_FIT |
| 165 | default MULTI_DTB_FIT_NO_COMPRESSION |
| 166 | |
| 167 | config MULTI_DTB_FIT_LZO |
| 168 | bool "LZO" |
| 169 | depends on SYS_MALLOC_F |
| 170 | select LZO |
| 171 | help |
| 172 | Compress the FIT image containing the DTBs available for the SPL |
| 173 | using LZO compression. (requires lzop on host). |
| 174 | |
| 175 | config MULTI_DTB_FIT_GZIP |
| 176 | bool "GZIP" |
| 177 | depends on SYS_MALLOC_F |
| 178 | select GZIP |
| 179 | help |
| 180 | Compress the FIT image containing the DTBs available for the SPL |
| 181 | using GZIP compression. (requires gzip on host) |
| 182 | |
| 183 | config MULTI_DTB_FIT_NO_COMPRESSION |
| 184 | bool "No compression" |
| 185 | help |
| 186 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 187 | Use this options only if LZO is not available and the DTBs are very small. |
| 188 | endchoice |
| 189 | |
| 190 | choice |
| 191 | prompt "Location of uncompressed DTBs" |
| 192 | depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO) |
| 193 | default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 194 | |
| 195 | config MULTI_DTB_FIT_DYN_ALLOC |
| 196 | bool "Dynamically allocate the memory" |
| 197 | depends on SYS_MALLOC_F |
| 198 | |
| 199 | config MULTI_DTB_FIT_USER_DEFINED_AREA |
| 200 | bool "User-defined location" |
| 201 | endchoice |
| 202 | |
| 203 | config MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 204 | hex "Size of memory reserved to uncompress the DTBs" |
| 205 | depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO) |
| 206 | default 0x8000 |
| 207 | help |
| 208 | This is the size of this area where the DTBs are uncompressed. |
| 209 | If this area is dynamically allocated, make sure that |
| 210 | SYS_MALLOC_F_LEN is big enough to contain it. |
| 211 | |
| 212 | config MULTI_DTB_FIT_USER_DEF_ADDR |
| 213 | hex "Address of memory where dtbs are uncompressed" |
| 214 | depends on MULTI_DTB_FIT_USER_DEFINED_AREA |
| 215 | help |
| 216 | the FIT image containing the DTBs is uncompressed in an area defined |
| 217 | at compilation time. This is the address of this area. It must be |
| 218 | aligned on 2-byte boundary. |
Jean-Jacques Hiblot | 1195559 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 219 | |
| 220 | config DTB_RESELECT |
| 221 | bool "Support swapping dtbs at a later point in boot" |
| 222 | depends on MULTI_DTB_FIT |
| 223 | help |
| 224 | It is possible during initial boot you may need to use a generic |
| 225 | dtb until you can fully determine the board your running on. This |
| 226 | config allows boards to implement a function at a later point |
| 227 | during boot to switch to the "correct" dtb. |
| 228 | |
| 229 | config MULTI_DTB_FIT |
| 230 | bool "Support embedding several DTBs in a FIT image for u-boot" |
| 231 | help |
| 232 | This option provides hooks to allow U-boot to parse an |
| 233 | appended FIT image and enable board specific code to then select |
| 234 | the correct DTB to be used. Use this if you need to support |
| 235 | multiple DTBs but don't use the SPL. |
| 236 | |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 237 | |
| 238 | config SPL_MULTI_DTB_FIT |
| 239 | depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA |
| 240 | bool "Support embedding several DTBs in a FIT image for the SPL" |
| 241 | help |
| 242 | This option provides the SPL with the ability to select its own |
| 243 | DTB at runtime from an appended FIT image containing several DTBs. |
| 244 | This allows using the same SPL binary on multiple platforms. |
| 245 | The primary purpose is to handle different versions of |
| 246 | the same platform without tweaking the platform code if the |
| 247 | differences can be expressed in the DTBs (common examples are: bus |
| 248 | capabilities, pad configurations). |
| 249 | |
| 250 | config SPL_OF_LIST |
| 251 | string "List of device tree files to include for DT control in SPL" |
| 252 | depends on SPL_MULTI_DTB_FIT |
| 253 | default OF_LIST |
| 254 | help |
| 255 | This option specifies a list of device tree files to use for DT |
| 256 | control in the SPL. These will be packaged into a FIT. At run-time, |
| 257 | the SPL will select the correct DT to use by examining the |
| 258 | hardware (e.g. reading a board ID value). This is a list of |
| 259 | device tree files (without the directory or .dtb suffix) |
| 260 | separated by <space>. |
| 261 | |
| 262 | choice |
| 263 | prompt "SPL OF LIST compression" |
| 264 | depends on SPL_MULTI_DTB_FIT |
| 265 | default SPL_MULTI_DTB_FIT_LZO |
| 266 | |
| 267 | config SPL_MULTI_DTB_FIT_LZO |
| 268 | bool "LZO" |
| 269 | depends on SYS_MALLOC_F |
| 270 | select SPL_LZO |
| 271 | help |
| 272 | Compress the FIT image containing the DTBs available for the SPL |
| 273 | using LZO compression. (requires lzop on host). |
| 274 | |
| 275 | config SPL_MULTI_DTB_FIT_GZIP |
| 276 | bool "GZIP" |
| 277 | depends on SYS_MALLOC_F |
| 278 | select SPL_GZIP |
| 279 | help |
| 280 | Compress the FIT image containing the DTBs available for the SPL |
| 281 | using GZIP compression. (requires gzip on host) |
| 282 | |
| 283 | config SPL_MULTI_DTB_FIT_NO_COMPRESSION |
| 284 | bool "No compression" |
| 285 | help |
| 286 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 287 | Use this options only if LZO is not available and the DTBs are very small. |
| 288 | endchoice |
| 289 | |
| 290 | choice |
Michal Simek | b844805 | 2018-07-23 08:38:56 +0200 | [diff] [blame] | 291 | prompt "Location of uncompressed DTBs" |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 292 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 293 | default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 294 | |
| 295 | config SPL_MULTI_DTB_FIT_DYN_ALLOC |
| 296 | bool "Dynamically allocate the memory" |
| 297 | depends on SYS_MALLOC_F |
| 298 | |
| 299 | config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 300 | bool "User-defined location" |
| 301 | endchoice |
| 302 | |
| 303 | config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 304 | hex "Size of memory reserved to uncompress the DTBs" |
| 305 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 306 | default 0x8000 |
| 307 | help |
| 308 | This is the size of this area where the DTBs are uncompressed. |
| 309 | If this area is dynamically allocated, make sure that |
| 310 | SPL_SYS_MALLOC_F_LEN is big enough to contain it. |
| 311 | |
| 312 | config SPL_MULTI_DTB_FIT_USER_DEF_ADDR |
| 313 | hex "Address of memory where dtbs are uncompressed" |
| 314 | depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 315 | help |
| 316 | the FIT image containing the DTBs is uncompressed in an area defined |
| 317 | at compilation time. This is the address of this area. It must be |
| 318 | aligned on 2-byte boundary. |
| 319 | |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 320 | config OF_SPL_REMOVE_PROPS |
| 321 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | 897705e | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 322 | depends on SPL_OF_CONTROL |
Michal Simek | f00d89f | 2019-02-22 10:50:23 +0100 | [diff] [blame] | 323 | default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK |
| 324 | default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL |
| 325 | default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK |
| 326 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts" |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 327 | help |
| 328 | Since SPL normally runs in a reduced memory space, the device tree |
| 329 | is cut down to only what is needed to load and start U-Boot. Only |
| 330 | nodes marked with the property "u-boot,dm-pre-reloc" will be |
| 331 | included. In addition, some properties are not used by U-Boot and |
| 332 | can be discarded. This option defines the list of properties to |
| 333 | discard. |
| 334 | |
Anatolij Gustschin | 43b6e38 | 2020-01-12 15:57:42 +0100 | [diff] [blame] | 335 | config OF_DTB_PROPS_REMOVE |
| 336 | bool "Enable removal of device tree properties" |
| 337 | depends on OF_CONTROL |
| 338 | help |
| 339 | Some boards have restricted amount of storage for U-Boot image. |
| 340 | If the generated binary doesn't fit into available image storage, |
| 341 | the built-in device tree could probably be cut down by removing |
| 342 | some not required device tree properties to reduce the image size. |
| 343 | Enable this option and define the properties to be removed in the |
| 344 | CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must |
| 345 | pass the built-in DTB directly to the kernel! |
| 346 | |
| 347 | config OF_REMOVE_PROPS |
| 348 | string "List of device tree properties to drop" |
| 349 | depends on OF_DTB_PROPS_REMOVE |
| 350 | default "interrupt-parent interrupts" if PINCTRL |
| 351 | help |
| 352 | Some properties are not used by U-Boot and can be discarded. |
| 353 | This option defines the list of properties to discard. |
| 354 | |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 355 | config SPL_OF_PLATDATA |
| 356 | bool "Generate platform data for use in SPL" |
| 357 | depends on SPL_OF_CONTROL |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 358 | select DTOC |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 359 | select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 360 | help |
| 361 | For very constrained SPL environments the overhead of decoding |
| 362 | device tree nodes and converting their contents into platform data |
| 363 | is too large. This overhead includes libfdt code as well as the |
| 364 | device tree contents itself. The latter is fairly compact, but the |
| 365 | former can add 3KB or more to a Thumb 2 Image. |
| 366 | |
| 367 | This option enables generation of platform data from the device |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 368 | tree as C code. This code creates devices using U_BOOT_DRVINFO() |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 369 | declarations. The benefit is that it allows driver code to access |
| 370 | the platform data directly in C structures, avoidin the libfdt |
| 371 | overhead. |
| 372 | |
| 373 | This option works by generating C structure declarations for each |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 374 | compatible string, then adding platform data and U_BOOT_DRVINFO |
Simon Goldschmidt | 3600b46 | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 375 | declarations for each node. See of-plat.txt for more information. |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 376 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 377 | if SPL_OF_PLATDATA |
| 378 | |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 379 | config SPL_OF_PLATDATA_PARENT |
| 380 | bool "Support parent information in devices" |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 381 | default y |
| 382 | help |
| 383 | Generally it is useful to be able to access the parent of a device |
| 384 | with of-platdata. To save space this can be disabled, but in that |
| 385 | case dev_get_parent() will always return NULL; |
| 386 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 387 | config SPL_OF_PLATDATA_INST |
| 388 | bool "Declare devices at build time" |
| 389 | help |
| 390 | Declare devices as udevice instances so that they do not need to be |
| 391 | bound when U-Boot starts. This can save time and code space. |
| 392 | |
Simon Glass | 1ef3af3 | 2021-03-15 17:25:15 +1300 | [diff] [blame] | 393 | config SPL_OF_PLATDATA_NO_BIND |
| 394 | bool "Don't allow run-time binding of devices" |
| 395 | depends on SPL_OF_PLATDATA_INST |
| 396 | default y |
| 397 | help |
| 398 | This removes the ability to bind devices at run time, thus saving |
| 399 | some code space in U-Boot. This can be disabled if binding is needed, |
| 400 | at the code of some code size increase. |
| 401 | |
Simon Glass | 95a5825 | 2021-03-15 17:25:35 +1300 | [diff] [blame] | 402 | config SPL_OF_PLATDATA_RT |
| 403 | bool "Use a separate struct for device runtime data" |
| 404 | depends on SPL_OF_PLATDATA_INST |
| 405 | default y |
| 406 | help |
| 407 | For systems running SPL from read-only memory it is convenient to |
| 408 | separate out the runtime information, so that the devices don't need |
| 409 | to be copied before being used. This moves the read-write parts of |
| 410 | struct udevice (at present just the flags) into a separate struct, |
| 411 | which is allocated at runtime. |
| 412 | |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 413 | config SPL_OF_PLATDATA_DRIVER_RT |
| 414 | bool |
| 415 | help |
| 416 | Use a separate struct for driver runtime data. |
| 417 | |
| 418 | This enables the driver_rt information, used with of-platdata when |
| 419 | of-platdata-inst is not used. It allows finding devices by their |
| 420 | driver data. |
| 421 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 422 | endif |
| 423 | |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 424 | config TPL_OF_PLATDATA |
| 425 | bool "Generate platform data for use in TPL" |
| 426 | depends on TPL_OF_CONTROL |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 427 | select DTOC |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 428 | select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 429 | help |
| 430 | For very constrained SPL environments the overhead of decoding |
| 431 | device tree nodes and converting their contents into platform data |
| 432 | is too large. This overhead includes libfdt code as well as the |
| 433 | device tree contents itself. The latter is fairly compact, but the |
| 434 | former can add 3KB or more to a Thumb 2 Image. |
| 435 | |
| 436 | This option enables generation of platform data from the device |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 437 | tree as C code. This code creates devices using U_BOOT_DRVINFO() |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 438 | declarations. The benefit is that it allows driver code to access |
| 439 | the platform data directly in C structures, avoidin the libfdt |
| 440 | overhead. |
| 441 | |
| 442 | This option works by generating C structure declarations for each |
Simon Glass | 20e442a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 443 | compatible string, then adding platform data and U_BOOT_DRVINFO |
Simon Goldschmidt | 3600b46 | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 444 | declarations for each node. See of-plat.txt for more information. |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 445 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 446 | if TPL_OF_PLATDATA |
| 447 | |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 448 | config TPL_OF_PLATDATA_PARENT |
| 449 | bool "Support parent information in devices" |
Simon Glass | e41651f | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 450 | default y |
| 451 | help |
| 452 | Generally it is useful to be able to access the parent of a device |
| 453 | with of-platdata. To save space this can be disabled, but in that |
| 454 | case dev_get_parent() will always return NULL; |
| 455 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 456 | config TPL_OF_PLATDATA_INST |
| 457 | bool "Declare devices at build time" |
| 458 | |
| 459 | help |
| 460 | Declare devices as udevice instances so that they do not need to be |
| 461 | bound when U-Boot starts. This can save time and code space. |
| 462 | |
Simon Glass | 1ef3af3 | 2021-03-15 17:25:15 +1300 | [diff] [blame] | 463 | config TPL_OF_PLATDATA_NO_BIND |
| 464 | bool "Don't allow run-time binding of devices" |
| 465 | depends on TPL_OF_PLATDATA_INST |
| 466 | default y |
| 467 | help |
| 468 | This removes the ability to bind devices at run time, thus saving |
| 469 | some code space in U-Boot. This can be disabled if binding is needed, |
| 470 | at the code of some code size increase. |
| 471 | |
Simon Glass | 95a5825 | 2021-03-15 17:25:35 +1300 | [diff] [blame] | 472 | config TPL_OF_PLATDATA_RT |
| 473 | bool "Use a separate struct for device runtime data" |
| 474 | depends on TPL_OF_PLATDATA_INST |
| 475 | default y |
| 476 | help |
| 477 | For systems running TPL from read-only memory it is convenient to |
| 478 | separate out the runtime information, so that the devices don't need |
| 479 | to be copied before being used. This moves the read-write parts of |
| 480 | struct udevice (at present just the flags) into a separate struct, |
| 481 | which is allocated at runtime. |
| 482 | |
Simon Glass | ab933d8 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 483 | config TPL_OF_PLATDATA_DRIVER_RT |
| 484 | bool |
| 485 | help |
| 486 | Use a separate struct for driver runtime data. |
| 487 | |
| 488 | This enables the driver_rt information, used with of-platdata when |
| 489 | of-platdata-inst is not used. It allows finding devices by their |
| 490 | driver data. |
| 491 | |
Simon Glass | 5a1b25c | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 492 | endif |
| 493 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 494 | endmenu |