[PATCH] fix snd_ich support for Asus M2400N

Autrijus Tang autrijus at autrijus.org
Sat Feb 21 12:35:27 PST 2004


(This is a folllow-up to misc/61388)

Hi. Here is a patch against -CURRENT that fixes ich4 support for
pcm0: <SigmaTel STAC9750/51 AC97 Codec>.  It works by backporting
the legacy support for NAMBAR/NABMBAR from 5.1-RELEASE, instead
of using the newer and broken MMBAR/MBBAR.

Before this patch, dmesg shows:
	pcm0: unable to map IO port space
	device_probe_and_attach: pcm0 attach returned 6

After this patch, it becomes:
	pcm0: <Intel ICH4 (82801DB)> port 0xe100-0xe13f,0xe000-0xe0ff irq 5 at device 31.5 on pci0
	pcm0: <SigmaTel STAC9750/51 AC97 Codec>

Thanks,
/Autrijus/

--- /usr/src/sys/dev/sound/pci/ich.orig	Sat Feb 21 17:40:43 2004
+++ /usr/src/sys/dev/sound/pci/ich.c	Sun Feb 22 04:21:29 2004
@@ -693,12 +693,23 @@
 	}
 
 	/*
+	 * By default, ich4 has NAMBAR and NABMBAR i/o spaces as
+	 * read-only.  Need to enable "legacy support", by poking into
+	 * pci config space.  The driver should use MMBAR and MBBAR,
+	 * but doing so will mess things up here.  ich4 has enough new
+	 * features it warrants it's own driver. 
+	 */
+	if (pci_get_devid(dev) == ICH4ID) {
+		pci_write_config(dev, PCIR_ICH_LEGACY, ICH_LEGACY_ENABLE, 1);
+	}
+
+	/*
 	 * Enable bus master. On ich4/5 this may prevent the detection of
 	 * the primary codec becoming ready in ich_init().
 	 */
 	pci_enable_busmaster(dev);
 
-	if ((pci_get_devid(dev) == ICH4ID) || (pci_get_devid(dev) == ICH5ID)) {
+	if (pci_get_devid(dev) == ICH5ID) {
 		sc->nambarid = PCIR_MMBAR;
 		sc->nabmbarid = PCIR_MBBAR;
 		sc->regtype = SYS_RES_MEMORY;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: 
	=?UTF-8?Q?=E9=80=99=E6=98=AF=E6=95=B8=E4=BD=8D=E5=8A=A0=E7=B0=BD?=
	=?UTF-8?Q?=E7=9A=84=E9=83=B5?= =?UTF-8?Q?=E4=BB=B6?=
Url : http://lists.freebsd.org/pipermail/freebsd-multimedia/attachments/20040222/216f2a71/attachment.bin


More information about the freebsd-multimedia mailing list