summaryrefslogtreecommitdiff
path: root/src/drivers/pc80
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/pc80')
-rw-r--r--src/drivers/pc80/pc/i8254.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/drivers/pc80/pc/i8254.c b/src/drivers/pc80/pc/i8254.c
index 5090f0c85b..9d23d4697e 100644
--- a/src/drivers/pc80/pc/i8254.c
+++ b/src/drivers/pc80/pc/i8254.c
@@ -11,7 +11,6 @@
* GNU General Public License for more details.
*/
-#include <arch/early_variables.h>
#include <arch/io.h>
#include <commonlib/helpers.h>
#include <cpu/x86/tsc.h>
@@ -107,23 +106,19 @@ bad_ctc:
}
#if CONFIG(UNKNOWN_TSC_RATE)
-static u32 g_timer_tsc CAR_GLOBAL;
+static u32 g_timer_tsc;
unsigned long tsc_freq_mhz(void)
{
- u32 tsc;
+ if (g_timer_tsc > 0)
+ return g_timer_tsc;
- tsc = car_get_var(g_timer_tsc);
- if (tsc > 0)
- return tsc;
-
- tsc = calibrate_tsc_with_pit();
+ g_timer_tsc = calibrate_tsc_with_pit();
/* Set some semi-ridiculous rate if approximation fails. */
- if (tsc == 0)
- tsc = 5000;
+ if (g_timer_tsc == 0)
+ g_timer_tsc = 5000;
- car_set_var(g_timer_tsc, tsc);
- return tsc;
+ return g_timer_tsc;
}
#endif