ppc4xx: Big cleanup of PPC4xx defines
[platform/kernel/u-boot.git] / cpu / ppc4xx / 40x_spd_sdram.c
index 19c4f76..83fa709 100644 (file)
 /*
  * Set default values
  */
-#ifndef CFG_I2C_SPEED
-#define CFG_I2C_SPEED  50000
-#endif
-
-#ifndef CFG_I2C_SLAVE
-#define CFG_I2C_SLAVE  0xFE
+#ifndef CONFIG_SYS_I2C_SPEED
+#define CONFIG_SYS_I2C_SPEED   50000
 #endif
 
 #define ONE_BILLION    1000000000
@@ -126,9 +122,9 @@ long int spd_sdram(int(read_spd)(uint addr))
 
        int sdram0_pmit=0x07c00000;
 #ifndef CONFIG_405EP /* not on PPC405EP */
-       int sdram0_besr0=-1;
-       int sdram0_besr1=-1;
-       int sdram0_eccesr=-1;
+       int sdram0_besr0 = -1;
+       int sdram0_besr1 = -1;
+       int sdram0_eccesr = -1;
 #endif
        int sdram0_ecccfg;
 
@@ -148,7 +144,7 @@ long int spd_sdram(int(read_spd)(uint addr))
        int t_rc;
        int min_cas;
 
-       PPC405_SYS_INFO sys_info;
+       PPC4xx_SYS_INFO sys_info;
        unsigned long bus_period_x_10;
 
        /*
@@ -163,7 +159,7 @@ long int spd_sdram(int(read_spd)(uint addr))
                 * Make sure I2C controller is initialized
                 * before continuing.
                 */
-               i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
+               i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
        }
 
        /* Make shure we are using SDRAM */
@@ -426,7 +422,7 @@ long int spd_sdram(int(read_spd)(uint addr))
         * program all the registers.
         * -------------------------------------------------------------------*/
 
-#define mtsdram0(reg, data)  mtdcr(memcfga,reg);mtdcr(memcfgd,data)
+#define mtsdram0(reg, data)  mtdcr(SDRAM0_CFGADDR,reg);mtdcr(SDRAM0_CFGDATA,data)
        /* disable memcontroller so updates work */
        mtsdram0( mem_mcopt1, 0 );