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