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" |
Simon Glass | 1501a83 | 2023-02-01 13:20:27 -0700 | [diff] [blame] | 24 | select OF_LIBFDT |
| 25 | select OF_REAL |
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 | e7ca7da | 2022-04-30 00:56:53 -0600 | [diff] [blame] | 68 | config VPL_OF_CONTROL |
| 69 | bool "Enable run-time configuration via Device Tree in VPL" |
| 70 | depends on VPL && OF_CONTROL |
| 71 | default y if SPL_OF_CONTROL |
| 72 | help |
| 73 | Some boards use device tree in U-Boot but only have 4KB of SRAM |
| 74 | which is not enough to support device tree. Enable this option to |
| 75 | allow such boards to be supported by U-Boot VPL. |
| 76 | |
Simon Glass | a6eedb8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 77 | config OF_LIVE |
| 78 | bool "Enable use of a live tree" |
Bin Meng | 85f737b | 2021-02-03 21:20:03 +0800 | [diff] [blame] | 79 | depends on DM && OF_CONTROL |
Simon Glass | a6eedb8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 80 | help |
| 81 | Normally U-Boot uses a flat device tree which saves space and |
| 82 | avoids the need to unpack the tree before use. However a flat |
Michal Simek | 97a0e49 | 2018-08-17 10:16:36 +0200 | [diff] [blame] | 83 | tree does not support modification from within U-Boot since it |
Simon Glass | a6eedb8 | 2017-05-18 20:08:53 -0600 | [diff] [blame] | 84 | can invalidate driver-model device tree offsets. This option |
| 85 | enables a live tree which is available after relocation, |
| 86 | and can be adjusted as needed. |
| 87 | |
Sumit Garg | f7e5284 | 2024-02-22 15:06:01 +0530 | [diff] [blame] | 88 | config OF_UPSTREAM |
| 89 | bool "Enable use of devicetree imported from Linux kernel release" |
| 90 | help |
| 91 | Traditionally, U-Boot platforms used to have their custom devicetree |
| 92 | files or copy devicetree files from Linux kernel which are hard to |
| 93 | maintain and can usually get out-of-sync from Linux kernel. This |
| 94 | option enables platforms to migrate to devicetree-rebasing repo where |
| 95 | a regular sync will be maintained every major Linux kernel release |
| 96 | cycle. However, platforms can still have some custom u-boot specific |
| 97 | bits maintained as part of *-u-boot.dtsi files. |
| 98 | |
| 99 | Note: This option should be set in Kconfig, for the SoC as a whole. |
| 100 | However, newer boards whose devicetree source files haven't landed in |
| 101 | the dts/upstream subtree, they can override this option to have the |
| 102 | DT build from existing U-Boot tree location instead. |
| 103 | |
Caleb Connolly | 90b7b39 | 2024-04-18 19:39:58 +0100 | [diff] [blame] | 104 | config OF_UPSTREAM_BUILD_VENDOR |
| 105 | bool "Build all devicetree files for a particular vendor" |
| 106 | depends on OF_UPSTREAM |
| 107 | help |
| 108 | Enable building all devicetree files for a particular vendor. This |
| 109 | is useful for generic U-Boot configurations where many boards can |
| 110 | be supported with a single binary. |
| 111 | |
| 112 | This is only available for platforms using upstream devicetree. |
| 113 | |
| 114 | config OF_UPSTREAM_VENDOR |
| 115 | string "Vendor to build all upstream devicetree files for" |
| 116 | depends on OF_UPSTREAM_BUILD_VENDOR |
| 117 | default "qcom" if ARCH_SNAPDRAGON |
| 118 | default "rockchip" if ARCH_ROCKCHIP |
| 119 | default "amlogic" if ARCH_MESON |
| 120 | default "allwinner" if ARCH_SUNXI |
| 121 | default "mediatek" if ARCH_MEDIATEK |
| 122 | default "marvell" if ARCH_MVEBU || ARCH_KIRKWOOD |
| 123 | default "xilinx" if ARCH_VERSAL || ARCH_ZYNQ |
| 124 | default "nvidia" if ARCH_TEGRA |
| 125 | help |
| 126 | Select the vendor to build all devicetree files for. |
| 127 | |
Marek Vasut | b5abbf8 | 2024-10-17 03:08:40 +0200 | [diff] [blame] | 128 | config OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS |
| 129 | bool "Build local DTBOs as fallback for DTBOs missing upstream" |
| 130 | default n |
| 131 | depends on OF_UPSTREAM |
| 132 | help |
| 133 | Enable building DTBOs from arch/$(ARCH)/dts as a fallback for |
| 134 | DTBOs which are not part of Linux kernel upstream yet. This is |
| 135 | a stopgap measure to expedite OF_UPSTREAM switch for platforms |
| 136 | which already have main DT in Linux kernel upstream, but still |
| 137 | have leftover DTBOs in U-Boot tree. |
| 138 | |
| 139 | Do not use this option, upstream your DTs and DTBOs instead. |
| 140 | If the upstreaming is in progress, use with utmost caution. |
| 141 | |
| 142 | If unsure, say N. |
| 143 | |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 144 | choice |
| 145 | prompt "Provider of DTB for DT control" |
| 146 | depends on OF_CONTROL |
| 147 | |
| 148 | config OF_SEPARATE |
| 149 | bool "Separate DTB for DT control" |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 150 | help |
| 151 | If this option is enabled, the device tree will be built and |
| 152 | placed as a separate u-boot.dtb file alongside the U-Boot image. |
| 153 | |
| 154 | config OF_EMBED |
| 155 | bool "Embedded DTB for DT control" |
| 156 | help |
| 157 | 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] | 158 | built into the U-Boot image. This is suitable for local debugging |
| 159 | and development only and is not recommended for production devices. |
| 160 | Boards in the mainline U-Boot tree should not use it. |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 161 | |
Simon Glass | 4cea97f | 2021-12-16 20:59:21 -0700 | [diff] [blame] | 162 | endchoice |
| 163 | |
Pali Rohár | 64a15c8 | 2024-06-06 18:33:21 +0200 | [diff] [blame] | 164 | config OF_INITIAL_DTB_READONLY |
| 165 | bool "Initial DTB for DT control is read-only" |
| 166 | help |
| 167 | If initial DTB for DT control is read-only (e.g. points to |
| 168 | memory-mapped flash memory), then set this option. |
| 169 | |
Alex Deymo | 5b661ec | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 170 | config OF_BOARD |
Ilias Apalodimas | dc35df4 | 2021-10-12 00:00:13 +0300 | [diff] [blame] | 171 | bool "Provided by the board (e.g a previous loader) at runtime" |
Simon Glass | 3760439 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 172 | default y if SANDBOX || OF_HAS_PRIOR_STAGE |
Alex Deymo | 5b661ec | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 173 | help |
Simon Glass | 3760439 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 174 | If this option is enabled, the device tree is provided at runtime by |
| 175 | a custom function called board_fdt_blob_setup(). The board must |
| 176 | implement this function if it wishes to provide special behaviour. |
| 177 | |
| 178 | With this option, the device tree build by U-Boot may be overridden or |
| 179 | ignored. See OF_HAS_PRIOR_STAGE. |
| 180 | |
| 181 | Note: Boards which use this to handle a device tree passed from an |
| 182 | earlier stage should enable OF_HAS_PRIOR_STAGE. |
| 183 | |
| 184 | config OF_HAS_PRIOR_STAGE |
| 185 | bool |
Raymond Mao | ec91e6a | 2024-02-03 08:36:27 -0800 | [diff] [blame] | 186 | depends on !BLOBLIST |
Simon Glass | 3760439 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 187 | help |
| 188 | Indicates that a prior stage of the firmware (before U-Boot proper) |
| 189 | makes use of device tree and this board normally boots with that prior |
| 190 | stage, that provides a devicetree to U-Boot. |
| 191 | |
| 192 | This means that the device tree built in U-Boot should not be packaged |
| 193 | in the firmware image. Instead, the prior stage's device tree should |
| 194 | be so packaged. At runtime, the prior stage reads this, does any |
| 195 | necessary fix-ups, then passes it to U-Boot. See OF_BOARD. |
| 196 | |
| 197 | This option does not preclude using the U-Boot device tree, e.g. for |
| 198 | development purposes, but it is not recommended, and likely will not |
| 199 | even work, for production systems. |
Alex Deymo | 5b661ec | 2017-04-02 01:25:20 -0700 | [diff] [blame] | 200 | |
Simon Glass | 3760439 | 2021-12-16 20:59:35 -0700 | [diff] [blame] | 201 | Note: This option must be set in Kconfig and cannot be enabled or |
| 202 | disabled in the board's defconfig file. |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 203 | |
Simon Glass | 944f8d8 | 2021-12-16 20:59:38 -0700 | [diff] [blame] | 204 | config OF_OMIT_DTB |
| 205 | bool "Omit the device tree output when building" |
| 206 | default y if OF_HAS_PRIOR_STAGE && !BINMAN |
| 207 | help |
| 208 | As a special case, avoid writing a device tree file u-boot.dtb when |
| 209 | building. Also don't include that file in u-boot.bin |
| 210 | |
| 211 | This is used for boards which normally provide a devicetree via a |
| 212 | runtime mechanism (such as OF_BOARD), to avoid confusion. |
| 213 | |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 214 | config DEFAULT_DEVICE_TREE |
| 215 | string "Default Device Tree for DT control" |
Simon Glass | 644f5bc | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 216 | depends on OF_CONTROL |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 217 | help |
| 218 | 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] | 219 | It can be overridden from the command line: |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 220 | $ make DEVICE_TREE=<device-tree-name> |
| 221 | |
Rasmus Villemoes | 303d98d | 2021-11-21 14:52:51 +0100 | [diff] [blame] | 222 | config DEVICE_TREE_INCLUDES |
| 223 | string "Extra .dtsi files to include when building DT control" |
| 224 | depends on OF_CONTROL |
| 225 | help |
| 226 | U-Boot's control .dtb is usually built from an in-tree .dts |
| 227 | file, plus (if available) an in-tree U-Boot-specific .dtsi |
| 228 | file. This option specifies a space-separated list of extra |
| 229 | .dtsi files that will also be used. |
| 230 | |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 231 | config OF_LIST |
Rasmus Villemoes | c8481ef | 2022-01-10 14:34:41 +0100 | [diff] [blame] | 232 | string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT |
| 233 | depends on OF_CONTROL |
Michal Simek | 9b2e95a | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 234 | default DEFAULT_DEVICE_TREE |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 235 | help |
| 236 | This option specifies a list of device tree files to use for DT |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 237 | control. These will be packaged into a FIT. At run-time, U-Boot |
Cooper Jr., Franklin | 06c7b62 | 2017-06-16 17:25:09 -0500 | [diff] [blame] | 238 | or SPL will select the correct DT to use by examining the |
| 239 | hardware (e.g. reading a board ID value). This is a list of |
| 240 | device tree files (without the directory or .dtb suffix) |
| 241 | separated by <space>. |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 242 | |
Jean-Jacques Hiblot | 985cec3 | 2019-10-22 16:39:21 +0200 | [diff] [blame] | 243 | config OF_OVERLAY_LIST |
| 244 | string "List of device tree overlays to include for DT control" |
Jean-Jacques Hiblot | 985cec3 | 2019-10-22 16:39:21 +0200 | [diff] [blame] | 245 | help |
| 246 | This option specifies a list of device tree overlays to use for DT |
| 247 | control. This option can then be used by a FIT generator to include |
Jan Kiszka | f9ac68d | 2024-09-30 12:20:36 +0200 | [diff] [blame] | 248 | the overlays in the FIT image or by binman when assembling an image |
| 249 | that uses overlays during DT fixup. |
Jean-Jacques Hiblot | 985cec3 | 2019-10-22 16:39:21 +0200 | [diff] [blame] | 250 | |
Marek Vasut | aeaa29d | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 251 | choice |
Baruch Siach | 45508fc | 2019-10-07 15:05:47 +0300 | [diff] [blame] | 252 | prompt "OF LIST compression" |
Marek Vasut | aeaa29d | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 253 | depends on MULTI_DTB_FIT |
| 254 | default MULTI_DTB_FIT_NO_COMPRESSION |
| 255 | |
| 256 | config MULTI_DTB_FIT_LZO |
| 257 | bool "LZO" |
| 258 | depends on SYS_MALLOC_F |
| 259 | select LZO |
| 260 | help |
| 261 | Compress the FIT image containing the DTBs available for the SPL |
| 262 | using LZO compression. (requires lzop on host). |
| 263 | |
| 264 | config MULTI_DTB_FIT_GZIP |
| 265 | bool "GZIP" |
| 266 | depends on SYS_MALLOC_F |
| 267 | select GZIP |
| 268 | help |
| 269 | Compress the FIT image containing the DTBs available for the SPL |
| 270 | using GZIP compression. (requires gzip on host) |
| 271 | |
| 272 | config MULTI_DTB_FIT_NO_COMPRESSION |
| 273 | bool "No compression" |
| 274 | help |
| 275 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 276 | Use this options only if LZO is not available and the DTBs are very small. |
| 277 | endchoice |
| 278 | |
| 279 | choice |
| 280 | prompt "Location of uncompressed DTBs" |
| 281 | depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO) |
| 282 | default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 283 | |
| 284 | config MULTI_DTB_FIT_DYN_ALLOC |
| 285 | bool "Dynamically allocate the memory" |
| 286 | depends on SYS_MALLOC_F |
| 287 | |
| 288 | config MULTI_DTB_FIT_USER_DEFINED_AREA |
| 289 | bool "User-defined location" |
| 290 | endchoice |
| 291 | |
| 292 | config MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 293 | hex "Size of memory reserved to uncompress the DTBs" |
Marek Vasut | aeaa29d | 2019-03-08 16:06:55 +0100 | [diff] [blame] | 294 | default 0x8000 |
| 295 | help |
| 296 | This is the size of this area where the DTBs are uncompressed. |
| 297 | If this area is dynamically allocated, make sure that |
| 298 | SYS_MALLOC_F_LEN is big enough to contain it. |
| 299 | |
| 300 | config MULTI_DTB_FIT_USER_DEF_ADDR |
| 301 | hex "Address of memory where dtbs are uncompressed" |
| 302 | depends on MULTI_DTB_FIT_USER_DEFINED_AREA |
| 303 | help |
| 304 | the FIT image containing the DTBs is uncompressed in an area defined |
| 305 | at compilation time. This is the address of this area. It must be |
| 306 | aligned on 2-byte boundary. |
Jean-Jacques Hiblot | 2037fa4 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 307 | |
| 308 | config DTB_RESELECT |
| 309 | bool "Support swapping dtbs at a later point in boot" |
| 310 | depends on MULTI_DTB_FIT |
| 311 | help |
| 312 | It is possible during initial boot you may need to use a generic |
| 313 | dtb until you can fully determine the board your running on. This |
| 314 | config allows boards to implement a function at a later point |
| 315 | during boot to switch to the "correct" dtb. |
| 316 | |
| 317 | config MULTI_DTB_FIT |
| 318 | bool "Support embedding several DTBs in a FIT image for u-boot" |
| 319 | help |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 320 | This option provides hooks to allow U-Boot to parse an |
Jean-Jacques Hiblot | 2037fa4 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 321 | appended FIT image and enable board specific code to then select |
| 322 | the correct DTB to be used. Use this if you need to support |
| 323 | multiple DTBs but don't use the SPL. |
| 324 | |
Jean-Jacques Hiblot | a2fee16 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 325 | |
| 326 | config SPL_MULTI_DTB_FIT |
Simon Glass | 7c4ba16 | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 327 | depends on SPL_LOAD_FIT && SPL_OF_REAL |
Jean-Jacques Hiblot | a2fee16 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 328 | bool "Support embedding several DTBs in a FIT image for the SPL" |
| 329 | help |
| 330 | This option provides the SPL with the ability to select its own |
| 331 | DTB at runtime from an appended FIT image containing several DTBs. |
| 332 | This allows using the same SPL binary on multiple platforms. |
| 333 | The primary purpose is to handle different versions of |
| 334 | the same platform without tweaking the platform code if the |
| 335 | differences can be expressed in the DTBs (common examples are: bus |
| 336 | capabilities, pad configurations). |
| 337 | |
| 338 | config SPL_OF_LIST |
Rasmus Villemoes | c8481ef | 2022-01-10 14:34:41 +0100 | [diff] [blame] | 339 | string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT |
| 340 | depends on SPL_OF_CONTROL |
Jean-Jacques Hiblot | a2fee16 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 341 | default OF_LIST |
| 342 | help |
| 343 | This option specifies a list of device tree files to use for DT |
| 344 | control in the SPL. These will be packaged into a FIT. At run-time, |
| 345 | the SPL will select the correct DT to use by examining the |
| 346 | hardware (e.g. reading a board ID value). This is a list of |
| 347 | device tree files (without the directory or .dtb suffix) |
| 348 | separated by <space>. |
| 349 | |
| 350 | choice |
| 351 | prompt "SPL OF LIST compression" |
| 352 | depends on SPL_MULTI_DTB_FIT |
| 353 | default SPL_MULTI_DTB_FIT_LZO |
| 354 | |
| 355 | config SPL_MULTI_DTB_FIT_LZO |
| 356 | bool "LZO" |
| 357 | depends on SYS_MALLOC_F |
| 358 | select SPL_LZO |
| 359 | help |
| 360 | Compress the FIT image containing the DTBs available for the SPL |
| 361 | using LZO compression. (requires lzop on host). |
| 362 | |
| 363 | config SPL_MULTI_DTB_FIT_GZIP |
| 364 | bool "GZIP" |
| 365 | depends on SYS_MALLOC_F |
| 366 | select SPL_GZIP |
| 367 | help |
| 368 | Compress the FIT image containing the DTBs available for the SPL |
| 369 | using GZIP compression. (requires gzip on host) |
| 370 | |
| 371 | config SPL_MULTI_DTB_FIT_NO_COMPRESSION |
| 372 | bool "No compression" |
| 373 | help |
| 374 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 375 | Use this options only if LZO is not available and the DTBs are very small. |
| 376 | endchoice |
| 377 | |
| 378 | choice |
Michal Simek | c7df3a2 | 2018-07-23 08:38:56 +0200 | [diff] [blame] | 379 | prompt "Location of uncompressed DTBs" |
Jean-Jacques Hiblot | a2fee16 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 380 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 381 | default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 382 | |
| 383 | config SPL_MULTI_DTB_FIT_DYN_ALLOC |
| 384 | bool "Dynamically allocate the memory" |
| 385 | depends on SYS_MALLOC_F |
| 386 | |
| 387 | config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 388 | bool "User-defined location" |
| 389 | endchoice |
| 390 | |
| 391 | config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 392 | hex "Size of memory reserved to uncompress the DTBs" |
| 393 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 394 | default 0x8000 |
| 395 | help |
| 396 | This is the size of this area where the DTBs are uncompressed. |
| 397 | If this area is dynamically allocated, make sure that |
| 398 | SPL_SYS_MALLOC_F_LEN is big enough to contain it. |
| 399 | |
| 400 | config SPL_MULTI_DTB_FIT_USER_DEF_ADDR |
| 401 | hex "Address of memory where dtbs are uncompressed" |
| 402 | depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 403 | help |
| 404 | the FIT image containing the DTBs is uncompressed in an area defined |
| 405 | at compilation time. This is the address of this area. It must be |
| 406 | aligned on 2-byte boundary. |
| 407 | |
Simon Glass | c2727e5 | 2023-02-13 08:56:32 -0700 | [diff] [blame] | 408 | config OF_TAG_MIGRATE |
| 409 | bool "Ease migration from old device trees with u-boot,dm- tags" |
| 410 | default y |
| 411 | help |
| 412 | U-Boot moved over to use new tags to mark device tree nodes which need |
| 413 | to be processed in SPL, before relocation, etc. Enable this option to |
| 414 | detect old tags and handle them. |
| 415 | |
| 416 | Note: This option will be removed after the 2023.07 release. |
| 417 | |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 418 | config OF_SPL_REMOVE_PROPS |
| 419 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | ddb9aa97 | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 420 | depends on SPL_OF_CONTROL |
Michal Simek | de21807 | 2019-02-22 10:50:23 +0100 | [diff] [blame] | 421 | default "interrupt-parent interrupts" if SPL_PINCTRL && SPL_CLK |
| 422 | default "clocks clock-names interrupt-parent interrupts" if SPL_PINCTRL |
| 423 | default "pinctrl-0 pinctrl-names interrupt-parent interrupts" if SPL_CLK |
| 424 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts" |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 425 | help |
| 426 | Since SPL normally runs in a reduced memory space, the device tree |
| 427 | is cut down to only what is needed to load and start U-Boot. Only |
Simon Glass | fc1aa35 | 2023-02-13 08:56:34 -0700 | [diff] [blame] | 428 | nodes marked with the property "bootph-all" will be |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 429 | included. In addition, some properties are not used by U-Boot and |
| 430 | can be discarded. This option defines the list of properties to |
| 431 | discard. |
| 432 | |
Anatolij Gustschin | 0856834 | 2020-01-12 15:57:42 +0100 | [diff] [blame] | 433 | config OF_DTB_PROPS_REMOVE |
| 434 | bool "Enable removal of device tree properties" |
| 435 | depends on OF_CONTROL |
| 436 | help |
| 437 | Some boards have restricted amount of storage for U-Boot image. |
| 438 | If the generated binary doesn't fit into available image storage, |
| 439 | the built-in device tree could probably be cut down by removing |
| 440 | some not required device tree properties to reduce the image size. |
| 441 | Enable this option and define the properties to be removed in the |
| 442 | CONFIG_OF_REMOVE_PROPS list. Do not enable this option if you must |
| 443 | pass the built-in DTB directly to the kernel! |
| 444 | |
| 445 | config OF_REMOVE_PROPS |
| 446 | string "List of device tree properties to drop" |
| 447 | depends on OF_DTB_PROPS_REMOVE |
| 448 | default "interrupt-parent interrupts" if PINCTRL |
| 449 | help |
| 450 | Some properties are not used by U-Boot and can be discarded. |
| 451 | This option defines the list of properties to discard. |
| 452 | |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 453 | config SPL_OF_PLATDATA |
| 454 | bool "Generate platform data for use in SPL" |
| 455 | depends on SPL_OF_CONTROL |
Masahiro Yamada | 87247af | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 456 | select DTOC |
Simon Glass | 8beeb28 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 457 | select SPL_OF_PLATDATA_DRIVER_RT if !SPL_OF_PLATDATA_INST |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 458 | help |
| 459 | For very constrained SPL environments the overhead of decoding |
| 460 | device tree nodes and converting their contents into platform data |
| 461 | is too large. This overhead includes libfdt code as well as the |
| 462 | device tree contents itself. The latter is fairly compact, but the |
| 463 | former can add 3KB or more to a Thumb 2 Image. |
| 464 | |
| 465 | This option enables generation of platform data from the device |
Simon Glass | 1d8364a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 466 | tree as C code. This code creates devices using U_BOOT_DRVINFO() |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 467 | declarations. The benefit is that it allows driver code to access |
| 468 | the platform data directly in C structures, avoidin the libfdt |
| 469 | overhead. |
| 470 | |
| 471 | This option works by generating C structure declarations for each |
Simon Glass | 1d8364a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 472 | compatible string, then adding platform data and U_BOOT_DRVINFO |
Simon Goldschmidt | 49ce8ca | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 473 | declarations for each node. See of-plat.txt for more information. |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 474 | |
Simon Glass | 7c4ba16 | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 475 | config SPL_OF_REAL |
Sean Anderson | 7bf2f8c | 2023-10-14 16:47:46 -0400 | [diff] [blame] | 476 | bool "Support a real devicetree in SPL" if SANDBOX |
| 477 | depends on SPL_OF_CONTROL |
| 478 | select SPL_OF_LIBFDT |
Simon Glass | 7c4ba16 | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 479 | help |
| 480 | Indicates that a real devicetree is available which can be accessed |
| 481 | at runtime. This means that dev_read_...() functions can be used to |
Sean Anderson | 7bf2f8c | 2023-10-14 16:47:46 -0400 | [diff] [blame] | 482 | read data from the devicetree for each device. You do not need to |
| 483 | enable this option if you have enabled SPL_OF_PLATDATA. |
Simon Glass | 7c4ba16 | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 484 | |
Simon Glass | 240d5f6 | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 485 | if SPL_OF_PLATDATA |
| 486 | |
Simon Glass | 36b15e2 | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 487 | config SPL_OF_PLATDATA_PARENT |
| 488 | bool "Support parent information in devices" |
Simon Glass | 36b15e2 | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 489 | default y |
| 490 | help |
| 491 | Generally it is useful to be able to access the parent of a device |
| 492 | with of-platdata. To save space this can be disabled, but in that |
| 493 | case dev_get_parent() will always return NULL; |
| 494 | |
Simon Glass | 240d5f6 | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 495 | config SPL_OF_PLATDATA_INST |
| 496 | bool "Declare devices at build time" |
| 497 | help |
| 498 | Declare devices as udevice instances so that they do not need to be |
| 499 | bound when U-Boot starts. This can save time and code space. |
| 500 | |
Simon Glass | 47fd4a2 | 2021-03-15 17:25:15 +1300 | [diff] [blame] | 501 | config SPL_OF_PLATDATA_NO_BIND |
| 502 | bool "Don't allow run-time binding of devices" |
| 503 | depends on SPL_OF_PLATDATA_INST |
| 504 | default y |
| 505 | help |
| 506 | This removes the ability to bind devices at run time, thus saving |
| 507 | some code space in U-Boot. This can be disabled if binding is needed, |
| 508 | at the code of some code size increase. |
| 509 | |
Simon Glass | 5b21b34 | 2021-03-15 17:25:35 +1300 | [diff] [blame] | 510 | config SPL_OF_PLATDATA_RT |
| 511 | bool "Use a separate struct for device runtime data" |
| 512 | depends on SPL_OF_PLATDATA_INST |
| 513 | default y |
| 514 | help |
| 515 | For systems running SPL from read-only memory it is convenient to |
| 516 | separate out the runtime information, so that the devices don't need |
| 517 | to be copied before being used. This moves the read-write parts of |
| 518 | struct udevice (at present just the flags) into a separate struct, |
| 519 | which is allocated at runtime. |
| 520 | |
Simon Glass | 8beeb28 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 521 | config SPL_OF_PLATDATA_DRIVER_RT |
| 522 | bool |
| 523 | help |
| 524 | Use a separate struct for driver runtime data. |
| 525 | |
| 526 | This enables the driver_rt information, used with of-platdata when |
| 527 | of-platdata-inst is not used. It allows finding devices by their |
| 528 | driver data. |
| 529 | |
Simon Glass | 240d5f6 | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 530 | endif |
| 531 | |
Simon Glass | 7c4ba16 | 2021-08-07 07:24:02 -0600 | [diff] [blame] | 532 | config TPL_OF_REAL |
| 533 | bool |
| 534 | help |
| 535 | Indicates that a real devicetree is available which can be accessed |
| 536 | at runtime. This means that dev_read_...() functions can be used to |
| 537 | read data from the devicetree for each device. This is true if |
| 538 | TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA |
| 539 | |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 540 | config TPL_OF_PLATDATA |
| 541 | bool "Generate platform data for use in TPL" |
| 542 | depends on TPL_OF_CONTROL |
Masahiro Yamada | 87247af | 2017-10-17 13:42:44 +0900 | [diff] [blame] | 543 | select DTOC |
Simon Glass | 8beeb28 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 544 | select TPL_OF_PLATDATA_DRIVER_RT if !TPL_OF_PLATDATA_INST |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 545 | help |
| 546 | For very constrained SPL environments the overhead of decoding |
| 547 | device tree nodes and converting their contents into platform data |
| 548 | is too large. This overhead includes libfdt code as well as the |
| 549 | device tree contents itself. The latter is fairly compact, but the |
| 550 | former can add 3KB or more to a Thumb 2 Image. |
| 551 | |
| 552 | This option enables generation of platform data from the device |
Simon Glass | 1d8364a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 553 | tree as C code. This code creates devices using U_BOOT_DRVINFO() |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 554 | declarations. The benefit is that it allows driver code to access |
| 555 | the platform data directly in C structures, avoidin the libfdt |
| 556 | overhead. |
| 557 | |
| 558 | This option works by generating C structure declarations for each |
Simon Glass | 1d8364a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 559 | compatible string, then adding platform data and U_BOOT_DRVINFO |
Simon Goldschmidt | 49ce8ca | 2019-01-16 20:40:18 +0100 | [diff] [blame] | 560 | declarations for each node. See of-plat.txt for more information. |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 561 | |
Simon Glass | 240d5f6 | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 562 | if TPL_OF_PLATDATA |
| 563 | |
Simon Glass | 36b15e2 | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 564 | config TPL_OF_PLATDATA_PARENT |
| 565 | bool "Support parent information in devices" |
Simon Glass | 36b15e2 | 2020-10-03 11:31:35 -0600 | [diff] [blame] | 566 | default y |
| 567 | help |
| 568 | Generally it is useful to be able to access the parent of a device |
| 569 | with of-platdata. To save space this can be disabled, but in that |
| 570 | case dev_get_parent() will always return NULL; |
| 571 | |
Simon Glass | 240d5f6 | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 572 | config TPL_OF_PLATDATA_INST |
| 573 | bool "Declare devices at build time" |
| 574 | |
| 575 | help |
| 576 | Declare devices as udevice instances so that they do not need to be |
| 577 | bound when U-Boot starts. This can save time and code space. |
| 578 | |
Simon Glass | 47fd4a2 | 2021-03-15 17:25:15 +1300 | [diff] [blame] | 579 | config TPL_OF_PLATDATA_NO_BIND |
| 580 | bool "Don't allow run-time binding of devices" |
| 581 | depends on TPL_OF_PLATDATA_INST |
| 582 | default y |
| 583 | help |
| 584 | This removes the ability to bind devices at run time, thus saving |
| 585 | some code space in U-Boot. This can be disabled if binding is needed, |
| 586 | at the code of some code size increase. |
| 587 | |
Simon Glass | 5b21b34 | 2021-03-15 17:25:35 +1300 | [diff] [blame] | 588 | config TPL_OF_PLATDATA_RT |
| 589 | bool "Use a separate struct for device runtime data" |
| 590 | depends on TPL_OF_PLATDATA_INST |
| 591 | default y |
| 592 | help |
| 593 | For systems running TPL from read-only memory it is convenient to |
| 594 | separate out the runtime information, so that the devices don't need |
| 595 | to be copied before being used. This moves the read-write parts of |
| 596 | struct udevice (at present just the flags) into a separate struct, |
| 597 | which is allocated at runtime. |
| 598 | |
Simon Glass | 8beeb28 | 2021-03-15 17:25:36 +1300 | [diff] [blame] | 599 | config TPL_OF_PLATDATA_DRIVER_RT |
| 600 | bool |
| 601 | help |
| 602 | Use a separate struct for driver runtime data. |
| 603 | |
| 604 | This enables the driver_rt information, used with of-platdata when |
| 605 | of-platdata-inst is not used. It allows finding devices by their |
| 606 | driver data. |
| 607 | |
Simon Glass | 240d5f6 | 2021-02-03 06:01:13 -0700 | [diff] [blame] | 608 | endif |
| 609 | |
Simon Glass | e7ca7da | 2022-04-30 00:56:53 -0600 | [diff] [blame] | 610 | config VPL_OF_REAL |
| 611 | def_bool y |
Tom Rini | 7fb323b | 2022-06-08 08:24:40 -0400 | [diff] [blame] | 612 | depends on VPL |
Simon Glass | e7ca7da | 2022-04-30 00:56:53 -0600 | [diff] [blame] | 613 | help |
| 614 | Indicates that a real devicetree is available which can be accessed |
| 615 | at runtime. This means that dev_read_...() functions can be used to |
| 616 | read data from the devicetree for each device. This is true if |
| 617 | TPL_OF_CONTROL is enabled and not TPL_OF_PLATDATA |
| 618 | |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 619 | endmenu |