X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=common%2Fboard_r.c;h=a301cc226f1e69fb4f6229382391c80218f12460;hb=1dfdd9ba4e699562a3b282f4fb5efe4c80e6e8c7;hp=7e1a76d97f73be5d2eb3d347dffbb82d301b7522;hpb=db67801bf92f7fae6131dbc0d387131698fb9490;p=people%2Fms%2Fu-boot.git diff --git a/common/board_r.c b/common/board_r.c index 7e1a76d97f..a301cc226f 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -60,7 +60,7 @@ DECLARE_GLOBAL_DATA_PTR; ulong monitor_flash_len; -int __board_flash_wp_on(void) +__weak int board_flash_wp_on(void) { /* * Most flashes can't be detected when write protection is enabled, @@ -70,16 +70,10 @@ int __board_flash_wp_on(void) return 0; } -int board_flash_wp_on(void) - __attribute__ ((weak, alias("__board_flash_wp_on"))); - -void __cpu_secondary_init_r(void) +__weak void cpu_secondary_init_r(void) { } -void cpu_secondary_init_r(void) - __attribute__ ((weak, alias("__cpu_secondary_init_r"))); - static int initr_secondary_cpu(void) { /* @@ -105,7 +99,8 @@ static int initr_trace(void) static int initr_reloc(void) { - gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ + /* tell others: relocation done */ + gd->flags |= GD_FLG_RELOC | GD_FLG_FULL_MALLOC_INIT; bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); return 0; @@ -270,6 +265,14 @@ static int initr_malloc(void) return 0; } +#ifdef CONFIG_SYS_NONCACHED_MEMORY +static int initr_noncached(void) +{ + noncached_init(); + return 0; +} +#endif + #ifdef CONFIG_DM static int initr_dm(void) { @@ -296,26 +299,14 @@ static int initr_flash(void) { ulong flash_size = 0; bd_t *bd = gd->bd; - int ok; puts("Flash: "); - if (board_flash_wp_on()) { + if (board_flash_wp_on()) printf("Uninitialized - Write Protect On\n"); - /* Since WP is on, we can't find real size. Set to 0 */ - ok = 1; - } else { + else flash_size = flash_init(); - ok = flash_size > 0; - } - if (!ok) { - puts("*** failed ***\n"); -#ifdef CONFIG_PPC - /* Why does PPC do this? */ - hang(); -#endif - return -1; - } + print_size(flash_size, ""); #ifdef CONFIG_SYS_FLASH_CHECKSUM /* @@ -354,7 +345,7 @@ static int initr_flash(void) } #endif -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) && !defined(CONFIG_DM_SPI) static int initr_spi(void) { /* PPC does this here */ @@ -370,7 +361,7 @@ static int initr_spi(void) #ifdef CONFIG_CMD_NAND /* go init the NAND */ -int initr_nand(void) +static int initr_nand(void) { puts("NAND: "); nand_init(); @@ -380,7 +371,7 @@ int initr_nand(void) #if defined(CONFIG_CMD_ONENAND) /* go init the NAND */ -int initr_onenand(void) +static int initr_onenand(void) { puts("NAND: "); onenand_init(); @@ -389,7 +380,7 @@ int initr_onenand(void) #endif #ifdef CONFIG_GENERIC_MMC -int initr_mmc(void) +static int initr_mmc(void) { puts("MMC: "); mmc_initialize(gd->bd); @@ -398,7 +389,7 @@ int initr_mmc(void) #endif #ifdef CONFIG_HAS_DATAFLASH -int initr_dataflash(void) +static int initr_dataflash(void) { AT91F_DataflashInit(); dataflash_print_info(); @@ -459,24 +450,6 @@ static int initr_env(void) return 0; } -#ifdef CONFIG_HERMES -static int initr_hermes(void) -{ - if ((gd->board_type >> 16) == 2) - gd->bd->bi_ethspeed = gd->board_type & 0xFFFF; - else - gd->bd->bi_ethspeed = 0xFFFF; - return 0; -} - -static int initr_hermes_start(void) -{ - if (gd->bd->bi_ethspeed != 0xFFFF) - hermes_start_lxt980((int) gd->bd->bi_ethspeed); - return 0; -} -#endif - #ifdef CONFIG_SC3 /* TODO: with new initcalls, move this into the driver */ extern void sc3_read_eeprom(void); @@ -722,6 +695,9 @@ init_fnc_t init_sequence_r[] = { #endif initr_barrier, initr_malloc, +#ifdef CONFIG_SYS_NONCACHED_MEMORY + initr_noncached, +#endif bootstage_relocate, #ifdef CONFIG_DM initr_dm, @@ -780,7 +756,7 @@ init_fnc_t init_sequence_r[] = { initr_flash, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PPC) || defined(CONFIG_X86) +#if defined(CONFIG_PPC) /* initialize higher level parts of CPU like time base and timers */ cpu_init_r, #endif @@ -808,9 +784,6 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_SC3 initr_sc3_read_eeprom, #endif -#ifdef CONFIG_HERMES - initr_hermes, -#endif #if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET) mac_read_from_eeprom, #endif @@ -835,19 +808,13 @@ init_fnc_t init_sequence_r[] = { #endif #ifdef CONFIG_MISC_INIT_R misc_init_r, /* miscellaneous platform-dependent init */ -#endif -#ifdef CONFIG_HERMES - initr_hermes_start, #endif INIT_FUNC_WATCHDOG_RESET #ifdef CONFIG_CMD_KGDB initr_kgdb, -#endif -#ifdef CONFIG_X86 - board_early_init_r, #endif interrupt_init, -#if defined(CONFIG_ARM) || defined(CONFIG_x86) +#if defined(CONFIG_ARM) initr_enable_interrupts, #endif #ifdef CONFIG_X86