]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/amcc/acadia/memory.c
ppc4xx: Add NAND booting support for AMCC Acadia (405EZ) eval board
[people/ms/u-boot.git] / board / amcc / acadia / memory.c
index 5375d36c9b580d1d5b757692a8b1a67aa02dbf52..25904d3b94a9680ff995ce6927effefc37ca28e3 100644 (file)
@@ -39,6 +39,7 @@ void sdram_init(void)
        return;
 }
 
+#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
 static void cram_bcr_write(u32 wr_val)
 {
        wr_val <<= 2;
@@ -62,9 +63,12 @@ static void cram_bcr_write(u32 wr_val)
 
        return;
 }
+#endif
 
 long int initdram(int board_type)
 {
+#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+       int i;
        u32 val;
 
        /* 1. EBC need to program READY, CLK, ADV for ASync mode */
@@ -92,7 +96,12 @@ long int initdram(int board_type)
 
        /* Config EBC to use RDY */
        mfsdr(sdrultra0, val);
-       mtsdr(sdrultra0, val | 0x04000000);
+       mtsdr(sdrultra0, val | SDR_ULTRA0_EBCRDYEN);
+
+       /* Wait a short while, since for NAND booting this is too fast */
+       for (i=0; i<200000; i++)
+               ;
+#endif
 
        return (CFG_MBYTES_RAM << 20);
 }