Project

General

Profile

Submit #2643 ยป 0001-Updating-km-from-OpenBSD.-Adds-support-for-AMD-Famil.patch

vadaszi, 02/19/2014 12:12 AM

View differences:

share/man/man4/km.4
.\" $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 <cnst+dfly@bugmail.mojo.ru>
.\" Copyright (c) 2008 Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
......
.\" 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
......
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
......
.%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
......
and
.Dx 2.5 .
.Sh AUTHORS
.An -nosplit
The
.Nm
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.
sys/bus/pci/pcidevs
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
sys/dev/powermng/km/km.c
/* $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 <cnst+dfly@bugmail.mojo.ru>
* Copyright (c) 2008 Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
......
/*
* AMD Family 10h Processors, Function 3 -- Miscellaneous Control
* AMD Family 10h/11h/14h/15h Processors, Function 3 -- Miscellaneous Control
*/
/* Function 3 Registers */
......
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-1/1)