X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=arch%2Fsparc%2Flib%2Fboard.c;h=32d025a34237c89c443314035f58c3f6264105f3;hb=cae4a8a2a81ca6cd16d5de1b55d47e315cbff05a;hp=4f6970965b0e2529cfacda4a9b7aa585c4bdd0c8;hpb=3df4f46f3209c067dcadc969ed02d27c97fa3632;p=u-boot diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c index 4f6970965b..32d025a342 100644 --- a/arch/sparc/lib/board.c +++ b/arch/sparc/lib/board.c @@ -62,7 +62,6 @@ DECLARE_GLOBAL_DATA_PTR; */ extern void timer_interrupt_init(void); -extern void malloc_bin_reloc(void); extern int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]); extern int prom_init(void); @@ -87,13 +86,8 @@ ulong monitor_flash_len; static int init_baudrate(void) { - char tmp[64]; /* long enough for environment variables */ - int i = getenv_f("baudrate", tmp, sizeof(tmp)); - - gd->baudrate = (i > 0) - ? (int)simple_strtoul(tmp, NULL, 10) - : CONFIG_BAUDRATE; - return (0); + gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); + return 0; } /***********************************************************************/ @@ -170,13 +164,9 @@ char *str_init_seq_done = "\n\rInit sequence done...\r\n\r\n"; void board_init_f(ulong bootflag) { - cmd_tbl_t *cmdtp; bd_t *bd; - unsigned char *s; init_fnc_t **init_fnc_ptr; int j; - int i; - char *e; #ifndef CONFIG_SYS_NO_FLASH ulong flash_size; @@ -244,7 +234,7 @@ void board_init_f(ulong bootflag) printf("CONFIG_SYS_PROM_OFFSET: 0x%lx (%d)\n", CONFIG_SYS_PROM_OFFSET, CONFIG_SYS_PROM_SIZE); printf("CONFIG_SYS_GBL_DATA_OFFSET: 0x%lx (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET, - CONFIG_SYS_GBL_DATA_SIZE); + GENERATED_GBL_DATA_SIZE); #endif #ifdef CONFIG_POST @@ -252,33 +242,13 @@ void board_init_f(ulong bootflag) post_run(NULL, POST_ROM | post_bootmode_get(0)); #endif +#if defined(CONFIG_NEEDS_MANUAL_RELOC) /* * We have to relocate the command table manually */ - for (cmdtp = &__u_boot_cmd_start; cmdtp != &__u_boot_cmd_end; cmdtp++) { - ulong addr; - addr = (ulong) (cmdtp->cmd) + gd->reloc_off; -#if DEBUG_COMMANDS - printf("Command \"%s\": 0x%08lx => 0x%08lx\n", - cmdtp->name, (ulong) (cmdtp->cmd), addr); -#endif - cmdtp->cmd = - (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr; - - addr = (ulong) (cmdtp->name) + gd->reloc_off; - cmdtp->name = (char *)addr; - - if (cmdtp->usage) { - addr = (ulong) (cmdtp->usage) + gd->reloc_off; - cmdtp->usage = (char *)addr; - } -#ifdef CONFIG_SYS_LONGHELP - if (cmdtp->help) { - addr = (ulong) (cmdtp->help) + gd->reloc_off; - cmdtp->help = (char *)addr; - } -#endif - } + fixup_cmdtable(ll_entry_start(cmd_tbl_t, cmd), + ll_entry_count(cmd_tbl_t, cmd)); +#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */ #if defined(CONFIG_CMD_AMBAPP) && defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP) puts("AMBA:\n"); @@ -304,7 +274,7 @@ void board_init_f(ulong bootflag) malloc_bin_reloc(); #if !defined(CONFIG_SYS_NO_FLASH) - puts("FLASH: "); + puts("Flash: "); if ((flash_size = flash_init()) > 0) { # ifdef CONFIG_SYS_FLASH_CHECKSUM @@ -361,8 +331,6 @@ void board_init_f(ulong bootflag) mac_read_from_eeprom(); #endif - /* IP Address */ - bd->bi_ip_addr = getenv_IPaddr("ipaddr"); #if defined(CONFIG_PCI) /* * Do pci configuration @@ -379,27 +347,14 @@ void board_init_f(ulong bootflag) /* Initialize the console (after the relocation and devices init) */ console_init_r(); -#ifdef CONFIG_SERIAL_SOFTWARE_FIFO - serial_buffered_init(); -#endif - #ifdef CONFIG_STATUS_LED status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING); #endif udelay(20); - set_timer(0); - /* Initialize from environment */ - if ((s = getenv("loadaddr")) != NULL) { - load_addr = simple_strtoul(s, NULL, 16); - } -#if defined(CONFIG_CMD_NET) - if ((s = getenv("bootfile")) != NULL) { - copy_filename(BootFile, s, sizeof(BootFile)); - } -#endif /* CONFIG_CMD_NET */ + load_addr = getenv_ulong("loadaddr", 16, load_addr); WATCHDOG_RESET(); @@ -413,10 +368,8 @@ void board_init_f(ulong bootflag) bb_miiphy_init(); #endif #if defined(CONFIG_CMD_NET) -#if defined(CONFIG_NET_MULTI) WATCHDOG_RESET(); puts("Net: "); -#endif eth_initialize(bd); #endif @@ -464,7 +417,7 @@ void hang(void) { puts("### ERROR ### Please RESET the board ###\n"); #ifdef CONFIG_SHOW_BOOT_PROGRESS - show_boot_progress(-30); + bootstage_error(BOOTSTAGE_ID_NEED_RESET); #endif for (;;) ; }