1# 2# Device Tree Control 3# 4 5config SUPPORT_OF_CONTROL 6 bool 7 8config DTC 9 bool 10 11config PYLIBFDT 12 bool 13 14config DTOC 15 bool 16 select PYLIBFDT 17 18config BINMAN 19 bool 20 select DTOC 21 22menu "Device Tree Control" 23 depends on SUPPORT_OF_CONTROL 24 25config OF_CONTROL 26 bool "Run-time configuration via Device Tree" 27 select DTC 28 help 29 This feature provides for run-time configuration of U-Boot 30 via a flattened device tree. 31 32config 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 42config SPL_OF_CONTROL 43 bool "Enable run-time configuration via Device Tree in SPL" 44 depends on SPL && OF_CONTROL 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 50config SPL_DTB_MINIMUM 51 bool "Provide a minimum SPL DTB " 52 depends on SPL_OF_CONTROL 53 default n 54 help 55 Some boards need a SPL DTB as smaller as possible to save dm scan 56 time and space. It provides a SPL DTB only include the node with 57 property "u-boot,dm-spl". The property "u-boot,pre-reloc" doesn't 58 work any more. 59 60config TPL_OF_CONTROL 61 bool "Enable run-time configuration via Device Tree in TPL" 62 depends on TPL && OF_CONTROL 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 68config OF_LIVE 69 bool "Enable use of a live tree" 70 depends on OF_CONTROL 71 help 72 Normally U-Boot uses a flat device tree which saves space and 73 avoids the need to unpack the tree before use. However a flat 74 tree does not support modifcation from within U-Boot since it 75 can invalidate driver-model device tree offsets. This option 76 enables a live tree which is available after relocation, 77 and can be adjusted as needed. 78 79choice 80 prompt "Provider of DTB for DT control" 81 depends on OF_CONTROL 82 83config OF_SEPARATE 84 bool "Separate DTB for DT control" 85 depends on !SANDBOX 86 help 87 If this option is enabled, the device tree will be built and 88 placed as a separate u-boot.dtb file alongside the U-Boot image. 89 90config OF_EMBED 91 bool "Embedded DTB for DT control" 92 help 93 If this option is enabled, the device tree will be picked up and 94 built into the U-Boot image. This is suitable for local debugging 95 and development only and is not recommended for production devices. 96 Boards in the mainline U-Boot tree should not use it. 97 98config OF_BOARD 99 bool "Provided by the board at runtime" 100 depends on !SANDBOX 101 help 102 If this option is enabled, the device tree will be provided by 103 the board at runtime if the board supports it, instead of being 104 bundled with the image. 105 106config OF_HOSTFILE 107 bool "Host filed DTB for DT control" 108 depends on SANDBOX 109 help 110 If this option is enabled, DTB will be read from a file on startup. 111 This is only useful for Sandbox. Use the -d flag to U-Boot to 112 specify the file to read. 113 114config OF_PRIOR_STAGE 115 bool "Prior stage bootloader DTB for DT control" 116 help 117 If this option is enabled, the device tree used for DT 118 control will be read from a device tree binary, at a memory 119 location passed to U-Boot by the prior stage bootloader. 120 121endchoice 122 123config DEFAULT_DEVICE_TREE 124 string "Default Device Tree for DT control" 125 depends on OF_CONTROL 126 help 127 This option specifies the default Device Tree used for DT control. 128 It can be overridden from the command line: 129 $ make DEVICE_TREE=<device-tree-name> 130 131config OF_LIST 132 string "List of device tree files to include for DT control" 133 depends on SPL_LOAD_FIT || MULTI_DTB_FIT 134 default DEFAULT_DEVICE_TREE 135 help 136 This option specifies a list of device tree files to use for DT 137 control. These will be packaged into a FIT. At run-time, U-boot 138 or SPL will select the correct DT to use by examining the 139 hardware (e.g. reading a board ID value). This is a list of 140 device tree files (without the directory or .dtb suffix) 141 separated by <space>. 142 143 144config DTB_RESELECT 145 bool "Support swapping dtbs at a later point in boot" 146 depends on MULTI_DTB_FIT 147 help 148 It is possible during initial boot you may need to use a generic 149 dtb until you can fully determine the board your running on. This 150 config allows boards to implement a function at a later point 151 during boot to switch to the "correct" dtb. 152 153config MULTI_DTB_FIT 154 bool "Support embedding several DTBs in a FIT image for u-boot" 155 help 156 This option provides hooks to allow U-boot to parse an 157 appended FIT image and enable board specific code to then select 158 the correct DTB to be used. Use this if you need to support 159 multiple DTBs but don't use the SPL. 160 161 162config SPL_MULTI_DTB_FIT 163 depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA 164 bool "Support embedding several DTBs in a FIT image for the SPL" 165 help 166 This option provides the SPL with the ability to select its own 167 DTB at runtime from an appended FIT image containing several DTBs. 168 This allows using the same SPL binary on multiple platforms. 169 The primary purpose is to handle different versions of 170 the same platform without tweaking the platform code if the 171 differences can be expressed in the DTBs (common examples are: bus 172 capabilities, pad configurations). 173 174config SPL_OF_LIST 175 string "List of device tree files to include for DT control in SPL" 176 depends on SPL_MULTI_DTB_FIT 177 default OF_LIST 178 help 179 This option specifies a list of device tree files to use for DT 180 control in the SPL. These will be packaged into a FIT. At run-time, 181 the SPL will select the correct DT to use by examining the 182 hardware (e.g. reading a board ID value). This is a list of 183 device tree files (without the directory or .dtb suffix) 184 separated by <space>. 185 186choice 187 prompt "SPL OF LIST compression" 188 depends on SPL_MULTI_DTB_FIT 189 default SPL_MULTI_DTB_FIT_LZO 190 191config SPL_MULTI_DTB_FIT_LZO 192 bool "LZO" 193 depends on SYS_MALLOC_F 194 select SPL_LZO 195 help 196 Compress the FIT image containing the DTBs available for the SPL 197 using LZO compression. (requires lzop on host). 198 199config SPL_MULTI_DTB_FIT_GZIP 200 bool "GZIP" 201 depends on SYS_MALLOC_F 202 select SPL_GZIP 203 help 204 Compress the FIT image containing the DTBs available for the SPL 205 using GZIP compression. (requires gzip on host) 206 207config SPL_MULTI_DTB_FIT_NO_COMPRESSION 208 bool "No compression" 209 help 210 Do not compress the FIT image containing the DTBs available for the SPL. 211 Use this options only if LZO is not available and the DTBs are very small. 212endchoice 213 214choice 215 prompt "Location of uncompressed DTBs " 216 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) 217 default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F 218 219config SPL_MULTI_DTB_FIT_DYN_ALLOC 220 bool "Dynamically allocate the memory" 221 depends on SYS_MALLOC_F 222 223config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA 224 bool "User-defined location" 225endchoice 226 227config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ 228 hex "Size of memory reserved to uncompress the DTBs" 229 depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) 230 default 0x8000 231 help 232 This is the size of this area where the DTBs are uncompressed. 233 If this area is dynamically allocated, make sure that 234 SPL_SYS_MALLOC_F_LEN is big enough to contain it. 235 236config SPL_MULTI_DTB_FIT_USER_DEF_ADDR 237 hex "Address of memory where dtbs are uncompressed" 238 depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA 239 help 240 the FIT image containing the DTBs is uncompressed in an area defined 241 at compilation time. This is the address of this area. It must be 242 aligned on 2-byte boundary. 243 244config OF_SPL_REMOVE_PROPS 245 string "List of device tree properties to drop for SPL" 246 default "interrupt-parent" if SPL_PINCTRL && SPL_CLK 247 default "clocks clock-names interrupt-parent" if SPL_PINCTRL 248 default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK 249 default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" 250 help 251 Since SPL normally runs in a reduced memory space, the device tree 252 is cut down to only what is needed to load and start U-Boot. Only 253 nodes marked with the property "u-boot,dm-pre-reloc" will be 254 included. In addition, some properties are not used by U-Boot and 255 can be discarded. This option defines the list of properties to 256 discard. 257 258config OF_U_BOOT_REMOVE_PROPS 259 string "List of device tree properties to drop for U-Boot" 260 depends on USING_KERNEL_DTB 261 default "" 262 help 263 Since kernel dtb feature is enabled, U-Boot prop use the same device tree as SPL. 264 At sometimes there is different require for list of device tree properties to drop 265 for U-Boot prop, so providing this configure which has higher priority, that if it 266 is defined empty string, fallback to use OF_SPL_REMOVE_PROPS. 267 268config SPL_OF_PLATDATA 269 bool "Generate platform data for use in SPL" 270 depends on SPL_OF_CONTROL 271 select DTOC 272 help 273 For very constrained SPL environments the overhead of decoding 274 device tree nodes and converting their contents into platform data 275 is too large. This overhead includes libfdt code as well as the 276 device tree contents itself. The latter is fairly compact, but the 277 former can add 3KB or more to a Thumb 2 Image. 278 279 This option enables generation of platform data from the device 280 tree as C code. This code creates devices using U_BOOT_DEVICE() 281 declarations. The benefit is that it allows driver code to access 282 the platform data directly in C structures, avoidin the libfdt 283 overhead. 284 285 This option works by generating C structure declarations for each 286 compatible string, then adding platform data and U_BOOT_DEVICE 287 declarations for each node. See README.platdata for more 288 information. 289 290config TPL_OF_PLATDATA 291 bool "Generate platform data for use in TPL" 292 depends on TPL_OF_CONTROL 293 select DTOC 294 help 295 For very constrained SPL environments the overhead of decoding 296 device tree nodes and converting their contents into platform data 297 is too large. This overhead includes libfdt code as well as the 298 device tree contents itself. The latter is fairly compact, but the 299 former can add 3KB or more to a Thumb 2 Image. 300 301 This option enables generation of platform data from the device 302 tree as C code. This code creates devices using U_BOOT_DEVICE() 303 declarations. The benefit is that it allows driver code to access 304 the platform data directly in C structures, avoidin the libfdt 305 overhead. 306 307 This option works by generating C structure declarations for each 308 compatible string, then adding platform data and U_BOOT_DEVICE 309 declarations for each node. See README.platdata for more 310 information. 311 312endmenu 313 314config MKIMAGE_DTC_PATH 315 string "Path to dtc binary for use within mkimage" 316 default "dtc" 317 help 318 The mkimage host tool will, in order to generate FIT images make 319 calls to the dtc application in order to create the output. In 320 some cases the system dtc may not support all required features 321 and the path to a different version should be given here. 322