9 #if defined(CONFIG_CMD_PCMCIA)
13 #if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
19 /* A lot of this has been taken from the RPX code in this file it works from me.
20 I have added the voltage selection for the MBX board. */
22 /* MBX voltage bit in control register #2 */
23 #define CR2_VPP12 ((uchar)0x10)
24 #define CR2_VPPVDD ((uchar)0x20)
25 #define CR2_VDD5 ((uchar)0x40)
26 #define CR2_VDD3 ((uchar)0x80)
28 #define PCMCIA_BOARD_MSG "MBX860"
30 int pcmcia_voltage_set (int slot, int vcc, int vpp)
34 debug ("voltage_set: PCMCIA_BOARD_MSG Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
35 'A' + slot, vcc / 10, vcc % 10, vpp / 10, vcc % 10);
68 /* first, turn off all power */
69 MBX_CSR2 &= ~(CR2_VDDSEL | CR2_VPPSEL);
71 /* enable new powersettings */
73 debug ("MBX_CSR2 read = 0x%02x\n", MBX_CSR2);
78 int pcmcia_hardware_enable (int slot)
80 volatile pcmconf8xx_t *pcmp;
83 debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n",
88 pcmp = (pcmconf8xx_t *) (&(((immap_t *) CONFIG_SYS_IMMR)->im_pcmcia));
90 /* clear interrupt state, and disable interrupts */
91 pcmp->pcmc_pscr = PCMCIA_MASK (_slot_);
92 pcmp->pcmc_per &= ~PCMCIA_MASK (_slot_);
95 * Disable interrupts, DMA, and PCMCIA buffers
96 * (isolate the interface) and assert RESET signal
98 debug ("Disable PCMCIA buffers and assert RESET\n");
100 reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
101 reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
102 PCMCIA_PGCRX (_slot_) = reg;
105 /* remove all power */
106 pcmcia_voltage_set (slot, 0, 0);
108 * Make sure there is a card in the slot, then configure the interface.
111 debug ("[%d] %s: PIPR(%p)=0x%x\n",
112 __LINE__,__FUNCTION__,
113 &(pcmp->pcmc_pipr),pcmp->pcmc_pipr);
114 if (pcmp->pcmc_pipr & (0x10000000 >> (slot << 4))) {
115 printf (" No Card found\n");
122 mask = PCMCIA_VS1 (_slot_) | PCMCIA_VS2 (_slot_);
123 reg = pcmp->pcmc_pipr;
124 debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg,
125 (reg & PCMCIA_VS1 (slot)) ? "n" : "ff",
126 (reg & PCMCIA_VS2 (slot)) ? "n" : "ff");
128 if ((reg & mask) == mask) {
129 pcmcia_voltage_set (_slot_, 50, 0);
130 printf (" 5.0V card found: ");
132 pcmcia_voltage_set (_slot_, 33, 0);
133 printf (" 3.3V card found: ");
136 debug ("Enable PCMCIA buffers and stop RESET\n");
137 reg = PCMCIA_PGCRX (_slot_);
138 reg &= ~__MY_PCMCIA_GCRX_CXRESET; /* active high */
139 reg &= ~__MY_PCMCIA_GCRX_CXOE; /* active low */
140 PCMCIA_PGCRX (_slot_) = reg;
142 udelay (250000); /* some cards need >150 ms to come up :-( */
144 debug ("# hardware_enable done\n");
149 #if defined(CONFIG_CMD_PCMCIA)
150 int pcmcia_hardware_disable (int slot)
152 return 0; /* No hardware to disable */
156 #endif /* CONFIG_PCMCIA */