From 3d3afab1ee14d167f82ed6f2513d0db43a562755 Mon Sep 17 00:00:00 2001 From: Imre Vadasz Date: Wed, 19 Feb 2014 08:52:53 +0100 Subject: [PATCH] km(4): Update from OpenBSD. Adds support for AMD Family 14h and 15h CPUs. --- share/man/man4/km.4 | 22 +++++++++++++++------- sys/bus/pci/pcidevs | 3 +++ sys/dev/powermng/km/km.c | 32 +++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/share/man/man4/km.4 b/share/man/man4/km.4 index 6c4aa867e3..89c4147c4c 100644 --- a/share/man/man4/km.4 +++ b/share/man/man4/km.4 @@ -1,6 +1,6 @@ -.\" $OpenBSD: km.4,v 1.5 2009/07/23 17:19:07 cnst Exp $ +.\" $OpenBSD: km.4,v 1.9 2013/07/16 16:05:49 schwarze Exp $ .\" -.\" Copyright (c) 2008/2010 Constantine A. Murenin +.\" Copyright (c) 2008/2010 Constantine A. Murenin .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd February 12, 2010 +.Dd July 16, 2013 .Dt KM 4 .Os .Sh NAME @@ -39,7 +39,7 @@ km_load="YES" The .Nm driver provides support for the temperature sensors available in the -AMD Family 10h and 11h processors. +AMD Family 10h, 11h, 14h, and 15h processors. .Pp Each chip reports one temperature sensor. Multiprocessor systems have one instance of @@ -82,14 +82,21 @@ hw.sensors.km0.temp0: 60.50 degC .%D March 26, 2008 .%R Publication # 31116 .%P pp. 236--237 and pp. 243--244 -.\" .%O http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116.PDF +.%O http://support.amd.com/us/Processor_TechDocs/31116.pdf .Re .Rs .%T "BIOS and Kernel Developer's Guide for AMD Family 11h Processors" .%D July 07, 2008 .%R Publication # 41256 .%P pp. 156--157 and pp. 159--160 -.\" .%O http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41256.pdf +.%O http://support.amd.com/us/Processor_TechDocs/41256.pdf +.Re +.Rs +.%T "BIOS and Kernel Developer's Guide for AMD Family 14h Models 00h-04h Processors" +.%D May 02, 2011 +.%R Publication # 43170 +.%P pp. 277--278 and pp. 280--282 +.%O http://support.amd.com/us/Processor_TechDocs/43170.pdf .Re .Sh HISTORY The @@ -99,6 +106,7 @@ driver first appeared in and .Dx 2.5 . .Sh AUTHORS +.An -nosplit The .Nm driver was written for @@ -106,7 +114,7 @@ driver was written for and .Dx by -.An Constantine A. Murenin Aq http://cnst.su/ , +.An Constantine A. Murenin Aq Mt cnst@openbsd.org , Raouf Boutaba Research Group, David R. Cheriton School of Computer Science, University of Waterloo. diff --git a/sys/bus/pci/pcidevs b/sys/bus/pci/pcidevs index 718006d976..a7c4316f20 100644 --- a/sys/bus/pci/pcidevs +++ b/sys/bus/pci/pcidevs @@ -171,6 +171,9 @@ product ALTIMA AC9100 0x03ea AC9100 Gigabit Ethernet product AMD AMD64_MISC 0x1103 AMD64 Miscellaneous configuration product AMD AMD64_F10_MISC 0x1203 Family 10h Miscellaneous product AMD AMD64_F11_MISC 0x1303 Family 11h Miscellaneous +product AMD AMD64_F14_MISC 0x1703 Family 14h Miscellaneous +product AMD AMD64_F15_0x_MISC 0x1603 Family 15/0xh Miscellaneous +product AMD AMD64_F15_1x_MISC 0x1403 Family 15/1xh Miscellaneous product AMD PCNET_PCI 0x2000 PCnet-PCI Ethernet product AMD PCNET_HOME 0x2001 PCnet-Home HomePNA Ethernet product AMD GEODE_LX_PCHB 0x2080 Geode LX diff --git a/sys/dev/powermng/km/km.c b/sys/dev/powermng/km/km.c index 8ad0f1cd5f..3f352eed6e 100644 --- a/sys/dev/powermng/km/km.c +++ b/sys/dev/powermng/km/km.c @@ -1,7 +1,7 @@ -/* $OpenBSD: km.c,v 1.2 2008/08/29 03:38:31 cnst Exp $ */ +/* $OpenBSD: km.c,v 1.8 2013/09/17 13:42:34 kettenis Exp $ */ /* - * Copyright (c) 2008/2010 Constantine A. Murenin + * Copyright (c) 2008/2010 Constantine A. Murenin * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -26,7 +26,7 @@ /* - * AMD Family 10h Processors, Function 3 -- Miscellaneous Control + * AMD Family 10h/11h/14h/15h Processors, Function 3 -- Miscellaneous Control */ /* Function 3 Registers */ @@ -86,24 +86,34 @@ km_identify(driver_t *driver, struct device *parent) static int km_probe(struct device *dev) { - int ten = 0; + char *desc; if (pci_get_vendor(dev) != PCI_VENDOR_AMD) return ENXIO; switch (pci_get_device(dev)) { case PCI_PRODUCT_AMD_AMD64_F10_MISC: - ten = 1; - /* FALLTHROUGH */ + desc = "AMD Family 10h temperature sensor"; + break; case PCI_PRODUCT_AMD_AMD64_F11_MISC: - if (device_get_desc(dev) == NULL) - device_set_desc(dev, ten ? - "AMD Family 10h temperature sensor" : - "AMD Family 11h temperature sensor"); - return 0; + desc = "AMD Family 11h temperature sensor"; + break; + case PCI_PRODUCT_AMD_AMD64_F14_MISC: + desc = "AMD Family 14h temperature sensor"; + break; + case PCI_PRODUCT_AMD_AMD64_F15_0x_MISC: + desc = "AMD Family 15/0xh temperature sensor"; + break; + case PCI_PRODUCT_AMD_AMD64_F15_1x_MISC: + desc = "AMD Family 15/1xh temperature sensor"; + break; default: return ENXIO; } + + if (device_get_desc(dev) == NULL) + device_set_desc(dev, desc); + return 0; } static int -- 2.41.0