summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-07-02 05:13:34 +0300
committerTom Rini <trini@konsulko.com>2018-07-02 05:13:34 +0300
commitac378bb05fa3cac3197085431f577e0dbddd4b4a (patch)
treeaa16e2990b97bd5d2f1358a63e906963a55bc8ce /drivers
parent168de20f3b6ccefef0ff5757fa5310f47a95c2f0 (diff)
parent40144260a9c8c5228500824ad9b7b19597a4bb0b (diff)
downloadu-boot-ac378bb05fa3cac3197085431f577e0dbddd4b4a.tar.xz
Merge git://git.denx.de/u-boot-x86
Diffstat (limited to 'drivers')
-rw-r--r--drivers/timer/tsc_timer.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index cf869998bf..747f190d38 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -377,14 +377,23 @@ static int tsc_timer_probe(struct udevice *dev)
{
struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
- tsc_timer_ensure_setup();
- uc_priv->clock_rate = gd->arch.clock_rate;
+ if (!uc_priv->clock_rate) {
+ tsc_timer_ensure_setup();
+ uc_priv->clock_rate = gd->arch.clock_rate;
+ } else {
+ gd->arch.tsc_base = rdtsc();
+ }
return 0;
}
unsigned long notrace timer_early_get_rate(void)
{
+ /*
+ * When TSC timer is used as the early timer, be warned that the timer
+ * clock rate can only be calibrated via some hardware ways. Specifying
+ * it in the device tree won't work for the early timer.
+ */
tsc_timer_ensure_setup();
return gd->arch.clock_rate;