Update of /cvsroot/linux-mips/linux/drivers/pcmcia
In directory usw-pr-cvs1:/tmp/cvs-serv23818/drivers/pcmcia
Modified Files:
au1000_generic.c au1000_pb1x00.c
Log Message:
Added support for the 2nd pcmcia slot on the Pb1000 board.
Index: au1000_generic.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/drivers/pcmcia/au1000_generic.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- au1000_generic.c 19 Apr 2002 19:12:52 -0000 1.10
+++ au1000_generic.c 22 Apr 2002 23:28:50 -0000 1.11
@@ -183,6 +183,11 @@
memset(pcmcia_socket, 0,
sizeof(struct au1000_pcmcia_socket) * socket_count);
+ /*
+ * Assuming max of 2 sockets, which the Au1000 supports.
+ * WARNING: the Pb1000 has two sockets, and both work, but you
+ * can't use them both at the same time due to glue logic conflicts.
+ */
for(i=0; i < socket_count; i++) {
if(pcmcia_low_level->socket_state(i, &state)<0){
@@ -199,8 +204,10 @@
pcmcia_socket[i].phys_mem = (memaddr_t)0xF80000000;
}
else {
- printk(KERN_ERR "au1000: socket 1 not supported\n");
- return 1;
+ pcmcia_socket[i].virt_io =
+ (u32)ioremap((ioaddr_t)0xF08000000, 0x1000);
+ pcmcia_socket[i].phys_attr = (memaddr_t)0xF48000000;
+ pcmcia_socket[i].phys_mem = (memaddr_t)0xF88000000;
}
}
Index: au1000_pb1x00.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/drivers/pcmcia/au1000_pb1x00.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- au1000_pb1x00.c 22 Apr 2002 17:37:35 -0000 1.2
+++ au1000_pb1x00.c 22 Apr 2002 23:28:50 -0000 1.3
@@ -68,12 +68,12 @@
static int pb1x00_pcmcia_init(struct pcmcia_init *init)
{
#ifdef CONFIG_MIPS_PB1000
- u32 pcr;
+ u16 pcr;
pcr = PCR_SLOT_0_RST | PCR_SLOT_1_RST;
- writel(0x8000, PB1000_MDR); /* clear pcmcia interrupt */
+ writew(0x8000, PB1000_MDR); /* clear pcmcia interrupt */
au_sync_delay(100);
- writel(0x4000, PB1000_MDR); /* enable pcmcia interrupt */
+ writew(0x4000, PB1000_MDR); /* enable pcmcia interrupt */
au_sync();
pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,0);
@@ -81,8 +81,7 @@
writew(pcr, PB1000_PCR);
au_sync_delay(20);
- /* There's two sockets, but only the first one, 0, is used and tested */
- return 1;
+ return PCMCIA_NUM_SOCKS;
#else /* fixme -- take care of the Pb1500 at some point */
@@ -91,7 +90,7 @@
pcr &= ~(PB1100_PC_DEASSERT_RST | PB1100_PC_DRV_EN);
writew(pcr, PB1100_MEM_PCMCIA);
au_sync_delay(500);
- return 1;
+ return PCMCIA_NUM_SOCKS;
#endif
}
@@ -118,16 +117,18 @@
static int
pb1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
{
- u32 inserted;
- unsigned char vs;
+ u32 inserted0, inserted1;
+ unsigned short vs0, vs1;
#ifdef CONFIG_MIPS_PB1000
- vs = readw(PB1000_ACR1);
- inserted = !(vs & (ACR1_SLOT_0_CD1 | ACR1_SLOT_0_CD2));
- vs = (vs >> 4) & 0x3;
+ vs0 = vs1 = readw(PB1000_ACR1);
+ inserted0 = !(vs0 & (ACR1_SLOT_0_CD1 | ACR1_SLOT_0_CD2));
+ inserted1 = !(vs1 & (ACR1_SLOT_1_CD1 | ACR1_SLOT_1_CD2));
+ vs0 = (vs0 >> 4) & 0x3;
+ vs1 = (vs1 >> 12) & 0x3;
#else
- vs = (readw(PB1100_BOARD_STATUS) >> 4) & 0x3;
- inserted = !((readl(SYS_PINSTATERD) >> 9) & 0x1); /* gpio 9 */
+ vs0 = (readw(PB1100_BOARD_STATUS) >> 4) & 0x3;
+ inserted0 = !((readl(SYS_PINSTATERD) >> 9) & 0x1); /* gpio 9 */
#endif
state->ready = 0;
@@ -136,8 +137,8 @@
state->detect = 0;
if (sock == 0) {
- if (inserted) {
- switch (vs) {
+ if (inserted0) {
+ switch (vs0) {
case 0:
case 2:
state->vs_3v=1;
@@ -147,14 +148,29 @@
default:
/* return without setting 'detect' */
printk(KERN_ERR "pb1x00 bad VS (%d)\n",
- vs);
+ vs0);
return;
}
state->detect = 1;
}
}
else {
- printk(KERN_ERR "pb1x00 socket_state bad sock %d\n", sock);
+ if (inserted1) {
+ switch (vs1) {
+ case 0:
+ case 2:
+ state->vs_3v=1;
+ break;
+ case 3: /* 5V */
+ break;
+ default:
+ /* return without setting 'detect' */
+ printk(KERN_ERR "pb1x00 bad VS (%d)\n",
+ vs1);
+ return;
+ }
+ state->detect = 1;
+ }
}
if (state->detect) {
@@ -173,11 +189,11 @@
if(info->sock > PCMCIA_MAX_SOCK) return -1;
- if(info->sock == 0) {
- info->irq = PCMCIA_IRQ;
- }
- else
- info->irq = -1;
+ /*
+ * Even in the case of the Pb1000, both sockets are connected
+ * to the same irq line.
+ */
+ info->irq = PCMCIA_IRQ;
return 0;
}
|