1config SUPPORT_SPL
2	bool
3
4config SUPPORT_TPL
5	bool
6
7config SUPPORT_VPL
8	bool
9
10config SPL_DFU_NO_RESET
11	bool
12
13config SPL
14	bool "Enable SPL"
15	depends on SUPPORT_SPL
16	help
17	  If you want to build SPL as well as the normal image, say Y.
18
19menu "SPL configuration options"
20	depends on SPL
21
22config SPL_FRAMEWORK
23	bool "Support SPL based upon the common SPL framework"
24	default y
25	help
26	  Enable the SPL framework under common/spl/.  This framework
27	  supports MMC, NAND and YMODEM and other methods loading of U-Boot
28	  and the Linux Kernel.  If unsure, say Y.
29
30config SPL_FRAMEWORK_BOARD_INIT_F
31	bool "Define a generic function board_init_f"
32	depends on SPL_FRAMEWORK
33	help
34	  Define a generic function board_init_f that:
35	  - initialize the spl (spl_early_init)
36	  - initialize the serial (preloader_console_init)
37	  Unless you want to provide your own board_init_f, you should say Y.
38
39config SPL_SIZE_LIMIT
40	hex "Maximum size of SPL image"
41	default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
42	default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
43	default 0x30000 if ARCH_MVEBU && ARMADA_32BIT
44	default 0x0
45	help
46	  Specifies the maximum length of the U-Boot SPL image.
47	  If this value is zero, it is ignored.
48
49config SPL_SIZE_LIMIT_SUBTRACT_GD
50	bool "SPL image size check: provide space for global data"
51	depends on SPL_SIZE_LIMIT > 0
52	help
53	  If enabled, aligned size of global data is reserved in
54	  SPL_SIZE_LIMIT check to ensure such an image does not overflow SRAM
55	  if SPL_SIZE_LIMIT describes the size of SRAM available for SPL when
56	  pre-reloc global data is put into this SRAM, too.
57
58config SPL_SIZE_LIMIT_SUBTRACT_MALLOC
59	bool "SPL image size check: provide space for malloc() pool before relocation"
60	depends on SPL_SIZE_LIMIT > 0
61	help
62	  If enabled, SPL_SYS_MALLOC_F_LEN is reserved in SPL_SIZE_LIMIT check
63	  to ensure such an image does not overflow SRAM if SPL_SIZE_LIMIT
64	  describes the size of SRAM available for SPL when pre-reloc malloc
65	  pool is put into this SRAM, too.
66
67config SPL_SIZE_LIMIT_PROVIDE_STACK
68	hex "SPL image size check: provide stack space before relocation"
69	depends on SPL_SIZE_LIMIT > 0
70	default 0x0
71	help
72	  If set, this size is reserved in SPL_SIZE_LIMIT check to ensure such
73	  an image does not overflow SRAM if SPL_SIZE_LIMIT describes the size
74	  of SRAM available for SPL when the stack required before reolcation
75	  uses this SRAM, too.
76
77config SPL_MAX_SIZE
78	hex "Maximum size of the SPL image, excluding BSS"
79	default 0x30000 if ARCH_MX6 && MX6_OCRAM_256KB
80	default 0x1b000 if AM33XX && !TI_SECURE_DEVICE
81	default 0xec00 if OMAP34XX
82	default 0x10000 if ARCH_MX6 && !MX6_OCRAM_256KB
83	default 0xbfa0 if MACH_SUN50I_H616 || MACH_SUN50I_A133 || MACH_SUN55I_A523
84	default 0x7000 if RCAR_GEN3
85	default 0x5fa0 if SUNXI_SRAM_ADDRESS = 0x0
86	default 0x7fa0 if ARCH_SUNXI
87	default 0x10000 if ASPEED_AST2600
88	default 0x27000 if IMX8MM && SPL_TEXT_BASE = 0x7E1000
89	default 0x30000 if ARCH_SC5XX && (SC59X_64 || SC59X)
90	default 0x20000 if ARCH_SC5XX && (SC58X || SC57X)
91	default 0x0
92	help
93	  Maximum size of the SPL image (text, data, rodata, and linker lists
94	  sections), BSS excluded.  When defined, the linker checks that the
95	  actual size does not exceed it.
96
97config SPL_PAD_TO
98	hex "Offset to which the SPL should be padded before appending the SPL payload"
99	default 0x7f8000 if ARCH_ROCKCHIP
100	default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
101	default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB)
102	default 0x10000 if ARCH_KEYSTONE
103	default 0x0 if ARCH_MTMIPS || ARCH_SUNXI
104	default TPL_MAX_SIZE if TPL_MAX_SIZE > SPL_MAX_SIZE
105	default SPL_MAX_SIZE
106	help
107	  Image offset to which the SPL should be padded before appending the
108	  SPL payload. By default, this is defined as CONFIG_SPL_MAX_SIZE, or 0 if
109	  CONFIG_SPL_MAX_SIZE is undefined.  CONFIG_SPL_PAD_TO must be either
110	  0, meaning to append the SPL payload without any padding, or >=
111	  CONFIG_SPL_MAX_SIZE.
112
113config SPL_HAS_BSS_LINKER_SECTION
114	depends on SPL_FRAMEWORK
115	bool "Use a specific address for the BSS via the linker script"
116	default y if ARCH_SUNXI || ARCH_MX6 || ARCH_OMAP2PLUS || MIPS || RISCV || ARCH_ZYNQMP || ARCH_SC5XX
117
118config SPL_BSS_START_ADDR
119	hex "Link address for the BSS within the SPL binary"
120	depends on SPL_HAS_BSS_LINKER_SECTION
121	default 0x88200000 if (ARCH_MX6 && (MX6SX || MX6SL || MX6UL || MX6ULL)) || ARCH_MX7
122	default 0x18200000 if ARCH_MX6 && !(MX6SX || MX6SL || MX6UL || MX6ULL)
123	default 0x80a00000 if ARCH_OMAP2PLUS
124	default 0x81f80000 if ARCH_SUNXI && MACH_SUNIV
125	default 0x4ff80000 if ARCH_SUNXI && !(MACH_SUN9I || MACH_SUNIV)
126	default 0x2ff80000 if ARCH_SUNXI && MACH_SUN9I
127	default 0x1000 if ARCH_ZYNQMP
128	default 0x200B0000 if ARCH_SC5XX && (SC59X_64 || SC59X)
129	default 0x20080000 if ARCH_SC5XX && SC58X
130	default 0x200A0000 if ARCH_SC5XX && SC57X
131
132choice
133	prompt "Enforce SPL BSS limit"
134	depends on !PPC
135	default SPL_NO_BSS_LIMIT if COMPILE_TEST
136	default SPL_BSS_LIMIT
137	help
138	  In some platforms we only want to enforce a limit on the size of the
139	  BSS in memory.  On other platforms we need to enforce a limit on the
140	  whole of the memory allocation as we're strictly limited to a small
141	  typically non-DRAM location.  Finally, other platforms do not enforce
142	  a memory limit within SPL.
143
144config SPL_NO_BSS_LIMIT
145	bool "Do not enforce a build time limit on the size of the BSS"
146
147config SPL_BSS_LIMIT
148	bool "Enforce a limit on the size of the BSS only"
149
150config SPL_FOOTPRINT_LIMIT
151	bool "Enforce a limit on the whole of memory allocated to SPL, BSS included"
152
153endchoice
154
155config SPL_BSS_MAX_SIZE
156	hex "Maximum size in memory allocated to the SPL BSS"
157	depends on SPL_BSS_LIMIT
158	default 0x100000 if ARCH_MX6 || RISCV
159	default 0x80000 if ARCH_OMAP2PLUS || ARCH_SUNXI
160	default 0x10000 if ARCH_SC5XX
161	help
162	  When non-zero, the linker checks that the actual memory used by SPL
163	  from __bss_start to __bss_end does not exceed it.
164
165config SPL_MAX_FOOTPRINT
166	hex "Maximum size in memory allocated to the SPL, BSS included"
167	depends on SPL_FOOTPRINT_LIMIT
168	help
169	  When non-zero, the linker checks that the actual memory used by SPL
170	  from _start to __bss_end does not exceed it.
171
172config SPL_SYS_STACK_F_CHECK_BYTE
173	hex
174	default 0xaa
175	help
176	  Constant used to check the stack
177
178config SPL_SYS_REPORT_STACK_F_USAGE
179	depends on SPL_SIZE_LIMIT_PROVIDE_STACK != 0
180	bool "Check and report stack usage in SPL before relocation"
181	help
182	  If this option is enabled, the initial SPL stack is filled with 0xaa
183	  very early, up to the size configured with
184	  SPL_SIZE_LIMIT_PROVIDE_STACK.
185	  Later when SPL is done using this initial stack and switches to a
186	  stack in DRAM, the actually used size of this initial stack is
187	  reported by examining the memory and searching for the lowest
188	  occurrence of non 0xaa bytes.
189	  This default implementation works for stacks growing down only.
190
191config SPL_SHOW_ERRORS
192	bool "Show more information when something goes wrong"
193	depends on SPL_LIBCOMMON_SUPPORT
194	help
195	  This enabled more verbose error messages and checking when something
196	  goes wrong in SPL. For example, it shows the error code when U-Boot
197	  cannot be located. This can help to diagnose the problem and figure
198	  out a fix, particularly during development.
199
200	  This adds a small amount to SPL code size, perhaps 100 bytes.
201
202config SPL_BINMAN_SYMBOLS
203	bool "Declare binman symbols in SPL"
204	depends on SPL_FRAMEWORK && BINMAN
205	default y
206	help
207	  This enables use of symbols in SPL which refer to other entries in
208	  the same binman image as the SPL. These can be declared with the
209	  binman_sym_declare(type, entry, prop) macro and accessed by the
210	  binman_sym(type, entry, prop) macro defined in binman_sym.h.
211
212	  See tools/binman/binman.rst for a detailed explanation.
213
214config SPL_BINMAN_UBOOT_SYMBOLS
215	bool "Declare binman symbols for U-Boot phases in SPL"
216	depends on SPL_BINMAN_SYMBOLS
217	default n if ARCH_IMX8M || ARCH_IMX8ULP || ARCH_IMX9
218	default y
219	help
220	  This enables use of symbols in SPL which refer to U-Boot phases,
221	  enabling SPL to obtain the location and size of its next phase simply
222	  by calling spl_get_image_pos() and spl_get_image_size().
223
224	  For this to work, you must have all U-Boot phases in the same binman
225	  image, so binman can update SPL with the locations of everything.
226
227source "common/spl/Kconfig.nxp"
228
229config HANDOFF
230	bool "Pass hand-off information from SPL to U-Boot proper"
231	depends on BLOBLIST
232	help
233	  It is useful to be able to pass information from SPL to U-Boot
234	  proper to preserve state that is known in SPL and is needed in U-Boot.
235	  Enable this to locate the handoff information in U-Boot proper, early
236	  in boot. It is available in gd->handoff. The state state is set up
237	  in SPL (or TPL if that is being used).
238
239config SPL_HANDOFF
240	bool "Pass hand-off information from SPL to U-Boot proper"
241	depends on HANDOFF && SPL_BLOBLIST
242	default y
243	help
244	  This option enables SPL to write handoff information. This can be
245	  used to pass information like the size of SDRAM from SPL to U-Boot
246	  proper. Also SPL can receive information from TPL in the same place
247	  if that is enabled.
248
249config SPL_LDSCRIPT
250	string "Linker script for the SPL stage"
251	default "arch/arm/cpu/arm926ejs/sunxi/u-boot-spl.lds" if MACH_SUNIV
252	default "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds" if ARCH_SUNXI && !MACH_SUNIV && !ARM64
253	default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
254	default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
255	default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A || ARCH_LS1046A || ARCH_LS2080A
256	default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
257	default "arch/arm/mach-at91/arm926ejs/u-boot-spl.lds" if ARCH_AT91 && CPU_ARM926EJS
258	default "arch/arm/mach-at91/armv7/u-boot-spl.lds" if ARCH_AT91 && CPU_V7A
259	default "arch/arm/mach-omap2/u-boot-spl.lds" if ARCH_MX6 || ARCH_OMAP2PLUS || (ARCH_K3 && !ARM64)
260	default "arch/arm/mach-zynq/u-boot-spl.lds" if ARCH_ZYNQ
261	default "board/samsung/common/exynos-uboot-spl.lds" if ARCH_EXYNOS5 || ARCH_EXYNOS4
262	default "board/davinci/da8xxevm/u-boot-spl-da850evm.lds" if ARCH_DAVINCI
263	default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
264	help
265	  The SPL stage will usually require a different linker-script
266	  (as it runs from a different memory region) than the regular
267	  U-Boot stage.	 Set this to the path of the linker-script to
268	  be used for SPL.
269
270config SPL_TEXT_BASE
271	hex "SPL Text Base"
272	default 0x40200000 if OMAP34XX
273	default 0x402F4000 if AM43XX
274	default 0x402F0400 if AM33XX
275	default 0x80080000 if ARCH_K3 && ARM64
276	default 0x43c00000 if ARCH_K3 && !ARM64
277	default 0x00908000 if ARCH_MX6
278	default 0x00912000 if ARCH_MX7
279	default 0x40301350 if OMAP54XX
280	default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I
281	default 0x44060 if MACH_SUN55I_A523
282	default 0x20060 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2
283	default 0x00060 if ARCH_SUNXI
284	default 0xfffc0000 if ARCH_ZYNQMP
285	default 0x20080000 if ARCH_SC5XX
286	default 0x0
287	help
288	  The address in memory that SPL will be running from.
289
290config SPL_SOC_INIT
291	bool "Call SoC-specific initialization in SPL"
292	help
293	  If this option is enabled, U-Boot will call the function
294	  spl_soc_init() from board_init_r(). This function should be
295	  provided by the SoC vendor.
296
297config SPL_BOARD_INIT
298	bool "Call board-specific initialization in SPL"
299	help
300	  If this option is enabled, U-Boot will call the function
301	  spl_board_init() from board_init_r(). This function should be
302	  provided by the board.
303
304config SPL_LOAD_BLOCK
305	bool
306	help
307	  Support loading images from block devices. This adds a bl_len member
308	  to struct spl_load_info.
309
310config SPL_BOOTROM_SUPPORT
311	bool "Support returning to the BOOTROM"
312	select SPL_LOAD_BLOCK if MACH_IMX
313	help
314	  Some platforms (e.g. the Rockchip RK3368) provide support in their
315	  ROM for loading the next boot-stage after performing basic setup
316	  from the SPL stage.
317
318	  Enable this option, to return to the BOOTROM through the
319	  BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
320	  boot device list, if not implemented for a given board)
321
322config SPL_BOOTCOUNT_LIMIT
323	bool "Support bootcount in SPL"
324	depends on SPL_ENV_SUPPORT && !TPL_BOOTCOUNT_LIMIT
325	help
326	  On some boards, which use 'falcon' mode, it is necessary to check
327	  and increment the number of boot attempts. Such boards do not
328	  use proper U-Boot for normal boot flow and hence needs those
329	  adjustments to be done in the SPL.
330
331config SPL_RAW_IMAGE_SUPPORT
332	bool "Support SPL loading and booting of RAW images"
333	default n if ARCH_MVEBU
334	default n if (ARCH_MX6 && (SPL_MMC || SPL_SATA))
335	default y
336	depends on !TI_SECURE_DEVICE
337	help
338	  SPL will support loading and booting a RAW image when this option
339	  is y. If this is not set, SPL will move on to other available
340	  boot media to find a suitable image.
341
342config SPL_LEGACY_IMAGE_FORMAT
343	bool "Support SPL loading and booting of Legacy images"
344	default n if ARCH_MVEBU
345	default y if !SPL_LOAD_FIT
346	depends on !TI_SECURE_DEVICE
347	help
348	  SPL will support loading and booting Legacy images when this option
349	  is y. If this is not set, SPL will move on to other available
350	  boot media to find a suitable image.
351
352config SPL_LEGACY_IMAGE_CRC_CHECK
353	bool "Check CRC of Legacy images"
354	depends on SPL_LEGACY_IMAGE_FORMAT
355	select SPL_CRC32
356	help
357	  Enable this to check the CRC of Legacy images. While this increases
358	  reliability, it affects both code size and boot duration.
359	  If disabled, Legacy images are booted if the image magic and size
360	  are correct, without further integrity checks.
361
362config SPL_LOAD_IMX_CONTAINER
363	bool "Enable SPL loading and booting of i.MX8 Containers"
364	depends on SPL
365	help
366	  Support booting U-Boot from an i.MX8 container image. If you are not
367	  using i.MX8, say 'n'.
368
369config SPL_IMX_CONTAINER_USE_TRAMPOLINE
370	bool
371	depends on SPL
372	help
373	  Enable SPL load reader to load data to a trampoline buffer.
374
375config IMX_PQC_SUPPORT
376	bool "Enable to support i.MX ROM PQC Container"
377	depends on SPL && SPL_LOAD_IMX_CONTAINER
378	help
379	  Support i.MX ROM new PQC container format. If your chip does not use
380	  PQC container, say 'n'.
381
382config IMX_CONTAINER_CFG
383	string "i.MX8 Container config file"
384	depends on SPL && SPL_LOAD_IMX_CONTAINER
385	help
386	  Specify the cfg file for generating the container image which will be
387	  loaded by SPL.
388
389config SPL_SYS_MALLOC_SIMPLE
390	bool "Only use malloc_simple functions in the SPL"
391	help
392	  Say Y here to only use the *_simple malloc functions from
393	  malloc_simple.c, rather then using the versions from dlmalloc.c;
394	  this will make the SPL binary smaller at the cost of more heap
395	  usage as the *_simple malloc functions do not re-use free-ed mem.
396
397config SPL_SHARES_INIT_SP_ADDR
398	bool "SPL and U-Boot use the same initial stack pointer location"
399	depends on (ARM || ARCH_JZ47XX || MICROBLAZE || RISCV) && SPL_FRAMEWORK
400	default n if ARCH_SUNXI || ARCH_MX6 || ARCH_MX7 || ARCH_SC5XX
401	default y
402	help
403	  In many cases, we can use the same initial stack pointer address for
404	  both SPL and U-Boot itself.  If you need to specify a different address
405	  however, say N here and then set a different value in CONFIG_SPL_STACK.
406
407config SPL_HAVE_INIT_STACK
408	bool "SPL requires a initial, fixed, stack-pointer location"
409	depends on (ARM || ARCH_JZ47XX || MICROBLAZE || RISCV) && \
410		SPL_FRAMEWORK || ROCKCHIP_RK3036
411	depends on !SPL_SHARES_INIT_SP_ADDR
412	default y if ARCH_MX7
413	default y if ARCH_MX6 && MX6_OCRAM_256KB
414	default y if ARCH_MX6 && !MX6_OCRAM_256KB
415	default y if MACH_SUN50I_H6 || MACH_SUN50I_H616 || MACH_SUN8I_R528
416	default y if MACH_SUN50I || MACH_SUN50I_H5
417	default y if MACH_SUN9I
418	default y if ARCH_SUNXI
419	default y if ARCH_SC5XX && (SC59X_64 || SC59X)
420	default y if ARCH_SC5XX && SC58X
421	default y if ARCH_SC5XX && SC57X
422	help
423	  Enable if the SPL phase should not use inherit its initial
424	  stack-pointer from the settings for U-Boot proper, but should set
425	  its own value.
426
427config SPL_STACK
428	hex "Address of the initial stack-pointer for the SPL phase"
429	depends on SPL_HAVE_INIT_STACK
430	default 0x946bb8 if ARCH_MX7
431	default 0x93ffb8 if ARCH_MX6 && MX6_OCRAM_256KB
432	default 0x91ffb8 if ARCH_MX6 && !MX6_OCRAM_256KB
433	default 0x118000 if MACH_SUN50I_H6
434	default 0x52a00 if MACH_SUN50I_H616
435	default 0x40000 if MACH_SUN8I_R528 || MACH_SUN50I_A133
436	default 0x44000 if MACH_SUN55I_A523
437	default 0x54000 if MACH_SUN50I || MACH_SUN50I_H5
438	default 0x18000 if MACH_SUN9I
439	default 0x8000 if ARCH_SUNXI
440	default 0x200e4000 if ARCH_SC5XX && (SC59X_64 || SC59X)
441	default 0x200b0000 if ARCH_SC5XX && SC58X
442	default 0x200d0000 if ARCH_SC5XX && SC57X
443	help
444	  Address of the start of the stack SPL will use before SDRAM is
445	  initialized.
446
447config SPL_STACK_R
448	bool "Enable SDRAM location for SPL stack"
449	help
450	  SPL starts off execution in SRAM and thus typically has only a small
451	  stack available. Since SPL sets up DRAM while in its board_init_f()
452	  function, it is possible for the stack to move there before
453	  board_init_r() is reached. This option enables a special SDRAM
454	  location for the SPL stack. U-Boot SPL switches to this after
455	  board_init_f() completes, and before board_init_r() starts.
456
457config SPL_STACK_R_ADDR
458	depends on SPL_STACK_R
459	hex "SDRAM location for SPL stack"
460	default 0x82000000 if ARCH_OMAP2PLUS
461	help
462	  Specify the address in SDRAM for the SPL stack. This will be set up
463	  before board_init_r() is called.
464
465config SPL_STACK_R_MALLOC_SIMPLE_LEN
466	depends on SPL_STACK_R && SPL_SYS_MALLOC_SIMPLE
467	hex "Size of malloc_simple heap after switching to DRAM SPL stack"
468	default 0x400000 if ARCH_K3 && ARM64
469	default 0x200000 if ARCH_K3 && CPU_V7R
470	default 0x100000
471	help
472	  Specify the amount of the stack to use as memory pool for
473	  malloc_simple after switching the stack to DRAM. This may be set
474	  to give board_init_r() a larger heap then the initial heap in
475	  SRAM which is limited to SYS_MALLOC_F_LEN bytes.
476
477config SPL_SEPARATE_BSS
478	bool "BSS section is in a different memory region from text"
479	help
480	  Some platforms need a large BSS region in SPL and can provide this
481	  because RAM is already set up. In this case BSS can be moved to RAM.
482	  This option should then be enabled so that the correct device tree
483	  location is used. Normally we put the device tree at the end of BSS
484	  but with this option enabled, it goes at _image_binary_end.
485
486config SPL_SYS_MALLOC
487	bool "Enable malloc pool in SPL"
488	depends on SPL_FRAMEWORK
489
490config SPL_HAS_CUSTOM_MALLOC_START
491	bool "For the SPL malloc pool, define a custom starting address"
492	depends on SPL_SYS_MALLOC
493
494config SPL_CUSTOM_SYS_MALLOC_ADDR
495	hex "SPL malloc addr"
496	depends on SPL_HAS_CUSTOM_MALLOC_START
497
498config SPL_SYS_MALLOC_SIZE
499	hex "Size of the SPL malloc pool"
500	depends on SPL_SYS_MALLOC
501	default 0x800000 if RISCV
502	default 0x100000
503
504config SPL_READ_ONLY
505	bool
506	depends on SPL_OF_PLATDATA
507	# Bind cannot be supported because the udevice structs are in read-only
508	# memory so we cannot update the linked lists.
509	select SPL_OF_PLATDATA_NO_BIND
510	select SPL_OF_PLATDATA_RT
511	help
512	  Some platforms (e.g. x86 Apollo Lake) load SPL into a read-only
513	  section of memory. This means that of-platdata must make a copy (in
514	  writeable memory) of anything it wants to modify, such as
515	  device-private data.
516
517config SPL_BANNER_PRINT
518	bool "Enable output of the SPL banner 'U-Boot SPL ...'"
519	default y
520	help
521	  If this option is enabled, SPL will print the banner with version
522	  info. Disabling this option could be useful to reduce SPL boot time
523	  (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
524
525config SPL_EARLY_BSS
526	depends on ARM && !ARM64
527	bool "Allows initializing BSS early before entering board_init_f"
528	help
529	  On some platform we have sufficient memory available early on to
530	  allow setting up and using a basic BSS prior to entering
531	  board_init_f. Activating this option will also de-activate the
532	  clearing of BSS during the SPL relocation process, thus allowing
533	  to carry state from board_init_f to board_init_r by way of BSS.
534
535config SPL_DISPLAY_PRINT
536	bool "Display a board-specific message in SPL"
537	help
538	  If this option is enabled, U-Boot will call the function
539	  spl_display_print() immediately after displaying the SPL console
540	  banner ("U-Boot SPL ..."). This function should be provided by
541	  the board.
542
543config SPL_SYS_MMCSD_RAW_MODE
544	bool "Use raw reads to locate the next boot phase"
545	depends on SPL_DM_MMC || SPL_MMC
546	default y if ARCH_SUNXI || ARCH_DAVINCI || ARCH_UNIPHIER || \
547		     ARCH_MX6 || ARCH_MX7 || \
548		     ARCH_ROCKCHIP || ARCH_MVEBU ||  ARCH_SOCFPGA || \
549		     ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
550		     OMAP54XX || AM33XX || AM43XX || \
551		     TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED
552	help
553	  Support booting from an MMC without a filesystem.
554
555if SPL_SYS_MMCSD_RAW_MODE
556
557choice
558	prompt "Method for locating next phase of boot (e.g. U-Boot)"
559	default SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR if MVEBU_SPL_BOOT_DEVICE_MMC
560
561config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
562	bool "MMC raw mode: by sector"
563	select SPL_LOAD_BLOCK
564	help
565	  Use sector number for specifying U-Boot location on MMC/SD in
566	  raw mode.
567
568config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
569	bool "MMC raw mode: by partition"
570	select SPL_LOAD_BLOCK
571	help
572	  Use a partition for loading U-Boot when using MMC/SD in raw mode.
573
574config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
575	bool "MMC raw mode: by partition type"
576	depends on DOS_PARTITION
577	help
578	  Use partition type for specifying U-Boot partition on MMC/SD in
579	  raw mode. U-Boot will be loaded from the first partition of this
580	  type to be found.
581
582endchoice
583
584config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
585	hex "Address on the MMC to load U-Boot from"
586	depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
587	default 0x40 if ARCH_SUNXI
588	default 0x75 if ARCH_DAVINCI
589	default 0x8a if ARCH_MX6 || ARCH_MX7
590	default 0x100 if ARCH_UNIPHIER
591	default 0x0 if ARCH_MVEBU
592	default 0x200 if ARCH_SOCFPGA || ARCH_AT91
593	default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
594		         OMAP54XX || AM33XX || AM43XX || ARCH_K3
595	default 0x4000 if ARCH_ROCKCHIP
596	default 0x822 if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED
597	help
598	  Address on the MMC to load U-Boot from, when the MMC is being used
599	  in raw mode. Units: MMC sectors (1 sector = 512 bytes).
600
601config SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET
602	hex "U-Boot main hardware partition image offset"
603	depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
604	default 0x10 if ARCH_SUNXI
605	default 0x0
606	help
607	  On some platforms SPL location depends on hardware partition. The ROM
608	  code skips the MBR sector when loading SPL from main hardware data
609	  partition. This adds offset to the main U-Boot image. Set this symbol
610	  to the number of skipped sectors.
611
612	  If unsure, leave the default.
613
614config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
615	hex "Partition to use to load U-Boot from"
616	depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
617	default 1
618	help
619	  Partition on the MMC to load U-Boot from when the MMC is being
620	  used in raw mode
621
622config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE
623	hex "Partition Type on the MMC to load U-Boot from"
624	depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
625	help
626	  Partition Type on the MMC to load U-Boot from, when the MMC is being
627	  used in raw mode.
628
629endif # SPL_SYS_MMCSD_RAW_MODE
630
631config SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG
632	bool "Override eMMC EXT_CSC_PART_CONFIG by user defined partition"
633	depends on SUPPORT_EMMC_BOOT
634	help
635	  eMMC boot partition is normally configured by the bits of the EXT_CSD
636	  register (EXT_CSC_PART_CONFIG), BOOT_PARTITION_ENABLE field. In some
637	  cases it might be required in SPL to load the image from different
638	  partition than the partition selected by EXT_CSC_PART_CONFIG register.
639	  Enable this option if you intend to use an eMMC boot partition other
640	  then selected via EXT_CSC_PART_CONFIG register and specify the custom
641	  partition number by the CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
642	  option.
643
644config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
645	int "Number of the eMMC boot partition to use"
646	depends on SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG
647	default 1
648	help
649	  eMMC boot partition number to use when the eMMC in raw mode and
650	  the eMMC EXT_CSC_PART_CONFIG selection should be overridden in SPL
651	  by user defined partition number.
652
653config SPL_FIT_IMAGE_TINY
654	bool "Remove functionality from SPL FIT loading to reduce size"
655	depends on SPL_FIT
656	default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI
657	help
658	  Enable this to reduce the size of the FIT image loading code
659	  in SPL, if space for the SPL binary is very tight.
660
661	  This skips the recording of each loaded payload
662	  (i.e. loadable) into the FDT (modifying the loaded FDT to
663	  ensure this information is available to the next image
664	  invoked).
665
666config SPL_CACHE
667	bool "Support CACHE drivers"
668	help
669	  Enable CACHE drivers in SPL. These drivers can keep data so that
670	  future requests for that data can be served faster. Enable this option
671	  to build the drivers in drivers/cache as part of an SPL build.
672
673config SPL_CPU
674	bool "Support CPU drivers"
675	help
676	  Enable this to support CPU drivers in SPL. These drivers can set
677	  up CPUs and provide information about them such as the model and
678	  name. This can be useful in SPL since setting up the CPUs earlier
679	  may improve boot performance. Enable this option to build the
680	  drivers in drivers/cpu as part of an SPL build.
681
682config SPL_CRYPTO
683	bool "Support crypto drivers"
684	help
685	  Enable crypto drivers in SPL. These drivers can be used to
686	  accelerate secure boot processing in secure applications. Enable
687	  this option to build the drivers in drivers/crypto as part of an
688	  SPL build.
689
690config SPL_DMA
691	bool "Support DMA drivers"
692	help
693	  Enable DMA (direct-memory-access) drivers in SPL. These drivers
694	  can be used to handle memory-to-peripheral data transfer without
695	  the CPU moving the data. Enable this option to build the drivers
696	  in drivers/dma as part of an SPL build.
697
698config SPL_DRIVERS_MISC
699	bool "Support misc drivers"
700	help
701	  Enable miscellaneous drivers in SPL. These drivers perform various
702	  tasks that don't fall nicely into other categories, Enable this
703	  option to build the drivers in drivers/misc as part of an SPL
704	  build, for those that support building in SPL (not all drivers do).
705
706config SPL_ENV_SUPPORT
707	bool "Support an environment"
708	help
709	  Enable environment support in SPL. The U-Boot environment provides
710	  a number of settings (essentially name/value pairs) which can
711	  control many aspects of U-Boot's operation. Normally this is not
712	  needed in SPL as it has a much simpler task with less
713	  configuration. But some boards use this to support 'Falcon' boot
714	  on EXT2 and FAT, where SPL boots directly into Linux without
715	  starting U-Boot first. Enabling this option will make env_get()
716	  and env_set() available in SPL.
717
718config SPL_SAVEENV
719	bool "Support save environment"
720	depends on SPL_ENV_SUPPORT
721	select SPL_MMC_WRITE if ENV_IS_IN_MMC
722	help
723	  Enable save environment support in SPL after setenv. By default
724	  the saveenv option is not provided in SPL, but some boards need
725	  this support in 'Falcon' boot, where SPL need to boot from
726	  different images based on environment variable set by OS. For
727	  example OS may set "reboot_image" environment variable to
728	  "recovery" inorder to boot recovery image by SPL. The SPL read
729	  "reboot_image" and act accordingly and change the reboot_image
730	  to default mode using setenv and save the environment.
731
732config SPL_ETH
733	bool "Support Ethernet"
734	depends on SPL_ENV_SUPPORT
735	depends on SPL_NET
736	help
737	  Enable access to the network subsystem and associated Ethernet
738	  drivers in SPL. This permits SPL to load U-Boot over an Ethernet
739	  link rather than from an on-board peripheral. Environment support
740	  is required since the network stack uses a number of environment
741	  variables. See also SPL_NET.
742
743config SPL_FS_EXT4
744	bool "Support EXT filesystems"
745	select SPL_CRC16 if EXT4_WRITE
746	help
747	  Enable support for EXT2/3/4 filesystems with SPL. This permits
748	  U-Boot (or Linux in Falcon mode) to be loaded from an EXT
749	  filesystem from within SPL. Support for the underlying block
750	  device (e.g. MMC or USB) must be enabled separately.
751
752config SPL_FS_SQUASHFS
753	bool "Support SquashFS filesystems"
754	select FS_SQUASHFS
755	help
756	  Enable support for SquashFS filesystems with SPL. This permits
757	  U-Boot (or Linux in Falcon mode) to be loaded from a SquashFS
758	  filesystem from within SPL. Support for the underlying block
759	  device (e.g. MMC or USB) must be enabled separately.
760
761config SPL_FS_FAT
762	bool "Support FAT filesystems"
763	select FS_FAT
764	help
765	  Enable support for FAT and VFAT filesystems with SPL. This
766	  permits U-Boot (or Linux in Falcon mode) to be loaded from a FAT
767	  filesystem from within SPL. Support for the underlying block
768	  device (e.g. MMC or USB) must be enabled separately.
769
770config SPL_FS_FAT_DMA_ALIGN
771	bool "Use DMA-aligned buffers with FAT"
772	depends on SPL_FS_FAT
773	select SPL_LOAD_BLOCK
774	default y if SPL_LOAD_FIT
775	help
776	  The FAT filesystem driver tries to ensure that the reads it issues to
777	  the block subsystem use DMA-aligned buffers. If the supplied buffer is
778	  not DMA-aligned, the FAT driver will use a bounce-buffer and read
779	  block-by-block. This is separate from the bounce-buffer used by the
780	  block subsystem (CONFIG_BOUNCE_BUFFER).
781
782	  Enable this config to align buffers passed to the FAT filesystem
783	  driver. This will speed up reads, but will increase the size of U-Boot
784	  by around 60 bytes.
785
786config SPL_FS_LOAD_PAYLOAD_NAME
787	string "File to load for U-Boot from the filesystem"
788	depends on SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS || SPL_SEMIHOSTING
789	default "tispl.bin" if SYS_K3_SPL_ATF
790	default "u-boot.itb" if SPL_LOAD_FIT
791	default "linux.itb" if SPL_LOAD_FIT_OPENSBI_OS_BOOT
792	default "u-boot.img"
793	help
794	  Filename to read to load U-Boot when reading from filesystem.
795
796config SPL_FS_LOAD_KERNEL_NAME
797	string "File to load for the OS kernel from the filesystem"
798	depends on (SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS) && SPL_OS_BOOT
799	default "uImage"
800	help
801	  Filename to read to load for the OS kernel when reading from the
802	  filesystem.
803
804config SPL_FS_LOAD_ARGS_NAME
805	string "File to load for the OS kernel argument parameters from the filesystem"
806	depends on (SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS) && SPL_OS_BOOT
807	default "args"
808	help
809	  Filename to read to load for the OS kernel argument parameters from
810	  the filesystem.
811
812config SPL_FAT_WRITE
813	bool "Support write for FAT filesystems"
814	help
815	  Enable write support for FAT and VFAT filesystems with SPL.
816	  Support for the underlying block device (e.g. MMC or USB) must be
817	  enabled separately.
818
819config SPL_FPGA
820	bool "Support FPGAs"
821	help
822	  Enable support for FPGAs in SPL. Field-programmable Gate Arrays
823	  provide software-configurable hardware which is typically used to
824	  implement peripherals (such as UARTs, LCD displays, MMC) or
825	  accelerate custom processing functions, such as image processing
826	  or machine learning. Sometimes it is useful to program the FPGA
827	  as early as possible during boot, and this option can enable that
828	  within SPL.
829
830config SPL_GPIO
831	bool "Support GPIO in SPL"
832	help
833	  Enable support for GPIOs (General-purpose Input/Output) in SPL.
834	  GPIOs allow U-Boot to read the state of an input line (high or
835	  low) and set the state of an output line. This can be used to
836	  drive LEDs, control power to various system parts and read user
837	  input. GPIOs can be useful in SPL to enable a 'sign-of-life' LED,
838	  for example. Enable this option to build the drivers in
839	  drivers/gpio as part of an SPL build.
840
841config SPL_I2C
842	bool "Support I2C"
843	help
844	  Enable support for the I2C (Inter-Integrated Circuit) bus in SPL.
845	  I2C works with a clock and data line which can be driven by a
846	  one or more masters or slaves. It is a fairly complex bus but is
847	  widely used as it only needs two lines for communication. Speeds of
848	  400kbps are typical but up to 3.4Mbps is supported by some
849	  hardware. I2C can be useful in SPL to configure power management
850	  ICs (PMICs) before raising the CPU clock speed, for example.
851	  Enable this option to build the drivers in drivers/i2c as part of
852	  an SPL build.
853
854config SPL_LIBCOMMON_SUPPORT
855	bool "Support common libraries"
856	help
857	  Enable support for common U-Boot libraries within SPL. These
858	  libraries include common code to deal with U-Boot images,
859	  environment and USB, for example. This option is enabled on many
860	  boards. Enable this option to build the code in common/ as part of
861	  an SPL build.
862
863config SPL_LIBDISK_SUPPORT
864	bool "Support disk partitions"
865	select PARTITIONS
866	help
867	  Enable support for disk partitions within SPL. 'Disk' is something
868	  of a misnomer as it includes non-spinning media such as flash (as
869	  used in MMC and USB sticks). Partitions provide a way for a disk
870	  to be split up into separate regions, with a partition table placed
871	  at the start or end which describes the location and size of each
872	  'partition'. These partitions are typically uses as individual block
873	  devices, typically with an EXT2 or FAT filesystem in each. This
874	  option enables whatever partition support has been enabled in
875	  U-Boot to also be used in SPL. It brings in the code in disk/.
876
877config SPL_LIBGENERIC_SUPPORT
878	bool "Support generic libraries"
879	help
880	  Enable support for generic U-Boot libraries within SPL. These
881	  libraries include generic code to deal with device tree, hashing,
882	  printf(), compression and the like. This option is enabled on many
883	  boards. Enable this option to build the code in lib/ as part of an
884	  SPL build.
885
886config SPL_DM_MAILBOX
887	bool "Support Mailbox"
888	depends on SPL_DM
889	help
890	  Enable support for Mailbox within SPL. This enable the inter
891	  processor communication protocols tobe used within SPL. Enable
892	  this option to build the drivers in drivers/mailbox as part of
893	  SPL build.
894
895config SPL_MEMORY
896	bool "Support Memory controller drivers"
897	help
898	  Enable support for Memory Controller drivers within SPL.
899	  These devices provide Memory bus interface to various devices like
900	  SRAM, Ethernet adapters, FPGAs, etc.
901
902config SPL_MMC
903	bool "Support MMC"
904	depends on MMC
905	help
906	  Enable support for MMC (Multimedia Card) within SPL. This enables
907	  the MMC protocol implementation and allows any enabled drivers to
908	  be used within SPL. MMC can be used with or without disk partition
909	  support depending on the application (SPL_LIBDISK_SUPPORT). Enable
910	  this option to build the drivers in drivers/mmc as part of an SPL
911	  build.
912
913config SYS_MMCSD_FS_BOOT
914	bool "MMC FS Boot mode"
915	depends on SPL_MMC
916	default y if !ARCH_MVEBU
917	help
918	  Enable MMC FS Boot mode. Partition is selected by option
919	  SYS_MMCSD_FS_BOOT_PARTITION.
920
921config SYS_MMCSD_FS_BOOT_PARTITION
922	int "MMC Boot Partition"
923	depends on SYS_MMCSD_FS_BOOT
924	default 1
925	help
926	  Partition on the MMC to load U-Boot from when the MMC is being
927	  used in fs mode.
928	  Use -1 as a special value to use the first bootable partition.
929
930config SPL_MMC_TINY
931	bool "Tiny MMC framework in SPL"
932	depends on SPL_MMC
933	help
934	  Enable MMC framework tinification support. This option is useful if
935	  if your SPL is extremely size constrained. Heed the warning, enable
936	  this option if and only if you know exactly what you are doing, if
937	  you are reading this help text, you most likely have no idea :-)
938
939	  The MMC framework is reduced to bare minimum to be useful. No malloc
940	  support is needed for the MMC framework operation with this option
941	  enabled. The framework supports exactly one MMC device and exactly
942	  one MMC driver. The MMC driver can be adjusted to avoid any malloc
943	  operations too, which can remove the need for malloc support in SPL
944	  and thus further reduce footprint.
945
946config SPL_MMC_WRITE
947	bool "MMC/SD/SDIO card support for write operations in SPL"
948	depends on SPL_MMC
949	help
950	  Enable write access to MMC and SD Cards in SPL
951
952
953config SPL_MPC8XXX_INIT_DDR
954	bool "Support MPC8XXX DDR init"
955	help
956	  Enable support for DDR-SDRAM (double-data-rate synchronous dynamic
957	  random-access memory) on the MPC8XXX family within SPL. This
958	  allows DRAM to be set up before loading U-Boot into that DRAM,
959	  where it can run.
960
961config SPL_MTD
962	bool "Support MTD drivers"
963	help
964	  Enable support for MTD (Memory Technology Device) within SPL. MTD
965	  provides a block interface over raw NAND and can also be used with
966	  SPI flash. This allows SPL to load U-Boot from supported MTD
967	  devices. See SPL_NAND_SUPPORT and SPL_ONENAND_SUPPORT for how
968	  to enable specific MTD drivers.
969
970config SPL_MUSB_NEW
971	bool "Support new Mentor Graphics USB"
972	help
973	  Enable support for Mentor Graphics USB in SPL. This is a new
974	  driver used by some boards. Enable this option to build
975	  the drivers in drivers/usb/musb-new as part of an SPL build. The
976	  old drivers are in drivers/usb/musb.
977
978config SPL_NAND_SUPPORT
979	bool "Support NAND flash"
980	select SPL_LOAD_BLOCK
981	help
982	  Enable support for NAND (Negative AND) flash in SPL. NAND flash
983	  can be used to allow SPL to load U-Boot from supported devices.
984	  This enables the drivers in drivers/mtd/nand/raw as part of an SPL
985	  build.
986
987config SPL_NAND_RAW_U_BOOT_USE_SECTOR
988	bool "NAND raw mode: by sector"
989	depends on SPL_NAND_SUPPORT
990	select SPL_LOAD_BLOCK
991	help
992	  Use sector number for specifying U-Boot location on NAND in
993	  raw mode.
994
995config SPL_NAND_RAW_U_BOOT_SECTOR
996	hex "Address on the NAND to load U-Boot from"
997	depends on SPL_NAND_RAW_U_BOOT_USE_SECTOR
998	help
999	  Address on the NAND to load U-Boot from, when the NAND is being used
1000	  in raw mode. Units: NAND disk sectors (1 sector = 512 bytes).
1001
1002config SPL_NAND_RAW_ONLY
1003	bool "Support to boot only raw u-boot.bin images"
1004	depends on SPL_NAND_SUPPORT
1005	help
1006	  Use this only if you need to save space.
1007
1008config SPL_NAND_DRIVERS
1009	bool "Use standard NAND driver"
1010	help
1011	  SPL uses normal NAND drivers, not minimal drivers.
1012
1013config SPL_NAND_ECC
1014	bool "Include standard ECC in SPL"
1015
1016config SPL_NAND_SOFTECC
1017	bool "Use software ECC in SPL"
1018	depends on SPL_NAND_ECC
1019
1020config SPL_NAND_SIMPLE
1021	bool "Support simple NAND drivers in SPL"
1022	help
1023	  Support for NAND boot using simple NAND drivers that
1024	  expose the cmd_ctrl() interface.
1025
1026config SPL_NAND_BASE
1027	depends on SPL_NAND_SUPPORT
1028	bool "Use Base NAND Driver"
1029	help
1030	  Include nand_base.c in the SPL.
1031
1032config SPL_NAND_IDENT
1033	depends on SPL_NAND_BASE
1034	bool "Use chip ID to identify NAND flash"
1035	help
1036	  SPL uses the chip ID list to identify the NAND flash.
1037
1038config SPL_RELOC_LOADER
1039	bool "Allow relocating the next phase"
1040	help
1041	  In some cases multiple U-Boot phases need to run in SRAM, typically
1042	  at the same address. Enable this to support loading the next phase
1043	  to temporary memory, then copying it into place afterwards, then
1044	  jumping to it.
1045
1046config SPL_UBI
1047	bool "Support UBI"
1048	help
1049	  Enable support for loading payloads from UBI. See
1050	  README.ubispl for more info.
1051
1052menu "UBI configuration for SPL"
1053	depends on SPL_UBI
1054
1055config SPL_UBI_LOAD_BY_VOLNAME
1056	bool "Support loading volumes by name"
1057	help
1058	  This enables support for loading UBI volumes by name. When this
1059	  is set, CONFIG_SPL_UBI_LOAD_MONITOR_VOLNAME can be used to
1060	  configure the volume name from which to load U-Boot.
1061
1062config SPL_UBI_MAX_VOL_LEBS
1063	int "Maximum number of LEBs per volume"
1064	help
1065	  The maximum number of logical eraseblocks which a static volume
1066	  to load can contain. Used for sizing the scan data structure.
1067
1068config SPL_UBI_MAX_PEB_SIZE
1069	int "Maximum PEB size"
1070	help
1071	  The maximum physical erase block size.
1072
1073config SPL_UBI_MAX_PEBS
1074	int "Maximum number of PEBs"
1075	help
1076	  The maximum physical erase block size. If not overridden by
1077	  board code, this value will be used as the actual number of PEBs.
1078
1079config SPL_UBI_PEB_OFFSET
1080	int "Offset to first UBI PEB"
1081	help
1082	  The offset in number of PEBs from the start of flash to the first
1083	  PEB part of the UBI image.
1084
1085config SPL_UBI_VID_OFFSET
1086	int "Offset to VID header"
1087
1088config SPL_UBI_LEB_START
1089	int "Offset to LEB in PEB"
1090	help
1091	  The offset in bytes to the LEB within a PEB.
1092
1093config SPL_UBI_INFO_ADDR
1094	hex "Address to place UBI scan info"
1095	help
1096	  Address for ubispl to place the scan info. Read README.ubispl to
1097	  determine the required size
1098
1099config SPL_UBI_VOL_IDS
1100	int "Maximum volume id"
1101	help
1102	  The maximum volume id which can be loaded. Used for sizing the
1103	  scan data structure.
1104
1105config SPL_UBI_LOAD_MONITOR_ID
1106	int "id of U-Boot volume"
1107	help
1108	  The UBI volume id from which to load U-Boot
1109
1110config SPL_UBI_LOAD_MONITOR_VOLNAME
1111	string "volume name of U-Boot volume"
1112	depends on SPL_UBI_LOAD_BY_VOLNAME
1113	help
1114	  The UBI volume name from which to load U-Boot
1115
1116config SPL_UBI_LOAD_KERNEL_ID
1117	int "id of kernel volume"
1118	depends on SPL_OS_BOOT
1119	help
1120	  The UBI volume id from which to load the kernel
1121
1122config SPL_UBI_LOAD_ARGS_ID
1123	int "id of kernel args volume"
1124	depends on SPL_OS_BOOT
1125	help
1126	  The UBI volume id from which to load the device tree
1127
1128config UBI_SPL_SILENCE_MSG
1129	bool "silence UBI SPL messages"
1130	help
1131	  Disable messages from UBI SPL. This leaves warnings
1132	  and errors enabled.
1133
1134endmenu
1135
1136config SPL_DM_SPI
1137	bool "Support SPI DM drivers in SPL"
1138	depends on SPL_DM
1139	help
1140	  Enable support for SPI DM drivers in SPL.
1141
1142config SPL_DM_SPI_FLASH
1143	bool "Support SPI DM FLASH drivers in SPL"
1144	depends on SPL_DM
1145	help
1146	  Enable support for SPI DM flash drivers in SPL.
1147
1148config SPL_NET
1149	bool "Support networking"
1150	depends on !NET_LWIP
1151	select SPL_USE_TINY_PRINTF_POINTER_SUPPORT if SPL_USE_TINY_PRINTF
1152	help
1153	  Enable support for network devices (such as Ethernet) in SPL.
1154	  This permits SPL to load U-Boot over a network link rather than
1155	  from an on-board peripheral. Environment support is required since
1156	  the network stack uses a number of environment variables. See also
1157	  SPL_ETH.
1158
1159config SPL_NET_VCI_STRING
1160	string "BOOTP Vendor Class Identifier string sent by SPL"
1161	depends on SPL_NET
1162	help
1163	  As defined by RFC 2132 the vendor class identifier field can be
1164	  sent by the client to identify the vendor type and configuration
1165	  of a client.  This is often used in practice to allow for the DHCP
1166	  server to specify different files to load depending on if the ROM,
1167	  SPL or U-Boot itself makes the request
1168
1169config SPL_NO_CPU_SUPPORT
1170	def_bool y
1171	depends on (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
1172	help
1173	  This is specific to the ARM926EJ-S CPU. It disables the standard
1174	  start.S start-up code, presumably so that a replacement can be
1175	  used on that CPU. You should not enable it unless you know what
1176	  you are doing.
1177
1178config SPL_NOR_SUPPORT
1179	bool "Support NOR flash"
1180	help
1181	  Enable support for loading U-Boot from memory-mapped NOR (Negative
1182	  OR) flash in SPL. NOR flash is slow to write but fast to read, and
1183	  a memory-mapped device makes it very easy to access. Loading from
1184	  NOR is typically achieved with just a memcpy().
1185
1186config SPL_XIP_SUPPORT
1187	bool "Support XIP"
1188	help
1189	  Enable support for execute in place of U-Boot or kernel image. There
1190	  is no need to copy image from flash to ram if flash supports execute
1191	  in place. Its very useful in systems having enough flash but not
1192	  enough ram to load the image.
1193
1194config SPL_ONENAND_SUPPORT
1195	bool "Support OneNAND flash"
1196	help
1197	  Enable support for OneNAND (Negative AND) flash in SPL. OneNAND is
1198	  a type of NAND flash and therefore can be used to allow SPL to
1199	  load U-Boot from supported devices. This enables the drivers in
1200	  drivers/mtd/onenand as part of an SPL build.
1201
1202config SPL_OS_BOOT
1203	bool "Activate Falcon Mode"
1204	depends on !TI_SECURE_DEVICE
1205	help
1206	  Enable booting directly to an OS from SPL.
1207	  for more info read doc/README.falcon
1208
1209config SPL_PAYLOAD_ARGS_ADDR
1210	hex "Address in memory to load 'args' file for Falcon Mode to"
1211	depends on SPL_OS_BOOT || SPL_LOAD_FIT_OPENSBI_OS_BOOT
1212	default 0x88000000 if ARCH_OMAP2PLUS
1213	default 0x99000000 if ARCH_SC5XX && SC59X_64
1214	default 0xA0000000 if ARCH_SC5XX && TARGET_SC594_SOM_EZKIT
1215	default 0x80000000 if ARCH_SC5XX && TARGET_SC594_SOM_EZLITE
1216	help
1217	  Address in memory where the 'args' file, typically a device tree
1218	  will be loaded in to memory.
1219
1220config SYS_NAND_SPL_KERNEL_OFFS
1221	hex "Address in memory to load the OS file for Falcon mode to"
1222	depends on SPL_OS_BOOT && SPL_NAND_SUPPORT
1223
1224config SYS_OS_BASE
1225	hex "addr, where OS is found"
1226	depends on SPL_OS_BOOT && SPL_NOR_SUPPORT
1227	help
1228	  Specify the address, where the OS image is found, which
1229	  gets booted.
1230
1231config SPL_FALCON_BOOT_MMCSD
1232	bool "Enable Falcon boot from MMC or SD media"
1233	depends on SPL_OS_BOOT && SPL_MMC
1234	select SPL_LOAD_BLOCK
1235	select SPL_SYS_MMCSD_RAW_MODE
1236	help
1237	  Select this if the Falcon mode OS image mode is on MMC or SD media.
1238
1239config SYS_MMCSD_RAW_MODE_KERNEL_SECTOR
1240	hex "Falcon mode: Sector to load kernel uImage from MMC"
1241	depends on SPL_FALCON_BOOT_MMCSD
1242	help
1243	  When Falcon mode is used with an MMC or SD media, SPL needs to know
1244	  where to look for the kernel uImage. The image is expected to begin
1245	  at the raw MMC specified in this config.
1246	  Note that the Falcon mode image can also be a FIT, if FIT support is
1247	  enabled.
1248
1249config SYS_MMCSD_RAW_MODE_ARGS_SECTOR
1250	hex "Falcon mode: Sector to load 'args' from MMC"
1251	depends on SPL_FALCON_BOOT_MMCSD
1252	help
1253	  When Falcon mode is used with an MMC or SD media, SPL needs to know
1254	  where to look for the OS 'args', typically a device tree. The
1255	  contents are expected to begin at the raw MMC specified in this config.
1256	  Note that if using a FIT image, this and the next option can be set to
1257	  0x0.
1258
1259config SYS_MMCSD_RAW_MODE_ARGS_SECTORS
1260	hex "Falcon mode: Number of sectors to load for 'args' from MMC"
1261	depends on SPL_FALCON_BOOT_MMCSD && SYS_MMCSD_RAW_MODE_ARGS_SECTOR != 0x0
1262
1263config SPL_PAYLOAD
1264	string "SPL payload"
1265	default "tpl/u-boot-with-tpl.bin" if TPL
1266	default "u-boot.bin"
1267	help
1268	  Payload for SPL boot. For backward compatibility, default to
1269	  u-boot.bin, i.e. RAW image without any header. In case of
1270	  TPL, tpl/u-boot-with-tpl.bin. For new boards, suggest to
1271	  use u-boot.img.
1272
1273config SPL_PCI
1274	bool "Support PCI drivers"
1275	help
1276	  Enable support for PCI in SPL. For platforms that need PCI to boot,
1277	  or must perform some init using PCI in SPL, this provides the
1278	  necessary driver support. This enables the drivers in drivers/pci
1279	  as part of an SPL build.
1280
1281config SPL_PCH
1282	bool "Support PCH drivers"
1283	help
1284	  Enable support for PCH (Platform Controller Hub) devices in SPL.
1285	  These are used to set up GPIOs and the SPI peripheral early in
1286	  boot. This enables the drivers in drivers/pch as part of an SPL
1287	  build.
1288
1289config SPL_POST_MEM_SUPPORT
1290	bool "Support POST drivers"
1291	help
1292	  Enable support for POST (Power-on Self Test) in SPL. POST is a
1293	  procedure that checks that the hardware (CPU or board) appears to
1294	  be functionally correctly. It is a sanity check that can be
1295	  performed before booting. This enables the drivers in post/drivers
1296	  as part of an SPL build.
1297
1298config SPL_DM_RESET
1299	bool "Support reset drivers"
1300	depends on SPL_DM
1301	help
1302	  Enable support for reset control in SPL.
1303	  That can be useful in SPL to handle IP reset in driver, as in U-Boot,
1304	  by using the generic reset API provided by driver model.
1305	  This enables the drivers in drivers/reset as part of an SPL build.
1306
1307config SPL_POWER
1308	bool "Support power drivers"
1309	help
1310	  Enable support for power control in SPL. This includes support
1311	  for PMICs (Power-management Integrated Circuits) and some of the
1312	  features provided by PMICs. In particular, voltage regulators can
1313	  be used to enable/disable power and vary its voltage. That can be
1314	  useful in SPL to turn on boot peripherals and adjust CPU voltage
1315	  so that the clock speed can be increased. This enables the drivers
1316	  in drivers/power, drivers/power/pmic and drivers/power/regulator
1317	  as part of an SPL build.
1318
1319config SPL_POWER_DOMAIN
1320	bool "Support power domain drivers"
1321	select SPL_POWER
1322	help
1323	  Enable support for power domain control in SPL. Many SoCs allow
1324	  power to be applied to or removed from portions of the SoC (power
1325	  domains). This may be used to save power. This API provides the
1326	  means to control such power management hardware. This enables
1327	  the drivers in drivers/power/domain as part of a SPL build.
1328
1329config SPL_RAM_SUPPORT
1330	bool
1331
1332config SPL_RAM_DEVICE
1333	bool "Support booting from preloaded image in RAM"
1334	select SPL_RAM_SUPPORT
1335	default y if MICROBLAZE || ARCH_SOCFPGA || ARCH_TEGRA || ARCH_ZYNQ
1336	help
1337	  Enable booting of an image already loaded in RAM. The image has to
1338	  be already in memory when SPL takes over, e.g. loaded by the boot
1339	  ROM.
1340
1341config SPL_REMOTEPROC
1342	bool "Support REMOTEPROCS"
1343	default y if (CPU_V7R && ARCH_K3)
1344	help
1345	  Enable support for REMOTEPROCs in SPL. This permits to load
1346	  a remote processor firmware in SPL.
1347
1348config SPL_RTC
1349	bool "Support RTC drivers"
1350	help
1351	  Enable RTC (Real-time Clock) support in SPL. This includes support
1352	  for reading and setting the time. Some RTC devices also have some
1353	  non-volatile (battery-backed) memory which is accessible if
1354	  needed. This enables the drivers in drivers/rtc as part of an SPL
1355	  build.
1356
1357config SPL_SATA
1358	bool "Support loading from SATA"
1359	help
1360	  Enable support for SATA (Serial AT attachment) in SPL. This allows
1361	  use of SATA devices such as hard drives and flash drivers for
1362	  loading U-Boot. SATA is used in higher-end embedded systems and
1363	  can provide higher performance than MMC , at somewhat higher
1364	  expense and power consumption. This enables loading from SATA
1365	  using a configured device.
1366
1367config SYS_SATA_FAT_BOOT_PARTITION
1368	int "Partition on the SATA disk to load U-Boot from"
1369	depends on SPL_SATA && SPL_FS_FAT
1370	default 1
1371
1372config SPL_SATA_RAW_U_BOOT_USE_SECTOR
1373	bool "SATA raw mode: by sector"
1374	depends on SPL_SATA
1375	default y if ARCH_MVEBU
1376	help
1377	  Use sector number for specifying U-Boot location on SATA disk in
1378	  raw mode.
1379
1380config SPL_SATA_RAW_U_BOOT_SECTOR
1381	hex "Sector on the SATA disk to load U-Boot from"
1382	depends on SPL_SATA_RAW_U_BOOT_USE_SECTOR
1383	default 0x1 if ARCH_MVEBU
1384	help
1385	  Sector on the SATA disk to load U-Boot from, when the SATA disk is being
1386	  used in raw mode. Units: SATA disk sectors (1 sector = 512 bytes).
1387
1388config SPL_NVME
1389	bool "NVM Express device support"
1390	depends on SPL_BLK
1391	select FS_LOADER
1392	select SPL_BLK_FS
1393	help
1394	  This option enables support for NVM Express devices.
1395	  It supports basic functions of NVMe (read/write).
1396
1397config SPL_NVME_PCI
1398	bool "NVM Express PCI device support for SPL"
1399	depends on SPL_PCI && SPL_NVME
1400	help
1401	  This option enables support for NVM Express PCI devices.
1402	  This allows use of NVMe devices for loading u-boot.
1403
1404config SPL_NVME_BOOT_DEVICE
1405	hex "NVMe boot device number"
1406	depends on SPL_NVME
1407	default 0x0
1408
1409config SYS_NVME_BOOT_PARTITION
1410	hex "NVMe boot partition number"
1411	depends on SPL_NVME
1412	default	0x1
1413
1414config SPL_SERIAL
1415	bool "Support serial"
1416	select SPL_PRINTF
1417	select SPL_STRTO
1418	help
1419	  Enable support for serial in SPL. This allows use of a serial UART
1420	  for displaying messages while SPL is running. It also brings in
1421	  printf() and panic() functions. This should normally be enabled
1422	  unless there are space reasons not to. Even then, consider
1423	  enabling SPL_USE_TINY_PRINTF which is a small printf() version.
1424
1425config SPL_SPI
1426	bool "Support SPI drivers"
1427	help
1428	  Enable support for using SPI in SPL. This is used for connecting
1429	  to SPI flash for loading U-Boot. See SPL_SPI_FLASH_SUPPORT for
1430	  more details on that. The SPI driver provides the transport for
1431	  data between the SPI flash and the CPU. This option can be used to
1432	  enable SPI drivers that are needed for other purposes also, such
1433	  as a SPI PMIC.
1434
1435config SPL_SPI_FLASH_SUPPORT
1436	bool "Support SPI flash drivers"
1437	depends on SPL_SPI
1438	help
1439	  Enable support for using SPI flash in SPL, and loading U-Boot from
1440	  SPI flash. SPI flash (Serial Peripheral Bus flash) is named after
1441	  the SPI bus that is used to connect it to a system. It is a simple
1442	  but fast bidirectional 4-wire bus (clock, chip select and two data
1443	  lines). This enables the drivers in drivers/mtd/spi as part of an
1444	  SPL build. This normally requires SPL_SPI.
1445
1446if SPL_SPI_FLASH_SUPPORT
1447
1448config SPL_SPI_FLASH_TINY
1449	bool "Enable low footprint SPL SPI Flash support"
1450	depends on !SPI_FLASH_BAR
1451	default y if SPI_FLASH
1452	help
1453	 Enable lightweight SPL SPI Flash support that supports just reading
1454	 data/images from flash. No support to write/erase flash. Enable
1455	 this if you have SPL size limitations and don't need full
1456	 fledged SPI flash support.
1457
1458config SPL_SPI_FLASH_SFDP_SUPPORT
1459	bool "SFDP table parsing support for SPI NOR flashes"
1460	depends on !SPI_FLASH_BAR && !SPL_SPI_FLASH_TINY
1461	help
1462	 Enable support for parsing and auto discovery of parameters for
1463	 SPI NOR flashes using Serial Flash Discoverable Parameters (SFDP)
1464	 tables as per JESD216 standard in SPL.
1465
1466config SPL_SPI_FLASH_MTD
1467	bool "Support for SPI flash MTD drivers in SPL"
1468	help
1469	  Enable support for SPI flash MTD drivers in SPL.
1470
1471config SPL_SPI_LOAD
1472	bool "Support loading from SPI flash"
1473	help
1474	  Enable support for loading next stage, U-Boot or otherwise, from
1475	  SPI NOR in U-Boot SPL.
1476
1477endif # SPL_SPI_FLASH_SUPPORT
1478
1479config SYS_SPI_U_BOOT_OFFS
1480	hex "address of u-boot payload in SPI flash"
1481	default 0x8000 if ARCH_SUNXI
1482	default 0x0
1483	depends on SPL_SPI_LOAD || SPL_SPI_SUNXI
1484	help
1485	 Address within SPI-Flash from where the u-boot payload is fetched
1486	 from.
1487
1488config SYS_SPI_KERNEL_OFFS
1489	hex "Falcon mode: address of kernel payload in SPI flash"
1490	depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT
1491	help
1492	 Address within SPI-Flash from where the kernel payload is fetched
1493	 in falcon boot.
1494
1495config SYS_SPI_ARGS_OFFS
1496	hex "Falcon mode: address of args payload in SPI flash"
1497	depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT
1498	help
1499	 Address within SPI-Flash from where the args payload (usually the
1500	 dtb) is fetched in falcon boot.
1501
1502config SYS_SPI_ARGS_SIZE
1503	hex "Falcon mode: size of args payload in SPI flash"
1504	depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT
1505
1506config SPL_THERMAL
1507	bool "Driver support for thermal devices"
1508	help
1509	  Enable support for temperature-sensing devices. Some SoCs have on-chip
1510	  temperature sensors to permit warnings, speed throttling or even
1511	  automatic power-off when the temperature gets too high or low. Other
1512	  devices may be discrete but connected on a suitable bus.
1513
1514config SPL_WATCHDOG
1515	bool "Support watchdog drivers"
1516	imply SPL_WDT if !HW_WATCHDOG
1517	help
1518	  Enable support for watchdog drivers in SPL. A watchdog is
1519	  typically a hardware peripheral which can reset the system when it
1520	  detects no activity for a while (such as a software crash). This
1521	  enables the drivers in drivers/watchdog as part of an SPL build.
1522
1523config SPL_YMODEM_SUPPORT
1524	bool "Support loading using Ymodem"
1525	depends on SPL_SERIAL
1526	help
1527	  While loading from serial is slow it can be a useful backup when
1528	  there is no other option. The Ymodem protocol provides a reliable
1529	  means of transmitting U-Boot over a serial line for using in SPL,
1530	  with a checksum to ensure correctness.
1531
1532config SPL_ATF
1533	bool "Support ARM Trusted Firmware"
1534	depends on ARM64
1535	depends on SPL_LOAD_FIT && !SPL_FIT_IMAGE_TINY
1536	help
1537	  ATF(ARM Trusted Firmware) is a component for ARM AArch64 which
1538	  is loaded by SPL (which is considered as BL2 in ATF terminology).
1539	  More detail at: https://github.com/TrustedFirmware-A/trusted-firmware-a
1540
1541config SPL_ATF_LOAD_IMAGE_V2
1542	bool "Use the new LOAD_IMAGE_V2 parameter passing"
1543	depends on SPL_ATF
1544	help
1545	  Some platforms use the newer LOAD_IMAGE_V2 parameter passing.
1546
1547	  If you want to load a bl31 image from the SPL and need the new
1548	  method, say Y.
1549
1550config SPL_ATF_NO_PLATFORM_PARAM
1551	bool "Pass no platform parameter"
1552	depends on SPL_ATF
1553	help
1554	  While we expect to call a pointer to a valid FDT (or NULL)
1555	  as the platform parameter to an ATF, some ATF versions are
1556	  not U-Boot aware and have an insufficiently robust parameter
1557	  validation to gracefully reject a FDT being passed.
1558
1559	  If this option is enabled, the spl_atf os-type handler will
1560	  always pass NULL for the platform parameter.
1561
1562	  If your ATF is affected, say Y.
1563
1564config SPL_AM33XX_ENABLE_RTC32K_OSC
1565	bool "Enable the RTC32K OSC on AM33xx based platforms"
1566	depends on AM33XX
1567	default y if AM33XX
1568	help
1569	  Enable access to the AM33xx RTC and select the external 32kHz clock
1570	  source.
1571
1572config SPL_OPTEE_IMAGE
1573	bool "Support OP-TEE Trusted OS image in SPL"
1574	depends on ARM
1575	depends on SPL_LOAD_FIT || SPL_LOAD_FIT_FULL
1576	help
1577	  OP-TEE is an open source Trusted OS which is loaded by SPL.
1578	  More detail at: https://github.com/OP-TEE/optee_os
1579
1580config SPL_OPENSBI
1581	bool "Support RISC-V OpenSBI"
1582	depends on RISCV && SPL_RISCV_MMODE && RISCV_SMODE
1583	depends on SPL_LOAD_FIT && !SPL_FIT_IMAGE_TINY
1584	help
1585	  OpenSBI is an open-source implementation of the RISC-V Supervisor Binary
1586	  Interface (SBI) specification. U-Boot supports the OpenSBI FW_DYNAMIC
1587	  firmware. It is loaded and started by U-Boot SPL.
1588
1589	  More details are available at https://github.com/riscv/opensbi and
1590	  https://github.com/riscv/riscv-sbi-doc
1591
1592config SPL_OPENSBI_LOAD_ADDR
1593	hex "OpenSBI load address"
1594	depends on SPL_OPENSBI
1595	help
1596	  Load address of the OpenSBI binary.
1597
1598config SPL_OPENSBI_SCRATCH_OPTIONS
1599	hex "Scratch options passed to OpenSBI"
1600	default 0x1
1601	depends on SPL_OPENSBI
1602	help
1603	  This bitmap of options is passed from U-Boot SPL to OpenSBI.
1604	  As of OpenSBI 1.3 the following bits are defined:
1605	  - SBI_SCRATCH_NO_BOOT_PRINTS = 0x1 (Disable prints during boot)
1606	  - SBI_SCRATCH_DEBUG_PRINTS   = 0x2 (Enable runtime debug prints)
1607
1608config SPL_TARGET
1609	string "Addtional build targets for 'make'"
1610	default "spl/u-boot-spl.srec" if RCAR_GEN2
1611	default "spl/u-boot-spl.scif" if RCAR_64
1612	default ""
1613	help
1614	  On some platforms we need to have 'make' run additional build target
1615	  rules. If required on your platform, enter it here, otherwise leave blank.
1616
1617
1618config SPL_AT91_MCK_BYPASS
1619	bool "Use external clock signal as a source of main clock for AT91 platforms"
1620	depends on ARCH_AT91
1621	help
1622	  Use external 8 to 24 Mhz clock signal as source of main clock instead
1623	  of an external crystal oscillator.
1624	  This option disables the internal driving on the XOUT pin.
1625	  The external source has to provide a stable clock on the XIN pin.
1626	  If this option is disabled, the SoC expects a crystal oscillator
1627	  that needs driving on both XIN and XOUT lines.
1628endmenu
1629
1630config TPL
1631	depends on SUPPORT_TPL
1632	bool "Enable TPL"
1633	help
1634	  If you want to build TPL as well as the normal image and SPL, say Y.
1635
1636source "common/spl/Kconfig.tpl"
1637
1638config VPL
1639	depends on SUPPORT_SPL
1640	bool "Enable VPL"
1641	help
1642	  If you want to build VPL as well as the normal image, TPL and SPL,
1643	  say Y.
1644
1645source "common/spl/Kconfig.vpl"
1646