]> git.sur5r.net Git - u-boot/blobdiff - common/board_f.c
Merge git://git.denx.de/u-boot-fsl-qoriq
[u-boot] / common / board_f.c
index 068db0d74eba35efe38d15055e6276aaff9c6b2e..c4501affd9da3b8a8e978ada308ceef4d335a5c5 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>
@@ -115,10 +117,11 @@ static int init_func_watchdog_init(void)
 # if defined(CONFIG_HW_WATCHDOG) && (defined(CONFIG_BLACKFIN) || \
        defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \
        defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG) || \
+       defined(CONFIG_DESIGNWARE_WATCHDOG) || \
        defined(CONFIG_IMX_WATCHDOG))
        hw_watchdog_init();
-# endif
        puts("       Watchdog enabled\n");
+# endif
        WATCHDOG_RESET();
 
        return 0;
@@ -161,9 +164,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);
@@ -275,7 +275,7 @@ static int setup_mon_len(void)
        gd->mon_len = CONFIG_SYS_MONITOR_LEN;
 #elif defined(CONFIG_NDS32)
        gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
-#else
+#elif defined(CONFIG_SYS_MONITOR_BASE)
        /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */
        gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
 #endif
@@ -340,7 +340,7 @@ static int setup_dest_addr(void)
         * Record secure memory location. Need recalcuate if memory splits
         * into banks, or the ram base is not zero.
         */
-       gd->secure_ram = gd->ram_size;
+       gd->arch.secure_ram = gd->ram_size;
 #endif
        /*
         * Subtract specified amount of memory to hide so that it won't
@@ -433,25 +433,51 @@ static int reserve_mmu(void)
        gd->arch.tlb_addr = gd->relocaddr;
        debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
              gd->arch.tlb_addr + gd->arch.tlb_size);
+
+#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
+       /*
+        * Record allocated tlb_addr in case gd->tlb_addr to be overwritten
+        * with location within secure ram.
+        */
+       gd->arch.tlb_allocated = gd->arch.tlb_addr;
+#endif
+
        return 0;
 }
 #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 */
+#  endif /* CONFIG_FB_ADDR */
+
        return 0;
 }
-#endif /* CONFIG_LCD */
+# 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_legacy_video(void)
@@ -462,7 +488,8 @@ static int reserve_legacy_video(void)
 
        return 0;
 }
-#endif
+# endif
+#endif /* !CONFIG_DM_VIDEO */
 
 static int reserve_trace(void)
 {
@@ -789,6 +816,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,15 +989,19 @@ 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
+# 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,
@@ -1069,6 +1105,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