Merge branch 'evk1100-prep'
[oweals/u-boot.git] / board / amcc / acadia / memory.c
index 709d41e41aa456eaf7d60f4ea05296b66453b604..3e5c80ea42909a8e8f418b7d4eab3e4da6943526 100644 (file)
 
 extern void board_pll_init_f(void);
 
-/*
- * sdram_init - Dummy implementation for start.S, spd_sdram used on this board!
- */
-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;
 
        /* set CRAM_CRE to 1 */
-       gpio_write_bit(CFG_GPIO_CRAM_CRE, 1);
+       gpio_write_bit(CONFIG_SYS_GPIO_CRAM_CRE, 1);
 
        /* Write BCR to CRAM on CS1 */
        out32(wr_val + 0x00200000, 0);
@@ -61,13 +53,13 @@ static void cram_bcr_write(u32 wr_val)
        eieio();
 
        /* set CRAM_CRE back to 0 (normal operation) */
-       gpio_write_bit(CFG_GPIO_CRAM_CRE, 0);
+       gpio_write_bit(CONFIG_SYS_GPIO_CRAM_CRE, 0);
 
        return;
 }
 #endif
 
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
 #if defined(CONFIG_NAND_SPL)
        u32 reg;
@@ -83,10 +75,10 @@ long int initdram(int board_type)
        u32 val;
 
        /* 1. EBC need to program READY, CLK, ADV for ASync mode */
-       gpio_config(CFG_GPIO_CRAM_CLK, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
-       gpio_config(CFG_GPIO_CRAM_ADV, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
-       gpio_config(CFG_GPIO_CRAM_CRE, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
-       gpio_config(CFG_GPIO_CRAM_WAIT, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG);
+       gpio_config(CONFIG_SYS_GPIO_CRAM_CLK, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
+       gpio_config(CONFIG_SYS_GPIO_CRAM_ADV, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
+       gpio_config(CONFIG_SYS_GPIO_CRAM_CRE, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
+       gpio_config(CONFIG_SYS_GPIO_CRAM_WAIT, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG);
 
        /* 2. EBC in Async mode */
        mtebc(pb1ap, 0x078F1EC0);
@@ -102,8 +94,8 @@ long int initdram(int board_type)
        mtebc(pb2ap, 0x9C0201C0);
 
        /* Set GPIO pins back to alternate function */
-       gpio_config(CFG_GPIO_CRAM_CLK, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG);
-       gpio_config(CFG_GPIO_CRAM_ADV, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG);
+       gpio_config(CONFIG_SYS_GPIO_CRAM_CLK, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG);
+       gpio_config(CONFIG_SYS_GPIO_CRAM_ADV, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG);
 
        /* Config EBC to use RDY */
        mfsdr(sdrultra0, val);
@@ -114,12 +106,5 @@ long int initdram(int board_type)
                ;
 #endif
 
-       return (CFG_MBYTES_RAM << 20);
+       return (CONFIG_SYS_MBYTES_RAM << 20);
 }
-
-#ifndef CONFIG_NAND_SPL
-int testdram(void)
-{
-       return (0);
-}
-#endif