Change initdram() return type to phys_size_t
[pandora-u-boot.git] / board / amcc / acadia / memory.c
index 25904d3..48a6725 100644 (file)
 #include <asm/io.h>
 #include <asm/gpio.h>
 
-/*
- * sdram_init - Dummy implementation for start.S, spd_sdram used on this board!
- */
-void sdram_init(void)
-{
-       return;
-}
+extern void board_pll_init_f(void);
 
 #if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
 static void cram_bcr_write(u32 wr_val)
@@ -65,8 +59,17 @@ static void cram_bcr_write(u32 wr_val)
 }
 #endif
 
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
+#if defined(CONFIG_NAND_SPL)
+       u32 reg;
+
+       /* don't reinit PLL when booting via I2C bootstrap option */
+       mfsdr(SDR_PINSTP, reg);
+       if (reg != 0xf0000000)
+               board_pll_init_f();
+#endif
+
 #if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
        int i;
        u32 val;
@@ -105,8 +108,3 @@ long int initdram(int board_type)
 
        return (CFG_MBYTES_RAM << 20);
 }
-
-int testdram(void)
-{
-       return (0);
-}