diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 29 | ||||
-rw-r--r-- | common/autoboot.c | 8 | ||||
-rw-r--r-- | common/bloblist.c | 1 | ||||
-rw-r--r-- | common/board_f.c | 10 | ||||
-rw-r--r-- | common/board_r.c | 2 | ||||
-rw-r--r-- | common/spl/Kconfig.vpl | 30 | ||||
-rw-r--r-- | common/spl/spl.c | 82 | ||||
-rw-r--r-- | common/spl/spl_atf.c | 2 | ||||
-rw-r--r-- | common/spl/spl_nand.c | 6 | ||||
-rw-r--r-- | common/spl/spl_optee.S | 2 |
10 files changed, 111 insertions, 61 deletions
diff --git a/common/Kconfig b/common/Kconfig index 62e7fb5d0e9..21434c5cf16 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -113,6 +113,28 @@ config SILENT_CONSOLE GD_FLG_SILENT flag is set. Changing the environment variable later will update the flag. +config SPL_SILENT_CONSOLE + bool "Use a silent console in SPL" + default y if SILENT_CONSOLE && !SANDBOX + help + This selects a silent console in SPL. When enabled it drops some + output messages. The GD_FLG_SILENT flag is not used in SPL so there + is no run-time control of console messages in SPL. + + Future work may allow the SPL console to be silenced completely using + this option. + +config TPL_SILENT_CONSOLE + bool "Use a silent console in TPL" + default y if SILENT_CONSOLE && !SANDBOX + help + This selects a silent console in TPL. When enabled it drops some + output messages. The GD_FLG_SILENT flag is not used in TPL so there + is no run-time control of console messages in TPL. + + Future work may allow the TPL console to be silenced completely using + this option. + config SILENT_U_BOOT_ONLY bool "Only silence the U-Boot console" depends on SILENT_CONSOLE @@ -1043,6 +1065,13 @@ config SPL_IMAGE_SIGN_INFO help Enable image_sign_info helper functions in SPL. +config VPL_IMAGE_SIGN_INFO + bool + select SHA1 + select SHA256 + help + Enable image_sign_info helper functions in SPL. + endif config FDT_SIMPLEFB diff --git a/common/autoboot.c b/common/autoboot.c index cdafe76309b..ea44fdf6add 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -424,19 +424,19 @@ static int abortboot(int bootdelay) static void process_fdt_options(const void *blob) { -#ifdef CONFIG_SYS_TEXT_BASE +#ifdef CONFIG_TEXT_BASE ulong addr; /* Add an env variable to point to a kernel payload, if available */ addr = ofnode_conf_read_int("kernel-offset", 0); if (addr) - env_set_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr)); + env_set_addr("kernaddr", (void *)(CONFIG_TEXT_BASE + addr)); /* Add an env variable to point to a root disk, if available */ addr = ofnode_conf_read_int("rootdisk-offset", 0); if (addr) - env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr)); -#endif /* CONFIG_SYS_TEXT_BASE */ + env_set_addr("rootaddr", (void *)(CONFIG_TEXT_BASE + addr)); +#endif /* CONFIG_TEXT_BASE */ } const char *bootdelay_process(void) diff --git a/common/bloblist.c b/common/bloblist.c index 8488663354b..0d63b6e8817 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -4,7 +4,6 @@ * Written by Simon Glass <sjg@chromium.org> */ -#define LOG_DEBUG #define LOG_CATEGORY LOGC_BLOBLIST #include <common.h> diff --git a/common/board_f.c b/common/board_f.c index 51ba5931899..faa096479b3 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -127,8 +127,8 @@ static int display_text_info(void) bss_start = (ulong)&__bss_start; bss_end = (ulong)&__bss_end; -#ifdef CONFIG_SYS_TEXT_BASE - text_base = CONFIG_SYS_TEXT_BASE; +#ifdef CONFIG_TEXT_BASE + text_base = CONFIG_TEXT_BASE; #else text_base = CONFIG_SYS_MONITOR_BASE; #endif @@ -689,7 +689,7 @@ static int reloc_bloblist(void) static int setup_reloc(void) { if (!(gd->flags & GD_FLG_SKIP_RELOC)) { -#ifdef CONFIG_SYS_TEXT_BASE +#ifdef CONFIG_TEXT_BASE #ifdef ARM gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start; #elif defined(CONFIG_MICROBLAZE) @@ -699,9 +699,9 @@ static int setup_reloc(void) * On all ColdFire arch cpu, monitor code starts always * just after the default vector table location, so at 0x400 */ - gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400); + gd->reloc_off = gd->relocaddr - (CONFIG_TEXT_BASE + 0x400); #elif !defined(CONFIG_SANDBOX) - gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE; + gd->reloc_off = gd->relocaddr - CONFIG_TEXT_BASE; #endif #endif } diff --git a/common/board_r.c b/common/board_r.c index 92ca2066ee3..98653de0553 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -369,7 +369,7 @@ static int initr_flash(void) #if defined(CONFIG_OXC) || defined(CONFIG_RMU) /* flash mapped at end of memory map */ - bd->bi_flashoffset = CONFIG_SYS_TEXT_BASE + flash_size; + bd->bi_flashoffset = CONFIG_TEXT_BASE + flash_size; #elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */ #endif diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index f33162276d9..ae1a3c724f3 100644 --- a/common/spl/Kconfig.vpl +++ b/common/spl/Kconfig.vpl @@ -133,6 +133,36 @@ config VPL_I2C_SUPPORT Enable support for the I2C bus in VPL. Vee SPL_I2C_SUPPORT for details. +config VPL_MMC + bool "Support MMC in VPL" + depends on VPL && MMC + default y if MMC + help + Enable support for MMC (Multimedia Card) within VPL This enables + the MMC protocol implementation and allows any enabled drivers to + be used within VPL. MMC can be used with or without disk partition + support depending on the application (SPL_LIBDISK_SUPPORT). Enable + this option to build the drivers in drivers/mmc as part of an VPL + build. + +config VPL_DM_MMC + bool "Enable MMC controllers using Driver Model in VPL" + depends on VPL_DM && DM_MMC + default y + help + This enables the MultiMediaCard (MMC) uclass which supports MMC and + Secure Digital I/O (SDIO) cards. Both removable (SD, micro-SD, etc.) + and non-removable (e.g. eMMC chip) devices are supported. These + appear as block devices in U-Boot and can support filesystems such + as EXT4 and FAT. + +config VPL_MMC_WRITE + bool "MMC/SD/SDIO card support for write operations in VPL" + depends on VPL_MMC + default y + help + Enable write access to MMC and SD Cards in VPL + config VPL_PCH_SUPPORT bool "Support PCH drivers" default y if TPL_PCH_SUPPORT diff --git a/common/spl/spl.c b/common/spl/spl.c index 752b5b247cb..6f2014b0e22 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -44,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR; DECLARE_BINMAN_MAGIC_SYM; #ifndef CONFIG_SYS_UBOOT_START -#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_UBOOT_START CONFIG_TEXT_BASE #endif #ifndef CONFIG_SYS_MONITOR_LEN /* Unknown U-Boot size, let's assume it will not be more than 200 KB */ @@ -59,13 +59,13 @@ binman_sym_declare(ulong, u_boot_any, image_pos); binman_sym_declare(ulong, u_boot_any, size); #ifdef CONFIG_TPL -binman_sym_declare(ulong, u_boot_spl, image_pos); -binman_sym_declare(ulong, u_boot_spl, size); +binman_sym_declare(ulong, u_boot_spl_any, image_pos); +binman_sym_declare(ulong, u_boot_spl_any, size); #endif #ifdef CONFIG_VPL -binman_sym_declare(ulong, u_boot_vpl, image_pos); -binman_sym_declare(ulong, u_boot_vpl, size); +binman_sym_declare(ulong, u_boot_vpl_any, image_pos); +binman_sym_declare(ulong, u_boot_vpl_any, size); #endif #endif /* BINMAN_UBOOT_SYMBOLS */ @@ -164,10 +164,10 @@ ulong spl_get_image_pos(void) #ifdef CONFIG_VPL if (spl_next_phase() == PHASE_VPL) - return binman_sym(ulong, u_boot_vpl, image_pos); + return binman_sym(ulong, u_boot_vpl_any, image_pos); #endif return spl_next_phase() == PHASE_SPL ? - binman_sym(ulong, u_boot_spl, image_pos) : + binman_sym(ulong, u_boot_spl_any, image_pos) : binman_sym(ulong, u_boot_any, image_pos); } @@ -178,10 +178,10 @@ ulong spl_get_image_size(void) #ifdef CONFIG_VPL if (spl_next_phase() == PHASE_VPL) - return binman_sym(ulong, u_boot_vpl, size); + return binman_sym(ulong, u_boot_vpl_any, size); #endif return spl_next_phase() == PHASE_SPL ? - binman_sym(ulong, u_boot_spl, size) : + binman_sym(ulong, u_boot_spl_any, size) : binman_sym(ulong, u_boot_any, size); } @@ -192,7 +192,7 @@ ulong spl_get_image_text_base(void) return CONFIG_VPL_TEXT_BASE; #endif return spl_next_phase() == PHASE_SPL ? CONFIG_SPL_TEXT_BASE : - CONFIG_SYS_TEXT_BASE; + CONFIG_TEXT_BASE; } /* @@ -229,7 +229,7 @@ __weak void spl_board_prepare_for_boot(void) __weak struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size) { - return map_sysmem(CONFIG_SYS_TEXT_BASE + offset, 0); + return map_sysmem(CONFIG_TEXT_BASE + offset, 0); } void spl_set_header_raw_uboot(struct spl_image_info *spl_image) @@ -249,7 +249,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) spl_image->load_addr = u_boot_pos; } else { spl_image->entry_point = CONFIG_SYS_UBOOT_START; - spl_image->load_addr = CONFIG_SYS_TEXT_BASE; + spl_image->load_addr = CONFIG_TEXT_BASE; } spl_image->os = IH_OS_U_BOOT; spl_image->name = "U-Boot"; @@ -630,23 +630,6 @@ __weak void board_boot_order(u32 *spl_boot_list) spl_boot_list[0] = spl_boot_device(); } -static struct spl_image_loader *spl_ll_find_loader(uint boot_device) -{ - struct spl_image_loader *drv = - ll_entry_start(struct spl_image_loader, spl_image_loader); - const int n_ents = - ll_entry_count(struct spl_image_loader, spl_image_loader); - struct spl_image_loader *entry; - - for (entry = drv; entry != drv + n_ents; entry++) { - if (boot_device == entry->boot_device) - return entry; - } - - /* Not found */ - return NULL; -} - __weak int spl_check_board_image(struct spl_image_info *spl_image, const struct spl_boot_device *bootdev) { @@ -693,6 +676,10 @@ static int spl_load_image(struct spl_image_info *spl_image, static int boot_from_devices(struct spl_image_info *spl_image, u32 spl_boot_list[], int count) { + struct spl_image_loader *drv = + ll_entry_start(struct spl_image_loader, spl_image_loader); + const int n_ents = + ll_entry_count(struct spl_image_loader, spl_image_loader); int ret = -ENODEV; int i; @@ -702,22 +689,27 @@ static int boot_from_devices(struct spl_image_info *spl_image, if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; - loader = spl_ll_find_loader(bootdev); - if (CONFIG_IS_ENABLED(SERIAL) && - CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && - !IS_ENABLED(CONFIG_SILENT_CONSOLE)) { - if (loader) - printf("Trying to boot from %s\n", - spl_loader_name(loader)); - else if (CONFIG_IS_ENABLED(SHOW_ERRORS)) - printf(SPL_TPL_PROMPT - "Unsupported Boot Device %d\n", bootdev); - else - puts(SPL_TPL_PROMPT "Unsupported Boot Device!\n"); - } - if (loader && !spl_load_image(spl_image, loader)) { - spl_image->boot_device = bootdev; - return 0; + for (loader = drv; loader != drv + n_ents; loader++) { + if (bootdev != loader->boot_device) + continue; + if (!CONFIG_IS_ENABLED(SILENT_CONSOLE)) { + if (loader) + printf("Trying to boot from %s\n", + spl_loader_name(loader)); + else if (CONFIG_IS_ENABLED(SHOW_ERRORS)) { + printf(SPL_TPL_PROMPT + "Unsupported Boot Device %d\n", + bootdev); + } else { + puts(SPL_TPL_PROMPT + "Unsupported Boot Device!\n"); + } + } + if (loader && + !spl_load_image(spl_image, loader)) { + spl_image->boot_device = bootdev; + return 0; + } } } diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index bae5c010c8c..2c10252834f 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -254,7 +254,7 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node) void spl_invoke_atf(struct spl_image_info *spl_image) { uintptr_t bl32_entry = 0; - uintptr_t bl33_entry = CONFIG_SYS_TEXT_BASE; + uintptr_t bl33_entry = CONFIG_TEXT_BASE; void *blob = spl_image->fdt_addr; uintptr_t platform_param = (uintptr_t)blob; int node; diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 4f4c00f2a1b..25a38be65ed 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -157,11 +157,11 @@ static int spl_nand_load_image(struct spl_image_info *spl_image, */ nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS, CONFIG_CMD_SPL_WRITE_SIZE, - (void *)CONFIG_SYS_TEXT_BASE); + (void *)CONFIG_TEXT_BASE); /* copy to destintion */ for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR, - src = (int *)CONFIG_SYS_TEXT_BASE; - src < (int *)(CONFIG_SYS_TEXT_BASE + + src = (int *)CONFIG_TEXT_BASE; + src < (int *)(CONFIG_TEXT_BASE + CONFIG_CMD_SPL_WRITE_SIZE); src++, dst++) { writel(readl(src), dst); diff --git a/common/spl/spl_optee.S b/common/spl/spl_optee.S index 8bd1949ddf3..a269904d386 100644 --- a/common/spl/spl_optee.S +++ b/common/spl/spl_optee.S @@ -7,6 +7,6 @@ #include <asm/assembler.h> ENTRY(spl_optee_entry) - ldr lr, =CONFIG_SYS_TEXT_BASE + ldr lr, =CONFIG_TEXT_BASE mov pc, r3 ENDPROC(spl_optee_entry) |