X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=arch%2Fpowerpc%2Flib%2Fboard.c;h=bc7c362cf28fae1c051adf353c35ab3e8e1b0b48;hb=ea818dbbcd59300b56014ac2d67798a54994eb9b;hp=22bd713d625a110ba47cd43a0066c33cd074f6e0;hpb=67ac13b1b9b6ca00893714fbc8cbf556bab6fd59;p=karo-tx-uboot.git diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 22bd713d62..bc7c362cf2 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -98,8 +98,7 @@ extern void sc3_read_eeprom(void); #if defined(CONFIG_CMD_DOC) void doc_init(void); #endif -#if defined(CONFIG_HARD_I2C) || \ - defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) #include #endif #include @@ -123,7 +122,7 @@ DECLARE_GLOBAL_DATA_PTR; #endif extern ulong __init_end; -extern ulong __bss_end__; +extern ulong __bss_end; ulong monitor_flash_len; #if defined(CONFIG_CMD_BEDBUG) @@ -214,11 +213,15 @@ static int init_func_ram(void) /***********************************************************************/ -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) static int init_func_i2c(void) { puts("I2C: "); +#ifdef CONFIG_SYS_I2C + i2c_init_all(); +#else i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +#endif puts("ready\n"); return 0; } @@ -237,25 +240,18 @@ static int init_func_spi(void) /***********************************************************************/ #if defined(CONFIG_WATCHDOG) -static int init_func_watchdog_init(void) +int init_func_watchdog_init(void) { puts(" Watchdog enabled\n"); WATCHDOG_RESET(); return 0; } -#define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init, - -static int init_func_watchdog_reset(void) +int init_func_watchdog_reset(void) { WATCHDOG_RESET(); return 0; } - -#define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset, -#else -#define INIT_FUNC_WATCHDOG_INIT /* undef */ -#define INIT_FUNC_WATCHDOG_RESET /* undef */ #endif /* CONFIG_WATCHDOG */ /* @@ -308,16 +304,13 @@ static init_fnc_t *init_sequence[] = { #if defined(CONFIG_MPC5xxx) prt_mpc5xxx_clks, #endif /* CONFIG_MPC5xxx */ -#if defined(CONFIG_MPC8220) - prt_mpc8220_clks, -#endif checkboard, INIT_FUNC_WATCHDOG_INIT #if defined(CONFIG_MISC_INIT_F) misc_init_f, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) init_func_i2c, #endif #if defined(CONFIG_HARD_SPI) @@ -326,7 +319,8 @@ static init_fnc_t *init_sequence[] = { #ifdef CONFIG_POST post_init_f, #endif - INIT_FUNC_WATCHDOG_RESET init_func_ram, + INIT_FUNC_WATCHDOG_RESET + init_func_ram, #if defined(CONFIG_SYS_DRAM_TEST) testdram, #endif /* CONFIG_SYS_DRAM_TEST */ @@ -419,7 +413,7 @@ void board_init_f(ulong bootflag) * - monitor code * - board info struct */ - len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE; + len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; /* * Subtract specified amount of memory to hide so that it won't @@ -554,27 +548,6 @@ void board_init_f(ulong bootflag) #if defined(CONFIG_MPC83xx) bd->bi_immrbar = CONFIG_SYS_IMMR; #endif -#if defined(CONFIG_MPC8220) - bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ - bd->bi_inpfreq = gd->inp_clk; - bd->bi_pcifreq = gd->pci_clk; - bd->bi_vcofreq = gd->vco_clk; - bd->bi_pevfreq = gd->pev_clk; - bd->bi_flbfreq = gd->flb_clk; - - /* store bootparam to sram (backward compatible), here? */ - { - u32 *sram = (u32 *) CONFIG_SYS_SRAM_BASE; - - *sram++ = gd->ram_size; - *sram++ = gd->bus_clk; - *sram++ = gd->inp_clk; - *sram++ = gd->cpu_clk; - *sram++ = gd->vco_clk; - *sram++ = gd->flb_clk; - *sram++ = 0xb8c3ba11; /* boot signature */ - } -#endif WATCHDOG_RESET(); bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ @@ -586,10 +559,10 @@ void board_init_f(ulong bootflag) bd->bi_vco = gd->arch.vco_out; #endif /* CONFIG_CPM2 */ #if defined(CONFIG_MPC512X) - bd->bi_ipsfreq = gd->ips_clk; + bd->bi_ipsfreq = gd->arch.ips_clk; #endif /* CONFIG_MPC512X */ #if defined(CONFIG_MPC5xxx) - bd->bi_ipbfreq = gd->ipb_clk; + bd->bi_ipbfreq = gd->arch.ipb_clk; bd->bi_pcifreq = gd->pci_clk; #endif /* CONFIG_MPC5xxx */ bd->bi_baudrate = gd->baudrate; /* Console Baudrate */ @@ -1056,15 +1029,6 @@ void board_init_r(gd_t *id, ulong dest_addr) /* NOTREACHED - no way out of command loop except booting */ } -void hang(void) -{ - puts("### ERROR ### Please RESET the board ###\n"); - bootstage_error(BOOTSTAGE_ID_NEED_RESET); - for (;;) - ; -} - - #if 0 /* We could use plain global data, but the resulting code is bigger */ /* * Pointer to initial global data area