spl: add overall SPL size check
[platform/kernel/u-boot.git] / common / spl / Kconfig
1 menu "SPL / TPL"
2
3 config SUPPORT_SPL
4         bool
5
6 config SUPPORT_TPL
7         bool
8
9 config SPL_DFU_NO_RESET
10         bool
11
12 config SPL
13         bool
14         depends on SUPPORT_SPL
15         prompt "Enable SPL"
16         help
17           If you want to build SPL as well as the normal image, say Y.
18
19 config SPL_FRAMEWORK
20         bool "Support SPL based upon the common SPL framework"
21         depends on SPL
22         default y
23         help
24           Enable the SPL framework under common/spl/.  This framework
25           supports MMC, NAND and YMODEM and other methods loading of U-Boot
26           and the Linux Kernel.  If unsure, say Y.
27
28 config SPL_SIZE_LIMIT
29         hex "Maximum size of SPL image"
30         depends on SPL
31         default 0
32         help
33           Specifies the maximum length of the U-Boot SPL image.
34           If this value is zero, it is ignored.
35
36 config SPL_SIZE_LIMIT_SUBTRACT_GD
37         bool "SPL image size check: provide space for global data"
38         depends on SPL_SIZE_LIMIT > 0
39         help
40           If enabled, aligned size of global data is reserved in
41           SPL_SIZE_LIMIT check to ensure such an image does not overflow SRAM
42           if SPL_SIZE_LIMIT describes the size of SRAM available for SPL when
43           pre-reloc global data is put into this SRAM, too.
44
45 config SPL_SIZE_LIMIT_SUBTRACT_MALLOC
46         bool "SPL image size check: provide space for malloc() pool before relocation"
47         depends on SPL_SIZE_LIMIT > 0
48         help
49           If enabled, SPL_SYS_MALLOC_F_LEN is reserved in SPL_SIZE_LIMIT check
50           to ensure such an image does not overflow SRAM if SPL_SIZE_LIMIT
51           describes the size of SRAM available for SPL when pre-reloc malloc
52           pool is put into this SRAM, too.
53
54 config SPL_SIZE_LIMIT_PROVIDE_STACK
55         hex "SPL image size check: provide stack space before relocation"
56         depends on SPL_SIZE_LIMIT > 0
57         default 0
58         help
59           If set, this size is reserved in SPL_SIZE_LIMIT check to ensure such
60           an image does not overflow SRAM if SPL_SIZE_LIMIT describes the size
61           of SRAM available for SPL when the stack required before reolcation
62           uses this SRAM, too.
63
64 config HANDOFF
65         bool "Pass hand-off information from SPL to U-Boot proper"
66         depends on BLOBLIST
67         help
68           It is useful to be able to pass information from SPL to U-Boot
69           proper to preserve state that is known in SPL and is needed in U-Boot.
70           Enable this to locate the handoff information in U-Boot proper, early
71           in boot. It is available in gd->handoff. The state state is set up
72           in SPL (or TPL if that is being used).
73
74 if SPL
75
76 config SPL_HANDOFF
77         bool "Pass hand-off information from SPL to U-Boot proper"
78         depends on HANDOFF
79         default y
80         help
81           This option enables SPL to write handoff information. This can be
82           used to pass information like the size of SDRAM from SPL to U-Boot
83           proper. Also SPL can receive information from TPL in the same place
84           if that is enabled.
85
86 config SPL_LDSCRIPT
87         string "Linker script for the SPL stage"
88         default "arch/$(ARCH)/cpu/u-boot-spl.lds"
89         help
90           The SPL stage will usually require a different linker-script
91           (as it runs from a different memory region) than the regular
92           U-Boot stage.  Set this to the path of the linker-script to
93           be used for SPL.
94
95 config SPL_TEXT_BASE
96         hex "SPL Text Base"
97         default ISW_ENTRY_ADDR if AM43XX || AM33XX || OMAP54XX || ARCH_KEYSTONE
98         default 0x0
99         help
100           The address in memory that SPL will be running from.
101
102 config SPL_BOARD_INIT
103         bool "Call board-specific initialization in SPL"
104         help
105           If this option is enabled, U-Boot will call the function
106           spl_board_init() from board_init_r(). This function should be
107           provided by the board.
108
109 config SPL_BOOTROM_SUPPORT
110         bool "Support returning to the BOOTROM"
111         help
112           Some platforms (e.g. the Rockchip RK3368) provide support in their
113           ROM for loading the next boot-stage after performing basic setup
114           from the SPL stage.
115
116           Enable this option, to return to the BOOTROM through the
117           BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
118           boot device list, if not implemented for a given board)
119
120 config SPL_BOOTCOUNT_LIMIT
121         bool "Support bootcount in SPL"
122         depends on SPL_ENV_SUPPORT
123         help
124           On some boards, which use 'falcon' mode, it is necessary to check
125           and increment the number of boot attempts. Such boards do not
126           use proper U-Boot for normal boot flow and hence needs those
127           adjustments to be done in the SPL.
128
129 config SPL_RAW_IMAGE_SUPPORT
130         bool "Support SPL loading and booting of RAW images"
131         default n if (ARCH_MX6 && (SPL_MMC_SUPPORT || SPL_SATA_SUPPORT))
132         default y if !TI_SECURE_DEVICE
133         help
134           SPL will support loading and booting a RAW image when this option
135           is y. If this is not set, SPL will move on to other available
136           boot media to find a suitable image.
137
138 config SPL_LEGACY_IMAGE_SUPPORT
139         bool "Support SPL loading and booting of Legacy images"
140         default y if !TI_SECURE_DEVICE
141         help
142           SPL will support loading and booting Legacy images when this option
143           is y. If this is not set, SPL will move on to other available
144           boot media to find a suitable image.
145
146 config SPL_LEGACY_IMAGE_CRC_CHECK
147         bool "Check CRC of Legacy images"
148         depends on SPL_LEGACY_IMAGE_SUPPORT
149         select SPL_CRC32_SUPPORT
150         help
151           Enable this to check the CRC of Legacy images. While this increases
152           reliability, it affects both code size and boot duration.
153           If disabled, Legacy images are booted if the image magic and size
154           are correct, without further integrity checks.
155
156 config SPL_SYS_MALLOC_SIMPLE
157         bool
158         prompt "Only use malloc_simple functions in the SPL"
159         help
160           Say Y here to only use the *_simple malloc functions from
161           malloc_simple.c, rather then using the versions from dlmalloc.c;
162           this will make the SPL binary smaller at the cost of more heap
163           usage as the *_simple malloc functions do not re-use free-ed mem.
164
165 config TPL_SYS_MALLOC_SIMPLE
166         bool
167         prompt "Only use malloc_simple functions in the TPL"
168         help
169           Say Y here to only use the *_simple malloc functions from
170           malloc_simple.c, rather then using the versions from dlmalloc.c;
171           this will make the TPL binary smaller at the cost of more heap
172           usage as the *_simple malloc functions do not re-use free-ed mem.
173
174 config SPL_STACK_R
175         bool "Enable SDRAM location for SPL stack"
176         help
177           SPL starts off execution in SRAM and thus typically has only a small
178           stack available. Since SPL sets up DRAM while in its board_init_f()
179           function, it is possible for the stack to move there before
180           board_init_r() is reached. This option enables a special SDRAM
181           location for the SPL stack. U-Boot SPL switches to this after
182           board_init_f() completes, and before board_init_r() starts.
183
184 config SPL_STACK_R_ADDR
185         depends on SPL_STACK_R
186         hex "SDRAM location for SPL stack"
187         default 0x82000000 if ARCH_OMAP2PLUS
188         help
189           Specify the address in SDRAM for the SPL stack. This will be set up
190           before board_init_r() is called.
191
192 config SPL_STACK_R_MALLOC_SIMPLE_LEN
193         depends on SPL_STACK_R && SPL_SYS_MALLOC_SIMPLE
194         hex "Size of malloc_simple heap after switching to DRAM SPL stack"
195         default 0x100000
196         help
197           Specify the amount of the stack to use as memory pool for
198           malloc_simple after switching the stack to DRAM. This may be set
199           to give board_init_r() a larger heap then the initial heap in
200           SRAM which is limited to SYS_MALLOC_F_LEN bytes.
201
202 config SPL_SEPARATE_BSS
203         bool "BSS section is in a different memory region from text"
204         help
205           Some platforms need a large BSS region in SPL and can provide this
206           because RAM is already set up. In this case BSS can be moved to RAM.
207           This option should then be enabled so that the correct device tree
208           location is used. Normally we put the device tree at the end of BSS
209           but with this option enabled, it goes at _image_binary_end.
210
211 config SPL_BANNER_PRINT
212         bool "Enable output of the SPL banner 'U-Boot SPL ...'"
213         default y
214         help
215           If this option is enabled, SPL will print the banner with version
216           info. Disabling this option could be useful to reduce TPL boot time
217           (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
218
219 config TPL_BANNER_PRINT
220         bool "Enable output of the TPL banner 'U-Boot TPL ...'"
221         default y
222         help
223           If this option is enabled, SPL will not print the banner with version
224           info. Disabling this option could be useful to reduce SPL boot time
225           (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
226
227 config SPL_DISPLAY_PRINT
228         bool "Display a board-specific message in SPL"
229         help
230           If this option is enabled, U-Boot will call the function
231           spl_display_print() immediately after displaying the SPL console
232           banner ("U-Boot SPL ..."). This function should be provided by
233           the board.
234
235 config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
236         bool "MMC raw mode: by sector"
237         default y if ARCH_SUNXI || ARCH_DAVINCI || ARCH_UNIPHIER || \
238                      ARCH_MX6 || ARCH_MX7 || \
239                      ARCH_ROCKCHIP || ARCH_MVEBU ||  ARCH_SOCFPGA || \
240                      ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
241                      OMAP44XX || OMAP54XX || AM33XX || AM43XX
242         help
243           Use sector number for specifying U-Boot location on MMC/SD in
244           raw mode.
245
246 config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
247         hex "Address on the MMC to load U-Boot from"
248         depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
249         default 0x50 if ARCH_SUNXI
250         default 0x75 if ARCH_DAVINCI
251         default 0x8a if ARCH_MX6 || ARCH_MX7
252         default 0x100 if ARCH_UNIPHIER
253         default 0x140 if ARCH_MVEBU
254         default 0x200 if ARCH_SOCFPGA || ARCH_AT91
255         default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \
256                          OMAP54XX || AM33XX || AM43XX || ARCH_K3
257         default 0x4000 if ARCH_ROCKCHIP
258         help
259           Address on the MMC to load U-Boot from, when the MMC is being used
260           in raw mode. Units: MMC sectors (1 sector = 512 bytes).
261
262 config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
263         bool "MMC Raw mode: by partition"
264         help
265           Use a partition for loading U-Boot when using MMC/SD in raw mode.
266
267 config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
268         hex "Partition to use to load U-Boot from"
269         depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
270         default 1
271         help
272           Partition on the MMC to load U-Boot from when the MMC is being
273           used in raw mode
274
275 config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
276         bool "MMC raw mode: by partition type"
277         depends on DOS_PARTITION && SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
278         help
279           Use partition type for specifying U-Boot partition on MMC/SD in
280           raw mode. U-Boot will be loaded from the first partition of this
281           type to be found.
282
283 config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE
284         hex "Partition Type on the MMC to load U-Boot from"
285         depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
286         help
287           Partition Type on the MMC to load U-Boot from, when the MMC is being
288           used in raw mode.
289
290 config SPL_CRC32_SUPPORT
291         bool "Support CRC32"
292         default y if SPL_LEGACY_IMAGE_SUPPORT
293         help
294           Enable this to support CRC32 in uImages or FIT images within SPL.
295           This is a 32-bit checksum value that can be used to verify images.
296           For FIT images, this is the least secure type of checksum, suitable
297           for detected accidental image corruption. For secure applications you
298           should consider SHA1 or SHA256.
299
300 config SPL_MD5_SUPPORT
301         bool "Support MD5"
302         depends on SPL_FIT
303         help
304           Enable this to support MD5 in FIT images within SPL. An MD5
305           checksum is a 128-bit hash value used to check that the image
306           contents have not been corrupted. Note that MD5 is not considered
307           secure as it is possible (with a brute-force attack) to adjust the
308           image while still retaining the same MD5 hash value. For secure
309           applications where images may be changed maliciously, you should
310           consider SHA1 or SHA256.
311
312 config SPL_SHA1_SUPPORT
313         bool "Support SHA1"
314         depends on SPL_FIT
315         select SHA1
316         help
317           Enable this to support SHA1 in FIT images within SPL. A SHA1
318           checksum is a 160-bit (20-byte) hash value used to check that the
319           image contents have not been corrupted or maliciously altered.
320           While SHA1 is fairly secure it is coming to the end of its life
321           due to the expanding computing power available to brute-force
322           attacks. For more security, consider SHA256.
323
324 config SPL_SHA256_SUPPORT
325         bool "Support SHA256"
326         depends on SPL_FIT
327         select SHA256
328         help
329           Enable this to support SHA256 in FIT images within SPL. A SHA256
330           checksum is a 256-bit (32-byte) hash value used to check that the
331           image contents have not been corrupted. SHA256 is recommended for
332           use in secure applications since (as at 2016) there is no known
333           feasible attack that could produce a 'collision' with differing
334           input data. Use this for the highest security. Note that only the
335           SHA256 variant is supported: SHA512 and others are not currently
336           supported in U-Boot.
337
338 config SPL_FIT_IMAGE_TINY
339         bool "Remove functionality from SPL FIT loading to reduce size"
340         depends on SPL_FIT
341         default y if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN50I_H6
342         default y if ARCH_IMX8M
343         help
344           Enable this to reduce the size of the FIT image loading code
345           in SPL, if space for the SPL binary is very tight.
346
347           This removes the detection of image types (which forces the
348           first image to be treated as having a U-Boot style calling
349           convention) and skips the recording of each loaded payload
350           (i.e. loadable) into the FDT (modifying the loaded FDT to
351           ensure this information is available to the next image
352           invoked).
353
354 config SPL_CPU_SUPPORT
355         bool "Support CPU drivers"
356         help
357           Enable this to support CPU drivers in SPL. These drivers can set
358           up CPUs and provide information about them such as the model and
359           name. This can be useful in SPL since setting up the CPUs earlier
360           may improve boot performance. Enable this option to build the
361           drivers in drivers/cpu as part of an SPL build.
362
363 config SPL_CRYPTO_SUPPORT
364         bool "Support crypto drivers"
365         help
366           Enable crypto drivers in SPL. These drivers can be used to
367           accelerate secure boot processing in secure applications. Enable
368           this option to build the drivers in drivers/crypto as part of an
369           SPL build.
370
371 config SPL_HASH_SUPPORT
372         bool "Support hashing drivers"
373         select SHA1
374         select SHA256
375         help
376           Enable hashing drivers in SPL. These drivers can be used to
377           accelerate secure boot processing in secure applications. Enable
378           this option to build system-specific drivers for hash acceleration
379           as part of an SPL build.
380
381 config TPL_HASH_SUPPORT
382         bool "Support hashing drivers in TPL"
383         select SHA1
384         select SHA256
385         help
386           Enable hashing drivers in SPL. These drivers can be used to
387           accelerate secure boot processing in secure applications. Enable
388           this option to build system-specific drivers for hash acceleration
389           as part of an SPL build.
390
391 config SPL_DMA_SUPPORT
392         bool "Support DMA drivers"
393         help
394           Enable DMA (direct-memory-access) drivers in SPL. These drivers
395           can be used to handle memory-to-peripheral data transfer without
396           the CPU moving the data. Enable this option to build the drivers
397           in drivers/dma as part of an SPL build.
398
399 config SPL_DRIVERS_MISC_SUPPORT
400         bool "Support misc drivers"
401         help
402           Enable miscellaneous drivers in SPL. These drivers perform various
403           tasks that don't fall nicely into other categories, Enable this
404           option to build the drivers in drivers/misc as part of an SPL
405           build, for those that support building in SPL (not all drivers do).
406
407 config SPL_ENV_SUPPORT
408         bool "Support an environment"
409         help
410           Enable environment support in SPL. The U-Boot environment provides
411           a number of settings (essentially name/value pairs) which can
412           control many aspects of U-Boot's operation. Normally this is not
413           needed in SPL as it has a much simpler task with less
414           configuration. But some boards use this to support 'Falcon' boot
415           on EXT2 and FAT, where SPL boots directly into Linux without
416           starting U-Boot first. Enabling this option will make env_get()
417           and env_set() available in SPL.
418
419 config SPL_SAVEENV
420         bool "Support save environment"
421         depends on SPL_ENV_SUPPORT
422         select SPL_MMC_WRITE if ENV_IS_IN_MMC
423         help
424           Enable save environment support in SPL after setenv. By default
425           the saveenv option is not provided in SPL, but some boards need
426           this support in 'Falcon' boot, where SPL need to boot from
427           different images based on environment variable set by OS. For
428           example OS may set "reboot_image" environment variable to
429           "recovery" inorder to boot recovery image by SPL. The SPL read
430           "reboot_image" and act accordingly and change the reboot_image
431           to default mode using setenv and save the environment.
432
433 config SPL_ETH_SUPPORT
434         bool "Support Ethernet"
435         depends on SPL_ENV_SUPPORT
436         help
437           Enable access to the network subsystem and associated Ethernet
438           drivers in SPL. This permits SPL to load U-Boot over an Ethernet
439           link rather than from an on-board peripheral. Environment support
440           is required since the network stack uses a number of environment
441           variables. See also SPL_NET_SUPPORT.
442
443 config SPL_FS_EXT4
444         bool "Support EXT filesystems"
445         help
446           Enable support for EXT2/3/4 filesystems with SPL. This permits
447           U-Boot (or Linux in Falcon mode) to be loaded from an EXT
448           filesystem from within SPL. Support for the underlying block
449           device (e.g. MMC or USB) must be enabled separately.
450
451 config SPL_FS_FAT
452         bool "Support FAT filesystems"
453         select FS_FAT
454         help
455           Enable support for FAT and VFAT filesystems with SPL. This
456           permits U-Boot (or Linux in Falcon mode) to be loaded from a FAT
457           filesystem from within SPL. Support for the underlying block
458           device (e.g. MMC or USB) must be enabled separately.
459
460 config SPL_FAT_WRITE
461         bool "Support write for FAT filesystems"
462         help
463           Enable write support for FAT and VFAT filesystems with SPL.
464           Support for the underlying block device (e.g. MMC or USB) must be
465           enabled separately.
466
467 config SPL_FPGA_SUPPORT
468         bool "Support FPGAs"
469         help
470           Enable support for FPGAs in SPL. Field-programmable Gate Arrays
471           provide software-configurable hardware which is typically used to
472           implement peripherals (such as UARTs, LCD displays, MMC) or
473           accelerate custom processing functions, such as image processing
474           or machine learning. Sometimes it is useful to program the FPGA
475           as early as possible during boot, and this option can enable that
476           within SPL.
477
478 config SPL_GPIO_SUPPORT
479         bool "Support GPIO in SPL"
480         help
481           Enable support for GPIOs (General-purpose Input/Output) in SPL.
482           GPIOs allow U-Boot to read the state of an input line (high or
483           low) and set the state of an output line. This can be used to
484           drive LEDs, control power to various system parts and read user
485           input. GPIOs can be useful in SPL to enable a 'sign-of-life' LED,
486           for example. Enable this option to build the drivers in
487           drivers/gpio as part of an SPL build.
488
489 config SPL_I2C_SUPPORT
490         bool "Support I2C"
491         help
492           Enable support for the I2C (Inter-Integrated Circuit) bus in SPL.
493           I2C works with a clock and data line which can be driven by a
494           one or more masters or slaves. It is a fairly complex bus but is
495           widely used as it only needs two lines for communication. Speeds of
496           400kbps are typical but up to 3.4Mbps is supported by some
497           hardware. I2C can be useful in SPL to configure power management
498           ICs (PMICs) before raising the CPU clock speed, for example.
499           Enable this option to build the drivers in drivers/i2c as part of
500           an SPL build.
501
502 config SPL_LIBCOMMON_SUPPORT
503         bool "Support common libraries"
504         help
505           Enable support for common U-Boot libraries within SPL. These
506           libraries include common code to deal with U-Boot images,
507           environment and USB, for example. This option is enabled on many
508           boards. Enable this option to build the code in common/ as part of
509           an SPL build.
510
511 config SPL_LIBDISK_SUPPORT
512         bool "Support disk partitions"
513         select PARTITIONS
514         help
515           Enable support for disk partitions within SPL. 'Disk' is something
516           of a misnomer as it includes non-spinning media such as flash (as
517           used in MMC and USB sticks). Partitions provide a way for a disk
518           to be split up into separate regions, with a partition table placed
519           at the start or end which describes the location and size of each
520           'partition'. These partitions are typically uses as individual block
521           devices, typically with an EXT2 or FAT filesystem in each. This
522           option enables whatever partition support has been enabled in
523           U-Boot to also be used in SPL. It brings in the code in disk/.
524
525 config SPL_LIBGENERIC_SUPPORT
526         bool "Support generic libraries"
527         help
528           Enable support for generic U-Boot libraries within SPL. These
529           libraries include generic code to deal with device tree, hashing,
530           printf(), compression and the like. This option is enabled on many
531           boards. Enable this option to build the code in lib/ as part of an
532           SPL build.
533
534 config SPL_DM_MAILBOX
535         bool "Support Mailbox"
536         help
537           Enable support for Mailbox within SPL. This enable the inter
538           processor communication protocols tobe used within SPL. Enable
539           this option to build the drivers in drivers/mailbox as part of
540           SPL build.
541
542 config SPL_MMC_SUPPORT
543         bool "Support MMC"
544         depends on MMC
545         select HAVE_BLOCK_DEVICE
546         help
547           Enable support for MMC (Multimedia Card) within SPL. This enables
548           the MMC protocol implementation and allows any enabled drivers to
549           be used within SPL. MMC can be used with or without disk partition
550           support depending on the application (SPL_LIBDISK_SUPPORT). Enable
551           this option to build the drivers in drivers/mmc as part of an SPL
552           build.
553
554 config SPL_MMC_WRITE
555         bool "MMC/SD/SDIO card support for write operations in SPL"
556         depends on SPL_MMC_SUPPORT
557         default n
558         help
559           Enable write access to MMC and SD Cards in SPL
560
561
562 config SPL_MPC8XXX_INIT_DDR_SUPPORT
563         bool "Support MPC8XXX DDR init"
564         help
565           Enable support for DDR-SDRAM (double-data-rate synchronous dynamic
566           random-access memory) on the MPC8XXX family within SPL. This
567           allows DRAM to be set up before loading U-Boot into that DRAM,
568           where it can run.
569
570 config SPL_MTD_SUPPORT
571         bool "Support MTD drivers"
572         help
573           Enable support for MTD (Memory Technology Device) within SPL. MTD
574           provides a block interface over raw NAND and can also be used with
575           SPI flash. This allows SPL to load U-Boot from supported MTD
576           devices. See SPL_NAND_SUPPORT and SPL_ONENAND_SUPPORT for how
577           to enable specific MTD drivers.
578
579 config SPL_MUSB_NEW_SUPPORT
580         bool "Support new Mentor Graphics USB"
581         help
582           Enable support for Mentor Graphics USB in SPL. This is a new
583           driver used by some boards. Enable this option to build
584           the drivers in drivers/usb/musb-new as part of an SPL build. The
585           old drivers are in drivers/usb/musb.
586
587 config SPL_NAND_SUPPORT
588         bool "Support NAND flash"
589         help
590           Enable support for NAND (Negative AND) flash in SPL. NAND flash
591           can be used to allow SPL to load U-Boot from supported devices.
592           This enables the drivers in drivers/mtd/nand/raw as part of an SPL
593           build.
594
595 config SPL_NET_SUPPORT
596         bool "Support networking"
597         help
598           Enable support for network devices (such as Ethernet) in SPL.
599           This permits SPL to load U-Boot over a network link rather than
600           from an on-board peripheral. Environment support is required since
601           the network stack uses a number of environment variables. See also
602           SPL_ETH_SUPPORT.
603
604 if SPL_NET_SUPPORT
605 config SPL_NET_VCI_STRING
606         string "BOOTP Vendor Class Identifier string sent by SPL"
607         help
608           As defined by RFC 2132 the vendor class identifier field can be
609           sent by the client to identify the vendor type and configuration
610           of a client.  This is often used in practice to allow for the DHCP
611           server to specify different files to load depending on if the ROM,
612           SPL or U-Boot itself makes the request
613 endif   # if SPL_NET_SUPPORT
614
615 config SPL_NO_CPU_SUPPORT
616         bool "Drop CPU code in SPL"
617         help
618           This is specific to the ARM926EJ-S CPU. It disables the standard
619           start.S start-up code, presumably so that a replacement can be
620           used on that CPU. You should not enable it unless you know what
621           you are doing.
622
623 config SPL_NOR_SUPPORT
624         bool "Support NOR flash"
625         help
626           Enable support for loading U-Boot from memory-mapped NOR (Negative
627           OR) flash in SPL. NOR flash is slow to write but fast to read, and
628           a memory-mapped device makes it very easy to access. Loading from
629           NOR is typically achieved with just a memcpy().
630
631 config SPL_XIP_SUPPORT
632         bool "Support XIP"
633         depends on SPL
634         help
635           Enable support for execute in place of U-Boot or kernel image. There
636           is no need to copy image from flash to ram if flash supports execute
637           in place. Its very useful in systems having enough flash but not
638           enough ram to load the image.
639
640 config SPL_ONENAND_SUPPORT
641         bool "Support OneNAND flash"
642         help
643           Enable support for OneNAND (Negative AND) flash in SPL. OneNAND is
644           a type of NAND flash and therefore can be used to allow SPL to
645           load U-Boot from supported devices. This enables the drivers in
646           drivers/mtd/onenand as part of an SPL build.
647
648 config SPL_OS_BOOT
649         bool "Activate Falcon Mode"
650         depends on !TI_SECURE_DEVICE
651         default n
652         help
653           Enable booting directly to an OS from SPL.
654           for more info read doc/README.falcon
655
656 if SPL_OS_BOOT
657 config SYS_OS_BASE
658         hex "addr, where OS is found"
659         depends on SPL_NOR_SUPPORT
660         help
661           Specify the address, where the OS image is found, which
662           gets booted.
663
664 endif # SPL_OS_BOOT
665
666 config SPL_PAYLOAD
667         string "SPL payload"
668         default "tpl/u-boot-with-tpl.bin" if TPL
669         default "u-boot.bin"
670         help
671           Payload for SPL boot. For backward compatibility, default to
672           u-boot.bin, i.e. RAW image without any header. In case of
673           TPL, tpl/u-boot-with-tpl.bin. For new boards, suggest to
674           use u-boot.img.
675
676 config SPL_PCI
677         bool "Support PCI drivers"
678         help
679           Enable support for PCI in SPL. For platforms that need PCI to boot,
680           or must perform some init using PCI in SPL, this provides the
681           necessary driver support. This enables the drivers in drivers/pci
682           as part of an SPL build.
683
684 config SPL_PCH_SUPPORT
685         bool "Support PCH drivers"
686         help
687           Enable support for PCH (Platform Controller Hub) devices in SPL.
688           These are used to set up GPIOs and the SPI peripheral early in
689           boot. This enables the drivers in drivers/pch as part of an SPL
690           build.
691
692 config SPL_POST_MEM_SUPPORT
693         bool "Support POST drivers"
694         help
695           Enable support for POST (Power-on Self Test) in SPL. POST is a
696           procedure that checks that the hardware (CPU or board) appears to
697           be functionally correctly. It is a sanity check that can be
698           performed before booting. This enables the drivers in post/drivers
699           as part of an SPL build.
700
701 config SPL_DM_RESET
702         bool "Support reset drivers"
703         depends on SPL
704         help
705           Enable support for reset control in SPL.
706           That can be useful in SPL to handle IP reset in driver, as in U-Boot,
707           by using the generic reset API provided by driver model.
708           This enables the drivers in drivers/reset as part of an SPL build.
709
710 config SPL_POWER_SUPPORT
711         bool "Support power drivers"
712         help
713           Enable support for power control in SPL. This includes support
714           for PMICs (Power-management Integrated Circuits) and some of the
715           features provided by PMICs. In particular, voltage regulators can
716           be used to enable/disable power and vary its voltage. That can be
717           useful in SPL to turn on boot peripherals and adjust CPU voltage
718           so that the clock speed can be increased. This enables the drivers
719           in drivers/power, drivers/power/pmic and drivers/power/regulator
720           as part of an SPL build.
721
722 config SPL_POWER_DOMAIN
723         bool "Support power domain drivers"
724         help
725           Enable support for power domain control in SPL. Many SoCs allow
726           power to be applied to or removed from portions of the SoC (power
727           domains). This may be used to save power. This API provides the
728           means to control such power management hardware. This enables
729           the drivers in drivers/power/domain as part of a SPL build.
730
731 config SPL_RAM_SUPPORT
732         bool "Support booting from RAM"
733         default y if MICROBLAZE || ARCH_SOCFPGA || TEGRA || ARCH_ZYNQ
734         help
735           Enable booting of an image in RAM. The image can be preloaded or
736           it can be loaded by SPL directly into RAM (e.g. using USB).
737
738 config SPL_RAM_DEVICE
739         bool "Support booting from preloaded image in RAM"
740         depends on SPL_RAM_SUPPORT
741         default y if MICROBLAZE || ARCH_SOCFPGA || TEGRA || ARCH_ZYNQ
742         help
743           Enable booting of an image already loaded in RAM. The image has to
744           be already in memory when SPL takes over, e.g. loaded by the boot
745           ROM.
746
747 config SPL_REMOTEPROC
748         bool "Support REMOTEPROCS"
749         help
750           Enable support for REMOTEPROCs in SPL. This permits to load
751           a remote processor firmware in SPL.
752
753 config SPL_RTC_SUPPORT
754         bool "Support RTC drivers"
755         help
756           Enable RTC (Real-time Clock) support in SPL. This includes support
757           for reading and setting the time. Some RTC devices also have some
758           non-volatile (battery-backed) memory which is accessible if
759           needed. This enables the drivers in drivers/rtc as part of an SPL
760           build.
761
762 config SPL_SATA_SUPPORT
763         bool "Support loading from SATA"
764         help
765           Enable support for SATA (Serial AT attachment) in SPL. This allows
766           use of SATA devices such as hard drives and flash drivers for
767           loading U-Boot. SATA is used in higher-end embedded systems and
768           can provide higher performance than MMC , at somewhat higher
769           expense and power consumption. This enables loading from SATA
770           using a configured device.
771
772 config SPL_SERIAL_SUPPORT
773         bool "Support serial"
774         select SPL_PRINTF
775         select SPL_STRTO
776         help
777           Enable support for serial in SPL. This allows use of a serial UART
778           for displaying messages while SPL is running. It also brings in
779           printf() and panic() functions. This should normally be enabled
780           unless there are space reasons not to. Even then, consider
781           enabling USE_TINY_PRINTF which is a small printf() version.
782
783 config SPL_SPI_FLASH_SUPPORT
784         bool "Support SPI flash drivers"
785         help
786           Enable support for using SPI flash in SPL, and loading U-Boot from
787           SPI flash. SPI flash (Serial Peripheral Bus flash) is named after
788           the SPI bus that is used to connect it to a system. It is a simple
789           but fast bidirectional 4-wire bus (clock, chip select and two data
790           lines). This enables the drivers in drivers/mtd/spi as part of an
791           SPL build. This normally requires SPL_SPI_SUPPORT.
792
793 if SPL_SPI_FLASH_SUPPORT
794
795 config SPL_SPI_FLASH_TINY
796         bool "Enable low footprint SPL SPI Flash support"
797         depends on !SPI_FLASH_BAR
798         default y if SPI_FLASH
799         help
800          Enable lightweight SPL SPI Flash support that supports just reading
801          data/images from flash. No support to write/erase flash. Enable
802          this if you have SPL size limitations and don't need full
803          fledged SPI flash support.
804
805 config SPL_SPI_FLASH_SFDP_SUPPORT
806         bool "SFDP table parsing support for SPI NOR flashes"
807         depends on !SPI_FLASH_BAR && !SPL_SPI_FLASH_TINY
808         help
809          Enable support for parsing and auto discovery of parameters for
810          SPI NOR flashes using Serial Flash Discoverable Parameters (SFDP)
811          tables as per JESD216 standard in SPL.
812
813 config SPL_SPI_LOAD
814         bool "Support loading from SPI flash"
815         help
816           Enable support for loading next stage, U-Boot or otherwise, from
817           SPI NOR in U-Boot SPL.
818
819 endif # SPL_SPI_FLASH_SUPPORT
820
821 config SPL_SPI_SUPPORT
822         bool "Support SPI drivers"
823         help
824           Enable support for using SPI in SPL. This is used for connecting
825           to SPI flash for loading U-Boot. See SPL_SPI_FLASH_SUPPORT for
826           more details on that. The SPI driver provides the transport for
827           data between the SPI flash and the CPU. This option can be used to
828           enable SPI drivers that are needed for other purposes also, such
829           as a SPI PMIC.
830
831 config SPL_THERMAL
832         bool "Driver support for thermal devices"
833         help
834           Enable support for temperature-sensing devices. Some SoCs have on-chip
835           temperature sensors to permit warnings, speed throttling or even
836           automatic power-off when the temperature gets too high or low. Other
837           devices may be discrete but connected on a suitable bus.
838
839 config SPL_USB_HOST_SUPPORT
840         bool "Support USB host drivers"
841         select HAVE_BLOCK_DEVICE
842         help
843           Enable access to USB (Universal Serial Bus) host devices so that
844           SPL can load U-Boot from a connected USB peripheral, such as a USB
845           flash stick. While USB takes a little longer to start up than most
846           buses, it is very flexible since many different types of storage
847           device can be attached. This option enables the drivers in
848           drivers/usb/host as part of an SPL build.
849
850 config SPL_USB_STORAGE
851         bool "Support loading from USB"
852         depends on SPL_USB_HOST_SUPPORT && !(BLK && !DM_USB)
853         help
854           Enable support for USB devices in SPL. This allows use of USB
855           devices such as hard drives and flash drivers for loading U-Boot.
856           The actual drivers are enabled separately using the normal U-Boot
857           config options. This enables loading from USB using a configured
858           device.
859
860 config SPL_USB_GADGET
861         bool "Suppport USB Gadget drivers"
862         help
863           Enable USB Gadget API which allows to enable USB device functions
864           in SPL.
865
866 if SPL_USB_GADGET
867
868 config SPL_USB_ETHER
869         bool "Support USB Ethernet drivers"
870         help
871           Enable access to the USB network subsystem and associated
872           drivers in SPL. This permits SPL to load U-Boot over a
873           USB-connected Ethernet link (such as a USB Ethernet dongle) rather
874           than from an onboard peripheral. Environment support is required
875           since the network stack uses a number of environment variables.
876           See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT.
877
878 config SPL_DFU
879         bool "Support DFU (Device Firmware Upgrade)"
880         select SPL_HASH_SUPPORT
881         select SPL_DFU_NO_RESET
882         depends on SPL_RAM_SUPPORT
883         help
884           This feature enables the DFU (Device Firmware Upgrade) in SPL with
885           RAM memory device support. The ROM code will load and execute
886           the SPL built with dfu. The user can load binaries (u-boot/kernel) to
887           selected device partition from host-pc using dfu-utils.
888           This feature is useful to flash the binaries to factory or bare-metal
889           boards using USB interface.
890
891 choice
892         bool "DFU device selection"
893         depends on SPL_DFU
894
895 config SPL_DFU_RAM
896         bool "RAM device"
897         depends on SPL_DFU && SPL_RAM_SUPPORT
898         help
899          select RAM/DDR memory device for loading binary images
900          (u-boot/kernel) to the selected device partition using
901          DFU and execute the u-boot/kernel from RAM.
902
903 endchoice
904
905 config SPL_USB_SDP_SUPPORT
906         bool "Support SDP (Serial Download Protocol)"
907         help
908           Enable Serial Download Protocol (SDP) device support in SPL. This
909           allows to download images into memory and execute (jump to) them
910           using the same protocol as implemented by the i.MX family's boot ROM.
911 endif
912
913 config SPL_WATCHDOG_SUPPORT
914         bool "Support watchdog drivers"
915         help
916           Enable support for watchdog drivers in SPL. A watchdog is
917           typically a hardware peripheral which can reset the system when it
918           detects no activity for a while (such as a software crash). This
919           enables the drivers in drivers/watchdog as part of an SPL build.
920
921 config SPL_YMODEM_SUPPORT
922         bool "Support loading using Ymodem"
923         depends on SPL_SERIAL_SUPPORT
924         help
925           While loading from serial is slow it can be a useful backup when
926           there is no other option. The Ymodem protocol provides a reliable
927           means of transmitting U-Boot over a serial line for using in SPL,
928           with a checksum to ensure correctness.
929
930 config SPL_ATF
931         bool "Support ARM Trusted Firmware"
932         depends on ARM64
933         help
934           ATF(ARM Trusted Firmware) is a component for ARM AArch64 which
935           is loaded by SPL (which is considered as BL2 in ATF terminology).
936           More detail at: https://github.com/ARM-software/arm-trusted-firmware
937
938 config SPL_ATF_NO_PLATFORM_PARAM
939         bool "Pass no platform parameter"
940         depends on SPL_ATF
941         help
942           While we expect to call a pointer to a valid FDT (or NULL)
943           as the platform parameter to an ATF, some ATF versions are
944           not U-Boot aware and have an insufficiently robust parameter
945           validation to gracefully reject a FDT being passed.
946
947           If this option is enabled, the spl_atf os-type handler will
948           always pass NULL for the platform parameter.
949
950           If your ATF is affected, say Y.
951
952 config SPL_AM33XX_ENABLE_RTC32K_OSC
953         bool "Enable the RTC32K OSC on AM33xx based platforms"
954         default y if AM33XX
955         help
956           Enable access to the AM33xx RTC and select the external 32kHz clock
957           source.
958
959 config SPL_OPTEE
960         bool "Support OP-TEE Trusted OS"
961         depends on ARM
962         help
963           OP-TEE is an open source Trusted OS  which is loaded by SPL.
964           More detail at: https://github.com/OP-TEE/optee_os
965
966 config TPL
967         bool
968         depends on SUPPORT_TPL
969         prompt "Enable TPL"
970         help
971           If you want to build TPL as well as the normal image and SPL, say Y.
972
973 if TPL
974
975 config TPL_HANDOFF
976         bool "Pass hand-off information from TPL to SPL and U-Boot proper"
977         depends on HANDOFF
978         default y
979         help
980           This option enables TPL to write handoff information. This can be
981           used to pass information like the size of SDRAM from TPL to U-Boot
982           proper. The information is also available to SPL if it is useful
983           there.
984
985 config TPL_BOARD_INIT
986         bool "Call board-specific initialization in TPL"
987         help
988           If this option is enabled, U-Boot will call the function
989           spl_board_init() from board_init_r(). This function should be
990           provided by the board.
991
992 config TPL_LDSCRIPT
993         string "Linker script for the TPL stage"
994         depends on TPL
995         default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
996         default "arch/$(ARCH)/cpu/u-boot-spl.lds"
997         help
998           The TPL stage will usually require a different linker-script
999           (as it runs from a different memory region) than the regular
1000           U-Boot stage.  Set this to the path of the linker-script to
1001           be used for TPL.
1002
1003           May be left empty to trigger the Makefile infrastructure to
1004           fall back to the linker-script used for the SPL stage.
1005
1006 config TPL_NEEDS_SEPARATE_TEXT_BASE
1007         bool "TPL needs a separate text-base"
1008         default n
1009         depends on TPL
1010         help
1011           Enable, if the TPL stage should not inherit its text-base
1012           from the SPL stage.  When enabled, a base address for the
1013           .text sections of the TPL stage has to be set below.
1014
1015 config TPL_NEEDS_SEPARATE_STACK
1016         bool "TPL needs a separate initial stack-pointer"
1017         default n
1018         depends on TPL
1019         help
1020           Enable, if the TPL stage should not inherit its initial
1021           stack-pointer from the settings for the SPL stage.
1022
1023 config TPL_TEXT_BASE
1024         hex "Base address for the .text section of the TPL stage"
1025         depends on TPL_NEEDS_SEPARATE_TEXT_BASE
1026         help
1027           The base address for the .text section of the TPL stage.
1028
1029 config TPL_MAX_SIZE
1030         int "Maximum size (in bytes) for the TPL stage"
1031         default 0
1032         depends on TPL
1033         help
1034           The maximum size (in bytes) of the TPL stage.
1035
1036 config TPL_STACK
1037         hex "Address of the initial stack-pointer for the TPL stage"
1038         depends on TPL_NEEDS_SEPARATE_STACK
1039         help
1040           The address of the initial stack-pointer for the TPL stage.
1041           Usually this will be the (aligned) top-of-stack.
1042
1043 config TPL_BOOTROM_SUPPORT
1044         bool "Support returning to the BOOTROM (from TPL)"
1045         help
1046           Some platforms (e.g. the Rockchip RK3368) provide support in their
1047           ROM for loading the next boot-stage after performing basic setup
1048           from the TPL stage.
1049
1050           Enable this option, to return to the BOOTROM through the
1051           BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
1052           boot device list, if not implemented for a given board)
1053
1054 config TPL_DRIVERS_MISC_SUPPORT
1055         bool "Support misc drivers in TPL"
1056         help
1057           Enable miscellaneous drivers in TPL. These drivers perform various
1058           tasks that don't fall nicely into other categories, Enable this
1059           option to build the drivers in drivers/misc as part of an TPL
1060           build, for those that support building in TPL (not all drivers do).
1061
1062 config TPL_ENV_SUPPORT
1063         bool "Support an environment"
1064         help
1065           Enable environment support in TPL. See SPL_ENV_SUPPORT for details.
1066
1067 config TPL_GPIO_SUPPORT
1068         bool "Support GPIO in TPL"
1069         help
1070           Enable support for GPIOs (General-purpose Input/Output) in TPL.
1071           GPIOs allow U-Boot to read the state of an input line (high or
1072           low) and set the state of an output line. This can be used to
1073           drive LEDs, control power to various system parts and read user
1074           input. GPIOs can be useful in TPL to enable a 'sign-of-life' LED,
1075           for example. Enable this option to build the drivers in
1076           drivers/gpio as part of an TPL build.
1077
1078 config TPL_I2C_SUPPORT
1079         bool "Support I2C"
1080         help
1081           Enable support for the I2C bus in TPL. See SPL_I2C_SUPPORT for
1082           details.
1083
1084 config TPL_LIBCOMMON_SUPPORT
1085         bool "Support common libraries"
1086         help
1087           Enable support for common U-Boot libraries within TPL. See
1088           SPL_LIBCOMMON_SUPPORT for details.
1089
1090 config TPL_LIBGENERIC_SUPPORT
1091         bool "Support generic libraries"
1092         help
1093           Enable support for generic U-Boot libraries within TPL. See
1094           SPL_LIBGENERIC_SUPPORT for details.
1095
1096 config TPL_MPC8XXX_INIT_DDR_SUPPORT
1097         bool "Support MPC8XXX DDR init"
1098         help
1099           Enable support for DDR-SDRAM on the MPC8XXX family within TPL. See
1100           SPL_MPC8XXX_INIT_DDR_SUPPORT for details.
1101
1102 config TPL_MMC_SUPPORT
1103         bool "Support MMC"
1104         depends on MMC
1105         help
1106           Enable support for MMC within TPL. See SPL_MMC_SUPPORT for details.
1107
1108 config TPL_NAND_SUPPORT
1109         bool "Support NAND flash"
1110         help
1111           Enable support for NAND in TPL. See SPL_NAND_SUPPORT for details.
1112
1113 config TPL_PCI
1114         bool "Support PCI drivers"
1115         help
1116           Enable support for PCI in TPL. For platforms that need PCI to boot,
1117           or must perform some init using PCI in SPL, this provides the
1118           necessary driver support. This enables the drivers in drivers/pci
1119           as part of a TPL build.
1120
1121 config TPL_PCH_SUPPORT
1122         bool "Support PCH drivers"
1123         help
1124           Enable support for PCH (Platform Controller Hub) devices in TPL.
1125           These are used to set up GPIOs and the SPI peripheral early in
1126           boot. This enables the drivers in drivers/pch as part of a TPL
1127           build.
1128
1129 config TPL_RAM_SUPPORT
1130         bool "Support booting from RAM"
1131         help
1132           Enable booting of an image in RAM. The image can be preloaded or
1133           it can be loaded by TPL directly into RAM (e.g. using USB).
1134
1135 config TPL_RAM_DEVICE
1136         bool "Support booting from preloaded image in RAM"
1137         depends on TPL_RAM_SUPPORT
1138         help
1139           Enable booting of an image already loaded in RAM. The image has to
1140           be already in memory when TPL takes over, e.g. loaded by the boot
1141           ROM.
1142
1143 config TPL_RTC_SUPPORT
1144         bool "Support RTC drivers"
1145         help
1146           Enable RTC (Real-time Clock) support in TPL. This includes support
1147           for reading and setting the time. Some RTC devices also have some
1148           non-volatile (battery-backed) memory which is accessible if
1149           needed. This enables the drivers in drivers/rtc as part of an TPL
1150           build.
1151
1152 config TPL_SERIAL_SUPPORT
1153         bool "Support serial"
1154         select TPL_PRINTF
1155         select TPL_STRTO
1156         help
1157           Enable support for serial in TPL. See SPL_SERIAL_SUPPORT for
1158           details.
1159
1160 config TPL_SPI_FLASH_SUPPORT
1161         bool "Support SPI flash drivers"
1162         help
1163           Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT
1164           for details.
1165
1166 config TPL_SPI_LOAD
1167         bool "Support loading from SPI flash"
1168         depends on TPL_SPI_FLASH_SUPPORT
1169         help
1170           Enable support for loading next stage, U-Boot or otherwise, from
1171           SPI NOR in U-Boot TPL.
1172
1173 config TPL_SPI_SUPPORT
1174         bool "Support SPI drivers"
1175         help
1176           Enable support for using SPI in TPL. See SPL_SPI_SUPPORT for
1177           details.
1178
1179 config TPL_YMODEM_SUPPORT
1180         bool "Support loading using Ymodem"
1181         depends on TPL_SERIAL_SUPPORT
1182         help
1183           While loading from serial is slow it can be a useful backup when
1184           there is no other option. The Ymodem protocol provides a reliable
1185           means of transmitting U-Boot over a serial line for using in TPL,
1186           with a checksum to ensure correctness.
1187
1188 endif # TPL
1189
1190 endif # SPL
1191 endmenu