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 | |
Tom Rini | 61d0fac | 2017-09-23 13:00:57 -0400 | [diff] [blame] | 8 | config DTC |
| 9 | bool |
| 10 | |
Masahiro Yamada | 87247af | 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 | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 22 | menu "Device Tree Control" |
Masahiro Yamada | 9fadbc8 | 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 | 61d0fac | 2017-09-23 13:00:57 -0400 | [diff] [blame] | 27 | select DTC |
Masahiro Yamada | 9fadbc8 | 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 | 7e9b9d6 | 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 | 1e35f39 | 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 | 400d040 | 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 |
| 47 | which is not enough to support device tree. Enable this option to |
| 48 | allow such boards to be supported by U-Boot SPL. |
| 49 | |
Philipp Tomsich | 2341dc6 | 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 | a6eedb8 | 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 |
| 64 | tree does not support modifcation from within U-Boot since it |
| 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 | 9fadbc8 | 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 | d9b64ea | 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 | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 87 | |
Alex Deymo | 5b661ec | 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 | 9fadbc8 | 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 | |
| 104 | endchoice |
| 105 | |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 106 | config DEFAULT_DEVICE_TREE |
| 107 | string "Default Device Tree for DT control" |
Simon Glass | 644f5bc | 2016-02-22 22:55:44 -0700 | [diff] [blame] | 108 | depends on OF_CONTROL |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 109 | help |
| 110 | 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] | 111 | It can be overridden from the command line: |
Masahiro Yamada | 8c65b9d | 2014-09-22 19:59:06 +0900 | [diff] [blame] | 112 | $ make DEVICE_TREE=<device-tree-name> |
| 113 | |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 114 | config OF_LIST |
| 115 | string "List of device tree files to include for DT control" |
Jean-Jacques Hiblot | 2037fa4 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 116 | depends on SPL_LOAD_FIT || MULTI_DTB_FIT |
Michal Simek | 9b2e95a | 2016-05-04 15:14:11 +0200 | [diff] [blame] | 117 | default DEFAULT_DEVICE_TREE |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 118 | help |
| 119 | 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] | 120 | control. These will be packaged into a FIT. At run-time, U-boot |
| 121 | or SPL will select the correct DT to use by examining the |
| 122 | hardware (e.g. reading a board ID value). This is a list of |
| 123 | device tree files (without the directory or .dtb suffix) |
| 124 | separated by <space>. |
Simon Glass | 963817b | 2016-02-22 22:55:57 -0700 | [diff] [blame] | 125 | |
Jean-Jacques Hiblot | 2037fa4 | 2017-09-15 12:57:24 +0200 | [diff] [blame] | 126 | |
| 127 | config DTB_RESELECT |
| 128 | bool "Support swapping dtbs at a later point in boot" |
| 129 | depends on MULTI_DTB_FIT |
| 130 | help |
| 131 | It is possible during initial boot you may need to use a generic |
| 132 | dtb until you can fully determine the board your running on. This |
| 133 | config allows boards to implement a function at a later point |
| 134 | during boot to switch to the "correct" dtb. |
| 135 | |
| 136 | config MULTI_DTB_FIT |
| 137 | bool "Support embedding several DTBs in a FIT image for u-boot" |
| 138 | help |
| 139 | This option provides hooks to allow U-boot to parse an |
| 140 | appended FIT image and enable board specific code to then select |
| 141 | the correct DTB to be used. Use this if you need to support |
| 142 | multiple DTBs but don't use the SPL. |
| 143 | |
Jean-Jacques Hiblot | a2fee16 | 2017-09-15 12:57:32 +0200 | [diff] [blame] | 144 | |
| 145 | config SPL_MULTI_DTB_FIT |
| 146 | depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA |
| 147 | bool "Support embedding several DTBs in a FIT image for the SPL" |
| 148 | help |
| 149 | This option provides the SPL with the ability to select its own |
| 150 | DTB at runtime from an appended FIT image containing several DTBs. |
| 151 | This allows using the same SPL binary on multiple platforms. |
| 152 | The primary purpose is to handle different versions of |
| 153 | the same platform without tweaking the platform code if the |
| 154 | differences can be expressed in the DTBs (common examples are: bus |
| 155 | capabilities, pad configurations). |
| 156 | |
| 157 | config SPL_OF_LIST |
| 158 | string "List of device tree files to include for DT control in SPL" |
| 159 | depends on SPL_MULTI_DTB_FIT |
| 160 | default OF_LIST |
| 161 | help |
| 162 | This option specifies a list of device tree files to use for DT |
| 163 | control in the SPL. These will be packaged into a FIT. At run-time, |
| 164 | the SPL will select the correct DT to use by examining the |
| 165 | hardware (e.g. reading a board ID value). This is a list of |
| 166 | device tree files (without the directory or .dtb suffix) |
| 167 | separated by <space>. |
| 168 | |
| 169 | choice |
| 170 | prompt "SPL OF LIST compression" |
| 171 | depends on SPL_MULTI_DTB_FIT |
| 172 | default SPL_MULTI_DTB_FIT_LZO |
| 173 | |
| 174 | config SPL_MULTI_DTB_FIT_LZO |
| 175 | bool "LZO" |
| 176 | depends on SYS_MALLOC_F |
| 177 | select SPL_LZO |
| 178 | help |
| 179 | Compress the FIT image containing the DTBs available for the SPL |
| 180 | using LZO compression. (requires lzop on host). |
| 181 | |
| 182 | config SPL_MULTI_DTB_FIT_GZIP |
| 183 | bool "GZIP" |
| 184 | depends on SYS_MALLOC_F |
| 185 | select SPL_GZIP |
| 186 | help |
| 187 | Compress the FIT image containing the DTBs available for the SPL |
| 188 | using GZIP compression. (requires gzip on host) |
| 189 | |
| 190 | config SPL_MULTI_DTB_FIT_NO_COMPRESSION |
| 191 | bool "No compression" |
| 192 | help |
| 193 | Do not compress the FIT image containing the DTBs available for the SPL. |
| 194 | Use this options only if LZO is not available and the DTBs are very small. |
| 195 | endchoice |
| 196 | |
| 197 | choice |
| 198 | prompt "Location of uncompressed DTBs " |
| 199 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 200 | default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F |
| 201 | |
| 202 | config SPL_MULTI_DTB_FIT_DYN_ALLOC |
| 203 | bool "Dynamically allocate the memory" |
| 204 | depends on SYS_MALLOC_F |
| 205 | |
| 206 | config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 207 | bool "User-defined location" |
| 208 | endchoice |
| 209 | |
| 210 | config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ |
| 211 | hex "Size of memory reserved to uncompress the DTBs" |
| 212 | depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) |
| 213 | default 0x8000 |
| 214 | help |
| 215 | This is the size of this area where the DTBs are uncompressed. |
| 216 | If this area is dynamically allocated, make sure that |
| 217 | SPL_SYS_MALLOC_F_LEN is big enough to contain it. |
| 218 | |
| 219 | config SPL_MULTI_DTB_FIT_USER_DEF_ADDR |
| 220 | hex "Address of memory where dtbs are uncompressed" |
| 221 | depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA |
| 222 | help |
| 223 | the FIT image containing the DTBs is uncompressed in an area defined |
| 224 | at compilation time. This is the address of this area. It must be |
| 225 | aligned on 2-byte boundary. |
| 226 | |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 227 | config OF_SPL_REMOVE_PROPS |
| 228 | string "List of device tree properties to drop for SPL" |
Masahiro Yamada | ddb9aa97 | 2015-08-28 20:28:42 +0900 | [diff] [blame] | 229 | depends on SPL_OF_CONTROL |
Vikas Manocha | b6cca7d | 2017-03-24 14:47:44 -0700 | [diff] [blame] | 230 | default "interrupt-parent" if SPL_PINCTRL && SPL_CLK |
| 231 | default "clocks clock-names interrupt-parent" if SPL_PINCTRL |
Masahiro Yamada | f03811c | 2016-02-03 20:51:36 +0900 | [diff] [blame] | 232 | default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK |
Simon Glass | 89caf33 | 2015-06-23 15:38:29 -0600 | [diff] [blame] | 233 | default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" |
| 234 | help |
| 235 | Since SPL normally runs in a reduced memory space, the device tree |
| 236 | is cut down to only what is needed to load and start U-Boot. Only |
| 237 | nodes marked with the property "u-boot,dm-pre-reloc" will be |
| 238 | included. In addition, some properties are not used by U-Boot and |
| 239 | can be discarded. This option defines the list of properties to |
| 240 | discard. |
| 241 | |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 242 | config SPL_OF_PLATDATA |
| 243 | bool "Generate platform data for use in SPL" |
| 244 | depends on SPL_OF_CONTROL |
Masahiro Yamada | 87247af | 2017-10-17 13:42:44 +0900 | [diff] [blame^] | 245 | select DTOC |
Simon Glass | 7bc65f3 | 2016-07-04 11:58:06 -0600 | [diff] [blame] | 246 | help |
| 247 | For very constrained SPL environments the overhead of decoding |
| 248 | device tree nodes and converting their contents into platform data |
| 249 | is too large. This overhead includes libfdt code as well as the |
| 250 | device tree contents itself. The latter is fairly compact, but the |
| 251 | former can add 3KB or more to a Thumb 2 Image. |
| 252 | |
| 253 | This option enables generation of platform data from the device |
| 254 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 255 | declarations. The benefit is that it allows driver code to access |
| 256 | the platform data directly in C structures, avoidin the libfdt |
| 257 | overhead. |
| 258 | |
| 259 | This option works by generating C structure declarations for each |
| 260 | compatible string, then adding platform data and U_BOOT_DEVICE |
| 261 | declarations for each node. See README.platdata for more |
| 262 | information. |
| 263 | |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 264 | config TPL_OF_PLATDATA |
| 265 | bool "Generate platform data for use in TPL" |
| 266 | depends on TPL_OF_CONTROL |
Masahiro Yamada | 87247af | 2017-10-17 13:42:44 +0900 | [diff] [blame^] | 267 | select DTOC |
Philipp Tomsich | 2341dc6 | 2017-06-29 11:11:21 +0200 | [diff] [blame] | 268 | help |
| 269 | For very constrained SPL environments the overhead of decoding |
| 270 | device tree nodes and converting their contents into platform data |
| 271 | is too large. This overhead includes libfdt code as well as the |
| 272 | device tree contents itself. The latter is fairly compact, but the |
| 273 | former can add 3KB or more to a Thumb 2 Image. |
| 274 | |
| 275 | This option enables generation of platform data from the device |
| 276 | tree as C code. This code creates devices using U_BOOT_DEVICE() |
| 277 | declarations. The benefit is that it allows driver code to access |
| 278 | the platform data directly in C structures, avoidin the libfdt |
| 279 | overhead. |
| 280 | |
| 281 | This option works by generating C structure declarations for each |
| 282 | compatible string, then adding platform data and U_BOOT_DEVICE |
| 283 | declarations for each node. See README.platdata for more |
| 284 | information. |
| 285 | |
Masahiro Yamada | 9fadbc8 | 2014-09-22 19:59:05 +0900 | [diff] [blame] | 286 | endmenu |
Tom Rini | 0e17fc7 | 2017-09-23 23:14:33 -0400 | [diff] [blame] | 287 | |
| 288 | config MKIMAGE_DTC_PATH |
| 289 | string "Path to dtc binary for use within mkimage" |
| 290 | default "dtc" |
| 291 | help |
| 292 | The mkimage host tool will, in order to generate FIT images make |
| 293 | calls to the dtc application in order to create the output. In |
| 294 | some cases the system dtc may not support all required features |
| 295 | and the path to a different version should be given here. |