]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/board_f.c
dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSI
[karo-tx-uboot.git] / common / board_f.c
index 8094ac4efe0d6feb120433e021f0cd2e723c85dd..109025a68d656d2222b7619c5cecaf4948758c1c 100644 (file)
@@ -45,7 +45,9 @@
 #include <post.h>
 #include <spi.h>
 #include <status_led.h>
+#include <timer.h>
 #include <trace.h>
+#include <video.h>
 #include <watchdog.h>
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -161,9 +163,6 @@ static int display_text_info(void)
                text_base, bss_start, bss_end);
 #endif
 
-#ifdef CONFIG_MODEM_SUPPORT
-       debug("Modem Support enabled\n");
-#endif
 #ifdef CONFIG_USE_IRQ
        debug("IRQ Stack: %08lx\n", IRQ_STACK_START);
        debug("FIQ Stack: %08lx\n", FIQ_STACK_START);
@@ -437,36 +436,41 @@ static int reserve_mmu(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
+#ifdef CONFIG_DM_VIDEO
+static int reserve_video(void)
+{
+       ulong addr;
+       int ret;
+
+       addr = gd->relocaddr;
+       ret = video_reserve(&addr);
+       if (ret)
+               return ret;
+       gd->relocaddr = addr;
+
+       return 0;
+}
+#else
+
+# ifdef CONFIG_LCD
 static int reserve_lcd(void)
 {
-#ifdef CONFIG_FB_ADDR
+#  ifdef CONFIG_FB_ADDR
        gd->fb_base = CONFIG_FB_ADDR;
-#else
+#  else
        /* reserve memory for LCD display (always full pages) */
        gd->relocaddr = lcd_setmem(gd->relocaddr);
        gd->fb_base = gd->relocaddr;
-#endif /* CONFIG_FB_ADDR */
-       return 0;
-}
-#endif /* CONFIG_LCD */
-
-static int reserve_trace(void)
-{
-#ifdef CONFIG_TRACE
-       gd->relocaddr -= CONFIG_TRACE_BUFFER_SIZE;
-       gd->trace_buff = map_sysmem(gd->relocaddr, CONFIG_TRACE_BUFFER_SIZE);
-       debug("Reserving %dk for trace data at: %08lx\n",
-             CONFIG_TRACE_BUFFER_SIZE >> 10, gd->relocaddr);
-#endif
+#  endif /* CONFIG_FB_ADDR */
 
        return 0;
 }
+# endif /* CONFIG_LCD */
 
-#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
+# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
                !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
                !defined(CONFIG_BLACKFIN) && !defined(CONFIG_M68K)
-static int reserve_video(void)
+static int reserve_legacy_video(void)
 {
        /* reserve memory for video display (always full pages) */
        gd->relocaddr = video_setmem(gd->relocaddr);
@@ -474,8 +478,21 @@ static int reserve_video(void)
 
        return 0;
 }
+# endif
+#endif /* !CONFIG_DM_VIDEO */
+
+static int reserve_trace(void)
+{
+#ifdef CONFIG_TRACE
+       gd->relocaddr -= CONFIG_TRACE_BUFFER_SIZE;
+       gd->trace_buff = map_sysmem(gd->relocaddr, CONFIG_TRACE_BUFFER_SIZE);
+       debug("Reserving %dk for trace data at: %08lx\n",
+             CONFIG_TRACE_BUFFER_SIZE >> 10, gd->relocaddr);
 #endif
 
+       return 0;
+}
+
 static int reserve_uboot(void)
 {
        /*
@@ -789,6 +806,11 @@ static int initf_dm(void)
        if (ret)
                return ret;
 #endif
+#ifdef CONFIG_TIMER_EARLY
+       ret = dm_timer_init();
+       if (ret)
+               return ret;
+#endif
 
        return 0;
 }
@@ -957,16 +979,20 @@ static init_fnc_t init_sequence_f[] = {
                defined(CONFIG_ARM)
        reserve_mmu,
 #endif
-#ifdef CONFIG_LCD
+#ifdef CONFIG_DM_VIDEO
+       reserve_video,
+#else
+# ifdef CONFIG_LCD
        reserve_lcd,
-#endif
-       reserve_trace,
+# endif
        /* TODO: Why the dependency on CONFIG_8xx? */
-#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
+# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
                !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
                !defined(CONFIG_BLACKFIN) && !defined(CONFIG_M68K)
-       reserve_video,
-#endif
+       reserve_legacy_video,
+# endif
+#endif /* CONFIG_DM_VIDEO */
+       reserve_trace,
 #if !defined(CONFIG_BLACKFIN)
        reserve_uboot,
 #endif
@@ -1069,6 +1095,13 @@ void board_init_f_r(void)
        if (initcall_run_list(init_sequence_f_r))
                hang();
 
+       /*
+        * The pre-relocation drivers may be using memory that has now gone
+        * away. Mark serial as unavailable - this will fall back to the debug
+        * UART if available.
+        */
+       gd->flags &= ~GD_FLG_SERIAL_READY;
+
        /*
         * U-Boot has been copied into SDRAM, the BSS has been cleared etc.
         * Transfer execution from Flash to RAM by calculating the address