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