diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 6 | ||||
-rw-r--r-- | common/Makefile | 42 | ||||
-rw-r--r-- | common/bloblist.c | 6 | ||||
-rw-r--r-- | common/board_f.c | 10 | ||||
-rw-r--r-- | common/board_r.c | 35 | ||||
-rw-r--r-- | common/bootstage.c | 22 | ||||
-rw-r--r-- | common/cli_readline.c | 2 | ||||
-rw-r--r-- | common/console.c | 2 | ||||
-rw-r--r-- | common/cyclic.c | 3 | ||||
-rw-r--r-- | common/dlmalloc.c | 8 | ||||
-rw-r--r-- | common/hash.c | 2 | ||||
-rw-r--r-- | common/init/Makefile | 2 | ||||
-rw-r--r-- | common/spl/Kconfig | 5 | ||||
-rw-r--r-- | common/spl/Makefile | 58 | ||||
-rw-r--r-- | common/spl/spl.c | 65 | ||||
-rw-r--r-- | common/spl/spl_fit.c | 2 | ||||
-rw-r--r-- | common/spl/spl_legacy.c | 2 | ||||
-rw-r--r-- | common/splash_source.c | 2 | ||||
-rw-r--r-- | common/usb_kbd.c | 2 |
19 files changed, 144 insertions, 132 deletions
diff --git a/common/Kconfig b/common/Kconfig index c3a68e33def..e8d89bf6eb9 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -424,7 +424,7 @@ config LOGF_FUNC_PAD config LOG_SYSLOG bool "Log output to syslog server" - depends on NET + depends on NET || NET_LWIP help Enables a log driver which broadcasts log records via UDP port 514 to syslog servers. @@ -850,6 +850,7 @@ config AVB_VERIFY depends on LIBAVB depends on MMC depends on PARTITION_UUIDS + depends on FASTBOOT help This option enables compilation of bootloader-dependent operations, used by Android Verified Boot 2.0 library (libavb). Includes: @@ -927,6 +928,9 @@ config BOARD_RNG_SEED new seed for use on subsequent boots, and whether or not the kernel should account any entropy from the given seed. + Default seed size (64 bytes) can be overridden by a decimal + environment variable rng_seed_size. + endmenu menu "Update support" diff --git a/common/Makefile b/common/Makefile index d871113cbb9..2ee5ef9cc6e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -4,7 +4,7 @@ # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # core -ifndef CONFIG_SPL_BUILD +ifndef CONFIG_XPL_BUILD obj-y += init/ obj-y += main.o obj-y += exports.o @@ -42,12 +42,12 @@ obj-$(CONFIG_MENU) += menu.o obj-$(CONFIG_UPDATE_COMMON) += update.o obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o -endif # !CONFIG_SPL_BUILD +endif # !CONFIG_XPL_BUILD -obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o -obj-$(CONFIG_$(SPL_TPL_)BLOBLIST) += bloblist.o +obj-$(CONFIG_$(PHASE_)BOOTSTAGE) += bootstage.o +obj-$(CONFIG_$(PHASE_)BLOBLIST) += bloblist.o -ifdef CONFIG_SPL_BUILD +ifdef CONFIG_XPL_BUILD ifdef CONFIG_SPL_DFU obj-$(CONFIG_DFU_OVER_USB) += dfu.o endif @@ -58,31 +58,23 @@ obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o obj-$(CONFIG_SPL_MUSB_NEW) += usb.o obj-$(CONFIG_SPL_SPLASH_SCREEN) += splash.o obj-$(CONFIG_SPL_SPLASH_SOURCE) += splash_source.o -endif # CONFIG_SPL_BUILD +endif # CONFIG_XPL_BUILD #others obj-$(CONFIG_DDR_SPD) += ddr_spd.o obj-$(CONFIG_SPD_EEPROM) += ddr_spd.o obj-$(CONFIG_HWCONFIG) += hwconfig.o obj-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o -ifdef CONFIG_SPL_BUILD -ifdef CONFIG_TPL_BUILD -obj-$(CONFIG_TPL_SERIAL) += console.o -else -obj-$(CONFIG_SPL_SERIAL) += console.o -endif -else -obj-y += console.o -endif # CONFIG_SPL_BUILD +obj-$(CONFIG_$(PHASE_)SERIAL) += console.o obj-$(CONFIG_CROS_EC) += cros_ec.o obj-y += dlmalloc.o -obj-$(CONFIG_$(SPL_TPL_)SYS_MALLOC_F) += malloc_simple.o +obj-$(CONFIG_$(PHASE_)SYS_MALLOC_F) += malloc_simple.o -obj-$(CONFIG_$(SPL_TPL_)CYCLIC) += cyclic.o -obj-$(CONFIG_$(SPL_TPL_)EVENT) += event.o +obj-$(CONFIG_$(PHASE_)CYCLIC) += cyclic.o +obj-$(CONFIG_$(PHASE_)EVENT) += event.o -obj-$(CONFIG_$(SPL_TPL_)HASH) += hash.o +obj-$(CONFIG_$(PHASE_)HASH) += hash.o obj-$(CONFIG_IO_TRACE) += iotrace.o obj-y += memsize.o obj-y += stdio.o @@ -96,15 +88,15 @@ obj-$(CONFIG_FSL_DDR_INTERACTIVE) += cli_getch.o cli_simple.o cli_readline.o obj-$(CONFIG_STM32MP1_DDR_INTERACTIVE) += cli_getch.o cli_simple.o cli_readline.o obj-$(CONFIG_DFU_OVER_USB) += dfu.o obj-y += command.o -obj-$(CONFIG_$(SPL_TPL_)LOG) += log.o -obj-$(CONFIG_$(SPL_TPL_)LOG_CONSOLE) += log_console.o -obj-$(CONFIG_$(SPL_TPL_)LOG_SYSLOG) += log_syslog.o +obj-$(CONFIG_$(PHASE_)LOG) += log.o +obj-$(CONFIG_$(PHASE_)LOG_CONSOLE) += log_console.o +obj-$(CONFIG_$(PHASE_)LOG_SYSLOG) += log_syslog.o obj-y += s_record.o obj-$(CONFIG_CMD_LOADB) += xyzModem.o -obj-$(CONFIG_$(SPL_TPL_)YMODEM_SUPPORT) += xyzModem.o +obj-$(CONFIG_$(PHASE_)YMODEM_SUPPORT) += xyzModem.o -obj-$(CONFIG_$(SPL_TPL_)AVB_VERIFY) += avb_verify.o -obj-$(CONFIG_$(SPL_TPL_)STACKPROTECTOR) += stackprot.o +obj-$(CONFIG_$(PHASE_)AVB_VERIFY) += avb_verify.o +obj-$(CONFIG_$(PHASE_)STACKPROTECTOR) += stackprot.o obj-$(CONFIG_SCP03) += scp03.o obj-$(CONFIG_QFW) += qfw.o diff --git a/common/bloblist.c b/common/bloblist.c index cf1a3b8b62c..ec6ff7a5a93 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -504,15 +504,15 @@ int bloblist_init(void) * If U-Boot is not in the first phase, an existing bloblist must be * at a fixed address. */ - bool from_addr = fixed && !u_boot_first_phase(); + bool from_addr = fixed && !xpl_is_first_phase(); /* * If U-Boot is in the first phase that an arch custom routine should * install the bloblist passed from previous loader to this fixed * address. */ - bool from_boot_arg = fixed && u_boot_first_phase(); + bool from_boot_arg = fixed && xpl_is_first_phase(); - if (spl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST)) + if (xpl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST)) from_addr = false; if (fixed) addr = IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED, diff --git a/common/board_f.c b/common/board_f.c index 154675d0e40..98dc2591e1d 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -397,7 +397,7 @@ __weak int arch_reserve_mmu(void) static int reserve_video_from_videoblob(void) { - if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) { + if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && xpl_phase() > PHASE_SPL) { struct video_handoff *ho; int ret = 0; @@ -501,9 +501,9 @@ static unsigned long reserve_stack_aligned(size_t size) static int reserve_noncached(void) { /* - * The value of gd->start_addr_sp must match the value of malloc_start - * calculated in board_r.c:initr_malloc(), which is passed to - * dlmalloc.c:mem_malloc_init() and then used by + * The value of gd->start_addr_sp must match the value of + * mem_malloc_start calculated in board_r.c:initr_malloc(), which is + * passed to dlmalloc.c:mem_malloc_init() and then used by * cache.c:noncached_init() * * These calculations must match the code in cache.c:noncached_init() @@ -582,7 +582,7 @@ static int reserve_fdt(void) static int reserve_bootstage(void) { #ifdef CONFIG_BOOTSTAGE - int size = bootstage_get_size(); + int size = bootstage_get_size(true); gd->start_addr_sp = reserve_stack_aligned(size); gd->boardf->new_bootstage = map_sysmem(gd->start_addr_sp, size); diff --git a/common/board_r.c b/common/board_r.c index 4faaa202421..8a19817fa39 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -40,6 +40,7 @@ #include <initcall.h> #include <kgdb.h> #include <irq_func.h> +#include <led.h> #include <malloc.h> #include <mapmem.h> #include <miiphy.h> @@ -203,8 +204,7 @@ static int initr_malloc(void) */ start = gd->relocaddr - TOTAL_MALLOC_LEN; gd_set_malloc_start(start); - mem_malloc_init((ulong)map_sysmem(start, TOTAL_MALLOC_LEN), - TOTAL_MALLOC_LEN); + mem_malloc_init(start, TOTAL_MALLOC_LEN); return 0; } @@ -460,19 +460,30 @@ static int initr_malloc_bootparams(void) } #endif -#if defined(CONFIG_LED_STATUS) static int initr_status_led(void) { -#if defined(CONFIG_LED_STATUS_BOOT) - status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING); -#else status_led_init(); -#endif + return 0; } -#endif -#ifdef CONFIG_CMD_NET +static int initr_boot_led_blink(void) +{ + status_led_boot_blink(); + + led_boot_blink(); + + return 0; +} + +static int initr_boot_led_on(void) +{ + led_boot_on(); + + return 0; +} + +#if defined(CONFIG_CMD_NET) static int initr_net(void) { puts("Net: "); @@ -725,9 +736,8 @@ static init_fnc_t init_sequence_r[] = { #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K) timer_init, /* initialize timer */ #endif -#if defined(CONFIG_LED_STATUS) initr_status_led, -#endif + initr_boot_led_blink, /* PPC has a udelay(20) here dating from 2002. Why? */ #ifdef CONFIG_BOARD_LATE_INIT board_late_init, @@ -738,7 +748,7 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_PCI_ENDPOINT pci_ep_init, #endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET) INIT_FUNC_WATCHDOG_RESET initr_net, #endif @@ -750,6 +760,7 @@ static init_fnc_t init_sequence_r[] = { #if defined(CFG_PRAM) initr_mem, #endif + initr_boot_led_on, run_main_loop, }; diff --git a/common/bootstage.c b/common/bootstage.c index 49acc9078a6..c7bb204501a 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -351,7 +351,7 @@ void bootstage_report(void) } if (data->rec_count > RECORD_COUNT) printf("Overflowed internal boot id table by %d entries\n" - "Please increase CONFIG_(SPL_TPL_)BOOTSTAGE_RECORD_COUNT\n", + "Please increase CONFIG_(PHASE_)BOOTSTAGE_RECORD_COUNT\n", data->rec_count - RECORD_COUNT); puts("\nAccumulated time:\n"); @@ -473,7 +473,7 @@ int bootstage_unstash(const void *base, int size) if (data->rec_count + hdr->count > RECORD_COUNT) { debug("%s: Bootstage has %d records, we have space for %d\n" - "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n", + "Please increase CONFIG_(PHASE_)BOOTSTAGE_RECORD_COUNT\n", __func__, hdr->count, RECORD_COUNT - data->rec_count); return -ENOSPC; } @@ -489,7 +489,7 @@ int bootstage_unstash(const void *base, int size) for (rec = data->record + data->next_id, i = 0; i < hdr->count; i++, rec++) { rec->name = ptr; - if (spl_phase() == PHASE_SPL) + if (xpl_phase() == PHASE_SPL) rec->name = strdup(ptr); /* Assume no data corruption here */ @@ -520,17 +520,19 @@ int _bootstage_unstash_default(void) } #endif -int bootstage_get_size(void) +int bootstage_get_size(bool add_strings) { - struct bootstage_data *data = gd->bootstage; - struct bootstage_record *rec; int size; - int i; size = sizeof(struct bootstage_data); - for (rec = data->record, i = 0; i < data->rec_count; - i++, rec++) - size += strlen(rec->name) + 1; + if (add_strings) { + struct bootstage_data *data = gd->bootstage; + struct bootstage_record *rec; + int i; + + for (rec = data->record, i = 0; i < data->rec_count; i++, rec++) + size += strlen(rec->name) + 1; + } return size; } diff --git a/common/cli_readline.c b/common/cli_readline.c index 4cb82b40149..4e6797a1944 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -73,7 +73,7 @@ static char *delete_char (char *buffer, char *p, int *colp, int *np, int plen) #define getcmd_getch() getchar() #define getcmd_cbeep() getcmd_putch('\a') -#ifdef CONFIG_SPL_BUILD +#ifdef CONFIG_XPL_BUILD #define HIST_MAX 3 #define HIST_SIZE 32 #else diff --git a/common/console.c b/common/console.c index c9e206aec41..22224701e45 100644 --- a/common/console.c +++ b/common/console.c @@ -191,7 +191,7 @@ static int console_setfile(int file, struct stdio_dev * dev) /* Assign the new device (leaving the existing one started) */ stdio_devices[file] = dev; -#ifndef CONFIG_SPL_BUILD +#ifndef CONFIG_XPL_BUILD /* * Update monitor functions * (to use the console stuff by other applications) diff --git a/common/cyclic.c b/common/cyclic.c index ec38fad6775..196797fd61e 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -15,6 +15,7 @@ #include <linux/errno.h> #include <linux/list.h> #include <asm/global_data.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR; @@ -44,7 +45,7 @@ void cyclic_unregister(struct cyclic_info *cyclic) hlist_del(&cyclic->list); } -void cyclic_run(void) +static void cyclic_run(void) { struct cyclic_info *cyclic; struct hlist_node *tmp; diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 1ac7ce3f43c..cc4d3a0a028 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -16,6 +16,8 @@ #include <asm/global_data.h> #include <malloc.h> +#include <mapmem.h> +#include <string.h> #include <asm/io.h> #include <valgrind/memcheck.h> @@ -598,9 +600,9 @@ void *sbrk(ptrdiff_t increment) void mem_malloc_init(ulong start, ulong size) { - mem_malloc_start = start; - mem_malloc_end = start + size; - mem_malloc_brk = start; + mem_malloc_start = (ulong)map_sysmem(start, size); + mem_malloc_end = mem_malloc_start + size; + mem_malloc_brk = mem_malloc_start; #ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT malloc_init(); diff --git a/common/hash.c b/common/hash.c index ac63803fed9..db6925d6782 100644 --- a/common/hash.c +++ b/common/hash.c @@ -403,7 +403,7 @@ int hash_block(const char *algo_name, const void *data, unsigned int len, return 0; } -#if !defined(CONFIG_SPL_BUILD) && (defined(CONFIG_CMD_HASH) || \ +#if !defined(CONFIG_XPL_BUILD) && (defined(CONFIG_CMD_HASH) || \ defined(CONFIG_CMD_SHA1SUM) || defined(CONFIG_CMD_CRC32)) || \ defined(CONFIG_CMD_MD5SUM) /** diff --git a/common/init/Makefile b/common/init/Makefile index 853b56d1e57..224e092f88c 100644 --- a/common/init/Makefile +++ b/common/init/Makefile @@ -5,4 +5,4 @@ # obj-y += board_init.o -obj-$(CONFIG_$(SPL_TPL_)HANDOFF) += handoff.o +obj-$(CONFIG_$(PHASE_)HANDOFF) += handoff.o diff --git a/common/spl/Kconfig b/common/spl/Kconfig index c9a6d8410ed..045fcac10a5 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -271,6 +271,8 @@ config SPL_TEXT_BASE default 0x40200000 if OMAP34XX default 0x402F4000 if AM43XX default 0x402F0400 if AM33XX + default 0x00908000 if ARCH_MX6 + default 0x00912000 if ARCH_MX7 default 0x40301350 if OMAP54XX default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I default 0x20060 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2 @@ -1083,6 +1085,7 @@ config SPL_DM_SPI_FLASH config SPL_NET bool "Support networking" + depends on !NET_LWIP help Enable support for network devices (such as Ethernet) in SPL. This permits SPL to load U-Boot over a network link rather than @@ -1451,7 +1454,7 @@ config SPL_ATF help ATF(ARM Trusted Firmware) is a component for ARM AArch64 which is loaded by SPL (which is considered as BL2 in ATF terminology). - More detail at: https://github.com/ARM-software/arm-trusted-firmware + More detail at: https://github.com/TrustedFirmware-A/trusted-firmware-a config SPL_ATF_LOAD_IMAGE_V2 bool "Use the new LOAD_IMAGE_V2 parameter passing" diff --git a/common/spl/Makefile b/common/spl/Makefile index 137b18428bd..75123eb666b 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -6,36 +6,36 @@ # Based on common/Makefile. # -ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o -obj-$(CONFIG_$(SPL_TPL_)BOOTROM_SUPPORT) += spl_bootrom.o -obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += spl_fit.o -obj-$(CONFIG_$(SPL_TPL_)BLK_FS) += spl_blk_fs.o -obj-$(CONFIG_$(SPL_TPL_)LEGACY_IMAGE_FORMAT) += spl_legacy.o -obj-$(CONFIG_$(SPL_TPL_)NOR_SUPPORT) += spl_nor.o -obj-$(CONFIG_$(SPL_TPL_)XIP_SUPPORT) += spl_xip.o -obj-$(CONFIG_$(SPL_TPL_)YMODEM_SUPPORT) += spl_ymodem.o +ifdef CONFIG_XPL_BUILD +obj-$(CONFIG_$(PHASE_)FRAMEWORK) += spl.o +obj-$(CONFIG_$(PHASE_)BOOTROM_SUPPORT) += spl_bootrom.o +obj-$(CONFIG_$(PHASE_)LOAD_FIT) += spl_fit.o +obj-$(CONFIG_$(PHASE_)BLK_FS) += spl_blk_fs.o +obj-$(CONFIG_$(PHASE_)LEGACY_IMAGE_FORMAT) += spl_legacy.o +obj-$(CONFIG_$(PHASE_)NOR_SUPPORT) += spl_nor.o +obj-$(CONFIG_$(PHASE_)XIP_SUPPORT) += spl_xip.o +obj-$(CONFIG_$(PHASE_)YMODEM_SUPPORT) += spl_ymodem.o ifndef CONFIG_SPL_UBI -obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += spl_nand.o -obj-$(CONFIG_$(SPL_TPL_)ONENAND_SUPPORT) += spl_onenand.o +obj-$(CONFIG_$(PHASE_)NAND_SUPPORT) += spl_nand.o +obj-$(CONFIG_$(PHASE_)ONENAND_SUPPORT) += spl_onenand.o endif -obj-$(CONFIG_$(SPL_TPL_)UBI) += spl_ubi.o -obj-$(CONFIG_$(SPL_TPL_)NET) += spl_net.o -obj-$(CONFIG_$(SPL_TPL_)MMC) += spl_mmc.o -obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o -obj-$(CONFIG_$(SPL_TPL_)OPTEE_IMAGE) += spl_optee.o -obj-$(CONFIG_$(SPL_TPL_)OPENSBI) += spl_opensbi.o -obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o -obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o -obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o -obj-$(CONFIG_$(SPL_TPL_)LOAD_IMX_CONTAINER) += spl_imx_container.o -obj-$(CONFIG_$(SPL_TPL_)SATA) += spl_sata.o -obj-$(CONFIG_$(SPL_TPL_)NVME) += spl_nvme.o -obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += spl_semihosting.o -obj-$(CONFIG_$(SPL_TPL_)DFU) += spl_dfu.o -obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o -obj-$(CONFIG_$(SPL_TPL_)RAM_SUPPORT) += spl_ram.o -obj-$(CONFIG_$(SPL_TPL_)USB_SDP_SUPPORT) += spl_sdp.o +obj-$(CONFIG_$(PHASE_)UBI) += spl_ubi.o +obj-$(CONFIG_$(PHASE_)NET) += spl_net.o +obj-$(CONFIG_$(PHASE_)MMC) += spl_mmc.o +obj-$(CONFIG_$(PHASE_)ATF) += spl_atf.o +obj-$(CONFIG_$(PHASE_)OPTEE_IMAGE) += spl_optee.o +obj-$(CONFIG_$(PHASE_)OPENSBI) += spl_opensbi.o +obj-$(CONFIG_$(PHASE_)USB_STORAGE) += spl_usb.o +obj-$(CONFIG_$(PHASE_)FS_FAT) += spl_fat.o +obj-$(CONFIG_$(PHASE_)FS_EXT4) += spl_ext.o +obj-$(CONFIG_$(PHASE_)LOAD_IMX_CONTAINER) += spl_imx_container.o +obj-$(CONFIG_$(PHASE_)SATA) += spl_sata.o +obj-$(CONFIG_$(PHASE_)NVME) += spl_nvme.o +obj-$(CONFIG_$(PHASE_)SEMIHOSTING) += spl_semihosting.o +obj-$(CONFIG_$(PHASE_)DFU) += spl_dfu.o +obj-$(CONFIG_$(PHASE_)SPI_LOAD) += spl_spi.o +obj-$(CONFIG_$(PHASE_)RAM_SUPPORT) += spl_ram.o +obj-$(CONFIG_$(PHASE_)USB_SDP_SUPPORT) += spl_sdp.o endif -obj-$(CONFIG_$(SPL_TPL_)UPL) += spl_upl.o +obj-$(CONFIG_$(PHASE_)UPL) += spl_upl.o diff --git a/common/spl/spl.c b/common/spl/spl.c index c13b2b8f714..1ceb63daf31 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -97,9 +97,9 @@ __weak int dram_init_banksize(void) #if CONFIG_IS_ENABLED(OS_BOOT) __weak int spl_start_uboot(void) { - puts(SPL_TPL_PROMPT + puts(PHASE_PROMPT "Please implement spl_start_uboot() for your board\n"); - puts(SPL_TPL_PROMPT "Direct Linux boot not active!\n"); + puts(PHASE_PROMPT "Direct Linux boot not active!\n"); return 1; } @@ -140,13 +140,13 @@ void spl_fixup_fdt(void *fdt_blob) /* fixup the memory dt node */ err = fdt_shrink_to_minimum(fdt_blob, 0); if (err == 0) { - printf(SPL_TPL_PROMPT "fdt_shrink_to_minimum err - %d\n", err); + printf(PHASE_PROMPT "fdt_shrink_to_minimum err - %d\n", err); return; } err = arch_fixup_fdt(fdt_blob); if (err) { - printf(SPL_TPL_PROMPT "arch_fixup_fdt err - %d\n", err); + printf(PHASE_PROMPT "arch_fixup_fdt err - %d\n", err); return; } #endif @@ -176,10 +176,10 @@ ulong spl_get_image_pos(void) return BINMAN_SYM_MISSING; #ifdef CONFIG_VPL - if (spl_next_phase() == PHASE_VPL) + if (xpl_next_phase() == PHASE_VPL) return binman_sym(ulong, u_boot_vpl_any, image_pos); #endif - return spl_next_phase() == PHASE_SPL ? + return xpl_next_phase() == PHASE_SPL ? binman_sym(ulong, u_boot_spl_any, image_pos) : binman_sym(ulong, u_boot_any, image_pos); } @@ -190,10 +190,10 @@ ulong spl_get_image_size(void) return BINMAN_SYM_MISSING; #ifdef CONFIG_VPL - if (spl_next_phase() == PHASE_VPL) + if (xpl_next_phase() == PHASE_VPL) return binman_sym(ulong, u_boot_vpl_any, size); #endif - return spl_next_phase() == PHASE_SPL ? + return xpl_next_phase() == PHASE_SPL ? binman_sym(ulong, u_boot_spl_any, size) : binman_sym(ulong, u_boot_any, size); } @@ -201,10 +201,10 @@ ulong spl_get_image_size(void) ulong spl_get_image_text_base(void) { #ifdef CONFIG_VPL - if (spl_next_phase() == PHASE_VPL) + if (xpl_next_phase() == PHASE_VPL) return CONFIG_VPL_TEXT_BASE; #endif - return spl_next_phase() == PHASE_SPL ? CONFIG_SPL_TEXT_BASE : + return xpl_next_phase() == PHASE_SPL ? CONFIG_SPL_TEXT_BASE : CONFIG_TEXT_BASE; } @@ -330,7 +330,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr = start; spl_image->entry_point = start; spl_image->size = size; - debug(SPL_TPL_PROMPT + debug(PHASE_PROMPT "payload Image, load addr: 0x%lx size: %d\n", spl_image->load_addr, spl_image->size); return 0; @@ -344,7 +344,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr = CONFIG_SYS_LOAD_ADDR; spl_image->entry_point = CONFIG_SYS_LOAD_ADDR; spl_image->size = end - start; - debug(SPL_TPL_PROMPT + debug(PHASE_PROMPT "payload zImage, load addr: 0x%lx size: %d\n", spl_image->load_addr, spl_image->size); return 0; @@ -423,7 +423,7 @@ static int write_spl_handoff(void) ret = handoff_arch_save(ho); if (ret) return ret; - debug(SPL_TPL_PROMPT "Wrote SPL handoff\n"); + debug(PHASE_PROMPT "Wrote SPL handoff\n"); return 0; } @@ -441,7 +441,7 @@ static inline int write_spl_handoff(void) { return 0; } */ static enum bootstage_id get_bootstage_id(bool start) { - enum u_boot_phase phase = spl_phase(); + enum xpl_phase_t phase = xpl_phase(); if (IS_ENABLED(CONFIG_TPL_BUILD) && phase == PHASE_TPL) return start ? BOOTSTAGE_ID_START_TPL : BOOTSTAGE_ID_END_TPL; @@ -464,19 +464,18 @@ static int spl_common_init(bool setup_malloc) gd->malloc_ptr = 0; } #endif - ret = bootstage_init(u_boot_first_phase()); + ret = bootstage_init(xpl_is_first_phase()); if (ret) { debug("%s: Failed to set up bootstage: ret=%d\n", __func__, ret); return ret; } - if (!u_boot_first_phase()) { + if (!xpl_is_first_phase()) { ret = bootstage_unstash_default(); if (ret) log_debug("Failed to unstash bootstage: ret=%d\n", ret); } - bootstage_mark_name(get_bootstage_id(true), - spl_phase_name(spl_phase())); + bootstage_mark_name(get_bootstage_id(true), xpl_name(xpl_phase())); #if CONFIG_IS_ENABLED(LOG) ret = log_init(); if (ret) { @@ -493,7 +492,7 @@ static int spl_common_init(bool setup_malloc) } if (CONFIG_IS_ENABLED(DM)) { bootstage_start(BOOTSTAGE_ID_ACCUM_DM_SPL, - spl_phase() == PHASE_TPL ? "dm tpl" : "dm_spl"); + xpl_phase() == PHASE_TPL ? "dm tpl" : "dm_spl"); /* With CONFIG_SPL_OF_PLATDATA, bring in all devices */ ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA)); bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_SPL); @@ -624,11 +623,11 @@ static int boot_from_devices(struct spl_image_info *spl_image, printf("Trying to boot from %s\n", spl_loader_name(loader)); else if (CONFIG_IS_ENABLED(SHOW_ERRORS)) { - printf(SPL_TPL_PROMPT + printf(PHASE_PROMPT "Unsupported Boot Device %d\n", bootdev); } else { - puts(SPL_TPL_PROMPT + puts(PHASE_PROMPT "Unsupported Boot Device!\n"); } } @@ -674,14 +673,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2) struct spl_image_info spl_image; int ret, os; - debug(">>" SPL_TPL_PROMPT "board_init_r()\n"); + debug(">>" PHASE_PROMPT "board_init_r()\n"); spl_set_bd(); if (IS_ENABLED(CONFIG_SPL_SYS_MALLOC)) { - mem_malloc_init((ulong)map_sysmem(SPL_SYS_MALLOC_START, - SPL_SYS_MALLOC_SIZE), - SPL_SYS_MALLOC_SIZE); + mem_malloc_init(SPL_SYS_MALLOC_START, SPL_SYS_MALLOC_SIZE); gd->flags |= GD_FLG_FULL_MALLOC_INIT; } if (!(gd->flags & GD_FLG_SPL_INIT)) { @@ -694,7 +691,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) if (ret) { debug("%s: Failed to set up bloblist: ret=%d\n", __func__, ret); - puts(SPL_TPL_PROMPT "Cannot set up bloblist\n"); + puts(PHASE_PROMPT "Cannot set up bloblist\n"); hang(); } } @@ -703,7 +700,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) ret = setup_spl_handoff(); if (ret) { - puts(SPL_TPL_PROMPT "Cannot set up SPL handoff\n"); + puts(PHASE_PROMPT "Cannot set up SPL handoff\n"); hang(); } } @@ -724,7 +721,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) if (CONFIG_IS_ENABLED(PCI) && !(gd->flags & GD_FLG_DM_DEAD)) { ret = pci_init(); if (ret) - puts(SPL_TPL_PROMPT "Cannot initialize PCI\n"); + puts(PHASE_PROMPT "Cannot initialize PCI\n"); /* Don't fail. We still can try other boot methods. */ } @@ -751,10 +748,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2) ARRAY_SIZE(spl_boot_list)); if (ret) { if (CONFIG_IS_ENABLED(SHOW_ERRORS)) - printf(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n", + printf(PHASE_PROMPT "failed to boot from all boot devices (err=%d)\n", ret); else - puts(SPL_TPL_PROMPT "failed to boot from all boot devices\n"); + puts(PHASE_PROMPT "failed to boot from all boot devices\n"); hang(); } @@ -762,7 +759,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) os = spl_image.os; if (os == IH_OS_U_BOOT) { - debug("Jumping to %s...\n", spl_phase_name(spl_next_phase())); + debug("Jumping to %s...\n", xpl_name(xpl_next_phase())); } else if (CONFIG_IS_ENABLED(ATF) && os == IH_OS_ARM_TRUSTED_FIRMWARE) { debug("Jumping to U-Boot via ARM Trusted Firmware\n"); spl_fixup_fdt(spl_image_fdt_addr(&spl_image)); @@ -808,13 +805,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2) if (CONFIG_IS_ENABLED(HANDOFF)) { ret = write_spl_handoff(); if (ret) - printf(SPL_TPL_PROMPT + printf(PHASE_PROMPT "SPL hand-off write failed (err=%d)\n", ret); } if (CONFIG_IS_ENABLED(UPL_OUT) && (gd->flags & GD_FLG_UPL)) { ret = spl_write_upl_handoff(&spl_image); if (ret) { - printf(SPL_TPL_PROMPT + printf(PHASE_PROMPT "UPL hand-off write failed (err=%d)\n", ret); hang(); } @@ -844,7 +841,7 @@ void preloader_console_init(void) gd->flags |= GD_FLG_HAVE_CONSOLE; #if CONFIG_IS_ENABLED(BANNER_PRINT) - puts("\nU-Boot " SPL_TPL_NAME " " PLAIN_VERSION " (" U_BOOT_DATE " - " + puts("\nU-Boot " PHASE_NAME " " PLAIN_VERSION " (" U_BOOT_DATE " - " U_BOOT_TIME " " U_BOOT_TZ ")\n"); #endif #ifdef CONFIG_SPL_DISPLAY_PRINT diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 1ad5a69d807..3160f573bfb 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -904,7 +904,7 @@ int spl_load_fit_image(struct spl_image_info *spl_image, spl_image->os = IH_OS_INVALID; spl_image->name = genimg_get_os_name(spl_image->os); - debug(SPL_TPL_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n", + debug(PHASE_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n", spl_image->name, spl_image->load_addr, spl_image->size); #ifdef CONFIG_SPL_FIT_SIGNATURE diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c index a77893455f2..9252b3a3de0 100644 --- a/common/spl/spl_legacy.c +++ b/common/spl/spl_legacy.c @@ -71,7 +71,7 @@ int spl_parse_legacy_header(struct spl_image_info *spl_image, spl_image->os = image_get_os(header); spl_image->name = image_get_name(header); - debug(SPL_TPL_PROMPT + debug(PHASE_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n", spl_image->name, spl_image->load_addr, spl_image->size); diff --git a/common/splash_source.c b/common/splash_source.c index 5b271160449..f43e7cc1be7 100644 --- a/common/splash_source.c +++ b/common/splash_source.c @@ -215,7 +215,7 @@ static int splash_init_virtio(void) } } -#if defined(CONFIG_CMD_UBIFS) && !defined(CONFIG_SPL_BUILD) +#if defined(CONFIG_CMD_UBIFS) && !defined(CONFIG_XPL_BUILD) static int splash_mount_ubifs(struct splash_location *location) { int res; diff --git a/common/usb_kbd.c b/common/usb_kbd.c index bbfee23bc26..36107a3b278 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -423,7 +423,7 @@ static int usb_kbd_testc(struct stdio_dev *sdev) */ unsigned long poll_delay = CONFIG_SYS_HZ / 50; -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_LWIP) /* * If net_busy_flag is 1, NET transfer is running, * then we check key-pressed every second (first check may be |