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

12345678910111213141516171819202122
  1. --- a/arch/mips/ath79/clock.c
  2. +++ b/arch/mips/ath79/clock.c
  3. @@ -25,7 +25,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. struct clk {
  10. @@ -99,8 +99,8 @@ static void __init ar724x_clocks_init(vo
  11. div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_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;