X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Ficu862%2Fpcmcia.c;h=dbe3c3cf72fc4130ad34daa5e7d6f81ff77ec6a4;hb=3c47f2f4871c345c20b9d986b11fec550ef6cc9f;hp=20f653ba2ba381ad34363c32275dd354e8e8d646;hpb=42868896df7eac02f67e2c52c6457c917b1542e9;p=u-boot diff --git a/board/icu862/pcmcia.c b/board/icu862/pcmcia.c index 20f653ba2b..dbe3c3cf72 100644 --- a/board/icu862/pcmcia.c +++ b/board/icu862/pcmcia.c @@ -4,11 +4,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 @@ -18,18 +18,16 @@ static void cfg_port_B (void) { - volatile immap_t *immap; volatile cpm8xx_t *cp; uint reg; - immap = (immap_t *)CFG_IMMR; - cp = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm)); + cp = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm)); /* - * Configure Port B for TPS2205 PC-Card Power-Interface Switch - * - * Switch off all voltages, assert shutdown - */ + * Configure Port B for TPS2205 PC-Card Power-Interface Switch + * + * Switch off all voltages, assert shutdown + */ reg = cp->cp_pbdat; reg |= (TPS2205_VPP_PGM | TPS2205_VPP_VCC | /* VAVPP => Hi-Z */ TPS2205_VCC3 | TPS2205_VCC5 | /* VAVCC => Hi-Z */ @@ -47,7 +45,6 @@ static void cfg_port_B (void) int pcmcia_hardware_enable(int slot) { - volatile immap_t *immap; volatile cpm8xx_t *cp; volatile pcmconf8xx_t *pcmp; volatile sysconf8xx_t *sysp; @@ -58,10 +55,9 @@ int pcmcia_hardware_enable(int slot) 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)); + 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 Port B for TPS2205 PC-Card Power-Interface Switch */ cfg_port_B (); @@ -155,7 +151,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; @@ -165,9 +161,9 @@ int pcmcia_hardware_disable(int slot) debug ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); - immap = (immap_t *)CFG_IMMR; - cp = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm)); - pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); + immap = (immap_t *)CONFIG_SYS_IMMR; + cp = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm)); + pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); /* Shut down */ cp->cp_pbdat &= ~(TPS2205_SHDN); @@ -183,12 +179,11 @@ int pcmcia_hardware_disable(int slot) return (0); } -#endif /* CFG_CMD_PCMCIA */ +#endif int pcmcia_voltage_set(int slot, int vcc, int vpp) { - volatile immap_t *immap; volatile cpm8xx_t *cp; volatile pcmconf8xx_t *pcmp; u_long reg; @@ -198,9 +193,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; - cp = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm)); - pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); + cp = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm)); + pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); /* * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal @@ -223,10 +217,10 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp) reg = cp->cp_pbdat; switch(vcc) { - case 0: break; /* Switch off */ + case 0: break; /* Switch off */ case 33: reg &= ~TPS2205_VCC3; break; /* Switch on 3.3V */ case 50: reg &= ~TPS2205_VCC5; break; /* Switch on 5.0V */ - default: goto done; + default: goto done; } /* Checking supported voltages */