blob: 7b4852416b68f74bb3f385b9d8c3e38d5ffe672b [file] [log] [blame]
Wills Wang833a1a82016-03-16 16:59:52 +08001/*
2 * Atheros AR71XX/AR724X/AR913X SoC register definitions
3 *
4 * Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com>
5 * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
6 * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
7 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8 *
9 * SPDX-License-Identifier: GPL-2.0+
10 */
11
12#ifndef __ASM_MACH_AR71XX_REGS_H
13#define __ASM_MACH_AR71XX_REGS_H
14
15#ifndef __ASSEMBLY__
16#include <linux/bitops.h>
17#else
18#ifndef BIT
Marek Vasutd04ad792016-05-06 20:10:34 +020019#define BIT(nr) (1 << (nr))
Wills Wang833a1a82016-03-16 16:59:52 +080020#endif
21#endif
22
Marek Vasutd04ad792016-05-06 20:10:34 +020023#define AR71XX_APB_BASE 0x18000000
24#define AR71XX_GE0_BASE 0x19000000
25#define AR71XX_GE0_SIZE 0x10000
26#define AR71XX_GE1_BASE 0x1a000000
27#define AR71XX_GE1_SIZE 0x10000
28#define AR71XX_EHCI_BASE 0x1b000000
29#define AR71XX_EHCI_SIZE 0x1000
30#define AR71XX_OHCI_BASE 0x1c000000
31#define AR71XX_OHCI_SIZE 0x1000
32#define AR71XX_SPI_BASE 0x1f000000
33#define AR71XX_SPI_SIZE 0x01000000
Wills Wang833a1a82016-03-16 16:59:52 +080034
Marek Vasutd04ad792016-05-06 20:10:34 +020035#define AR71XX_DDR_CTRL_BASE \
36 (AR71XX_APB_BASE + 0x00000000)
37#define AR71XX_DDR_CTRL_SIZE 0x100
38#define AR71XX_UART_BASE \
39 (AR71XX_APB_BASE + 0x00020000)
40#define AR71XX_UART_SIZE 0x100
41#define AR71XX_USB_CTRL_BASE \
42 (AR71XX_APB_BASE + 0x00030000)
43#define AR71XX_USB_CTRL_SIZE 0x100
44#define AR71XX_GPIO_BASE \
45 (AR71XX_APB_BASE + 0x00040000)
46#define AR71XX_GPIO_SIZE 0x100
47#define AR71XX_PLL_BASE \
48 (AR71XX_APB_BASE + 0x00050000)
49#define AR71XX_PLL_SIZE 0x100
50#define AR71XX_RESET_BASE \
51 (AR71XX_APB_BASE + 0x00060000)
52#define AR71XX_RESET_SIZE 0x100
53#define AR71XX_MII_BASE \
54 (AR71XX_APB_BASE + 0x00070000)
55#define AR71XX_MII_SIZE 0x100
Wills Wang833a1a82016-03-16 16:59:52 +080056
Marek Vasutd04ad792016-05-06 20:10:34 +020057#define AR71XX_PCI_MEM_BASE 0x10000000
58#define AR71XX_PCI_MEM_SIZE 0x07000000
Wills Wang833a1a82016-03-16 16:59:52 +080059
Marek Vasutd04ad792016-05-06 20:10:34 +020060#define AR71XX_PCI_WIN0_OFFS 0x10000000
61#define AR71XX_PCI_WIN1_OFFS 0x11000000
62#define AR71XX_PCI_WIN2_OFFS 0x12000000
63#define AR71XX_PCI_WIN3_OFFS 0x13000000
64#define AR71XX_PCI_WIN4_OFFS 0x14000000
65#define AR71XX_PCI_WIN5_OFFS 0x15000000
66#define AR71XX_PCI_WIN6_OFFS 0x16000000
67#define AR71XX_PCI_WIN7_OFFS 0x07000000
Wills Wang833a1a82016-03-16 16:59:52 +080068
69#define AR71XX_PCI_CFG_BASE \
70 (AR71XX_PCI_MEM_BASE + AR71XX_PCI_WIN7_OFFS + 0x10000)
Marek Vasutd04ad792016-05-06 20:10:34 +020071#define AR71XX_PCI_CFG_SIZE 0x100
Wills Wang833a1a82016-03-16 16:59:52 +080072
Marek Vasutd04ad792016-05-06 20:10:34 +020073#define AR7240_USB_CTRL_BASE \
74 (AR71XX_APB_BASE + 0x00030000)
75#define AR7240_USB_CTRL_SIZE 0x100
76#define AR7240_OHCI_BASE 0x1b000000
77#define AR7240_OHCI_SIZE 0x1000
Wills Wang833a1a82016-03-16 16:59:52 +080078
Marek Vasutd04ad792016-05-06 20:10:34 +020079#define AR724X_PCI_MEM_BASE 0x10000000
80#define AR724X_PCI_MEM_SIZE 0x04000000
Wills Wang833a1a82016-03-16 16:59:52 +080081
Marek Vasutd04ad792016-05-06 20:10:34 +020082#define AR724X_PCI_CFG_BASE 0x14000000
83#define AR724X_PCI_CFG_SIZE 0x1000
84#define AR724X_PCI_CRP_BASE \
85 (AR71XX_APB_BASE + 0x000c0000)
86#define AR724X_PCI_CRP_SIZE 0x1000
87#define AR724X_PCI_CTRL_BASE \
88 (AR71XX_APB_BASE + 0x000f0000)
89#define AR724X_PCI_CTRL_SIZE 0x100
Wills Wang833a1a82016-03-16 16:59:52 +080090
Marek Vasutd04ad792016-05-06 20:10:34 +020091#define AR724X_EHCI_BASE 0x1b000000
92#define AR724X_EHCI_SIZE 0x1000
Wills Wang833a1a82016-03-16 16:59:52 +080093
Marek Vasutd04ad792016-05-06 20:10:34 +020094#define AR913X_EHCI_BASE 0x1b000000
95#define AR913X_EHCI_SIZE 0x1000
96#define AR913X_WMAC_BASE \
97 (AR71XX_APB_BASE + 0x000C0000)
98#define AR913X_WMAC_SIZE 0x30000
Wills Wang833a1a82016-03-16 16:59:52 +080099
Marek Vasutd04ad792016-05-06 20:10:34 +0200100#define AR933X_UART_BASE \
101 (AR71XX_APB_BASE + 0x00020000)
102#define AR933X_UART_SIZE 0x14
103#define AR933X_GMAC_BASE \
104 (AR71XX_APB_BASE + 0x00070000)
105#define AR933X_GMAC_SIZE 0x04
106#define AR933X_WMAC_BASE \
107 (AR71XX_APB_BASE + 0x00100000)
108#define AR933X_WMAC_SIZE 0x20000
109#define AR933X_RTC_BASE \
110 (AR71XX_APB_BASE + 0x00107000)
111#define AR933X_RTC_SIZE 0x1000
112#define AR933X_EHCI_BASE 0x1b000000
113#define AR933X_EHCI_SIZE 0x1000
114#define AR933X_SRIF_BASE \
115 (AR71XX_APB_BASE + 0x00116000)
116#define AR933X_SRIF_SIZE 0x1000
Wills Wang833a1a82016-03-16 16:59:52 +0800117
Marek Vasutd04ad792016-05-06 20:10:34 +0200118#define AR934X_GMAC_BASE \
119 (AR71XX_APB_BASE + 0x00070000)
120#define AR934X_GMAC_SIZE 0x14
121#define AR934X_WMAC_BASE \
122 (AR71XX_APB_BASE + 0x00100000)
123#define AR934X_WMAC_SIZE 0x20000
124#define AR934X_EHCI_BASE 0x1b000000
125#define AR934X_EHCI_SIZE 0x200
126#define AR934X_NFC_BASE 0x1b000200
127#define AR934X_NFC_SIZE 0xb8
128#define AR934X_SRIF_BASE \
129 (AR71XX_APB_BASE + 0x00116000)
130#define AR934X_SRIF_SIZE 0x1000
Wills Wang833a1a82016-03-16 16:59:52 +0800131
Marek Vasutd04ad792016-05-06 20:10:34 +0200132#define QCA953X_GMAC_BASE \
133 (AR71XX_APB_BASE + 0x00070000)
134#define QCA953X_GMAC_SIZE 0x14
135#define QCA953X_WMAC_BASE \
136 (AR71XX_APB_BASE + 0x00100000)
137#define QCA953X_WMAC_SIZE 0x20000
138#define QCA953X_RTC_BASE \
139 (AR71XX_APB_BASE + 0x00107000)
140#define QCA953X_RTC_SIZE 0x1000
141#define QCA953X_EHCI_BASE 0x1b000000
142#define QCA953X_EHCI_SIZE 0x200
143#define QCA953X_SRIF_BASE \
144 (AR71XX_APB_BASE + 0x00116000)
145#define QCA953X_SRIF_SIZE 0x1000
Wills Wang833a1a82016-03-16 16:59:52 +0800146
Marek Vasutd04ad792016-05-06 20:10:34 +0200147#define QCA953X_PCI_CFG_BASE0 0x14000000
148#define QCA953X_PCI_CTRL_BASE0 \
149 (AR71XX_APB_BASE + 0x000f0000)
150#define QCA953X_PCI_CRP_BASE0 \
151 (AR71XX_APB_BASE + 0x000c0000)
152#define QCA953X_PCI_MEM_BASE0 0x10000000
153#define QCA953X_PCI_MEM_SIZE 0x02000000
Wills Wang833a1a82016-03-16 16:59:52 +0800154
Marek Vasutd04ad792016-05-06 20:10:34 +0200155#define QCA955X_PCI_MEM_BASE0 0x10000000
156#define QCA955X_PCI_MEM_BASE1 0x12000000
157#define QCA955X_PCI_MEM_SIZE 0x02000000
158#define QCA955X_PCI_CFG_BASE0 0x14000000
159#define QCA955X_PCI_CFG_BASE1 0x16000000
160#define QCA955X_PCI_CFG_SIZE 0x1000
161#define QCA955X_PCI_CRP_BASE0 \
162 (AR71XX_APB_BASE + 0x000c0000)
163#define QCA955X_PCI_CRP_BASE1 \
164 (AR71XX_APB_BASE + 0x00250000)
165#define QCA955X_PCI_CRP_SIZE 0x1000
166#define QCA955X_PCI_CTRL_BASE0 \
167 (AR71XX_APB_BASE + 0x000f0000)
168#define QCA955X_PCI_CTRL_BASE1 \
169 (AR71XX_APB_BASE + 0x00280000)
170#define QCA955X_PCI_CTRL_SIZE 0x100
Wills Wang833a1a82016-03-16 16:59:52 +0800171
Marek Vasutd04ad792016-05-06 20:10:34 +0200172#define QCA955X_GMAC_BASE \
173 (AR71XX_APB_BASE + 0x00070000)
174#define QCA955X_GMAC_SIZE 0x40
175#define QCA955X_WMAC_BASE \
176 (AR71XX_APB_BASE + 0x00100000)
177#define QCA955X_WMAC_SIZE 0x20000
178#define QCA955X_EHCI0_BASE 0x1b000000
179#define QCA955X_EHCI1_BASE 0x1b400000
180#define QCA955X_EHCI_SIZE 0x1000
181#define QCA955X_NFC_BASE 0x1b800200
182#define QCA955X_NFC_SIZE 0xb8
Wills Wang833a1a82016-03-16 16:59:52 +0800183
Marek Vasutd04ad792016-05-06 20:10:34 +0200184#define QCA956X_PCI_MEM_BASE1 0x12000000
185#define QCA956X_PCI_MEM_SIZE 0x02000000
186#define QCA956X_PCI_CFG_BASE1 0x16000000
187#define QCA956X_PCI_CFG_SIZE 0x1000
188#define QCA956X_PCI_CRP_BASE1 \
189 (AR71XX_APB_BASE + 0x00250000)
190#define QCA956X_PCI_CRP_SIZE 0x1000
191#define QCA956X_PCI_CTRL_BASE1 \
192 (AR71XX_APB_BASE + 0x00280000)
193#define QCA956X_PCI_CTRL_SIZE 0x100
Wills Wang833a1a82016-03-16 16:59:52 +0800194
Marek Vasutd04ad792016-05-06 20:10:34 +0200195#define QCA956X_WMAC_BASE \
196 (AR71XX_APB_BASE + 0x00100000)
197#define QCA956X_WMAC_SIZE 0x20000
198#define QCA956X_EHCI0_BASE 0x1b000000
199#define QCA956X_EHCI1_BASE 0x1b400000
200#define QCA956X_EHCI_SIZE 0x200
201#define QCA956X_GMAC_BASE \
202 (AR71XX_APB_BASE + 0x00070000)
203#define QCA956X_GMAC_SIZE 0x64
Wills Wang833a1a82016-03-16 16:59:52 +0800204
205/*
206 * DDR_CTRL block
207 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200208#define AR71XX_DDR_REG_CONFIG 0x00
209#define AR71XX_DDR_REG_CONFIG2 0x04
210#define AR71XX_DDR_REG_MODE 0x08
211#define AR71XX_DDR_REG_EMR 0x0c
212#define AR71XX_DDR_REG_CONTROL 0x10
213#define AR71XX_DDR_REG_REFRESH 0x14
214#define AR71XX_DDR_REG_RD_CYCLE 0x18
215#define AR71XX_DDR_REG_TAP_CTRL0 0x1c
216#define AR71XX_DDR_REG_TAP_CTRL1 0x20
Wills Wang833a1a82016-03-16 16:59:52 +0800217
Marek Vasutd04ad792016-05-06 20:10:34 +0200218#define AR71XX_DDR_REG_PCI_WIN0 0x7c
219#define AR71XX_DDR_REG_PCI_WIN1 0x80
220#define AR71XX_DDR_REG_PCI_WIN2 0x84
221#define AR71XX_DDR_REG_PCI_WIN3 0x88
222#define AR71XX_DDR_REG_PCI_WIN4 0x8c
223#define AR71XX_DDR_REG_PCI_WIN5 0x90
224#define AR71XX_DDR_REG_PCI_WIN6 0x94
225#define AR71XX_DDR_REG_PCI_WIN7 0x98
226#define AR71XX_DDR_REG_FLUSH_GE0 0x9c
227#define AR71XX_DDR_REG_FLUSH_GE1 0xa0
228#define AR71XX_DDR_REG_FLUSH_USB 0xa4
229#define AR71XX_DDR_REG_FLUSH_PCI 0xa8
Wills Wang833a1a82016-03-16 16:59:52 +0800230
Marek Vasutd04ad792016-05-06 20:10:34 +0200231#define AR724X_DDR_REG_FLUSH_GE0 0x7c
232#define AR724X_DDR_REG_FLUSH_GE1 0x80
233#define AR724X_DDR_REG_FLUSH_USB 0x84
234#define AR724X_DDR_REG_FLUSH_PCIE 0x88
Wills Wang833a1a82016-03-16 16:59:52 +0800235
Marek Vasutd04ad792016-05-06 20:10:34 +0200236#define AR913X_DDR_REG_FLUSH_GE0 0x7c
237#define AR913X_DDR_REG_FLUSH_GE1 0x80
238#define AR913X_DDR_REG_FLUSH_USB 0x84
239#define AR913X_DDR_REG_FLUSH_WMAC 0x88
Wills Wang833a1a82016-03-16 16:59:52 +0800240
Marek Vasutd04ad792016-05-06 20:10:34 +0200241#define AR933X_DDR_REG_FLUSH_GE0 0x7c
242#define AR933X_DDR_REG_FLUSH_GE1 0x80
243#define AR933X_DDR_REG_FLUSH_USB 0x84
244#define AR933X_DDR_REG_FLUSH_WMAC 0x88
245#define AR933X_DDR_REG_DDR2_CONFIG 0x8c
246#define AR933X_DDR_REG_EMR2 0x90
247#define AR933X_DDR_REG_EMR3 0x94
248#define AR933X_DDR_REG_BURST 0x98
249#define AR933X_DDR_REG_TIMEOUT_MAX 0x9c
250#define AR933X_DDR_REG_TIMEOUT_CNT 0x9c
251#define AR933X_DDR_REG_TIMEOUT_ADDR 0x9c
Wills Wang833a1a82016-03-16 16:59:52 +0800252
Marek Vasut6a713ea2016-05-06 20:10:40 +0200253#define AR934X_DDR_REG_TAP_CTRL2 0x24
254#define AR934X_DDR_REG_TAP_CTRL3 0x28
Marek Vasutd04ad792016-05-06 20:10:34 +0200255#define AR934X_DDR_REG_FLUSH_GE0 0x9c
256#define AR934X_DDR_REG_FLUSH_GE1 0xa0
257#define AR934X_DDR_REG_FLUSH_USB 0xa4
258#define AR934X_DDR_REG_FLUSH_PCIE 0xa8
259#define AR934X_DDR_REG_FLUSH_WMAC 0xac
Marek Vasut6a713ea2016-05-06 20:10:40 +0200260#define AR934X_DDR_REG_FLUSH_SRC1 0xb0
261#define AR934X_DDR_REG_FLUSH_SRC2 0xb4
262#define AR934X_DDR_REG_DDR2_CONFIG 0xb8
263#define AR934X_DDR_REG_EMR2 0xbc
264#define AR934X_DDR_REG_EMR3 0xc0
265#define AR934X_DDR_REG_BURST 0xc4
266#define AR934X_DDR_REG_BURST2 0xc8
267#define AR934X_DDR_REG_TIMEOUT_MAX 0xcc
268#define AR934X_DDR_REG_CTL_CONF 0x108
Wills Wang833a1a82016-03-16 16:59:52 +0800269
Marek Vasutd04ad792016-05-06 20:10:34 +0200270#define QCA953X_DDR_REG_FLUSH_GE0 0x9c
271#define QCA953X_DDR_REG_FLUSH_GE1 0xa0
272#define QCA953X_DDR_REG_FLUSH_USB 0xa4
273#define QCA953X_DDR_REG_FLUSH_PCIE 0xa8
274#define QCA953X_DDR_REG_FLUSH_WMAC 0xac
275#define QCA953X_DDR_REG_DDR2_CONFIG 0xb8
276#define QCA953X_DDR_REG_BURST 0xc4
277#define QCA953X_DDR_REG_BURST2 0xc8
278#define QCA953X_DDR_REG_TIMEOUT_MAX 0xcc
279#define QCA953X_DDR_REG_CTL_CONF 0x108
280#define QCA953X_DDR_REG_CONFIG3 0x15c
Wills Wang833a1a82016-03-16 16:59:52 +0800281
282/*
283 * PLL block
284 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200285#define AR71XX_PLL_REG_CPU_CONFIG 0x00
286#define AR71XX_PLL_REG_SEC_CONFIG 0x04
287#define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10
288#define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14
Wills Wang833a1a82016-03-16 16:59:52 +0800289
Marek Vasutd04ad792016-05-06 20:10:34 +0200290#define AR71XX_PLL_DIV_SHIFT 3
291#define AR71XX_PLL_DIV_MASK 0x1f
292#define AR71XX_CPU_DIV_SHIFT 16
293#define AR71XX_CPU_DIV_MASK 0x3
294#define AR71XX_DDR_DIV_SHIFT 18
295#define AR71XX_DDR_DIV_MASK 0x3
296#define AR71XX_AHB_DIV_SHIFT 20
297#define AR71XX_AHB_DIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800298
Marek Vasutd04ad792016-05-06 20:10:34 +0200299#define AR71XX_ETH0_PLL_SHIFT 17
300#define AR71XX_ETH1_PLL_SHIFT 19
Wills Wang833a1a82016-03-16 16:59:52 +0800301
Marek Vasutd04ad792016-05-06 20:10:34 +0200302#define AR724X_PLL_REG_CPU_CONFIG 0x00
303#define AR724X_PLL_REG_PCIE_CONFIG 0x18
Wills Wang833a1a82016-03-16 16:59:52 +0800304
Marek Vasutd04ad792016-05-06 20:10:34 +0200305#define AR724X_PLL_DIV_SHIFT 0
306#define AR724X_PLL_DIV_MASK 0x3ff
307#define AR724X_PLL_REF_DIV_SHIFT 10
308#define AR724X_PLL_REF_DIV_MASK 0xf
309#define AR724X_AHB_DIV_SHIFT 19
310#define AR724X_AHB_DIV_MASK 0x1
311#define AR724X_DDR_DIV_SHIFT 22
312#define AR724X_DDR_DIV_MASK 0x3
Wills Wang833a1a82016-03-16 16:59:52 +0800313
Marek Vasutd04ad792016-05-06 20:10:34 +0200314#define AR7242_PLL_REG_ETH0_INT_CLOCK 0x2c
Wills Wang833a1a82016-03-16 16:59:52 +0800315
Marek Vasutd04ad792016-05-06 20:10:34 +0200316#define AR913X_PLL_REG_CPU_CONFIG 0x00
317#define AR913X_PLL_REG_ETH_CONFIG 0x04
318#define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14
319#define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18
Wills Wang833a1a82016-03-16 16:59:52 +0800320
Marek Vasutd04ad792016-05-06 20:10:34 +0200321#define AR913X_PLL_DIV_SHIFT 0
322#define AR913X_PLL_DIV_MASK 0x3ff
323#define AR913X_DDR_DIV_SHIFT 22
324#define AR913X_DDR_DIV_MASK 0x3
325#define AR913X_AHB_DIV_SHIFT 19
326#define AR913X_AHB_DIV_MASK 0x1
Wills Wang833a1a82016-03-16 16:59:52 +0800327
Marek Vasutd04ad792016-05-06 20:10:34 +0200328#define AR913X_ETH0_PLL_SHIFT 20
329#define AR913X_ETH1_PLL_SHIFT 22
Wills Wang833a1a82016-03-16 16:59:52 +0800330
Marek Vasutd04ad792016-05-06 20:10:34 +0200331#define AR933X_PLL_CPU_CONFIG_REG 0x00
332#define AR933X_PLL_CLK_CTRL_REG 0x08
333#define AR933X_PLL_DITHER_FRAC_REG 0x10
Wills Wang8958f562016-05-30 22:54:54 +0800334#define AR933X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24
Wills Wang833a1a82016-03-16 16:59:52 +0800335
Marek Vasutd04ad792016-05-06 20:10:34 +0200336#define AR933X_PLL_CPU_CONFIG_NINT_SHIFT 10
337#define AR933X_PLL_CPU_CONFIG_NINT_MASK 0x3f
338#define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT 16
339#define AR933X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
340#define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT 23
341#define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800342
Marek Vasutd04ad792016-05-06 20:10:34 +0200343#define AR933X_PLL_CLK_CTRL_BYPASS BIT(2)
344#define AR933X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5
345#define AR933X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x3
346#define AR933X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10
347#define AR933X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x3
348#define AR933X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15
349#define AR933X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800350
Marek Vasutd04ad792016-05-06 20:10:34 +0200351#define AR934X_PLL_CPU_CONFIG_REG 0x00
352#define AR934X_PLL_DDR_CONFIG_REG 0x04
353#define AR934X_PLL_CPU_DDR_CLK_CTRL_REG 0x08
354#define AR934X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24
355#define AR934X_PLL_ETH_XMII_CONTROL_REG 0x2c
Marek Vasut6a713ea2016-05-06 20:10:40 +0200356#define AR934X_PLL_DDR_DIT_FRAC_REG 0x44
357#define AR934X_PLL_CPU_DIT_FRAC_REG 0x48
Wills Wang833a1a82016-03-16 16:59:52 +0800358
Marek Vasutd04ad792016-05-06 20:10:34 +0200359#define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0
360#define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f
361#define AR934X_PLL_CPU_CONFIG_NINT_SHIFT 6
362#define AR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f
363#define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
364#define AR934X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
Marek Vasut6a713ea2016-05-06 20:10:40 +0200365#define AR934X_PLL_CPU_CONFIG_RANGE_SHIFT 17
366#define AR934X_PLL_CPU_CONFIG_RANGE_MASK 0x3
Marek Vasutd04ad792016-05-06 20:10:34 +0200367#define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
368#define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3
Marek Vasut6a713ea2016-05-06 20:10:40 +0200369#define AR934X_PLL_CPU_CONFIG_PLLPWD BIT(30)
370#define AR934X_PLL_CPU_CONFIG_UPDATING BIT(31)
Wills Wang833a1a82016-03-16 16:59:52 +0800371
Marek Vasutd04ad792016-05-06 20:10:34 +0200372#define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
373#define AR934X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
374#define AR934X_PLL_DDR_CONFIG_NINT_SHIFT 10
375#define AR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f
376#define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT 16
377#define AR934X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f
Marek Vasut6a713ea2016-05-06 20:10:40 +0200378#define AR934X_PLL_DDR_CONFIG_RANGE_SHIFT 21
379#define AR934X_PLL_DDR_CONFIG_RANGE_MASK 0x3
Marek Vasutd04ad792016-05-06 20:10:34 +0200380#define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23
381#define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7
Marek Vasut6a713ea2016-05-06 20:10:40 +0200382#define AR934X_PLL_DDR_CONFIG_PLLPWD BIT(30)
383#define AR934X_PLL_DDR_CONFIG_UPDATING BIT(31)
Wills Wang833a1a82016-03-16 16:59:52 +0800384
Marek Vasutd04ad792016-05-06 20:10:34 +0200385#define AR934X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2)
386#define AR934X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3)
387#define AR934X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4)
388#define AR934X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5
389#define AR934X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f
390#define AR934X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10
391#define AR934X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f
392#define AR934X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15
393#define AR934X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f
394#define AR934X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20)
395#define AR934X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
396#define AR934X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
Wills Wang833a1a82016-03-16 16:59:52 +0800397
Marek Vasutd04ad792016-05-06 20:10:34 +0200398#define AR934X_PLL_SWITCH_CLK_CTRL_MDIO_CLK_SEL BIT(6)
Wills Wang833a1a82016-03-16 16:59:52 +0800399
Marek Vasut6a713ea2016-05-06 20:10:40 +0200400#define AR934X_PLL_DDR_DIT_FRAC_MAX_SHIFT 0
401#define AR934X_PLL_DDR_DIT_FRAC_MAX_MASK 0x3ff
402#define AR934X_PLL_DDR_DIT_FRAC_MIN_SHIFT 10
403#define AR934X_PLL_DDR_DIT_FRAC_MIN_MASK 0x3ff
404#define AR934X_PLL_DDR_DIT_FRAC_STEP_SHIFT 20
405#define AR934X_PLL_DDR_DIT_FRAC_STEP_MASK 0x3f
406#define AR934X_PLL_DDR_DIT_UPD_CNT_SHIFT 27
407#define AR934X_PLL_DDR_DIT_UPD_CNT_MASK 0x3f
408#define AR934X_PLL_DDR_DIT_DITHER_EN BIT(31)
409
410#define AR934X_PLL_CPU_DIT_FRAC_MAX_SHIFT 0
411#define AR934X_PLL_CPU_DIT_FRAC_MAX_MASK 0x3f
412#define AR934X_PLL_CPU_DIT_FRAC_MIN_SHIFT 6
413#define AR934X_PLL_CPU_DIT_FRAC_MIN_MASK 0x3f
414#define AR934X_PLL_CPU_DIT_FRAC_STEP_SHIFT 12
415#define AR934X_PLL_CPU_DIT_FRAC_STEP_MASK 0x3f
416#define AR934X_PLL_CPU_DIT_UPD_CNT_SHIFT 18
417#define AR934X_PLL_CPU_DIT_UPD_CNT_MASK 0x3f
418#define AR934X_PLL_CPU_DIT_DITHER_EN BIT(31)
419
Marek Vasutd04ad792016-05-06 20:10:34 +0200420#define QCA953X_PLL_CPU_CONFIG_REG 0x00
421#define QCA953X_PLL_DDR_CONFIG_REG 0x04
422#define QCA953X_PLL_CLK_CTRL_REG 0x08
423#define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24
424#define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c
425#define QCA953X_PLL_DDR_DIT_FRAC_REG 0x44
426#define QCA953X_PLL_CPU_DIT_FRAC_REG 0x48
Wills Wang833a1a82016-03-16 16:59:52 +0800427
Marek Vasutd04ad792016-05-06 20:10:34 +0200428#define QCA953X_PLL_CPU_CONFIG_NFRAC_SHIFT 0
429#define QCA953X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f
430#define QCA953X_PLL_CPU_CONFIG_NINT_SHIFT 6
431#define QCA953X_PLL_CPU_CONFIG_NINT_MASK 0x3f
432#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
433#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
434#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
435#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800436
Marek Vasutd04ad792016-05-06 20:10:34 +0200437#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
438#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
439#define QCA953X_PLL_DDR_CONFIG_NINT_SHIFT 10
440#define QCA953X_PLL_DDR_CONFIG_NINT_MASK 0x3f
441#define QCA953X_PLL_DDR_CONFIG_REFDIV_SHIFT 16
442#define QCA953X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f
443#define QCA953X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23
444#define QCA953X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800445
Marek Vasutd04ad792016-05-06 20:10:34 +0200446#define QCA953X_PLL_CONFIG_PWD BIT(30)
Wills Wang833a1a82016-03-16 16:59:52 +0800447
Marek Vasutd04ad792016-05-06 20:10:34 +0200448#define QCA953X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2)
449#define QCA953X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3)
450#define QCA953X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4)
451#define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5
452#define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f
453#define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10
454#define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f
455#define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15
456#define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f
457#define QCA953X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20)
458#define QCA953X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
459#define QCA953X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
Wills Wang833a1a82016-03-16 16:59:52 +0800460
Marek Vasutd04ad792016-05-06 20:10:34 +0200461#define QCA953X_PLL_CPU_DIT_FRAC_MAX_SHIFT 0
462#define QCA953X_PLL_CPU_DIT_FRAC_MAX_MASK 0x3f
463#define QCA953X_PLL_CPU_DIT_FRAC_MIN_SHIFT 6
464#define QCA953X_PLL_CPU_DIT_FRAC_MIN_MASK 0x3f
465#define QCA953X_PLL_CPU_DIT_FRAC_STEP_SHIFT 12
466#define QCA953X_PLL_CPU_DIT_FRAC_STEP_MASK 0x3f
467#define QCA953X_PLL_CPU_DIT_UPD_CNT_SHIFT 18
468#define QCA953X_PLL_CPU_DIT_UPD_CNT_MASK 0x3f
Wills Wang833a1a82016-03-16 16:59:52 +0800469
Marek Vasutd04ad792016-05-06 20:10:34 +0200470#define QCA953X_PLL_DDR_DIT_FRAC_MAX_SHIFT 0
471#define QCA953X_PLL_DDR_DIT_FRAC_MAX_MASK 0x3ff
472#define QCA953X_PLL_DDR_DIT_FRAC_MIN_SHIFT 9
473#define QCA953X_PLL_DDR_DIT_FRAC_MIN_MASK 0x3ff
474#define QCA953X_PLL_DDR_DIT_FRAC_STEP_SHIFT 20
475#define QCA953X_PLL_DDR_DIT_FRAC_STEP_MASK 0x3f
476#define QCA953X_PLL_DDR_DIT_UPD_CNT_SHIFT 27
477#define QCA953X_PLL_DDR_DIT_UPD_CNT_MASK 0x3f
Wills Wang833a1a82016-03-16 16:59:52 +0800478
Marek Vasutd04ad792016-05-06 20:10:34 +0200479#define QCA953X_PLL_DIT_FRAC_EN BIT(31)
Wills Wang833a1a82016-03-16 16:59:52 +0800480
Marek Vasutd04ad792016-05-06 20:10:34 +0200481#define QCA955X_PLL_CPU_CONFIG_REG 0x00
482#define QCA955X_PLL_DDR_CONFIG_REG 0x04
483#define QCA955X_PLL_CLK_CTRL_REG 0x08
484#define QCA955X_PLL_ETH_XMII_CONTROL_REG 0x28
485#define QCA955X_PLL_ETH_SGMII_CONTROL_REG 0x48
Wills Wang833a1a82016-03-16 16:59:52 +0800486
Marek Vasutd04ad792016-05-06 20:10:34 +0200487#define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT 0
488#define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f
489#define QCA955X_PLL_CPU_CONFIG_NINT_SHIFT 6
490#define QCA955X_PLL_CPU_CONFIG_NINT_MASK 0x3f
491#define QCA955X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
492#define QCA955X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
493#define QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
494#define QCA955X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3
Wills Wang833a1a82016-03-16 16:59:52 +0800495
Marek Vasutd04ad792016-05-06 20:10:34 +0200496#define QCA955X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
497#define QCA955X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
498#define QCA955X_PLL_DDR_CONFIG_NINT_SHIFT 10
499#define QCA955X_PLL_DDR_CONFIG_NINT_MASK 0x3f
500#define QCA955X_PLL_DDR_CONFIG_REFDIV_SHIFT 16
501#define QCA955X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f
502#define QCA955X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23
503#define QCA955X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800504
Marek Vasutd04ad792016-05-06 20:10:34 +0200505#define QCA955X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2)
506#define QCA955X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3)
507#define QCA955X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4)
508#define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5
509#define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f
510#define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10
511#define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f
512#define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15
513#define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f
514#define QCA955X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20)
515#define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
516#define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
Wills Wang833a1a82016-03-16 16:59:52 +0800517
Marek Vasutd04ad792016-05-06 20:10:34 +0200518#define QCA956X_PLL_CPU_CONFIG_REG 0x00
519#define QCA956X_PLL_CPU_CONFIG1_REG 0x04
520#define QCA956X_PLL_DDR_CONFIG_REG 0x08
521#define QCA956X_PLL_DDR_CONFIG1_REG 0x0c
522#define QCA956X_PLL_CLK_CTRL_REG 0x10
Wills Wang833a1a82016-03-16 16:59:52 +0800523
Marek Vasutd04ad792016-05-06 20:10:34 +0200524#define QCA956X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
525#define QCA956X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
526#define QCA956X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
527#define QCA956X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800528
Marek Vasutd04ad792016-05-06 20:10:34 +0200529#define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_SHIFT 0
530#define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_MASK 0x1f
531#define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_SHIFT 5
532#define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_MASK 0x3fff
533#define QCA956X_PLL_CPU_CONFIG1_NINT_SHIFT 18
534#define QCA956X_PLL_CPU_CONFIG1_NINT_MASK 0x1ff
Wills Wang833a1a82016-03-16 16:59:52 +0800535
Marek Vasutd04ad792016-05-06 20:10:34 +0200536#define QCA956X_PLL_DDR_CONFIG_REFDIV_SHIFT 16
537#define QCA956X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f
538#define QCA956X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23
539#define QCA956X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +0800540
Marek Vasutd04ad792016-05-06 20:10:34 +0200541#define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_SHIFT 0
542#define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_MASK 0x1f
543#define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_SHIFT 5
544#define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_MASK 0x3fff
545#define QCA956X_PLL_DDR_CONFIG1_NINT_SHIFT 18
546#define QCA956X_PLL_DDR_CONFIG1_NINT_MASK 0x1ff
Wills Wang833a1a82016-03-16 16:59:52 +0800547
Marek Vasutd04ad792016-05-06 20:10:34 +0200548#define QCA956X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2)
549#define QCA956X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3)
550#define QCA956X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4)
551#define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5
552#define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f
553#define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10
554#define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f
555#define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15
556#define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f
557#define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_DDRPLL BIT(20)
558#define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_CPUPLL BIT(21)
559#define QCA956X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
Wills Wang833a1a82016-03-16 16:59:52 +0800560
561/*
562 * USB_CONFIG block
563 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200564#define AR71XX_USB_CTRL_REG_FLADJ 0x00
565#define AR71XX_USB_CTRL_REG_CONFIG 0x04
Wills Wang833a1a82016-03-16 16:59:52 +0800566
567/*
568 * RESET block
569 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200570#define AR71XX_RESET_REG_TIMER 0x00
571#define AR71XX_RESET_REG_TIMER_RELOAD 0x04
572#define AR71XX_RESET_REG_WDOG_CTRL 0x08
573#define AR71XX_RESET_REG_WDOG 0x0c
574#define AR71XX_RESET_REG_MISC_INT_STATUS 0x10
575#define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14
576#define AR71XX_RESET_REG_PCI_INT_STATUS 0x18
577#define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c
578#define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20
579#define AR71XX_RESET_REG_RESET_MODULE 0x24
580#define AR71XX_RESET_REG_PERFC_CTRL 0x2c
581#define AR71XX_RESET_REG_PERFC0 0x30
582#define AR71XX_RESET_REG_PERFC1 0x34
583#define AR71XX_RESET_REG_REV_ID 0x90
Wills Wang833a1a82016-03-16 16:59:52 +0800584
Marek Vasutd04ad792016-05-06 20:10:34 +0200585#define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18
586#define AR913X_RESET_REG_RESET_MODULE 0x1c
587#define AR913X_RESET_REG_PERF_CTRL 0x20
588#define AR913X_RESET_REG_PERFC0 0x24
589#define AR913X_RESET_REG_PERFC1 0x28
Wills Wang833a1a82016-03-16 16:59:52 +0800590
Marek Vasutd04ad792016-05-06 20:10:34 +0200591#define AR724X_RESET_REG_RESET_MODULE 0x1c
Wills Wang833a1a82016-03-16 16:59:52 +0800592
Marek Vasutd04ad792016-05-06 20:10:34 +0200593#define AR933X_RESET_REG_RESET_MODULE 0x1c
594#define AR933X_RESET_REG_BOOTSTRAP 0xac
Wills Wang833a1a82016-03-16 16:59:52 +0800595
Marek Vasutd04ad792016-05-06 20:10:34 +0200596#define AR934X_RESET_REG_RESET_MODULE 0x1c
597#define AR934X_RESET_REG_BOOTSTRAP 0xb0
598#define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
Wills Wang833a1a82016-03-16 16:59:52 +0800599
Marek Vasutd04ad792016-05-06 20:10:34 +0200600#define QCA953X_RESET_REG_RESET_MODULE 0x1c
601#define QCA953X_RESET_REG_BOOTSTRAP 0xb0
602#define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
Wills Wang833a1a82016-03-16 16:59:52 +0800603
Marek Vasutd04ad792016-05-06 20:10:34 +0200604#define QCA955X_RESET_REG_RESET_MODULE 0x1c
605#define QCA955X_RESET_REG_BOOTSTRAP 0xb0
606#define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
Wills Wang833a1a82016-03-16 16:59:52 +0800607
Marek Vasutd04ad792016-05-06 20:10:34 +0200608#define QCA956X_RESET_REG_RESET_MODULE 0x1c
609#define QCA956X_RESET_REG_BOOTSTRAP 0xb0
610#define QCA956X_RESET_REG_EXT_INT_STATUS 0xac
Wills Wang833a1a82016-03-16 16:59:52 +0800611
Marek Vasutd04ad792016-05-06 20:10:34 +0200612#define MISC_INT_MIPS_SI_TIMERINT_MASK BIT(28)
613#define MISC_INT_ETHSW BIT(12)
614#define MISC_INT_TIMER4 BIT(10)
615#define MISC_INT_TIMER3 BIT(9)
616#define MISC_INT_TIMER2 BIT(8)
617#define MISC_INT_DMA BIT(7)
618#define MISC_INT_OHCI BIT(6)
619#define MISC_INT_PERFC BIT(5)
620#define MISC_INT_WDOG BIT(4)
621#define MISC_INT_UART BIT(3)
622#define MISC_INT_GPIO BIT(2)
623#define MISC_INT_ERROR BIT(1)
624#define MISC_INT_TIMER BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800625
Marek Vasutd04ad792016-05-06 20:10:34 +0200626#define AR71XX_RESET_EXTERNAL BIT(28)
627#define AR71XX_RESET_FULL_CHIP BIT(24)
628#define AR71XX_RESET_CPU_NMI BIT(21)
629#define AR71XX_RESET_CPU_COLD BIT(20)
630#define AR71XX_RESET_DMA BIT(19)
631#define AR71XX_RESET_SLIC BIT(18)
632#define AR71XX_RESET_STEREO BIT(17)
633#define AR71XX_RESET_DDR BIT(16)
634#define AR71XX_RESET_GE1_MAC BIT(13)
635#define AR71XX_RESET_GE1_PHY BIT(12)
636#define AR71XX_RESET_USBSUS_OVERRIDE BIT(10)
637#define AR71XX_RESET_GE0_MAC BIT(9)
638#define AR71XX_RESET_GE0_PHY BIT(8)
639#define AR71XX_RESET_USB_OHCI_DLL BIT(6)
640#define AR71XX_RESET_USB_HOST BIT(5)
641#define AR71XX_RESET_USB_PHY BIT(4)
642#define AR71XX_RESET_PCI_BUS BIT(1)
643#define AR71XX_RESET_PCI_CORE BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800644
Marek Vasutd04ad792016-05-06 20:10:34 +0200645#define AR7240_RESET_USB_HOST BIT(5)
646#define AR7240_RESET_OHCI_DLL BIT(3)
Wills Wang833a1a82016-03-16 16:59:52 +0800647
Marek Vasutd04ad792016-05-06 20:10:34 +0200648#define AR724X_RESET_GE1_MDIO BIT(23)
649#define AR724X_RESET_GE0_MDIO BIT(22)
650#define AR724X_RESET_PCIE_PHY_SERIAL BIT(10)
651#define AR724X_RESET_PCIE_PHY BIT(7)
652#define AR724X_RESET_PCIE BIT(6)
653#define AR724X_RESET_USB_HOST BIT(5)
654#define AR724X_RESET_USB_PHY BIT(4)
655#define AR724X_RESET_USBSUS_OVERRIDE BIT(3)
Wills Wang833a1a82016-03-16 16:59:52 +0800656
Marek Vasutd04ad792016-05-06 20:10:34 +0200657#define AR913X_RESET_AMBA2WMAC BIT(22)
658#define AR913X_RESET_USBSUS_OVERRIDE BIT(10)
659#define AR913X_RESET_USB_HOST BIT(5)
660#define AR913X_RESET_USB_PHY BIT(4)
Wills Wang833a1a82016-03-16 16:59:52 +0800661
Marek Vasutd04ad792016-05-06 20:10:34 +0200662#define AR933X_RESET_GE1_MDIO BIT(23)
663#define AR933X_RESET_GE0_MDIO BIT(22)
Wills Wang52872452016-05-22 11:59:50 +0800664#define AR933X_RESET_ETH_SWITCH_ANALOG BIT(14)
Marek Vasutd04ad792016-05-06 20:10:34 +0200665#define AR933X_RESET_GE1_MAC BIT(13)
666#define AR933X_RESET_WMAC BIT(11)
667#define AR933X_RESET_GE0_MAC BIT(9)
Marek Vasutc06cdad2016-05-06 20:10:39 +0200668#define AR933X_RESET_ETH_SWITCH BIT(8)
Marek Vasutd04ad792016-05-06 20:10:34 +0200669#define AR933X_RESET_USB_HOST BIT(5)
670#define AR933X_RESET_USB_PHY BIT(4)
671#define AR933X_RESET_USBSUS_OVERRIDE BIT(3)
Wills Wang833a1a82016-03-16 16:59:52 +0800672
Marek Vasutd04ad792016-05-06 20:10:34 +0200673#define AR934X_RESET_HOST BIT(31)
674#define AR934X_RESET_SLIC BIT(30)
675#define AR934X_RESET_HDMA BIT(29)
676#define AR934X_RESET_EXTERNAL BIT(28)
677#define AR934X_RESET_RTC BIT(27)
678#define AR934X_RESET_PCIE_EP_INT BIT(26)
679#define AR934X_RESET_CHKSUM_ACC BIT(25)
680#define AR934X_RESET_FULL_CHIP BIT(24)
681#define AR934X_RESET_GE1_MDIO BIT(23)
682#define AR934X_RESET_GE0_MDIO BIT(22)
683#define AR934X_RESET_CPU_NMI BIT(21)
684#define AR934X_RESET_CPU_COLD BIT(20)
685#define AR934X_RESET_HOST_RESET_INT BIT(19)
686#define AR934X_RESET_PCIE_EP BIT(18)
687#define AR934X_RESET_UART1 BIT(17)
688#define AR934X_RESET_DDR BIT(16)
689#define AR934X_RESET_USB_PHY_PLL_PWD_EXT BIT(15)
690#define AR934X_RESET_NANDF BIT(14)
691#define AR934X_RESET_GE1_MAC BIT(13)
692#define AR934X_RESET_ETH_SWITCH_ANALOG BIT(12)
693#define AR934X_RESET_USB_PHY_ANALOG BIT(11)
694#define AR934X_RESET_HOST_DMA_INT BIT(10)
695#define AR934X_RESET_GE0_MAC BIT(9)
696#define AR934X_RESET_ETH_SWITCH BIT(8)
697#define AR934X_RESET_PCIE_PHY BIT(7)
698#define AR934X_RESET_PCIE BIT(6)
699#define AR934X_RESET_USB_HOST BIT(5)
700#define AR934X_RESET_USB_PHY BIT(4)
701#define AR934X_RESET_USBSUS_OVERRIDE BIT(3)
702#define AR934X_RESET_LUT BIT(2)
703#define AR934X_RESET_MBOX BIT(1)
704#define AR934X_RESET_I2S BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800705
Marek Vasutd04ad792016-05-06 20:10:34 +0200706#define QCA953X_RESET_USB_EXT_PWR BIT(29)
707#define QCA953X_RESET_EXTERNAL BIT(28)
708#define QCA953X_RESET_RTC BIT(27)
709#define QCA953X_RESET_FULL_CHIP BIT(24)
710#define QCA953X_RESET_GE1_MDIO BIT(23)
711#define QCA953X_RESET_GE0_MDIO BIT(22)
712#define QCA953X_RESET_CPU_NMI BIT(21)
713#define QCA953X_RESET_CPU_COLD BIT(20)
714#define QCA953X_RESET_DDR BIT(16)
715#define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15)
716#define QCA953X_RESET_GE1_MAC BIT(13)
717#define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12)
718#define QCA953X_RESET_USB_PHY_ANALOG BIT(11)
719#define QCA953X_RESET_GE0_MAC BIT(9)
720#define QCA953X_RESET_ETH_SWITCH BIT(8)
721#define QCA953X_RESET_PCIE_PHY BIT(7)
722#define QCA953X_RESET_PCIE BIT(6)
723#define QCA953X_RESET_USB_HOST BIT(5)
724#define QCA953X_RESET_USB_PHY BIT(4)
725#define QCA953X_RESET_USBSUS_OVERRIDE BIT(3)
Wills Wang833a1a82016-03-16 16:59:52 +0800726
Marek Vasutd04ad792016-05-06 20:10:34 +0200727#define QCA955X_RESET_HOST BIT(31)
728#define QCA955X_RESET_SLIC BIT(30)
729#define QCA955X_RESET_HDMA BIT(29)
730#define QCA955X_RESET_EXTERNAL BIT(28)
731#define QCA955X_RESET_RTC BIT(27)
732#define QCA955X_RESET_PCIE_EP_INT BIT(26)
733#define QCA955X_RESET_CHKSUM_ACC BIT(25)
734#define QCA955X_RESET_FULL_CHIP BIT(24)
735#define QCA955X_RESET_GE1_MDIO BIT(23)
736#define QCA955X_RESET_GE0_MDIO BIT(22)
737#define QCA955X_RESET_CPU_NMI BIT(21)
738#define QCA955X_RESET_CPU_COLD BIT(20)
739#define QCA955X_RESET_HOST_RESET_INT BIT(19)
740#define QCA955X_RESET_PCIE_EP BIT(18)
741#define QCA955X_RESET_UART1 BIT(17)
742#define QCA955X_RESET_DDR BIT(16)
743#define QCA955X_RESET_USB_PHY_PLL_PWD_EXT BIT(15)
744#define QCA955X_RESET_NANDF BIT(14)
745#define QCA955X_RESET_GE1_MAC BIT(13)
746#define QCA955X_RESET_SGMII_ANALOG BIT(12)
747#define QCA955X_RESET_USB_PHY_ANALOG BIT(11)
748#define QCA955X_RESET_HOST_DMA_INT BIT(10)
749#define QCA955X_RESET_GE0_MAC BIT(9)
750#define QCA955X_RESET_SGMII BIT(8)
751#define QCA955X_RESET_PCIE_PHY BIT(7)
752#define QCA955X_RESET_PCIE BIT(6)
753#define QCA955X_RESET_USB_HOST BIT(5)
754#define QCA955X_RESET_USB_PHY BIT(4)
755#define QCA955X_RESET_USBSUS_OVERRIDE BIT(3)
756#define QCA955X_RESET_LUT BIT(2)
757#define QCA955X_RESET_MBOX BIT(1)
758#define QCA955X_RESET_I2S BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800759
Marek Vasutd04ad792016-05-06 20:10:34 +0200760#define AR933X_BOOTSTRAP_MDIO_GPIO_EN BIT(18)
761#define AR933X_BOOTSTRAP_DDR2 BIT(13)
762#define AR933X_BOOTSTRAP_EEPBUSY BIT(4)
763#define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800764
Marek Vasutd04ad792016-05-06 20:10:34 +0200765#define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23)
766#define AR934X_BOOTSTRAP_SW_OPTION7 BIT(22)
767#define AR934X_BOOTSTRAP_SW_OPTION6 BIT(21)
768#define AR934X_BOOTSTRAP_SW_OPTION5 BIT(20)
769#define AR934X_BOOTSTRAP_SW_OPTION4 BIT(19)
770#define AR934X_BOOTSTRAP_SW_OPTION3 BIT(18)
771#define AR934X_BOOTSTRAP_SW_OPTION2 BIT(17)
772#define AR934X_BOOTSTRAP_SW_OPTION1 BIT(16)
773#define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7)
774#define AR934X_BOOTSTRAP_PCIE_RC BIT(6)
775#define AR934X_BOOTSTRAP_EJTAG_MODE BIT(5)
776#define AR934X_BOOTSTRAP_REF_CLK_40 BIT(4)
777#define AR934X_BOOTSTRAP_BOOT_FROM_SPI BIT(2)
778#define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
779#define AR934X_BOOTSTRAP_DDR1 BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800780
Marek Vasutd04ad792016-05-06 20:10:34 +0200781#define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12)
782#define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11)
783#define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5)
784#define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4)
785#define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
786#define QCA953X_BOOTSTRAP_DDR1 BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800787
Marek Vasutd04ad792016-05-06 20:10:34 +0200788#define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
Wills Wang833a1a82016-03-16 16:59:52 +0800789
Marek Vasutd04ad792016-05-06 20:10:34 +0200790#define QCA956X_BOOTSTRAP_REF_CLK_40 BIT(2)
Wills Wang833a1a82016-03-16 16:59:52 +0800791
Marek Vasutd04ad792016-05-06 20:10:34 +0200792#define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
793#define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1)
794#define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
795#define AR934X_PCIE_WMAC_INT_WMAC_RXHP BIT(3)
796#define AR934X_PCIE_WMAC_INT_PCIE_RC BIT(4)
797#define AR934X_PCIE_WMAC_INT_PCIE_RC0 BIT(5)
798#define AR934X_PCIE_WMAC_INT_PCIE_RC1 BIT(6)
799#define AR934X_PCIE_WMAC_INT_PCIE_RC2 BIT(7)
800#define AR934X_PCIE_WMAC_INT_PCIE_RC3 BIT(8)
Wills Wang833a1a82016-03-16 16:59:52 +0800801#define AR934X_PCIE_WMAC_INT_WMAC_ALL \
802 (AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \
803 AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP)
804
805#define AR934X_PCIE_WMAC_INT_PCIE_ALL \
806 (AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \
807 AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \
808 AR934X_PCIE_WMAC_INT_PCIE_RC3)
809
Marek Vasutd04ad792016-05-06 20:10:34 +0200810#define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
811#define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1)
812#define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
813#define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3)
814#define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4)
815#define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5)
816#define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6)
817#define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7)
818#define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8)
Wills Wang833a1a82016-03-16 16:59:52 +0800819#define QCA953X_PCIE_WMAC_INT_WMAC_ALL \
820 (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \
821 QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP)
822
823#define QCA953X_PCIE_WMAC_INT_PCIE_ALL \
824 (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \
825 QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \
826 QCA953X_PCIE_WMAC_INT_PCIE_RC3)
827
Marek Vasutd04ad792016-05-06 20:10:34 +0200828#define QCA955X_EXT_INT_WMAC_MISC BIT(0)
829#define QCA955X_EXT_INT_WMAC_TX BIT(1)
830#define QCA955X_EXT_INT_WMAC_RXLP BIT(2)
831#define QCA955X_EXT_INT_WMAC_RXHP BIT(3)
832#define QCA955X_EXT_INT_PCIE_RC1 BIT(4)
833#define QCA955X_EXT_INT_PCIE_RC1_INT0 BIT(5)
834#define QCA955X_EXT_INT_PCIE_RC1_INT1 BIT(6)
835#define QCA955X_EXT_INT_PCIE_RC1_INT2 BIT(7)
836#define QCA955X_EXT_INT_PCIE_RC1_INT3 BIT(8)
837#define QCA955X_EXT_INT_PCIE_RC2 BIT(12)
838#define QCA955X_EXT_INT_PCIE_RC2_INT0 BIT(13)
839#define QCA955X_EXT_INT_PCIE_RC2_INT1 BIT(14)
840#define QCA955X_EXT_INT_PCIE_RC2_INT2 BIT(15)
841#define QCA955X_EXT_INT_PCIE_RC2_INT3 BIT(16)
842#define QCA955X_EXT_INT_USB1 BIT(24)
843#define QCA955X_EXT_INT_USB2 BIT(28)
Wills Wang833a1a82016-03-16 16:59:52 +0800844
845#define QCA955X_EXT_INT_WMAC_ALL \
846 (QCA955X_EXT_INT_WMAC_MISC | QCA955X_EXT_INT_WMAC_TX | \
847 QCA955X_EXT_INT_WMAC_RXLP | QCA955X_EXT_INT_WMAC_RXHP)
848
849#define QCA955X_EXT_INT_PCIE_RC1_ALL \
850 (QCA955X_EXT_INT_PCIE_RC1 | QCA955X_EXT_INT_PCIE_RC1_INT0 | \
851 QCA955X_EXT_INT_PCIE_RC1_INT1 | QCA955X_EXT_INT_PCIE_RC1_INT2 | \
852 QCA955X_EXT_INT_PCIE_RC1_INT3)
853
854#define QCA955X_EXT_INT_PCIE_RC2_ALL \
855 (QCA955X_EXT_INT_PCIE_RC2 | QCA955X_EXT_INT_PCIE_RC2_INT0 | \
856 QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \
857 QCA955X_EXT_INT_PCIE_RC2_INT3)
858
Marek Vasutd04ad792016-05-06 20:10:34 +0200859#define QCA956X_EXT_INT_WMAC_MISC BIT(0)
860#define QCA956X_EXT_INT_WMAC_TX BIT(1)
861#define QCA956X_EXT_INT_WMAC_RXLP BIT(2)
862#define QCA956X_EXT_INT_WMAC_RXHP BIT(3)
863#define QCA956X_EXT_INT_PCIE_RC1 BIT(4)
864#define QCA956X_EXT_INT_PCIE_RC1_INT0 BIT(5)
865#define QCA956X_EXT_INT_PCIE_RC1_INT1 BIT(6)
866#define QCA956X_EXT_INT_PCIE_RC1_INT2 BIT(7)
867#define QCA956X_EXT_INT_PCIE_RC1_INT3 BIT(8)
868#define QCA956X_EXT_INT_PCIE_RC2 BIT(12)
869#define QCA956X_EXT_INT_PCIE_RC2_INT0 BIT(13)
870#define QCA956X_EXT_INT_PCIE_RC2_INT1 BIT(14)
871#define QCA956X_EXT_INT_PCIE_RC2_INT2 BIT(15)
872#define QCA956X_EXT_INT_PCIE_RC2_INT3 BIT(16)
873#define QCA956X_EXT_INT_USB1 BIT(24)
874#define QCA956X_EXT_INT_USB2 BIT(28)
Wills Wang833a1a82016-03-16 16:59:52 +0800875
876#define QCA956X_EXT_INT_WMAC_ALL \
877 (QCA956X_EXT_INT_WMAC_MISC | QCA956X_EXT_INT_WMAC_TX | \
878 QCA956X_EXT_INT_WMAC_RXLP | QCA956X_EXT_INT_WMAC_RXHP)
879
880#define QCA956X_EXT_INT_PCIE_RC1_ALL \
881 (QCA956X_EXT_INT_PCIE_RC1 | QCA956X_EXT_INT_PCIE_RC1_INT0 | \
882 QCA956X_EXT_INT_PCIE_RC1_INT1 | QCA956X_EXT_INT_PCIE_RC1_INT2 | \
883 QCA956X_EXT_INT_PCIE_RC1_INT3)
884
885#define QCA956X_EXT_INT_PCIE_RC2_ALL \
886 (QCA956X_EXT_INT_PCIE_RC2 | QCA956X_EXT_INT_PCIE_RC2_INT0 | \
887 QCA956X_EXT_INT_PCIE_RC2_INT1 | QCA956X_EXT_INT_PCIE_RC2_INT2 | \
888 QCA956X_EXT_INT_PCIE_RC2_INT3)
889
Marek Vasutd04ad792016-05-06 20:10:34 +0200890#define REV_ID_MAJOR_MASK 0xfff0
891#define REV_ID_MAJOR_AR71XX 0x00a0
892#define REV_ID_MAJOR_AR913X 0x00b0
893#define REV_ID_MAJOR_AR7240 0x00c0
894#define REV_ID_MAJOR_AR7241 0x0100
895#define REV_ID_MAJOR_AR7242 0x1100
896#define REV_ID_MAJOR_AR9330 0x0110
897#define REV_ID_MAJOR_AR9331 0x1110
898#define REV_ID_MAJOR_AR9341 0x0120
899#define REV_ID_MAJOR_AR9342 0x1120
900#define REV_ID_MAJOR_AR9344 0x2120
901#define REV_ID_MAJOR_QCA9533 0x0140
902#define REV_ID_MAJOR_QCA9533_V2 0x0160
903#define REV_ID_MAJOR_QCA9556 0x0130
904#define REV_ID_MAJOR_QCA9558 0x1130
905#define REV_ID_MAJOR_TP9343 0x0150
906#define REV_ID_MAJOR_QCA9561 0x1150
Wills Wang833a1a82016-03-16 16:59:52 +0800907
Marek Vasutd04ad792016-05-06 20:10:34 +0200908#define AR71XX_REV_ID_MINOR_MASK 0x3
909#define AR71XX_REV_ID_MINOR_AR7130 0x0
910#define AR71XX_REV_ID_MINOR_AR7141 0x1
911#define AR71XX_REV_ID_MINOR_AR7161 0x2
912#define AR913X_REV_ID_MINOR_AR9130 0x0
913#define AR913X_REV_ID_MINOR_AR9132 0x1
Wills Wang833a1a82016-03-16 16:59:52 +0800914
Marek Vasutd04ad792016-05-06 20:10:34 +0200915#define AR71XX_REV_ID_REVISION_MASK 0x3
916#define AR71XX_REV_ID_REVISION_SHIFT 2
917#define AR71XX_REV_ID_REVISION2_MASK 0xf
Wills Wang833a1a82016-03-16 16:59:52 +0800918
919/*
920 * RTC block
921 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200922#define AR933X_RTC_REG_RESET 0x40
923#define AR933X_RTC_REG_STATUS 0x44
924#define AR933X_RTC_REG_DERIVED 0x48
925#define AR933X_RTC_REG_FORCE_WAKE 0x4c
926#define AR933X_RTC_REG_INT_CAUSE 0x50
927#define AR933X_RTC_REG_CAUSE_CLR 0x50
928#define AR933X_RTC_REG_INT_ENABLE 0x54
929#define AR933X_RTC_REG_INT_MASKE 0x58
Wills Wang833a1a82016-03-16 16:59:52 +0800930
Marek Vasutd04ad792016-05-06 20:10:34 +0200931#define QCA953X_RTC_REG_SYNC_RESET 0x40
932#define QCA953X_RTC_REG_SYNC_STATUS 0x44
Wills Wang833a1a82016-03-16 16:59:52 +0800933
934/*
935 * SPI block
936 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200937#define AR71XX_SPI_REG_FS 0x00
938#define AR71XX_SPI_REG_CTRL 0x04
939#define AR71XX_SPI_REG_IOC 0x08
940#define AR71XX_SPI_REG_RDS 0x0c
Wills Wang833a1a82016-03-16 16:59:52 +0800941
Marek Vasutd04ad792016-05-06 20:10:34 +0200942#define AR71XX_SPI_FS_GPIO BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +0800943
Marek Vasutd04ad792016-05-06 20:10:34 +0200944#define AR71XX_SPI_CTRL_RD BIT(6)
945#define AR71XX_SPI_CTRL_DIV_MASK 0x3f
Wills Wang833a1a82016-03-16 16:59:52 +0800946
Marek Vasutd04ad792016-05-06 20:10:34 +0200947#define AR71XX_SPI_IOC_DO BIT(0)
948#define AR71XX_SPI_IOC_CLK BIT(8)
949#define AR71XX_SPI_IOC_CS(n) BIT(16 + (n))
950#define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0)
951#define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1)
952#define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2)
Wills Wang833a1a82016-03-16 16:59:52 +0800953#define AR71XX_SPI_IOC_CS_ALL \
954 (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | AR71XX_SPI_IOC_CS2)
955
956/*
957 * GPIO block
958 */
Marek Vasutd04ad792016-05-06 20:10:34 +0200959#define AR71XX_GPIO_REG_OE 0x00
960#define AR71XX_GPIO_REG_IN 0x04
961#define AR71XX_GPIO_REG_OUT 0x08
962#define AR71XX_GPIO_REG_SET 0x0c
963#define AR71XX_GPIO_REG_CLEAR 0x10
964#define AR71XX_GPIO_REG_INT_MODE 0x14
965#define AR71XX_GPIO_REG_INT_TYPE 0x18
966#define AR71XX_GPIO_REG_INT_POLARITY 0x1c
967#define AR71XX_GPIO_REG_INT_PENDING 0x20
968#define AR71XX_GPIO_REG_INT_ENABLE 0x24
969#define AR71XX_GPIO_REG_FUNC 0x28
970#define AR933X_GPIO_REG_FUNC 0x30
Wills Wang833a1a82016-03-16 16:59:52 +0800971
Marek Vasutd04ad792016-05-06 20:10:34 +0200972#define AR934X_GPIO_REG_OUT_FUNC0 0x2c
973#define AR934X_GPIO_REG_OUT_FUNC1 0x30
974#define AR934X_GPIO_REG_OUT_FUNC2 0x34
975#define AR934X_GPIO_REG_OUT_FUNC3 0x38
976#define AR934X_GPIO_REG_OUT_FUNC4 0x3c
977#define AR934X_GPIO_REG_OUT_FUNC5 0x40
978#define AR934X_GPIO_REG_FUNC 0x6c
Wills Wang833a1a82016-03-16 16:59:52 +0800979
Marek Vasutd04ad792016-05-06 20:10:34 +0200980#define QCA953X_GPIO_REG_OUT_FUNC0 0x2c
981#define QCA953X_GPIO_REG_OUT_FUNC1 0x30
982#define QCA953X_GPIO_REG_OUT_FUNC2 0x34
983#define QCA953X_GPIO_REG_OUT_FUNC3 0x38
984#define QCA953X_GPIO_REG_OUT_FUNC4 0x3c
985#define QCA953X_GPIO_REG_IN_ENABLE0 0x44
986#define QCA953X_GPIO_REG_FUNC 0x6c
Wills Wang833a1a82016-03-16 16:59:52 +0800987
Marek Vasutd04ad792016-05-06 20:10:34 +0200988#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c
989#define QCA955X_GPIO_REG_OUT_FUNC1 0x30
990#define QCA955X_GPIO_REG_OUT_FUNC2 0x34
991#define QCA955X_GPIO_REG_OUT_FUNC3 0x38
992#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c
993#define QCA955X_GPIO_REG_OUT_FUNC5 0x40
994#define QCA955X_GPIO_REG_FUNC 0x6c
Wills Wang833a1a82016-03-16 16:59:52 +0800995
Marek Vasutd04ad792016-05-06 20:10:34 +0200996#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c
997#define QCA956X_GPIO_REG_OUT_FUNC1 0x30
998#define QCA956X_GPIO_REG_OUT_FUNC2 0x34
999#define QCA956X_GPIO_REG_OUT_FUNC3 0x38
1000#define QCA956X_GPIO_REG_OUT_FUNC4 0x3c
1001#define QCA956X_GPIO_REG_OUT_FUNC5 0x40
1002#define QCA956X_GPIO_REG_IN_ENABLE0 0x44
1003#define QCA956X_GPIO_REG_IN_ENABLE3 0x50
1004#define QCA956X_GPIO_REG_FUNC 0x6c
Wills Wang833a1a82016-03-16 16:59:52 +08001005
Marek Vasutd04ad792016-05-06 20:10:34 +02001006#define AR71XX_GPIO_FUNC_STEREO_EN BIT(17)
1007#define AR71XX_GPIO_FUNC_SLIC_EN BIT(16)
1008#define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13)
1009#define AR71XX_GPIO_FUNC_SPI_CS1_EN BIT(12)
1010#define AR71XX_GPIO_FUNC_UART_EN BIT(8)
1011#define AR71XX_GPIO_FUNC_USB_OC_EN BIT(4)
1012#define AR71XX_GPIO_FUNC_USB_CLK_EN BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +08001013
Marek Vasutd04ad792016-05-06 20:10:34 +02001014#define AR724X_GPIO_FUNC_GE0_MII_CLK_EN BIT(19)
1015#define AR724X_GPIO_FUNC_SPI_EN BIT(18)
1016#define AR724X_GPIO_FUNC_SPI_CS_EN2 BIT(14)
1017#define AR724X_GPIO_FUNC_SPI_CS_EN1 BIT(13)
1018#define AR724X_GPIO_FUNC_CLK_OBS5_EN BIT(12)
1019#define AR724X_GPIO_FUNC_CLK_OBS4_EN BIT(11)
1020#define AR724X_GPIO_FUNC_CLK_OBS3_EN BIT(10)
1021#define AR724X_GPIO_FUNC_CLK_OBS2_EN BIT(9)
1022#define AR724X_GPIO_FUNC_CLK_OBS1_EN BIT(8)
1023#define AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN BIT(7)
1024#define AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN BIT(6)
1025#define AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN BIT(5)
1026#define AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN BIT(4)
1027#define AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN BIT(3)
1028#define AR724X_GPIO_FUNC_UART_RTS_CTS_EN BIT(2)
1029#define AR724X_GPIO_FUNC_UART_EN BIT(1)
1030#define AR724X_GPIO_FUNC_JTAG_DISABLE BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +08001031
Marek Vasutd04ad792016-05-06 20:10:34 +02001032#define AR913X_GPIO_FUNC_WMAC_LED_EN BIT(22)
1033#define AR913X_GPIO_FUNC_EXP_PORT_CS_EN BIT(21)
1034#define AR913X_GPIO_FUNC_I2S_REFCLKEN BIT(20)
1035#define AR913X_GPIO_FUNC_I2S_MCKEN BIT(19)
1036#define AR913X_GPIO_FUNC_I2S1_EN BIT(18)
1037#define AR913X_GPIO_FUNC_I2S0_EN BIT(17)
1038#define AR913X_GPIO_FUNC_SLIC_EN BIT(16)
1039#define AR913X_GPIO_FUNC_UART_RTSCTS_EN BIT(9)
1040#define AR913X_GPIO_FUNC_UART_EN BIT(8)
1041#define AR913X_GPIO_FUNC_USB_CLK_EN BIT(4)
Wills Wang833a1a82016-03-16 16:59:52 +08001042
Marek Vasutd04ad792016-05-06 20:10:34 +02001043#define AR933X_GPIO(x) BIT(x)
1044#define AR933X_GPIO_FUNC_SPDIF2TCK BIT(31)
1045#define AR933X_GPIO_FUNC_SPDIF_EN BIT(30)
1046#define AR933X_GPIO_FUNC_I2SO_22_18_EN BIT(29)
1047#define AR933X_GPIO_FUNC_I2S_MCK_EN BIT(27)
1048#define AR933X_GPIO_FUNC_I2SO_EN BIT(26)
1049#define AR933X_GPIO_FUNC_ETH_SWITCH_LED_DUPL BIT(25)
1050#define AR933X_GPIO_FUNC_ETH_SWITCH_LED_COLL BIT(24)
1051#define AR933X_GPIO_FUNC_ETH_SWITCH_LED_ACT BIT(23)
1052#define AR933X_GPIO_FUNC_SPI_EN BIT(18)
1053#define AR933X_GPIO_FUNC_RES_TRUE BIT(15)
1054#define AR933X_GPIO_FUNC_SPI_CS_EN2 BIT(14)
1055#define AR933X_GPIO_FUNC_SPI_CS_EN1 BIT(13)
1056#define AR933X_GPIO_FUNC_XLNA_EN BIT(12)
1057#define AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN BIT(7)
1058#define AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN BIT(6)
1059#define AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN BIT(5)
1060#define AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN BIT(4)
1061#define AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN BIT(3)
1062#define AR933X_GPIO_FUNC_UART_RTS_CTS_EN BIT(2)
1063#define AR933X_GPIO_FUNC_UART_EN BIT(1)
1064#define AR933X_GPIO_FUNC_JTAG_DISABLE BIT(0)
Wills Wang833a1a82016-03-16 16:59:52 +08001065
Marek Vasutd04ad792016-05-06 20:10:34 +02001066#define AR934X_GPIO_FUNC_CLK_OBS7_EN BIT(9)
1067#define AR934X_GPIO_FUNC_CLK_OBS6_EN BIT(8)
1068#define AR934X_GPIO_FUNC_CLK_OBS5_EN BIT(7)
1069#define AR934X_GPIO_FUNC_CLK_OBS4_EN BIT(6)
1070#define AR934X_GPIO_FUNC_CLK_OBS3_EN BIT(5)
1071#define AR934X_GPIO_FUNC_CLK_OBS2_EN BIT(4)
1072#define AR934X_GPIO_FUNC_CLK_OBS1_EN BIT(3)
1073#define AR934X_GPIO_FUNC_CLK_OBS0_EN BIT(2)
1074#define AR934X_GPIO_FUNC_JTAG_DISABLE BIT(1)
Wills Wang833a1a82016-03-16 16:59:52 +08001075
Marek Vasutd04ad792016-05-06 20:10:34 +02001076#define AR934X_GPIO_OUT_GPIO 0
1077#define AR934X_GPIO_OUT_SPI_CS1 7
1078#define AR934X_GPIO_OUT_LED_LINK0 41
1079#define AR934X_GPIO_OUT_LED_LINK1 42
1080#define AR934X_GPIO_OUT_LED_LINK2 43
1081#define AR934X_GPIO_OUT_LED_LINK3 44
1082#define AR934X_GPIO_OUT_LED_LINK4 45
1083#define AR934X_GPIO_OUT_EXT_LNA0 46
1084#define AR934X_GPIO_OUT_EXT_LNA1 47
Wills Wang833a1a82016-03-16 16:59:52 +08001085
Marek Vasutd04ad792016-05-06 20:10:34 +02001086#define QCA953X_GPIO(x) BIT(x)
1087#define QCA953X_GPIO_MUX_MASK(x) (0xff << (x))
1088#define QCA953X_GPIO_OUT_MUX_SPI_CS1 10
1089#define QCA953X_GPIO_OUT_MUX_SPI_CS2 11
1090#define QCA953X_GPIO_OUT_MUX_SPI_CS0 9
1091#define QCA953X_GPIO_OUT_MUX_SPI_CLK 8
1092#define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12
1093#define QCA953X_GPIO_OUT_MUX_UART0_SOUT 22
1094#define QCA953X_GPIO_OUT_MUX_LED_LINK1 41
1095#define QCA953X_GPIO_OUT_MUX_LED_LINK2 42
1096#define QCA953X_GPIO_OUT_MUX_LED_LINK3 43
1097#define QCA953X_GPIO_OUT_MUX_LED_LINK4 44
1098#define QCA953X_GPIO_OUT_MUX_LED_LINK5 45
Wills Wang833a1a82016-03-16 16:59:52 +08001099
Marek Vasutd04ad792016-05-06 20:10:34 +02001100#define QCA953X_GPIO_IN_MUX_UART0_SIN 9
1101#define QCA953X_GPIO_IN_MUX_SPI_DATA_IN 8
Wills Wang833a1a82016-03-16 16:59:52 +08001102
Marek Vasutd04ad792016-05-06 20:10:34 +02001103#define QCA956X_GPIO_OUT_MUX_GE0_MDO 32
1104#define QCA956X_GPIO_OUT_MUX_GE0_MDC 33
Wills Wang833a1a82016-03-16 16:59:52 +08001105
Marek Vasutd04ad792016-05-06 20:10:34 +02001106#define AR71XX_GPIO_COUNT 16
1107#define AR7240_GPIO_COUNT 18
1108#define AR7241_GPIO_COUNT 20
1109#define AR913X_GPIO_COUNT 22
1110#define AR933X_GPIO_COUNT 30
1111#define AR934X_GPIO_COUNT 23
1112#define QCA953X_GPIO_COUNT 18
1113#define QCA955X_GPIO_COUNT 24
1114#define QCA956X_GPIO_COUNT 23
Wills Wang833a1a82016-03-16 16:59:52 +08001115
1116/*
1117 * SRIF block
1118 */
Marek Vasutd04ad792016-05-06 20:10:34 +02001119#define AR933X_SRIF_DDR_DPLL1_REG 0x240
1120#define AR933X_SRIF_DDR_DPLL2_REG 0x244
1121#define AR933X_SRIF_DDR_DPLL3_REG 0x248
1122#define AR933X_SRIF_DDR_DPLL4_REG 0x24c
Wills Wang833a1a82016-03-16 16:59:52 +08001123
Marek Vasutd04ad792016-05-06 20:10:34 +02001124#define AR934X_SRIF_CPU_DPLL1_REG 0x1c0
1125#define AR934X_SRIF_CPU_DPLL2_REG 0x1c4
1126#define AR934X_SRIF_CPU_DPLL3_REG 0x1c8
Marek Vasut6a713ea2016-05-06 20:10:40 +02001127#define AR934X_SRIF_CPU_DPLL4_REG 0x1cc
Wills Wang833a1a82016-03-16 16:59:52 +08001128
Marek Vasutd04ad792016-05-06 20:10:34 +02001129#define AR934X_SRIF_DDR_DPLL1_REG 0x240
1130#define AR934X_SRIF_DDR_DPLL2_REG 0x244
1131#define AR934X_SRIF_DDR_DPLL3_REG 0x248
Marek Vasut6a713ea2016-05-06 20:10:40 +02001132#define AR934X_SRIF_DDR_DPLL4_REG 0x24c
Wills Wang833a1a82016-03-16 16:59:52 +08001133
Marek Vasutd04ad792016-05-06 20:10:34 +02001134#define AR934X_SRIF_DPLL1_REFDIV_SHIFT 27
1135#define AR934X_SRIF_DPLL1_REFDIV_MASK 0x1f
1136#define AR934X_SRIF_DPLL1_NINT_SHIFT 18
1137#define AR934X_SRIF_DPLL1_NINT_MASK 0x1ff
1138#define AR934X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff
Wills Wang833a1a82016-03-16 16:59:52 +08001139
Marek Vasutd04ad792016-05-06 20:10:34 +02001140#define AR934X_SRIF_DPLL2_LOCAL_PLL BIT(30)
1141#define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13
1142#define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +08001143
Marek Vasutd04ad792016-05-06 20:10:34 +02001144#define QCA953X_SRIF_BB_DPLL1_REG 0x180
1145#define QCA953X_SRIF_BB_DPLL2_REG 0x184
1146#define QCA953X_SRIF_BB_DPLL3_REG 0x188
Wills Wang833a1a82016-03-16 16:59:52 +08001147
Marek Vasutd04ad792016-05-06 20:10:34 +02001148#define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0
1149#define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4
1150#define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8
Wills Wang833a1a82016-03-16 16:59:52 +08001151
Marek Vasutd04ad792016-05-06 20:10:34 +02001152#define QCA953X_SRIF_DDR_DPLL1_REG 0x240
1153#define QCA953X_SRIF_DDR_DPLL2_REG 0x244
1154#define QCA953X_SRIF_DDR_DPLL3_REG 0x248
Wills Wang833a1a82016-03-16 16:59:52 +08001155
Marek Vasutd04ad792016-05-06 20:10:34 +02001156#define QCA953X_SRIF_PCIE_DPLL1_REG 0xc00
1157#define QCA953X_SRIF_PCIE_DPLL2_REG 0xc04
1158#define QCA953X_SRIF_PCIE_DPLL3_REG 0xc08
Wills Wang833a1a82016-03-16 16:59:52 +08001159
Marek Vasutd04ad792016-05-06 20:10:34 +02001160#define QCA953X_SRIF_PMU1_REG 0xc40
1161#define QCA953X_SRIF_PMU2_REG 0xc44
Wills Wang833a1a82016-03-16 16:59:52 +08001162
Marek Vasutd04ad792016-05-06 20:10:34 +02001163#define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27
1164#define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f
Wills Wang833a1a82016-03-16 16:59:52 +08001165
Marek Vasutd04ad792016-05-06 20:10:34 +02001166#define QCA953X_SRIF_DPLL1_NINT_SHIFT 18
1167#define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff
1168#define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff
Wills Wang833a1a82016-03-16 16:59:52 +08001169
Marek Vasutd04ad792016-05-06 20:10:34 +02001170#define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30)
Wills Wang833a1a82016-03-16 16:59:52 +08001171
Marek Vasutd04ad792016-05-06 20:10:34 +02001172#define QCA953X_SRIF_DPLL2_KI_SHIFT 29
1173#define QCA953X_SRIF_DPLL2_KI_MASK 0x3
Wills Wang833a1a82016-03-16 16:59:52 +08001174
Marek Vasutd04ad792016-05-06 20:10:34 +02001175#define QCA953X_SRIF_DPLL2_KD_SHIFT 25
1176#define QCA953X_SRIF_DPLL2_KD_MASK 0xf
Wills Wang833a1a82016-03-16 16:59:52 +08001177
Marek Vasutd04ad792016-05-06 20:10:34 +02001178#define QCA953X_SRIF_DPLL2_PWD BIT(22)
Wills Wang833a1a82016-03-16 16:59:52 +08001179
Marek Vasutd04ad792016-05-06 20:10:34 +02001180#define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13
1181#define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7
Wills Wang833a1a82016-03-16 16:59:52 +08001182
1183/*
1184 * MII_CTRL block
1185 */
Marek Vasutd04ad792016-05-06 20:10:34 +02001186#define AR71XX_MII_REG_MII0_CTRL 0x00
1187#define AR71XX_MII_REG_MII1_CTRL 0x04
Wills Wang833a1a82016-03-16 16:59:52 +08001188
Marek Vasutd04ad792016-05-06 20:10:34 +02001189#define AR71XX_MII_CTRL_IF_MASK 3
1190#define AR71XX_MII_CTRL_SPEED_SHIFT 4
1191#define AR71XX_MII_CTRL_SPEED_MASK 3
1192#define AR71XX_MII_CTRL_SPEED_10 0
1193#define AR71XX_MII_CTRL_SPEED_100 1
1194#define AR71XX_MII_CTRL_SPEED_1000 2
Wills Wang833a1a82016-03-16 16:59:52 +08001195
Marek Vasutd04ad792016-05-06 20:10:34 +02001196#define AR71XX_MII0_CTRL_IF_GMII 0
1197#define AR71XX_MII0_CTRL_IF_MII 1
1198#define AR71XX_MII0_CTRL_IF_RGMII 2
1199#define AR71XX_MII0_CTRL_IF_RMII 3
Wills Wang833a1a82016-03-16 16:59:52 +08001200
Marek Vasutd04ad792016-05-06 20:10:34 +02001201#define AR71XX_MII1_CTRL_IF_RGMII 0
1202#define AR71XX_MII1_CTRL_IF_RMII 1
Wills Wang833a1a82016-03-16 16:59:52 +08001203
1204/*
1205 * AR933X GMAC interface
1206 */
Marek Vasutd04ad792016-05-06 20:10:34 +02001207#define AR933X_GMAC_REG_ETH_CFG 0x00
Wills Wang833a1a82016-03-16 16:59:52 +08001208
Marek Vasutd04ad792016-05-06 20:10:34 +02001209#define AR933X_ETH_CFG_RGMII_GE0 BIT(0)
1210#define AR933X_ETH_CFG_MII_GE0 BIT(1)
1211#define AR933X_ETH_CFG_GMII_GE0 BIT(2)
1212#define AR933X_ETH_CFG_MII_GE0_MASTER BIT(3)
1213#define AR933X_ETH_CFG_MII_GE0_SLAVE BIT(4)
1214#define AR933X_ETH_CFG_MII_GE0_ERR_EN BIT(5)
1215#define AR933X_ETH_CFG_SW_PHY_SWAP BIT(7)
1216#define AR933X_ETH_CFG_SW_PHY_ADDR_SWAP BIT(8)
1217#define AR933X_ETH_CFG_RMII_GE0 BIT(9)
1218#define AR933X_ETH_CFG_RMII_GE0_SPD_10 0
1219#define AR933X_ETH_CFG_RMII_GE0_SPD_100 BIT(10)
Wills Wang833a1a82016-03-16 16:59:52 +08001220
1221/*
1222 * AR934X GMAC Interface
1223 */
Marek Vasutd04ad792016-05-06 20:10:34 +02001224#define AR934X_GMAC_REG_ETH_CFG 0x00
Wills Wang833a1a82016-03-16 16:59:52 +08001225
Marek Vasutd04ad792016-05-06 20:10:34 +02001226#define AR934X_ETH_CFG_RGMII_GMAC0 BIT(0)
1227#define AR934X_ETH_CFG_MII_GMAC0 BIT(1)
1228#define AR934X_ETH_CFG_GMII_GMAC0 BIT(2)
1229#define AR934X_ETH_CFG_MII_GMAC0_MASTER BIT(3)
1230#define AR934X_ETH_CFG_MII_GMAC0_SLAVE BIT(4)
1231#define AR934X_ETH_CFG_MII_GMAC0_ERR_EN BIT(5)
1232#define AR934X_ETH_CFG_SW_ONLY_MODE BIT(6)
1233#define AR934X_ETH_CFG_SW_PHY_SWAP BIT(7)
1234#define AR934X_ETH_CFG_SW_APB_ACCESS BIT(9)
1235#define AR934X_ETH_CFG_RMII_GMAC0 BIT(10)
1236#define AR933X_ETH_CFG_MII_CNTL_SPEED BIT(11)
1237#define AR934X_ETH_CFG_RMII_GMAC0_MASTER BIT(12)
1238#define AR933X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13)
1239#define AR934X_ETH_CFG_RXD_DELAY BIT(14)
1240#define AR934X_ETH_CFG_RXD_DELAY_MASK 0x3
1241#define AR934X_ETH_CFG_RXD_DELAY_SHIFT 14
1242#define AR934X_ETH_CFG_RDV_DELAY BIT(16)
1243#define AR934X_ETH_CFG_RDV_DELAY_MASK 0x3
1244#define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16
Wills Wang833a1a82016-03-16 16:59:52 +08001245
1246/*
1247 * QCA953X GMAC Interface
1248 */
Marek Vasutd04ad792016-05-06 20:10:34 +02001249#define QCA953X_GMAC_REG_ETH_CFG 0x00
Wills Wang833a1a82016-03-16 16:59:52 +08001250
Marek Vasutd04ad792016-05-06 20:10:34 +02001251#define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6)
1252#define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7)
1253#define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9)
1254#define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13)
Wills Wang833a1a82016-03-16 16:59:52 +08001255
1256/*
1257 * QCA955X GMAC Interface
1258 */
1259
Marek Vasutd04ad792016-05-06 20:10:34 +02001260#define QCA955X_GMAC_REG_ETH_CFG 0x00
Wills Wang833a1a82016-03-16 16:59:52 +08001261
Marek Vasutd04ad792016-05-06 20:10:34 +02001262#define QCA955X_ETH_CFG_RGMII_EN BIT(0)
1263#define QCA955X_ETH_CFG_GE0_SGMII BIT(6)
Wills Wang833a1a82016-03-16 16:59:52 +08001264
1265#endif /* __ASM_AR71XX_H */