]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/sparc/lib/board.c
Merge remote-tracking branch 'u-boot-ti/master'
[karo-tx-uboot.git] / arch / sparc / lib / board.c
index 4a6041f51ca0c8bee8eaefcb248ecc411d1b659b..32d025a34237c89c443314035f58c3f6264105f3 100644 (file)
@@ -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;
@@ -252,13 +242,13 @@ void board_init_f(ulong bootflag)
        post_run(NULL, POST_ROM | post_bootmode_get(0));
 #endif
 
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
-       fixup_cmdtable(&__u_boot_cmd_start,
-               (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
-#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
+       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");
@@ -284,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
@@ -341,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
@@ -365,17 +353,8 @@ void board_init_f(ulong bootflag)
 
        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();
 
@@ -389,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
 
@@ -440,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 (;;) ;
 }