From yosimoto@current.waishi.jp  Wed Jun 11 21:04:58 2003
Return-Path: <yosimoto@current.waishi.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5942737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Jun 2003 21:04:58 -0700 (PDT)
Received: from current.waishi.jp (current.waishi.jp [61.199.233.196])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CC03C43FBD
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Jun 2003 21:04:57 -0700 (PDT)
	(envelope-from yosimoto@current.waishi.jp)
Received: by current.waishi.jp (Postfix, from userid 1001)
	id E1EB011F82A; Thu, 12 Jun 2003 13:04:53 +0900 (JST)
Message-Id: <20030612040453.E1EB011F82A@current.waishi.jp>
Date: Thu, 12 Jun 2003 13:04:53 +0900 (JST)
From: Shin-ichi Yoshimoto <yosimoto@waishi.jp>
Reply-To: Shin-ichi Yoshimoto <yosimoto@waishi.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] snd_ich fails to detect Intel 82801ER (ICH5) chip
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         53242
>Category:       kern
>Synopsis:       [patch] snd_ich fails to detect Intel 82801ER (ICH5) chip
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sound
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 11 21:10:16 PDT 2003
>Closed-Date:    Sun Aug 10 08:00:46 PDT 2003
>Last-Modified:  Sun Aug 10 08:00:46 PDT 2003
>Originator:     Shin-ichi Yoshimoto
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD current.waishi.jp 5.1-CURRENT FreeBSD 5.1-CURRENT #9: Sun Jun 8 07:43:17 JST 2003 yosimoto@current.waishi.jp:/usr/obj/usr/src/sys/CURRENT i386


>Description:
The snd_ich sound driver fails to detect the Intel 82801ER (ICH5) sound on my motherboard (MSI 865PE Neo2). 

>How-To-Repeat:

>Fix:

--- ich.c.orig	Wed Apr 16 12:16:55 2003
+++ ich.c	Sun Jun  8 16:34:37 2003
@@ -43,6 +43,7 @@
 
 #define SIS7012ID       0x70121039      /* SiS 7012 needs special handling */
 #define ICH4ID		0x24c58086	/* ICH4 needs special handling too */
+#define ICH5ID		0x24d58086	/* ICH5 needs special handling too */
 
 /* buffer descriptor */
 struct ich_desc {
@@ -578,7 +579,7 @@
 
 	if ((stat & ICH_GLOB_STA_PCR) == 0) {
 		/* ICH4 may fail when busmastering is enabled. Continue */
-		if (pci_get_devid(sc->dev) != ICH4ID) {
+		if (pci_get_devid(sc->dev) != ICH4ID && pci_get_devid(sc->dev) != ICH5ID) {
 			return ENXIO;
 		}
 	}
@@ -630,6 +631,10 @@
 		device_set_desc(dev, "Intel 82801DB (ICH4)");
 		return 0;
 
+	case ICH5ID:
+		device_set_desc(dev, "Intel 82801ER (ICH5)");
+		return 0;
+
 	case SIS7012ID:
 		device_set_desc(dev, "SiS 7012");
 		return 0;
@@ -681,7 +686,7 @@
 	 * 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) {
+	if (pci_get_devid(dev) == ICH4ID || pci_get_devid(dev) == ICH5ID) {
 		pci_write_config(dev, PCIR_ICH_LEGACY, ICH_LEGACY_ENABLE, 1);
 	}
 
>Release-Note:
>Audit-Trail:

From: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
To: Shin-ichi Yoshimoto <yosimoto@waishi.jp>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER
 (ICH5) chip
Date: Thu, 12 Jun 2003 20:56:15 +0900

 Sorry. I mistook the chip name.
 
 s/82801ER/82801EB/
 
 > +		device_set_desc(dev, "Intel 82801ER (ICH5)");
 
 -- 
 Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
 http://diary.waishi.jp/~yosimoto/diary/
 

From: Dominic Marks <dom@cus.org.uk>
To: freebsd-gnats-submit@FreeBSD.org, yosimoto@waishi.jp,
	sound@FreeBSD.org
Cc:  
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5) chip
Date: Sun, 6 Jul 2003 13:23:55 +0100

 Hi,
 
 I've tested this on a Dell Dimension 8300, also with a Intel ICH5
 chipset and it works correctly, please commit.
 
 egg# kldload /boot/kernel/snd_ich.ko
 egg# cat /dev/sndstat 
 FreeBSD Audio Driver (newpcm)
 Installed devices:
 pcm0: <Intel 82801ER (ICH5)> at io 0xee00, 0xedc0 irq 3 bufsz 16384 ...
 
 Thanks,
 -- 
 Dominic
  <dom at cus.org.uk> <dominic.marks at npl.co.uk>
Responsible-Changed-From-To: freebsd-bugs->sound 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sun Jul 13 02:50:29 PDT 2003 
Responsible-Changed-Why:  
Assign to sound maintainers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53242 

From: Markko Merzin <markko@short.cut.ee>
To: freebsd-gnats-submit@FreeBSD.org, yosimoto@waishi.jp
Cc:  
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5)
 chip
