From kawasaki@kawasaki3.org  Thu Mar 13 01:48:08 2003
Return-Path: <kawasaki@kawasaki3.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7D39D37B404
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Mar 2003 01:48:07 -0800 (PST)
Received: from home.kawasaki3.org (home.kawasaki3.org [61.206.116.61])
	by mx1.FreeBSD.org (Postfix) with SMTP id 0887E43FA3
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Mar 2003 01:48:06 -0800 (PST)
	(envelope-from kawasaki@kawasaki3.org)
Received: (qmail 6468 invoked from network); 13 Mar 2003 09:48:02 -0000
Received: from unknown (HELO localhost) (211.14.2.57)
  by home.kawasaki3.org with SMTP; 13 Mar 2003 09:48:02 -0000
Message-Id: <20030313.184800.30191150.kawasaki@kawasaki3.org>
Date: Thu, 13 Mar 2003 18:48:00 +0900 (JST)
From: moto kawasaki <kawasaki@kawasaki3.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: patch to enable ThinkPAD X24 sound device (Intel 82801CA (ICH3))
X-Send-Pr-Version: 3.113

>Number:         49980
>Category:       kern
>Synopsis:       [sound] [patch] enable ThinkPAD X24 sound device (Intel 82801CA (ICH3))
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 13 01:50:13 PST 2003
>Closed-Date:    Sun Sep 11 10:13:38 GMT 2005
>Last-Modified:  Sun Sep 11 10:13:38 GMT 2005
>Originator:     moto kawasaki <kawasaki@kawasaki3.org>
>Release:        FreeBSD 4.8-RC i386
>Organization:
n/a
>Environment:
Machine: IBM ThinkPAD X24 (2662-L3J)
         PIII-M 1.13GHz(512KB), 1024MB RAM, 30.0GB HDD,
         12.1 XGA(1024x768) TFT LCD, 802.11b wireless(MPCI),
         Ethernet(CDC), Modem(MPCI), IBM Secure Chip, USB-FDD,
         IEEE 1394, 6Cell Li-Ion battery, WinXP Pro

System: FreeBSD x24.local 4.8-RC FreeBSD 4.8-RC #2:
    Thu Mar 6 15:30:58 JST 2003 kawasaki@x24.local:/usr/obj/usr/src/sys/X24
    i386

Target: sound device on Intel 82891CA ICH3.

>Description:

Please find attached patch which enable sound device (pcm) on IBM ThinkPAD X24.
Following instructions below (unfortunately in Japanese) and modifying
them as matching codes in 4.7-stable through 4.8-RC, I am enjoying music now.

[bsd-nomads: 15930]
  http://www.clave.gr.jp/ml/bsd-nomads/200109/msg00028.html
[bsd-nomads: 16348]
  http://www.clave.gr.jp/ml/bsd-nomads/200206/msg00023.html

>How-To-Repeat:

Install 4.8-RC onto X24, then kernel cannot detect this device.

>Fix:

please find attached patch below.

--- dmesg.boot begins here ---
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 4.8-RC #2: Thu Mar  6 15:30:58 JST 2003
    kawasaki@x24.local:/usr/obj/usr/src/sys/X24
