Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2005 22:47:41 GMT
From:      Mark Gooderum <mark@verniernetworks.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/77365: amdpm driver has wrong PCI device ID for 8111
Message-ID:  <200502102247.j1AMlfHS067644@www.freebsd.org>
Resent-Message-ID: <200502102250.j1AMoS16072116@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2>
  AMD Features=0xe0500000<NX,AMIE,LM,DSP,3DNow!>
real memory  = 1073676288 (1023 MB)
avail memory = 1040961536 (992 MB)
ACPI APIC Table: <A M I  OEMAPIC >
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 <Version 1.1> irqs 0-23 on motherboard
ioapic1 <Version 1.1> irqs 24-27 on motherboard
ioapic2 <Version 1.1> irqs 28-31 on motherboard
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <A M I OEMXSDT> 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: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 6.0 on pci0
pci3: <ACPI PCI bus> on pcib1
ohci0: <OHCI (generic) USB controller> mem 0xfeafc000-0xfeafcfff irq 19 at device 0.0 on pci3
ohci0: [GIANT-LOCKED]
usb0: OHCI version 1.0, legacy support
usb0: <OHCI (generic) USB controller> 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: <OHCI (generic) USB controller> mem 0xfeafd000-0xfeafdfff irq 19 at device 0.1 on pci3
ohci1: [GIANT-LOCKED]
usb1: OHCI version 1.0, legacy support
usb1: <OHCI (generic) USB controller> 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: <SiI 3114 SATA150 controller> 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: <display, VGA> at device 6.0 (no driver attached)
fxp0: <Intel 82551 Pro/100 Ethernet> port 0xa400-0xa43f mem 0xfeaa0000-0xfeabffff,0xfeafb000-0xfeafbfff irq 18 at device 8.0 on pci3
miibus0: <MII bus> on fxp0
inphy0: <i82555 10/100 media interface> on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:e0:81:2a:15:b7
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci1: <AMD 8111 UDMA133 controller> 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: <SMBus controller> port 0xcc00-0xcc1f irq 19 at device 7.2 on pci0
device_attach: ichsmb0 attach returned 6
amdpm0: <AMD 756/766/768/8111 Power Management Controller> port 0x50e0-0x50ff at device 7.3 on pci0
smbus0: <System Management Bus> on amdpm0
smb0: <SMBus generic I/O> on smbus0
pcib2: <ACPI PCI-PCI bridge> at device 10.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pci2: <processor> at device 3.0 (no driver attached)
bge0: <Broadcom BCM5704C Dual Gigabit Ethernet, ASIC rev. 0x2003> mem 0xfc8a0000-0xfc8affff,0xfc8b0000-0xfc8bffff irq 24 at device 9.0 on pci2
miibus1: <MII bus> on bge0
brgphy0: <BCM5704 10/100/1000baseTX PHY> on miibus1
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto
bge0: Ethernet address: 00:e0:81:2a:50:2a
bge1: <Broadcom BCM5704C Dual Gigabit Ethernet, ASIC rev. 0x2003> mem 0xfc8d0000-0xfc8dffff,0xfc8e0000-0xfc8effff irq 25 at device 9.1 on pci2
miibus2: <MII bus> on bge1
brgphy1: <BCM5704 10/100/1000baseTX PHY> on miibus2
brgphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto
bge1: Ethernet address: 00:e0:81:2a:50:2b
pci0: <base peripheral, interrupt controller> at device 10.1 (no driver attached)
pcib3: <ACPI PCI-PCI bridge> at device 11.0 on pci0
pci1: <ACPI PCI bus> on pcib3
em0: <Intel(R) PRO/1000 Network Connection, Version - 1.7.35> 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: <Intel(R) PRO/1000 Network Connection, Version - 1.7.35> 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: <RocketRAID 182x SATA Controller> 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: <base peripheral, interrupt controller> at device 11.1 (no driver attached)
acpi_button0: <Power Button> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model Generic PS/2 mouse, device ID 0
speaker0: <PC speaker> 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: <floppy drive controller (FDE)> port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on acpi0
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ppc0: <ECP parallel printer port> 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: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
orm0: <ISA Option ROMs> at iomem 0xc8000-0xcc7ff,0xc0000-0xc7fff on isa0
pmtimer0 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> 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 <TOSHIBA CD-ROM XM-6502B/1914> at ata1-master UDMA33
da0 at hptmv0 bus 0 target 0 lun 0
da0: <RR182x RAID 5 Array 3.00> 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: <AMD 756/766/768/8111 Power Management Controller> 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: <AMD 756/766/768/8111 Power Management Controller> port 0x50e0-0x50ff at device 7.3 on pci0
smbus0: <System Management Bus> on amdpm0
smb0: <SMBus generic I/O> 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502102247.j1AMlfHS067644>