mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
i.MX7ULP: Fix SPLL/APLL clock rate calculation issue
The num/denom is a float value, but in the calculation it is convert to integer 0, and cause the result wrong. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
3399a2e1d2
commit
eb6d2e5920
1 changed files with 8 additions and 2 deletions
|
@ -503,7 +503,10 @@ u32 decode_pll(enum pll_clocks pll)
|
|||
|
||||
infreq = infreq / pre_div;
|
||||
|
||||
return infreq * mult + infreq * num / denom;
|
||||
if (denom)
|
||||
return infreq * mult + infreq * num / denom;
|
||||
else
|
||||
return infreq * mult;
|
||||
|
||||
case PLL_A7_APLL:
|
||||
reg = readl(&scg1_regs->apllcsr);
|
||||
|
@ -532,7 +535,10 @@ u32 decode_pll(enum pll_clocks pll)
|
|||
|
||||
infreq = infreq / pre_div;
|
||||
|
||||
return infreq * mult + infreq * num / denom;
|
||||
if (denom)
|
||||
return infreq * mult + infreq * num / denom;
|
||||
else
|
||||
return infreq * mult;
|
||||
|
||||
case PLL_USB:
|
||||
reg = readl(&scg1_regs->upllcsr);
|
||||
|
|
Loading…
Reference in a new issue