ar71xx: add support for linux 4.4
[openwrt.git] / target / linux / ar71xx / patches-4.4 / 634-MIPS-ath79-ar724x-clock-calculation-fixes.patch
1 --- a/arch/mips/ath79/clock.c
2 +++ b/arch/mips/ath79/clock.c
3 @@ -26,7 +26,7 @@
4  #include "common.h"
5  
6  #define AR71XX_BASE_FREQ       40000000
7 -#define AR724X_BASE_FREQ       5000000
8 +#define AR724X_BASE_FREQ       40000000
9  #define AR913X_BASE_FREQ       5000000
10  
11  static struct clk *clks[3];
12 @@ -103,8 +103,8 @@ static void __init ar724x_clocks_init(vo
13         div = ((pll >> AR724X_PLL_FB_SHIFT) & AR724X_PLL_FB_MASK);
14         freq = div * ref_rate;
15  
16 -       div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
17 -       freq *= div;
18 +       div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK) * 2;
19 +       freq /= div;
20  
21         cpu_rate = freq;
22