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 35783e6a72SMasahiro Yamadachoice 36783e6a72SMasahiro Yamada prompt "Provider of DTB for DT control" 37783e6a72SMasahiro Yamada depends on OF_CONTROL 38783e6a72SMasahiro Yamada 39783e6a72SMasahiro Yamadaconfig OF_SEPARATE 40783e6a72SMasahiro Yamada bool "Separate DTB for DT control" 41783e6a72SMasahiro Yamada depends on !SANDBOX 42783e6a72SMasahiro Yamada help 43783e6a72SMasahiro Yamada If this option is enabled, the device tree will be built and 44783e6a72SMasahiro Yamada placed as a separate u-boot.dtb file alongside the U-Boot image. 45783e6a72SMasahiro Yamada 46783e6a72SMasahiro Yamadaconfig OF_EMBED 47783e6a72SMasahiro Yamada bool "Embedded DTB for DT control" 48783e6a72SMasahiro Yamada help 49783e6a72SMasahiro Yamada If this option is enabled, the device tree will be picked up and 503d3f60cbSSimon Glass built into the U-Boot image. This is suitable for local debugging 513d3f60cbSSimon Glass and development only and is not recommended for production devices. 523d3f60cbSSimon Glass Boards in the mainline U-Boot tree should not use it. 53783e6a72SMasahiro Yamada 54*82f766d1SAlex Deymoconfig OF_BOARD 55*82f766d1SAlex Deymo bool "Provided by the board at runtime" 56*82f766d1SAlex Deymo depends on !SANDBOX 57*82f766d1SAlex Deymo help 58*82f766d1SAlex Deymo If this option is enabled, the device tree will be provided by 59*82f766d1SAlex Deymo the board at runtime if the board supports it, instead of being 60*82f766d1SAlex Deymo bundled with the image. 61*82f766d1SAlex Deymo 62783e6a72SMasahiro Yamadaconfig OF_HOSTFILE 63783e6a72SMasahiro Yamada bool "Host filed DTB for DT control" 64783e6a72SMasahiro Yamada depends on SANDBOX 65783e6a72SMasahiro Yamada help 66783e6a72SMasahiro Yamada If this option is enabled, DTB will be read from a file on startup. 67783e6a72SMasahiro Yamada This is only useful for Sandbox. Use the -d flag to U-Boot to 68783e6a72SMasahiro Yamada specify the file to read. 69783e6a72SMasahiro Yamada 70783e6a72SMasahiro Yamadaendchoice 71783e6a72SMasahiro Yamada 72f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE 73f1ef2b62SMasahiro Yamada string "Default Device Tree for DT control" 7470d41093SSimon Glass depends on OF_CONTROL 75f1ef2b62SMasahiro Yamada help 76f1ef2b62SMasahiro Yamada This option specifies the default Device Tree used for DT control. 775699ea6dSRobert P. J. Day It can be overridden from the command line: 78f1ef2b62SMasahiro Yamada $ make DEVICE_TREE=<device-tree-name> 79f1ef2b62SMasahiro Yamada 80cdf17246SSimon Glassconfig OF_LIST 81cdf17246SSimon Glass string "List of device tree files to include for DT control" 82cdf17246SSimon Glass depends on SPL_LOAD_FIT 83c409bd01SMichal Simek default DEFAULT_DEVICE_TREE 84cdf17246SSimon Glass help 85cdf17246SSimon Glass This option specifies a list of device tree files to use for DT 86cdf17246SSimon Glass control. These will be packaged into a FIT. At run-time, SPL will 87cdf17246SSimon Glass select the correct DT to use by examining the hardware (e.g. 88cdf17246SSimon Glass reading a board ID value). This is a list of device tree files 89cdf17246SSimon Glass (without the directory or .dtb suffix) separated by <space>. 90cdf17246SSimon Glass 91fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS 92fa78e0a3SSimon Glass string "List of device tree properties to drop for SPL" 93897705ecSMasahiro Yamada depends on SPL_OF_CONTROL 94239ae4a9SVikas Manocha default "interrupt-parent" if SPL_PINCTRL && SPL_CLK 95239ae4a9SVikas Manocha default "clocks clock-names interrupt-parent" if SPL_PINCTRL 965f3f7b79SMasahiro Yamada default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK 97fa78e0a3SSimon Glass default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent" 98fa78e0a3SSimon Glass help 99fa78e0a3SSimon Glass Since SPL normally runs in a reduced memory space, the device tree 100fa78e0a3SSimon Glass is cut down to only what is needed to load and start U-Boot. Only 101fa78e0a3SSimon Glass nodes marked with the property "u-boot,dm-pre-reloc" will be 102fa78e0a3SSimon Glass included. In addition, some properties are not used by U-Boot and 103fa78e0a3SSimon Glass can be discarded. This option defines the list of properties to 104fa78e0a3SSimon Glass discard. 105fa78e0a3SSimon Glass 1062789ddb9SSimon Glassconfig SPL_OF_PLATDATA 1072789ddb9SSimon Glass bool "Generate platform data for use in SPL" 1082789ddb9SSimon Glass depends on SPL_OF_CONTROL 1092789ddb9SSimon Glass help 1102789ddb9SSimon Glass For very constrained SPL environments the overhead of decoding 1112789ddb9SSimon Glass device tree nodes and converting their contents into platform data 1122789ddb9SSimon Glass is too large. This overhead includes libfdt code as well as the 1132789ddb9SSimon Glass device tree contents itself. The latter is fairly compact, but the 1142789ddb9SSimon Glass former can add 3KB or more to a Thumb 2 Image. 1152789ddb9SSimon Glass 1162789ddb9SSimon Glass This option enables generation of platform data from the device 1172789ddb9SSimon Glass tree as C code. This code creates devices using U_BOOT_DEVICE() 1182789ddb9SSimon Glass declarations. The benefit is that it allows driver code to access 1192789ddb9SSimon Glass the platform data directly in C structures, avoidin the libfdt 1202789ddb9SSimon Glass overhead. 1212789ddb9SSimon Glass 1222789ddb9SSimon Glass This option works by generating C structure declarations for each 1232789ddb9SSimon Glass compatible string, then adding platform data and U_BOOT_DEVICE 1242789ddb9SSimon Glass declarations for each node. See README.platdata for more 1252789ddb9SSimon Glass information. 1262789ddb9SSimon Glass 127783e6a72SMasahiro Yamadaendmenu 128