public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Pavel Roskin <proski@gnu.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Making TI bridges work with kernel PCMCIA
Date: Thu, 20 Dec 2001 21:49:11 +0100	[thread overview]
Message-ID: <20011220204911.25097@smtp.noos.fr> (raw)
In-Reply-To: <Pine.LNX.4.33.0112191617370.2705-100000@marabou.research.att.com>
In-Reply-To: <Pine.LNX.4.33.0112191617370.2705-100000@marabou.research.att.com>

>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.

I have to use a similar workaround on pmac laptops. However, I do that
in the platform specific quirks.

Ben.

>=========================
>--- 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;
> }



  reply	other threads:[~2001-12-20 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-20 20:16 [PATCH] Making TI bridges work with kernel PCMCIA Pavel Roskin
2001-12-20 20:49 ` Benjamin Herrenschmidt [this message]
2001-12-20 21:07   ` Pavel Roskin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011220204911.25097@smtp.noos.fr \
    --to=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=proski@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox