Skip to content
Snippets Groups Projects
Commit 43bff395 authored by Ye Li's avatar Ye Li
Browse files

MLK-14693 mx7ulp: Change PLL rate calculation to avoid div 0


The new ROM patch will set DENOM and NUM of APLL and SPLL to 0 to
workaround PLL issue.
When DENOM is 0, the PLL rate calculation will divide 0 and raise a signal.

raise: Signal # 8 caught

To avoid such problem, we change our calculation.

Signed-off-by: default avatarYe Li <ye.li@nxp.com>
(cherry picked from commit f28cf489)
parent f2d1f950
No related branches found
No related tags found
No related merge requests found
......@@ -500,7 +500,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);
......@@ -529,7 +532,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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment