]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/mx5/clock.c
arm: mx5: clock: improve accuracy of decode_pll()
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / mx5 / clock.c
index 7dec2d1a2e46867a008cd2b185ac68431dff329e..5091f999db7a9b1a2b0c90ff05ece2074f05f1e8 100644 (file)
@@ -378,7 +378,6 @@ static uint32_t decode_pll(struct mxc_pll_reg *pll, uint32_t infreq)
        if (ctrl & MXC_DPLLC_CTL_DPDCK0_2_EN)
                refclk *= 2;
 
-       do_div(refclk, pdf + 1);
        temp = refclk * mfn_abs;
        do_div(temp, mfd + 1);
        ret = refclk * mfi;
@@ -388,6 +387,7 @@ static uint32_t decode_pll(struct mxc_pll_reg *pll, uint32_t infreq)
        else
                ret += temp;
 
+       ret /= pdf + 1;
        return ret;
 }