Project

General

Profile

Actions

Submit #2643

closed

Sync km with the current OpenBSD version.

Added by vadaszi almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

This patch synchronizes the km driver to the current OpenBSD version.
This adds support for AMD family 14h and 15h CPUs.
Works for me with an AMD Family 14h cpu (model T44R).

From 44da3dee91ba6855d7d89ecbb9e42b3366cfa9bf Mon Sep 17 00:00:00 2001
From: Imre Vadasz <>
Date: Wed, 19 Feb 2014 08:52:53 +0100
Subject: [PATCH] Updating km 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 | 31 +
++++++++++++++++++-----------
3 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/share/man/man4/km.4 b/share/man/man4/km.4
index 6c4aa86..53e31b3 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 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 $Mdocdate: 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
.\" .%U 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
.\" .%U 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
.\" .%U 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 ,
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 718006d..a7c4316 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 8ad0f1c..991e65f 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 &lt;&gt;
+ * Copyright (c) 2008 Constantine A. Murenin &lt;&gt; * * 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,33 @ 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);
}
static int
--
1.8.5.2

Files

Actions #1

Updated by swildner almost 11 years ago

  • Status changed from New to In Progress
  • Assignee set to swildner

grab

Actions #2

Updated by swildner almost 11 years ago

  • Status changed from In Progress to Closed

I've pushed it with some minor changes. Thanks!

Actions

Also available in: Atom PDF