]> git.sur5r.net Git - u-boot/blobdiff - arch/m68k/lib/board.c
bootstage: Replace show_boot_progress/error() with bootstage_...()
[u-boot] / arch / m68k / lib / board.c
index 9a519088582145e338774762f7c24c5c0c001386..1526967fe3e73d90f13d76314696d75c61b3db55 100644 (file)
@@ -76,9 +76,7 @@ static char *failed = "*** failed ***\n";
 #include <environment.h>
 
 extern ulong __init_end;
-extern ulong _end;
-
-extern void timer_init(void);
+extern ulong __bss_end__;
 
 #if defined(CONFIG_WATCHDOG)
 # define INIT_FUNC_WATCHDOG_INIT       watchdog_init,
@@ -121,13 +119,8 @@ typedef int (init_fnc_t) (void);
 
 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;
 }
 
 /***********************************************************************/
@@ -223,9 +216,7 @@ board_init_f (ulong bootflag)
        gd_t *id;
        init_fnc_t **init_fnc_ptr;
 #ifdef CONFIG_PRAM
-       int i;
        ulong reg;
-       char tmp[64];           /* long enough for environment variables */
 #endif
 
        /* Pointer is writable since we allocated a register for it */
@@ -252,7 +243,7 @@ board_init_f (ulong bootflag)
         *      - monitor code
         *      - board info struct
         */
-       len = (ulong)&_end - CONFIG_SYS_MONITOR_BASE;
+       len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE;
 
        addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
 
@@ -266,8 +257,7 @@ board_init_f (ulong bootflag)
        /*
         * reserve protected RAM
         */
-       i = getenv_f("pram", tmp, sizeof (tmp));
-       reg = (i > 0) ? simple_strtoul (tmp, NULL, 10) : CONFIG_PRAM;
+       reg = getenv_ulong("pram", 10, CONFIG_PRAM);
        addr -= (reg << 10);            /* size is in kB */
        debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
 #endif /* CONFIG_PRAM */
@@ -277,9 +267,13 @@ board_init_f (ulong bootflag)
        debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+       gd->fb_base = CONFIG_FB_ADDR;
+#else
        /* reserve memory for LCD display (always full pages) */
        addr = lcd_setmem (addr);
        gd->fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
        /*
@@ -460,7 +454,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        malloc_bin_reloc ();
 
 #if !defined(CONFIG_SYS_NO_FLASH)
-       puts ("FLASH: ");
+       puts ("Flash: ");
 
        if ((flash_size = flash_init ()) > 0) {
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
@@ -570,14 +564,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        udelay (20);
 
-       set_timer (0);
-
        /* Insert function pointers now that we have relocated the code */
 
        /* Initialize from environment */
-       if ((s = getenv ("loadaddr")) != NULL) {
-               load_addr = simple_strtoul (s, NULL, 16);
-       }
+       load_addr = getenv_ulong("loadaddr", 16, load_addr);
 #if defined(CONFIG_CMD_NET)
        if ((s = getenv ("bootfile")) != NULL) {
                copy_filename (BootFile, s, sizeof (BootFile));
@@ -606,11 +596,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #if defined(FEC_ENET)
        eth_init(bd);
 #endif
-#if defined(CONFIG_NET_MULTI)
        puts ("Net:   ");
        eth_initialize (bd);
 #endif
-#endif
 
 #ifdef CONFIG_POST
        post_run (NULL, POST_RAM | post_bootmode_get(0));
@@ -650,18 +638,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
         * taking into account the protected RAM at top of memory
         */
        {
-               ulong pram;
+               ulong pram = 0;
                char memsz[32];
-#ifdef CONFIG_PRAM
-               char *s;
 
-               if ((s = getenv ("pram")) != NULL) {
-                       pram = simple_strtoul (s, NULL, 10);
-               } else {
-                       pram = CONFIG_PRAM;
-               }
-#else
-               pram=0;
+#ifdef CONFIG_PRAM
+               pram = getenv_ulong("pram", 10, CONFIG_PRAM);
 #endif
 #ifdef CONFIG_LOGBUFFER
                /* Also take the logbuffer into account (pram is in kB) */