problem with TI adaptor

Daniel Ritz daniel.ritz at gmx.ch
Sun May 8 10:46:47 EDT 2005


hi

looking at the dmesg output:
May  7 10:55:20 logrus kernel: Yenta: CardBus bridge found at 0000:00:08.0 [133f:3000]
May  7 10:55:20 logrus kernel: Yenta: Enabling burst memory read transactions
May  7 10:55:20 logrus kernel: Yenta: Using CSCINT to route CSC interrupts to PCI
May  7 10:55:20 logrus kernel: Yenta: Routing CardBus interrupts to PCI
May  7 10:55:20 logrus kernel: Yenta TI: socket 0000:00:08.0, mfunc 0x00001d92, devctl 0x02
May  7 10:55:20 logrus kernel: Yenta: ISA IRQ mask 0x0000, PCI irq 11
May  7 10:55:20 logrus kernel: Socket status: 10000061

the socket status here is just wrong it has to looke lik 300000xxx (ie start with 3)
so probably there's something overlapping with the socket iomem space.

your reserve= parameter only changes the iomem of the cardbus card itself which
obviously doesn't help. my guess is that the cardbus bridge is not setup right
so that the cardbus card doesn't get power...

so as a first step could you try replacing the reserve= on the command line
with reserve=0x20000000,0x2000000

this reserves the area from 512MB to 544MB. so the socket itself get's another
iomem range assigned.

another possibility is that the socket is not initialized right maybe because of
the bios. the attached patch might help in that case...
(the patch is hand-edited. if it applies at all then with some offsets :)


rgds
-daniel

[PATCH] yenta: redo interrogation in more cases and harder socket_get_status()

change the code that redoes voltage interrogation to always do it as long as
no card is completley recognized. plus catch some clearly invalid states and redo
then.

it also runs the redo code before probing the ISA interrupts.

also makes the status reporting more accurate. ie !CBCARD doesn't always
mean 16bit card. it can be an unrecognized card as well. so check explicitley for
16BITCARD..

Signed-off-by: Daniel Ritz <daniel.ritz at gmx.ch>


--- 1.22/drivers/pcmcia/ti113x.h	2005-03-11 21:32:12 +01:00
+++ edited/drivers/pcmcia/ti113x.h	2005-04-21 00:12:09 +02:00
@@ -150,15 +154,15 @@
 
 	val  = (state & CB_3VCARD) ? SS_3VCARD : 0;
 	val |= (state & CB_XVCARD) ? SS_XVCARD : 0;
-	val |= (state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD | CB_3VCARD
-			 | CB_XVCARD | CB_YVCARD)) ? 0 : SS_PENDING;
+	val |= (state & (CB_5VCARD | CB_3VCARD | CB_XVCARD | CB_YVCARD)) ? 0 : SS_PENDING;
+	val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? SS_PENDING : 0;
 
 	if (state & CB_CBCARD) {
 		val |= SS_CARDBUS;	
 		val |= (state & CB_CARDSTS) ? SS_STSCHG : 0;
 		val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? 0 : SS_DETECT;
 		val |= (state & CB_PWRCYCLE) ? SS_POWERON | SS_READY : 0;
-	} else {
+	} else if (state & CB_16BITCARD) {
 		u8 status = exca_readb(socket, I365_STATUS);
 		val |= ((status & I365_CS_DETECT) == I365_CS_DETECT) ? SS_DETECT : 0;
 		if (exca_readb(socket, I365_INTCTL) & I365_PC_IOCARD) {
@@ -470,11 +469,23 @@
 	}
 }
 
+/* redoes voltage interrogation if required */
+static void yenta_interrogate(struct yenta_socket *socket)
+{
+	u32 state;
+
+	state = cb_readl(socket, CB_SOCKET_STATE);
+	if (!(state & (CB_5VCARD | CB_3VCARD | CB_XVCARD | CB_YVCARD)) ||
+	     (state & (CB_CDETECT1 | CB_CDETECT2 | CB_NOTACARD | CB_BADVCCREQ)) || 
+	     ((state & (CB_16BITCARD | CB_CBCARD)) == (CB_16BITCARD | CB_CBCARD)))
+		cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
+}
+
+
 /* Called at resume and initialization events */
 static int yenta_sock_init(struct pcmcia_socket *sock)
 {
 	struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
-	u32 state;
 	u16 bridge;
 
 	bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_INTR;
@@ -486,10 +497,7 @@
 	exca_writeb(socket, I365_GENCTL, 0x00);
 
 	/* Redo card voltage interrogation */
-	state = cb_readl(socket, CB_SOCKET_STATE);
-	if (!(state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD |
-	               CB_3VCARD | CB_XVCARD | CB_YVCARD)))
-		cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
+	yenta_interrogate(socket);
 
 	yenta_clear_maps(socket);
 
@@ -996,6 +990,7 @@
 	}
 
 	/* Figure out what the dang thing can do for the PCMCIA layer... */
+	yenta_interrogate(socket);
 	yenta_get_socket_capabilities(socket, isa_interrupts);
 	printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
 




More information about the linux-pcmcia mailing list