Date: Mon, 14 Jul 2003 03:28:55 +0300

 Hi!
 
 This patch freezes my system when onboard audio is enabled on intel 
 D865PERL motherboard.
 
 pcm1: <Intel ICH5 (82801EB)> mem 
 0xfebff400-0xfebff4ff,0xfebff800-0xfebff9ff irq 19 at device 31.5 on pci0
 pcm1: unable to map IO port space
 device_probe_and_attach: pcm1 attach returned 6
 
 Full dmesg with onboard audio disabled:
 
 Copyright (c) 1992-2003 The FreeBSD Project.
 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
          The Regents of the University of California. All rights reserved.
 FreeBSD 5.1-CURRENT #13: Mon Jul 14 00:10:04 EEST 2003
      root@short.cut.ee:/usr/obj/usr/src/sys/SHORT
 Preloaded elf kernel "/boot/kernel/kernel" at 0xc0570000.
 Preloaded elf module "/boot/kernel/acpi.ko" at 0xc0570244.
 Timecounter "i8254"  frequency 1193182 Hz
 Timecounter "TSC"  frequency 2394006768 Hz
 CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (2394.01-MHz 686-class CPU)
    Origin = "GenuineIntel"  Id = 0xf29  Stepping = 9
  
 Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,C
 MOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
    Hyperthreading: 2 logical CPUs
 real memory  = 536018944 (511 MB)
 avail memory = 514666496 (490 MB)
 Programming 24 pins in IOAPIC #0
 IOAPIC #0 intpin 2 -> irq 0
 FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
   cpu0 (BSP): apic id:  0, version: 0x00050014, at 0xfee00000
   cpu1 (AP):  apic id:  1, version: 0x00050014, at 0xfee00000
   io0 (APIC): apic id:  2, version: 0x00178020, at 0xfec00000
 Pentium Pro MTRR support enabled
 npx0: <math processor> on motherboard
 npx0: INT 16 interface
 acpi0: <INTEL  D865PERL> on motherboard
 pcibios: BIOS version 2.10
 Using $PIR table, 12 entries at 0xc00f3310
 acpi0: power button is handled as a fixed feature programming model.
 Timecounter "ACPI-fast"  frequency 3579545 Hz
 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
 acpi_cpu0: <CPU> port 0x530-0x537 on acpi0
 acpi_cpu1: <CPU> port 0x530-0x537 on acpi0
 pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
 pci0: <ACPI PCI bus> on pcib0
 IOAPIC #0 intpin 16 -> irq 2
 IOAPIC #0 intpin 19 -> irq 16
 IOAPIC #0 intpin 18 -> irq 17
 IOAPIC #0 intpin 23 -> irq 18
 IOAPIC #0 intpin 17 -> irq 19
 agp0: <Intel 82865 host to AGP bridge> mem 0xf8000000-0xfbffffff at 
 device 0.0 o
 n pci0
 pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
 pci1: <ACPI PCI bus> on pcib1
 drm0: <Matrox G550 (AGP)> mem 
 0xfe000000-0xfe7fffff,0xfe9fc000-0xfe9fffff,0xf200
 0000-0xf3ffffff irq 2 at device 0.0 on pci1
 info: [drm] AGP at 0xf8000000 64MB
 info: [drm] Initialized mga 3.1.0 20021029 on minor 0
 uhci0: <Intel 82801EB (ICH5) USB controller USB-A> port 0xcc00-0xcc1f 
 irq 2 at d
 evice 29.0 on pci0
 usb0: <Intel 82801EB (ICH5) USB controller USB-A> on uhci0
 usb0: USB revision 1.0
 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub0: 2 ports with 2 removable, self powered
 uhci1: <Intel 82801EB (ICH5) USB controller USB-B> port 0xd000-0xd01f 
 irq 16 at
 device 29.1 on pci0
 usb1: <Intel 82801EB (ICH5) USB controller USB-B> on uhci1
 usb1: USB revision 1.0
 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub1: 2 ports with 2 removable, self powered
 uhci2: <Intel 82801EB (ICH5) USB controller USB-C> port 0xd400-0xd41f 
 irq 17 at
 device 29.2 on pci0
 usb2: <Intel 82801EB (ICH5) USB controller USB-C> on uhci2
 usb2: USB revision 1.0
 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub2: 2 ports with 2 removable, self powered
 uhci3: <Intel 82801EB (ICH5) USB controller USB-D> port 0xd800-0xd81f 
 irq 2 at d
 evice 29.3 on pci0
 usb3: <Intel 82801EB (ICH5) USB controller USB-D> on uhci3
 usb3: USB revision 1.0
 uhub3: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub3: 2 ports with 2 removable, self powered
 pci0: <serial bus, USB> at device 29.7 (no driver attached)
 pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
 pci2: <ACPI PCI bus> on pcib2
 IOAPIC #0 intpin 21 -> irq 20
 IOAPIC #0 intpin 22 -> irq 21
 IOAPIC #0 intpin 20 -> irq 22
 dpt0: <DPT Caching SCSI RAID Controller> port 0xbc00-0xbc1f irq 20 at 
 device 0.0
   on pci2
 dpt0: DPT PM2044UW FW Rev. 07H1, 1 channel, 64 CCBs
 pcm0: <AudioPCI ES1371-A> port 0xb800-0xb83f irq 21 at device 1.0 on pci2
 pcm0: <TriTech TR28023 AC97 Codec>
 fwohci0: <Lucent FW322/323> mem 0xfeaef000-0xfeaeffff irq 19 at device 
 7.0 on pc
 i2
 fwohci0: OHCI version 1.0 (ROM=0)
 fwohci0: No. of Isochronous channel is 8.
 fwohci0: EUI64 00:07:e9:00:00:77:ac:e0
 fwohci0: Phy 1394a available S400, 3 ports.
 fwohci0: Link S400, max_rec 2048 bytes.
 firewire0: <IEEE1394(FireWire) bus> on fwohci0
 sbp0: <SBP2/SCSI over firewire> on firewire0
 fwohci0: Initiate bus reset
 fwohci0: BUS reset
 fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode
 firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
 firewire0: bus manager 0 (me)
 fxp0: <Intel 82801BA (D865) Pro/100 VE Ethernet> port 0xb400-0xb43f mem 
 0xfeaee0
 00-0xfeaeefff irq 22 at device 8.0 on pci2
 fxp0: Ethernet address 00:07:e9:77:ac:e0
 miibus0: <MII bus> on fxp0
 inphy0: <i82562ET 10/100 media interface> on miibus0
 inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 isab0: <PCI-ISA bridge> at device 31.0 on pci0
 isa0: <ISA bus> on isab0
 atapci0: <Intel ICH5 UDMA100 controller> port 
 0xffa0-0xffaf,0-0x3,0-0x7,0-0x3,0-
 0x7 irq 17 at device 31.1 on pci0
 ata0: at 0x1f0 irq 14 on atapci0
 ata1: at 0x170 irq 15 on atapci0
 atapci1: <Intel ICH5 SATA150 controller> port 
 0xdc00-0xdc0f,0xe000-0xe003,0xe400
 -0xe407,0xe800-0xe803,0xec00-0xec07 irq 17 at device 31.2 on pci0
 ata2: at 0xec00 on atapci1
 ata3: at 0xe400 on atapci1
 ichsmb0: <SMBus controller> port 0xc800-0xc81f irq 19 at device 31.3 on pci0
 acpi_button0: <Sleep Button> on acpi0
 atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
 atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
 kbd0 at atkbd0
 fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 
 0x3f7,0x3f4-0
 x3f5,0x3f2-0x3f3,0x3f0-0x3f1 irq 6 drq 2 on acpi0
 fdc0: FIFO enabled, 8 bytes threshold
 fd0: <1440-KB 3.5" drive> on fdc0 drive 0
 sio0: configured irq 4 not in bitmap of probed irqs 0
 sio0: port may not be enabled
 sio0 port 0x3f8-0x3ff irq 4 on acpi0
 sio0: type 16550A
 ppc0 port 0x378-0x37f irq 7 on acpi0
 ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
 ppbus0: <Parallel port bus> on ppc0
 lpt0: <Printer> on ppbus0
 lpt0: Interrupt-driven port
 orm0: <Option ROMs> at iomem 0xc9000-0xc9fff,0xc0000-0xc8fff on isa0
 pmtimer0 on isa0
 sc0: <System console> at flags 0x100 on isa0
 sc0: VGA <16 virtual consoles, flags=0x300>
 sio1: configured irq 3 not in bitmap of probed irqs 0
 sio1: port may not be enabled
 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
 APIC_IO: Testing 8254 interrupt delivery
 APIC_IO: routing 8254 via IOAPIC #0 intpin 2
 Timecounters tick every 10.000 msec
 ipfw2 initialized, divert disabled, rule-based forwarding enabled, 
 default to accept, logging unlimited
 DUMMYNET initialized (011031)
 IP Filter: v3.4.31 initialized.  Default = block all, Logging = enabled
 acpi_cpu: throttling enabled, 8 steps (100% to 12.5%), currently 100.0%
 ad0: 38166MB <ST340014A> [77545/16/63] at ata0-master UDMA100
 ad3: DMA limited to UDMA33, non-ATA66 cable or device
 ad3: 19470MB <QUANTUM FIREBALLlct10 20> [39560/16/63] at ata1-slave UDMA33
 acd0: CD-RW <LITE-ON LTR-52246S> at ata1-master UDMA33
 Waiting 15 seconds for SCSI devices to settle
 sa0 at dpt0 bus 0 target 0 lun 0
 sa0: <HP HP35480A T503> Removable Sequential Access SCSI-2 device
 SMP: AP CPU #1 Launched!
 Mounting root from ufs:/dev/ad0s1a
 
 

