]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] yenta: don't enable read prefetch on older o2 bridges.
authorDaniel Ritz <daniel.ritz@gmx.ch>
Wed, 1 Dec 2004 09:11:00 +0000 (01:11 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 1 Dec 2004 09:11:00 +0000 (01:11 -0800)
It turns out that just blindly enabling read prefetch is wrong for the
older (and buggy) oz6833 bridge.  fixed in the attached patch.

- don't touch the oz6832/6833
- more verbose
- only set the read prefetch and the write burst bits

it broke on some old laptop with a cardbus tulip.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pcmcia/o2micro.h

index adbe8a724e0a0d92a18ffe4c4e03707b7f1150a9..b1f6e3d9ee0665be99b2feb40e3c6e3e6b5f55e0 100644 (file)
@@ -129,9 +129,24 @@ static int o2micro_override(struct yenta_socket *socket)
         * ok to write to both registers on all O2 bridges.
         * from Eric Still, 02Micro.
         */
+       u8 a, b;
+
        if (PCI_FUNC(socket->dev->devfn) == 0) {
-               config_writeb(socket, 0x94, 0xCA);
-               config_writeb(socket, 0xD4, 0xCA);
+               a = config_readb(socket, 0x94);
+               b = config_readb(socket, 0xD4);
+
+               printk(KERN_INFO "Yenta O2: res at 0x94/0xD4: %02x/%02x\n", a, b);
+
+               switch (socket->dev->device) {
+               case PCI_DEVICE_ID_O2_6832:
+                       printk(KERN_INFO "Yenta O2: old bridge, not enabling read prefetch / write burst\n");
+                       break;
+
+               default:
+                       printk(KERN_INFO "Yenta O2: enabling read prefetch/write burst\n");
+                       config_writeb(socket, 0x94, a | 0x0a);
+                       config_writeb(socket, 0xD4, b | 0x0a);
+               }
        }
 
        return 0;