summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-07-11 10:18:13 -0400
committerTom Rini <[email protected]>2022-07-11 14:58:57 -0400
commit36b661dc919da318c163a45f4a220d2e3d9db608 (patch)
tree268703050f58280feb3287d48eb0cedc974730e1 /common
parente092e3250270a1016c877da7bdd9384f14b1321e (diff)
parent05a4859637567b13219efd6f1707fb236648b1b7 (diff)
Merge branch 'next'
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig30
-rw-r--r--common/Makefile13
-rw-r--r--common/board_f.c6
-rw-r--r--common/board_r.c22
-rw-r--r--common/event.c17
-rw-r--r--common/init/board_init.c2
-rw-r--r--common/spl/Kconfig890
-rw-r--r--common/spl/Kconfig.nxp124
-rw-r--r--common/spl/Kconfig.tpl335
-rw-r--r--common/spl/Kconfig.vpl226
-rw-r--r--common/spl/spl.c31
-rw-r--r--common/spl/spl_mmc.c2
-rw-r--r--common/spl/spl_nor.c4
-rw-r--r--common/spl/spl_ram.c2
-rw-r--r--common/spl/spl_sata.c24
-rw-r--r--common/spl/spl_spi.c16
-rw-r--r--common/spl/spl_xip.c2
-rw-r--r--common/usb.c4
18 files changed, 1049 insertions, 701 deletions
diff --git a/common/Kconfig b/common/Kconfig
index a96842a5c11..e7914ca750a 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -83,14 +83,17 @@ config LOGLEVEL
config SPL_LOGLEVEL
int
+ depends on SPL
default LOGLEVEL
config TPL_LOGLEVEL
int
+ depends on TPL
default LOGLEVEL
config VPL_LOGLEVEL
int "loglevel for VPL"
+ depends on VPL
default LOGLEVEL
help
All Messages with a loglevel smaller than the console loglevel will
@@ -271,15 +274,6 @@ config LOG
if LOG
-config VPL_LOG
- bool "Enable logging support in VPL"
- depends on LOG
- help
- This enables support for logging of status and debug messages. These
- can be displayed on the console, recorded in a memory buffer, or
- discarded if not needed. Logging supports various categories and
- levels of severity.
-
config LOG_MAX_LEVEL
int "Maximum log level to record"
default 6
@@ -365,7 +359,7 @@ config LOG_SYSLOG
config SPL_LOG
bool "Enable logging support in SPL"
- depends on LOG
+ depends on LOG && SPL
help
This enables support for logging of status and debug messages. These
can be displayed on the console, recorded in a memory buffer, or
@@ -408,7 +402,7 @@ endif
config TPL_LOG
bool "Enable logging support in TPL"
- depends on LOG
+ depends on LOG && TPL
help
This enables support for logging of status and debug messages. These
can be displayed on the console, recorded in a memory buffer, or
@@ -451,7 +445,7 @@ endif
config VPL_LOG
bool "Enable logging support in VPL"
- depends on LOG
+ depends on LOG && VPL
help
This enables support for logging of status and debug messages. These
can be displayed on the console, recorded in a memory buffer, or
@@ -659,6 +653,18 @@ config MISC_INIT_R
help
Enabling this option calls 'misc_init_r' function
+config SYS_MALLOC_BOOTPARAMS
+ bool "Malloc a buffer to use for bootparams"
+ help
+ In some cases rather than using a known location to store the
+ bi_boot_params portion of gd we need to allocate it from our malloc pool.
+
+config SYS_BOOTPARAMS_LEN
+ hex "Size of the bootparam buffer to malloc in bytes"
+ depends on SYS_MALLOC_BOOTPARAMS
+ default 0x20000 if MIPS || RCAR_GEN3
+ default 0x10000
+
config ID_EEPROM
bool "Enable I2C connected system identifier EEPROM"
help
diff --git a/common/Makefile b/common/Makefile
index 75c24e32492..2ed8672c3ac 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -23,10 +23,9 @@ obj-$(CONFIG_MII) += miiphyutil.o
obj-$(CONFIG_CMD_MII) += miiphyutil.o
obj-$(CONFIG_PHYLIB) += miiphyutil.o
-ifdef CONFIG_USB
-obj-y += usb.o usb_hub.o
+obj-$(CONFIG_USB_HOST) += usb.o usb_hub.o
+obj-$(CONFIG_USB_GADGET) += usb.o usb_hub.o
obj-$(CONFIG_USB_STORAGE) += usb_storage.o
-endif
# others
obj-$(CONFIG_CONSOLE_MUX) += iomux.o
@@ -57,13 +56,9 @@ endif
obj-$(CONFIG_SPL_NET) += miiphyutil.o
obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
-ifdef CONFIG_SPL_USB_HOST
-obj-y += usb.o
-obj-y += usb_hub.o
+obj-$(CONFIG_SPL_USB_HOST) += usb.o usb_hub.o
obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
-else
-obj-$(CONFIG_USB_MUSB_HOST) += usb.o
-endif
+obj-$(CONFIG_SPL_MUSB_NEW) += usb.o
endif # CONFIG_SPL_BUILD
#others
diff --git a/common/board_f.c b/common/board_f.c
index 51d2f3c365e..5c86faeb217 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -400,13 +400,9 @@ static int reserve_video(void)
((unsigned long)gd->relocaddr - addr) >> 10, addr);
gd->relocaddr = addr;
#elif defined(CONFIG_LCD)
-# ifdef CONFIG_FB_ADDR
- gd->fb_base = CONFIG_FB_ADDR;
-# else
/* reserve memory for LCD display (always full pages) */
gd->relocaddr = lcd_setmem(gd->relocaddr);
gd->fb_base = gd->relocaddr;
-# endif /* CONFIG_FB_ADDR */
#endif
return 0;
@@ -684,6 +680,8 @@ static int setup_reloc(void)
#ifdef CONFIG_SYS_TEXT_BASE
#ifdef ARM
gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
+#elif defined(CONFIG_MICROBLAZE)
+ gd->reloc_off = gd->relocaddr - (u32)_start;
#elif defined(CONFIG_M68K)
/*
* On all ColdFire arch cpu, monitor code starts always
diff --git a/common/board_r.c b/common/board_r.c
index 6f4aca2077d..ed29069d2de 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -457,7 +457,7 @@ static int initr_env(void)
return 0;
}
-#ifdef CONFIG_SYS_BOOTPARAMS_LEN
+#ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
static int initr_malloc_bootparams(void)
{
gd->bd->bi_boot_params = (ulong)malloc(CONFIG_SYS_BOOTPARAMS_LEN);
@@ -469,18 +469,6 @@ static int initr_malloc_bootparams(void)
}
#endif
-#ifdef CONFIG_CMD_NET
-static int initr_ethaddr(void)
-{
- struct bd_info *bd = gd->bd;
-
- /* kept around for legacy kernels only ... ignore the next section */
- eth_env_get_enetaddr("ethaddr", bd->bi_enetaddr);
-
- return 0;
-}
-#endif /* CONFIG_CMD_NET */
-
#if defined(CONFIG_LED_STATUS)
static int initr_status_led(void)
{
@@ -612,6 +600,9 @@ static init_fnc_t init_sequence_r[] = {
*/
#endif
initr_reloc_global_data,
+#if CONFIG_IS_ENABLED(NEEDS_MANUAL_RELOC) && CONFIG_IS_ENABLED(EVENT)
+ event_manual_reloc,
+#endif
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
initr_unlock_ram_in_cache,
#endif
@@ -713,7 +704,7 @@ static init_fnc_t init_sequence_r[] = {
initr_pvblock,
#endif
initr_env,
-#ifdef CONFIG_SYS_BOOTPARAMS_LEN
+#ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
initr_malloc_bootparams,
#endif
INIT_FUNC_WATCHDOG_RESET
@@ -756,9 +747,6 @@ static init_fnc_t init_sequence_r[] = {
initr_status_led,
#endif
/* PPC has a udelay(20) here dating from 2002. Why? */
-#ifdef CONFIG_CMD_NET
- initr_ethaddr,
-#endif
#if defined(CONFIG_GPIO_HOG)
gpio_hog_probe_all,
#endif
diff --git a/common/event.c b/common/event.c
index 9d67a060a02..af1ed4121d8 100644
--- a/common/event.c
+++ b/common/event.c
@@ -17,6 +17,7 @@
#include <malloc.h>
#include <asm/global_data.h>
#include <linux/list.h>
+#include <relocate.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -148,6 +149,20 @@ void event_show_spy_list(void)
}
}
+#if CONFIG_IS_ENABLED(NEEDS_MANUAL_RELOC)
+int event_manual_reloc(void)
+{
+ struct evspy_info *spy, *end;
+
+ spy = ll_entry_start(struct evspy_info, evspy_info);
+ end = ll_entry_end(struct evspy_info, evspy_info);
+ for (; spy < end; spy++)
+ MANUAL_RELOC(spy->func);
+
+ return 0;
+}
+#endif
+
#if CONFIG_IS_ENABLED(EVENT_DYNAMIC)
static void spy_free(struct event_spy *spy)
{
@@ -159,8 +174,6 @@ int event_register(const char *id, enum event_t type, event_handler_t func, void
struct event_state *state = gd_event_state();
struct event_spy *spy;
- if (!CONFIG_IS_ENABLED(EVENT_DYNAMIC))
- return -ENOSYS;
spy = malloc(sizeof(*spy));
if (!spy)
return log_msg_ret("alloc", -ENOMEM);
diff --git a/common/init/board_init.c b/common/init/board_init.c
index eab5ee13953..6a550261778 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -78,9 +78,11 @@ __weak void board_init_f_init_stack_protection(void)
ulong board_init_f_alloc_reserve(ulong top)
{
/* Reserve early malloc arena */
+#ifndef CONFIG_MALLOC_F_ADDR
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
top -= CONFIG_VAL(SYS_MALLOC_F_LEN);
#endif
+#endif
/* LAST : reserve GD (rounded up to a multiple of 16 bytes) */
top = rounddown(top-sizeof(struct global_data), 16);
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 50ff113cab2..931619c366f 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1,5 +1,3 @@
-menu "SPL / TPL / VPL"
-
config SUPPORT_SPL
bool
@@ -13,15 +11,16 @@ config SPL_DFU_NO_RESET
bool
config SPL
- bool
+ bool "Enable SPL"
depends on SUPPORT_SPL
- prompt "Enable SPL"
help
If you want to build SPL as well as the normal image, say Y.
+menu "SPL configuration options"
+ depends on SPL
+
config SPL_FRAMEWORK
bool "Support SPL based upon the common SPL framework"
- depends on SPL
default y
help
Enable the SPL framework under common/spl/. This framework
@@ -39,7 +38,6 @@ config SPL_FRAMEWORK_BOARD_INIT_F
config SPL_SIZE_LIMIT
hex "Maximum size of SPL image"
- depends on SPL
default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
default 0x0
@@ -75,6 +73,90 @@ config SPL_SIZE_LIMIT_PROVIDE_STACK
of SRAM available for SPL when the stack required before reolcation
uses this SRAM, too.
+config SPL_MAX_SIZE
+ hex "Maximum size of the SPL image, excluding BSS"
+ default 0x30000 if ARCH_MX6 && MX6_OCRAM_256KB
+ default 0x1b000 if AM33XX && !TI_SECURE_DEVICE
+ default 0x10000 if ARCH_MX6 && !MX6_OCRAM_256KB
+ default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x10000
+ default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x20000 && !MACH_SUN50I_H616
+ default 0x7000 if RCAR_GEN3
+ default 0x5fa0 if SUNXI_SRAM_ADDRESS = 0x0
+ default 0x10000 if ASPEED_AST2600
+ default 0x0
+ help
+ Maximum size of the SPL image (text, data, rodata, and linker lists
+ sections), BSS excluded. When defined, the linker checks that the
+ actual size does not exceed it.
+
+config SPL_PAD_TO
+ hex "Offset to which the SPL should be padded before appending the SPL payload"
+ default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
+ default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB)
+ default 0x10000 if ARCH_KEYSTONE
+ default 0x8000 if ARCH_SUNXI && !MACH_SUN50I_H616
+ default TPL_MAX_SIZE if TPL_MAX_SIZE > SPL_MAX_SIZE
+ default SPL_MAX_SIZE
+ help
+ Image offset to which the SPL should be padded before appending the
+ SPL payload. By default, this is defined as CONFIG_SPL_MAX_SIZE, or 0 if
+ CONFIG_SPL_MAX_SIZE is undefined. CONFIG_SPL_PAD_TO must be either
+ 0, meaning to append the SPL payload without any padding, or >=
+ CONFIG_SPL_MAX_SIZE.
+
+config SPL_HAS_BSS_LINKER_SECTION
+ depends on SPL_FRAMEWORK
+ bool "Use a specific address for the BSS via the linker script"
+ default y if ARCH_SUNXI || ARCH_MX6 || ARCH_OMAP2PLUS || MIPS || RISCV
+
+config SPL_BSS_START_ADDR
+ hex "Link address for the BSS within the SPL binary"
+ depends on SPL_HAS_BSS_LINKER_SECTION
+ default 0x88200000 if (ARCH_MX6 && (MX6SX || MX6SL || MX6UL || MX6ULL)) || ARCH_MX7
+ default 0x18200000 if ARCH_MX6 && !(MX6SX || MX6SL || MX6UL || MX6ULL)
+ default 0x80a00000 if ARCH_OMAP2PLUS
+ default 0x81f80000 if ARCH_SUNXI && MACH_SUNIV
+ default 0x4ff80000 if ARCH_SUNXI && !(MACH_SUN9I || MACH_SUNIV)
+ default 0x2ff80000 if ARCH_SUNXI && MACH_SUN9I
+
+choice
+ prompt "Enforce SPL BSS limit"
+ depends on !PPC
+ default SPL_BSS_LIMIT
+ help
+ In some platforms we only want to enforce a limit on the size of the
+ BSS in memory. On other platforms we need to enforce a limit on the
+ whole of the memory allocation as we're strictly limited to a small
+ typically non-DRAM location. Finally, other platforms do not enforce
+ a memory limit within SPL.
+
+config SPL_NO_BSS_LIMIT
+ bool "Do not enforce a build time limit on the size of the BSS"
+
+config SPL_BSS_LIMIT
+ bool "Enforce a limit on the size of the BSS only"
+
+config SPL_FOOTPRINT_LIMIT
+ bool "Enforce a limit on the whole of memory allocated to SPL, BSS included"
+
+endchoice
+
+config SPL_BSS_MAX_SIZE
+ hex "Maximum size in memory allocated to the SPL BSS"
+ depends on SPL_BSS_LIMIT
+ default 0x100000 if ARCH_MX6 || RISCV
+ default 0x80000 if ARCH_OMAP2PLUS || ARCH_SUNXI
+ help
+ When non-zero, the linker checks that the actual memory used by SPL
+ from __bss_start to __bss_end does not exceed it.
+
+config SPL_MAX_FOOTPRINT
+ hex "Maximum size in memory allocated to the SPL, BSS included"
+ depends on SPL_FOOTPRINT_LIMIT
+ help
+ When non-zero, the linker checks that the actual memory used by SPL
+ from _start to __bss_end does not exceed it.
+
config SPL_SYS_STACK_F_CHECK_BYTE
hex
default 0xaa
@@ -109,40 +191,31 @@ config SPL_BINMAN_SYMBOLS
depends on SPL_FRAMEWORK && BINMAN
default y
help
- This enables use of symbols in SPL which refer to U-Boot, enabling SPL
- to obtain the location of U-Boot simply by calling spl_get_image_pos()
- and spl_get_image_size().
-
- For this to work, you must have a U-Boot image in the binman image, so
- binman can update SPL with the location of it.
-
-menu "PowerPC and LayerScape SPL Boot options"
-
-config SPL_NAND_BOOT
- bool "Load SPL from NAND flash"
- depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
-
-config SPL_MMC_BOOT
- bool "Load SPL from SD Card / eMMC"
- depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
+ This enables use of symbols in SPL which refer to other entries in
+ the same binman image as the SPL. These can be declared with the
+ binman_sym_declare(type, entry, prop) macro and accessed by the
+ binman_sym(type, entry, prop) macro defined in binman_sym.h.
-config SPL_SPI_BOOT
- bool "Load SPL from SPI flash"
- depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
+ See tools/binman/binman.rst for a detailed explanation.
-config SPL_FSL_PBL
- bool "Create SPL in Freescale PBI format"
- depends on (PPC || ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A) && \
- SUPPORT_SPL
+config SPL_BINMAN_UBOOT_SYMBOLS
+ bool "Declare binman symbols for U-Boot phases in SPL"
+ depends on SPL_BINMAN_SYMBOLS
+ default n if ARCH_IMX8M
+ default y
help
- Create boot binary having SPL binary in PBI format concatenated with
- u-boot binary.
+ This enables use of symbols in SPL which refer to U-Boot phases,
+ enabling SPL to obtain the location and size of its next phase simply
+ by calling spl_get_image_pos() and spl_get_image_size().
-endmenu
+ For this to work, you must have all U-Boot phases in the same binman
+ image, so binman can update SPL with the locations of everything.
+
+source "common/spl/Kconfig.nxp"
config HANDOFF
bool "Pass hand-off information from SPL to U-Boot proper"
- depends on SPL && BLOBLIST
+ depends on BLOBLIST
help
It is useful to be able to pass information from SPL to U-Boot
proper to preserve state that is known in SPL and is needed in U-Boot.
@@ -150,8 +223,6 @@ config HANDOFF
in boot. It is available in gd->handoff. The state state is set up
in SPL (or TPL if that is being used).
-if SPL
-
config SPL_HANDOFF
bool "Pass hand-off information from SPL to U-Boot proper"
depends on HANDOFF && SPL_BLOBLIST
@@ -164,6 +235,18 @@ config SPL_HANDOFF
config SPL_LDSCRIPT
string "Linker script for the SPL stage"
+ default "arch/arm/cpu/arm926ejs/sunxi/u-boot-spl.lds" if MACH_SUNIV
+ default "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds" if ARCH_SUNXI && !MACH_SUNIV && !ARM64
+ default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
+ default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
+ default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A || ARCH_LS1046A || ARCH_LS2080A
+ default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
+ default "arch/arm/mach-at91/arm926ejs/u-boot-spl.lds" if ARCH_AT91 && CPU_ARM926EJS
+ default "arch/arm/mach-at91/armv7/u-boot-spl.lds" if ARCH_AT91 && CPU_V7A
+ default "arch/arm/mach-omap2/u-boot-spl.lds" if ARCH_MX6 || ARCH_OMAP2PLUS || (ARCH_K3 && !ARM64)
+ default "arch/arm/mach-zynq/u-boot-spl.lds" if ARCH_ZYNQ
+ default "board/samsung/common/exynos-uboot-spl.lds" if ARCH_EXYNOS5 || ARCH_EXYNOS4
+ default "board/davinci/da8xxevm/u-boot-spl-da850evm.lds" if ARCH_DAVINCI
default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
help
The SPL stage will usually require a different linker-script
@@ -189,13 +272,6 @@ config SPL_BOARD_INIT
spl_board_init() from board_init_r(). This function should be
provided by the board.
-config VPL_BOARD_INIT
- bool "Call board-specific initialization in VPL"
- help
- If this option is enabled, U-Boot will call the function
- spl_board_init() from board_init_r(). This function should be
- provided by the board.
-
config SPL_BOOTROM_SUPPORT
bool "Support returning to the BOOTROM"
help
@@ -246,23 +322,33 @@ config SPL_LEGACY_IMAGE_CRC_CHECK
are correct, without further integrity checks.
config SPL_SYS_MALLOC_SIMPLE
- bool
- prompt "Only use malloc_simple functions in the SPL"
+ bool "Only use malloc_simple functions in the SPL"
help
Say Y here to only use the *_simple malloc functions from
malloc_simple.c, rather then using the versions from dlmalloc.c;
this will make the SPL binary smaller at the cost of more heap
usage as the *_simple malloc functions do not re-use free-ed mem.
-config TPL_SYS_MALLOC_SIMPLE
- bool
- prompt "Only use malloc_simple functions in the TPL"
- depends on TPL
+config SPL_SHARES_INIT_SP_ADDR
+ bool "SPL and U-Boot use the same initial stack pointer location"
+ depends on (ARM || ARCH_JZ47XX || MICROBLAZE || RISCV) && SPL_FRAMEWORK
+ default n if ARCH_SUNXI || ARCH_MX6 || ARCH_MX7
+ default y
help
- Say Y here to only use the *_simple malloc functions from
- malloc_simple.c, rather then using the versions from dlmalloc.c;
- this will make the TPL binary smaller at the cost of more heap
- usage as the *_simple malloc functions do not re-use free-ed mem.
+ In many cases, we can use the same initial stack pointer address for
+ both SPL and U-Boot itself. If you need to specify a different address
+ however, say N here and then set a different value in CONFIG_SPL_STACK.
+
+config SPL_STACK
+ hex "Initial stack pointer location"
+ depends on (ARM || ARCH_JZ47XX || MICROBLAZE || RISCV) && SPL_FRAMEWORK
+ depends on !SPL_SHARES_INIT_SP_ADDR
+ default 0x946bb8 if ARCH_MX7
+ default 0x93ffb8 if ARCH_MX6 && MX6_OCRAM_256KB
+ default 0x91ffb8 if ARCH_MX6 && !MX6_OCRAM_256KB
+ help
+ Address of the start of the stack SPL will use before SDRAM is
+ initialized.
config SPL_STACK_R
bool "Enable SDRAM location for SPL stack"
@@ -301,6 +387,23 @@ config SPL_SEPARATE_BSS
location is used. Normally we put the device tree at the end of BSS
but with this option enabled, it goes at _image_binary_end.
+config SYS_SPL_MALLOC
+ bool "Enable malloc pool in SPL"
+ depends on SPL_FRAMEWORK
+
+config HAS_CUSTOM_SPL_MALLOC_START
+ bool "For the SPL malloc pool, define a custom starting address"
+ depends on SYS_SPL_MALLOC
+
+config CUSTOM_SYS_SPL_MALLOC_ADDR
+ hex "SPL malloc addr"
+ depends on HAS_CUSTOM_SPL_MALLOC_START
+
+config SYS_SPL_MALLOC_SIZE
+ hex "Size of the SPL malloc pool"
+ depends on SYS_SPL_MALLOC
+ default 0x100000
+
config SPL_READ_ONLY
bool
depends on SPL_OF_PLATDATA
@@ -314,16 +417,6 @@ config SPL_READ_ONLY
writeable memory) of anything it wants to modify, such as
device-private data.
-config TPL_SEPARATE_BSS
- bool "BSS section is in a different memory region from text"
- default y if SPL_SEPARATE_BSS
- help
- Some platforms need a large BSS region in TPL and can provide this
- because RAM is already set up. In this case BSS can be moved to RAM.
- This option should then be enabled so that the correct device tree
- location is used. Normally we put the device tree at the end of BSS
- but with this option enabled, it goes at _image_binary_end.
-
config SPL_BANNER_PRINT
bool "Enable output of the SPL banner 'U-Boot SPL ...'"
default y
@@ -332,15 +425,6 @@ config SPL_BANNER_PRINT
info. Disabling this option could be useful to reduce SPL boot time
(e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
-config TPL_BANNER_PRINT
- bool "Enable output of the TPL banner 'U-Boot TPL ...'"
- depends on TPL
- default y
- help
- If this option is enabled, TPL will print the banner with version
- info. Disabling this option could be useful to reduce TPL boot time
- (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
-
config SPL_EARLY_BSS
depends on ARM && !ARM64
bool "Allows initializing BSS early before entering board_init_f"
@@ -591,6 +675,31 @@ config SPL_FS_FAT
filesystem from within SPL. Support for the underlying block
device (e.g. MMC or USB) must be enabled separately.
+config SPL_FS_LOAD_PAYLOAD_NAME
+ string "File to load for U-Boot from the filesystem"
+ depends on SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS
+ default "tispl.bin" if SYS_K3_SPL_ATF
+ default "u-boot.itb" if SPL_LOAD_FIT
+ default "u-boot.img"
+ help
+ Filename to read to load U-Boot when reading from filesystem.
+
+config SPL_FS_LOAD_KERNEL_NAME
+ string "File to load for the OS kernel from the filesystem"
+ depends on (SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS) && SPL_OS_BOOT
+ default "uImage"
+ help
+ Filename to read to load for the OS kernel when reading from the
+ filesystem.
+
+config SPL_FS_LOAD_ARGS_NAME
+ string "File to load for the OS kernel argument parameters from the filesystem"
+ depends on (SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS) && SPL_OS_BOOT
+ default "args"
+ help
+ Filename to read to load for the OS kernel argument parameters from
+ the filesystem.
+
config SPL_FAT_WRITE
bool "Support write for FAT filesystems"
help
@@ -667,6 +776,7 @@ config SPL_LIBGENERIC_SUPPORT
config SPL_DM_MAILBOX
bool "Support Mailbox"
+ depends on SPL_DM
help
Enable support for Mailbox within SPL. This enable the inter
processor communication protocols tobe used within SPL. Enable
@@ -749,13 +859,23 @@ config SPL_NAND_SUPPORT
This enables the drivers in drivers/mtd/nand/raw as part of an SPL
build.
+config SPL_NAND_RAW_ONLY
+ bool "Support to boot only raw u-boot.bin images"
+ depends on SPL_NAND_SUPPORT
+ help
+ Use this only if you need to save space.
+
config SPL_NAND_DRIVERS
bool "Use standard NAND driver"
help
SPL uses normal NAND drivers, not minimal drivers.
config SPL_NAND_ECC
- bool "Include standard software ECC in the SPL"
+ bool "Include standard ECC in SPL"
+
+config SPL_NAND_SOFTECC
+ bool "Use software ECC in SPL"
+ depends on SPL_NAND_ECC
config SPL_NAND_SIMPLE
bool "Support simple NAND drivers in SPL"
@@ -781,19 +901,9 @@ config SPL_UBI
Enable support for loading payloads from UBI. See
README.ubispl for more info.
-if SPL_DM
-config SPL_DM_SPI
- bool "Support SPI DM drivers in SPL"
- help
- Enable support for SPI DM drivers in SPL.
-
-config SPL_DM_SPI_FLASH
- bool "Support SPI DM FLASH drivers in SPL"
- help
- Enable support for SPI DM flash drivers in SPL.
+menu "UBI configuration for SPL"
+ depends on SPL_UBI
-endif
-if SPL_UBI
config SPL_UBI_LOAD_BY_VOLNAME
bool "Support loading volumes by name"
help
@@ -803,58 +913,49 @@ config SPL_UBI_LOAD_BY_VOLNAME
config SPL_UBI_MAX_VOL_LEBS
int "Maximum number of LEBs per volume"
- depends on SPL_UBI
help
The maximum number of logical eraseblocks which a static volume
to load can contain. Used for sizing the scan data structure.
config SPL_UBI_MAX_PEB_SIZE
int "Maximum PEB size"
- depends on SPL_UBI
help
The maximum physical erase block size.
config SPL_UBI_MAX_PEBS
int "Maximum number of PEBs"
- depends on SPL_UBI
help
The maximum physical erase block size. If not overridden by
board code, this value will be used as the actual number of PEBs.
config SPL_UBI_PEB_OFFSET
int "Offset to first UBI PEB"
- depends on SPL_UBI
help
The offset in number of PEBs from the start of flash to the first
PEB part of the UBI image.
config SPL_UBI_VID_OFFSET
int "Offset to VID header"
- depends on SPL_UBI
config SPL_UBI_LEB_START
int "Offset to LEB in PEB"
- depends on SPL_UBI
help
The offset in bytes to the LEB within a PEB.
config SPL_UBI_INFO_ADDR
hex "Address to place UBI scan info"
- depends on SPL_UBI
help
Address for ubispl to place the scan info. Read README.ubispl to
determine the required size
config SPL_UBI_VOL_IDS
int "Maximum volume id"
- depends on SPL_UBI
help
The maximum volume id which can be loaded. Used for sizing the
scan data structure.
config SPL_UBI_LOAD_MONITOR_ID
int "id of U-Boot volume"
- depends on SPL_UBI
help
The UBI volume id from which to load U-Boot
@@ -866,13 +967,13 @@ config SPL_UBI_LOAD_MONITOR_VOLNAME
config SPL_UBI_LOAD_KERNEL_ID
int "id of kernel volume"
- depends on SPL_OS_BOOT && SPL_UBI
+ depends on SPL_OS_BOOT
help
The UBI volume id from which to load the kernel
config SPL_UBI_LOAD_ARGS_ID
int "id of kernel args volume"
- depends on SPL_OS_BOOT && SPL_UBI
+ depends on SPL_OS_BOOT
help
The UBI volume id from which to load the device tree
@@ -882,7 +983,19 @@ config UBI_SPL_SILENCE_MSG
Disable messages from UBI SPL. This leaves warnings
and errors enabled.
-endif # if SPL_UBI
+endmenu
+
+config SPL_DM_SPI
+ bool "Support SPI DM drivers in SPL"
+ depends on SPL_DM
+ help
+ Enable support for SPI DM drivers in SPL.
+
+config SPL_DM_SPI_FLASH
+ bool "Support SPI DM FLASH drivers in SPL"
+ depends on SPL_DM
+ help
+ Enable support for SPI DM flash drivers in SPL.
config SPL_NET
bool "Support networking"
@@ -893,19 +1006,19 @@ config SPL_NET
the network stack uses a number of environment variables. See also
SPL_ETH.
-if SPL_NET
config SPL_NET_VCI_STRING
string "BOOTP Vendor Class Identifier string sent by SPL"
+ depends on SPL_NET
help
As defined by RFC 2132 the vendor class identifier field can be
sent by the client to identify the vendor type and configuration
of a client. This is often used in practice to allow for the DHCP
server to specify different files to load depending on if the ROM,
SPL or U-Boot itself makes the request
-endif # if SPL_NET
config SPL_NO_CPU_SUPPORT
- bool "Drop CPU code in SPL"
+ def_bool y
+ depends on (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
help
This is specific to the ARM926EJ-S CPU. It disables the standard
start.S start-up code, presumably so that a replacement can be
@@ -922,7 +1035,6 @@ config SPL_NOR_SUPPORT
config SPL_XIP_SUPPORT
bool "Support XIP"
- depends on SPL
help
Enable support for execute in place of U-Boot or kernel image. There
is no need to copy image from flash to ram if flash supports execute
@@ -944,16 +1056,25 @@ config SPL_OS_BOOT
Enable booting directly to an OS from SPL.
for more info read doc/README.falcon
-if SPL_OS_BOOT
+config SYS_SPL_ARGS_ADDR
+ hex "Address in memory to load 'args' file for Falcon Mode to"
+ depends on SPL_OS_BOOT
+ default 0x88000000 if ARCH_OMAP2PLUS
+ help
+ Address in memory where the 'args' file, typically a device tree
+ will be loaded in to memory.
+
+config SYS_NAND_SPL_KERNEL_OFFS
+ hex "Address in memory to load the OS file for Falcon mode to"
+ depends on SPL_OS_BOOT && SPL_NAND_SUPPORT
+
config SYS_OS_BASE
hex "addr, where OS is found"
- depends on SPL_NOR_SUPPORT
+ depends on SPL_OS_BOOT && SPL_NOR_SUPPORT
help
Specify the address, where the OS image is found, which
gets booted.
-endif # SPL_OS_BOOT
-
config SPL_FALCON_BOOT_MMCSD
bool "Enable Falcon boot from MMC or SD media"
depends on SPL_OS_BOOT && SPL_MMC
@@ -970,6 +1091,20 @@ config SYS_MMCSD_RAW_MODE_KERNEL_SECTOR
Note that the Falcon mode image can also be a FIT, if FIT support is
enabled.
+config SYS_MMCSD_RAW_MODE_ARGS_SECTOR
+ hex "Falcon mode: Sector to load 'args' from MMC"
+ depends on SPL_FALCON_BOOT_MMCSD
+ help
+ When Falcon mode is used with an MMC or SD media, SPL needs to know
+ where to look for the OS 'args', typically a device tree. The
+ contents are expected to begin at the raw MMC specified in this config.
+ Note that if using a FIT image, this and the next option can be set to
+ 0x0.
+
+config SYS_MMCSD_RAW_MODE_ARGS_SECTORS
+ hex "Falcon mode: Number of sectors to load for 'args' from MMC"
+ depends on SPL_FALCON_BOOT_MMCSD && SYS_MMCSD_RAW_MODE_ARGS_SECTOR != 0x0
+
config SPL_PAYLOAD
string "SPL payload"
default "tpl/u-boot-with-tpl.bin" if TPL
@@ -1007,7 +1142,7 @@ config SPL_POST_MEM_SUPPORT
config SPL_DM_RESET
bool "Support reset drivers"
- depends on SPL
+ depends on SPL_DM
help
Enable support for reset control in SPL.
That can be useful in SPL to handle IP reset in driver, as in U-Boot,
@@ -1196,6 +1331,13 @@ config SPL_USB_STORAGE
config options. This enables loading from USB using a configured
device.
+config SYS_USB_FAT_BOOT_PARTITION
+ int "Partition on USB to use to load U-Boot from"
+ depends on SPL_USB_STORAGE
+ default 1
+ help
+ Partition on the USB storage device to load U-Boot from
+
config SPL_USB_GADGET
bool "Suppport USB Gadget drivers"
help
@@ -1310,6 +1452,7 @@ config SPL_ATF_NO_PLATFORM_PARAM
config SPL_AM33XX_ENABLE_RTC32K_OSC
bool "Enable the RTC32K OSC on AM33xx based platforms"
+ depends on AM33XX
default y if AM33XX
help
Enable access to the AM33xx RTC and select the external 32kHz clock
@@ -1339,519 +1482,15 @@ config SPL_OPENSBI_LOAD_ADDR
help
Load address of the OpenSBI binary.
-config TPL
- bool
- depends on SUPPORT_TPL
- prompt "Enable TPL"
- help
- If you want to build TPL as well as the normal image and SPL, say Y.
-
-if TPL
-
-config TPL_SIZE_LIMIT
- hex "Maximum size of TPL image"
- depends on TPL
- default 0x0
- help
- Specifies the maximum length of the U-Boot TPL image.
- If this value is zero, it is ignored.
-
-config TPL_BINMAN_SYMBOLS
- bool "Declare binman symbols in TPL"
- depends on SPL_FRAMEWORK && BINMAN
- default y
- help
- This enables use of symbols in TPL which refer to U-Boot, enabling TPL
- to obtain the location of U-Boot simply by calling spl_get_image_pos()
- and spl_get_image_size().
-
- For this to work, you must have a U-Boot image in the binman image, so
- binman can update TPL with the location of it.
-
-config TPL_FRAMEWORK
- bool "Support TPL based upon the common SPL framework"
- default y if SPL_FRAMEWORK
- help
- Enable the SPL framework under common/spl/ for TPL builds.
- This framework supports MMC, NAND and YMODEM and other methods
- loading of U-Boot's SPL stage. If unsure, say Y.
-
-config TPL_HANDOFF
- bool "Pass hand-off information from TPL to SPL and U-Boot proper"
- depends on HANDOFF && TPL_BLOBLIST
- default y
- help
- This option enables TPL to write handoff information. This can be
- used to pass information like the size of SDRAM from TPL to U-Boot
- proper. The information is also available to SPL if it is useful
- there.
-
-config TPL_BOARD_INIT
- bool "Call board-specific initialization in TPL"
- help
- If this option is enabled, U-Boot will call the function
- spl_board_init() from board_init_r(). This function should be
- provided by the board.
-
-config TPL_BOOTCOUNT_LIMIT
- bool "Support bootcount in TPL"
- depends on TPL_ENV_SUPPORT
+config SPL_TARGET
+ string "Addtional build targets for 'make'"
+ default "spl/u-boot-spl.srec" if RCAR_GEN2
+ default "spl/u-boot-spl.scif" if RCAR_GEN3
+ default ""
help
- If this option is enabled, the TPL will support bootcount.
- For example, it may be useful to choose the device to boot.
+ On some platforms we need to have 'make' run additional build target
+ rules. If required on your platform, enter it here, otherwise leave blank.
-config TPL_LDSCRIPT
- string "Linker script for the TPL stage"
- depends on TPL
- default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
- default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
- help
- The TPL stage will usually require a different linker-script
- (as it runs from a different memory region) than the regular
- U-Boot stage. Set this to the path of the linker-script to
- be used for TPL.
-
- May be left empty to trigger the Makefile infrastructure to
- fall back to the linker-script used for the SPL stage.
-
-config TPL_NEEDS_SEPARATE_STACK
- bool "TPL needs a separate initial stack-pointer"
- depends on TPL
- help
- Enable, if the TPL stage should not inherit its initial
- stack-pointer from the settings for the SPL stage.
-
-config TPL_POWER
- bool "Support power drivers"
- help
- Enable support for power control in TPL. This includes support
- for PMICs (Power-management Integrated Circuits) and some of the
- features provided by PMICs. In particular, voltage regulators can
- be used to enable/disable power and vary its voltage. That can be
- useful in TPL to turn on boot peripherals and adjust CPU voltage
- so that the clock speed can be increased. This enables the drivers
- in drivers/power, drivers/power/pmic and drivers/power/regulator
- as part of an TPL build.
-
-config TPL_TEXT_BASE
- hex "Base address for the .text section of the TPL stage"
- default 0
- help
- The base address for the .text section of the TPL stage.
-
-config TPL_MAX_SIZE
- int "Maximum size (in bytes) for the TPL stage"
- default 0
- depends on TPL
- help
- The maximum size (in bytes) of the TPL stage.
-
-config TPL_STACK
- hex "Address of the initial stack-pointer for the TPL stage"
- depends on TPL_NEEDS_SEPARATE_STACK
- help
- The address of the initial stack-pointer for the TPL stage.
- Usually this will be the (aligned) top-of-stack.
-
-config TPL_READ_ONLY
- bool
- depends on TPL_OF_PLATDATA
- select TPL_OF_PLATDATA_NO_BIND
- select TPL_OF_PLATDATA_RT
- help
- Some platforms (e.g. x86 Apollo Lake) load SPL into a read-only
- section of memory. This means that of-platdata must make a copy (in
- writeable memory) of anything it wants to modify, such as
- device-private data.
-
-config TPL_BOOTROM_SUPPORT
- bool "Support returning to the BOOTROM (from TPL)"
- help
- Some platforms (e.g. the Rockchip RK3368) provide support in their
- ROM for loading the next boot-stage after performing basic setup
- from the TPL stage.
-
- Enable this option, to return to the BOOTROM through the
- BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
- boot device list, if not implemented for a given board)
-
-config TPL_CRC32
- bool "Support CRC32 in TPL"
- default y if TPL_ENV_SUPPORT || TPL_BLOBLIST
- help
- Enable this to support CRC32 in uImages or FIT images within SPL.
- This is a 32-bit checksum value that can be used to verify images.
- For FIT images, this is the least secure type of checksum, suitable
- for detected accidental image corruption. For secure applications you
- should consider SHA1 or SHA256.
-
-config TPL_DRIVERS_MISC
- bool "Support misc drivers in TPL"
- help
- Enable miscellaneous drivers in TPL. These drivers perform various
- tasks that don't fall nicely into other categories, Enable this
- option to build the drivers in drivers/misc as part of an TPL
- build, for those that support building in TPL (not all drivers do).
-
-config TPL_ENV_SUPPORT
- bool "Support an environment"
- help
- Enable environment support in TPL. See SPL_ENV_SUPPORT for details.
-
-config TPL_GPIO
- bool "Support GPIO in TPL"
- help
- Enable support for GPIOs (General-purpose Input/Output) in TPL.
- GPIOs allow U-Boot to read the state of an input line (high or
- low) and set the state of an output line. This can be used to
- drive LEDs, control power to various system parts and read user
- input. GPIOs can be useful in TPL to enable a 'sign-of-life' LED,
- for example. Enable this option to build the drivers in
- drivers/gpio as part of an TPL build.
-
-config TPL_I2C
- bool "Support I2C"
- help
- Enable support for the I2C bus in TPL. See SPL_I2C for
- details.
-
-config TPL_LIBCOMMON_SUPPORT
- bool "Support common libraries"
- help
- Enable support for common U-Boot libraries within TPL. See
- SPL_LIBCOMMON_SUPPORT for details.
-
-config TPL_LIBGENERIC_SUPPORT
- bool "Support generic libraries"
- help
- Enable support for generic U-Boot libraries within TPL. See
- SPL_LIBGENERIC_SUPPORT for details.
-
-config TPL_MPC8XXX_INIT_DDR
- bool "Support MPC8XXX DDR init"
- help
- Enable support for DDR-SDRAM on the MPC8XXX family within TPL. See
- SPL_MPC8XXX_INIT_DDR for details.
-
-config TPL_MMC
- bool "Support MMC"
- depends on MMC
- help
- Enable support for MMC within TPL. See SPL_MMC for details.
-
-config TPL_NAND_SUPPORT
- bool "Support NAND flash"
- help
- Enable support for NAND in TPL. See SPL_NAND_SUPPORT for details.
-
-config TPL_PCI
- bool "Support PCI drivers"
- help
- Enable support for PCI in TPL. For platforms that need PCI to boot,
- or must perform some init using PCI in SPL, this provides the
- necessary driver support. This enables the drivers in drivers/pci
- as part of a TPL build.
-
-config TPL_PCH
- bool "Support PCH drivers"
- help
- Enable support for PCH (Platform Controller Hub) devices in TPL.
- These are used to set up GPIOs and the SPI peripheral early in
- boot. This enables the drivers in drivers/pch as part of a TPL
- build.
-
-config TPL_RAM_SUPPORT
- bool "Support booting from RAM"
- help
- Enable booting of an image in RAM. The image can be preloaded or
- it can be loaded by TPL directly into RAM (e.g. using USB).
-
-config TPL_RAM_DEVICE
- bool "Support booting from preloaded image in RAM"
- depends on TPL_RAM_SUPPORT
- help
- Enable booting of an image already loaded in RAM. The image has to
- be already in memory when TPL takes over, e.g. loaded by the boot
- ROM.
-
-config TPL_RTC
- bool "Support RTC drivers"
- help
- Enable RTC (Real-time Clock) support in TPL. This includes support
- for reading and setting the time. Some RTC devices also have some
- non-volatile (battery-backed) memory which is accessible if
- needed. This enables the drivers in drivers/rtc as part of an TPL
- build.
-
-config TPL_SERIAL
- bool "Support serial"
- select TPL_PRINTF
- select TPL_STRTO
- help
- Enable support for serial in TPL. See SPL_SERIAL for
- details.
-
-config TPL_SPI_FLASH_SUPPORT
- bool "Support SPI flash drivers"
- help
- Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT
- for details.
-
-config TPL_SPI_FLASH_TINY
- bool "Enable low footprint TPL SPI Flash support"
- depends on TPL_SPI_FLASH_SUPPORT && !SPI_FLASH_BAR
- default y if SPI_FLASH
- help
- Enable lightweight TPL SPI Flash support that supports just reading
- data/images from flash. No support to write/erase flash. Enable
- this if you have TPL size limitations and don't need full-fledged
- SPI flash support.
-
-config TPL_SPI_LOAD
- bool "Support loading from SPI flash"
- depends on TPL_SPI_FLASH_SUPPORT
- help
- Enable support for loading next stage, U-Boot or otherwise, from
- SPI NOR in U-Boot TPL.
-
-config TPL_SPI
- bool "Support SPI drivers"
- help
- Enable support for using SPI in TPL. See SPL_SPI for
- details.
-
-config TPL_DM_SPI
- bool "Support SPI DM drivers in TPL"
- help
- Enable support for SPI DM drivers in TPL.
-
-config TPL_DM_SPI_FLASH
- bool "Support SPI DM FLASH drivers in TPL"
- help
- Enable support for SPI DM flash drivers in TPL.
-
-config TPL_YMODEM_SUPPORT
- bool "Support loading using Ymodem"
- depends on TPL_SERIAL
- help
- While loading from serial is slow it can be a useful backup when
- there is no other option. The Ymodem protocol provides a reliable
- means of transmitting U-Boot over a serial line for using in TPL,
- with a checksum to ensure correctness.
-
-endif # TPL
-
-config VPL
- bool
- depends on SUPPORT_SPL
- prompt "Enable VPL"
- help
- If you want to build VPL as well as the normal image, TPL and SPL,
- say Y.
-
-if VPL
-
-config VPL_BANNER_PRINT
- bool "Enable output of the VPL banner 'U-Boot VPL ...'"
- depends on VPL
- default y
- help
- If this option is enabled, VPL will print the banner with version
- info. Disabling this option could be useful to reduce VPL boot time
- (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
-
-config VPL_BOARD_INIT
- bool "Call board-specific initialization in VPL"
- help
- If this option is enabled, U-Boot will call the function
- spl_board_init() from board_init_r(). This function should be
- provided by the board.
-
-config VPL_CACHE
- depends on CACHE
- bool "Support cache drivers in VPL"
- help
- Enable support for cache drivers in VPL.
-
-config VPL_CRC32
- bool "Support CRC32 in VPL"
- default y if VPL_ENV_SUPPORT || VPL_BLOBLIST
- help
- Enable this to support CRC32 in uImages or FIT images within VPL.
- This is a 32-bit checksum value that can be used to verify images.
- For FIT images, this is the least secure type of checksum, suitable
- for detected accidental image corruption. For secure applications you
- should consider SHA1 or SHA256.
-
-config VPL_DM_SPI
- bool "Support SPI DM drivers in VPL"
- help
- Enable support for SPI DM drivers in VPL.
-
-config VPL_DM_SPI_FLASH
- bool "Support SPI DM FLASH drivers in VPL"
- help
- Enable support for SPI DM flash drivers in VPL.
-
-config VPL_FRAMEWORK
- bool "Support VPL based upon the common SPL framework"
- default y
- help
- Enable the SPL framework under common/spl/ for VPL builds.
- This framework supports MMC, NAND and YMODEM and other methods
- loading of U-Boot's next stage. If unsure, say Y.
-
-config VPL_HANDOFF
- bool "Pass hand-off information from VPL to SPL"
- depends on HANDOFF && VPL_BLOBLIST
- default y
- help
- This option enables VPL to write handoff information. This can be
- used to pass information like the size of SDRAM from VPL to SPL. Also
- VPL can receive information from TPL in the same place if that is
- enabled.
-
-config VPL_LIBCOMMON_SUPPORT
- bool "Support common libraries"
- default y if SPL_LIBCOMMON_SUPPORT
- help
- Enable support for common U-Boot libraries within VPL. See
- SPL_LIBCOMMON_SUPPORT for details.
-
-config VPL_LIBGENERIC_SUPPORT
- bool "Support generic libraries"
- default y if SPL_LIBGENERIC_SUPPORT
- help
- Enable support for generic U-Boot libraries within VPL. These
- libraries include generic code to deal with device tree, hashing,
- printf(), compression and the like. This option is enabled on many
- boards. Enable this option to build the code in lib/ as part of a
- VPL build.
-
-config VPL_DRIVERS_MISC
- bool "Support misc drivers"
- default y if TPL_DRIVERS_MISC
- help
- Enable miscellaneous drivers in VPL. These drivers perform various
- tasks that don't fall nicely into other categories, Enable this
- option to build the drivers in drivers/misc as part of a VPL
- build, for those that support building in VPL (not all drivers do).
-
-config VPL_ENV_SUPPORT
- bool "Support an environment"
- help
- Enable environment support in VPL. The U-Boot environment provides
- a number of settings (essentially name/value pairs) which can
- control many aspects of U-Boot's operation. Enabling this option will
- make env_get() and env_set() available in VSPL.
-
-config VPL_GPIO
- bool "Support GPIO in VPL"
- default y if SPL_GPIO
- help
- Enable support for GPIOs (General-purpose Input/Output) in VPL.
- GPIOs allow U-Boot to read the state of an input line (high or
- low) and set the state of an output line. This can be used to
- drive LEDs, control power to various system parts and read user
- input. GPIOs can be useful in VPL to enable a 'sign-of-life' LED,
- for example. Enable this option to build the drivers in
- drivers/gpio as part of a VPL build.
-
-config VPL_HANDOFF
- bool "Pass hand-off information from VPL to SPL and U-Boot proper"
- depends on HANDOFF && VPL_BLOBLIST
- default y
- help
- This option enables VPL to write handoff information. This can be
- used to pass information like the size of SDRAM from VPL to U-Boot
- proper. The information is also available to VPL if it is useful
- there.
-
-config VPL_HASH
- bool "Support hashing drivers in VPL"
- depends on VPL
- select SHA1
- select SHA256
- help
- Enable hashing drivers in VPL. These drivers can be used to
- accelerate secure boot processing in secure applications. Enable
- this option to build system-specific drivers for hash acceleration
- as part of a VPL build.
-
-config VPL_I2C_SUPPORT
- bool "Support I2C in VPL"
- default y if SPL_I2C_SUPPORT
- help
- Enable support for the I2C bus in VPL. Vee SPL_I2C_SUPPORT for
- details.
-
-config VPL_PCH_SUPPORT
- bool "Support PCH drivers"
- default y if TPL_PCH_SUPPORT
- help
- Enable support for PCH (Platform Controller Hub) devices in VPL.
- These are used to set up GPIOs and the SPI peripheral early in
- boot. This enables the drivers in drivers/pch as part of a VPL
- build.
-
-config VPL_PCI
- bool "Support PCI drivers"
- default y if SPL_PCI
- help
- Enable support for PCI in VPL. For platforms that need PCI to boot,
- or must perform some init using PCI in VPL, this provides the
- necessary driver support. This enables the drivers in drivers/pci
- as part of a VPL build.
-
-config VPL_RTC
- bool "Support RTC drivers"
- help
- Enable RTC (Real-time Clock) support in VPL. This includes support
- for reading and setting the time. Some RTC devices also have some
- non-volatile (battery-backed) memory which is accessible if
- needed. This enables the drivers in drivers/rtc as part of a VPL
- build.
-
-config VPL_SERIAL
- bool "Support serial"
- default y if TPL_SERIAL
- select VPL_PRINTF
- select VPL_STRTO
- help
- Enable support for serial in VPL. See SPL_SERIAL_SUPPORT for
- details.
-
-config VPL_SIZE_LIMIT
- hex "Maximum size of VPL image"
- depends on VPL
- default 0x0
- help
- Specifies the maximum length of the U-Boot VPL image.
- If this value is zero, it is ignored.
-
-config VPL_SPI
- bool "Support SPI drivers"
- help
- Enable support for using SPI in VPL. See SPL_SPI_SUPPORT for
- details.
-
-config VPL_SPI_FLASH_SUPPORT
- bool "Support SPI flash drivers"
- help
- Enable support for using SPI flash in VPL, and loading U-Boot from
- SPI flash. SPI flash (Serial Peripheral Bus flash) is named after
- the SPI bus that is used to connect it to a system. It is a simple
- but fast bidirectional 4-wire bus (clock, chip select and two data
- lines). This enables the drivers in drivers/mtd/spi as part of a
- VPL build. This normally requires VPL_SPI_SUPPORT.
-
-config VPL_TEXT_BASE
- hex "VPL Text Base"
- default 0x0
- help
- The address in memory that VPL will be running from.
-
-endif # VPL
config SPL_AT91_MCK_BYPASS
bool "Use external clock signal as a source of main clock for AT91 platforms"
@@ -1863,6 +1502,21 @@ config SPL_AT91_MCK_BYPASS
The external source has to provide a stable clock on the XIN pin.
If this option is disabled, the SoC expects a crystal oscillator
that needs driving on both XIN and XOUT lines.
-
-endif # SPL
endmenu
+
+config TPL
+ depends on SUPPORT_TPL
+ bool "Enable TPL"
+ help
+ If you want to build TPL as well as the normal image and SPL, say Y.
+
+source "common/spl/Kconfig.tpl"
+
+config VPL
+ depends on SUPPORT_SPL
+ bool "Enable VPL"
+ help
+ If you want to build VPL as well as the normal image, TPL and SPL,
+ say Y.
+
+source "common/spl/Kconfig.vpl"
diff --git a/common/spl/Kconfig.nxp b/common/spl/Kconfig.nxp
new file mode 100644
index 00000000000..8da85539afd
--- /dev/null
+++ b/common/spl/Kconfig.nxp
@@ -0,0 +1,124 @@
+menu "PowerPC and LayerScape SPL Boot options"
+ depends on (PPC && SUPPORT_SPL && !SPL_FRAMEWORK) || \
+ ((ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A) && SUPPORT_SPL)
+
+config SPL_NAND_BOOT
+ bool "Load SPL from NAND flash"
+ depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
+
+config SPL_MMC_BOOT
+ bool "Load SPL from SD Card / eMMC"
+ depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
+
+config SPL_SPI_BOOT
+ bool "Load SPL from SPI flash"
+ depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
+
+config SPL_FSL_PBL
+ bool "Create SPL in Freescale PBI format"
+ depends on (PPC || ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A) && \
+ SUPPORT_SPL
+ help
+ Create boot binary having SPL binary in PBI format concatenated with
+ u-boot binary.
+
+config SPL_SYS_CCSR_DO_NOT_RELOCATE
+ bool "Ensures that CCSR is not relocated"
+ depends on PPC
+ help
+ If this is defined, then CONFIG_SYS_CCSRBAR_PHYS will be forced to a
+ value that ensures that CCSR is not relocated.
+
+config TPL_SYS_CCSR_DO_NOT_RELOCATE
+ def_bool y
+ depends on SPL_SYS_CCSR_DO_NOT_RELOCATE
+
+menu "PowerPC SPL / TPL specific options"
+ depends on PPC && (SPL && !SPL_FRAMEWORK)
+
+config SPL_INIT_MINIMAL
+ bool "Arch init code will be built for a very small image"
+
+config SPL_FLUSH_IMAGE
+ bool "Clean dcache and invalidate icache after loading the image"
+
+config SPL_SKIP_RELOCATE
+ bool "Skip relocating SPL"
+
+config SPL_GD_ADDR
+ hex "Address to use for global data (gd) in SPL"
+ depends on !SPL_INIT_MINIMAL
+
+config SPL_RELOC_TEXT_BASE
+ hex "Address to relocate SPL to"
+ default SPL_TEXT_BASE
+ help
+ If unspecified, this is equal to CONFIG_SPL_TEXT_BASE (i.e. no
+ relocation is done).
+
+config SPL_RELOC_STACK
+ hex "Address of the start of the stack SPL will use after relocation."
+ help
+ If unspecified, this is equal to CONFIG_SYS_SPL_MALLOC_START. Starting
+ address of the malloc pool used in SPL. When this option is set the full
+ malloc is used in SPL and it is set up by spl_init() and before that, the
+ simple malloc() can be used if CONFIG_SYS_MALLOC_F is defined.
+
+config SPL_RELOC_MALLOC
+ bool "SPL has malloc pool after relocation"
+
+config SPL_RELOC_MALLOC_ADDR
+ hex "Address of malloc pool in SPL"
+ depends on SPL_RELOC_MALLOC
+
+config SPL_RELOC_MALLOC_SIZE
+ hex "Size of malloc pool in SPL"
+ depends on SPL_RELOC_MALLOC
+
+config TPL_GD_ADDR
+ hex "Address to use for global data (gd) in TPL"
+ depends on TPL
+
+config TPL_RELOC_TEXT_BASE
+ hex "Address to relocate TPL to"
+ depends on TPL
+ default TPL_TEXT_BASE
+ help
+ If unspecified, this is equal to CONFIG_TPL_TEXT_BASE (i.e. no
+ relocation is done).
+
+config TPL_RELOC_STACK
+ hex "Address of the start of the stack TPL will use after relocation."
+ depends on TPL
+ help
+ If unspecified, this is equal to CONFIG_SYS_TPL_MALLOC_START. Starting
+ address of the malloc pool used in TPL. When this option is set the full
+ malloc is used in TPL and it is set up by spl_init() and before that, the
+ simple malloc() can be used if CONFIG_SYS_MALLOC_F is defined.
+
+config TPL_RELOC_MALLOC
+ bool "TPL has malloc pool after relocation"
+ depends on TPL
+
+config TPL_RELOC_MALLOC_ADDR
+ hex "Address of malloc pool in TPL"
+ depends on TPL_RELOC_MALLOC
+
+config TPL_RELOC_MALLOC_SIZE
+ hex "Size of malloc pool in TPL"
+ depends on TPL_RELOC_MALLOC
+
+config TPL_PAD_TO
+ hex "Offset to which the TPL should be padded before appending the TPL payload"
+ depends on TPL && !TPL_FRAMEWORK
+ default TPL_MAX_SIZE
+ help
+ Image offset to which the TPL should be padded before appending the
+ TPL payload. By default, this is defined as CONFIG_TPL_MAX_SIZE, or 0 if
+ CONFIG_TPL_MAX_SIZE is undefined. CONFIG_TPL_PAD_TO must be either
+ 0, meaning to append the TPL payload without any padding, or >=
+ CONFIG_TPL_MAX_SIZE.
+endmenu
+
+endmenu
+
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
new file mode 100644
index 00000000000..e314b793a2e
--- /dev/null
+++ b/common/spl/Kconfig.tpl
@@ -0,0 +1,335 @@
+menu "TPL configuration options"
+ depends on TPL
+
+config TPL_SIZE_LIMIT
+ hex "Maximum size of TPL image"
+ default 0x0
+ help
+ Specifies the maximum length of the U-Boot TPL image.
+ If this value is zero, it is ignored.
+
+config TPL_BINMAN_SYMBOLS
+ bool "Support binman symbols in TPL"
+ depends on TPL_FRAMEWORK && BINMAN
+ default y
+ help
+ This enables use of symbols in TPL which refer to other entries in
+ the same binman image as the TPL. These can be declared with the
+ binman_sym_declare(type, entry, prop) macro and accessed by the
+ binman_sym(type, entry, prop) macro defined in binman_sym.h.
+
+ See tools/binman/binman.rst for a detailed explanation.
+
+config TPL_BINMAN_UBOOT_SYMBOLS
+ bool "Declare binman symbols for U-Boot phases in TPL"
+ depends on TPL_BINMAN_SYMBOLS
+ default n if ARCH_IMX8M
+ default y
+ help
+ This enables use of symbols in TPL which refer to U-Boot phases,
+ enabling TPL to obtain the location and size of its next phase simply
+ by calling spl_get_image_pos() and spl_get_image_size().
+
+ For this to work, you must have all U-Boot phases in the same binman
+ image, so binman can update TPL with the locations of everything.
+
+config TPL_FRAMEWORK
+ bool "Support TPL based upon the common SPL framework"
+ default y if SPL_FRAMEWORK
+ help
+ Enable the SPL framework under common/spl/ for TPL builds.
+ This framework supports MMC, NAND and YMODEM and other methods
+ loading of U-Boot's SPL stage. If unsure, say Y.
+
+config TPL_BANNER_PRINT
+ bool "Enable output of the TPL banner 'U-Boot TPL ...'"
+ default y
+ help
+ If this option is enabled, TPL will print the banner with version
+ info. Disabling this option could be useful to reduce TPL boot time
+ (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
+
+config TPL_HANDOFF
+ bool "Pass hand-off information from TPL to SPL and U-Boot proper"
+ depends on HANDOFF && TPL_BLOBLIST
+ default y
+ help
+ This option enables TPL to write handoff information. This can be
+ used to pass information like the size of SDRAM from TPL to U-Boot
+ proper. The information is also available to SPL if it is useful
+ there.
+
+config TPL_BOARD_INIT
+ bool "Call board-specific initialization in TPL"
+ help
+ If this option is enabled, U-Boot will call the function
+ spl_board_init() from board_init_r(). This function should be
+ provided by the board.
+
+config TPL_BOOTCOUNT_LIMIT
+ bool "Support bootcount in TPL"
+ depends on TPL_ENV_SUPPORT
+ help
+ If this option is enabled, the TPL will support bootcount.
+ For example, it may be useful to choose the device to boot.
+
+config TPL_SYS_MALLOC_SIMPLE
+ bool
+ prompt "Only use malloc_simple functions in the TPL"
+ help
+ Say Y here to only use the *_simple malloc functions from
+ malloc_simple.c, rather then using the versions from dlmalloc.c;
+ this will make the TPL binary smaller at the cost of more heap
+ usage as the *_simple malloc functions do not re-use free-ed mem.
+
+config TPL_SEPARATE_BSS
+ bool "BSS section is in a different memory region from text"
+ default y if SPL_SEPARATE_BSS
+ help
+ Some platforms need a large BSS region in TPL and can provide this
+ because RAM is already set up. In this case BSS can be moved to RAM.
+ This option should then be enabled so that the correct device tree
+ location is used. Normally we put the device tree at the end of BSS
+ but with this option enabled, it goes at _image_binary_end.
+
+config TPL_LDSCRIPT
+ string "Linker script for the TPL stage"
+ default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
+ default "arch/\$(ARCH)/cpu/u-boot-spl.lds"
+ help
+ The TPL stage will usually require a different linker-script
+ (as it runs from a different memory region) than the regular
+ U-Boot stage. Set this to the path of the linker-script to
+ be used for TPL.
+
+ May be left empty to trigger the Makefile infrastructure to
+ fall back to the linker-script used for the SPL stage.
+
+config TPL_NEEDS_SEPARATE_STACK
+ bool "TPL needs a separate initial stack-pointer"
+ help
+ Enable, if the TPL stage should not inherit its initial
+ stack-pointer from the settings for the SPL stage.
+
+config TPL_POWER
+ bool "Support power drivers"
+ help
+ Enable support for power control in TPL. This includes support
+ for PMICs (Power-management Integrated Circuits) and some of the
+ features provided by PMICs. In particular, voltage regulators can
+ be used to enable/disable power and vary its voltage. That can be
+ useful in TPL to turn on boot peripherals and adjust CPU voltage
+ so that the clock speed can be increased. This enables the drivers
+ in drivers/power, drivers/power/pmic and drivers/power/regulator
+ as part of an TPL build.
+
+config TPL_TEXT_BASE
+ hex "Base address for the .text section of the TPL stage"
+ default 0
+ help
+ The base address for the .text section of the TPL stage.
+
+config TPL_MAX_SIZE
+ hex "Maximum size (in bytes) for the TPL stage"
+ default 0x2e000 if ROCKCHIP_RK3399
+ default 0x8000 if ROCKCHIP_RK3288
+ default 0x7000 if ROCKCHIP_RK322X || ROCKCHIP_RK3328 || ROCKCHIP_RK3368
+ default 0x2800 if ROCKCHIP_PX30
+ default 0x0
+ help
+ The maximum size (in bytes) of the TPL stage.
+
+config TPL_STACK
+ hex "Address of the initial stack-pointer for the TPL stage"
+ depends on TPL_NEEDS_SEPARATE_STACK
+ help
+ The address of the initial stack-pointer for the TPL stage.
+ Usually this will be the (aligned) top-of-stack.
+
+config TPL_READ_ONLY
+ bool
+ depends on TPL_OF_PLATDATA
+ select TPL_OF_PLATDATA_NO_BIND
+ select TPL_OF_PLATDATA_RT
+ help
+ Some platforms (e.g. x86 Apollo Lake) load SPL into a read-only
+ section of memory. This means that of-platdata must make a copy (in
+ writeable memory) of anything it wants to modify, such as
+ device-private data.
+
+config TPL_BOOTROM_SUPPORT
+ bool "Support returning to the BOOTROM (from TPL)"
+ help
+ Some platforms (e.g. the Rockchip RK3368) provide support in their
+ ROM for loading the next boot-stage after performing basic setup
+ from the TPL stage.
+
+ Enable this option, to return to the BOOTROM through the
+ BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
+ boot device list, if not implemented for a given board)
+
+config TPL_CRC32
+ bool "Support CRC32 in TPL"
+ default y if TPL_ENV_SUPPORT || TPL_BLOBLIST
+ help
+ Enable this to support CRC32 in uImages or FIT images within SPL.
+ This is a 32-bit checksum value that can be used to verify images.
+ For FIT images, this is the least secure type of checksum, suitable
+ for detected accidental image corruption. For secure applications you
+ should consider SHA1 or SHA256.
+
+config TPL_DRIVERS_MISC
+ bool "Support misc drivers in TPL"
+ help
+ Enable miscellaneous drivers in TPL. These drivers perform various
+ tasks that don't fall nicely into other categories, Enable this
+ option to build the drivers in drivers/misc as part of an TPL
+ build, for those that support building in TPL (not all drivers do).
+
+config TPL_ENV_SUPPORT
+ bool "Support an environment"
+ help
+ Enable environment support in TPL. See SPL_ENV_SUPPORT for details.
+
+config TPL_GPIO
+ bool "Support GPIO in TPL"
+ help
+ Enable support for GPIOs (General-purpose Input/Output) in TPL.
+ GPIOs allow U-Boot to read the state of an input line (high or
+ low) and set the state of an output line. This can be used to
+ drive LEDs, control power to various system parts and read user
+ input. GPIOs can be useful in TPL to enable a 'sign-of-life' LED,
+ for example. Enable this option to build the drivers in
+ drivers/gpio as part of an TPL build.
+
+config TPL_I2C
+ bool "Support I2C"
+ help
+ Enable support for the I2C bus in TPL. See SPL_I2C for
+ details.
+
+config TPL_LIBCOMMON_SUPPORT
+ bool "Support common libraries"
+ help
+ Enable support for common U-Boot libraries within TPL. See
+ SPL_LIBCOMMON_SUPPORT for details.
+
+config TPL_LIBGENERIC_SUPPORT
+ bool "Support generic libraries"
+ help
+ Enable support for generic U-Boot libraries within TPL. See
+ SPL_LIBGENERIC_SUPPORT for details.
+
+config TPL_MPC8XXX_INIT_DDR
+ bool "Support MPC8XXX DDR init"
+ help
+ Enable support for DDR-SDRAM on the MPC8XXX family within TPL. See
+ SPL_MPC8XXX_INIT_DDR for details.
+
+config TPL_MMC
+ bool "Support MMC"
+ depends on MMC
+ help
+ Enable support for MMC within TPL. See SPL_MMC for details.
+
+config TPL_NAND_SUPPORT
+ bool "Support NAND flash"
+ help
+ Enable support for NAND in TPL. See SPL_NAND_SUPPORT for details.
+
+config TPL_PCI
+ bool "Support PCI drivers"
+ help
+ Enable support for PCI in TPL. For platforms that need PCI to boot,
+ or must perform some init using PCI in SPL, this provides the
+ necessary driver support. This enables the drivers in drivers/pci
+ as part of a TPL build.
+
+config TPL_PCH
+ bool "Support PCH drivers"
+ help
+ Enable support for PCH (Platform Controller Hub) devices in TPL.
+ These are used to set up GPIOs and the SPI peripheral early in
+ boot. This enables the drivers in drivers/pch as part of a TPL
+ build.
+
+config TPL_RAM_SUPPORT
+ bool "Support booting from RAM"
+ help
+ Enable booting of an image in RAM. The image can be preloaded or
+ it can be loaded by TPL directly into RAM (e.g. using USB).
+
+config TPL_RAM_DEVICE
+ bool "Support booting from preloaded image in RAM"
+ depends on TPL_RAM_SUPPORT
+ help
+ Enable booting of an image already loaded in RAM. The image has to
+ be already in memory when TPL takes over, e.g. loaded by the boot
+ ROM.
+
+config TPL_RTC
+ bool "Support RTC drivers"
+ help
+ Enable RTC (Real-time Clock) support in TPL. This includes support
+ for reading and setting the time. Some RTC devices also have some
+ non-volatile (battery-backed) memory which is accessible if
+ needed. This enables the drivers in drivers/rtc as part of an TPL
+ build.
+
+config TPL_SERIAL
+ bool "Support serial"
+ select TPL_PRINTF
+ select TPL_STRTO
+ help
+ Enable support for serial in TPL. See SPL_SERIAL for
+ details.
+
+config TPL_SPI_FLASH_SUPPORT
+ bool "Support SPI flash drivers"
+ help
+ Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT
+ for details.
+
+config TPL_SPI_FLASH_TINY
+ bool "Enable low footprint TPL SPI Flash support"
+ depends on TPL_SPI_FLASH_SUPPORT && !SPI_FLASH_BAR
+ default y if SPI_FLASH
+ help
+ Enable lightweight TPL SPI Flash support that supports just reading
+ data/images from flash. No support to write/erase flash. Enable
+ this if you have TPL size limitations and don't need full-fledged
+ SPI flash support.
+
+config TPL_SPI_LOAD
+ bool "Support loading from SPI flash"
+ depends on TPL_SPI_FLASH_SUPPORT
+ help
+ Enable support for loading next stage, U-Boot or otherwise, from
+ SPI NOR in U-Boot TPL.
+
+config TPL_SPI
+ bool "Support SPI drivers"
+ help
+ Enable support for using SPI in TPL. See SPL_SPI for
+ details.
+
+config TPL_DM_SPI
+ bool "Support SPI DM drivers in TPL"
+ help
+ Enable support for SPI DM drivers in TPL.
+
+config TPL_DM_SPI_FLASH
+ bool "Support SPI DM FLASH drivers in TPL"
+ help
+ Enable support for SPI DM flash drivers in TPL.
+
+config TPL_YMODEM_SUPPORT
+ bool "Support loading using Ymodem"
+ depends on TPL_SERIAL
+ help
+ While loading from serial is slow it can be a useful backup when
+ there is no other option. The Ymodem protocol provides a reliable
+ means of transmitting U-Boot over a serial line for using in TPL,
+ with a checksum to ensure correctness.
+
+endmenu
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
new file mode 100644
index 00000000000..ba4b2e4f99e
--- /dev/null
+++ b/common/spl/Kconfig.vpl
@@ -0,0 +1,226 @@
+menu "VPL options"
+ depends on VPL
+
+config VPL_BANNER_PRINT
+ bool "Enable output of the VPL banner 'U-Boot VPL ...'"
+ default y
+ help
+ If this option is enabled, VPL will print the banner with version
+ info. Disabling this option could be useful to reduce VPL boot time
+ (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
+
+config VPL_BOARD_INIT
+ bool "Call board-specific initialization in VPL"
+ help
+ If this option is enabled, U-Boot will call the function
+ spl_board_init() from board_init_r(). This function should be
+ provided by the board.
+
+config VPL_CACHE
+ depends on CACHE
+ bool "Support cache drivers in VPL"
+ help
+ Enable support for cache drivers in VPL.
+
+config VPL_CRC32
+ bool "Support CRC32 in VPL"
+ default y if VPL_ENV_SUPPORT || VPL_BLOBLIST
+ help
+ Enable this to support CRC32 in uImages or FIT images within VPL.
+ This is a 32-bit checksum value that can be used to verify images.
+ For FIT images, this is the least secure type of checksum, suitable
+ for detected accidental image corruption. For secure applications you
+ should consider SHA1 or SHA256.
+
+config VPL_DM_SPI
+ bool "Support SPI DM drivers in VPL"
+ help
+ Enable support for SPI DM drivers in VPL.
+
+config VPL_DM_SPI_FLASH
+ bool "Support SPI DM FLASH drivers in VPL"
+ help
+ Enable support for SPI DM flash drivers in VPL.
+
+config VPL_FRAMEWORK
+ bool "Support VPL based upon the common SPL framework"
+ default y
+ help
+ Enable the SPL framework under common/spl/ for VPL builds.
+ This framework supports MMC, NAND and YMODEM and other methods
+ loading of U-Boot's next stage. If unsure, say Y.
+
+config VPL_HANDOFF
+ bool "Pass hand-off information from VPL to SPL"
+ depends on HANDOFF && VPL_BLOBLIST
+ default y
+ help
+ This option enables VPL to write handoff information. This can be
+ used to pass information like the size of SDRAM from VPL to SPL. Also
+ VPL can receive information from TPL in the same place if that is
+ enabled.
+
+config VPL_LIBCOMMON_SUPPORT
+ bool "Support common libraries"
+ default y if SPL_LIBCOMMON_SUPPORT
+ help
+ Enable support for common U-Boot libraries within VPL. See
+ SPL_LIBCOMMON_SUPPORT for details.
+
+config VPL_LIBGENERIC_SUPPORT
+ bool "Support generic libraries"
+ default y if SPL_LIBGENERIC_SUPPORT
+ help
+ Enable support for generic U-Boot libraries within VPL. These
+ libraries include generic code to deal with device tree, hashing,
+ printf(), compression and the like. This option is enabled on many
+ boards. Enable this option to build the code in lib/ as part of a
+ VPL build.
+
+config VPL_DRIVERS_MISC
+ bool "Support misc drivers"
+ default y if TPL_DRIVERS_MISC
+ help
+ Enable miscellaneous drivers in VPL. These drivers perform various
+ tasks that don't fall nicely into other categories, Enable this
+ option to build the drivers in drivers/misc as part of a VPL
+ build, for those that support building in VPL (not all drivers do).
+
+config VPL_ENV_SUPPORT
+ bool "Support an environment"
+ help
+ Enable environment support in VPL. The U-Boot environment provides
+ a number of settings (essentially name/value pairs) which can
+ control many aspects of U-Boot's operation. Enabling this option will
+ make env_get() and env_set() available in VSPL.
+
+config VPL_GPIO
+ bool "Support GPIO in VPL"
+ default y if SPL_GPIO
+ help
+ Enable support for GPIOs (General-purpose Input/Output) in VPL.
+ GPIOs allow U-Boot to read the state of an input line (high or
+ low) and set the state of an output line. This can be used to
+ drive LEDs, control power to various system parts and read user
+ input. GPIOs can be useful in VPL to enable a 'sign-of-life' LED,
+ for example. Enable this option to build the drivers in
+ drivers/gpio as part of a VPL build.
+
+config VPL_HANDOFF
+ bool "Pass hand-off information from VPL to SPL and U-Boot proper"
+ depends on HANDOFF && VPL_BLOBLIST
+ default y
+ help
+ This option enables VPL to write handoff information. This can be
+ used to pass information like the size of SDRAM from VPL to U-Boot
+ proper. The information is also available to VPL if it is useful
+ there.
+
+config VPL_HASH
+ bool "Support hashing drivers in VPL"
+ select SHA1
+ select SHA256
+ help
+ Enable hashing drivers in VPL. These drivers can be used to
+ accelerate secure boot processing in secure applications. Enable
+ this option to build system-specific drivers for hash acceleration
+ as part of a VPL build.
+
+config VPL_I2C_SUPPORT
+ bool "Support I2C in VPL"
+ default y if SPL_I2C_SUPPORT
+ help
+ Enable support for the I2C bus in VPL. Vee SPL_I2C_SUPPORT for
+ details.
+
+config VPL_PCH_SUPPORT
+ bool "Support PCH drivers"
+ default y if TPL_PCH_SUPPORT
+ help
+ Enable support for PCH (Platform Controller Hub) devices in VPL.
+ These are used to set up GPIOs and the SPI peripheral early in
+ boot. This enables the drivers in drivers/pch as part of a VPL
+ build.
+
+config VPL_PCI
+ bool "Support PCI drivers"
+ default y if SPL_PCI
+ help
+ Enable support for PCI in VPL. For platforms that need PCI to boot,
+ or must perform some init using PCI in VPL, this provides the
+ necessary driver support. This enables the drivers in drivers/pci
+ as part of a VPL build.
+
+config VPL_RTC
+ bool "Support RTC drivers"
+ help
+ Enable RTC (Real-time Clock) support in VPL. This includes support
+ for reading and setting the time. Some RTC devices also have some
+ non-volatile (battery-backed) memory which is accessible if
+ needed. This enables the drivers in drivers/rtc as part of a VPL
+ build.
+
+config VPL_SERIAL
+ bool "Support serial"
+ default y if TPL_SERIAL
+ select VPL_PRINTF
+ select VPL_STRTO
+ help
+ Enable support for serial in VPL. See SPL_SERIAL_SUPPORT for
+ details.
+
+config VPL_SIZE_LIMIT
+ hex "Maximum size of VPL image"
+ default 0x0
+ help
+ Specifies the maximum length of the U-Boot VPL image.
+ If this value is zero, it is ignored.
+
+config VPL_SPI
+ bool "Support SPI drivers"
+ help
+ Enable support for using SPI in VPL. See SPL_SPI_SUPPORT for
+ details.
+
+config VPL_SPI_FLASH_SUPPORT
+ bool "Support SPI flash drivers"
+ help
+ Enable support for using SPI flash in VPL, and loading U-Boot from
+ SPI flash. SPI flash (Serial Peripheral Bus flash) is named after
+ the SPI bus that is used to connect it to a system. It is a simple
+ but fast bidirectional 4-wire bus (clock, chip select and two data
+ lines). This enables the drivers in drivers/mtd/spi as part of a
+ VPL build. This normally requires VPL_SPI_SUPPORT.
+
+config VPL_TEXT_BASE
+ hex "VPL Text Base"
+ default 0x0
+ help
+ The address in memory that VPL will be running from.
+
+config VPL_BINMAN_SYMBOLS
+ bool "Declare binman symbols in VPL"
+ depends on VPL_FRAMEWORK && BINMAN
+ default y
+ help
+ This enables use of symbols in VPL which refer to other entries in
+ the same binman image as the VPL. These can be declared with the
+ binman_sym_declare(type, entry, prop) macro and accessed by the
+ binman_sym(type, entry, prop) macro defined in binman_sym.h.
+
+ See tools/binman/binman.rst for a detailed explanation.
+
+config VPL_BINMAN_UBOOT_SYMBOLS
+ bool "Declare binman symbols for U-Boot phases in VPL"
+ depends on VPL_BINMAN_SYMBOLS
+ default n if ARCH_IMX8M
+ default y
+ help
+ This enables use of symbols in VPL which refer to U-Boot phases,
+ enabling VPL to obtain the location and size of its next phase simply
+ by calling spl_get_image_pos() and spl_get_image_size().
+
+ For this to work, you must have all U-Boot phases in the same binman
+ image, so binman can update VPL with the locations of everything.
+
+endmenu
diff --git a/common/spl/spl.c b/common/spl/spl.c
index c8c463f80bd..29e0898f03d 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -19,6 +19,7 @@
#include <mapmem.h>
#include <serial.h>
#include <spl.h>
+#include <system-constants.h>
#include <asm/global_data.h>
#include <asm-generic/gpio.h>
#include <asm/u-boot.h>
@@ -33,12 +34,14 @@
#include <malloc.h>
#include <mapmem.h>
#include <dm/root.h>
+#include <dm/util.h>
#include <linux/compiler.h>
#include <fdt_support.h>
#include <bootcount.h>
#include <wdt.h>
DECLARE_GLOBAL_DATA_PTR;
+DECLARE_BINMAN_MAGIC_SYM;
#ifndef CONFIG_SYS_UBOOT_START
#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
@@ -50,11 +53,10 @@ DECLARE_GLOBAL_DATA_PTR;
u32 *boot_params_ptr = NULL;
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
+#if CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS)
/* See spl.h for information about this */
binman_sym_declare(ulong, u_boot_any, image_pos);
binman_sym_declare(ulong, u_boot_any, size);
-#endif
#ifdef CONFIG_TPL
binman_sym_declare(ulong, u_boot_spl, image_pos);
@@ -66,6 +68,8 @@ binman_sym_declare(ulong, u_boot_vpl, image_pos);
binman_sym_declare(ulong, u_boot_vpl, size);
#endif
+#endif /* BINMAN_UBOOT_SYMBOLS */
+
/* Define board data structure */
static struct bd_info bdata __attribute__ ((section(".data")));
@@ -148,9 +152,11 @@ void spl_fixup_fdt(void *fdt_blob)
#endif
}
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
ulong spl_get_image_pos(void)
{
+ if (!CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS))
+ return BINMAN_SYM_MISSING;
+
#ifdef CONFIG_VPL
if (spl_next_phase() == PHASE_VPL)
return binman_sym(ulong, u_boot_vpl, image_pos);
@@ -162,6 +168,9 @@ ulong spl_get_image_pos(void)
ulong spl_get_image_size(void)
{
+ if (!CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS))
+ return BINMAN_SYM_MISSING;
+
#ifdef CONFIG_VPL
if (spl_next_phase() == PHASE_VPL)
return binman_sym(ulong, u_boot_vpl, size);
@@ -170,7 +179,6 @@ ulong spl_get_image_size(void)
binman_sym(ulong, u_boot_spl, size) :
binman_sym(ulong, u_boot_any, size);
}
-#endif /* BINMAN_SYMBOLS */
ulong spl_get_image_text_base(void)
{
@@ -221,7 +229,7 @@ __weak struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
{
- ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+ ulong u_boot_pos = spl_get_image_pos();
spl_image->size = CONFIG_SYS_MONITOR_LEN;
@@ -728,9 +736,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
spl_set_bd();
-#if defined(CONFIG_SYS_SPL_MALLOC_START)
- mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
- CONFIG_SYS_SPL_MALLOC_SIZE);
+#if defined(CONFIG_SYS_SPL_MALLOC)
+ mem_malloc_init(SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE);
gd->flags |= GD_FLG_FULL_MALLOC_INIT;
#endif
if (!(gd->flags & GD_FLG_SPL_INIT)) {
@@ -780,6 +787,14 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
bootcount_inc();
+ /* Dump driver model states to aid analysis */
+ if (CONFIG_IS_ENABLED(DM_STATS)) {
+ struct dm_stats mem;
+
+ dm_get_mem(&mem);
+ dm_dump_mem(&mem);
+ }
+
memset(&spl_image, '\0', sizeof(spl_image));
#ifdef CONFIG_SYS_SPL_ARGS_ADDR
spl_image.arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 6116a68371a..f66147477e7 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -229,7 +229,7 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
{
int ret;
-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR)
+#if CONFIG_VAL(SYS_MMCSD_RAW_MODE_ARGS_SECTOR)
unsigned long count;
count = blk_dread(mmc_get_blk_desc(mmc),
diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index 067a2d42bbf..7986e930d28 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -74,8 +74,8 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
(void *)(CONFIG_SYS_OS_BASE +
sizeof(struct image_header)),
spl_image->size);
-#ifdef CONFIG_SYS_FDT_BASE
- spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
+#ifdef CONFIG_SYS_SPL_ARGS_ADDR
+ spl_image->arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
#endif
return 0;
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 82964592571..d64710878cf 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -70,7 +70,7 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
load.read = spl_ram_load_read;
spl_load_simple_fit(spl_image, &load, 0, header);
} else {
- ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+ ulong u_boot_pos = spl_get_image_pos();
debug("Legacy image\n");
/*
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 1f3a144cdfb..1351d78612a 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -21,10 +21,6 @@
#define CONFIG_SYS_SATA_FAT_BOOT_PARTITION 1
#endif
-#ifndef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
-#endif
-
#ifndef CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR
/* Dummy value to make the compiler happy */
#define CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR 0x100
@@ -73,21 +69,11 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
int err = 0;
struct blk_desc *stor_dev;
-#if !defined(CONFIG_DM_SCSI) && !defined(CONFIG_AHCI)
- err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
-#endif
- if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
- printf("spl: sata init failed: err - %d\n", err);
-#endif
- return err;
- } else {
- /* try to recognize storage devices immediately */
- scsi_scan(false);
- stor_dev = blk_get_devnum_by_type(IF_TYPE_SCSI, 0);
- if (!stor_dev)
- return -ENODEV;
- }
+ /* try to recognize storage devices immediately */
+ scsi_scan(false);
+ stor_dev = blk_get_devnum_by_type(IF_TYPE_SCSI, 0);
+ if (!stor_dev)
+ return -ENODEV;
#if CONFIG_IS_ENABLED(OS_BOOT)
if (spl_start_uboot() ||
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index cf3f7ef4c0d..3eef2f8d683 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -71,6 +71,16 @@ unsigned int __weak spl_spi_get_uboot_offs(struct spi_flash *flash)
return CONFIG_SYS_SPI_U_BOOT_OFFS;
}
+u32 __weak spl_spi_boot_bus(void)
+{
+ return CONFIG_SF_DEFAULT_BUS;
+}
+
+u32 __weak spl_spi_boot_cs(void)
+{
+ return CONFIG_SF_DEFAULT_CS;
+}
+
/*
* The main entry for SPI booting. It's necessary that SDRAM is already
* configured and available since this code loads the main U-Boot image
@@ -83,15 +93,15 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
unsigned int payload_offs;
struct spi_flash *flash;
struct image_header *header;
+ unsigned int sf_bus = spl_spi_boot_bus();
+ unsigned int sf_cs = spl_spi_boot_cs();
/*
* Load U-Boot image from SPI flash into RAM
* In DM mode: defaults speed and mode will be
* taken from DT when available
*/
-
- flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
- CONFIG_SF_DEFAULT_CS,
+ flash = spi_flash_probe(sf_bus, sf_cs,
CONFIG_SF_DEFAULT_SPEED,
CONFIG_SF_DEFAULT_MODE);
if (!flash) {
diff --git a/common/spl/spl_xip.c b/common/spl/spl_xip.c
index 33863fe7d45..e9a40b0ec79 100644
--- a/common/spl/spl_xip.c
+++ b/common/spl/spl_xip.c
@@ -14,7 +14,7 @@ static int spl_xip(struct spl_image_info *spl_image,
{
#if CONFIG_IS_ENABLED(OS_BOOT)
if (!spl_start_uboot()) {
- spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
+ spl_image->arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
spl_image->name = "Linux";
spl_image->os = IH_OS_LINUX;
spl_image->load_addr = CONFIG_SYS_LOAD_ADDR;
diff --git a/common/usb.c b/common/usb.c
index aad13fd9c55..6fcf1e8428e 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -49,10 +49,6 @@ char usb_started; /* flag for the started/stopped USB status */
static struct usb_device usb_dev[USB_MAX_DEVICE];
static int dev_index;
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
/***************************************************************************
* Init USB Device
*/