From: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
To: Markko Merzin <markko@short.cut.ee>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER
 (ICH5) chip
Date: Mon, 14 Jul 2003 10:05:33 +0900

 Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5) chip,
 On Mon, 14 Jul 2003 03:28:55 +0300, Markko Merzin wrote:
 > This patch freezes my system when onboard audio is enabled on intel 
 > D865PERL motherboard.
 
 This patch has been submittied by cg.
 
 <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/sound/pci/ich.c?rev=1.31&content-type=text/x-cvsweb-markup>
 
 Please check ich.c version. If ver. 1.31, you don't need to patch. 
 
 -- 
 Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
 http://diary.waishi.jp/~yosimoto/diary/
 

From: Markko Merzin <markko@short.cut.ee>
To: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5)
 chip
Date: Mon, 14 Jul 2003 14:53:44 +0300 (EEST)

 On Mon, 14 Jul 2003, Shin-ichi YOSHIMOTO wrote:
 
 > > This patch freezes my system when onboard audio is enabled on intel
 > > D865PERL motherboard.
 
 > This patch has been submittied by cg.
 >
 > <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/sound/pci/ich.c?rev=1.31&content-type=text/x-cvsweb-markup>
 >
 > Please check ich.c version. If ver. 1.31, you don't need to patch.
 
 same result with todays full checkout.
 
 -- 
 Markko Merzin

