[PATCH] enable read prefetch for O2Micro bridges (take 2)

Daniel Ritz daniel.ritz at gmx.ch
Thu May 6 23:06:52 BST 2004


This one enables read prefetching on O2micro bridges. It fixes the problems
seen with the RME Hammerfall DSP.
Thanks to Eric Still from O2micro for the input.

changes since last patch:
- match all o2micro cardbus bridges
- don't mess around with pci ids
- remove the wrong 67xx pci-pcmcia bridge from the list (-ENOCOFFE)


--- 1.54/drivers/pcmcia/yenta_socket.c	Wed Apr 14 23:06:58 2004
+++ edited/drivers/pcmcia/yenta_socket.c	Thu May  6 20:56:19 2004
@@ -668,6 +668,7 @@
 #include "ti113x.h"
 #include "ricoh.h"
 #include "topic.h"
+#include "o2micro.h"
 
 enum {
 	CARDBUS_TYPE_DEFAULT = -1,
@@ -676,7 +677,8 @@
 	CARDBUS_TYPE_TI12XX,
 	CARDBUS_TYPE_TI1250,
 	CARDBUS_TYPE_RICOH,
-	CARDBUS_TYPE_TOPIC97
+	CARDBUS_TYPE_TOPIC97,
+	CARDBUS_TYPE_O2MICRO,
 };
 
 /*
@@ -716,6 +718,10 @@
 	[CARDBUS_TYPE_TOPIC97]	= {
 		.override	= topic97_override,
 	},
+	[CARDBUS_TYPE_O2MICRO]	= {
+		.override	= o2micro_override,
+		.restore_state	= o2micro_restore_state,
+	},
 };
 
 
@@ -1098,6 +1104,8 @@
 
 	CB_ID(PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_TOPIC97, TOPIC97),
 	CB_ID(PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_TOPIC100, TOPIC97),
+
+	CB_ID(PCI_VENDOR_ID_O2, PCI_ANY_ID, O2MICRO),
 
 	/* match any cardbus bridge */
 	CB_ID(PCI_ANY_ID, PCI_ANY_ID, DEFAULT),
--- 1.3/drivers/pcmcia/o2micro.h	Sat Oct 19 01:11:25 2002
+++ edited/drivers/pcmcia/o2micro.h	Thu May  6 20:55:33 2004
@@ -120,4 +120,30 @@
 #define  O2_MODE_E_LED_OUT	0x08
 #define  O2_MODE_E_SKTA_ACTV	0x10
 
+static int o2micro_override(struct yenta_socket *socket)
+{
+	/*
+	 * 'reserved' register at 0x94/D4. chaning it to 0xCA (8 bit) enables
+	 * read prefetching which for example makes the RME Hammerfall DSP
+	 * working. for some bridges it is at 0x94, for others at 0xD4. it's
+	 * ok to write to both registers on all O2 bridges.
+	 * from Eric Still, 02Micro.
+	 */
+	if (PCI_FUNC(socket->dev->devfn) == 0) {
+		config_writeb(socket, 0x94, 0xCA);
+		config_writeb(socket, 0xD4, 0xCA);
+	}
+
+	return 0;
+}
+
+static void o2micro_restore_state(struct yenta_socket *socket)
+{
+	/*
+	 * as long as read prefetch is the only thing in
+	 * o2micro_override, it's safe to call it from here
+	 */
+	o2micro_override(socket);
+}
+
 #endif /* _LINUX_O2MICRO_H */
--- 1.50/drivers/pcmcia/i82365.c	Sat Apr 17 10:36:21 2004
+++ edited/drivers/pcmcia/i82365.c	Tue Apr 20 21:44:05 2004
@@ -65,7 +65,6 @@
 #include "cirrus.h"
 #include "vg468.h"
 #include "ricoh.h"
-#include "o2micro.h"
 
 #ifdef DEBUG
 static const char *version =




More information about the linux-pcmcia mailing list