xref: /openbmc/u-boot/dts/Kconfig (revision 6e87ae1c)
1#
2# Device Tree Control
3#
4
5config SUPPORT_OF_CONTROL
6	bool
7
8menu "Device Tree Control"
9	depends on SUPPORT_OF_CONTROL
10
11config OF_CONTROL
12	bool "Run-time configuration via Device Tree"
13	help
14	  This feature provides for run-time configuration of U-Boot
15	  via a flattened device tree.
16
17config OF_BOARD_FIXUP
18	bool "Board-specific manipulation of Device Tree"
19	help
20	  In certain circumstances it is necessary to be able to modify
21	  U-Boot's device tree (e.g. to delete device from it). This option
22	  make the Device Tree writeable and provides a board-specific
23	  "board_fix_fdt" callback (called during pre-relocation time), which
24	  enables the board initialization to modifiy the Device Tree. The
25	  modified copy is subsequently used by U-Boot after relocation.
26
27config SPL_OF_CONTROL
28	bool "Enable run-time configuration via Device Tree in SPL"
29	depends on SPL && OF_CONTROL
30	help
31	  Some boards use device tree in U-Boot but only have 4KB of SRAM
32	  which is not enough to support device tree. Enable this option to
33	  allow such boards to be supported by U-Boot SPL.
34
35config OF_LIVE
36	bool "Enable use of a live tree"
37	depends on OF_CONTROL
38	help
39	  Normally U-Boot uses a flat device tree which saves space and
40	  avoids the need to unpack the tree before use. However a flat
41	  tree does not support modifcation from within U-Boot since it
42	  can invalidate driver-model device tree offsets. This option
43	  enables a live tree which is available after relocation,
44	  and can be adjusted as needed.
45
46choice
47	prompt "Provider of DTB for DT control"
48	depends on OF_CONTROL
49
50config OF_SEPARATE
51	bool "Separate DTB for DT control"
52	depends on !SANDBOX
53	help
54	  If this option is enabled, the device tree will be built and
55	  placed as a separate u-boot.dtb file alongside the U-Boot image.
56
57config OF_EMBED
58	bool "Embedded DTB for DT control"
59	help
60	  If this option is enabled, the device tree will be picked up and
61	  built into the U-Boot image. This is suitable for local debugging
62	  and development only and is not recommended for production devices.
63	  Boards in the mainline U-Boot tree should not use it.
64
65config OF_BOARD
66	bool "Provided by the board at runtime"
67	depends on !SANDBOX
68	help
69	  If this option is enabled, the device tree will be provided by
70	  the board at runtime if the board supports it, instead of being
71	  bundled with the image.
72
73config OF_HOSTFILE
74	bool "Host filed DTB for DT control"
75	depends on SANDBOX
76	help
77	  If this option is enabled, DTB will be read from a file on startup.
78	  This is only useful for Sandbox.  Use the -d flag to U-Boot to
79	  specify the file to read.
80
81endchoice
82
83config DEFAULT_DEVICE_TREE
84	string "Default Device Tree for DT control"
85	depends on OF_CONTROL
86	help
87	  This option specifies the default Device Tree used for DT control.
88	  It can be overridden from the command line:
89	  $ make DEVICE_TREE=<device-tree-name>
90
91config OF_LIST
92	string "List of device tree files to include for DT control"
93	depends on SPL_LOAD_FIT
94	default DEFAULT_DEVICE_TREE
95	help
96	  This option specifies a list of device tree files to use for DT
97	  control. These will be packaged into a FIT. At run-time, SPL will
98	  select the correct DT to use by examining the hardware (e.g.
99	  reading a board ID value). This is a list of device tree files
100	  (without the directory or .dtb suffix) separated by <space>.
101
102config OF_SPL_REMOVE_PROPS
103	string "List of device tree properties to drop for SPL"
104	depends on SPL_OF_CONTROL
105	default "interrupt-parent" if SPL_PINCTRL && SPL_CLK
106	default "clocks clock-names interrupt-parent" if SPL_PINCTRL
107	default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK
108	default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent"
109	help
110	  Since SPL normally runs in a reduced memory space, the device tree
111	  is cut down to only what is needed to load and start U-Boot. Only
112	  nodes marked with the property "u-boot,dm-pre-reloc" will be
113	  included. In addition, some properties are not used by U-Boot and
114	  can be discarded. This option defines the list of properties to
115	  discard.
116
117config SPL_OF_PLATDATA
118	bool "Generate platform data for use in SPL"
119	depends on SPL_OF_CONTROL
120	help
121	  For very constrained SPL environments the overhead of decoding
122	  device tree nodes and converting their contents into platform data
123	  is too large. This overhead includes libfdt code as well as the
124	  device tree contents itself. The latter is fairly compact, but the
125	  former can add 3KB or more to a Thumb 2 Image.
126
127	  This option enables generation of platform data from the device
128	  tree as C code. This code creates devices using U_BOOT_DEVICE()
129	  declarations. The benefit is that it allows driver code to access
130	  the platform data directly in C structures, avoidin the libfdt
131	  overhead.
132
133	  This option works by generating C structure declarations for each
134	  compatible string, then adding platform data and U_BOOT_DEVICE
135	  declarations for each node. See README.platdata for more
136	  information.
137
138endmenu
139