summaryrefslogtreecommitdiff
path: root/drivers/timer/tsc_timer.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-03 19:28:54 -0500
committerTom Rini <trini@konsulko.com>2019-11-03 19:28:54 -0500
commitee93ef0c4b272c57c08038655ff0259fdd2c4126 (patch)
tree8794b7d6bed8385811bac310d0ca35e6049b7e10 /drivers/timer/tsc_timer.c
parent9c17ad33fe3ec5ca9ce039db13ccf2e66d74d23b (diff)
parent73c6cd6c0bdb3af76d573f619bbcc141758bb16b (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
- Add support for Intel FSP-S and FSP-T in binman - Correct priority selection for image loaders for SPL - Add a size check for TPL - Various small SPL/TPL bug fixes and changes - SPI: Add support for memory-mapped flash
Diffstat (limited to 'drivers/timer/tsc_timer.c')
-rw-r--r--drivers/timer/tsc_timer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 919caba8a14..637c8ff25a5 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -394,7 +394,7 @@ static int tsc_timer_get_count(struct udevice *dev, u64 *count)
static void tsc_timer_ensure_setup(bool early)
{
- if (gd->arch.tsc_base)
+ if (gd->arch.tsc_inited)
return;
gd->arch.tsc_base = rdtsc();
@@ -425,6 +425,7 @@ static void tsc_timer_ensure_setup(bool early)
done:
gd->arch.clock_rate = fast_calibrate * 1000000;
}
+ gd->arch.tsc_inited = true;
}
static int tsc_timer_probe(struct udevice *dev)
@@ -461,6 +462,8 @@ unsigned long notrace timer_early_get_rate(void)
u64 notrace timer_early_get_count(void)
{
+ tsc_timer_ensure_setup(true);
+
return rdtsc() - gd->arch.tsc_base;
}