X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fboard_r.c;h=28f32c38853ab3a05fb3c796df1299dc01bb9af6;hb=a375ff8e14bea0a5cbfff99d6456aa8d9a3320ab;hp=48fa4ee52406df7a5fe874b14366c8d81fb67379;hpb=a8523a808fd05e4b1c1df63bc40744dd3fd318f4;p=u-boot diff --git a/common/board_r.c b/common/board_r.c index 48fa4ee524..28f32c3885 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -27,6 +27,7 @@ #include #endif #include +#include #ifdef CONFIG_PS2KBD #include #endif @@ -49,16 +50,10 @@ #include #include #include -#ifdef CONFIG_CMD_AMBAPP -#include -#endif #ifdef CONFIG_ADDR_MAP #include #endif #include -#ifdef CONFIG_X86 -#include -#endif #include #include #include @@ -69,10 +64,6 @@ DECLARE_GLOBAL_DATA_PTR; -#if defined(CONFIG_SPARC) -extern int prom_init(void); -#endif - ulong monitor_flash_len; __weak int board_flash_wp_on(void) @@ -355,7 +346,7 @@ static int initr_manual_reloc_cmdtable(void) } #endif -#if !defined(CONFIG_SYS_NO_FLASH) +#if defined(CONFIG_MTD_NOR_FLASH) static int initr_flash(void) { ulong flash_size = 0; @@ -426,6 +417,7 @@ static int initr_nand(void) { puts("NAND: "); nand_init(); + printf("%lu MiB\n", nand_size() / 1024); return 0; } #endif @@ -440,7 +432,7 @@ static int initr_onenand(void) } #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC static int initr_mmc(void) { puts("MMC: "); @@ -493,24 +485,7 @@ static int initr_env(void) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_SYS_EXTBDINFO) -#if defined(CONFIG_405GP) || defined(CONFIG_405EP) -#if defined(CONFIG_I2CFAST) - /* - * set bi_iic_fast for linux taking environment variable - * "i2cfast" into account - */ - { - char *s = getenv("i2cfast"); - if (s && ((*s == 'y') || (*s == 'Y'))) { - gd->bd->bi_iic_fast[0] = 1; - gd->bd->bi_iic_fast[1] = 1; - } - } -#endif /* CONFIG_I2CFAST */ -#endif /* CONFIG_405GP, CONFIG_405EP */ -#endif /* CONFIG_SYS_EXTBDINFO */ return 0; } @@ -597,18 +572,6 @@ static int initr_status_led(void) } #endif -#if defined(CONFIG_CMD_AMBAPP) && defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP) -extern int do_ambapp_print(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); - -static int initr_ambapp_print(void) -{ - puts("AMBA:\n"); - do_ambapp_print(NULL, 0, 0, NULL); - - return 0; -} -#endif - #if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI) static int initr_scsi(void) { @@ -737,7 +700,7 @@ static int run_main_loop(void) * * TODO: perhaps reset the watchdog in the initcall function after each call? */ -init_fnc_t init_sequence_r[] = { +static init_fnc_t init_sequence_r[] = { initr_trace, initr_reloc, /* TODO: could x86/PPC have this also perhaps? */ @@ -818,12 +781,11 @@ init_fnc_t init_sequence_r[] = { arch_early_init_r, #endif power_init_board, -#ifndef CONFIG_SYS_NO_FLASH +#ifdef CONFIG_MTD_NOR_FLASH initr_flash, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) || \ - defined(CONFIG_SPARC) +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) /* initialize higher level parts of CPU like time base and timers */ cpu_init_r, #endif @@ -836,7 +798,7 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_CMD_ONENAND initr_onenand, #endif -#ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_MMC initr_mmc, #endif #ifdef CONFIG_HAS_DATAFLASH @@ -894,12 +856,6 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_BOARD_LATE_INIT board_late_init, #endif -#if defined(CONFIG_CMD_AMBAPP) - ambapp_init_reloc, -#if defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP) - initr_ambapp_print, -#endif -#endif #if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI) INIT_FUNC_WATCHDOG_RESET initr_scsi, @@ -938,15 +894,22 @@ init_fnc_t init_sequence_r[] = { #endif #ifdef CONFIG_PS2KBD initr_kbd, -#endif -#if defined(CONFIG_SPARC) - prom_init, #endif run_main_loop, }; void board_init_r(gd_t *new_gd, ulong dest_addr) { + /* + * Set up the new global data pointer. So far only x86 does this + * here. + * 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 + #ifdef CONFIG_NEEDS_MANUAL_RELOC int i; #endif