diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 230 | ||||
-rw-r--r-- | common/board_r.c | 252 | ||||
-rw-r--r-- | common/cli_hush.c | 6 | ||||
-rw-r--r-- | common/cli_hush_upstream.c | 6 | ||||
-rw-r--r-- | common/console.c | 2 | ||||
-rw-r--r-- | common/cyclic.c | 3 | ||||
-rw-r--r-- | common/iomux.c | 2 | ||||
-rw-r--r-- | common/spl/Kconfig | 3 |
8 files changed, 266 insertions, 238 deletions
diff --git a/common/board_f.c b/common/board_f.c index c4561874496..bff465d9cb2 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -38,6 +38,7 @@ #include <spl.h> #include <status_led.h> #include <sysreset.h> +#include <time.h> #include <timer.h> #include <trace.h> #include <upl.h> @@ -476,6 +477,13 @@ static int reserve_trace(void) static int reserve_uboot(void) { + /* + * This should be the first place GD_FLG_SKIP_RELOC is read from. + * Set GD_FLG_SKIP_RELOC flag if CONFIG_SKIP_RELOCATE is enabled. + */ + if (CONFIG_IS_ENABLED(SKIP_RELOCATE)) + gd->flags |= GD_FLG_SKIP_RELOC; + if (!(gd->flags & GD_FLG_SKIP_RELOC)) { /* * reserve memory for U-Boot code, data & bss @@ -753,7 +761,7 @@ static int setup_reloc(void) return 0; } -#ifdef CONFIG_OF_BOARD_FIXUP +#if CONFIG_IS_ENABLED(OF_BOARD_FIXUP) static int fix_fdt(void) { return board_fix_fdt((void *)gd->fdt_blob); @@ -881,81 +889,86 @@ static int initf_upl(void) return 0; } -static const init_fnc_t init_sequence_f[] = { - setup_mon_len, -#ifdef CONFIG_OF_CONTROL - fdtdec_setup, +static void initcall_run_f(void) +{ + /* + * Please do not add logic to this function (variables, if (), etc.). + * For simplicity it should remain an ordered list of function calls. + */ + INITCALL(setup_mon_len); +#if CONFIG_IS_ENABLED(OF_CONTROL) + INITCALL(fdtdec_setup); #endif -#ifdef CONFIG_TRACE_EARLY - trace_early_init, +#if CONFIG_IS_ENABLED(TRACE_EARLY) + INITCALL(trace_early_init); #endif - initf_malloc, - initf_upl, - log_init, - initf_bootstage, /* uses its own timer, so does not need DM */ - event_init, - bloblist_maybe_init, - setup_spl_handoff, -#if defined(CONFIG_CONSOLE_RECORD_INIT_F) - console_record_init, + INITCALL(initf_malloc); + INITCALL(initf_upl); + INITCALL(log_init); + INITCALL(initf_bootstage); /* uses its own timer, so does not need DM */ + INITCALL(event_init); + INITCALL(bloblist_maybe_init); + INITCALL(setup_spl_handoff); +#if CONFIG_IS_ENABLED(CONSOLE_RECORD_INIT_F) + INITCALL(console_record_init); #endif - INITCALL_EVENT(EVT_FSP_INIT_F), - arch_cpu_init, /* basic arch cpu dependent setup */ - mach_cpu_init, /* SoC/machine dependent CPU setup */ - initf_dm, -#if defined(CONFIG_BOARD_EARLY_INIT_F) - board_early_init_f, + INITCALL_EVT(EVT_FSP_INIT_F); + INITCALL(arch_cpu_init); /* basic arch cpu dependent setup */ + INITCALL(mach_cpu_init); /* SoC/machine dependent CPU setup */ + INITCALL(initf_dm); +#if CONFIG_IS_ENABLED(BOARD_EARLY_INIT_F) + INITCALL(board_early_init_f); #endif #if defined(CONFIG_PPC) || defined(CONFIG_SYS_FSL_CLK) || defined(CONFIG_M68K) /* get CPU and bus clocks according to the environment variable */ - get_clocks, /* get CPU and bus clocks (etc.) */ + INITCALL(get_clocks); /* get CPU and bus clocks (etc.) */ #endif #if !defined(CONFIG_M68K) || (defined(CONFIG_M68K) && !defined(CONFIG_MCFTMR)) - timer_init, /* initialize timer */ + INITCALL(timer_init); /* initialize timer */ #endif -#if defined(CONFIG_BOARD_POSTCLK_INIT) - board_postclk_init, +#if CONFIG_IS_ENABLED(BOARD_POSTCLK_INIT) + INITCALL(board_postclk_init); #endif - env_init, /* initialize environment */ - init_baud_rate, /* initialze baudrate settings */ - serial_init, /* serial communications setup */ - console_init_f, /* stage 1 init of console */ - display_options, /* say that we are here */ - display_text_info, /* show debugging info if required */ - checkcpu, -#if defined(CONFIG_SYSRESET) - print_resetinfo, + INITCALL(env_init); /* initialize environment */ + INITCALL(init_baud_rate); /* initialze baudrate settings */ + INITCALL(serial_init); /* serial communications setup */ + INITCALL(console_init_f); /* stage 1 init of console */ + INITCALL(display_options); /* say that we are here */ + INITCALL(display_text_info); /* show debugging info if required */ + INITCALL(checkcpu); +#if CONFIG_IS_ENABLED(SYSRESET) + INITCALL(print_resetinfo); #endif -#if defined(CONFIG_DISPLAY_CPUINFO) - print_cpuinfo, /* display cpu info (and speed) */ + /* display cpu info (and speed) */ +#if CONFIG_IS_ENABLED(DISPLAY_CPUINFO) + INITCALL(print_cpuinfo); #endif -#if defined(CONFIG_DTB_RESELECT) - embedded_dtb_select, +#if CONFIG_IS_ENABLED(DTB_RESELECT) + INITCALL(embedded_dtb_select); #endif -#if defined(CONFIG_DISPLAY_BOARDINFO) - show_board_info, +#if CONFIG_IS_ENABLED(DISPLAY_BOARDINFO) + INITCALL(show_board_info); #endif - INIT_FUNC_WATCHDOG_INIT - INITCALL_EVENT(EVT_MISC_INIT_F), - INIT_FUNC_WATCHDOG_RESET + WATCHDOG_INIT(); + INITCALL_EVT(EVT_MISC_INIT_F); + WATCHDOG_RESET(); #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) - init_func_i2c, + INITCALL(init_func_i2c); #endif - announce_dram_init, - dram_init, /* configure available RAM banks */ -#ifdef CONFIG_POST - post_init_f, + INITCALL(announce_dram_init); + INITCALL(dram_init); /* configure available RAM banks */ +#if CONFIG_IS_ENABLED(POST) + INITCALL(post_init_f); #endif - INIT_FUNC_WATCHDOG_RESET + WATCHDOG_RESET(); #if defined(CFG_SYS_DRAM_TEST) - testdram, + INITCALL(testdram); #endif /* CFG_SYS_DRAM_TEST */ - INIT_FUNC_WATCHDOG_RESET - -#ifdef CONFIG_POST - init_post, + WATCHDOG_RESET(); +#if CONFIG_IS_ENABLED(POST) + INITCALL(init_post); #endif - INIT_FUNC_WATCHDOG_RESET + WATCHDOG_RESET(); /* * Now that we have DRAM mapped and working, we can * relocate the code and continue running from DRAM. @@ -968,48 +981,51 @@ static const init_fnc_t init_sequence_f[] = { * - monitor code * - board info struct */ - setup_dest_addr, -#if defined(CONFIG_OF_BOARD_FIXUP) && !defined(CONFIG_OF_INITIAL_DTB_READONLY) - fix_fdt, + INITCALL(setup_dest_addr); +#if CONFIG_IS_ENABLED(OF_BOARD_FIXUP) && \ + !CONFIG_IS_ENABLED(OF_INITIAL_DTB_READONLY) + INITCALL(fix_fdt); #endif #ifdef CFG_PRAM - reserve_pram, + INITCALL(reserve_pram); #endif - reserve_round_4k, - setup_relocaddr_from_bloblist, - arch_reserve_mmu, - reserve_video, - reserve_trace, - reserve_uboot, - reserve_malloc, - reserve_board, - reserve_global_data, - reserve_fdt, -#if defined(CONFIG_OF_BOARD_FIXUP) && defined(CONFIG_OF_INITIAL_DTB_READONLY) - reloc_fdt, - fix_fdt, + INITCALL(reserve_round_4k); + INITCALL(setup_relocaddr_from_bloblist); + INITCALL(arch_reserve_mmu); + INITCALL(reserve_video); + INITCALL(reserve_trace); + INITCALL(reserve_uboot); + INITCALL(reserve_malloc); + INITCALL(reserve_board); + INITCALL(reserve_global_data); + INITCALL(reserve_fdt); +#if CONFIG_IS_ENABLED(OF_BOARD_FIXUP) && \ + CONFIG_IS_ENABLED(OF_INITIAL_DTB_READONLY) + INITCALL(reloc_fdt); + INITCALL(fix_fdt); #endif - reserve_bootstage, - reserve_bloblist, - reserve_arch, - reserve_stacks, - dram_init_banksize, - show_dram_config, - INIT_FUNC_WATCHDOG_RESET - setup_bdinfo, - display_new_sp, - INIT_FUNC_WATCHDOG_RESET -#if !defined(CONFIG_OF_BOARD_FIXUP) || !defined(CONFIG_OF_INITIAL_DTB_READONLY) - reloc_fdt, + INITCALL(reserve_bootstage); + INITCALL(reserve_bloblist); + INITCALL(reserve_arch); + INITCALL(reserve_stacks); + INITCALL(dram_init_banksize); + INITCALL(show_dram_config); + WATCHDOG_RESET(); + INITCALL(setup_bdinfo); + INITCALL(display_new_sp); + WATCHDOG_RESET(); +#if !CONFIG_IS_ENABLED(OF_BOARD_FIXUP) || \ + !CONFIG_IS_ENABLED(INITIAL_DTB_READONLY) + INITCALL(reloc_fdt); #endif - reloc_bootstage, - reloc_bloblist, - setup_reloc, -#if defined(CONFIG_X86) || defined(CONFIG_ARC) - copy_uboot_to_ram, - do_elf_reloc_fixups, + INITCALL(reloc_bootstage); + INITCALL(reloc_bloblist); + INITCALL(setup_reloc); +#if CONFIG_IS_ENABLED(X86) || CONFIG_IS_ENABLED(ARC) + INITCALL(copy_uboot_to_ram); + INITCALL(do_elf_reloc_fixups); #endif - clear_bss, + INITCALL(clear_bss); /* * Deregister all cyclic functions before relocation, so that * gd->cyclic_list does not contain any references to pre-relocation @@ -1019,12 +1035,11 @@ static const init_fnc_t init_sequence_f[] = { * This should happen as late as possible so that the window where a * watchdog device is not serviced is as small as possible. */ - cyclic_unregister_all, -#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) - jump_to_copy, + INITCALL(cyclic_unregister_all); +#if !CONFIG_IS_ENABLED(ARM) && !CONFIG_IS_ENABLED(SANDBOX) + INITCALL(jump_to_copy); #endif - NULL, -}; +} void board_init_f(ulong boot_flags) { @@ -1034,8 +1049,7 @@ void board_init_f(ulong boot_flags) gd->flags &= ~GD_FLG_HAVE_CONSOLE; gd->boardf = &boardf; - if (initcall_run_list(init_sequence_f)) - hang(); + initcall_run_f(); #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \ !defined(CONFIG_EFI_APP) && !CONFIG_IS_ENABLED(X86_64) && \ @@ -1049,8 +1063,8 @@ void board_init_f(ulong boot_flags) /* * For now this code is only used on x86. * - * init_sequence_f_r is the list of init functions which are run when - * U-Boot is executing from Flash with a semi-limited 'C' environment. + * Run init functions which are run when U-Boot is executing from Flash with a + * semi-limited 'C' environment. * The following limitations must be considered when implementing an * '_f_r' function: * - 'static' variables are read-only @@ -1063,18 +1077,16 @@ void board_init_f(ulong boot_flags) * NOTE: At present only x86 uses this route, but it is intended that * all archs will move to this when generic relocation is implemented. */ -static const init_fnc_t init_sequence_f_r[] = { -#if !CONFIG_IS_ENABLED(X86_64) - init_cache_f_r, +static void initcall_run_f_r(void) +{ +#if CONFIG_IS_ENABLED(X86_64) + INITCALL(init_cache_f_r); #endif - - NULL, -}; +} void board_init_f_r(void) { - if (initcall_run_list(init_sequence_f_r)) - hang(); + initcall_run_f_r(); /* * The pre-relocation drivers may be using memory that has now gone diff --git a/common/board_r.c b/common/board_r.c index 8d69db1875d..b90a4d9ff69 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -169,7 +169,8 @@ static int initr_reloc_global_data(void) */ efi_save_gd(); - efi_runtime_relocate(gd->relocaddr, NULL); + if (!(gd->flags & GD_FLG_SKIP_RELOC)) + efi_runtime_relocate(gd->relocaddr, NULL); #endif /* @@ -508,7 +509,7 @@ static int initr_boot_led_on(void) return 0; } -#if defined(CONFIG_CMD_NET) +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP) static int initr_net(void) { puts("Net: "); @@ -602,21 +603,24 @@ static int run_main_loop(void) } /* - * Over time we hope to remove these functions with code fragments and - * stub functions, and instead call the relevant function directly. - * - * We also hope to remove most of the driver-related init and do it if/when - * the driver is later used. + * Over time we hope to remove most of the driver-related init and do it + * if/when the driver is later used. * * TODO: perhaps reset the watchdog in the initcall function after each call? */ -static init_fnc_t init_sequence_r[] = { - initr_trace, - initr_reloc, - event_init, + +static void initcall_run_r(void) +{ + /* + * Please do not add logic to this function (variables, if (), etc.). + * For simplicity it should remain an ordered list of function calls. + */ + INITCALL(initr_trace); + INITCALL(initr_reloc); + INITCALL(event_init); /* TODO: could x86/PPC have this also perhaps? */ -#if defined(CONFIG_ARM) || defined(CONFIG_RISCV) - initr_caches, +#if CONFIG_IS_ENABLED(ARM) || CONFIG_IS_ENABLED(RISCV) + INITCALL(initr_caches); /* Note: For Freescale LS2 SoCs, new MMU table is created in DDR. * A temporary mapping of IFC high region is since removed, * so environmental variables in NOR flash is not available @@ -624,29 +628,30 @@ static init_fnc_t init_sequence_r[] = { * region. */ #endif - initr_reloc_global_data, -#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) - initr_unlock_ram_in_cache, + INITCALL(initr_reloc_global_data); +#if CONFIG_IS_ENABLED(SYS_INIT_RAM_LOCK) && CONFIG_IS_ENABLED(E500) + INITCALL(initr_unlock_ram_in_cache); #endif - initr_barrier, - initr_malloc, - log_init, - initr_bootstage, /* Needs malloc() but has its own timer */ -#if defined(CONFIG_CONSOLE_RECORD) - console_record_init, + INITCALL(initr_barrier); + INITCALL(initr_malloc); + INITCALL(log_init); + INITCALL(initr_bootstage); /* Needs malloc() but has its own timer */ +#if CONFIG_IS_ENABLED(CONSOLE_RECORD) + INITCALL(console_record_init); #endif -#ifdef CONFIG_SYS_NONCACHED_MEMORY - noncached_init, +#if CONFIG_IS_ENABLED(SYS_HAS_NONCACHED_MEMORY) + INITCALL(noncached_init); #endif - initr_of_live, -#ifdef CONFIG_DM - initr_dm, + INITCALL(initr_of_live); +#if CONFIG_IS_ENABLED(DM) + INITCALL(initr_dm); #endif -#ifdef CONFIG_ADDR_MAP - init_addr_map, +#if CONFIG_IS_ENABLED(ADDR_MAP) + INITCALL(init_addr_map); #endif -#if defined(CONFIG_ARM) || defined(CONFIG_RISCV) || defined(CONFIG_SANDBOX) - board_init, /* Setup chipselects */ +#if CONFIG_IS_ENABLED(ARM) || CONFIG_IS_ENABLED(RISCV) || \ + CONFIG_IS_ENABLED(SANDBOX) + INITCALL(board_init); /* Setup chipselects */ #endif /* * TODO: printing of the clock inforamtion of the board is now @@ -654,139 +659,141 @@ static init_fnc_t init_sequence_r[] = { * davinci SOC's is added. Remove this check once all the board * implement this. */ -#ifdef CONFIG_CLOCKS - set_cpu_clk_info, /* Setup clock information */ +#if CONFIG_IS_ENABLED(CLOCKS) + INITCALL(set_cpu_clk_info); #endif - initr_lmb, -#ifdef CONFIG_EFI_LOADER - efi_memory_init, + INITCALL(initr_lmb); +#if CONFIG_IS_ENABLED(EFI_LOADER) + INITCALL(efi_memory_init); #endif -#ifdef CONFIG_BINMAN_FDT - initr_binman, +#if CONFIG_IS_ENABLED(BINMAN_FDT) + INITCALL(initr_binman); #endif -#ifdef CONFIG_FSP_VERSION2 - arch_fsp_init_r, +#if CONFIG_IS_ENABLED(FSP_VERSION2) + INITCALL(arch_fsp_init_r); #endif - initr_dm_devices, - stdio_init_tables, - serial_initialize, - initr_announce, - dm_announce, + INITCALL(initr_dm_devices); + INITCALL(stdio_init_tables); + INITCALL(serial_initialize); + INITCALL(initr_announce); + INITCALL(dm_announce); #if CONFIG_IS_ENABLED(WDT) - initr_watchdog, + INITCALL(initr_watchdog); #endif - INIT_FUNC_WATCHDOG_RESET - arch_initr_trap, -#if defined(CONFIG_BOARD_EARLY_INIT_R) - board_early_init_r, + WATCHDOG_RESET(); + INITCALL(arch_initr_trap); +#if CONFIG_IS_ENABLED(BOARD_EARLY_INIT_R) + INITCALL(board_early_init_r); #endif - INIT_FUNC_WATCHDOG_RESET -#ifdef CONFIG_POST - post_output_backlog, + WATCHDOG_RESET(); +#if CONFIG_IS_ENABLED(POST) + INITCALL(post_output_backlog); #endif - INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT) + WATCHDOG_RESET(); +#if CONFIG_IS_ENABLED(PCI_INIT_R) && CONFIG_IS_ENABLED(SYS_EARLY_PCI_INIT) /* * Do early PCI configuration _before_ the flash gets initialised, * because PCU resources are crucial for flash access on some boards. */ - pci_init, + INITCALL(pci_init); #endif -#ifdef CONFIG_ARCH_EARLY_INIT_R - arch_early_init_r, +#if CONFIG_IS_ENABLED(ARCH_EARLY_INIT_R) + INITCALL(arch_early_init_r); #endif - power_init_board, -#ifdef CONFIG_MTD_NOR_FLASH - initr_flash, + INITCALL(power_init_board); +#if CONFIG_IS_ENABLED(MTD_NOR_FLASH) + INITCALL(initr_flash); #endif - INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) + WATCHDOG_RESET(); +#if CONFIG_IS_ENABLED(PPC) || CONFIG_IS_ENABLED(M68K) || CONFIG_IS_ENABLED(X86) /* initialize higher level parts of CPU like time base and timers */ - cpu_init_r, + INITCALL(cpu_init_r); #endif -#ifdef CONFIG_EFI_LOADER - efi_init_early, +#if CONFIG_IS_ENABLED(EFI_LOADER) + INITCALL(efi_init_early); #endif -#ifdef CONFIG_CMD_NAND - initr_nand, +#if CONFIG_IS_ENABLED(CMD_NAND) + INITCALL(initr_nand); #endif -#ifdef CONFIG_CMD_ONENAND - initr_onenand, +#if CONFIG_IS_ENABLED(CMD_ONENAND) + INITCALL(initr_onenand); #endif -#ifdef CONFIG_MMC - initr_mmc, +#if CONFIG_IS_ENABLED(MMC) + INITCALL(initr_mmc); #endif -#ifdef CONFIG_XEN - xen_init, +#if CONFIG_IS_ENABLED(XEN) + INITCALL(xen_init); #endif -#ifdef CONFIG_PVBLOCK - initr_pvblock, +#if CONFIG_IS_ENABLED(PVBLOCK) + INITCALL(initr_pvblock); #endif - initr_env, -#ifdef CONFIG_SYS_MALLOC_BOOTPARAMS - initr_malloc_bootparams, + INITCALL(initr_env); +#if CONFIG_IS_ENABLED(SYS_MALLOC_BOOTPARAMS) + INITCALL(initr_malloc_bootparams); #endif - INIT_FUNC_WATCHDOG_RESET - cpu_secondary_init_r, -#if defined(CONFIG_ID_EEPROM) - mac_read_from_eeprom, + WATCHDOG_RESET(); + INITCALL(cpu_secondary_init_r); +#if CONFIG_IS_ENABLED(ID_EEPROM) + INITCALL(mac_read_from_eeprom); #endif - INITCALL_EVENT(EVT_SETTINGS_R), - INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PCI_INIT_R) && !defined(CONFIG_SYS_EARLY_PCI_INIT) + INITCALL_EVT(EVT_SETTINGS_R); + WATCHDOG_RESET(); +#if CONFIG_IS_ENABLED(PCI_INIT_R) && !CONFIG_IS_ENABLED(SYS_EARLY_PCI_INIT) /* * Do pci configuration */ - pci_init, + INITCALL(pci_init); #endif - stdio_add_devices, - jumptable_init, -#ifdef CONFIG_API - api_init, + INITCALL(stdio_add_devices); + INITCALL(jumptable_init); +#if CONFIG_IS_ENABLED(API) + INITCALL(api_init); #endif - console_init_r, /* fully init console as a device */ -#ifdef CONFIG_DISPLAY_BOARDINFO_LATE - console_announce_r, - show_board_info, + INITCALL(console_init_r); /* fully init console as a device */ +#if CONFIG_IS_ENABLED(DISPLAY_BOARDINFO_LATE) + INITCALL(console_announce_r); + INITCALL(show_board_info); #endif -#ifdef CONFIG_ARCH_MISC_INIT - arch_misc_init, /* miscellaneous arch-dependent init */ + /* miscellaneous arch-dependent init */ +#if CONFIG_IS_ENABLED(ARCH_MISC_INIT) + INITCALL(arch_misc_init); #endif -#ifdef CONFIG_MISC_INIT_R - misc_init_r, /* miscellaneous platform-dependent init */ + /* miscellaneous platform-dependent init */ +#if CONFIG_IS_ENABLED(MISC_INIT_R) + INITCALL(misc_init_r); #endif - INIT_FUNC_WATCHDOG_RESET -#ifdef CONFIG_CMD_KGDB - kgdb_init, + WATCHDOG_RESET(); +#if CONFIG_IS_ENABLED(CMD_KGDB) + INITCALL(kgdb_init); #endif - interrupt_init, + INITCALL(interrupt_init); #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K) - timer_init, /* initialize timer */ + INITCALL(timer_init); /* initialize timer */ #endif - initr_status_led, - initr_boot_led_blink, + INITCALL(initr_status_led); + INITCALL(initr_boot_led_blink); /* PPC has a udelay(20) here dating from 2002. Why? */ -#ifdef CONFIG_BOARD_LATE_INIT - board_late_init, +#if CONFIG_IS_ENABLED(BOARD_LATE_INIT) + INITCALL(board_late_init); #endif -#ifdef CONFIG_PCI_ENDPOINT - pci_ep_init, +#if CONFIG_IS_ENABLED(PCI_ENDPOINT) + INITCALL(pci_ep_init); #endif -#if defined(CONFIG_CMD_NET) - INIT_FUNC_WATCHDOG_RESET - initr_net, +#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP) + WATCHDOG_RESET(); + INITCALL(initr_net); #endif -#ifdef CONFIG_POST - initr_post, +#if CONFIG_IS_ENABLED(POST) + INITCALL(initr_post); #endif - INIT_FUNC_WATCHDOG_RESET - INITCALL_EVENT(EVT_LAST_STAGE_INIT), + WATCHDOG_RESET(); + INITCALL_EVT(EVT_LAST_STAGE_INIT); #if defined(CFG_PRAM) - initr_mem, + INITCALL(initr_mem); #endif - initr_boot_led_on, - run_main_loop, -}; + INITCALL(initr_boot_led_on); + INITCALL(run_main_loop); +} void board_init_r(gd_t *new_gd, ulong dest_addr) { @@ -813,8 +820,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) #endif gd->flags &= ~GD_FLG_LOG_READY; - if (initcall_run_list(init_sequence_r)) - hang(); + initcall_run_r(); /* NOTREACHED - run_main_loop() does not return */ hang(); diff --git a/common/cli_hush.c b/common/cli_hush.c index 9f437ae5f47..7bd6943d3ed 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -1028,8 +1028,10 @@ static void get_user_input(struct in_str *i) puts("\nTimeout waiting for command\n"); # ifdef CONFIG_RESET_TO_RETRY do_reset(NULL, 0, 0, NULL); -# else -# error "This currently only works with CONFIG_RESET_TO_RETRY enabled" +# elif IS_ENABLED(CONFIG_RETRY_BOOTCMD) + strcpy(console_buffer, "run bootcmd\n"); +# else +# error "This only works with CONFIG_RESET_TO_RETRY or CONFIG_BOOT_RETRY_COMMAND enabled" # endif } #endif diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index ab5aa5f9b36..748ef60ac90 100644 --- a/common/cli_hush_upstream.c +++ b/common/cli_hush_upstream.c @@ -2907,8 +2907,10 @@ static void get_user_input(struct in_str *i) puts("\nTimeout waiting for command\n"); # ifdef CONFIG_RESET_TO_RETRY do_reset(NULL, 0, 0, NULL); -# else -# error "This currently only works with CONFIG_RESET_TO_RETRY enabled" +# elif IS_ENABLED(CONFIG_RETRY_BOOTCMD) + strcpy(console_buffer, "run bootcmd\n"); +# else +# error "This only works with CONFIG_RESET_TO_RETRY or CONFIG_BOOT_RETRY_COMMAND enabled" # endif } # endif diff --git a/common/console.c b/common/console.c index b69bb189639..275da2f264d 100644 --- a/common/console.c +++ b/common/console.c @@ -208,8 +208,8 @@ static int console_setfile(int file, struct stdio_dev * dev) gd->jt->printf = printf; break; } - break; #endif + break; default: /* Invalid file ID */ error = -1; } diff --git a/common/cyclic.c b/common/cyclic.c index fad071a39c6..b695f092f52 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -16,6 +16,7 @@ #include <linux/list.h> #include <asm/global_data.h> #include <u-boot/schedule.h> +#include <uthread.h> DECLARE_GLOBAL_DATA_PTR; @@ -100,6 +101,8 @@ void schedule(void) */ if (gd) cyclic_run(); + + uthread_schedule(); } int cyclic_unregister_all(void) diff --git a/common/iomux.c b/common/iomux.c index 1224c15eb71..4844df51fbe 100644 --- a/common/iomux.c +++ b/common/iomux.c @@ -131,7 +131,7 @@ int iomux_doenv(const int console, const char *arg) /* Stop dropped consoles */ for (i = 0; i < repeat; i++) { j = iomux_match_device(cons_set, cs_idx, old_set[i]); - if (j == cs_idx) + if (j == -ENOENT) console_stop(console, old_set[i]); } diff --git a/common/spl/Kconfig b/common/spl/Kconfig index c08045f9c8d..b076f49ac00 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -270,6 +270,8 @@ config SPL_TEXT_BASE default 0x40200000 if OMAP34XX default 0x402F4000 if AM43XX default 0x402F0400 if AM33XX + default 0x80080000 if ARCH_K3 && ARM64 + default 0x43c00000 if ARCH_K3 && !ARM64 default 0x00908000 if ARCH_MX6 default 0x00912000 if ARCH_MX7 default 0x40301350 if OMAP54XX @@ -537,6 +539,7 @@ if SPL_SYS_MMCSD_RAW_MODE choice prompt "Method for locating next phase of boot (e.g. U-Boot)" + default SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR if MVEBU_SPL_BOOT_DEVICE_MMC config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR bool "MMC raw mode: by sector" |