2
0

634-MIPS-ath79-ar724x-clock-calculation-fixes.patch 618 B

12345678910111213141516171819202122
  1. --- a/arch/mips/ath79/clock.c
  2. +++ b/arch/mips/ath79/clock.c
  3. @@ -26,7 +26,7 @@
  4. #include "common.h"
  5. #define AR71XX_BASE_FREQ 40000000
  6. -#define AR724X_BASE_FREQ 5000000
  7. +#define AR724X_BASE_FREQ 40000000
  8. #define AR913X_BASE_FREQ 5000000
  9. static struct clk *clks[3];
  10. @@ -103,8 +103,8 @@ static void __init ar724x_clocks_init(vo
  11. div = ((pll >> AR724X_PLL_FB_SHIFT) & AR724X_PLL_FB_MASK);
  12. freq = div * ref_rate;
  13. - div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
  14. - freq *= div;
  15. + div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK) * 2;
  16. + freq /= div;
  17. cpu_rate = freq;