1783e6a72SMasahiro Yamada# 2783e6a72SMasahiro Yamada# Device Tree Control 3783e6a72SMasahiro Yamada# 4783e6a72SMasahiro Yamada 5783e6a72SMasahiro Yamadaconfig SUPPORT_OF_CONTROL 6783e6a72SMasahiro Yamada bool 7783e6a72SMasahiro Yamada 8783e6a72SMasahiro Yamadamenu "Device Tree Control" 9783e6a72SMasahiro Yamada depends on SUPPORT_OF_CONTROL 10783e6a72SMasahiro Yamada 11783e6a72SMasahiro Yamadaconfig OF_CONTROL 12783e6a72SMasahiro Yamada bool "Run-time configuration via Device Tree" 13783e6a72SMasahiro Yamada help 14783e6a72SMasahiro Yamada This feature provides for run-time configuration of U-Boot 15783e6a72SMasahiro Yamada via a flattened device tree. 16783e6a72SMasahiro Yamada 172a792753Smario.six@gdsys.ccconfig OF_BOARD_FIXUP 182a792753Smario.six@gdsys.cc bool "Board-specific manipulation of Device Tree" 192a792753Smario.six@gdsys.cc help 202a792753Smario.six@gdsys.cc In certain circumstances it is necessary to be able to modify 212a792753Smario.six@gdsys.cc U-Boot's device tree (e.g. to delete device from it). This option 222a792753Smario.six@gdsys.cc make the Device Tree writeable and provides a board-specific 232a792753Smario.six@gdsys.cc "board_fix_fdt" callback (called during pre-relocation time), which 242a792753Smario.six@gdsys.cc enables the board initialization to modifiy the Device Tree. The 252a792753Smario.six@gdsys.cc modified copy is subsequently used by U-Boot after relocation. 262a792753Smario.six@gdsys.cc 27dffb86e4SMasahiro Yamadaconfig SPL_OF_CONTROL 28dffb86e4SMasahiro Yamada bool "Enable run-time configuration via Device Tree in SPL" 29dffb86e4SMasahiro Yamada depends on SPL && OF_CONTROL 302860f03bSSimon Glass help 312860f03bSSimon Glass Some boards use device tree in U-Boot but only have 4KB of SRAM 322860f03bSSimon Glass which is not enough to support device tree. Enable this option to 332860f03bSSimon Glass allow such boards to be supported by U-Boot SPL. 342860f03bSSimon Glass 35*f291ce12SPhilipp Tomsichconfig TPL_OF_CONTROL 36*f291ce12SPhilipp Tomsich bool "Enable run-time configuration via Device Tree in TPL" 37*f291ce12SPhilipp Tomsich depends on TPL && OF_CONTROL 38*f291ce12SPhilipp Tomsich help 39*f291ce12SPhilipp Tomsich Some boards use device tree in U-Boot but only have 4KB of SRAM 40*f291ce12SPhilipp Tomsich which is not enough to support device tree. Enable this option to 41*f291ce12SPhilipp Tomsich allow such boards to be supported by U-Boot TPL. 42*f291ce12SPhilipp Tomsich 435e060d8bSSimon Glassconfig OF_LIVE 445e060d8bSSimon Glass bool "Enable use of a live tree" 455e060d8bSSimon Glass depends on OF_CONTROL 465e060d8bSSimon Glass help 475e060d8bSSimon Glass Normally U-Boot uses a flat device tree which saves space and 485e060d8bSSimon Glass avoids the need to unpack the tree before use. However a flat 495e060d8bSSimon Glass tree does not support modifcation from within U-Boot since it 505e060d8bSSimon Glass can invalidate driver-model device tree offsets. This option 515e060d8bSSimon Glass enables a live tree which is available after relocation, 525e060d8bSSimon Glass and can be adjusted as needed. 535e060d8bSSimon Glass 54783e6a72SMasahiro Yamadachoice 55783e6a72SMasahiro Yamada prompt "Provider of DTB for DT control" 56783e6a72SMasahiro Yamada depends on OF_CONTROL 57783e6a72SMasahiro Yamada 58783e6a72SMasahiro Yamadaconfig OF_SEPARATE 59783e6a72SMasahiro Yamada bool "Separate DTB for DT control" 60783e6a72SMasahiro Yamada depends on !SANDBOX 61783e6a72SMasahiro Yamada help 62783e6a72SMasahiro Yamada If this option is enabled, the device tree will be built and 63783e6a72SMasahiro Yamada placed as a separate u-boot.dtb file alongside the U-Boot image. 64783e6a72SMasahiro Yamada 65783e6a72SMasahiro Yamadaconfig OF_EMBED 66783e6a72SMasahiro Yamada bool "Embedded DTB for DT control" 67783e6a72SMasahiro Yamada help 68783e6a72SMasahiro Yamada If this option is enabled, the device tree will be picked up and 693d3f60cbSSimon Glass built into the U-Boot image. This is suitable for local debugging 703d3f60cbSSimon Glass and development only and is not recommended for production devices. 713d3f60cbSSimon Glass Boards in the mainline U-Boot tree should not use it. 72783e6a72SMasahiro Yamada 7382f766d1SAlex Deymoconfig OF_BOARD 7482f766d1SAlex Deymo bool "Provided by the board at runtime" 7582f766d1SAlex Deymo depends on !SANDBOX 7682f766d1SAlex Deymo help 7782f766d1SAlex Deymo If this option is enabled, the device tree will be provided by 7882f766d1SAlex Deymo the board at runtime if the board supports it, instead of being 7982f766d1SAlex Deymo bundled with the image. 8082f766d1SAlex Deymo 81783e6a72SMasahiro Yamadaconfig OF_HOSTFILE 82783e6a72SMasahiro Yamada bool "Host filed DTB for DT control" 83783e6a72SMasahiro Yamada depends on SANDBOX 84783e6a72SMasahiro Yamada help 85783e6a72SMasahiro Yamada If this option is enabled, DTB will be read from a file on startup. 86783e6a72SMasahiro Yamada This is only useful for Sandbox. Use the -d flag to U-Boot to 87783e6a72SMasahiro Yamada specify the file to read. 88783e6a72SMasahiro Yamada 89783e6a72SMasahiro Yamadaendchoice 90783e6a72SMasahiro Yamada 91f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE 92f1ef2b62SMasahiro Yamada string "Default Device Tree for DT control" 9370d41093SSimon Glass depends on OF_CONTROL 94f1ef2b62SMasahiro Yamada help 95f1ef2b62SMasahiro Yamada This option specifies the default Device Tree used for DT control. 965699ea6dSRobert P. J. Day It can be overridden from the command line: 97f1ef2b62SMasahiro Yamada $ make DEVICE_TREE=<device-tree-name> 98f1ef2b62SMasahiro Yamada 99cdf17246SSimon Glassconfig OF_LIST 100cdf17246SSimon Glass string "List of device tree files to include for DT control" 101d9797409SCooper Jr., Franklin depends on SPL_LOAD_FIT || FIT_EMBED 102c409bd01SMichal Simek default DEFAULT_DEVICE_TREE 103cdf17246SSimon Glass help 104cdf17246SSimon Glass This option specifies a list of device tree files to use for DT 105d9797409SCooper Jr., Franklin control. These will be packaged into a FIT. At run-time, U-boot 106d9797409SCooper Jr., Franklin or SPL will select the correct DT to use by examining the 107d9797409SCooper Jr., Franklin hardware (e.g. reading a board ID value). This is a list of 108d9797409SCooper Jr., Franklin device tree files (without the directory or .dtb suffix) 109d9797409SCooper Jr., Franklin separated by <space>. 110cdf17246SSimon Glass 111fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS 112fa78e0a3SSimon Glass string "List of device tree properties to drop for SPL" 113897705ecSMasahiro Yamada depends on SPL_OF_CONTROL 114239ae4a9SVikas Manocha default "interrupt-parent" if SPL_PINCTRL && SPL_CLK 115239ae4a9SVikas Manocha default "clocks clock-names interrupt-parent" if SPL_PINCTRL 1165f3f7b79SMasahiro Yamada default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK 117fa78e0a3SSimon Glass default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" 118fa78e0a3SSimon Glass help 119fa78e0a3SSimon Glass Since SPL normally runs in a reduced memory space, the device tree 120fa78e0a3SSimon Glass is cut down to only what is needed to load and start U-Boot. Only 121fa78e0a3SSimon Glass nodes marked with the property "u-boot,dm-pre-reloc" will be 122fa78e0a3SSimon Glass included. In addition, some properties are not used by U-Boot and 123fa78e0a3SSimon Glass can be discarded. This option defines the list of properties to 124fa78e0a3SSimon Glass discard. 125fa78e0a3SSimon Glass 1262789ddb9SSimon Glassconfig SPL_OF_PLATDATA 1272789ddb9SSimon Glass bool "Generate platform data for use in SPL" 1282789ddb9SSimon Glass depends on SPL_OF_CONTROL 1292789ddb9SSimon Glass help 1302789ddb9SSimon Glass For very constrained SPL environments the overhead of decoding 1312789ddb9SSimon Glass device tree nodes and converting their contents into platform data 1322789ddb9SSimon Glass is too large. This overhead includes libfdt code as well as the 1332789ddb9SSimon Glass device tree contents itself. The latter is fairly compact, but the 1342789ddb9SSimon Glass former can add 3KB or more to a Thumb 2 Image. 1352789ddb9SSimon Glass 1362789ddb9SSimon Glass This option enables generation of platform data from the device 1372789ddb9SSimon Glass tree as C code. This code creates devices using U_BOOT_DEVICE() 1382789ddb9SSimon Glass declarations. The benefit is that it allows driver code to access 1392789ddb9SSimon Glass the platform data directly in C structures, avoidin the libfdt 1402789ddb9SSimon Glass overhead. 1412789ddb9SSimon Glass 1422789ddb9SSimon Glass This option works by generating C structure declarations for each 1432789ddb9SSimon Glass compatible string, then adding platform data and U_BOOT_DEVICE 1442789ddb9SSimon Glass declarations for each node. See README.platdata for more 1452789ddb9SSimon Glass information. 1462789ddb9SSimon Glass 147*f291ce12SPhilipp Tomsichconfig TPL_OF_PLATDATA 148*f291ce12SPhilipp Tomsich bool "Generate platform data for use in TPL" 149*f291ce12SPhilipp Tomsich depends on TPL_OF_CONTROL 150*f291ce12SPhilipp Tomsich help 151*f291ce12SPhilipp Tomsich For very constrained SPL environments the overhead of decoding 152*f291ce12SPhilipp Tomsich device tree nodes and converting their contents into platform data 153*f291ce12SPhilipp Tomsich is too large. This overhead includes libfdt code as well as the 154*f291ce12SPhilipp Tomsich device tree contents itself. The latter is fairly compact, but the 155*f291ce12SPhilipp Tomsich former can add 3KB or more to a Thumb 2 Image. 156*f291ce12SPhilipp Tomsich 157*f291ce12SPhilipp Tomsich This option enables generation of platform data from the device 158*f291ce12SPhilipp Tomsich tree as C code. This code creates devices using U_BOOT_DEVICE() 159*f291ce12SPhilipp Tomsich declarations. The benefit is that it allows driver code to access 160*f291ce12SPhilipp Tomsich the platform data directly in C structures, avoidin the libfdt 161*f291ce12SPhilipp Tomsich overhead. 162*f291ce12SPhilipp Tomsich 163*f291ce12SPhilipp Tomsich This option works by generating C structure declarations for each 164*f291ce12SPhilipp Tomsich compatible string, then adding platform data and U_BOOT_DEVICE 165*f291ce12SPhilipp Tomsich declarations for each node. See README.platdata for more 166*f291ce12SPhilipp Tomsich information. 167*f291ce12SPhilipp Tomsich 168783e6a72SMasahiro Yamadaendmenu 169