Re: Add family 15h devices, km(4) sensor.

2013-03-13 Thread Juan Francisco Cantero Hurtado
On Wed, Mar 13, 2013 at 10:51:12AM -0400, Brynet wrote:
> So someone sent me a new toy, this adds the k15 PCIe devices. Names are
> copied from the equivalent k14.. because I'm not sure wherefrom they
> were originally sourced.
> 
> For km(4), it seems the temperature calculations are off.. according to
> the BKDG curtmp doesn't seem to actually reflect the real temperature,
> but some sort of value in relation to the max temperature.
> 
> On my system is shows around <10degC when idle, reaching 40degC when all
> cores are under load. So.. the value increases! :P

I've the same problem with km and 14h.

> 
> The FreeBSD driver has all sorts of workarounds I'm not sure we want,
> but it shows similar temperatures values.
> 
> ok?
> 
> -Bryan.


OpenBSD 5.3 (GENERIC.MP) #62: Tue Mar 12 18:21:20 MDT 2013
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8566591488 (8169MB)
avail mem = 831602 (7930MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xeb0d0 (65 entries)
bios0: vendor American Megatrends Inc. version "0901" date 09/30/2012
bios0: ASUSTeK COMPUTER INC. F1A55
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG HPET SSDT SSDT
acpi0: wakeup devices SBAZ(S4) PS2K(S4) PS2M(S4) UAR1(S4) UHC1(S4) UHC2(S4) 
USB3(S4) UHC4(S4) USB5(S4) UHC6(S4) UHC7(S4) PE20(S4) PE21(S4) RLAN(S4) 
PE22(S4) PE23(S4) PCE2(S4) PCE4(S4) P0PC(S4)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD A4-3400 APU with Radeon(tm) HD Graphics, 2700.25 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,ITSC
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu0: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu0: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu0: AMD erratum 721 detected and fixed
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD A4-3400 APU with Radeon(tm) HD Graphics, 2699.94 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,ITSC
cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 
16-way L2 cache
cpu1: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu1: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu1: AMD erratum 721 detected and fixed
ioapic0 at mainbus0: apid 3 pa 0xfec0, version 21, 24 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpihpet0 at acpi0: 14318180 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 3 (PE20)
acpiprt2 at acpi0: bus 4 (PE21)
acpiprt3 at acpi0: bus -1 (PE22)
acpiprt4 at acpi0: bus 5 (PE23)
acpiprt5 at acpi0: bus -1 (BR13)
acpiprt6 at acpi0: bus -1 (PCE2)
acpiprt7 at acpi0: bus -1 (PCE4)
acpiprt8 at acpi0: bus 1 (P0PC)
acpicpu0 at acpi0: C2, PSS
acpicpu1 at acpi0: C2, PSS
acpibtn0 at acpi0: PWRB
cpu0: 2700 MHz: speeds: 2700 2400 2200 2000 1800 1400 1100 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "AMD AMD64 12h Host" rev 0x00
ahci0 at pci0 dev 17 function 0 "AMD Hudson-2 SATA" rev 0x40: msi, AHCI 1.3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0:  SCSI3 0/direct fixed 
t10.ATA_ST3250310AS_5RY0ZTKS
sd0: 238475MB, 512 bytes/sector, 488397168 sectors
sd1 at scsibus0 targ 1 lun 0:  SCSI3 0/direct fixed 
naa.5000c500142c3ef3
sd1: 476940MB, 512 bytes/sector, 976773168 sectors
sd2 at scsibus0 targ 2 lun 0:  SCSI3 0/direct 
fixed naa.5000c5004fab5f8b
sd2: 953869MB, 512 bytes/sector, 1953525168 sectors
ohci0 at pci0 dev 18 function 0 "AMD Hudson-2 USB" rev 0x11: apic 3 int 18, 
version 1.0, legacy support
ehci0 at pci0 dev 18 function 2 "AMD Hudson-2 USB2" rev 0x11: apic 3 int 17
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "AMD EHCI root hub" rev 2.00/1.00 addr 1
ohci1 at pci0 dev 19 function 0 "AMD Hudson-2 USB" rev 0x11: apic 3 int 18, 
version 1.0, legacy support
ehci1 at pci0 dev 19 function 2 "AMD Hudson-2 USB2" rev 0x11: apic 3 int 17
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "AMD EHCI root hub" rev 2.00/1.00 addr 1
piixpm0 at pci0 dev 20 function 0 "AMD Hudson-2 SMBus" rev 0x13: polling
iic0 at piixpm0
iic0: addr 0x20 01=0d 02=17 03=26 04=8c 05=8c 06=8c 07=8c 08=00 09=00 0a=10 
0b=10 0c=10 0d=10 0e=07 0f=8b 10=00 11=00 12=00 13=00 14=00 15=0f 16=19 17=20 
18=e0 19=fb 1a=a8 1b=a3 1c=ac 1d=80 1e=04 1f=03 20=09 21=09 22=09 23=09 24=37 
3e=a3 words 00=ff0d 01=0d17 02=1726 03=268c 04=8c8c 05=8c8c 06=8c8c 07=8c00
spdmem0 at iic0 addr 0x50: 4GB DDR3 SDRAM PC3-10600
spdmem1 at iic0 addr 0x51: 4

Add family 15h devices, km(4) sensor.

2013-03-13 Thread Brynet
So someone sent me a new toy, this adds the k15 PCIe devices. Names are
copied from the equivalent k14.. because I'm not sure wherefrom they
were originally sourced.

For km(4), it seems the temperature calculations are off.. according to
the BKDG curtmp doesn't seem to actually reflect the real temperature,
but some sort of value in relation to the max temperature.

On my system is shows around <10degC when idle, reaching 40degC when all
cores are under load. So.. the value increases! :P

The FreeBSD driver has all sorts of workarounds I'm not sure we want,
but it shows similar temperatures values.

ok?

-Bryan.

Index: dev/pci/km.c
===
RCS file: /cvs/src/sys/dev/pci/km.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 km.c
--- dev/pci/km.c31 May 2011 00:19:55 -  1.5
+++ dev/pci/km.c12 Mar 2013 22:19:16 -
@@ -70,7 +70,8 @@ struct cfdriver km_cd = {
 static const struct pci_matchid km_devices[] = {
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD64_10_MISC },
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD64_11_MISC },
-   { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD64_14_MISC }
+   { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD64_14_MISC },
+   { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_AMD64_15_MISC }
 };
 
 
