From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 10 22:50:28 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBEE116A4CF for ; Thu, 10 Feb 2005 22:50:28 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54A2043D49 for ; Thu, 10 Feb 2005 22:50:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1AMoS1w072117 for ; Thu, 10 Feb 2005 22:50:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1AMoS16072116; Thu, 10 Feb 2005 22:50:28 GMT (envelope-from gnats) Resent-Date: Thu, 10 Feb 2005 22:50:28 GMT Resent-Message-Id: <200502102250.j1AMoS16072116@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Gooderum Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D00DF16A4CE for ; Thu, 10 Feb 2005 22:47:42 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B377943D46 for ; Thu, 10 Feb 2005 22:47:41 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1AMlfju067645 for ; Thu, 10 Feb 2005 22:47:41 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j1AMlfHS067644; Thu, 10 Feb 2005 22:47:41 GMT (envelope-from nobody) Message-Id: <200502102247.j1AMlfHS067644@www.freebsd.org> Date: Thu, 10 Feb 2005 22:47:41 GMT From: Mark Gooderum To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/77365: amdpm driver has wrong PCI device ID for 8111 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2005 22:50:29 -0000 >Number: 77365 >Category: kern >Synopsis: amdpm driver has wrong PCI device ID for 8111 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 10 22:50:27 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Mark Gooderum >Release: 5.3-RELEASE >Organization: Vernier Networks, Inc. >Environment: FreeBSD eagle.jumpadmin.net 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Thu Feb 10 16:30:09 CST 2005 mark@eagle.jumpadmin.net:/net/piglet/data/FreeBSD/5.3-RELEASE/src/sys/i386/compile/JUMPSMP i386 eagle:~ > This is a Tyan 2882 motherboard with Dual Opteron 246's, dmesg.boot is below: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.3-RELEASE #1: Thu Feb 10 16:30:09 CST 2005 mark@eagle.jumpadmin.net:/net/piglet/data/FreeBSD/5.3-RELEASE/src/sys/i386/compile/JUMPSMP Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: AMD Opteron(tm) Processor 246 (1993.04-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0xf5a Stepping = 10 Features=0x78bfbff AMD Features=0xe0500000 real memory = 1073676288 (1023 MB) avail memory = 1040961536 (992 MB) ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 MADT: Forcing active-low polarity and level trigger for SCI ioapic0 irqs 0-23 on motherboard ioapic1 irqs 24-27 on motherboard ioapic2 irqs 28-31 on motherboard npx0: [FAST] npx0: on motherboard npx0: INT 16 interface acpi0: on motherboard acpi0: Power Button (fixed) Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x5008-0x500b on acpi0 cpu0: on acpi0 cpu1: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 6.0 on pci0 pci3: on pcib1 ohci0: mem 0xfeafc000-0xfeafcfff irq 19 at device 0.0 on pci3 ohci0: [GIANT-LOCKED] usb0: OHCI version 1.0, legacy support usb0: on ohci0 usb0: USB revision 1.0 uhub0: AMD OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 3 ports with 3 removable, self powered ohci1: mem 0xfeafd000-0xfeafdfff irq 19 at device 0.1 on pci3 ohci1: [GIANT-LOCKED] usb1: OHCI version 1.0, legacy support usb1: on ohci1 usb1: USB revision 1.0 uhub1: AMD OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 3 ports with 3 removable, self powered atapci0: port 0xa800-0xa80f,0xac00-0xac03,0xb000-0xb007,0xb400-0xb403,0xbc00-0xbc07 mem 0xfeafec00-0xfeafefff irq 19 at device 5.0 on pci3 ata2: channel #0 on atapci0 ata3: channel #1 on atapci0 ata4: channel #2 on atapci0 ata5: channel #3 on atapci0 pci3: at device 6.0 (no driver attached) fxp0: port 0xa400-0xa43f mem 0xfeaa0000-0xfeabffff,0xfeafb000-0xfeafbfff irq 18 at device 8.0 on pci3 miibus0: on fxp0 inphy0: on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fxp0: Ethernet address: 00:e0:81:2a:15:b7 isab0: at device 7.0 on pci0 isa0: on isab0 atapci1: port 0xffa0-0xffaf,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 7.1 on pci0 ata0: channel #0 on atapci1 ata1: channel #1 on atapci1 ichsmb0: port 0xcc00-0xcc1f irq 19 at device 7.2 on pci0 device_attach: ichsmb0 attach returned 6 amdpm0: port 0x50e0-0x50ff at device 7.3 on pci0 smbus0: on amdpm0 smb0: on smbus0 pcib2: at device 10.0 on pci0 pci2: on pcib2 pci2: at device 3.0 (no driver attached) bge0: mem 0xfc8a0000-0xfc8affff,0xfc8b0000-0xfc8bffff irq 24 at device 9.0 on pci2 miibus1: on bge0 brgphy0: on miibus1 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto bge0: Ethernet address: 00:e0:81:2a:50:2a bge1: mem 0xfc8d0000-0xfc8dffff,0xfc8e0000-0xfc8effff irq 25 at device 9.1 on pci2 miibus2: on bge1 brgphy1: on miibus2 brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto bge1: Ethernet address: 00:e0:81:2a:50:2b pci0: at device 10.1 (no driver attached) pcib3: at device 11.0 on pci0 pci1: on pcib3 em0: port 0x9800-0x983f mem 0xfc7c0000-0xfc7dffff irq 29 at device 1.0 on pci1 em0: Ethernet address: 00:07:e9:09:00:1c em0: Speed:N/A Duplex:N/A em1: port 0x9c00-0x9c3f mem 0xfc7e0000-0xfc7fffff irq 30 at device 1.1 on pci1 em1: Ethernet address: 00:07:e9:09:00:1d em1: Speed:N/A Duplex:N/A hptmv0: mem 0xfc700000-0xfc77ffff irq 28 at device 3.0 on pci1 RocketRAID 182x SATA Controller driver Version 1.1 RR182x [0,0]: channel started successfully RR182x [0,1]: channel started successfully RR182x [0,2]: channel started successfully RR182x: RAID5 write-back enabled hptmv0: [GIANT-LOCKED] pci0: at device 11.1 (no driver attached) acpi_button0: on acpi0 atkbdc0: port 0x64,0x60 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Generic PS/2 mouse, device ID 0 speaker0: port 0x61 on acpi0 sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 sio0: type 16550A sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0 sio1: type 16550A fdc0: port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on acpi0 fdc0: [FAST] fd0: <1440-KB 3.5" drive> on fdc0 drive 0 ppc0: port 0x778-0x77f,0x378-0x37f irq 7 drq 3 on acpi0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/9 bytes threshold ppbus0: on ppc0 plip0: on ppbus0 lpt0: on ppbus0 lpt0: Interrupt-driven port ppi0: on ppbus0 orm0: at iomem 0xc8000-0xcc7ff,0xc0000-0xc7fff on isa0 pmtimer0 on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounters tick every 1.000 msec acpi_cpu: throttling enabled, 8 steps (100% to 12.5%), currently 100.0% acd0: CDROM at ata1-master UDMA33 da0 at hptmv0 bus 0 target 0 lun 0 da0: Fixed Direct Access SCSI-0 device da0: 476950MB (976794112 512 byte sectors: 255H 63S/T 60802C) SMP: AP CPU #1 Launched! Mounting root from ufs:/dev/da0s2a >Description: The amdpm driver is using the wrong PCI device ID for the AMD 8111 Hypertransport LPC chip. There are TWO SMBus controllers on this chip and the driver is using the PCI device ID for the Newer SMBus 2.0 controller. This device has a completely different I/O interface and is not supported and does not work with the amdpm driver. The incorrect PCI device ID is 0x746a. The correct PCI device ID is 0x746b - the "old" SMBus 1.0 driver is a sub-set of the AMD System Management controller at 0x746b. Checking CVS reveals this hasn't been fixed in the 5 or HEAD branches. >How-To-Repeat: Boot 5.3 with a system with an AMD 8111 part, such as a Tyan 288x. All testing for this problem was done on a Tyan 2882. You get output like: =============== amdpm0: port 0xe0-0xff,0xcc00-0xcc1f irq 19 at device 7.2 on pci0 amdpm0: could not map i/o space =============== with the fix you get: =============== amdpm0: port 0x50e0-0x50ff at device 7.3 on pci0 smbus0: on amdpm0 smb0: on smbus0 =============== Plus we have used the smbus(4) interface successfully (see fix section) for this smbus. >Fix: Switch the PCI device ID referenced in the amdpm driver from 0x764a to 0x746b. The following patch works. With this patch we have sucessfully interacted with the ADM1027 environmental monitor chip which lives on the SMBus on the Tyan 2882 using smbus(4). For the curious the ADM1027 on the Tyan 2882 lives at slave addres 0x5a (0x5a on a 2881) and reads chassis fans 1, 2, 3 and 5. CPU 0, 1 and chassis 4 are on the Winbond. ====================================================================== --- sys/pci/amdpm.c~ Tue Apr 20 08:36:44 2004 +++ sys/pci/amdpm.c Thu Feb 10 16:27:53 2005 @@ -68,13 +68,21 @@ #define AMDPM_DEVICEID_AMD756PM 0x740b #define AMDPM_DEVICEID_AMD766PM 0x7413 #define AMDPM_DEVICEID_AMD768PM 0x7443 -#define AMDPM_DEVICEID_AMD8111PM 0x746A +/* + * The 8111 has two SMBus controllers, the old PM/SMB 1.0 lives under the + * "ACPI System Management Controller" PCI ID 746B and the SMBus 2.0 controller + * is the "SMBus 2.0 Controller" w/PCI Device ID 746A. It's PCI configuration + * register is 0x10 instead of 0x58. It is not currently supported. + */ +#define AMDPM_DEVICEID_AMD8111SM 0x746A +#define AMDPM_DEVICEID_AMD8111PM 0x746B /* nVidia nForce chipset */ #define AMDPM_VENDORID_NVIDIA 0x10de #define AMDPM_DEVICEID_NF_SMB 0x01b4 /* PCI Configuration space registers */ +#define AMDPCI_SMBASE 0x10 #define AMDPCI_PMBASE 0x58 #define NFPCI_PMBASE 0x14 >Release-Note: >Audit-Trail: >Unformatted: