CURRENT Intel ICH5 (82801EB) errors

Pyun YongHyeon pyunyh at gmail.com
Thu Nov 17 08:11:26 GMT 2005


On Thu, Nov 17, 2005 at 10:49:20AM +0300, Andrew Bliznak wrote:
 > On 11/17/05, Pyun YongHyeon <pyunyh at gmail.com> wrote:
 > > On Wed, Nov 16, 2005 at 01:53:25PM +0300, Andrew Bliznak wrote:
 > >  > Just for information
 > >  >
 > >  > FreeBSD beef.xxxxxx.com 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Tue Nov 15
 > >  > 13:03:12 EET 2005
 > >  > andrew at pyvo.xxxxxx.com:/usr/home/andrew/C/obj/usr/home/andrew/C/src/sys/GENERIC
 > >  >  i386
 > >  >
 > >  > from dmesg:
 > >  > ---
 > >  > Nov 15 17:02:31 beef kernel: pcm0: <Intel ICH5 (82801EB)> port
 > >  > 0xd000-0xd0ff,0xe100-0xe13f mem
 > >  > 0xf8201000-0xf82011ff,0xf8202000-0xf82020ff irq 17 at device 31.5 on
 > >  > pci0
 > >  > Nov 15 17:02:31 beef kernel: pcm0: unable to initialize the card
 > >  > Nov 15 17:02:31 beef kernel: device_attach: pcm0 attach returned 6
 > >
 > > How about attached patch?
 > 
 > No luck, rebuild module and reload
 > ---
 > Nov 17 09:37:50 beef kernel: pcm0: <Intel ICH5 (82801EB)> port
 > 0xd000-0xd0ff,0xe100-0xe13f mem
 > 0xf8201000-0xf82011ff,0xf8202000-0xf82020ff irq 17 at device 31.5 on
 > pci0
 > Nov 17 09:37:50 beef kernel: pcm0: primary codec not ready!pcm0:
 > unable to initialize the card
 > Nov 17 09:37:50 beef kernel: device_attach: pcm0 attach returned 6
 > ---
 > 
 > Will try late with reboot, thanks anyway.
 > 

Hmm, then try this one. It just ignores PCR bit.
-- 
Regards,
Pyun YongHyeon
-------------- next part --------------
--- sys/dev/sound/pci/ich.c.orig	Wed Nov 16 09:50:55 2005
+++ sys/dev/sound/pci/ich.c	Thu Nov 17 17:06:22 2005
@@ -165,6 +165,8 @@
 	int use_intrhook;
 	uint16_t vendor;
 	uint16_t devid;
+	uint32_t flags;
+#define IGNORE_PCR	0x01
 	struct mtx *ich_lock;
 };
 
@@ -222,7 +224,10 @@
 		data = ich_rd(sc, ICH_REG_ACC_SEMA, 1);
 		if ((data & 0x01) == 0)
 			return 0;
+		DELAY(1);
 	}
+	if ((sc->flags & IGNORE_PCR) != 0)
+		return (0);
 	device_printf(sc->dev, "CODEC semaphore timeout\n");
 	return ETIMEDOUT;
 }
@@ -684,7 +689,8 @@
 		    sc->devid == INTEL_82801DB || sc->devid == INTEL_82801EB ||
 		    sc->devid == INTEL_6300ESB || sc->devid == INTEL_82801FB ||
 		    sc->devid == INTEL_82801GB)) {
-			return ENXIO;
+			sc->flags |= IGNORE_PCR;
+			device_printf(sc->dev, "primary codec not ready!\n");
 		}
 	}
 
@@ -759,28 +765,25 @@
 	}
 
 	/*
+	 * Enable bus master. On ich4/5 this may prevent the detection of
+	 * the primary codec becoming ready in ich_init().
+	 */
+	pci_enable_busmaster(dev);
+
+	/*
 	 * 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 (vendor == INTEL_VENDORID && devid == INTEL_82801DB) {
-		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 (vendor == INTEL_VENDORID && (devid == INTEL_82801EB ||
-	    devid == INTEL_6300ESB || devid == INTEL_82801FB ||
-	    devid == INTEL_82801GB)) {
+	if (vendor == INTEL_VENDORID && (devid == INTEL_82801DB ||
+	    devid == INTEL_82801EB || devid == INTEL_6300ESB ||
+	    devid == INTEL_82801FB || devid == INTEL_82801GB)) {
 		sc->nambarid = PCIR_MMBAR;
 		sc->nabmbarid = PCIR_MBBAR;
 		sc->regtype = SYS_RES_MEMORY;
+		pci_write_config(dev, PCIR_ICH_LEGACY, ICH_LEGACY_ENABLE, 1);
 	} else {
 		sc->nambarid = PCIR_NAMBAR;
 		sc->nabmbarid = PCIR_NABMBAR;


More information about the freebsd-multimedia mailing list