[PATCH] Making TI bridges work with kernel PCMCIA

From: Pavel Roskin (proski@gnu.org)
Date: Thu Dec 20 2001 - 15:16:55 EST


Hello!

The driver for Cardbus/PCMCIA bridges (yenta_socket) doesn't initialize
the irqmux register of TI bridges. In fact, the driver doesn't even
access that register.

My experience shows that relying in the initial values of that register is
not a good idea. It is set to use ISA interrupts, but they don't work
with either of two motherboards I tested the bridge with.

Bridge:
CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 01)

Fisrt system:
Athlon 1GHz, motherboard AOpen KT-133.

Second system:
Compaq AP500, 2 x Pentium II, motherboard with Intel 440BX chipset.

This patch makes the same thing as "irq_mode=0" does in the standalone
PCMCIA driver (i82365). It means that PCMCIA cards inserted to the socket
have their interrupt redirected to the same PCI interrupt that is used for
the Card Status Change (csc) notification. I believe that's the safest
behavior, as it avoids probing ISA interupts.

Since the patch changes ti_open(), it affects all TI bridges. This should
be the right thing to do according to the pcmcia-cs sources. I'm a bit
surprized that the driver doesn't access those registers at all except
some old TI113x models.

The code with TI122X_SCR_INTRTIE has been copied from pcmcia-cs without
changes. It should only affect two-socket bridges.

The patch is against 2.4.17-rc2.

=========================
--- linux.orig/drivers/pcmcia/ti113x.h
+++ linux/drivers/pcmcia/ti113x.h
@@ -150,11 +150,27 @@
  */
 static int ti_open(pci_socket_t *socket)
 {
+ u32 irqmux;
+ u8 devctl, sysctl;
         u8 new, reg = exca_readb(socket, I365_INTCTL);
 
         new = reg & ~I365_INTR_ENA;
         if (new != reg)
                 exca_writeb(socket, I365_INTCTL, new);
+
+ /* Disable ISA interrupt routing ... */
+ devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
+ devctl &= ~TI113X_DCR_IMODE_MASK;
+ config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
+ /* ... and enable PCI routing instead */
+ sysctl = config_readb(socket, TI113X_SYSTEM_CONTROL);
+ irqmux = config_readl(socket, TI122X_IRQMUX);
+ irqmux = (irqmux & ~0x0f) | 0x02; /* route INTA */
+ if (!(sysctl & TI122X_SCR_INTRTIE)) {
+ irqmux = (irqmux & ~0xf0) | 0x20; /* route INTB */
+ }
+ config_writel(socket, TI122X_IRQMUX, irqmux);
+
         return 0;
 }
 
=========================

-- 
Regards,
Pavel Roskin

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 23 2001 - 21:00:23 EST