summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2009-11-22 20:13:13 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2009-11-22 20:13:13 +0000
commit112007cc35a7c67407d61b85fec7436416266dda (patch)
tree2a0890494dfd6273f1107d9d69f1f7c856736f5a
parent9626e4cb267b99b0c9c9ce2978e0ccd0f1152df6 (diff)
Match the i386 behaviour and only care about bus_clock if we
don't have the tables from acpi. This way we don't have to have knowledge of the cpu model to do speedstep in the acpi case. ok kettenis@
-rw-r--r--sys/arch/amd64/amd64/est.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/sys/arch/amd64/amd64/est.c b/sys/arch/amd64/amd64/est.c
index b1a3bee44d9..f09ad335f48 100644
--- a/sys/arch/amd64/amd64/est.c
+++ b/sys/arch/amd64/amd64/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.14 2009/07/27 11:28:55 dms Exp $ */
+/* $OpenBSD: est.c,v 1.15 2009/11/22 20:13:12 jsg Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -196,9 +196,9 @@ p3_get_bus_clock(struct cpu_info *ci)
break;
}
break;
- case 0x1a: /* Nehalem based Core i7 and Xeon */
- bus_clock = BUS133;
- break;
+ case 0x1a: /* Nehalem based Core i7 and Xeon */
+ bus_clock = BUS133;
+ break;
case 0x1c: /* Atom */
msr = rdmsr(MSR_FSB_FREQ);
bus = (msr >> 0) & 0x7;
@@ -328,24 +328,26 @@ est_init(struct cpu_info *ci)
} else if (family == 6) {
p3_get_bus_clock(ci);
}
- if (bus_clock == 0) {
- printf("%s: EST: unknown system bus clock\n", cpu_device);
- return;
- }
-
- msr = rdmsr(MSR_PERF_STATUS);
- idhi = (msr >> 32) & 0xffff;
- idlo = (msr >> 48) & 0xffff;
- cur = msr & 0xffff;
- crhi = (idhi >> 8) & 0xff;
- crlo = (idlo >> 8) & 0xff;
- crcur = (cur >> 8) & 0xff;
#if NACPICPU > 0
est_fqlist = est_acpi_init();
#endif
if (est_fqlist == NULL) {
+ if (bus_clock == 0) {
+ printf("%s: EST: unknown system bus clock\n",
+ cpu_device);
+ return;
+ }
+
+ msr = rdmsr(MSR_PERF_STATUS);
+ idhi = (msr >> 32) & 0xffff;
+ idlo = (msr >> 48) & 0xffff;
+ cur = msr & 0xffff;
+ crhi = (idhi >> 8) & 0xff;
+ crlo = (idlo >> 8) & 0xff;
+ crcur = (cur >> 8) & 0xff;
+
if (crhi == 0 || crcur == 0 || crlo > crhi ||
crcur < crlo || crcur > crhi) {
/*
@@ -357,7 +359,7 @@ est_init(struct cpu_info *ci)
cpu_device, msr);
return;
}
- if (crlo == 0 || crhi == crlo) {
+ if (crlo == 0 || crhi == crlo) {
/*
* Don't complain about these cases, and silently
* disable EST: - A lowest clock ratio of 0, which