xref: /rk3399_rockchip-uboot/dts/Kconfig (revision 94fbbf0f6db608f9349f507ed0734ea9befc8ec3)
1#
2# Device Tree Control
3#
4
5config SUPPORT_OF_CONTROL
6	bool
7
8config DTC
9	bool
10
11config PYLIBFDT
12	bool
13
14config DTOC
15	bool
16	select PYLIBFDT
17
18config BINMAN
19	bool
20	select DTOC
21
22menu "Device Tree Control"
23	depends on SUPPORT_OF_CONTROL
24
25config OF_CONTROL
26	bool "Run-time configuration via Device Tree"
27	select DTC
28	help
29	  This feature provides for run-time configuration of U-Boot
30	  via a flattened device tree.
31
32config OF_BOARD_FIXUP
33	bool "Board-specific manipulation of Device Tree"
34	help
35	  In certain circumstances it is necessary to be able to modify
36	  U-Boot's device tree (e.g. to delete device from it). This option
37	  make the Device Tree writeable and provides a board-specific
38	  "board_fix_fdt" callback (called during pre-relocation time), which
39	  enables the board initialization to modifiy the Device Tree. The
40	  modified copy is subsequently used by U-Boot after relocation.
41
42config SPL_OF_CONTROL
43	bool "Enable run-time configuration via Device Tree in SPL"
44	depends on SPL && OF_CONTROL
45	help
46	  Some boards use device tree in U-Boot but only have 4KB of SRAM
47	  which is not enough to support device tree. Enable this option to
48	  allow such boards to be supported by U-Boot SPL.
49
50config SPL_DTB_MINIMUM
51	bool "Provide a minimum SPL DTB "
52	depends on SPL_OF_CONTROL
53	default n
54	help
55	  Some boards need a SPL DTB as smaller as possible to save dm scan
56	  time and space. It provides a SPL DTB only include the node with
57	  property "u-boot,dm-spl". The property "u-boot,pre-reloc" doesn't
58	  work any more.
59
60config TPL_OF_CONTROL
61	bool "Enable run-time configuration via Device Tree in TPL"
62	depends on TPL && OF_CONTROL
63	help
64	  Some boards use device tree in U-Boot but only have 4KB of SRAM
65	  which is not enough to support device tree. Enable this option to
66	  allow such boards to be supported by U-Boot TPL.
67
68config OF_LIVE
69	bool "Enable use of a live tree"
70	depends on OF_CONTROL
71	help
72	  Normally U-Boot uses a flat device tree which saves space and
73	  avoids the need to unpack the tree before use. However a flat
74	  tree does not support modifcation from within U-Boot since it
75	  can invalidate driver-model device tree offsets. This option
76	  enables a live tree which is available after relocation,
77	  and can be adjusted as needed.
78
79choice
80	prompt "Provider of DTB for DT control"
81	depends on OF_CONTROL
82
83config OF_SEPARATE
84	bool "Separate DTB for DT control"
85	depends on !SANDBOX
86	help
87	  If this option is enabled, the device tree will be built and
88	  placed as a separate u-boot.dtb file alongside the U-Boot image.
89
90config OF_EMBED
91	bool "Embedded DTB for DT control"
92	help
93	  If this option is enabled, the device tree will be picked up and
94	  built into the U-Boot image. This is suitable for local debugging
95	  and development only and is not recommended for production devices.
96	  Boards in the mainline U-Boot tree should not use it.
97
98config OF_BOARD
99	bool "Provided by the board at runtime"
100	depends on !SANDBOX
101	help
102	  If this option is enabled, the device tree will be provided by
103	  the board at runtime if the board supports it, instead of being
104	  bundled with the image.
105
106config OF_HOSTFILE
107	bool "Host filed DTB for DT control"
108	depends on SANDBOX
109	help
110	  If this option is enabled, DTB will be read from a file on startup.
111	  This is only useful for Sandbox.  Use the -d flag to U-Boot to
112	  specify the file to read.
113
114endchoice
115
116config DEFAULT_DEVICE_TREE
117	string "Default Device Tree for DT control"
118	depends on OF_CONTROL
119	help
120	  This option specifies the default Device Tree used for DT control.
121	  It can be overridden from the command line:
122	  $ make DEVICE_TREE=<device-tree-name>
123
124config OF_LIST
125	string "List of device tree files to include for DT control"
126	depends on SPL_LOAD_FIT || MULTI_DTB_FIT
127	default DEFAULT_DEVICE_TREE
128	help
129	  This option specifies a list of device tree files to use for DT
130	  control. These will be packaged into a FIT. At run-time, U-boot
131	  or SPL will select the correct DT to use by examining the
132	  hardware (e.g. reading a board ID value). This is a list of
133	  device tree files (without the directory or .dtb suffix)
134	  separated by <space>.
135
136
137config DTB_RESELECT
138	bool "Support swapping dtbs at a later point in boot"
139	depends on MULTI_DTB_FIT
140	help
141	  It is possible during initial boot you may need to use a generic
142	  dtb until you can fully determine the board your running on. This
143	  config allows boards to implement a function at a later point
144	  during boot to switch to the "correct" dtb.
145
146config MULTI_DTB_FIT
147	bool "Support embedding several DTBs in a FIT image for u-boot"
148	help
149	  This option provides hooks to allow U-boot to parse an
150	  appended FIT image and enable board specific code to then select
151	  the correct DTB to be used. Use this if you need to support
152	  multiple DTBs but don't use the SPL.
153
154
155config SPL_MULTI_DTB_FIT
156	depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA
157	bool "Support embedding several DTBs in a FIT image for the SPL"
158	help
159	  This option provides the SPL with the ability to select its own
160	  DTB at runtime from an appended FIT image containing several DTBs.
161	  This allows using the same SPL binary on multiple platforms.
162	  The primary purpose is to handle different versions of
163	  the same platform without tweaking the platform code if the
164	  differences can be expressed in the DTBs (common examples are: bus
165	  capabilities, pad configurations).
166
167config SPL_OF_LIST
168	string "List of device tree files to include for DT control in SPL"
169	depends on SPL_MULTI_DTB_FIT
170	default OF_LIST
171	help
172	  This option specifies a list of device tree files to use for DT
173	  control in the SPL. These will be packaged into a FIT. At run-time,
174	  the SPL will select the correct DT to use by examining the
175	  hardware (e.g. reading a board ID value). This is a list of
176	  device tree files (without the directory or .dtb suffix)
177	  separated by <space>.
178
179choice
180	prompt "SPL OF LIST compression"
181	depends on SPL_MULTI_DTB_FIT
182	default SPL_MULTI_DTB_FIT_LZO
183
184config SPL_MULTI_DTB_FIT_LZO
185	bool "LZO"
186	depends on SYS_MALLOC_F
187	select SPL_LZO
188	help
189	  Compress the FIT image containing the DTBs available for the SPL
190	  using LZO compression. (requires lzop on host).
191
192config SPL_MULTI_DTB_FIT_GZIP
193	bool "GZIP"
194	depends on SYS_MALLOC_F
195	select SPL_GZIP
196	help
197	  Compress the FIT image containing the DTBs available for the SPL
198	  using GZIP compression. (requires gzip on host)
199
200config SPL_MULTI_DTB_FIT_NO_COMPRESSION
201	bool "No compression"
202	help
203	  Do not compress the FIT image containing the DTBs available for the SPL.
204	  Use this options only if LZO is not available and the DTBs are very small.
205endchoice
206
207choice
208	prompt "Location of uncompressed DTBs "
209	depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
210	default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
211
212config SPL_MULTI_DTB_FIT_DYN_ALLOC
213	bool "Dynamically allocate the memory"
214	depends on SYS_MALLOC_F
215
216config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
217	bool "User-defined location"
218endchoice
219
220config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
221	hex "Size of memory reserved to uncompress the DTBs"
222	depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
223	default 0x8000
224	help
225	   This is the size of this area where the DTBs are uncompressed.
226	   If this area is dynamically allocated, make sure that
227	   SPL_SYS_MALLOC_F_LEN is big enough to contain it.
228
229config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
230	hex "Address of memory where dtbs are uncompressed"
231	depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
232	help
233	   the FIT image containing the DTBs is uncompressed in an area defined
234	   at compilation time. This is the address of this area. It must be
235	   aligned on 2-byte boundary.
236
237config OF_SPL_REMOVE_PROPS
238	string "List of device tree properties to drop for SPL"
239	default "interrupt-parent" if SPL_PINCTRL && SPL_CLK
240	default "clocks clock-names interrupt-parent" if SPL_PINCTRL
241	default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK
242	default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent"
243	help
244	  Since SPL normally runs in a reduced memory space, the device tree
245	  is cut down to only what is needed to load and start U-Boot. Only
246	  nodes marked with the property "u-boot,dm-pre-reloc" will be
247	  included. In addition, some properties are not used by U-Boot and
248	  can be discarded. This option defines the list of properties to
249	  discard.
250
251config SPL_OF_PLATDATA
252	bool "Generate platform data for use in SPL"
253	depends on SPL_OF_CONTROL
254	select DTOC
255	help
256	  For very constrained SPL environments the overhead of decoding
257	  device tree nodes and converting their contents into platform data
258	  is too large. This overhead includes libfdt code as well as the
259	  device tree contents itself. The latter is fairly compact, but the
260	  former can add 3KB or more to a Thumb 2 Image.
261
262	  This option enables generation of platform data from the device
263	  tree as C code. This code creates devices using U_BOOT_DEVICE()
264	  declarations. The benefit is that it allows driver code to access
265	  the platform data directly in C structures, avoidin the libfdt
266	  overhead.
267
268	  This option works by generating C structure declarations for each
269	  compatible string, then adding platform data and U_BOOT_DEVICE
270	  declarations for each node. See README.platdata for more
271	  information.
272
273config TPL_OF_PLATDATA
274	bool "Generate platform data for use in TPL"
275	depends on TPL_OF_CONTROL
276	select DTOC
277	help
278	  For very constrained SPL environments the overhead of decoding
279	  device tree nodes and converting their contents into platform data
280	  is too large. This overhead includes libfdt code as well as the
281	  device tree contents itself. The latter is fairly compact, but the
282	  former can add 3KB or more to a Thumb 2 Image.
283
284	  This option enables generation of platform data from the device
285	  tree as C code. This code creates devices using U_BOOT_DEVICE()
286	  declarations. The benefit is that it allows driver code to access
287	  the platform data directly in C structures, avoidin the libfdt
288	  overhead.
289
290	  This option works by generating C structure declarations for each
291	  compatible string, then adding platform data and U_BOOT_DEVICE
292	  declarations for each node. See README.platdata for more
293	  information.
294
295endmenu
296
297config MKIMAGE_DTC_PATH
298	string "Path to dtc binary for use within mkimage"
299	default "dtc"
300	help
301	  The mkimage host tool will, in order to generate FIT images make
302	  calls to the dtc application in order to create the output.  In
303	  some cases the system dtc may not support all required features
304	  and the path to a different version should be given here.
305