aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Bedel <albeu@free.fr>2015-04-19 08:30:02 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-06-21 15:53:49 -0400
commit626a0695a6d98338063c528d113d9ee4ba00cd78 (patch)
tree03c999ddbda06315325bb635736c77ecb30c9539
parentda628e8b8b824b15c75fbc6b3defed2ff38475fe (diff)
MIPS: ath79: Correctly name the defines for the PLL_FB register
This register is named PLL_FB and is not a divider but a multiplier. To make things less confusing rename the ARxxxx_PLL_DIV_SHIFT and ARxxxx_PLL_DIV_MASK macros to ARxxxx_PLL_FB_SHIFT and ARxxxx_PLL_FB_MASK. Signed-off-by: Alban Bedel <albeu@free.fr> Cc: linux-mips@linux-mips.org Cc: Andrew Bresticker <abrestic@chromium.org> Cc: Qais Yousef <qais.yousef@imgtec.com> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com> Cc: Gabor Juhos <juhosg@openwrt.org> Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/9772/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/ath79/clock.c6
-rw-r--r--arch/mips/include/asm/mach-ath79/ar71xx_regs.h12
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 26479f437675..226ddf0a0a97 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -62,7 +62,7 @@ static void __init ar71xx_clocks_init(void)
62 62
63 pll = ath79_pll_rr(AR71XX_PLL_REG_CPU_CONFIG); 63 pll = ath79_pll_rr(AR71XX_PLL_REG_CPU_CONFIG);
64 64
65 div = ((pll >> AR71XX_PLL_DIV_SHIFT) & AR71XX_PLL_DIV_MASK) + 1; 65 div = ((pll >> AR71XX_PLL_FB_SHIFT) & AR71XX_PLL_FB_MASK) + 1;
66 freq = div * ref_rate; 66 freq = div * ref_rate;
67 67
68 div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1; 68 div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1;
@@ -96,7 +96,7 @@ static void __init ar724x_clocks_init(void)
96 ref_rate = AR724X_BASE_FREQ; 96 ref_rate = AR724X_BASE_FREQ;
97 pll = ath79_pll_rr(AR724X_PLL_REG_CPU_CONFIG); 97 pll = ath79_pll_rr(AR724X_PLL_REG_CPU_CONFIG);
98 98
99 div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_MASK); 99 div = ((pll >> AR724X_PLL_FB_SHIFT) & AR724X_PLL_FB_MASK);
100 freq = div * ref_rate; 100 freq = div * ref_rate;
101 101
102 div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK); 102 div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
@@ -132,7 +132,7 @@ static void __init ar913x_clocks_init(void)
132 ref_rate = AR913X_BASE_FREQ; 132 ref_rate = AR913X_BASE_FREQ;
133 pll = ath79_pll_rr(AR913X_PLL_REG_CPU_CONFIG); 133 pll = ath79_pll_rr(AR913X_PLL_REG_CPU_CONFIG);
134 134
135 div = ((pll >> AR913X_PLL_DIV_SHIFT) & AR913X_PLL_DIV_MASK); 135 div = ((pll >> AR913X_PLL_FB_SHIFT) & AR913X_PLL_FB_MASK);
136 freq = div * ref_rate; 136 freq = div * ref_rate;
137 137
138 cpu_rate = freq; 138 cpu_rate = freq;
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
index cd41e93bc1d8..aa3800c82332 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -157,8 +157,8 @@
157#define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10 157#define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10
158#define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14 158#define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14
159 159
160#define AR71XX_PLL_DIV_SHIFT 3 160#define AR71XX_PLL_FB_SHIFT 3
161#define AR71XX_PLL_DIV_MASK 0x1f 161#define AR71XX_PLL_FB_MASK 0x1f
162#define AR71XX_CPU_DIV_SHIFT 16 162#define AR71XX_CPU_DIV_SHIFT 16
163#define AR71XX_CPU_DIV_MASK 0x3 163#define AR71XX_CPU_DIV_MASK 0x3
164#define AR71XX_DDR_DIV_SHIFT 18 164#define AR71XX_DDR_DIV_SHIFT 18
@@ -169,8 +169,8 @@
169#define AR724X_PLL_REG_CPU_CONFIG 0x00 169#define AR724X_PLL_REG_CPU_CONFIG 0x00
170#define AR724X_PLL_REG_PCIE_CONFIG 0x18 170#define AR724X_PLL_REG_PCIE_CONFIG 0x18
171 171
172#define AR724X_PLL_DIV_SHIFT 0 172#define AR724X_PLL_FB_SHIFT 0
173#define AR724X_PLL_DIV_MASK 0x3ff 173#define AR724X_PLL_FB_MASK 0x3ff
174#define AR724X_PLL_REF_DIV_SHIFT 10 174#define AR724X_PLL_REF_DIV_SHIFT 10
175#define AR724X_PLL_REF_DIV_MASK 0xf 175#define AR724X_PLL_REF_DIV_MASK 0xf
176#define AR724X_AHB_DIV_SHIFT 19 176#define AR724X_AHB_DIV_SHIFT 19
@@ -183,8 +183,8 @@
183#define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14 183#define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14
184#define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18 184#define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18
185 185
186#define AR913X_PLL_DIV_SHIFT 0 186#define AR913X_PLL_FB_SHIFT 0
187#define AR913X_PLL_DIV_MASK 0x3ff 187#define AR913X_PLL_FB_MASK 0x3ff
188#define AR913X_DDR_DIV_SHIFT 22 188#define AR913X_DDR_DIV_SHIFT 22
189#define AR913X_DDR_DIV_MASK 0x3 189#define AR913X_DDR_DIV_MASK 0x3
190#define AR913X_AHB_DIV_SHIFT 19 190#define AR913X_AHB_DIV_SHIFT 19