diff options
| author | J. Neuschäfer <[email protected]> | 2024-12-20 11:37:51 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-12-30 15:55:27 -0600 |
| commit | deb26b6c29670dee743dfb54b8f69866339580bd (patch) | |
| tree | 8eaf57e9a28c65cf63cda794e2745f1ffcdbe0e8 /drivers/timer | |
| parent | 337bfdce5aa52637b482b182db959b9bb058f4b7 (diff) | |
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 <[email protected]>
Signed-off-by: J. Neuschäfer <[email protected]>
Diffstat (limited to 'drivers/timer')
| -rw-r--r-- | drivers/timer/mpc83xx_timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |
