xref: /openbmc/u-boot/dts/Kconfig (revision 36dd5f1b8abcd0aa5f8490b3ef1e4e7ecce2eb8c)
1783e6a72SMasahiro Yamada#
2783e6a72SMasahiro Yamada# Device Tree Control
3783e6a72SMasahiro Yamada#
4783e6a72SMasahiro Yamada
5783e6a72SMasahiro Yamadaconfig SUPPORT_OF_CONTROL
6783e6a72SMasahiro Yamada	bool
7783e6a72SMasahiro Yamada
8*36dd5f1bSTom Riniconfig DTC
9*36dd5f1bSTom Rini	bool
10*36dd5f1bSTom Rini
11783e6a72SMasahiro Yamadamenu "Device Tree Control"
12783e6a72SMasahiro Yamada	depends on SUPPORT_OF_CONTROL
13783e6a72SMasahiro Yamada
14783e6a72SMasahiro Yamadaconfig OF_CONTROL
15783e6a72SMasahiro Yamada	bool "Run-time configuration via Device Tree"
16*36dd5f1bSTom Rini	select DTC
17783e6a72SMasahiro Yamada	help
18783e6a72SMasahiro Yamada	  This feature provides for run-time configuration of U-Boot
19783e6a72SMasahiro Yamada	  via a flattened device tree.
20783e6a72SMasahiro Yamada
212a792753Smario.six@gdsys.ccconfig OF_BOARD_FIXUP
222a792753Smario.six@gdsys.cc	bool "Board-specific manipulation of Device Tree"
232a792753Smario.six@gdsys.cc	help
242a792753Smario.six@gdsys.cc	  In certain circumstances it is necessary to be able to modify
252a792753Smario.six@gdsys.cc	  U-Boot's device tree (e.g. to delete device from it). This option
262a792753Smario.six@gdsys.cc	  make the Device Tree writeable and provides a board-specific
272a792753Smario.six@gdsys.cc	  "board_fix_fdt" callback (called during pre-relocation time), which
282a792753Smario.six@gdsys.cc	  enables the board initialization to modifiy the Device Tree. The
292a792753Smario.six@gdsys.cc	  modified copy is subsequently used by U-Boot after relocation.
302a792753Smario.six@gdsys.cc
31dffb86e4SMasahiro Yamadaconfig SPL_OF_CONTROL
32dffb86e4SMasahiro Yamada	bool "Enable run-time configuration via Device Tree in SPL"
33dffb86e4SMasahiro Yamada	depends on SPL && OF_CONTROL
342860f03bSSimon Glass	help
352860f03bSSimon Glass	  Some boards use device tree in U-Boot but only have 4KB of SRAM
362860f03bSSimon Glass	  which is not enough to support device tree. Enable this option to
372860f03bSSimon Glass	  allow such boards to be supported by U-Boot SPL.
382860f03bSSimon Glass
39f291ce12SPhilipp Tomsichconfig TPL_OF_CONTROL
40f291ce12SPhilipp Tomsich	bool "Enable run-time configuration via Device Tree in TPL"
41f291ce12SPhilipp Tomsich	depends on TPL && OF_CONTROL
42f291ce12SPhilipp Tomsich	help
43f291ce12SPhilipp Tomsich	  Some boards use device tree in U-Boot but only have 4KB of SRAM
44f291ce12SPhilipp Tomsich	  which is not enough to support device tree. Enable this option to
45f291ce12SPhilipp Tomsich	  allow such boards to be supported by U-Boot TPL.
46f291ce12SPhilipp Tomsich
475e060d8bSSimon Glassconfig OF_LIVE
485e060d8bSSimon Glass	bool "Enable use of a live tree"
495e060d8bSSimon Glass	depends on OF_CONTROL
505e060d8bSSimon Glass	help
515e060d8bSSimon Glass	  Normally U-Boot uses a flat device tree which saves space and
525e060d8bSSimon Glass	  avoids the need to unpack the tree before use. However a flat
535e060d8bSSimon Glass	  tree does not support modifcation from within U-Boot since it
545e060d8bSSimon Glass	  can invalidate driver-model device tree offsets. This option
555e060d8bSSimon Glass	  enables a live tree which is available after relocation,
565e060d8bSSimon Glass	  and can be adjusted as needed.
575e060d8bSSimon Glass
58783e6a72SMasahiro Yamadachoice
59783e6a72SMasahiro Yamada	prompt "Provider of DTB for DT control"
60783e6a72SMasahiro Yamada	depends on OF_CONTROL
61783e6a72SMasahiro Yamada
62783e6a72SMasahiro Yamadaconfig OF_SEPARATE
63783e6a72SMasahiro Yamada	bool "Separate DTB for DT control"
64783e6a72SMasahiro Yamada	depends on !SANDBOX
65783e6a72SMasahiro Yamada	help
66783e6a72SMasahiro Yamada	  If this option is enabled, the device tree will be built and
67783e6a72SMasahiro Yamada	  placed as a separate u-boot.dtb file alongside the U-Boot image.
68783e6a72SMasahiro Yamada
69783e6a72SMasahiro Yamadaconfig OF_EMBED
70783e6a72SMasahiro Yamada	bool "Embedded DTB for DT control"
71783e6a72SMasahiro Yamada	help
72783e6a72SMasahiro Yamada	  If this option is enabled, the device tree will be picked up and
733d3f60cbSSimon Glass	  built into the U-Boot image. This is suitable for local debugging
743d3f60cbSSimon Glass	  and development only and is not recommended for production devices.
753d3f60cbSSimon Glass	  Boards in the mainline U-Boot tree should not use it.
76783e6a72SMasahiro Yamada
7782f766d1SAlex Deymoconfig OF_BOARD
7882f766d1SAlex Deymo	bool "Provided by the board at runtime"
7982f766d1SAlex Deymo	depends on !SANDBOX
8082f766d1SAlex Deymo	help
8182f766d1SAlex Deymo	  If this option is enabled, the device tree will be provided by
8282f766d1SAlex Deymo	  the board at runtime if the board supports it, instead of being
8382f766d1SAlex Deymo	  bundled with the image.
8482f766d1SAlex Deymo
85783e6a72SMasahiro Yamadaconfig OF_HOSTFILE
86783e6a72SMasahiro Yamada	bool "Host filed DTB for DT control"
87783e6a72SMasahiro Yamada	depends on SANDBOX
88783e6a72SMasahiro Yamada	help
89783e6a72SMasahiro Yamada	  If this option is enabled, DTB will be read from a file on startup.
90783e6a72SMasahiro Yamada	  This is only useful for Sandbox.  Use the -d flag to U-Boot to
91783e6a72SMasahiro Yamada	  specify the file to read.
92783e6a72SMasahiro Yamada
93783e6a72SMasahiro Yamadaendchoice
94783e6a72SMasahiro Yamada
95f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE
96f1ef2b62SMasahiro Yamada	string "Default Device Tree for DT control"
9770d41093SSimon Glass	depends on OF_CONTROL
98f1ef2b62SMasahiro Yamada	help
99f1ef2b62SMasahiro Yamada	  This option specifies the default Device Tree used for DT control.
1005699ea6dSRobert P. J. Day	  It can be overridden from the command line:
101f1ef2b62SMasahiro Yamada	  $ make DEVICE_TREE=<device-tree-name>
102f1ef2b62SMasahiro Yamada
103cdf17246SSimon Glassconfig OF_LIST
104cdf17246SSimon Glass	string "List of device tree files to include for DT control"
105d9797409SCooper Jr., Franklin	depends on SPL_LOAD_FIT || FIT_EMBED
106c409bd01SMichal Simek	default DEFAULT_DEVICE_TREE
107cdf17246SSimon Glass	help
108cdf17246SSimon Glass	  This option specifies a list of device tree files to use for DT
109d9797409SCooper Jr., Franklin	  control. These will be packaged into a FIT. At run-time, U-boot
110d9797409SCooper Jr., Franklin	  or SPL will select the correct DT to use by examining the
111d9797409SCooper Jr., Franklin	  hardware (e.g. reading a board ID value). This is a list of
112d9797409SCooper Jr., Franklin	  device tree files (without the directory or .dtb suffix)
113d9797409SCooper Jr., Franklin	  separated by <space>.
114cdf17246SSimon Glass
115fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS
116fa78e0a3SSimon Glass	string "List of device tree properties to drop for SPL"
117897705ecSMasahiro Yamada	depends on SPL_OF_CONTROL
118239ae4a9SVikas Manocha	default "interrupt-parent" if SPL_PINCTRL && SPL_CLK
119239ae4a9SVikas Manocha	default "clocks clock-names interrupt-parent" if SPL_PINCTRL
1205f3f7b79SMasahiro Yamada	default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK
121fa78e0a3SSimon Glass	default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent"
122fa78e0a3SSimon Glass	help
123fa78e0a3SSimon Glass	  Since SPL normally runs in a reduced memory space, the device tree
124fa78e0a3SSimon Glass	  is cut down to only what is needed to load and start U-Boot. Only
125fa78e0a3SSimon Glass	  nodes marked with the property "u-boot,dm-pre-reloc" will be
126fa78e0a3SSimon Glass	  included. In addition, some properties are not used by U-Boot and
127fa78e0a3SSimon Glass	  can be discarded. This option defines the list of properties to
128fa78e0a3SSimon Glass	  discard.
129fa78e0a3SSimon Glass
1302789ddb9SSimon Glassconfig SPL_OF_PLATDATA
1312789ddb9SSimon Glass	bool "Generate platform data for use in SPL"
1322789ddb9SSimon Glass	depends on SPL_OF_CONTROL
1332789ddb9SSimon Glass	help
1342789ddb9SSimon Glass	  For very constrained SPL environments the overhead of decoding
1352789ddb9SSimon Glass	  device tree nodes and converting their contents into platform data
1362789ddb9SSimon Glass	  is too large. This overhead includes libfdt code as well as the
1372789ddb9SSimon Glass	  device tree contents itself. The latter is fairly compact, but the
1382789ddb9SSimon Glass	  former can add 3KB or more to a Thumb 2 Image.
1392789ddb9SSimon Glass
1402789ddb9SSimon Glass	  This option enables generation of platform data from the device
1412789ddb9SSimon Glass	  tree as C code. This code creates devices using U_BOOT_DEVICE()
1422789ddb9SSimon Glass	  declarations. The benefit is that it allows driver code to access
1432789ddb9SSimon Glass	  the platform data directly in C structures, avoidin the libfdt
1442789ddb9SSimon Glass	  overhead.
1452789ddb9SSimon Glass
1462789ddb9SSimon Glass	  This option works by generating C structure declarations for each
1472789ddb9SSimon Glass	  compatible string, then adding platform data and U_BOOT_DEVICE
1482789ddb9SSimon Glass	  declarations for each node. See README.platdata for more
1492789ddb9SSimon Glass	  information.
1502789ddb9SSimon Glass
151f291ce12SPhilipp Tomsichconfig TPL_OF_PLATDATA
152f291ce12SPhilipp Tomsich	bool "Generate platform data for use in TPL"
153f291ce12SPhilipp Tomsich	depends on TPL_OF_CONTROL
154f291ce12SPhilipp Tomsich	help
155f291ce12SPhilipp Tomsich	  For very constrained SPL environments the overhead of decoding
156f291ce12SPhilipp Tomsich	  device tree nodes and converting their contents into platform data
157f291ce12SPhilipp Tomsich	  is too large. This overhead includes libfdt code as well as the
158f291ce12SPhilipp Tomsich	  device tree contents itself. The latter is fairly compact, but the
159f291ce12SPhilipp Tomsich	  former can add 3KB or more to a Thumb 2 Image.
160f291ce12SPhilipp Tomsich
161f291ce12SPhilipp Tomsich	  This option enables generation of platform data from the device
162f291ce12SPhilipp Tomsich	  tree as C code. This code creates devices using U_BOOT_DEVICE()
163f291ce12SPhilipp Tomsich	  declarations. The benefit is that it allows driver code to access
164f291ce12SPhilipp Tomsich	  the platform data directly in C structures, avoidin the libfdt
165f291ce12SPhilipp Tomsich	  overhead.
166f291ce12SPhilipp Tomsich
167f291ce12SPhilipp Tomsich	  This option works by generating C structure declarations for each
168f291ce12SPhilipp Tomsich	  compatible string, then adding platform data and U_BOOT_DEVICE
169f291ce12SPhilipp Tomsich	  declarations for each node. See README.platdata for more
170f291ce12SPhilipp Tomsich	  information.
171f291ce12SPhilipp Tomsich
172783e6a72SMasahiro Yamadaendmenu
173