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