Skip to contentSkip to conversation

enable read prefetch on o2micro bridges to fix HDSP

PATCH New Daniel Ritz 1 participant 1 message Aug 21, 2004 Pcmcia

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enable read prefetch on o2micro bridges to fix HDSP

hi marcelo

this is in 2.6 since june 21 and even longer on the linux-pcmcia list (2.6 version). not a single negative report about this until now.

against 2.4-bknow

rgds
-daniel

--------------------

enable read prefetching on O2micro bridges. It fixes the problems seen with the RME Hammerfall DSP. it's also known to fix problems with an external cd-writer on a dell laptop.
Thanks to Eric Still from O2micro for the input.

drivers/pcmcia/yenta.c +3 -0
@@ -845,6 +845,7 @@
 
 #include "ti113x.h"
 #include "ricoh.h"
+#include "o2micro.h"
 
 /*
  * Different cardbus controllers have slightly different
@@ -879,6 +880,8 @@
 	{ PD(ENE,1225),  &ti_ops },
 	{ PD(ENE,1410),  &ti_ops },
 	{ PD(ENE,1420),  &ti_ops },
+
+	{ PCI_VENDOR_ID_O2, PCI_ANY_ID, &o2micro_ops },
 
 	{ PD(RICOH,RL5C465), &ricoh_ops },
 	{ PD(RICOH,RL5C466), &ricoh_ops },
drivers/pcmcia/o2micro.h +32 -0
@@ -120,4 +120,36 @@
 #define  O2_MODE_E_LED_OUT	0x08
 #define  O2_MODE_E_SKTA_ACTV	0x10
 
+static int o2micro_open(pci_socket_t *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 struct pci_socket_ops o2micro_ops = {
+	o2micro_open,
+	yenta_close,
+	yenta_init,
+	yenta_suspend,
+	yenta_get_status,
+	yenta_get_socket,
+	yenta_set_socket,
+	yenta_get_io_map,
+	yenta_set_io_map,
+	yenta_get_mem_map,
+	yenta_set_mem_map,
+	yenta_proc_setup
+};
+
 #endif /* _LINUX_O2MICRO_H */
drivers/pcmcia/i82365.c +0 -1
@@ -63,7 +63,6 @@
 #include "cirrus.h"
 #include "vg468.h"
 #include "ricoh.h"
-#include "o2micro.h"
 
 #ifdef PCMCIA_DEBUG
 static int pc_debug = PCMCIA_DEBUG;