aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-02-15 08:38:17 -0500
committerJohn Crispin <blogic@openwrt.org>2013-02-19 03:36:25 -0500
commit41583c05c15cd3adb848f9ee8316bf8084c961cb (patch)
tree2526f8df6b38945a7193ec4de582c48d85c5b407 /arch/mips/include
parent2e6c91e392fd7be2ef0ba1e9a20e0ebe8ab79cf3 (diff)
MIPS: ath79: add clock setup code for the QCA955X SoCs
The patch adds code to get various clock frequencies from the PLLs used in the QCA955x SoCs. Cc: Rodriguez, Luis <rodrigue@qca.qualcomm.com> Cc: Giori, Kathy <kgiori@qca.qualcomm.com> Cc: QCA Linux Team <qca-linux-team@qca.qualcomm.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/4945/ Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/mach-ath79/ar71xx_regs.h39
1 files changed, 39 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 63a9f2b600b8..7b00e12afc1c 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -225,6 +225,41 @@
225#define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 225#define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
226#define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 226#define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
227 227
228#define QCA955X_PLL_CPU_CONFIG_REG 0x00
229#define QCA955X_PLL_DDR_CONFIG_REG 0x04
230#define QCA955X_PLL_CLK_CTRL_REG 0x08
231
232#define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT 0
233#define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f
234#define QCA955X_PLL_CPU_CONFIG_NINT_SHIFT 6
235#define QCA955X_PLL_CPU_CONFIG_NINT_MASK 0x3f
236#define QCA955X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
237#define QCA955X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
238#define QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
239#define QCA955X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3
240
241#define QCA955X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
242#define QCA955X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
243#define QCA955X_PLL_DDR_CONFIG_NINT_SHIFT 10
244#define QCA955X_PLL_DDR_CONFIG_NINT_MASK 0x3f
245#define QCA955X_PLL_DDR_CONFIG_REFDIV_SHIFT 16
246#define QCA955X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f
247#define QCA955X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23
248#define QCA955X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7
249
250#define QCA955X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2)
251#define QCA955X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3)
252#define QCA955X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4)
253#define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5
254#define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f
255#define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10
256#define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f
257#define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15
258#define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f
259#define QCA955X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20)
260#define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
261#define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
262
228/* 263/*
229 * USB_CONFIG block 264 * USB_CONFIG block
230 */ 265 */
@@ -264,6 +299,8 @@
264#define AR934X_RESET_REG_BOOTSTRAP 0xb0 299#define AR934X_RESET_REG_BOOTSTRAP 0xb0
265#define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac 300#define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
266 301
302#define QCA955X_RESET_REG_BOOTSTRAP 0xb0
303
267#define MISC_INT_ETHSW BIT(12) 304#define MISC_INT_ETHSW BIT(12)
268#define MISC_INT_TIMER4 BIT(10) 305#define MISC_INT_TIMER4 BIT(10)
269#define MISC_INT_TIMER3 BIT(9) 306#define MISC_INT_TIMER3 BIT(9)
@@ -341,6 +378,8 @@
341#define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 378#define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
342#define AR934X_BOOTSTRAP_DDR1 BIT(0) 379#define AR934X_BOOTSTRAP_DDR1 BIT(0)
343 380
381#define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
382
344#define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) 383#define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
345#define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1) 384#define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1)
346#define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) 385#define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)