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