[linux-audio-user] snd-hdsp+cardbus+M6807 notebook=distortion -- FIXED!

Daniel Ritz daniel.ritz at gmx.ch
Wed Apr 21 00:43:42 BST 2004


On Monday 19 April 2004 14:35, Tim Blechmann wrote:
> > could you actually show us the hexdump of the config space?
> 
[...]
> both the windows and the linux configurations have the same register
> settings, except for the memory address ...

the size of the memory windows differ and windows doesn't set
the prefetch flag for memory window 0 (win: 04 at 3fh, linux: 05)
also windows doesn't set the cardbus latency timer at all (at 1b)

> i hope this helps...
> 
> > for your OZ6933 there are some setting that should be tried. it's
> > enable/disable the FIFO between CB and PCI, enable/dispable posted
> > writes. i have a patch that messes around with these setting, but i
> > need to see the hexdump first.
> just tell me how ... i'll do nearly everything what you tell me ...
> 

with the attached patch. it's not in PCI config space, so you can't see
it in the hexdump. but: the two bits should be on by default. may be the
bios disabled them? you'll see if they are changed by the patch in
dmesg.

if it doesn't work, try playing with o2micro.h. i did three blocks there
to enable/disable the FIFO/postwriting. test them all, only one at a
time to #if 1, the other two to #if 0

also a full lspci -vvv and a hexdump of the config space of the PCI
bridge (i think you have a 82801BA/CA pci bridge, right?) it may
be that the BIOS did something wrong there and linux doesn't take
care about. (plus the windows one to compare)

rgds
-daniel

--- 1.54/drivers/pcmcia/yenta_socket.c	Wed Apr 14 23:06:58 2004
+++ edited/drivers/pcmcia/yenta_socket.c	Sun Apr 18 13:23:05 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,9 @@
 	[CARDBUS_TYPE_TOPIC97]	= {
 		.override	= topic97_override,
 	},
+	[CARDBUS_TYPE_O2MICRO]	= {
+		.override	= o2micro_override,
+	},
 };
 
 
@@ -1098,6 +1103,13 @@
 
 	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_DEVICE_ID_O2_6729, O2MICRO),
+	CB_ID(PCI_VENDOR_ID_O2, PCI_DEVICE_ID_O2_6730, O2MICRO),
+	CB_ID(PCI_VENDOR_ID_O2, PCI_DEVICE_ID_O2_6812, O2MICRO),
+	CB_ID(PCI_VENDOR_ID_O2, PCI_DEVICE_ID_O2_6832, O2MICRO),
+	CB_ID(PCI_VENDOR_ID_O2, PCI_DEVICE_ID_O2_6836, O2MICRO),
+	CB_ID(PCI_VENDOR_ID_O2, PCI_DEVICE_ID_O2_6933, 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	Tue Apr 20 21:43:08 2004
@@ -48,6 +48,9 @@
 #ifndef PCI_DEVICE_ID_O2_6812
 #define PCI_DEVICE_ID_O2_6812		0x6872
 #endif
+#ifndef PCI_DEVICE_ID_O2_6933
+#define PCI_DEVICE_ID_O2_6933		0x6933
+#endif
 
 /* Additional PCI configuration registers */
 
@@ -65,6 +68,12 @@
 #define  O2_MUX_PCI_VCC_5V	0x00800000
 #define  O2_MUX_PME_MUX		0x0f000000
 
+/* Additional registers, in CB memory space */
+#define O2_MISC_CONTROL		0x28	/* 32 bit */
+#define O2_MISC_CB_FIFO		0x00800000
+#define O2_MISC_MEM_POSTWR	0x00400000
+
+
 /* Additional ExCA registers */
 
 #define O2_MODE_A		0x38
@@ -119,5 +128,41 @@
 #define  O2_MODE_E_SPKR_OUT	0x02
 #define  O2_MODE_E_LED_OUT	0x08
 #define  O2_MODE_E_SKTA_ACTV	0x10
+
+static int o2micro_override(struct yenta_socket *socket)
+{
+	u32 misc_ctrl, old;
+
+	old = misc_ctrl = cb_readl(socket, O2_MISC_CONTROL);
+
+	printk("Yenta O2: socket %s: misc ctrl %08x\n", pci_name(socket->dev), misc_ctrl);
+
+	/* mess around with FIFO and Memory post write */
+
+#if 1
+	/* enable both */
+	misc_ctrl |= O2_MISC_CB_FIFO | O2_MISC_MEM_POSTWR;
+#endif
+
+#if 0
+	/* disable both */
+	misc_ctrl &= ~(O2_MISC_CB_FIFO | O2_MISC_MEM_POSTWR);
+#endif
+
+#if 0
+	/* only FIFO, but no post write */
+	misc_ctrl |= O2_MISC_CB_FIFO;
+	misc_ctrl &= ~O2_MISC_MEM_POSTWR;
+#endif
+
+	
+	if (misc_ctrl != old) {
+		printk("Yenta O2: socket %s: changing misc ctrl to %08x\n",
+		       pci_name(socket->dev), misc_ctrl);
+		cb_writel(socket, O2_MISC_CONTROL, misc_ctrl);
+	}
+
+	return 0;
+}
 
 #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