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