diff options
Diffstat (limited to 'common/board_r.c')
-rw-r--r-- | common/board_r.c | 74 |
1 files changed, 29 insertions, 45 deletions
diff --git a/common/board_r.c b/common/board_r.c index 31a59c585a8..60eced6f7f9 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -23,10 +23,6 @@ #include <asm/cache.h> #include <asm/global_data.h> #include <u-boot/crc.h> -/* TODO: can we just include all these headers whether needed or not? */ -#if defined(CONFIG_CMD_BEDBUG) -#include <bedbug/type.h> -#endif #include <binman.h> #include <command.h> #include <console.h> @@ -37,15 +33,11 @@ #include <ide.h> #include <init.h> #include <initcall.h> -#if defined(CONFIG_CMD_KGDB) #include <kgdb.h> -#endif #include <irq_func.h> #include <malloc.h> #include <mapmem.h> -#ifdef CONFIG_BITBANGMII #include <miiphy.h> -#endif #include <mmc.h> #include <mux.h> #include <nand.h> @@ -59,12 +51,7 @@ #include <timer.h> #include <trace.h> #include <watchdog.h> -#ifdef CONFIG_XEN #include <xen.h> -#endif -#ifdef CONFIG_ADDR_MAP -#include <asm/mmu.h> -#endif #include <asm/sections.h> #include <dm/root.h> #include <dm/ofnode.h> @@ -72,12 +59,8 @@ #include <linux/err.h> #include <efi_loader.h> #include <wdt.h> -#if defined(CONFIG_GPIO_HOG) -#include <asm/gpio.h> -#endif -#ifdef CONFIG_EFI_SETUP_EARLY +#include <asm-generic/gpio.h> #include <efi_loader.h> -#endif DECLARE_GLOBAL_DATA_PTR; @@ -189,15 +172,6 @@ __weak int arch_initr_trap(void) return 0; } -#ifdef CONFIG_ADDR_MAP -static int initr_addr_map(void) -{ - init_addr_map(); - - return 0; -} -#endif - #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) static int initr_unlock_ram_in_cache(void) { @@ -501,15 +475,6 @@ static int initr_ethaddr(void) } #endif /* CONFIG_CMD_NET */ -#ifdef CONFIG_CMD_KGDB -static int initr_kgdb(void) -{ - puts("KGDB: "); - kgdb_init(); - return 0; -} -#endif - #if defined(CONFIG_LED_STATUS) static int initr_status_led(void) { @@ -586,6 +551,29 @@ int initr_mem(void) } #endif +static int dm_announce(void) +{ + int device_count; + int uclass_count; + + if (IS_ENABLED(CONFIG_DM)) { + dm_get_stats(&device_count, &uclass_count); + printf("Core: %d devices, %d uclasses", device_count, + uclass_count); + if (CONFIG_IS_ENABLED(OF_REAL)) + printf(", devicetree: %s", fdtdec_get_srcname()); + printf("\n"); + if (IS_ENABLED(CONFIG_OF_HAS_PRIOR_STAGE) && + (gd->fdt_src == FDTSRC_SEPARATE || + gd->fdt_src == FDTSRC_EMBED)) { + printf("Warning: Unexpected devicetree source (not from a prior stage)"); + printf("Warning: U-Boot may not function properly\n"); + } + } + + return 0; +} + static int run_main_loop(void) { #ifdef CONFIG_SANDBOX @@ -635,7 +623,7 @@ static init_fnc_t init_sequence_r[] = { initr_dm, #endif #ifdef CONFIG_ADDR_MAP - initr_addr_map, + init_addr_map, #endif #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \ defined(CONFIG_SANDBOX) @@ -661,6 +649,7 @@ static init_fnc_t init_sequence_r[] = { stdio_init_tables, serial_initialize, initr_announce, + dm_announce, #if CONFIG_IS_ENABLED(WDT) initr_watchdog, #endif @@ -748,7 +737,7 @@ static init_fnc_t init_sequence_r[] = { #endif INIT_FUNC_WATCHDOG_RESET #ifdef CONFIG_CMD_KGDB - initr_kgdb, + kgdb_init, #endif interrupt_init, #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K) @@ -796,10 +785,6 @@ static init_fnc_t init_sequence_r[] = { */ last_stage_init, #endif -#ifdef CONFIG_CMD_BEDBUG - INIT_FUNC_WATCHDOG_RESET - bedbug_init, -#endif #if defined(CONFIG_PRAM) initr_mem, #endif @@ -817,9 +802,8 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) * TODO(sjg@chromium.org): Consider doing this for all archs, or * dropping the new_gd parameter. */ -#if CONFIG_IS_ENABLED(X86_64) - arch_setup_gd(new_gd); -#endif + if (CONFIG_IS_ENABLED(X86_64) && !IS_ENABLED(CONFIG_EFI_APP)) + arch_setup_gd(new_gd); #ifdef CONFIG_NEEDS_MANUAL_RELOC int i; |