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