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