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 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 22 | menu "Device Tree Control" |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 23 | depends on SUPPORT_OF_CONTROL |
| 24 | |
| 25 | config OF_CONTROL |
| 26 | bool "Run-time configuration via Device Tree" |
Tom Rini | 36dd5f1 | 2017-09-23 13:00:57 -0400 | [diff] [blame] | 27 | select DTC |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 28 | help |
| 29 | This feature provides for run-time configuration of U-Boot |
| 30 | via a flattened device tree. |
| 31 | |
mario.six@gdsys.cc | 2a79275 | 2017-02-22 16:07:22 +0100 | [diff] [blame] | 32 | config OF_BOARD_FIXUP |
| 33 | bool "Board-specific manipulation of Device Tree" |
| 34 | help |
| 35 | In certain circumstances it is necessary to be able to modify |
| 36 | U-Boot's device tree (e.g. to delete device from it). This option |
| 37 | make the Device Tree writeable and provides a board-specific |
| 38 | "board_fix_fdt" callback (called during pre-relocation time), which |
| 39 | enables the board initialization to modifiy the Device Tree. The |
| 40 | modified copy is subsequently used by U-Boot after relocation. |
| 41 | |
Masahiro Yamada | dffb86e | 2015-08-12 07:31:54 +0900 | [diff] [blame] | 42 | config SPL_OF_CONTROL |
| 43 | bool "Enable run-time configuration via Device Tree in SPL" |
| 44 | depends on SPL && OF_CONTROL |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 45 | help |
| 46 | 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] | 47 | which is not enough to support device tree. Disable this option to |
Simon Glass | 2860f03 | 2015-02-27 22:06:38 -0700 | [diff] [blame] | 48 | allow such boards to be supported by U-Boot SPL. |
| 49 | |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 50 | config TPL_OF_CONTROL |
| 51 | bool "Enable run-time configuration via Device Tree in TPL" |
| 52 | depends on TPL && OF_CONTROL |
| 53 | help |
| 54 | Some boards use device tree in U-Boot but only have 4KB of SRAM |
| 55 | which is not enough to support device tree. Enable this option to |
| 56 | allow such boards to be supported by U-Boot TPL. |
| 57 | |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 58 | config OF_LIVE |
| 59 | bool "Enable use of a live tree" |
| 60 | depends on OF_CONTROL |
| 61 | help |
| 62 | Normally U-Boot uses a flat device tree which saves space and |
| 63 | avoids the need to unpack the tree before use. However a flat |
Michal Simek | 4adc660 | 2018-08-17 10:16:36 +0200 | [diff] [blame] | 64 | tree does not support modification from within U-Boot since it |
Simon Glass | 5e060d8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 65 | can invalidate driver-model device tree offsets. This option |
| 66 | enables a live tree which is available after relocation, |
| 67 | and can be adjusted as needed. |
| 68 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 69 | choice |
| 70 | prompt "Provider of DTB for DT control" |
| 71 | depends on OF_CONTROL |
| 72 | |
| 73 | config OF_SEPARATE |
| 74 | bool "Separate DTB for DT control" |
| 75 | depends on !SANDBOX |
| 76 | help |
| 77 | If this option is enabled, the device tree will be built and |
| 78 | placed as a separate u-boot.dtb file alongside the U-Boot image. |
| 79 | |
| 80 | config OF_EMBED |
| 81 | bool "Embedded DTB for DT control" |
| 82 | help |
| 83 | 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] | 84 | built into the U-Boot image. This is suitable for local debugging |
| 85 | and development only and is not recommended for production devices. |
| 86 | Boards in the mainline U-Boot tree should not use it. |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 87 | |
Alex Deymo | 82f766d | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 88 | config OF_BOARD |
| 89 | bool "Provided by the board at runtime" |
| 90 | depends on !SANDBOX |
| 91 | help |
| 92 | If this option is enabled, the device tree will be provided by |
| 93 | the board at runtime if the board supports it, instead of being |
| 94 | bundled with the image. |
| 95 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 96 | config OF_HOSTFILE |
| 97 | bool "Host filed DTB for DT control" |
| 98 | depends on SANDBOX |
| 99 | help |
| 100 | If this option is enabled, DTB will be read from a file on startup. |
| 101 | This is only useful for Sandbox. Use the -d flag to U-Boot to |
| 102 | specify the file to read. |
| 103 | |
Thomas Fitzsimmons | 894c3ad | 2018-06-08 17:59:45 -0400 | [diff] [blame] | 104 | config OF_PRIOR_STAGE |
| 105 | bool "Prior stage bootloader DTB for DT control" |
| 106 | help |
| 107 | If this option is enabled, the device tree used for DT |
| 108 | control will be read from a device tree binary, at a memory |
| 109 | location passed to U-Boot by the prior stage bootloader. |
| 110 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 111 | endchoice |
| 112 | |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 113 | config DEFAULT_DEVICE_TREE |
| 114 | string "Default Device Tree for DT control" |
Simon Glass | 70d4109 | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 115 | depends on OF_CONTROL |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 116 | help |
| 117 | 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] | 118 | It can be overridden from the command line: |
Masahiro Yamada | f1ef2b6 | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 119 | $ make DEVICE_TREE=<device-tree-name> |
| 120 | |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 121 | config OF_LIST |
| 122 | string "List of device tree files to include for DT control" |
Jean-Jacques Hiblot | 1195559 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 123 | depends on SPL_LOAD_FIT || MULTI_DTB_FIT |
Michal Simek | c409bd0 | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 124 | default DEFAULT_DEVICE_TREE |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 125 | help |
| 126 | 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] | 127 | control. These will be packaged into a FIT. At run-time, U-boot |
| 128 | or SPL will select the correct DT to use by examining the |
| 129 | hardware (e.g. reading a board ID value). This is a list of |
| 130 | device tree files (without the directory or .dtb suffix) |
| 131 | separated by <space>. |
Simon Glass | cdf1724 | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 132 | |
Jean-Jacques Hiblot | 557bc97 | 2019-10-22 16:39:21 +0200 | [diff] [blame] | 133 | config OF_OVERLAY_LIST |
| 134 | string "List of device tree overlays to include for DT control" |
| 135 | depends on SPL_LOAD_FIT_APPLY_OVERLAY |
| 136 | help |
| 137 | This option specifies a list of device tree overlays to use for DT |
| 138 | control. This option can then be used by a FIT generator to include |
| 139 | the overlays in the FIT image. |
| 140 | |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 141 | choice |
Baruch Siach | 574e386 | 2019-10-07 15:05:47 +0300 | [diff] [blame] | 142 | prompt "OF LIST compression" |
Marek Vasut | 95f4bbd | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 143 | depends on MULTI_DTB_FIT |
| 144 | default MULTI_DTB_FIT_NO_COMPRESSION |
| 145 | |
| 146 | config MULTI_DTB_FIT_LZO |
| 147 | bool "LZO" |
| 148 | depends on SYS_MALLOC_F |
| 149 | select LZO |
| 150 | help |
| 151 | Compress the FIT image containing the DTBs available for the SPL |
| 152 | using LZO compression. (requires lzop on host). |
| 153 | |
| 154 | config MULTI_DTB_FIT_GZIP |
| 155 | bool "GZIP" |
| 156 | depends on SYS_MALLOC_F |
| 157 | select GZIP |
| 158 | help |
| 159 | Compress the FIT image containing the DTBs available for the SPL |
| 160 | using GZIP compression. (requires gzip on host) |
| 161 | |
| 162 | config MULTI_DTB_FIT_NO_COMPRESSION |
| 163 | bool "No compression" |
| 164 | help |
| 165 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 166 | Use this options only if LZO is not available and the DTBs are very small. |
| 167 | endchoice |
| 168 | |
| 169 | choice |
| 170 | prompt "Location of uncompressed DTBs" |
| 171 | depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO) |
| 172 | default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 173 | |
| 174 | config MULTI_DTB_FIT_DYN_ALLOC |
| 175 | bool "Dynamically allocate the memory" |
| 176 | depends on SYS_MALLOC_F |
| 177 | |
| 178 | config MULTI_DTB_FIT_USER_DEFINED_AREA |
| 179 | bool "User-defined location" |
| 180 | endchoice |
| 181 | |
| 182 | config MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 183 | hex "Size of memory reserved to uncompress the DTBs" |
| 184 | depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO) |
| 185 | default 0x8000 |
| 186 | help |
| 187 | This is the size of this area where the DTBs are uncompressed. |
| 188 | If this area is dynamically allocated, make sure that |
| 189 | SYS_MALLOC_F_LEN is big enough to contain it. |
| 190 | |
| 191 | config MULTI_DTB_FIT_USER_DEF_ADDR |
| 192 | hex "Address of memory where dtbs are uncompressed" |
| 193 | depends on MULTI_DTB_FIT_USER_DEFINED_AREA |
| 194 | help |
| 195 | the FIT image containing the DTBs is uncompressed in an area defined |
| 196 | at compilation time. This is the address of this area. It must be |
| 197 | aligned on 2-byte boundary. |
Jean-Jacques Hiblot | 1195559 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 198 | |
| 199 | config DTB_RESELECT |
| 200 | bool "Support swapping dtbs at a later point in boot" |
| 201 | depends on MULTI_DTB_FIT |
| 202 | help |
| 203 | It is possible during initial boot you may need to use a generic |
| 204 | dtb until you can fully determine the board your running on. This |
| 205 | config allows boards to implement a function at a later point |
| 206 | during boot to switch to the "correct" dtb. |
| 207 | |
| 208 | config MULTI_DTB_FIT |
| 209 | bool "Support embedding several DTBs in a FIT image for u-boot" |
| 210 | help |
| 211 | This option provides hooks to allow U-boot to parse an |
| 212 | appended FIT image and enable board specific code to then select |
| 213 | the correct DTB to be used. Use this if you need to support |
| 214 | multiple DTBs but don't use the SPL. |
| 215 | |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 216 | |
| 217 | config SPL_MULTI_DTB_FIT |
| 218 | depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA |
| 219 | bool "Support embedding several DTBs in a FIT image for the SPL" |
| 220 | help |
| 221 | This option provides the SPL with the ability to select its own |
| 222 | DTB at runtime from an appended FIT image containing several DTBs. |
| 223 | This allows using the same SPL binary on multiple platforms. |
| 224 | The primary purpose is to handle different versions of |
| 225 | the same platform without tweaking the platform code if the |
| 226 | differences can be expressed in the DTBs (common examples are: bus |
| 227 | capabilities, pad configurations). |
| 228 | |
| 229 | config SPL_OF_LIST |
| 230 | string "List of device tree files to include for DT control in SPL" |
| 231 | depends on SPL_MULTI_DTB_FIT |
| 232 | default OF_LIST |
| 233 | help |
| 234 | This option specifies a list of device tree files to use for DT |
| 235 | control in the SPL. These will be packaged into a FIT. At run-time, |
| 236 | the SPL will select the correct DT to use by examining the |
| 237 | hardware (e.g. reading a board ID value). This is a list of |
| 238 | device tree files (without the directory or .dtb suffix) |
| 239 | separated by <space>. |
| 240 | |
| 241 | choice |
| 242 | prompt "SPL OF LIST compression" |
| 243 | depends on SPL_MULTI_DTB_FIT |
| 244 | default SPL_MULTI_DTB_FIT_LZO |
| 245 | |
| 246 | config SPL_MULTI_DTB_FIT_LZO |
| 247 | bool "LZO" |
| 248 | depends on SYS_MALLOC_F |
| 249 | select SPL_LZO |
| 250 | help |
| 251 | Compress the FIT image containing the DTBs available for the SPL |
| 252 | using LZO compression. (requires lzop on host). |
| 253 | |
| 254 | config SPL_MULTI_DTB_FIT_GZIP |
| 255 | bool "GZIP" |
| 256 | depends on SYS_MALLOC_F |
| 257 | select SPL_GZIP |
| 258 | help |
| 259 | Compress the FIT image containing the DTBs available for the SPL |
| 260 | using GZIP compression. (requires gzip on host) |
| 261 | |
| 262 | config SPL_MULTI_DTB_FIT_NO_COMPRESSION |
| 263 | bool "No compression" |
| 264 | help |
| 265 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 266 | Use this options only if LZO is not available and the DTBs are very small. |
| 267 | endchoice |
| 268 | |
| 269 | choice |
Michal Simek | b844805 | 2018-07-23 08:38:56 +0200 | [diff] [blame] | 270 | prompt "Location of uncompressed DTBs" |
Jean-Jacques Hiblot | 2f57c95 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 271 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 272 | default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 273 | |
| 274 | config SPL_MULTI_DTB_FIT_DYN_ALLOC |
| 275 | bool "Dynamically allocate the memory" |
| 276 | depends on SYS_MALLOC_F |
| 277 | |
| 278 | config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 279 | bool "User-defined location" |
| 280 | endchoice |
| 281 | |
| 282 | config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 283 | hex "Size of memory reserved to uncompress the DTBs" |
| 284 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 285 | default 0x8000 |
| 286 | help |
| 287 | This is the size of this area where the DTBs are uncompressed. |
| 288 | If this area is dynamically allocated, make sure that |
| 289 | SPL_SYS_MALLOC_F_LEN is big enough to contain it. |
| 290 | |
| 291 | config SPL_MULTI_DTB_FIT_USER_DEF_ADDR |
| 292 | hex "Address of memory where dtbs are uncompressed" |
| 293 | depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 294 | help |
| 295 | the FIT image containing the DTBs is uncompressed in an area defined |
| 296 | at compilation time. This is the address of this area. It must be |
| 297 | aligned on 2-byte boundary. |
| 298 | |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 299 | config OF_SPL_REMOVE_PROPS |
| 300 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | 897705e | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 301 | depends on SPL_OF_CONTROL |
Michal Simek | f00d89f | 2019-02-22 10:50:23 +0100 | [diff] [blame] | 302 | default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK |
| 303 | default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL |
| 304 | default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK |
| 305 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts" |
Simon Glass | fa78e0a | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 306 | help |
| 307 | Since SPL normally runs in a reduced memory space, the device tree |
| 308 | is cut down to only what is needed to load and start U-Boot. Only |
| 309 | nodes marked with the property "u-boot,dm-pre-reloc" will be |
| 310 | included. In addition, some properties are not used by U-Boot and |
| 311 | can be discarded. This option defines the list of properties to |
| 312 | discard. |
| 313 | |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 314 | config SPL_OF_PLATDATA |
| 315 | bool "Generate platform data for use in SPL" |
| 316 | depends on SPL_OF_CONTROL |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 317 | select DTOC |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 318 | help |
| 319 | For very constrained SPL environments the overhead of decoding |
| 320 | device tree nodes and converting their contents into platform data |
| 321 | is too large. This overhead includes libfdt code as well as the |
| 322 | device tree contents itself. The latter is fairly compact, but the |
| 323 | former can add 3KB or more to a Thumb 2 Image. |
| 324 | |
| 325 | This option enables generation of platform data from the device |
| 326 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 327 | declarations. The benefit is that it allows driver code to access |
| 328 | the platform data directly in C structures, avoidin the libfdt |
| 329 | overhead. |
| 330 | |
| 331 | This option works by generating C structure declarations for each |
| 332 | compatible string, then adding platform data and U_BOOT_DEVICE |
Simon Goldschmidt | 3600b46 | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 333 | declarations for each node. See of-plat.txt for more information. |
Simon Glass | 2789ddb | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 334 | |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 335 | config TPL_OF_PLATDATA |
| 336 | bool "Generate platform data for use in TPL" |
| 337 | depends on TPL_OF_CONTROL |
Masahiro Yamada | d6a0c78 | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 338 | select DTOC |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 339 | help |
| 340 | For very constrained SPL environments the overhead of decoding |
| 341 | device tree nodes and converting their contents into platform data |
| 342 | is too large. This overhead includes libfdt code as well as the |
| 343 | device tree contents itself. The latter is fairly compact, but the |
| 344 | former can add 3KB or more to a Thumb 2 Image. |
| 345 | |
| 346 | This option enables generation of platform data from the device |
| 347 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 348 | declarations. The benefit is that it allows driver code to access |
| 349 | the platform data directly in C structures, avoidin the libfdt |
| 350 | overhead. |
| 351 | |
| 352 | This option works by generating C structure declarations for each |
| 353 | compatible string, then adding platform data and U_BOOT_DEVICE |
Simon Goldschmidt | 3600b46 | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 354 | declarations for each node. See of-plat.txt for more information. |
Philipp Tomsich | f291ce1 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 355 | |
Masahiro Yamada | 783e6a7 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 356 | endmenu |
Tom Rini | 1f6049e | 2017-09-23 23:14:33 -0400 | [diff] [blame] | 357 | |
| 358 | config MKIMAGE_DTC_PATH |
| 359 | string "Path to dtc binary for use within mkimage" |
| 360 | default "dtc" |
| 361 | help |
| 362 | The mkimage host tool will, in order to generate FIT images make |
| 363 | calls to the dtc application in order to create the output. In |
| 364 | some cases the system dtc may not support all required features |
| 365 | and the path to a different version should be given here. |