From: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
To: Markko Merzin <markko@short.cut.ee>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER
 (ICH5) chip
Date: Tue, 15 Jul 2003 07:09:31 +0900

 Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5) chip,
 On Mon, 14 Jul 2003 14:53:44 +0300 (EEST), Markko Merzin wrote:
 > same result with todays full checkout.
 
 I have no idea.
 But if you can , please remove the following pci audio card:
 
 pcm0: <AudioPCI ES1371-A> port 0xb800-0xb83f irq 21 at device 1.0 on pci2
 pcm0: <TriTech TR28023 AC97 Codec>
 
 -- 
 Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
 http://diary.waishi.jp/~yosimoto/diary/
 

From: Markko Merzin <markko@short.cut.ee>
To: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5)
 chip
Date: Tue, 15 Jul 2003 16:32:52 +0300 (EEST)

 On Tue, 15 Jul 2003, Shin-ichi YOSHIMOTO wrote:
 
 > But if you can , please remove the following pci audio card:
 >
 > pcm0: <AudioPCI ES1371-A> port 0xb800-0xb83f irq 21 at device 1.0 on pci2
 > pcm0: <TriTech TR28023 AC97 Codec>
 
 I tried that allready. Same results.
 
 -- 
 Markko Merzin

From: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
To: Markko Merzin <markko@short.cut.ee>
Cc: freebsd-gnats-submit@FreeBSD.org, yosimoto@waishi.jp
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER
 (ICH5) chip
