diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-03-14 05:45:22 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-05-15 11:49:08 -0400 |
commit | 8889612b3e2054617219581ae10dbe33cf3bddfe (patch) | |
tree | c1bc35777092773857c5eeca53630897aeb1ae16 /arch/mips/include | |
parent | d84114660a65e89e27ebd3fb21ce71ff579ee882 (diff) |
MIPS: ath79: add clock initialization code for AR934X
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Cc: linux-mips@linux-mips.org
Cc: mcgrof@infradead.org
Patchwork: https://patchwork.linux-mips.org/patch/3507/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h index 4e3c55d4b078..bc1c345da009 100644 --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h | |||
@@ -151,6 +151,41 @@ | |||
151 | #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT 15 | 151 | #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT 15 |
152 | #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK 0x7 | 152 | #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK 0x7 |
153 | 153 | ||
154 | #define AR934X_PLL_CPU_CONFIG_REG 0x00 | ||
155 | #define AR934X_PLL_DDR_CONFIG_REG 0x04 | ||
156 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG 0x08 | ||
157 | |||
158 | #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 | ||
159 | #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f | ||
160 | #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT 6 | ||
161 | #define AR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f | ||
162 | #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 | ||
163 | #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f | ||
164 | #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 | ||
165 | #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 | ||
166 | |||
167 | #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 | ||
168 | #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff | ||
169 | #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT 10 | ||
170 | #define AR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f | ||
171 | #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 | ||
172 | #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f | ||
173 | #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 | ||
174 | #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 | ||
175 | |||
176 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS BIT(2) | ||
177 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS BIT(3) | ||
178 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS BIT(4) | ||
179 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT 5 | ||
180 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK 0x1f | ||
181 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT 10 | ||
182 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK 0x1f | ||
183 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT 15 | ||
184 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK 0x1f | ||
185 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) | ||
186 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) | ||
187 | #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) | ||
188 | |||
154 | /* | 189 | /* |
155 | * USB_CONFIG block | 190 | * USB_CONFIG block |
156 | */ | 191 | */ |
@@ -186,6 +221,8 @@ | |||
186 | #define AR933X_RESET_REG_RESET_MODULE 0x1c | 221 | #define AR933X_RESET_REG_RESET_MODULE 0x1c |
187 | #define AR933X_RESET_REG_BOOTSTRAP 0xac | 222 | #define AR933X_RESET_REG_BOOTSTRAP 0xac |
188 | 223 | ||
224 | #define AR934X_RESET_REG_BOOTSTRAP 0xb0 | ||
225 | |||
189 | #define MISC_INT_ETHSW BIT(12) | 226 | #define MISC_INT_ETHSW BIT(12) |
190 | #define MISC_INT_TIMER4 BIT(10) | 227 | #define MISC_INT_TIMER4 BIT(10) |
191 | #define MISC_INT_TIMER3 BIT(9) | 228 | #define MISC_INT_TIMER3 BIT(9) |
@@ -242,6 +279,22 @@ | |||
242 | 279 | ||
243 | #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) | 280 | #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) |
244 | 281 | ||
282 | #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) | ||
283 | #define AR934X_BOOTSTRAP_SW_OPTION7 BIT(22) | ||
284 | #define AR934X_BOOTSTRAP_SW_OPTION6 BIT(21) | ||
285 | #define AR934X_BOOTSTRAP_SW_OPTION5 BIT(20) | ||
286 | #define AR934X_BOOTSTRAP_SW_OPTION4 BIT(19) | ||
287 | #define AR934X_BOOTSTRAP_SW_OPTION3 BIT(18) | ||
288 | #define AR934X_BOOTSTRAP_SW_OPTION2 BIT(17) | ||
289 | #define AR934X_BOOTSTRAP_SW_OPTION1 BIT(16) | ||
290 | #define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7) | ||
291 | #define AR934X_BOOTSTRAP_PCIE_RC BIT(6) | ||
292 | #define AR934X_BOOTSTRAP_EJTAG_MODE BIT(5) | ||
293 | #define AR934X_BOOTSTRAP_REF_CLK_40 BIT(4) | ||
294 | #define AR934X_BOOTSTRAP_BOOT_FROM_SPI BIT(2) | ||
295 | #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) | ||
296 | #define AR934X_BOOTSTRAP_DDR1 BIT(0) | ||
297 | |||
245 | #define REV_ID_MAJOR_MASK 0xfff0 | 298 | #define REV_ID_MAJOR_MASK 0xfff0 |
246 | #define REV_ID_MAJOR_AR71XX 0x00a0 | 299 | #define REV_ID_MAJOR_AR71XX 0x00a0 |
247 | #define REV_ID_MAJOR_AR913X 0x00b0 | 300 | #define REV_ID_MAJOR_AR913X 0x00b0 |