Don't grab memory for LCD if FB address is defined
[platform/kernel/u-boot.git] / arch / m68k / lib / board.c
index acbdc58..6a892db 100644 (file)
@@ -73,22 +73,10 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static char *failed = "*** failed ***\n";
 
-#ifdef CONFIG_PCU_E
-extern flash_info_t flash_info[];
-#endif
-
 #include <environment.h>
 
-#if ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
-      (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \
-    defined(CONFIG_ENV_IS_IN_NVRAM)
-#define        TOTAL_MALLOC_LEN        (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE)
-#else
-#define        TOTAL_MALLOC_LEN        CONFIG_SYS_MALLOC_LEN
-#endif
-
 extern ulong __init_end;
-extern ulong _end;
+extern ulong __bss_end__;
 
 extern void timer_init(void);
 
@@ -264,7 +252,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;
 
@@ -289,9 +277,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 */
 
        /*
@@ -353,7 +345,7 @@ board_init_f (ulong bootflag)
        bd->bi_memsize   = gd->ram_size;        /* size  of  DRAM memory in bytes */
 #ifdef CONFIG_SYS_INIT_RAM_ADDR
        bd->bi_sramstart = CONFIG_SYS_INIT_RAM_ADDR;    /* start of  SRAM memory        */
-       bd->bi_sramsize  = CONFIG_SYS_INIT_RAM_END;     /* size  of  SRAM memory        */
+       bd->bi_sramsize  = CONFIG_SYS_INIT_RAM_SIZE;    /* size  of  SRAM memory        */
 #endif
        bd->bi_mbar_base = CONFIG_SYS_MBAR;             /* base of internal registers */
 
@@ -405,7 +397,6 @@ board_init_f (ulong bootflag)
  */
 void board_init_r (gd_t *id, ulong dest_addr)
 {
-       cmd_tbl_t *cmdtp;
        char *s;
        bd_t *bd;
        extern void malloc_bin_reloc (void);
@@ -433,13 +424,13 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        monitor_flash_len = (ulong)&__init_end - dest_addr;
 
-#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) */
+#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
        /* there are some other pointer constants we must deal with */
 #ifndef CONFIG_ENV_IS_NOWHERE
@@ -473,7 +464,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
@@ -577,10 +568,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
         */
        timer_init();
 
-#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
-       serial_buffered_init();
-#endif
-
 #ifdef CONFIG_STATUS_LED
        status_led_set (STATUS_LED_BOOT, STATUS_LED_BLINKING);
 #endif