From: Stefan Roese Date: Thu, 15 Sep 2022 14:20:36 +0000 (+0200) Subject: timer: orion-timer: Use timer_conv_64() to fix timer wrap around X-Git-Tag: v2022.10~17^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5996a8a8356c11c6eb504eeea93c267f9adbf53c;p=platform%2Fkernel%2Fu-boot.git 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 Signed-off-by: Stefan Roese Tested-by: Tony Dinh --- diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c index fd30e1b..d7d1a1b 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)