]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/lib/board.c
armv7: integrate cache maintenance support
[karo-tx-uboot.git] / arch / arm / lib / board.c
index 1fd5f8362f7a3e1a076c44e9f554e6c0297dfdb0..fc52a26b797a47c2945e9846c4d877efb58b091b 100644 (file)
@@ -262,9 +262,6 @@ init_fnc_t *init_sequence[] = {
        init_func_i2c,
 #endif
        dram_init,              /* configure available RAM banks */
-#if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI)
-       arm_pci_init,
-#endif
        NULL,
 };
 
@@ -276,7 +273,7 @@ void board_init_f (ulong bootflag)
        ulong addr, addr_sp;
 
        /* Pointer is writable since we allocated a register for it */
-       gd = (gd_t *) (CONFIG_SYS_INIT_SP_ADDR);
+       gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07);
        /* compiler optimization barrier needed for GCC >= 3.4 */
        __asm__ __volatile__("": : :"memory");
 
@@ -329,7 +326,7 @@ void board_init_f (ulong bootflag)
        debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
 #endif /* CONFIG_PRAM */
 
-#if !(defined(CONFIG_SYS_NO_ICACHE) && defined(CONFIG_SYS_NO_DCACHE))
+#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
        /* reserve TLB table */
        addr -= (4096 * 4);
 
@@ -344,21 +341,14 @@ void board_init_f (ulong bootflag)
        addr &= ~(4096 - 1);
        debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
 
-#ifdef CONFIG_VFD
-#      ifndef PAGE_SIZE
-#        define PAGE_SIZE 4096
-#      endif
-       /*
-        * reserve memory for VFD display (always full pages)
-        */
-       addr -= vfd_setmem (addr);
-       gd->fb_base = addr;
-#endif /* CONFIG_VFD */
-
 #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 */
 
        /*
@@ -399,7 +389,7 @@ void board_init_f (ulong bootflag)
                CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ, addr_sp);
 #endif
        /* leave 3 words for abort-stack    */
-       addr_sp -= 3;
+       addr_sp -= 12;
 
        /* 8-byte alignment for ABI compliance */
        addr_sp &= ~0x07;
@@ -459,7 +449,13 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
 
-       monitor_flash_len = _bss_start_ofs;
+       monitor_flash_len = _end_ofs;
+       /*
+        * Enable D$:
+        * I$, if needed, must be already enabled in start.S
+        */
+       dcache_enable();
+
        debug ("monitor flash len: %08lX\n", monitor_flash_len);
        board_init();   /* Setup chipselects */
 
@@ -481,7 +477,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
 
 #if !defined(CONFIG_SYS_NO_FLASH)
-       puts ("FLASH: ");
+       puts ("Flash: ");
 
        if ((flash_size = flash_init ()) > 0) {
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
@@ -529,10 +525,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
        /* initialize environment */
        env_relocate ();
 
-#ifdef CONFIG_VFD
-       /* must do this after the framebuffer is allocated */
-       drv_vfd_init();
-#endif /* CONFIG_VFD */
+#if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
+       arm_pci_init();
+#endif
 
        /* IP Address */
        gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr");