diff options
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/arm_cortexa8/mx53/generic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpu/arm_cortexa8/mx53/generic.c b/cpu/arm_cortexa8/mx53/generic.c index 1357462..d54bf2c 100644 --- a/cpu/arm_cortexa8/mx53/generic.c +++ b/cpu/arm_cortexa8/mx53/generic.c @@ -94,8 +94,10 @@ struct pll_param { static u32 __decode_pll(enum pll_clocks pll, u32 infreq) { - u32 mfi, mfn, mfd, pd; + u32 mfi, mfn, mfd, pd, ctrl, mult; + ctrl = __REG(pll + MXC_PLL_DP_CTL); + mult = (ctrl & MXC_PLL_DP_CTL_DPDCK0_2_EN) ? 4 : 2; mfn = __REG(pll + MXC_PLL_DP_MFN); mfd = __REG(pll + MXC_PLL_DP_MFD) + 1; mfi = __REG(pll + MXC_PLL_DP_OP); @@ -103,7 +105,7 @@ static u32 __decode_pll(enum pll_clocks pll, u32 infreq) mfi = (mfi >> 4) & 0xF; mfi = (mfi >= 5) ? mfi : 5; - return ((4 * (infreq / 1000) * (mfi * mfd + mfn)) / (mfd * pd)) * 1000; + return ((mult * (infreq / 1000) * (mfi * mfd + mfn)) / (mfd * pd)) * 1000; } static u32 __get_mcu_main_clk(void) |