[PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around

Stefan Roese sr at denx.de
Sun Sep 18 12:49:48 CEST 2022


On 15.09.22 16:20, Stefan Roese wrote:
> 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 at weidmueller.com>
> Signed-off-by: Stefan Roese <sr at denx.de>
> Tested-by: Tony Dinh <mibodhi at gmail.com>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
> v3:
> - Add Fixes tag
> 
> v2:
> - New patch
> 
>   drivers/timer/orion-timer.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c
> index fd30e1bf036c..d7d1a1b24462 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)

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list