1783e6a72SMasahiro Yamada# 2783e6a72SMasahiro Yamada# Device Tree Control 3783e6a72SMasahiro Yamada# 4783e6a72SMasahiro Yamada 5783e6a72SMasahiro Yamadaconfig SUPPORT_OF_CONTROL 6783e6a72SMasahiro Yamada bool 7783e6a72SMasahiro Yamada 836dd5f1bSTom Riniconfig DTC 936dd5f1bSTom Rini bool 1036dd5f1bSTom Rini 11d6a0c78aSMasahiro Yamadaconfig PYLIBFDT 12d6a0c78aSMasahiro Yamada bool 13d6a0c78aSMasahiro Yamada 14d6a0c78aSMasahiro Yamadaconfig DTOC 15d6a0c78aSMasahiro Yamada bool 16d6a0c78aSMasahiro Yamada select PYLIBFDT 17d6a0c78aSMasahiro Yamada 18d6a0c78aSMasahiro Yamadaconfig BINMAN 19d6a0c78aSMasahiro Yamada bool 20d6a0c78aSMasahiro Yamada select DTOC 21d6a0c78aSMasahiro 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" 2736dd5f1bSTom 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 322a792753Smario.six@gdsys.ccconfig OF_BOARD_FIXUP 332a792753Smario.six@gdsys.cc bool "Board-specific manipulation of Device Tree" 342a792753Smario.six@gdsys.cc help 352a792753Smario.six@gdsys.cc In certain circumstances it is necessary to be able to modify 362a792753Smario.six@gdsys.cc U-Boot's device tree (e.g. to delete device from it). This option 372a792753Smario.six@gdsys.cc make the Device Tree writeable and provides a board-specific 382a792753Smario.six@gdsys.cc "board_fix_fdt" callback (called during pre-relocation time), which 392a792753Smario.six@gdsys.cc enables the board initialization to modifiy the Device Tree. The 402a792753Smario.six@gdsys.cc modified copy is subsequently used by U-Boot after relocation. 412a792753Smario.six@gdsys.cc 42dffb86e4SMasahiro Yamadaconfig SPL_OF_CONTROL 43dffb86e4SMasahiro Yamada bool "Enable run-time configuration via Device Tree in SPL" 44dffb86e4SMasahiro Yamada depends on SPL && OF_CONTROL 452860f03bSSimon Glass help 462860f03bSSimon Glass Some boards use device tree in U-Boot but only have 4KB of SRAM 472860f03bSSimon Glass which is not enough to support device tree. Enable this option to 482860f03bSSimon Glass allow such boards to be supported by U-Boot SPL. 492860f03bSSimon Glass 50f291ce12SPhilipp Tomsichconfig TPL_OF_CONTROL 51f291ce12SPhilipp Tomsich bool "Enable run-time configuration via Device Tree in TPL" 52f291ce12SPhilipp Tomsich depends on TPL && OF_CONTROL 53f291ce12SPhilipp Tomsich help 54f291ce12SPhilipp Tomsich Some boards use device tree in U-Boot but only have 4KB of SRAM 55f291ce12SPhilipp Tomsich which is not enough to support device tree. Enable this option to 56f291ce12SPhilipp Tomsich allow such boards to be supported by U-Boot TPL. 57f291ce12SPhilipp Tomsich 585e060d8bSSimon Glassconfig OF_LIVE 595e060d8bSSimon Glass bool "Enable use of a live tree" 605e060d8bSSimon Glass depends on OF_CONTROL 615e060d8bSSimon Glass help 625e060d8bSSimon Glass Normally U-Boot uses a flat device tree which saves space and 635e060d8bSSimon Glass avoids the need to unpack the tree before use. However a flat 644adc6605SMichal Simek tree does not support modification from within U-Boot since it 655e060d8bSSimon Glass can invalidate driver-model device tree offsets. This option 665e060d8bSSimon Glass enables a live tree which is available after relocation, 675e060d8bSSimon Glass and can be adjusted as needed. 685e060d8bSSimon Glass 69783e6a72SMasahiro Yamadachoice 70783e6a72SMasahiro Yamada prompt "Provider of DTB for DT control" 71783e6a72SMasahiro Yamada depends on OF_CONTROL 72783e6a72SMasahiro Yamada 73783e6a72SMasahiro Yamadaconfig OF_SEPARATE 74783e6a72SMasahiro Yamada bool "Separate DTB for DT control" 75783e6a72SMasahiro Yamada depends on !SANDBOX 76783e6a72SMasahiro Yamada help 77783e6a72SMasahiro Yamada If this option is enabled, the device tree will be built and 78783e6a72SMasahiro Yamada placed as a separate u-boot.dtb file alongside the U-Boot image. 79783e6a72SMasahiro Yamada 80783e6a72SMasahiro Yamadaconfig OF_EMBED 81783e6a72SMasahiro Yamada bool "Embedded DTB for DT control" 82783e6a72SMasahiro Yamada help 83783e6a72SMasahiro Yamada If this option is enabled, the device tree will be picked up and 843d3f60cbSSimon Glass built into the U-Boot image. This is suitable for local debugging 853d3f60cbSSimon Glass and development only and is not recommended for production devices. 863d3f60cbSSimon Glass Boards in the mainline U-Boot tree should not use it. 87783e6a72SMasahiro Yamada 8882f766d1SAlex Deymoconfig OF_BOARD 8982f766d1SAlex Deymo bool "Provided by the board at runtime" 9082f766d1SAlex Deymo depends on !SANDBOX 9182f766d1SAlex Deymo help 9282f766d1SAlex Deymo If this option is enabled, the device tree will be provided by 9382f766d1SAlex Deymo the board at runtime if the board supports it, instead of being 9482f766d1SAlex Deymo bundled with the image. 9582f766d1SAlex Deymo 96783e6a72SMasahiro Yamadaconfig OF_HOSTFILE 97783e6a72SMasahiro Yamada bool "Host filed DTB for DT control" 98783e6a72SMasahiro Yamada depends on SANDBOX 99783e6a72SMasahiro Yamada help 100783e6a72SMasahiro Yamada If this option is enabled, DTB will be read from a file on startup. 101783e6a72SMasahiro Yamada This is only useful for Sandbox. Use the -d flag to U-Boot to 102783e6a72SMasahiro Yamada specify the file to read. 103783e6a72SMasahiro Yamada 104894c3ad2SThomas Fitzsimmonsconfig OF_PRIOR_STAGE 105894c3ad2SThomas Fitzsimmons bool "Prior stage bootloader DTB for DT control" 106894c3ad2SThomas Fitzsimmons help 107894c3ad2SThomas Fitzsimmons If this option is enabled, the device tree used for DT 108894c3ad2SThomas Fitzsimmons control will be read from a device tree binary, at a memory 109894c3ad2SThomas Fitzsimmons location passed to U-Boot by the prior stage bootloader. 110894c3ad2SThomas Fitzsimmons 111783e6a72SMasahiro Yamadaendchoice 112783e6a72SMasahiro Yamada 113f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE 114f1ef2b62SMasahiro Yamada string "Default Device Tree for DT control" 11570d41093SSimon Glass depends on OF_CONTROL 116f1ef2b62SMasahiro Yamada help 117f1ef2b62SMasahiro Yamada This option specifies the default Device Tree used for DT control. 1185699ea6dSRobert P. J. Day It can be overridden from the command line: 119f1ef2b62SMasahiro Yamada $ make DEVICE_TREE=<device-tree-name> 120f1ef2b62SMasahiro Yamada 121cdf17246SSimon Glassconfig OF_LIST 122cdf17246SSimon Glass string "List of device tree files to include for DT control" 12311955590SJean-Jacques Hiblot depends on SPL_LOAD_FIT || MULTI_DTB_FIT 124c409bd01SMichal Simek default DEFAULT_DEVICE_TREE 125cdf17246SSimon Glass help 126cdf17246SSimon Glass This option specifies a list of device tree files to use for DT 127d9797409SCooper Jr., Franklin control. These will be packaged into a FIT. At run-time, U-boot 128d9797409SCooper Jr., Franklin or SPL will select the correct DT to use by examining the 129d9797409SCooper Jr., Franklin hardware (e.g. reading a board ID value). This is a list of 130d9797409SCooper Jr., Franklin device tree files (without the directory or .dtb suffix) 131d9797409SCooper Jr., Franklin separated by <space>. 132cdf17246SSimon Glass 13311955590SJean-Jacques Hiblot 13411955590SJean-Jacques Hiblotconfig DTB_RESELECT 13511955590SJean-Jacques Hiblot bool "Support swapping dtbs at a later point in boot" 13611955590SJean-Jacques Hiblot depends on MULTI_DTB_FIT 13711955590SJean-Jacques Hiblot help 13811955590SJean-Jacques Hiblot It is possible during initial boot you may need to use a generic 13911955590SJean-Jacques Hiblot dtb until you can fully determine the board your running on. This 14011955590SJean-Jacques Hiblot config allows boards to implement a function at a later point 14111955590SJean-Jacques Hiblot during boot to switch to the "correct" dtb. 14211955590SJean-Jacques Hiblot 14311955590SJean-Jacques Hiblotconfig MULTI_DTB_FIT 14411955590SJean-Jacques Hiblot bool "Support embedding several DTBs in a FIT image for u-boot" 14511955590SJean-Jacques Hiblot help 14611955590SJean-Jacques Hiblot This option provides hooks to allow U-boot to parse an 14711955590SJean-Jacques Hiblot appended FIT image and enable board specific code to then select 14811955590SJean-Jacques Hiblot the correct DTB to be used. Use this if you need to support 14911955590SJean-Jacques Hiblot multiple DTBs but don't use the SPL. 15011955590SJean-Jacques Hiblot 1512f57c951SJean-Jacques Hiblot 1522f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT 1532f57c951SJean-Jacques Hiblot depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA 1542f57c951SJean-Jacques Hiblot bool "Support embedding several DTBs in a FIT image for the SPL" 1552f57c951SJean-Jacques Hiblot help 1562f57c951SJean-Jacques Hiblot This option provides the SPL with the ability to select its own 1572f57c951SJean-Jacques Hiblot DTB at runtime from an appended FIT image containing several DTBs. 1582f57c951SJean-Jacques Hiblot This allows using the same SPL binary on multiple platforms. 1592f57c951SJean-Jacques Hiblot The primary purpose is to handle different versions of 1602f57c951SJean-Jacques Hiblot the same platform without tweaking the platform code if the 1612f57c951SJean-Jacques Hiblot differences can be expressed in the DTBs (common examples are: bus 1622f57c951SJean-Jacques Hiblot capabilities, pad configurations). 1632f57c951SJean-Jacques Hiblot 1642f57c951SJean-Jacques Hiblotconfig SPL_OF_LIST 1652f57c951SJean-Jacques Hiblot string "List of device tree files to include for DT control in SPL" 1662f57c951SJean-Jacques Hiblot depends on SPL_MULTI_DTB_FIT 1672f57c951SJean-Jacques Hiblot default OF_LIST 1682f57c951SJean-Jacques Hiblot help 1692f57c951SJean-Jacques Hiblot This option specifies a list of device tree files to use for DT 1702f57c951SJean-Jacques Hiblot control in the SPL. These will be packaged into a FIT. At run-time, 1712f57c951SJean-Jacques Hiblot the SPL will select the correct DT to use by examining the 1722f57c951SJean-Jacques Hiblot hardware (e.g. reading a board ID value). This is a list of 1732f57c951SJean-Jacques Hiblot device tree files (without the directory or .dtb suffix) 1742f57c951SJean-Jacques Hiblot separated by <space>. 1752f57c951SJean-Jacques Hiblot 1762f57c951SJean-Jacques Hiblotchoice 1772f57c951SJean-Jacques Hiblot prompt "SPL OF LIST compression" 1782f57c951SJean-Jacques Hiblot depends on SPL_MULTI_DTB_FIT 1792f57c951SJean-Jacques Hiblot default SPL_MULTI_DTB_FIT_LZO 1802f57c951SJean-Jacques Hiblot 1812f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_LZO 1822f57c951SJean-Jacques Hiblot bool "LZO" 1832f57c951SJean-Jacques Hiblot depends on SYS_MALLOC_F 1842f57c951SJean-Jacques Hiblot select SPL_LZO 1852f57c951SJean-Jacques Hiblot help 1862f57c951SJean-Jacques Hiblot Compress the FIT image containing the DTBs available for the SPL 1872f57c951SJean-Jacques Hiblot using LZO compression. (requires lzop on host). 1882f57c951SJean-Jacques Hiblot 1892f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_GZIP 1902f57c951SJean-Jacques Hiblot bool "GZIP" 1912f57c951SJean-Jacques Hiblot depends on SYS_MALLOC_F 1922f57c951SJean-Jacques Hiblot select SPL_GZIP 1932f57c951SJean-Jacques Hiblot help 1942f57c951SJean-Jacques Hiblot Compress the FIT image containing the DTBs available for the SPL 1952f57c951SJean-Jacques Hiblot using GZIP compression. (requires gzip on host) 1962f57c951SJean-Jacques Hiblot 1972f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_NO_COMPRESSION 1982f57c951SJean-Jacques Hiblot bool "No compression" 1992f57c951SJean-Jacques Hiblot help 2002f57c951SJean-Jacques Hiblot Do not compress the FIT image containing the DTBs available for the SPL. 2012f57c951SJean-Jacques Hiblot Use this options only if LZO is not available and the DTBs are very small. 2022f57c951SJean-Jacques Hiblotendchoice 2032f57c951SJean-Jacques Hiblot 2042f57c951SJean-Jacques Hiblotchoice 2052f57c951SJean-Jacques Hiblot prompt "Location of uncompressed DTBs" 2062f57c951SJean-Jacques Hiblot depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) 2072f57c951SJean-Jacques Hiblot default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F 2082f57c951SJean-Jacques Hiblot 2092f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_DYN_ALLOC 2102f57c951SJean-Jacques Hiblot bool "Dynamically allocate the memory" 2112f57c951SJean-Jacques Hiblot depends on SYS_MALLOC_F 2122f57c951SJean-Jacques Hiblot 2132f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_USER_DEFINED_AREA 2142f57c951SJean-Jacques Hiblot bool "User-defined location" 2152f57c951SJean-Jacques Hiblotendchoice 2162f57c951SJean-Jacques Hiblot 2172f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ 2182f57c951SJean-Jacques Hiblot hex "Size of memory reserved to uncompress the DTBs" 2192f57c951SJean-Jacques Hiblot depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO) 2202f57c951SJean-Jacques Hiblot default 0x8000 2212f57c951SJean-Jacques Hiblot help 2222f57c951SJean-Jacques Hiblot This is the size of this area where the DTBs are uncompressed. 2232f57c951SJean-Jacques Hiblot If this area is dynamically allocated, make sure that 2242f57c951SJean-Jacques Hiblot SPL_SYS_MALLOC_F_LEN is big enough to contain it. 2252f57c951SJean-Jacques Hiblot 2262f57c951SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_USER_DEF_ADDR 2272f57c951SJean-Jacques Hiblot hex "Address of memory where dtbs are uncompressed" 2282f57c951SJean-Jacques Hiblot depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA 2292f57c951SJean-Jacques Hiblot help 2302f57c951SJean-Jacques Hiblot the FIT image containing the DTBs is uncompressed in an area defined 2312f57c951SJean-Jacques Hiblot at compilation time. This is the address of this area. It must be 2322f57c951SJean-Jacques Hiblot aligned on 2-byte boundary. 2332f57c951SJean-Jacques Hiblot 234fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS 235fa78e0a3SSimon Glass string "List of device tree properties to drop for SPL" 236897705ecSMasahiro Yamada depends on SPL_OF_CONTROL 237239ae4a9SVikas Manocha default "interrupt-parent" if SPL_PINCTRL && SPL_CLK 238239ae4a9SVikas Manocha default "clocks clock-names interrupt-parent" if SPL_PINCTRL 2395f3f7b79SMasahiro Yamada default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK 240fa78e0a3SSimon Glass default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" 241fa78e0a3SSimon Glass help 242fa78e0a3SSimon Glass Since SPL normally runs in a reduced memory space, the device tree 243fa78e0a3SSimon Glass is cut down to only what is needed to load and start U-Boot. Only 244fa78e0a3SSimon Glass nodes marked with the property "u-boot,dm-pre-reloc" will be 245fa78e0a3SSimon Glass included. In addition, some properties are not used by U-Boot and 246fa78e0a3SSimon Glass can be discarded. This option defines the list of properties to 247fa78e0a3SSimon Glass discard. 248fa78e0a3SSimon Glass 2492789ddb9SSimon Glassconfig SPL_OF_PLATDATA 2502789ddb9SSimon Glass bool "Generate platform data for use in SPL" 2512789ddb9SSimon Glass depends on SPL_OF_CONTROL 252d6a0c78aSMasahiro Yamada select DTOC 2532789ddb9SSimon Glass help 2542789ddb9SSimon Glass For very constrained SPL environments the overhead of decoding 2552789ddb9SSimon Glass device tree nodes and converting their contents into platform data 2562789ddb9SSimon Glass is too large. This overhead includes libfdt code as well as the 2572789ddb9SSimon Glass device tree contents itself. The latter is fairly compact, but the 2582789ddb9SSimon Glass former can add 3KB or more to a Thumb 2 Image. 2592789ddb9SSimon Glass 2602789ddb9SSimon Glass This option enables generation of platform data from the device 2612789ddb9SSimon Glass tree as C code. This code creates devices using U_BOOT_DEVICE() 2622789ddb9SSimon Glass declarations. The benefit is that it allows driver code to access 2632789ddb9SSimon Glass the platform data directly in C structures, avoidin the libfdt 2642789ddb9SSimon Glass overhead. 2652789ddb9SSimon Glass 2662789ddb9SSimon Glass This option works by generating C structure declarations for each 2672789ddb9SSimon Glass compatible string, then adding platform data and U_BOOT_DEVICE 268*3600b461SSimon Goldschmidt declarations for each node. See of-plat.txt for more information. 2692789ddb9SSimon Glass 270f291ce12SPhilipp Tomsichconfig TPL_OF_PLATDATA 271f291ce12SPhilipp Tomsich bool "Generate platform data for use in TPL" 272f291ce12SPhilipp Tomsich depends on TPL_OF_CONTROL 273d6a0c78aSMasahiro Yamada select DTOC 274f291ce12SPhilipp Tomsich help 275f291ce12SPhilipp Tomsich For very constrained SPL environments the overhead of decoding 276f291ce12SPhilipp Tomsich device tree nodes and converting their contents into platform data 277f291ce12SPhilipp Tomsich is too large. This overhead includes libfdt code as well as the 278f291ce12SPhilipp Tomsich device tree contents itself. The latter is fairly compact, but the 279f291ce12SPhilipp Tomsich former can add 3KB or more to a Thumb 2 Image. 280f291ce12SPhilipp Tomsich 281f291ce12SPhilipp Tomsich This option enables generation of platform data from the device 282f291ce12SPhilipp Tomsich tree as C code. This code creates devices using U_BOOT_DEVICE() 283f291ce12SPhilipp Tomsich declarations. The benefit is that it allows driver code to access 284f291ce12SPhilipp Tomsich the platform data directly in C structures, avoidin the libfdt 285f291ce12SPhilipp Tomsich overhead. 286f291ce12SPhilipp Tomsich 287f291ce12SPhilipp Tomsich This option works by generating C structure declarations for each 288f291ce12SPhilipp Tomsich compatible string, then adding platform data and U_BOOT_DEVICE 289*3600b461SSimon Goldschmidt declarations for each node. See of-plat.txt for more information. 290f291ce12SPhilipp Tomsich 291783e6a72SMasahiro Yamadaendmenu 2921f6049e2STom Rini 2931f6049e2STom Riniconfig MKIMAGE_DTC_PATH 2941f6049e2STom Rini string "Path to dtc binary for use within mkimage" 2951f6049e2STom Rini default "dtc" 2961f6049e2STom Rini help 2971f6049e2STom Rini The mkimage host tool will, in order to generate FIT images make 2981f6049e2STom Rini calls to the dtc application in order to create the output. In 2991f6049e2STom Rini some cases the system dtc may not support all required features 3001f6049e2STom Rini and the path to a different version should be given here. 301