summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-11-20 22:02:33 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-29 09:19:54 +0000
commit22be29e23b278bc0dd344832a8e3cab1eeb07f7a (patch)
tree9ef190a214e5085e8f0b0896429a9fa721350b11
parentc2a9c426701a45cfcb624e8d3befb258c74abe06 (diff)
downloadcoreboot-22be29e23b278bc0dd344832a8e3cab1eeb07f7a.tar.xz
drivers/pc80/pc/i8254.c: Drop CAR_GLOBAL_MIGRATION support
Change-Id: Ibe9b353ce050b4718e07bccb958dbe3d2312e741 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37045 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-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