1783e6a72SMasahiro Yamada# 2783e6a72SMasahiro Yamada# Device Tree Control 3783e6a72SMasahiro Yamada# 4783e6a72SMasahiro Yamada 5783e6a72SMasahiro Yamadaconfig SUPPORT_OF_CONTROL 6783e6a72SMasahiro Yamada bool 7783e6a72SMasahiro Yamada 85821df21STom Riniconfig DTC 95821df21STom Rini bool 105821df21STom Rini 11ec821af4SMasahiro Yamadaconfig PYLIBFDT 12ec821af4SMasahiro Yamada bool 13ec821af4SMasahiro Yamada 14ec821af4SMasahiro Yamadaconfig DTOC 15ec821af4SMasahiro Yamada bool 16ec821af4SMasahiro Yamada select PYLIBFDT 17ec821af4SMasahiro Yamada 18ec821af4SMasahiro Yamadaconfig BINMAN 19ec821af4SMasahiro Yamada bool 20ec821af4SMasahiro Yamada select DTOC 21ec821af4SMasahiro Yamada 22783e6a72SMasahiro Yamadamenu "Device Tree Control" 23783e6a72SMasahiro Yamada depends on SUPPORT_OF_CONTROL 24783e6a72SMasahiro Yamada 25783e6a72SMasahiro Yamadaconfig OF_CONTROL 26783e6a72SMasahiro Yamada bool "Run-time configuration via Device Tree" 275821df21STom Rini select DTC 28783e6a72SMasahiro Yamada help 29783e6a72SMasahiro Yamada This feature provides for run-time configuration of U-Boot 30783e6a72SMasahiro Yamada via a flattened device tree. 31783e6a72SMasahiro Yamada 32*39d40ad5SJoseph Chenconfig OF_ADDR_SIZE_AUTO_NOPARENT 33*39d40ad5SJoseph Chen bool "FDT get address/size cell auto from parent node" 34*39d40ad5SJoseph Chen depends on OF_CONTROL && ARM64 35*39d40ad5SJoseph Chen help 36*39d40ad5SJoseph Chen Enable this to use 'fdtdec_get_addr_size_auto_noparent' instead of 37*39d40ad5SJoseph Chen 'fdtdec_get_addr_size_fixed' in case of 64-bit U-Boot use 32-bit 38*39d40ad5SJoseph Chen platform dtb. 39*39d40ad5SJoseph Chen 402a792753Smario.six@gdsys.ccconfig OF_BOARD_FIXUP 412a792753Smario.six@gdsys.cc bool "Board-specific manipulation of Device Tree" 422a792753Smario.six@gdsys.cc help 432a792753Smario.six@gdsys.cc In certain circumstances it is necessary to be able to modify 442a792753Smario.six@gdsys.cc U-Boot's device tree (e.g. to delete device from it). This option 452a792753Smario.six@gdsys.cc make the Device Tree writeable and provides a board-specific 462a792753Smario.six@gdsys.cc "board_fix_fdt" callback (called during pre-relocation time), which 472a792753Smario.six@gdsys.cc enables the board initialization to modifiy the Device Tree. The 482a792753Smario.six@gdsys.cc modified copy is subsequently used by U-Boot after relocation. 492a792753Smario.six@gdsys.cc 50dffb86e4SMasahiro Yamadaconfig SPL_OF_CONTROL 51dffb86e4SMasahiro Yamada bool "Enable run-time configuration via Device Tree in SPL" 52dffb86e4SMasahiro Yamada depends on SPL && OF_CONTROL 532860f03bSSimon Glass help 542860f03bSSimon Glass Some boards use device tree in U-Boot but only have 4KB of SRAM 552860f03bSSimon Glass which is not enough to support device tree. Enable this option to 562860f03bSSimon Glass allow such boards to be supported by U-Boot SPL. 572860f03bSSimon Glass 584447bf16SJoseph Chenconfig SPL_DTB_MINIMUM 594447bf16SJoseph Chen bool "Provide a minimum SPL DTB " 604447bf16SJoseph Chen depends on SPL_OF_CONTROL 614447bf16SJoseph Chen default n 624447bf16SJoseph Chen help 634447bf16SJoseph Chen Some boards need a SPL DTB as smaller as possible to save dm scan 644447bf16SJoseph Chen time and space. It provides a SPL DTB only include the node with 654447bf16SJoseph Chen property "u-boot,dm-spl". The property "u-boot,pre-reloc" doesn't 664447bf16SJoseph Chen work any more. 674447bf16SJoseph Chen 68f291ce12SPhilipp Tomsichconfig TPL_OF_CONTROL 69f291ce12SPhilipp Tomsich bool "Enable run-time configuration via Device Tree in TPL" 70f291ce12SPhilipp Tomsich depends on TPL && OF_CONTROL 71f291ce12SPhilipp Tomsich help 72f291ce12SPhilipp Tomsich Some boards use device tree in U-Boot but only have 4KB of SRAM 73f291ce12SPhilipp Tomsich which is not enough to support device tree. Enable this option to 74f291ce12SPhilipp Tomsich allow such boards to be supported by U-Boot TPL. 75f291ce12SPhilipp Tomsich 765e060d8bSSimon Glassconfig OF_LIVE 775e060d8bSSimon Glass bool "Enable use of a live tree" 785e060d8bSSimon Glass depends on OF_CONTROL 795e060d8bSSimon Glass help 805e060d8bSSimon Glass Normally U-Boot uses a flat device tree which saves space and 815e060d8bSSimon Glass avoids the need to unpack the tree before use. However a flat 825e060d8bSSimon Glass tree does not support modifcation from within U-Boot since it 835e060d8bSSimon Glass can invalidate driver-model device tree offsets. This option 845e060d8bSSimon Glass enables a live tree which is available after relocation, 855e060d8bSSimon Glass and can be adjusted as needed. 865e060d8bSSimon Glass 87783e6a72SMasahiro Yamadachoice 88783e6a72SMasahiro Yamada prompt "Provider of DTB for DT control" 89783e6a72SMasahiro Yamada depends on OF_CONTROL 90783e6a72SMasahiro Yamada 91783e6a72SMasahiro Yamadaconfig OF_SEPARATE 92783e6a72SMasahiro Yamada bool "Separate DTB for DT control" 93783e6a72SMasahiro Yamada depends on !SANDBOX 94783e6a72SMasahiro Yamada help 95783e6a72SMasahiro Yamada If this option is enabled, the device tree will be built and 96783e6a72SMasahiro Yamada placed as a separate u-boot.dtb file alongside the U-Boot image. 97783e6a72SMasahiro Yamada 98783e6a72SMasahiro Yamadaconfig OF_EMBED 99783e6a72SMasahiro Yamada bool "Embedded DTB for DT control" 100783e6a72SMasahiro Yamada help 101783e6a72SMasahiro Yamada If this option is enabled, the device tree will be picked up and 1023d3f60cbSSimon Glass built into the U-Boot image. This is suitable for local debugging 1033d3f60cbSSimon Glass and development only and is not recommended for production devices. 1043d3f60cbSSimon Glass Boards in the mainline U-Boot tree should not use it. 105783e6a72SMasahiro Yamada 10682f766d1SAlex Deymoconfig OF_BOARD 10782f766d1SAlex Deymo bool "Provided by the board at runtime" 10882f766d1SAlex Deymo depends on !SANDBOX 10982f766d1SAlex Deymo help 11082f766d1SAlex Deymo If this option is enabled, the device tree will be provided by 11182f766d1SAlex Deymo the board at runtime if the board supports it, instead of being 11282f766d1SAlex Deymo bundled with the image. 11382f766d1SAlex Deymo 114783e6a72SMasahiro Yamadaconfig OF_HOSTFILE 115783e6a72SMasahiro Yamada bool "Host filed DTB for DT control" 116783e6a72SMasahiro Yamada depends on SANDBOX 117783e6a72SMasahiro Yamada help 118783e6a72SMasahiro Yamada If this option is enabled, DTB will be read from a file on startup. 119783e6a72SMasahiro Yamada This is only useful for Sandbox. Use the -d flag to U-Boot to 120783e6a72SMasahiro Yamada specify the file to read. 121783e6a72SMasahiro Yamada 122f36ea2f6SThomas Fitzsimmonsconfig OF_PRIOR_STAGE 123f36ea2f6SThomas Fitzsimmons bool "Prior stage bootloader DTB for DT control" 124f36ea2f6SThomas Fitzsimmons help 125f36ea2f6SThomas Fitzsimmons If this option is enabled, the device tree used for DT 126f36ea2f6SThomas Fitzsimmons control will be read from a device tree binary, at a memory 127f36ea2f6SThomas Fitzsimmons location passed to U-Boot by the prior stage bootloader. 128f36ea2f6SThomas Fitzsimmons 129783e6a72SMasahiro Yamadaendchoice 130783e6a72SMasahiro Yamada 131f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE 132f1ef2b62SMasahiro Yamada string "Default Device Tree for DT control" 13370d41093SSimon Glass depends on OF_CONTROL 134f1ef2b62SMasahiro Yamada help 135f1ef2b62SMasahiro Yamada This option specifies the default Device Tree used for DT control. 1365699ea6dSRobert P. J. Day It can be overridden from the command line: 137f1ef2b62SMasahiro Yamada $ make DEVICE_TREE=<device-tree-name> 138f1ef2b62SMasahiro Yamada 139cdf17246SSimon Glassconfig OF_LIST 140cdf17246SSimon Glass string "List of device tree files to include for DT control" 1412bbcffb1SJean-Jacques Hiblot depends on SPL_LOAD_FIT || MULTI_DTB_FIT 142c409bd01SMichal Simek default DEFAULT_DEVICE_TREE 143cdf17246SSimon Glass help 144cdf17246SSimon Glass This option specifies a list of device tree files to use for DT 145d9797409SCooper Jr., Franklin control. These will be packaged into a FIT. At run-time, U-boot 146d9797409SCooper Jr., Franklin or SPL will select the correct DT to use by examining the 147d9797409SCooper Jr., Franklin hardware (e.g. reading a board ID value). This is a list of 148d9797409SCooper Jr., Franklin device tree files (without the directory or .dtb suffix) 149d9797409SCooper Jr., Franklin separated by <space>. 150cdf17246SSimon Glass 1512bbcffb1SJean-Jacques Hiblot 1522bbcffb1SJean-Jacques Hiblotconfig DTB_RESELECT 1532bbcffb1SJean-Jacques Hiblot bool "Support swapping dtbs at a later point in boot" 1542bbcffb1SJean-Jacques Hiblot depends on MULTI_DTB_FIT 1552bbcffb1SJean-Jacques Hiblot help 1562bbcffb1SJean-Jacques Hiblot It is possible during initial boot you may need to use a generic 1572bbcffb1SJean-Jacques Hiblot dtb until you can fully determine the board your running on. This 1582bbcffb1SJean-Jacques Hiblot config allows boards to implement a function at a later point 1592bbcffb1SJean-Jacques Hiblot during boot to switch to the "correct" dtb. 1602bbcffb1SJean-Jacques Hiblot 1612bbcffb1SJean-Jacques Hiblotconfig MULTI_DTB_FIT 1622bbcffb1SJean-Jacques Hiblot bool "Support embedding several DTBs in a FIT image for u-boot" 1632bbcffb1SJean-Jacques Hiblot help 1642bbcffb1SJean-Jacques Hiblot This option provides hooks to allow U-boot to parse an 1652bbcffb1SJean-Jacques Hiblot appended FIT image and enable board specific code to then select 1662bbcffb1SJean-Jacques Hiblot the correct DTB to be used. Use this if you need to support 1672bbcffb1SJean-Jacques Hiblot multiple DTBs but don't use the SPL. 1682bbcffb1SJean-Jacques Hiblot 169476f6045SJean-Jacques Hiblot 170476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT 171476f6045SJean-Jacques Hiblot depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA 172476f6045SJean-Jacques Hiblot bool "Support embedding several DTBs in a FIT image for the SPL" 173476f6045SJean-Jacques Hiblot help 174476f6045SJean-Jacques Hiblot This option provides the SPL with the ability to select its own 175476f6045SJean-Jacques Hiblot DTB at runtime from an appended FIT image containing several DTBs. 176476f6045SJean-Jacques Hiblot This allows using the same SPL binary on multiple platforms. 177476f6045SJean-Jacques Hiblot The primary purpose is to handle different versions of 178476f6045SJean-Jacques Hiblot the same platform without tweaking the platform code if the 179476f6045SJean-Jacques Hiblot differences can be expressed in the DTBs (common examples are: bus 180476f6045SJean-Jacques Hiblot capabilities, pad configurations). 181476f6045SJean-Jacques Hiblot 182476f6045SJean-Jacques Hiblotconfig SPL_OF_LIST 183476f6045SJean-Jacques Hiblot string "List of device tree files to include for DT control in SPL" 184476f6045SJean-Jacques Hiblot depends on SPL_MULTI_DTB_FIT 185476f6045SJean-Jacques Hiblot default OF_LIST 186476f6045SJean-Jacques Hiblot help 187476f6045SJean-Jacques Hiblot This option specifies a list of device tree files to use for DT 188476f6045SJean-Jacques Hiblot control in the SPL. These will be packaged into a FIT. At run-time, 189476f6045SJean-Jacques Hiblot the SPL will select the correct DT to use by examining the 190476f6045SJean-Jacques Hiblot hardware (e.g. reading a board ID value). This is a list of 191476f6045SJean-Jacques Hiblot device tree files (without the directory or .dtb suffix) 192476f6045SJean-Jacques Hiblot separated by <space>. 193476f6045SJean-Jacques Hiblot 194476f6045SJean-Jacques Hiblotchoice 195476f6045SJean-Jacques Hiblot prompt "SPL OF LIST compression" 196476f6045SJean-Jacques Hiblot depends on SPL_MULTI_DTB_FIT 197476f6045SJean-Jacques Hiblot default SPL_MULTI_DTB_FIT_LZO 198476f6045SJean-Jacques Hiblot 199476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_LZO 200476f6045SJean-Jacques Hiblot bool "LZO" 201476f6045SJean-Jacques Hiblot depends on SYS_MALLOC_F 202476f6045SJean-Jacques Hiblot select SPL_LZO 203476f6045SJean-Jacques Hiblot help 204476f6045SJean-Jacques Hiblot Compress the FIT image containing the DTBs available for the SPL 205476f6045SJean-Jacques Hiblot using LZO compression. (requires lzop on host). 206476f6045SJean-Jacques Hiblot 207476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_GZIP 208476f6045SJean-Jacques Hiblot bool "GZIP" 209476f6045SJean-Jacques Hiblot depends on SYS_MALLOC_F 210476f6045SJean-Jacques Hiblot select SPL_GZIP 211476f6045SJean-Jacques Hiblot help 212476f6045SJean-Jacques Hiblot Compress the FIT image containing the DTBs available for the SPL 213476f6045SJean-Jacques Hiblot using GZIP compression. (requires gzip on host) 214476f6045SJean-Jacques Hiblot 215476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_NO_COMPRESSION 216476f6045SJean-Jacques Hiblot bool "No compression" 217476f6045SJean-Jacques Hiblot help 218476f6045SJean-Jacques Hiblot Do not compress the FIT image containing the DTBs available for the SPL. 219476f6045SJean-Jacques Hiblot Use this options only if LZO is not available and the DTBs are very small. 220476f6045SJean-Jacques Hiblotendchoice 221476f6045SJean-Jacques Hiblot 222476f6045SJean-Jacques Hiblotchoice 223476f6045SJean-Jacques Hiblot prompt "Location of uncompressed DTBs " 224476f6045SJean-Jacques Hiblot depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) 225476f6045SJean-Jacques Hiblot default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F 226476f6045SJean-Jacques Hiblot 227476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_DYN_ALLOC 228476f6045SJean-Jacques Hiblot bool "Dynamically allocate the memory" 229476f6045SJean-Jacques Hiblot depends on SYS_MALLOC_F 230476f6045SJean-Jacques Hiblot 231476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_USER_DEFINED_AREA 232476f6045SJean-Jacques Hiblot bool "User-defined location" 233476f6045SJean-Jacques Hiblotendchoice 234476f6045SJean-Jacques Hiblot 235476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ 236476f6045SJean-Jacques Hiblot hex "Size of memory reserved to uncompress the DTBs" 237476f6045SJean-Jacques Hiblot depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) 238476f6045SJean-Jacques Hiblot default 0x8000 239476f6045SJean-Jacques Hiblot help 240476f6045SJean-Jacques Hiblot This is the size of this area where the DTBs are uncompressed. 241476f6045SJean-Jacques Hiblot If this area is dynamically allocated, make sure that 242476f6045SJean-Jacques Hiblot SPL_SYS_MALLOC_F_LEN is big enough to contain it. 243476f6045SJean-Jacques Hiblot 244476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_USER_DEF_ADDR 245476f6045SJean-Jacques Hiblot hex "Address of memory where dtbs are uncompressed" 246476f6045SJean-Jacques Hiblot depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA 247476f6045SJean-Jacques Hiblot help 248476f6045SJean-Jacques Hiblot the FIT image containing the DTBs is uncompressed in an area defined 249476f6045SJean-Jacques Hiblot at compilation time. This is the address of this area. It must be 250476f6045SJean-Jacques Hiblot aligned on 2-byte boundary. 251476f6045SJean-Jacques Hiblot 252fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS 253fa78e0a3SSimon Glass string "List of device tree properties to drop for SPL" 254239ae4a9SVikas Manocha default "interrupt-parent" if SPL_PINCTRL && SPL_CLK 255239ae4a9SVikas Manocha default "clocks clock-names interrupt-parent" if SPL_PINCTRL 2565f3f7b79SMasahiro Yamada default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK 257fa78e0a3SSimon Glass default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" 258fa78e0a3SSimon Glass help 259fa78e0a3SSimon Glass Since SPL normally runs in a reduced memory space, the device tree 260fa78e0a3SSimon Glass is cut down to only what is needed to load and start U-Boot. Only 261fa78e0a3SSimon Glass nodes marked with the property "u-boot,dm-pre-reloc" will be 262fa78e0a3SSimon Glass included. In addition, some properties are not used by U-Boot and 263fa78e0a3SSimon Glass can be discarded. This option defines the list of properties to 264fa78e0a3SSimon Glass discard. 265fa78e0a3SSimon Glass 266c48a3a80SJoseph Chenconfig OF_U_BOOT_REMOVE_PROPS 267c48a3a80SJoseph Chen string "List of device tree properties to drop for U-Boot" 268c48a3a80SJoseph Chen depends on USING_KERNEL_DTB 269c48a3a80SJoseph Chen default "" 270c48a3a80SJoseph Chen help 271c48a3a80SJoseph Chen Since kernel dtb feature is enabled, U-Boot prop use the same device tree as SPL. 272c48a3a80SJoseph Chen At sometimes there is different require for list of device tree properties to drop 273c48a3a80SJoseph Chen for U-Boot prop, so providing this configure which has higher priority, that if it 274c48a3a80SJoseph Chen is defined empty string, fallback to use OF_SPL_REMOVE_PROPS. 275c48a3a80SJoseph Chen 2762789ddb9SSimon Glassconfig SPL_OF_PLATDATA 2772789ddb9SSimon Glass bool "Generate platform data for use in SPL" 2782789ddb9SSimon Glass depends on SPL_OF_CONTROL 279ec821af4SMasahiro Yamada select DTOC 2802789ddb9SSimon Glass help 2812789ddb9SSimon Glass For very constrained SPL environments the overhead of decoding 2822789ddb9SSimon Glass device tree nodes and converting their contents into platform data 2832789ddb9SSimon Glass is too large. This overhead includes libfdt code as well as the 2842789ddb9SSimon Glass device tree contents itself. The latter is fairly compact, but the 2852789ddb9SSimon Glass former can add 3KB or more to a Thumb 2 Image. 2862789ddb9SSimon Glass 2872789ddb9SSimon Glass This option enables generation of platform data from the device 2882789ddb9SSimon Glass tree as C code. This code creates devices using U_BOOT_DEVICE() 2892789ddb9SSimon Glass declarations. The benefit is that it allows driver code to access 2902789ddb9SSimon Glass the platform data directly in C structures, avoidin the libfdt 2912789ddb9SSimon Glass overhead. 2922789ddb9SSimon Glass 2932789ddb9SSimon Glass This option works by generating C structure declarations for each 2942789ddb9SSimon Glass compatible string, then adding platform data and U_BOOT_DEVICE 2952789ddb9SSimon Glass declarations for each node. See README.platdata for more 2962789ddb9SSimon Glass information. 2972789ddb9SSimon Glass 298f291ce12SPhilipp Tomsichconfig TPL_OF_PLATDATA 299f291ce12SPhilipp Tomsich bool "Generate platform data for use in TPL" 300f291ce12SPhilipp Tomsich depends on TPL_OF_CONTROL 301ec821af4SMasahiro Yamada select DTOC 302f291ce12SPhilipp Tomsich help 303f291ce12SPhilipp Tomsich For very constrained SPL environments the overhead of decoding 304f291ce12SPhilipp Tomsich device tree nodes and converting their contents into platform data 305f291ce12SPhilipp Tomsich is too large. This overhead includes libfdt code as well as the 306f291ce12SPhilipp Tomsich device tree contents itself. The latter is fairly compact, but the 307f291ce12SPhilipp Tomsich former can add 3KB or more to a Thumb 2 Image. 308f291ce12SPhilipp Tomsich 309f291ce12SPhilipp Tomsich This option enables generation of platform data from the device 310f291ce12SPhilipp Tomsich tree as C code. This code creates devices using U_BOOT_DEVICE() 311f291ce12SPhilipp Tomsich declarations. The benefit is that it allows driver code to access 312f291ce12SPhilipp Tomsich the platform data directly in C structures, avoidin the libfdt 313f291ce12SPhilipp Tomsich overhead. 314f291ce12SPhilipp Tomsich 315f291ce12SPhilipp Tomsich This option works by generating C structure declarations for each 316f291ce12SPhilipp Tomsich compatible string, then adding platform data and U_BOOT_DEVICE 317f291ce12SPhilipp Tomsich declarations for each node. See README.platdata for more 318f291ce12SPhilipp Tomsich information. 319f291ce12SPhilipp Tomsich 320783e6a72SMasahiro Yamadaendmenu 321f8470aeeSTom Rini 322f8470aeeSTom Riniconfig MKIMAGE_DTC_PATH 323f8470aeeSTom Rini string "Path to dtc binary for use within mkimage" 324f8470aeeSTom Rini default "dtc" 325f8470aeeSTom Rini help 326f8470aeeSTom Rini The mkimage host tool will, in order to generate FIT images make 327f8470aeeSTom Rini calls to the dtc application in order to create the output. In 328f8470aeeSTom Rini some cases the system dtc may not support all required features 329f8470aeeSTom Rini and the path to a different version should be given here. 330