blob: 4fb09c79019e0058708fdd4a48f3371a9bc218dd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From 03a830aad1cdf4325781aa60566bebcf5aa57238 Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <contact@paulk.fr>
Date: Mon, 19 Dec 2016 19:22:39 +0100
Subject: [PATCH 3/4] libpayload: Get current tick from high register in
generic timer
This fixes the generic timer driver to get the current tick from the
high register, so that comparison with the high count value (obtained
previously from the same register) has a chance to succeed.
Change-Id: I5ce02bfa15a91ad34641b8e24813a5b7ca790ec3
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
payloads/libpayload/drivers/timer/generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/drivers/timer/generic.c b/payloads/libpayload/drivers/timer/generic.c
index 4c06618..ac26f40 100644
--- a/payloads/libpayload/drivers/timer/generic.c
+++ b/payloads/libpayload/drivers/timer/generic.c
@@ -53,7 +53,7 @@ uint64_t timer_raw_value(void)
do {
count_h = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_HIGH_REG));
count_l = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_REG));
- cur_tick = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_REG));
+ cur_tick = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_HIGH_REG));
} while (cur_tick != count_h);
return (cur_tick << 32) + count_l;
--
2.10.2
|