Timecounter "i8254"  frequency 1193182 Hz
CPU: Intel(R) Pentium(R) III Mobile CPU      1133MHz (1129.57-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6b1  Stepping = 1
  Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 670498816 (654784K bytes)
avail memory = 647806976 (632624K bytes)
Preloaded elf kernel "kernel" at 0xc03c3000.
Pentium Pro MTRR support enabled
md0: Malloc disk
Using $PIR table, 14 entries at 0xc00fdeb0
apm0: <APM BIOS> on motherboard
apm0: found APM BIOS v1.2, connected at v1.2
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib1: <Intel 82830M/MP Host-AGP bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <ATI model 4c59 graphics accelerator> at 0.0 irq 11
uhci0: <Intel 82801CA/CAM (ICH3) USB controller USB-A> port 0x1800-0x181f irq 11 at device 29.0 on pci0
usb0: <Intel 82801CA/CAM (ICH3) 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 82801CA/CAM (ICH3) USB controller USB-B> port 0x1820-0x183f irq 11 at device 29.1 on pci0
usb1: <Intel 82801CA/CAM (ICH3) 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 82801CA/CAM (ICH3) USB controller USB-C> port 0x1840-0x185f irq 11 at device 29.2 on pci0
usb2: <Intel 82801CA/CAM (ICH3) 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
pcib2: <Intel 82801BAM/CAM Hub to PCI bridge> at device 30.0 on pci0
pci2: <PCI bus> on pcib2
pcic0: <Ricoh RL5C476 PCI-CardBus Bridge> mem 0x50000000-0x50000fff irq 11 at device 3.0 on pci2
pccard0: <PC Card 16-bit bus (classic)> on pcic0
pcic1: <Ricoh RL5C476 PCI-CardBus Bridge> mem 0x50100000-0x50100fff irq 11 at device 3.1 on pci2
pccard1: <PC Card 16-bit bus (classic)> on pcic1
pci2: <unknown card> (vendor=0x1180, dev=0x0552) at 3.2 irq 11
wi0: <Intersil Prism2.5> mem 0xf0000000-0xf0000fff irq 11 at device 5.0 on pci2
wi0: 802.11 address: 00:20:e0:8d:1d:39
wi0: using RF:PRISM2.5 MAC:ISL3874A(Mini-PCI)
wi0: Intersil Firmware: Primary 1.01.00, Station 1.04.02
fxp0: <Intel Pro/100 Ethernet> port 0x8000-0x803f mem 0xc0200000-0xc0200fff irq 11 at device 8.0 on pci2
fxp0: Ethernet address 00:d0:59:ca:8f:03
inphy0: <i82562ET 10/100 media interface> on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isab0: <Intel 82801CA/CAM (ICH3) PCI to LPC bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH3 ATA100 controller> port 0x1860-0x186f,0x374-0x377,0x170-0x177,0x3f4-0x3f7,0x1f0-0x1f7 at device 31.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
ichsmb0: <Intel 82801CA (ICH3) SMBus controller> port 0x1880-0x189f irq 11 at device 31.3 on pci0
smbus0: <System Management Bus> on ichsmb0
pcm0: <Intel 82801CA (ICH3)> port 0x18c0-0x18ff,0x1c00-0x1cff irq 11 at device 31.5 on pci0
pcm0: <unknown ac97 codec> (id=0x43525936)
pci0: <unknown card> (vendor=0x8086, dev=0x2486) at 31.6 irq 11
isa0: too many memory ranges
orm0: <Option ROMs> at iomem 0xc0000-0xcbfff,0xcc000-0xccfff,0xcd000-0xcdfff,0xdc000-0xdffff,0xe0000-0xeffff on isa0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model Generic PS/2 mouse, device ID 0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
unknown: <PNP0c01> can't assign resources
unknown: <PNP0000> can't assign resources
unknown: <PNP0303> can't assign resources
unknown: <PNP0c02> can't assign resources
unknown: <PNP0680> can't assign resources
unknown: <IBM3780> can't assign resources
unknown: <PNP0501> can't assign resources
unknown: <IBM0071> can't assign resources
unknown: <PNP0700> can't assign resources
IP Filter: v3.4.31 initialized.  Default = block all, Logging = enabled
ad0: 28615MB <IC25N030ATCS04-0> [62016/15/63] at ata0-master UDMA100
Mounting root from ufs:/dev/ad0s2a
--- dmesg.boot ends here ---

--- ThinkPAD-X24-sound-FreeBSD4.7STABLE.diff begins here ---
Modified patch on FreeBSD 4.7-STABLE.

--- sys/pci/pci.c.orig	Thu Oct 17 16:04:10 2002
+++ sys/pci/pci.c	Thu Oct 17 16:04:46 2002
@@ -1323,6 +1323,7 @@
 	 * peripherals respond oddly to having these bits
 	 * enabled.  Leave them alone by default.
 	 */
+#define PCI_ENABLE_IO_MODES
 #ifdef PCI_ENABLE_IO_MODES
 	if (type == SYS_RES_IOPORT && !pci_porten(cfg)) {
 		cfg->cmdreg |= PCIM_CMD_PORTEN;
--- sys/pci/pcisupport.c.orig	Thu Oct 17 16:05:21 2002
+++ sys/pci/pcisupport.c	Thu Oct 17 16:06:50 2002
@@ -694,6 +694,11 @@
 		return ("Intel 82801BA/BAM (ICH2) Hub to PCI bridge");
 	case 0x1a318086:
 		return ("Intel 82845 PCI-PCI (AGP) bridge");
+	case 0x35768086:
+		return ("Intel 82830M/MP Host-AGP bridge");
+	case 0x24488086:
+		return ("Intel 82801BAM/CAM Hub to PCI bridge");
+
 	
 	/* VLSI -- vendor 0x1004 */
 	case 0x01021004:
@@ -905,6 +910,9 @@
 		return ("Intel 82801AB (ICH0) PCI to LPC bridge");
 	case 0x24408086:
 		return ("Intel 82801BA/BAM (ICH2) PCI to LPC bridge");
+	case 0x248c8086:
+		return ("Intel 82801CA/CAM (ICH3) PCI to LPC bridge");
+
 	
 	/* VLSI -- vendor 0x1004 */
 	case 0x00061004:
--- ThinkPAD-X24-sound-FreeBSD4.7STABLE.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->murray 
Responsible-Changed-By: murray 
Responsible-Changed-When: Sun May 11 14:09:53 PDT 2003 
Responsible-Changed-Why:  
I will look at this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=49980 
Responsible-Changed-From-To: murray->bugs 
Responsible-Changed-By: murray 
Responsible-Changed-When: Sat Aug 30 23:45:30 PDT 2003 
Responsible-Changed-Why:  
took too much on.. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=49980 
Responsible-Changed-From-To: bugs->freebsd-bugs 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Mon Sep 1 13:38:26 PDT 2003 
Responsible-Changed-Why:  

Properly assign to freebsd-bugs 

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

From: Georg Graf <georg.graf@wu-wien.ac.at>
To: freebsd-gnats-submit@FreeBSD.org, kawasaki@kawasaki3.org,
	georg@graf.priv.at
Cc:  
Subject: Re: kern/49980: patch to enable ThinkPAD X24 sound device (Intel
 82801CA (ICH3))
Date: Tue, 11 Nov 2003 13:22:42 +0100

 The patch does not apply, because the source files changed.
 I suggest the following:
 
 -) The patch against pci.c should not be applied, instead somewhere the 
 info should be put, that "options PCI_ENABLE_IO_MODES" belongs into the 
 kernel config.
 
 -) The patch for sys/pci/pcisupport.c effectively enables the sound of
 this kute thinkpad. IMO it just needs to be committed into the right 
 file in sys/dev/.
 
 It works perfectly for me for FreeBSD 4.8 RELEASE.
 
 Please commit, and lots of thanks,
    George
 
Responsible-Changed-From-To: freebsd-bugs->sound 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Aug 26 21:02:43 GMT 2004 
Responsible-Changed-Why:  
Reassign to appropriate mailing list. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=49980 
State-Changed-From-To: open->closed 
State-Changed-By: netchild 
State-Changed-When: Sun Sep 11 10:12:23 GMT 2005 
State-Changed-Why:  
It seems that ICH3 (and more) support is included in 5.[34], if it 
doesn't work for you please open a new bug report (and reference this 
one please). 

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