Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 Get bus clock for some Atom processors.
details: https://anonhg.NetBSD.org/src/rev/86f69e5e51a7
branches: trunk
changeset: 791177:86f69e5e51a7
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Nov 07 18:17:13 2013 +0000
description:
Get bus clock for some Atom processors.
diffstat:
sys/arch/x86/x86/intel_busclock.c | 64 +++++++++++++++++++++++++++++++++++++-
1 files changed, 62 insertions(+), 2 deletions(-)
diffs (85 lines):
diff -r f2964c925b5f -r 86f69e5e51a7 sys/arch/x86/x86/intel_busclock.c
--- a/sys/arch/x86/x86/intel_busclock.c Thu Nov 07 17:50:18 2013 +0000
+++ b/sys/arch/x86/x86/intel_busclock.c Thu Nov 07 18:17:13 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intel_busclock.c,v 1.13 2011/09/24 10:49:13 jym Exp $ */
+/* $NetBSD: intel_busclock.c,v 1.14 2013/11/07 18:17:13 msaitoh Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.13 2011/09/24 10:49:13 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.14 2013/11/07 18:17:13 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -213,6 +213,66 @@
goto print_msr;
}
break;
+ case 0x1c: /* Atom */
+ case 0x26:
+ case 0x27:
+ case 0x35:
+ case 0x36:
+ if (rdmsr_safe(MSR_FSB_FREQ, &msr) == EFAULT) {
+ aprint_debug_dev(ci->ci_dev,
+ "unable to determine bus speed");
+ goto print_msr;
+ }
+ bus = (msr >> 0) & 0x7;
+ switch (bus) {
+ case 7:
+ bus_clock = 8333;
+ break;
+ case 5:
+ bus_clock = 10000;
+ break;
+ case 1:
+ bus_clock = 13333;
+ break;
+ case 3:
+ bus_clock = 16667;
+ break;
+ default:
+ aprint_debug("%s: unknown Atom FSB_FREQ value %d",
+ device_xname(ci->ci_dev), bus);
+ goto print_msr;
+ }
+ break;
+ case 0x37: /* Silvermont */
+ case 0x4d:
+ if (rdmsr_safe(MSR_FSB_FREQ, &msr) == EFAULT) {
+ aprint_debug_dev(ci->ci_dev,
+ "unable to determine bus speed");
+ goto print_msr;
+ }
+ bus = (msr >> 0) & 0x7;
+ switch (bus) {
+ case 4:
+ bus_clock = 8000;
+ break;
+ case 0:
+ bus_clock = 8333;
+ break;
+ case 1:
+ bus_clock = 10000;
+ break;
+ case 2:
+ bus_clock = 13333;
+ break;
+ case 3:
+ bus_clock = 16667;
+ break;
+ default:
+ aprint_debug("%s: unknown Silvermont FSB_FREQ value %d",
+ device_xname(ci->ci_dev), bus);
+ goto print_msr;
+ }
+ break;
default:
aprint_debug("%s: unknown i686 model %d, can't get bus clock",
device_xname(ci->ci_dev),
Home |
Main Index |
Thread Index |
Old Index