]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/lwmon/pcmcia.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / board / lwmon / pcmcia.c
index 2349286bb252472e12be50e5ecfa734c7db4fca4..ad2e60d590fe72b3657028e726f3678d7ced5806 100644 (file)
@@ -5,11 +5,11 @@
 
 #undef CONFIG_PCMCIA
 
-#if    (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 #define        CONFIG_PCMCIA
 #endif
 
-#if    (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
+#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
 #define        CONFIG_PCMCIA
 #endif
 
@@ -51,10 +51,10 @@ int pcmcia_hardware_enable(int slot)
 #endif
        udelay(10000);
 
-       immap = (immap_t *)CFG_IMMR;
-       sysp  = (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf));
-       pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
-       cp    = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm));
+       immap = (immap_t *)CONFIG_SYS_IMMR;
+       sysp  = (sysconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_siu_conf));
+       pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia));
+       cp    = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm));
 
        /*
         * Configure SIUMCR to enable PCMCIA port B
@@ -108,8 +108,8 @@ int pcmcia_hardware_enable(int slot)
 
        /*  switch VCC on */
        val |= MAX1604_OP_SUS | MAX1604_VCCBON;
-       i2c_init  (CFG_I2C_SPEED, CFG_I2C_SLAVE);
-       i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1);
+       i2c_init  (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
 
        udelay(500000);
 
@@ -127,7 +127,7 @@ int pcmcia_hardware_enable(int slot)
 }
 
 
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#if defined(CONFIG_CMD_PCMCIA)
 int pcmcia_hardware_disable(int slot)
 {
        volatile immap_t        *immap;
@@ -137,13 +137,13 @@ int pcmcia_hardware_disable(int slot)
 
        debug ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
 
-       immap = (immap_t *)CFG_IMMR;
-       pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
+       immap = (immap_t *)CONFIG_SYS_IMMR;
+       pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia));
 
        /* remove all power, put output in high impedance state */
        val  = MAX1604_VCCBHIZ | MAX1604_VPPBHIZ;
-       i2c_init  (CFG_I2C_SPEED, CFG_I2C_SLAVE);
-       i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1);
+       i2c_init  (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
 
        /* Configure PCMCIA General Control Register */
        debug ("Disable PCMCIA buffers and assert RESET\n");
@@ -166,7 +166,7 @@ int pcmcia_hardware_disable(int slot)
 
        return (0);
 }
-#endif /* CFG_CMD_PCMCIA */
+#endif
 
 
 int pcmcia_voltage_set(int slot, int vcc, int vpp)
@@ -181,8 +181,8 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp)
                " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
                'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10);
 
-       immap = (immap_t *)CFG_IMMR;
-       pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
+       immap = (immap_t *)CONFIG_SYS_IMMR;
+       pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia));
        /*
         * Disable PCMCIA buffers (isolate the interface)
         * and assert RESET signal
@@ -199,15 +199,15 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp)
         */
        debug ("PCMCIA power OFF\n");
        val  = MAX1604_VCCBHIZ | MAX1604_VPPBHIZ;
-       i2c_init  (CFG_I2C_SPEED, CFG_I2C_SLAVE);
-       i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1);
+       i2c_init  (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
 
        val = 0;
        switch(vcc) {
-       case  0:                        break;
+       case  0:                        break;
        case 33: val = MAX1604_VCC_35;  break;
-       case 50:                        break;
-       default:                        goto done;
+       case 50:                        break;
+       default:                        goto done;
        }
 
        /* Checking supported voltages */
@@ -216,7 +216,7 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp)
                pcmp->pcmc_pipr,
                (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V");
 
-       i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1);
+       i2c_write (CONFIG_SYS_I2C_POWER_A_ADDR, 0, 0, &val, 1);
        if (val) {
                debug ("PCMCIA powered at %sV\n",
                        (val & MAX1604_VCC_35) ? "3.3" : "5.0");