xref: /rk3399_rockchip-uboot/dts/Kconfig (revision f36ea2f6e17621c4d9dd97c4dbfab62d03d061df)
1783e6a72SMasahiro Yamada#
2783e6a72SMasahiro Yamada# Device Tree Control
3783e6a72SMasahiro Yamada#
4783e6a72SMasahiro Yamada
5783e6a72SMasahiro Yamadaconfig SUPPORT_OF_CONTROL
6783e6a72SMasahiro Yamada	bool
7783e6a72SMasahiro Yamada
85821df21STom Riniconfig DTC
95821df21STom Rini	bool
105821df21STom Rini
11ec821af4SMasahiro Yamadaconfig PYLIBFDT
12ec821af4SMasahiro Yamada	bool
13ec821af4SMasahiro Yamada
14ec821af4SMasahiro Yamadaconfig DTOC
15ec821af4SMasahiro Yamada	bool
16ec821af4SMasahiro Yamada	select PYLIBFDT
17ec821af4SMasahiro Yamada
18ec821af4SMasahiro Yamadaconfig BINMAN
19ec821af4SMasahiro Yamada	bool
20ec821af4SMasahiro Yamada	select DTOC
21ec821af4SMasahiro Yamada
22783e6a72SMasahiro Yamadamenu "Device Tree Control"
23783e6a72SMasahiro Yamada	depends on SUPPORT_OF_CONTROL
24783e6a72SMasahiro Yamada
25783e6a72SMasahiro Yamadaconfig OF_CONTROL
26783e6a72SMasahiro Yamada	bool "Run-time configuration via Device Tree"
275821df21STom Rini	select DTC
28783e6a72SMasahiro Yamada	help
29783e6a72SMasahiro Yamada	  This feature provides for run-time configuration of U-Boot
30783e6a72SMasahiro Yamada	  via a flattened device tree.
31783e6a72SMasahiro Yamada
322a792753Smario.six@gdsys.ccconfig OF_BOARD_FIXUP
332a792753Smario.six@gdsys.cc	bool "Board-specific manipulation of Device Tree"
342a792753Smario.six@gdsys.cc	help
352a792753Smario.six@gdsys.cc	  In certain circumstances it is necessary to be able to modify
362a792753Smario.six@gdsys.cc	  U-Boot's device tree (e.g. to delete device from it). This option
372a792753Smario.six@gdsys.cc	  make the Device Tree writeable and provides a board-specific
382a792753Smario.six@gdsys.cc	  "board_fix_fdt" callback (called during pre-relocation time), which
392a792753Smario.six@gdsys.cc	  enables the board initialization to modifiy the Device Tree. The
402a792753Smario.six@gdsys.cc	  modified copy is subsequently used by U-Boot after relocation.
412a792753Smario.six@gdsys.cc
42dffb86e4SMasahiro Yamadaconfig SPL_OF_CONTROL
43dffb86e4SMasahiro Yamada	bool "Enable run-time configuration via Device Tree in SPL"
44dffb86e4SMasahiro Yamada	depends on SPL && OF_CONTROL
452860f03bSSimon Glass	help
462860f03bSSimon Glass	  Some boards use device tree in U-Boot but only have 4KB of SRAM
472860f03bSSimon Glass	  which is not enough to support device tree. Enable this option to
482860f03bSSimon Glass	  allow such boards to be supported by U-Boot SPL.
492860f03bSSimon Glass
504447bf16SJoseph Chenconfig SPL_DTB_MINIMUM
514447bf16SJoseph Chen	bool "Provide a minimum SPL DTB "
524447bf16SJoseph Chen	depends on SPL_OF_CONTROL
534447bf16SJoseph Chen	default n
544447bf16SJoseph Chen	help
554447bf16SJoseph Chen	  Some boards need a SPL DTB as smaller as possible to save dm scan
564447bf16SJoseph Chen	  time and space. It provides a SPL DTB only include the node with
574447bf16SJoseph Chen	  property "u-boot,dm-spl". The property "u-boot,pre-reloc" doesn't
584447bf16SJoseph Chen	  work any more.
594447bf16SJoseph Chen
60f291ce12SPhilipp Tomsichconfig TPL_OF_CONTROL
61f291ce12SPhilipp Tomsich	bool "Enable run-time configuration via Device Tree in TPL"
62f291ce12SPhilipp Tomsich	depends on TPL && OF_CONTROL
63f291ce12SPhilipp Tomsich	help
64f291ce12SPhilipp Tomsich	  Some boards use device tree in U-Boot but only have 4KB of SRAM
65f291ce12SPhilipp Tomsich	  which is not enough to support device tree. Enable this option to
66f291ce12SPhilipp Tomsich	  allow such boards to be supported by U-Boot TPL.
67f291ce12SPhilipp Tomsich
685e060d8bSSimon Glassconfig OF_LIVE
695e060d8bSSimon Glass	bool "Enable use of a live tree"
705e060d8bSSimon Glass	depends on OF_CONTROL
715e060d8bSSimon Glass	help
725e060d8bSSimon Glass	  Normally U-Boot uses a flat device tree which saves space and
735e060d8bSSimon Glass	  avoids the need to unpack the tree before use. However a flat
745e060d8bSSimon Glass	  tree does not support modifcation from within U-Boot since it
755e060d8bSSimon Glass	  can invalidate driver-model device tree offsets. This option
765e060d8bSSimon Glass	  enables a live tree which is available after relocation,
775e060d8bSSimon Glass	  and can be adjusted as needed.
785e060d8bSSimon Glass
79783e6a72SMasahiro Yamadachoice
80783e6a72SMasahiro Yamada	prompt "Provider of DTB for DT control"
81783e6a72SMasahiro Yamada	depends on OF_CONTROL
82783e6a72SMasahiro Yamada
83783e6a72SMasahiro Yamadaconfig OF_SEPARATE
84783e6a72SMasahiro Yamada	bool "Separate DTB for DT control"
85783e6a72SMasahiro Yamada	depends on !SANDBOX
86783e6a72SMasahiro Yamada	help
87783e6a72SMasahiro Yamada	  If this option is enabled, the device tree will be built and
88783e6a72SMasahiro Yamada	  placed as a separate u-boot.dtb file alongside the U-Boot image.
89783e6a72SMasahiro Yamada
90783e6a72SMasahiro Yamadaconfig OF_EMBED
91783e6a72SMasahiro Yamada	bool "Embedded DTB for DT control"
92783e6a72SMasahiro Yamada	help
93783e6a72SMasahiro Yamada	  If this option is enabled, the device tree will be picked up and
943d3f60cbSSimon Glass	  built into the U-Boot image. This is suitable for local debugging
953d3f60cbSSimon Glass	  and development only and is not recommended for production devices.
963d3f60cbSSimon Glass	  Boards in the mainline U-Boot tree should not use it.
97783e6a72SMasahiro Yamada
9882f766d1SAlex Deymoconfig OF_BOARD
9982f766d1SAlex Deymo	bool "Provided by the board at runtime"
10082f766d1SAlex Deymo	depends on !SANDBOX
10182f766d1SAlex Deymo	help
10282f766d1SAlex Deymo	  If this option is enabled, the device tree will be provided by
10382f766d1SAlex Deymo	  the board at runtime if the board supports it, instead of being
10482f766d1SAlex Deymo	  bundled with the image.
10582f766d1SAlex Deymo
106783e6a72SMasahiro Yamadaconfig OF_HOSTFILE
107783e6a72SMasahiro Yamada	bool "Host filed DTB for DT control"
108783e6a72SMasahiro Yamada	depends on SANDBOX
109783e6a72SMasahiro Yamada	help
110783e6a72SMasahiro Yamada	  If this option is enabled, DTB will be read from a file on startup.
111783e6a72SMasahiro Yamada	  This is only useful for Sandbox.  Use the -d flag to U-Boot to
112783e6a72SMasahiro Yamada	  specify the file to read.
113783e6a72SMasahiro Yamada
114*f36ea2f6SThomas Fitzsimmonsconfig OF_PRIOR_STAGE
115*f36ea2f6SThomas Fitzsimmons	bool "Prior stage bootloader DTB for DT control"
116*f36ea2f6SThomas Fitzsimmons	help
117*f36ea2f6SThomas Fitzsimmons	  If this option is enabled, the device tree used for DT
118*f36ea2f6SThomas Fitzsimmons	  control will be read from a device tree binary, at a memory
119*f36ea2f6SThomas Fitzsimmons	  location passed to U-Boot by the prior stage bootloader.
120*f36ea2f6SThomas Fitzsimmons
121783e6a72SMasahiro Yamadaendchoice
122783e6a72SMasahiro Yamada
123f1ef2b62SMasahiro Yamadaconfig DEFAULT_DEVICE_TREE
124f1ef2b62SMasahiro Yamada	string "Default Device Tree for DT control"
12570d41093SSimon Glass	depends on OF_CONTROL
126f1ef2b62SMasahiro Yamada	help
127f1ef2b62SMasahiro Yamada	  This option specifies the default Device Tree used for DT control.
1285699ea6dSRobert P. J. Day	  It can be overridden from the command line:
129f1ef2b62SMasahiro Yamada	  $ make DEVICE_TREE=<device-tree-name>
130f1ef2b62SMasahiro Yamada
131cdf17246SSimon Glassconfig OF_LIST
132cdf17246SSimon Glass	string "List of device tree files to include for DT control"
1332bbcffb1SJean-Jacques Hiblot	depends on SPL_LOAD_FIT || MULTI_DTB_FIT
134c409bd01SMichal Simek	default DEFAULT_DEVICE_TREE
135cdf17246SSimon Glass	help
136cdf17246SSimon Glass	  This option specifies a list of device tree files to use for DT
137d9797409SCooper Jr., Franklin	  control. These will be packaged into a FIT. At run-time, U-boot
138d9797409SCooper Jr., Franklin	  or SPL will select the correct DT to use by examining the
139d9797409SCooper Jr., Franklin	  hardware (e.g. reading a board ID value). This is a list of
140d9797409SCooper Jr., Franklin	  device tree files (without the directory or .dtb suffix)
141d9797409SCooper Jr., Franklin	  separated by <space>.
142cdf17246SSimon Glass
1432bbcffb1SJean-Jacques Hiblot
1442bbcffb1SJean-Jacques Hiblotconfig DTB_RESELECT
1452bbcffb1SJean-Jacques Hiblot	bool "Support swapping dtbs at a later point in boot"
1462bbcffb1SJean-Jacques Hiblot	depends on MULTI_DTB_FIT
1472bbcffb1SJean-Jacques Hiblot	help
1482bbcffb1SJean-Jacques Hiblot	  It is possible during initial boot you may need to use a generic
1492bbcffb1SJean-Jacques Hiblot	  dtb until you can fully determine the board your running on. This
1502bbcffb1SJean-Jacques Hiblot	  config allows boards to implement a function at a later point
1512bbcffb1SJean-Jacques Hiblot	  during boot to switch to the "correct" dtb.
1522bbcffb1SJean-Jacques Hiblot
1532bbcffb1SJean-Jacques Hiblotconfig MULTI_DTB_FIT
1542bbcffb1SJean-Jacques Hiblot	bool "Support embedding several DTBs in a FIT image for u-boot"
1552bbcffb1SJean-Jacques Hiblot	help
1562bbcffb1SJean-Jacques Hiblot	  This option provides hooks to allow U-boot to parse an
1572bbcffb1SJean-Jacques Hiblot	  appended FIT image and enable board specific code to then select
1582bbcffb1SJean-Jacques Hiblot	  the correct DTB to be used. Use this if you need to support
1592bbcffb1SJean-Jacques Hiblot	  multiple DTBs but don't use the SPL.
1602bbcffb1SJean-Jacques Hiblot
161476f6045SJean-Jacques Hiblot
162476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT
163476f6045SJean-Jacques Hiblot	depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA
164476f6045SJean-Jacques Hiblot	bool "Support embedding several DTBs in a FIT image for the SPL"
165476f6045SJean-Jacques Hiblot	help
166476f6045SJean-Jacques Hiblot	  This option provides the SPL with the ability to select its own
167476f6045SJean-Jacques Hiblot	  DTB at runtime from an appended FIT image containing several DTBs.
168476f6045SJean-Jacques Hiblot	  This allows using the same SPL binary on multiple platforms.
169476f6045SJean-Jacques Hiblot	  The primary purpose is to handle different versions of
170476f6045SJean-Jacques Hiblot	  the same platform without tweaking the platform code if the
171476f6045SJean-Jacques Hiblot	  differences can be expressed in the DTBs (common examples are: bus
172476f6045SJean-Jacques Hiblot	  capabilities, pad configurations).
173476f6045SJean-Jacques Hiblot
174476f6045SJean-Jacques Hiblotconfig SPL_OF_LIST
175476f6045SJean-Jacques Hiblot	string "List of device tree files to include for DT control in SPL"
176476f6045SJean-Jacques Hiblot	depends on SPL_MULTI_DTB_FIT
177476f6045SJean-Jacques Hiblot	default OF_LIST
178476f6045SJean-Jacques Hiblot	help
179476f6045SJean-Jacques Hiblot	  This option specifies a list of device tree files to use for DT
180476f6045SJean-Jacques Hiblot	  control in the SPL. These will be packaged into a FIT. At run-time,
181476f6045SJean-Jacques Hiblot	  the SPL will select the correct DT to use by examining the
182476f6045SJean-Jacques Hiblot	  hardware (e.g. reading a board ID value). This is a list of
183476f6045SJean-Jacques Hiblot	  device tree files (without the directory or .dtb suffix)
184476f6045SJean-Jacques Hiblot	  separated by <space>.
185476f6045SJean-Jacques Hiblot
186476f6045SJean-Jacques Hiblotchoice
187476f6045SJean-Jacques Hiblot	prompt "SPL OF LIST compression"
188476f6045SJean-Jacques Hiblot	depends on SPL_MULTI_DTB_FIT
189476f6045SJean-Jacques Hiblot	default SPL_MULTI_DTB_FIT_LZO
190476f6045SJean-Jacques Hiblot
191476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_LZO
192476f6045SJean-Jacques Hiblot	bool "LZO"
193476f6045SJean-Jacques Hiblot	depends on SYS_MALLOC_F
194476f6045SJean-Jacques Hiblot	select SPL_LZO
195476f6045SJean-Jacques Hiblot	help
196476f6045SJean-Jacques Hiblot	  Compress the FIT image containing the DTBs available for the SPL
197476f6045SJean-Jacques Hiblot	  using LZO compression. (requires lzop on host).
198476f6045SJean-Jacques Hiblot
199476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_GZIP
200476f6045SJean-Jacques Hiblot	bool "GZIP"
201476f6045SJean-Jacques Hiblot	depends on SYS_MALLOC_F
202476f6045SJean-Jacques Hiblot	select SPL_GZIP
203476f6045SJean-Jacques Hiblot	help
204476f6045SJean-Jacques Hiblot	  Compress the FIT image containing the DTBs available for the SPL
205476f6045SJean-Jacques Hiblot	  using GZIP compression. (requires gzip on host)
206476f6045SJean-Jacques Hiblot
207476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_NO_COMPRESSION
208476f6045SJean-Jacques Hiblot	bool "No compression"
209476f6045SJean-Jacques Hiblot	help
210476f6045SJean-Jacques Hiblot	  Do not compress the FIT image containing the DTBs available for the SPL.
211476f6045SJean-Jacques Hiblot	  Use this options only if LZO is not available and the DTBs are very small.
212476f6045SJean-Jacques Hiblotendchoice
213476f6045SJean-Jacques Hiblot
214476f6045SJean-Jacques Hiblotchoice
215476f6045SJean-Jacques Hiblot	prompt "Location of uncompressed DTBs "
216476f6045SJean-Jacques Hiblot	depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
217476f6045SJean-Jacques Hiblot	default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
218476f6045SJean-Jacques Hiblot
219476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_DYN_ALLOC
220476f6045SJean-Jacques Hiblot	bool "Dynamically allocate the memory"
221476f6045SJean-Jacques Hiblot	depends on SYS_MALLOC_F
222476f6045SJean-Jacques Hiblot
223476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
224476f6045SJean-Jacques Hiblot	bool "User-defined location"
225476f6045SJean-Jacques Hiblotendchoice
226476f6045SJean-Jacques Hiblot
227476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
228476f6045SJean-Jacques Hiblot	hex "Size of memory reserved to uncompress the DTBs"
229476f6045SJean-Jacques Hiblot	depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
230476f6045SJean-Jacques Hiblot	default 0x8000
231476f6045SJean-Jacques Hiblot	help
232476f6045SJean-Jacques Hiblot	   This is the size of this area where the DTBs are uncompressed.
233476f6045SJean-Jacques Hiblot	   If this area is dynamically allocated, make sure that
234476f6045SJean-Jacques Hiblot	   SPL_SYS_MALLOC_F_LEN is big enough to contain it.
235476f6045SJean-Jacques Hiblot
236476f6045SJean-Jacques Hiblotconfig SPL_MULTI_DTB_FIT_USER_DEF_ADDR
237476f6045SJean-Jacques Hiblot	hex "Address of memory where dtbs are uncompressed"
238476f6045SJean-Jacques Hiblot	depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
239476f6045SJean-Jacques Hiblot	help
240476f6045SJean-Jacques Hiblot	   the FIT image containing the DTBs is uncompressed in an area defined
241476f6045SJean-Jacques Hiblot	   at compilation time. This is the address of this area. It must be
242476f6045SJean-Jacques Hiblot	   aligned on 2-byte boundary.
243476f6045SJean-Jacques Hiblot
244fa78e0a3SSimon Glassconfig OF_SPL_REMOVE_PROPS
245fa78e0a3SSimon Glass	string "List of device tree properties to drop for SPL"
246239ae4a9SVikas Manocha	default "interrupt-parent" if SPL_PINCTRL && SPL_CLK
247239ae4a9SVikas Manocha	default "clocks clock-names interrupt-parent" if SPL_PINCTRL
2485f3f7b79SMasahiro Yamada	default "pinctrl-0 pinctrl-names interrupt-parent" if SPL_CLK
249fa78e0a3SSimon Glass	default "pinctrl-0 pinctrl-names clocks clock-names interrupt-parent"
250fa78e0a3SSimon Glass	help
251fa78e0a3SSimon Glass	  Since SPL normally runs in a reduced memory space, the device tree
252fa78e0a3SSimon Glass	  is cut down to only what is needed to load and start U-Boot. Only
253fa78e0a3SSimon Glass	  nodes marked with the property "u-boot,dm-pre-reloc" will be
254fa78e0a3SSimon Glass	  included. In addition, some properties are not used by U-Boot and
255fa78e0a3SSimon Glass	  can be discarded. This option defines the list of properties to
256fa78e0a3SSimon Glass	  discard.
257fa78e0a3SSimon Glass
258c48a3a80SJoseph Chenconfig OF_U_BOOT_REMOVE_PROPS
259c48a3a80SJoseph Chen	string "List of device tree properties to drop for U-Boot"
260c48a3a80SJoseph Chen	depends on USING_KERNEL_DTB
261c48a3a80SJoseph Chen	default ""
262c48a3a80SJoseph Chen	help
263c48a3a80SJoseph Chen	  Since kernel dtb feature is enabled, U-Boot prop use the same device tree as SPL.
264c48a3a80SJoseph Chen	  At sometimes there is different require for list of device tree properties to drop
265c48a3a80SJoseph Chen	  for U-Boot prop, so providing this configure which has higher priority, that if it
266c48a3a80SJoseph Chen	  is defined empty string, fallback to use OF_SPL_REMOVE_PROPS.
267c48a3a80SJoseph Chen
2682789ddb9SSimon Glassconfig SPL_OF_PLATDATA
2692789ddb9SSimon Glass	bool "Generate platform data for use in SPL"
2702789ddb9SSimon Glass	depends on SPL_OF_CONTROL
271ec821af4SMasahiro Yamada	select DTOC
2722789ddb9SSimon Glass	help
2732789ddb9SSimon Glass	  For very constrained SPL environments the overhead of decoding
2742789ddb9SSimon Glass	  device tree nodes and converting their contents into platform data
2752789ddb9SSimon Glass	  is too large. This overhead includes libfdt code as well as the
2762789ddb9SSimon Glass	  device tree contents itself. The latter is fairly compact, but the
2772789ddb9SSimon Glass	  former can add 3KB or more to a Thumb 2 Image.
2782789ddb9SSimon Glass
2792789ddb9SSimon Glass	  This option enables generation of platform data from the device
2802789ddb9SSimon Glass	  tree as C code. This code creates devices using U_BOOT_DEVICE()
2812789ddb9SSimon Glass	  declarations. The benefit is that it allows driver code to access
2822789ddb9SSimon Glass	  the platform data directly in C structures, avoidin the libfdt
2832789ddb9SSimon Glass	  overhead.
2842789ddb9SSimon Glass
2852789ddb9SSimon Glass	  This option works by generating C structure declarations for each
2862789ddb9SSimon Glass	  compatible string, then adding platform data and U_BOOT_DEVICE
2872789ddb9SSimon Glass	  declarations for each node. See README.platdata for more
2882789ddb9SSimon Glass	  information.
2892789ddb9SSimon Glass
290f291ce12SPhilipp Tomsichconfig TPL_OF_PLATDATA
291f291ce12SPhilipp Tomsich	bool "Generate platform data for use in TPL"
292f291ce12SPhilipp Tomsich	depends on TPL_OF_CONTROL
293ec821af4SMasahiro Yamada	select DTOC
294f291ce12SPhilipp Tomsich	help
295f291ce12SPhilipp Tomsich	  For very constrained SPL environments the overhead of decoding
296f291ce12SPhilipp Tomsich	  device tree nodes and converting their contents into platform data
297f291ce12SPhilipp Tomsich	  is too large. This overhead includes libfdt code as well as the
298f291ce12SPhilipp Tomsich	  device tree contents itself. The latter is fairly compact, but the
299f291ce12SPhilipp Tomsich	  former can add 3KB or more to a Thumb 2 Image.
300f291ce12SPhilipp Tomsich
301f291ce12SPhilipp Tomsich	  This option enables generation of platform data from the device
302f291ce12SPhilipp Tomsich	  tree as C code. This code creates devices using U_BOOT_DEVICE()
303f291ce12SPhilipp Tomsich	  declarations. The benefit is that it allows driver code to access
304f291ce12SPhilipp Tomsich	  the platform data directly in C structures, avoidin the libfdt
305f291ce12SPhilipp Tomsich	  overhead.
306f291ce12SPhilipp Tomsich
307f291ce12SPhilipp Tomsich	  This option works by generating C structure declarations for each
308f291ce12SPhilipp Tomsich	  compatible string, then adding platform data and U_BOOT_DEVICE
309f291ce12SPhilipp Tomsich	  declarations for each node. See README.platdata for more
310f291ce12SPhilipp Tomsich	  information.
311f291ce12SPhilipp Tomsich
312783e6a72SMasahiro Yamadaendmenu
313f8470aeeSTom Rini
314f8470aeeSTom Riniconfig MKIMAGE_DTC_PATH
315f8470aeeSTom Rini	string "Path to dtc binary for use within mkimage"
316f8470aeeSTom Rini	default "dtc"
317f8470aeeSTom Rini	help
318f8470aeeSTom Rini	  The mkimage host tool will, in order to generate FIT images make
319f8470aeeSTom Rini	  calls to the dtc application in order to create the output.  In
320f8470aeeSTom Rini	  some cases the system dtc may not support all required features
321f8470aeeSTom Rini	  and the path to a different version should be given here.
322