summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2022-09-15 16:20:36 +0200
committerStefan Roese <sr@denx.de>2022-09-18 12:41:57 +0200
commit5996a8a8356c11c6eb504eeea93c267f9adbf53c (patch)
tree49b577aabdf7dc2483b895bc02ed560cfcf56535
parent711b5fd23253bace6bef75630229aa71eeb0ffb9 (diff)
timer: orion-timer: Use timer_conv_64() to fix timer wrap around
While testing on some Kirkwood platforms it was noticed that the timer did not function correctly all the time. The driver did not correctly handle 32bit timer value wrap arounds. Using the timer_conv_64() conversion function fixes this issue. Fixes: e9e73d78a8fb ("timer: add orion-timer support") Suggested-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com> Signed-off-by: Stefan Roese <sr@denx.de> Tested-by: Tony Dinh <mibodhi@gmail.com>
-rw-r--r--drivers/timer/orion-timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c
index fd30e1bf03..d7d1a1b244 100644
--- a/drivers/timer/orion-timer.c
+++ b/drivers/timer/orion-timer.c
@@ -19,7 +19,7 @@ static uint64_t orion_timer_get_count(struct udevice *dev)
{
struct orion_timer_priv *priv = dev_get_priv(dev);
- return ~readl(priv->base + TIMER0_VAL);
+ return timer_conv_64(~readl(priv->base + TIMER0_VAL));
}
static int orion_timer_probe(struct udevice *dev)