xref: /rk3399_rockchip-uboot/dts/Kconfig (revision d97974099b6ecae1cfc655a1a59ee985f7d59dde)
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
355e060d8bSSimon Glassconfig OF_LIVE
365e060d8bSSimon Glass	bool "Enable use of a live tree"
375e060d8bSSimon Glass	depends on OF_CONTROL
385e060d8bSSimon Glass	help
395e060d8bSSimon Glass	  Normally U-Boot uses a flat device tree which saves space and
405e060d8bSSimon Glass	  avoids the need to unpack the tree before use. However a flat
415e060d8bSSimon Glass	  tree does not support modifcation from within U-Boot since it
425e060d8bSSimon Glass	  can invalidate driver-model device tree offsets. This option
435e060d8bSSimon Glass	  enables a live tree which is available after relocation,
445e060d8bSSimon Glass	  and can be adjusted as needed.
455e060d8bSSimon Glass
46783e6a72SMasahiro Yamadachoice
47783e6a72SMasahiro Yamada	prompt "Provider of DTB for DT control"
48783e6a72SMasahiro Yamada	depends on OF_CONTROL
49783e6a72SMasahiro Yamada
50783e6a72SMasahiro Yamadaconfig OF_SEPARATE
51783e6a72SMasahiro Yamada	bool "Separate DTB for DT control"
52783e6a72SMasahiro Yamada	depends on !SANDBOX
53783e6a72SMasahiro Yamada	help
54783e6a72SMasahiro Yamada	  If this option is enabled, the device tree will be built and
55783e6a72SMasahiro Yamada	  placed as a separate u-boot.dtb file alongside the U-Boot image.
56783e6a72SMasahiro Yamada
57783e6a72SMasahiro Yamadaconfig OF_EMBED
58783e6a72SMasahiro Yamada	bool "Embedded DTB for DT control"
59783e6a72SMasahiro Yamada	help
60783e6a72SMasahiro Yamada	  If this option is enabled, the device tree will be picked up and
613d3f60cbSSimon Glass	  built into the U-Boot image. This is suitable for local debugging
623d3f60cbSSimon Glass	  and development only and is not recommended for production devices.
633d3f60cbSSimon Glass	  Boards in the mainline U-Boot tree should not use it.
64783e6a72SMasahiro Yamada
6582f766d1SAlex Deymoconfig OF_BOARD
6682f766d1SAlex Deymo	bool "Provided by the board at runtime"
6782f766d1SAlex Deymo	depends on !SANDBOX
6882f766d1SAlex Deymo	help
6982f766d1SAlex Deymo	  If this option is enabled, the device tree will be provided by
7082f766d1SAlex Deymo	  the board at runtime if the board supports it, instead of being
7182f766d1SAlex Deymo	  bundled with the image.
7282f766d1SAlex Deymo
73783e6a72SMasahiro Yamadaconfig OF_HOSTFILE
74783e6a72SMasahiro Yamada	bool "Host filed DTB for DT control"
75783e6a72SMasahiro Yamada	depends on SANDBOX
76783e6a72SMasahiro Yamada	help
77783e6a72SMasahiro Yamada	  If this option is enabled, DTB will be read from a file on startup.
78783e6a72SMasahiro Yamada	  This is only useful for Sandbox.  Use the -d flag to U-Boot to
79783e6a72SMasahiro Yamada	  specify the file to read.
80783e6a72SMasahiro Yamada
81783e6a72SMasahiro Yamadaendchoice
82783e6a72SMasahiro Yamada
83f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE
84f1ef2b62SMasahiro Yamada	string "Default Device Tree for DT control"
8570d41093SSimon Glass	depends on OF_CONTROL
86f1ef2b62SMasahiro Yamada	help
87f1ef2b62SMasahiro Yamada	  This option specifies the default Device Tree used for DT control.
885699ea6dSRobert P. J. Day	  It can be overridden from the command line:
89f1ef2b62SMasahiro Yamada	  $ make DEVICE_TREE=<device-tree-name>
90f1ef2b62SMasahiro Yamada
91cdf17246SSimon Glassconfig OF_LIST
92cdf17246SSimon Glass	string "List of device tree files to include for DT control"
93*d9797409SCooper Jr., Franklin	depends on SPL_LOAD_FIT || FIT_EMBED
94c409bd01SMichal Simek	default DEFAULT_DEVICE_TREE
95cdf17246SSimon Glass	help
96cdf17246SSimon Glass	  This option specifies a list of device tree files to use for DT
97*d9797409SCooper Jr., Franklin	  control. These will be packaged into a FIT. At run-time, U-boot
98*d9797409SCooper Jr., Franklin	  or SPL will select the correct DT to use by examining the
99*d9797409SCooper Jr., Franklin	  hardware (e.g. reading a board ID value). This is a list of
100*d9797409SCooper Jr., Franklin	  device tree files (without the directory or .dtb suffix)
101*d9797409SCooper Jr., Franklin	  separated by <space>.
102cdf17246SSimon Glass
103fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS
104fa78e0a3SSimon Glass	string "List of device tree properties to drop for SPL"
105897705ecSMasahiro Yamada	depends on SPL_OF_CONTROL
106239ae4a9SVikas Manocha	default "interrupt-parent" if SPL_PINCTRL && SPL_CLK
107239ae4a9SVikas Manocha	default "clocks clock-names interrupt-parent" if SPL_PINCTRL
1085f3f7b79SMasahiro Yamada	default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK
109fa78e0a3SSimon Glass	default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent"
110fa78e0a3SSimon Glass	help
111fa78e0a3SSimon Glass	  Since SPL normally runs in a reduced memory space, the device tree
112fa78e0a3SSimon Glass	  is cut down to only what is needed to load and start U-Boot. Only
113fa78e0a3SSimon Glass	  nodes marked with the property "u-boot,dm-pre-reloc" will be
114fa78e0a3SSimon Glass	  included. In addition, some properties are not used by U-Boot and
115fa78e0a3SSimon Glass	  can be discarded. This option defines the list of properties to
116fa78e0a3SSimon Glass	  discard.
117fa78e0a3SSimon Glass
1182789ddb9SSimon Glassconfig SPL_OF_PLATDATA
1192789ddb9SSimon Glass	bool "Generate platform data for use in SPL"
1202789ddb9SSimon Glass	depends on SPL_OF_CONTROL
1212789ddb9SSimon Glass	help
1222789ddb9SSimon Glass	  For very constrained SPL environments the overhead of decoding
1232789ddb9SSimon Glass	  device tree nodes and converting their contents into platform data
1242789ddb9SSimon Glass	  is too large. This overhead includes libfdt code as well as the
1252789ddb9SSimon Glass	  device tree contents itself. The latter is fairly compact, but the
1262789ddb9SSimon Glass	  former can add 3KB or more to a Thumb 2 Image.
1272789ddb9SSimon Glass
1282789ddb9SSimon Glass	  This option enables generation of platform data from the device
1292789ddb9SSimon Glass	  tree as C code. This code creates devices using U_BOOT_DEVICE()
1302789ddb9SSimon Glass	  declarations. The benefit is that it allows driver code to access
1312789ddb9SSimon Glass	  the platform data directly in C structures, avoidin the libfdt
1322789ddb9SSimon Glass	  overhead.
1332789ddb9SSimon Glass
1342789ddb9SSimon Glass	  This option works by generating C structure declarations for each
1352789ddb9SSimon Glass	  compatible string, then adding platform data and U_BOOT_DEVICE
1362789ddb9SSimon Glass	  declarations for each node. See README.platdata for more
1372789ddb9SSimon Glass	  information.
1382789ddb9SSimon Glass
139783e6a72SMasahiro Yamadaendmenu
140