]> git.sur5r.net Git - u-boot/blobdiff - drivers/pcmcia/pxa_pcmcia.c
Merge branch 'master' of git://git.denx.de/u-boot-nios
[u-boot] / drivers / pcmcia / pxa_pcmcia.c
index 6020e46283abc966f5de4b3f5fb183402138e683..d06ab746c8ad8c50e7a293daa8dfa47c548983fa 100644 (file)
@@ -1,8 +1,6 @@
 #include <common.h>
 #include <config.h>
 
-#ifdef CONFIG_PXA_PCMCIA
-
 #include <pcmcia.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
@@ -15,12 +13,12 @@ static inline void msWait(unsigned msVal)
 int pcmcia_on (void)
 {
        unsigned int reg_arr[] = {
-               0x48000028, CFG_MCMEM0_VAL,
-               0x4800002c, CFG_MCMEM1_VAL,
-               0x48000030, CFG_MCATT0_VAL,
-               0x48000034, CFG_MCATT1_VAL,
-               0x48000038, CFG_MCIO0_VAL,
-               0x4800003c, CFG_MCIO1_VAL,
+               0x48000028, CONFIG_SYS_MCMEM0_VAL,
+               0x4800002c, CONFIG_SYS_MCMEM1_VAL,
+               0x48000030, CONFIG_SYS_MCATT0_VAL,
+               0x48000034, CONFIG_SYS_MCATT1_VAL,
+               0x48000038, CONFIG_SYS_MCIO0_VAL,
+               0x4800003c, CONFIG_SYS_MCIO1_VAL,
 
                0, 0
        };
@@ -35,8 +33,10 @@ int pcmcia_on (void)
        debug ("%s\n", __FUNCTION__);
 
        i = 0;
-       while (reg_arr[i])
-               *((volatile unsigned int *) reg_arr[i++]) |= reg_arr[i++];
+       while (reg_arr[i]) {
+               (*(volatile unsigned int *) reg_arr[i]) |= reg_arr[i + 1];
+               i += 2;
+       }
        udelay (1000);
 
        debug ("%s: programmed mem controller \n", __FUNCTION__);
@@ -44,7 +44,7 @@ int pcmcia_on (void)
 #ifdef CONFIG_EXADRON1
 
 /*define useful BCR masks */
-#define BCR_CF_INIT_VAL                    0x00007230
+#define BCR_CF_INIT_VAL                            0x00007230
 #define BCR_CF_PWRON_BUSOFF_RESETOFF_VAL    0x00007231
 #define BCR_CF_PWRON_BUSOFF_RESETON_VAL     0x00007233
 #define BCR_CF_PWRON_BUSON_RESETON_VAL      0x00007213
@@ -91,5 +91,3 @@ int pcmcia_off (void)
        return 0;
 }
 #endif
-
-#endif /* CONFIG_PXA_PCMCIA */