From: J. Neuschäfer Date: Fri, 20 Dec 2024 10:37:51 +0000 (+0100) Subject: powerpc: mpc83xx: Fix timer value calculation X-Git-Tag: v2025.04-rc1~17^2~19^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb26b6c29670dee743dfb54b8f69866339580bd;p=pandora-u-boot.git powerpc: mpc83xx: Fix timer value calculation TBU and TBL are specified as two 32-bit registers that form a 64-bit value, but the calculation only shifted TBU by 16 bits. Fix this by actually shifting 32 bits. Reviewed-by: Sinan Akman Signed-off-by: J. Neuschäfer --- diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c index 9da74479aaa..f92009e4ccc 100644 --- a/drivers/timer/mpc83xx_timer.c +++ b/drivers/timer/mpc83xx_timer.c @@ -206,7 +206,7 @@ static u64 mpc83xx_timer_get_count(struct udevice *dev) tbl = mftb(); } while (tbu != mftbu()); - return (tbu * 0x10000ULL) + tbl; + return (uint64_t)tbu << 32 | tbl; } static int mpc83xx_timer_probe(struct udevice *dev)