Date: Fri, 8 Aug 2003 07:21:38 +0900

 Hi, Markko
 
 I bought a Intel D865PERL last week ;) 
 
 I don't know why this M/B do not work in legacy mode. I tried to change
 the bus_alloc_resource from SYS_RES_IOPORT to SYS_RES_MEMORY, because ICH4
 and ICH5 have the memory mapped IO. Then my onboard sound worked fine.
 Please test the following patch:
 
 <http://current.waishi.jp/~yosimoto/ich.diff>
 
 with best regards.
 
 Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5) chip,
 On Tue, 15 Jul 2003 16:32:52 +0300 (EEST), Markko Merzin wrote:
 > On Tue, 15 Jul 2003, Shin-ichi YOSHIMOTO wrote:
 > 
 > > But if you can , please remove the following pci audio card:
 > >
 > > pcm0: <AudioPCI ES1371-A> port 0xb800-0xb83f irq 21 at device 1.0 on pci2
 > > pcm0: <TriTech TR28023 AC97 Codec>
 > 
 > I tried that allready. Same results.
 > 
 > -- 
 > Markko Merzin
 
 
 -- 
 Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
 http://diary.waishi.jp/~yosimoto/diary/
 

From: Markko Merzin <markko@short.cut.ee>
To: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/53242: [patch] snd_ich fails to detect Intel 82801ER (ICH5)
 chip
Date: Sat, 9 Aug 2003 20:55:55 +0300 (EEST)

 On Fri, 8 Aug 2003, Shin-ichi YOSHIMOTO wrote:
 
 > Please test the following patch:
 > <http://current.waishi.jp/~yosimoto/ich.diff>
 
 It works! :-) Thanks.
 
 -- 
 Markko Merzin
State-Changed-From-To: open->closed 
State-Changed-By: orion 
State-Changed-When: Sun Aug 10 07:58:29 PDT 2003 
State-Changed-Why:  
Many thanks for the efforts in reporting and fixing this problem.  The 
patch is now in the source tree. 

Kind regards 
- Orion 


http://www.freebsd.org/cgi/query-pr.cgi?pr=53242 
>Unformatted:
