aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2013-02-10 01:13:56 +0000
committerKevin O'Connor <kevin@koconnor.net>2013-02-12 21:14:31 -0500
commit473013a8219176a39cbdabb5caabaf341d8ce44b (patch)
treec85541e1c1373c5d5e6740412f22b710b681ba52
parent38c2ebf41da37e3a4f452492e005c75b8d0c3ab1 (diff)
downloadseabios-473013a8219176a39cbdabb5caabaf341d8ce44b.tar.gz
Don't calibrate TSC if PMTIMER is already set up
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--src/clock.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/clock.c b/src/clock.c
index bbcafd7..708d413 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -65,10 +65,20 @@
u32 cpu_khz VAR16VISIBLE;
u8 no_tsc VAR16VISIBLE;
+u16 pmtimer_ioport VAR16VISIBLE;
+u32 pmtimer_wraps VARLOW;
+u32 pmtimer_last VARLOW;
+
static void
calibrate_tsc(void)
{
u32 eax, ebx, ecx, edx, cpuid_features = 0;
+
+ if (CONFIG_PMTIMER && GET_GLOBAL(pmtimer_ioport)) {
+ dprintf(3, "pmtimer already configured; will not calibrate TSC\n");
+ return;
+ }
+
cpuid(0, &eax, &ebx, &ecx, &edx);
if (eax > 0)
cpuid(1, &eax, &ebx, &ecx, &cpuid_features);
@@ -129,10 +139,6 @@ emulate_tsc(void)
return ret;
}
-u16 pmtimer_ioport VAR16VISIBLE;
-u32 pmtimer_wraps VARLOW;
-u32 pmtimer_last VARLOW;
-
void pmtimer_setup(u16 ioport, u32 khz)
{
if (!CONFIG_PMTIMER)