X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fboard_r.c;h=985aa95c2aea2c664169d5acf453d0f557e663b1;hb=19d1f1a2f3ccfbf85125150f7876ce22714b38bd;hp=9f34b85a74ef725746c60f7b598de74703c7eaea;hpb=4aa2ba3a34e3e4413c2cc63fc54f3176881b1a56;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/board_r.c b/common/board_r.c index 9f34b85..985aa95 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -11,6 +11,7 @@ */ #include +#include /* TODO: can we just include all these headers whether needed or not? */ #if defined(CONFIG_CMD_BEDBUG) #include @@ -23,9 +24,7 @@ #include #include #include -#if defined(CONFIG_CMD_IDE) #include -#endif #include #include #ifdef CONFIG_PS2KBD @@ -42,6 +41,7 @@ #endif #include #include +#include #include #include #include @@ -57,9 +57,6 @@ #include #include #include -#ifdef CONFIG_AVR32 -#include -#endif #include DECLARE_GLOBAL_DATA_PTR; @@ -227,13 +224,6 @@ static int initr_post_backlog(void) } #endif -#ifdef CONFIG_SYS_DELAYED_ICACHE -static int initr_icache_enable(void) -{ - return 0; -} -#endif - #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) static int initr_unlock_ram_in_cache(void) { @@ -266,7 +256,7 @@ static int initr_malloc(void) { ulong malloc_start; -#ifdef CONFIG_SYS_MALLOC_F_LEN +#if CONFIG_VAL(SYS_MALLOC_F_LEN) debug("Pre-reloc malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr, gd->malloc_ptr / 1024); #endif @@ -294,6 +284,21 @@ static int initr_noncached(void) } #endif +#ifdef CONFIG_OF_LIVE +static int initr_of_live(void) +{ + int ret; + + bootstage_start(BOOTSTAGE_ID_ACCUM_OF_LIVE, "of_live"); + ret = of_live_build(gd->fdt_blob, (struct device_node **)&gd->of_root); + bootstage_accum(BOOTSTAGE_ID_ACCUM_OF_LIVE); + if (ret) + return ret; + + return 0; +} +#endif + #ifdef CONFIG_DM static int initr_dm(void) { @@ -305,7 +310,9 @@ static int initr_dm(void) #ifdef CONFIG_TIMER gd->timer = NULL; #endif + bootstage_start(BOOTSTATE_ID_ACCUM_DM_R, "dm_r"); ret = dm_init_and_scan(false); + bootstage_accum(BOOTSTATE_ID_ACCUM_DM_R); if (ret) return ret; #ifdef CONFIG_TIMER_EARLY @@ -320,7 +327,6 @@ static int initr_dm(void) static int initr_bootstage(void) { - /* We cannot do this before initr_dm() */ bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); return 0; @@ -485,24 +491,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; } @@ -534,7 +523,7 @@ static int initr_api(void) #endif /* enable exceptions */ -#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) +#ifdef CONFIG_ARM static int initr_enable_interrupts(void) { enable_interrupts(); @@ -628,7 +617,7 @@ static int initr_post(void) } #endif -#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) +#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_IDE) static int initr_pcmcia(void) { puts("PCMCIA:"); @@ -637,14 +626,10 @@ static int initr_pcmcia(void) } #endif -#if defined(CONFIG_CMD_IDE) +#if defined(CONFIG_IDE) static int initr_ide(void) { -#ifdef CONFIG_IDE_8xx_PCCARD - puts("PCMCIA:"); -#else puts("IDE: "); -#endif #if defined(CONFIG_START_IDE) if (board_start_ide()) ide_init(); @@ -736,15 +721,18 @@ static init_fnc_t init_sequence_r[] = { #endif initr_barrier, initr_malloc, + initr_bootstage, /* Needs malloc() but has its own timer */ initr_console_record, #ifdef CONFIG_SYS_NONCACHED_MEMORY initr_noncached, #endif bootstage_relocate, +#ifdef CONFIG_OF_LIVE + initr_of_live, +#endif #ifdef CONFIG_DM initr_dm, #endif - initr_bootstage, #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) board_init, /* Setup chipselects */ #endif @@ -784,9 +772,6 @@ static init_fnc_t init_sequence_r[] = { initr_post_backlog, #endif INIT_FUNC_WATCHDOG_RESET -#ifdef CONFIG_SYS_DELAYED_ICACHE - initr_icache_enable, -#endif #if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT) /* * Do early PCI configuration _before_ the flash gets initialised, @@ -844,6 +829,7 @@ static init_fnc_t init_sequence_r[] = { #endif console_init_r, /* fully init console as a device */ #ifdef CONFIG_DISPLAY_BOARDINFO_LATE + console_announce_r, show_board_info, #endif #ifdef CONFIG_ARCH_MISC_INIT @@ -857,10 +843,10 @@ static init_fnc_t init_sequence_r[] = { initr_kgdb, #endif interrupt_init, -#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) +#ifdef CONFIG_ARM initr_enable_interrupts, #endif -#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || defined(CONFIG_M68K) +#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K) timer_init, /* initialize timer */ #endif #if defined(CONFIG_LED_STATUS) @@ -887,10 +873,10 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_POST initr_post, #endif -#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) +#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_IDE) initr_pcmcia, #endif -#if defined(CONFIG_CMD_IDE) +#if defined(CONFIG_IDE) initr_ide, #endif #ifdef CONFIG_LAST_STAGE_INIT @@ -931,10 +917,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) int i; #endif -#ifdef CONFIG_AVR32 - mmu_init_r(dest_addr); -#endif - #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) gd = new_gd; #endif