Index: dev/pci/pcidevs
===
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1669
diff -u -p -u -r1.1669 pcidevs
--- dev/pci/pcidevs 8 Feb 2013 07:58:18 -   1.1669
+++ dev/pci/pcidevs 12 Mar 2013 22:19:16 -
@@ -693,6 +693,12 @@ product AMD AMD64_14_PCIE_20x1513  AMD64
 product AMD AMD64_14_PCIE_30x1514  AMD64 14h PCIE
 product AMD AMD64_14_PCIE_40x1515  AMD64 14h PCIE
 product AMD AMD64_14_PCIE_50x1516  AMD64 14h PCIE
+product AMD AMD64_15_LINK  0x1600  AMD64 15h Link Cfg
+product AMD AMD64_15_ADDR  0x1601  AMD64 15h Address Map
+product AMD AMD64_15_DRAM  0x1602  AMD64 15h DRAM Cfg
+product AMD AMD64_15_MISC  0x1603  AMD64 15h Misc Cfg
+product AMD AMD64_15_CPU_PM0x1604  AMD64 15h CPU Power
+product AMD AMD64_15_HB0x1605  AMD64 15h Host
 product AMD AMD64_14_LINK  0x1700  AMD64 14h Link Cfg
 product AMD AMD64_14_ADDR  0x1701  AMD64 14h Address Map
 product AMD AMD64_14_DRAM  0x1702  AMD64 14h DRAM Cfg