1 /*
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
19 #define BIT(nr)		(1 << (nr))
20 #endif
21 #endif
22 
23 #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
34 
35 #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
56 
57 #define AR71XX_PCI_MEM_BASE				0x10000000
58 #define AR71XX_PCI_MEM_SIZE				0x07000000
59 
60 #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
68 
69 #define AR71XX_PCI_CFG_BASE \
70 	(AR71XX_PCI_MEM_BASE + AR71XX_PCI_WIN7_OFFS + 0x10000)
71 #define AR71XX_PCI_CFG_SIZE				0x100
72 
73 #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
78 
79 #define AR724X_PCI_MEM_BASE				0x10000000
80 #define AR724X_PCI_MEM_SIZE				0x04000000
81 
82 #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
90 
91 #define AR724X_EHCI_BASE				0x1b000000
92 #define AR724X_EHCI_SIZE				0x1000
93 
94 #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
99 
100 #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
117 
118 #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
131 
132 #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
146 
147 #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
154 
155 #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
171 
172 #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
183 
184 #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
194 
195 #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
204 
205 /*
206  * DDR_CTRL block
207  */
208 #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
217 
218 #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
230 
231 #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
235 
236 #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
240 
241 #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
252 
253 #define AR934X_DDR_REG_TAP_CTRL2			0x24
254 #define AR934X_DDR_REG_TAP_CTRL3			0x28
255 #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
260 #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
269 
270 #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
281 
282 /*
283  * PLL block
284  */
285 #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
289 
290 #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
298 
299 #define AR71XX_ETH0_PLL_SHIFT				17
300 #define AR71XX_ETH1_PLL_SHIFT				19
301 
302 #define AR724X_PLL_REG_CPU_CONFIG			0x00
303 #define AR724X_PLL_REG_PCIE_CONFIG			0x18
304 
305 #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
313 
314 #define AR7242_PLL_REG_ETH0_INT_CLOCK			0x2c
315 
316 #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
320 
321 #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
327 
328 #define AR913X_ETH0_PLL_SHIFT				20
329 #define AR913X_ETH1_PLL_SHIFT				22
330 
331 #define AR933X_PLL_CPU_CONFIG_REG			0x00
332 #define AR933X_PLL_CLK_CTRL_REG				0x08
333 #define AR933X_PLL_DITHER_FRAC_REG			0x10
334 
335 #define AR933X_PLL_CPU_CONFIG_NINT_SHIFT		10
336 #define AR933X_PLL_CPU_CONFIG_NINT_MASK			0x3f
337 #define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT		16
338 #define AR933X_PLL_CPU_CONFIG_REFDIV_MASK		0x1f
339 #define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT		23
340 #define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK		0x7
341 
342 #define AR933X_PLL_CLK_CTRL_BYPASS			BIT(2)
343 #define AR933X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT		5
344 #define AR933X_PLL_CLK_CTRL_CPU_POST_DIV_MASK		0x3
345 #define AR933X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT		10
346 #define AR933X_PLL_CLK_CTRL_DDR_POST_DIV_MASK		0x3
347 #define AR933X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT		15
348 #define AR933X_PLL_CLK_CTRL_AHB_POST_DIV_MASK		0x7
349 
350 #define AR934X_PLL_CPU_CONFIG_REG			0x00
351 #define AR934X_PLL_DDR_CONFIG_REG			0x04
352 #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG			0x08
353 #define AR934X_PLL_SWITCH_CLOCK_CONTROL_REG		0x24
354 #define AR934X_PLL_ETH_XMII_CONTROL_REG			0x2c
355 #define AR934X_PLL_DDR_DIT_FRAC_REG			0x44
356 #define AR934X_PLL_CPU_DIT_FRAC_REG			0x48
357 
358 #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT		0
359 #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK		0x3f
360 #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT		6
361 #define AR934X_PLL_CPU_CONFIG_NINT_MASK			0x3f
362 #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT		12
363 #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK		0x1f
364 #define AR934X_PLL_CPU_CONFIG_RANGE_SHIFT		17
365 #define AR934X_PLL_CPU_CONFIG_RANGE_MASK		0x3
366 #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT		19
367 #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK		0x3
368 #define AR934X_PLL_CPU_CONFIG_PLLPWD			BIT(30)
369 #define AR934X_PLL_CPU_CONFIG_UPDATING			BIT(31)
370 
371 #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT		0
372 #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK		0x3ff
373 #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT		10
374 #define AR934X_PLL_DDR_CONFIG_NINT_MASK			0x3f
375 #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT		16
376 #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK		0x1f
377 #define AR934X_PLL_DDR_CONFIG_RANGE_SHIFT		21
378 #define AR934X_PLL_DDR_CONFIG_RANGE_MASK		0x3
379 #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT		23
380 #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK		0x7
381 #define AR934X_PLL_DDR_CONFIG_PLLPWD			BIT(30)
382 #define AR934X_PLL_DDR_CONFIG_UPDATING			BIT(31)
383 
384 #define AR934X_PLL_CLK_CTRL_CPU_PLL_BYPASS		BIT(2)
385 #define AR934X_PLL_CLK_CTRL_DDR_PLL_BYPASS		BIT(3)
386 #define AR934X_PLL_CLK_CTRL_AHB_PLL_BYPASS		BIT(4)
387 #define AR934X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT		5
388 #define AR934X_PLL_CLK_CTRL_CPU_POST_DIV_MASK		0x1f
389 #define AR934X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT		10
390 #define AR934X_PLL_CLK_CTRL_DDR_POST_DIV_MASK		0x1f
391 #define AR934X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT		15
392 #define AR934X_PLL_CLK_CTRL_AHB_POST_DIV_MASK		0x1f
393 #define AR934X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL		BIT(20)
394 #define AR934X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL		BIT(21)
395 #define AR934X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL		BIT(24)
396 
397 #define AR934X_PLL_SWITCH_CLK_CTRL_MDIO_CLK_SEL		BIT(6)
398 
399 #define AR934X_PLL_DDR_DIT_FRAC_MAX_SHIFT		0
400 #define AR934X_PLL_DDR_DIT_FRAC_MAX_MASK		0x3ff
401 #define AR934X_PLL_DDR_DIT_FRAC_MIN_SHIFT		10
402 #define AR934X_PLL_DDR_DIT_FRAC_MIN_MASK		0x3ff
403 #define AR934X_PLL_DDR_DIT_FRAC_STEP_SHIFT		20
404 #define AR934X_PLL_DDR_DIT_FRAC_STEP_MASK		0x3f
405 #define AR934X_PLL_DDR_DIT_UPD_CNT_SHIFT		27
406 #define AR934X_PLL_DDR_DIT_UPD_CNT_MASK			0x3f
407 #define AR934X_PLL_DDR_DIT_DITHER_EN			BIT(31)
408 
409 #define AR934X_PLL_CPU_DIT_FRAC_MAX_SHIFT		0
410 #define AR934X_PLL_CPU_DIT_FRAC_MAX_MASK		0x3f
411 #define AR934X_PLL_CPU_DIT_FRAC_MIN_SHIFT		6
412 #define AR934X_PLL_CPU_DIT_FRAC_MIN_MASK		0x3f
413 #define AR934X_PLL_CPU_DIT_FRAC_STEP_SHIFT		12
414 #define AR934X_PLL_CPU_DIT_FRAC_STEP_MASK		0x3f
415 #define AR934X_PLL_CPU_DIT_UPD_CNT_SHIFT		18
416 #define AR934X_PLL_CPU_DIT_UPD_CNT_MASK			0x3f
417 #define AR934X_PLL_CPU_DIT_DITHER_EN			BIT(31)
418 
419 #define QCA953X_PLL_CPU_CONFIG_REG			0x00
420 #define QCA953X_PLL_DDR_CONFIG_REG			0x04
421 #define QCA953X_PLL_CLK_CTRL_REG			0x08
422 #define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG		0x24
423 #define QCA953X_PLL_ETH_XMII_CONTROL_REG		0x2c
424 #define QCA953X_PLL_DDR_DIT_FRAC_REG			0x44
425 #define QCA953X_PLL_CPU_DIT_FRAC_REG			0x48
426 
427 #define QCA953X_PLL_CPU_CONFIG_NFRAC_SHIFT		0
428 #define QCA953X_PLL_CPU_CONFIG_NFRAC_MASK		0x3f
429 #define QCA953X_PLL_CPU_CONFIG_NINT_SHIFT		6
430 #define QCA953X_PLL_CPU_CONFIG_NINT_MASK		0x3f
431 #define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT		12
432 #define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK		0x1f
433 #define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT		19
434 #define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK		0x7
435 
436 #define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT		0
437 #define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK		0x3ff
438 #define QCA953X_PLL_DDR_CONFIG_NINT_SHIFT		10
439 #define QCA953X_PLL_DDR_CONFIG_NINT_MASK		0x3f
440 #define QCA953X_PLL_DDR_CONFIG_REFDIV_SHIFT		16
441 #define QCA953X_PLL_DDR_CONFIG_REFDIV_MASK		0x1f
442 #define QCA953X_PLL_DDR_CONFIG_OUTDIV_SHIFT		23
443 #define QCA953X_PLL_DDR_CONFIG_OUTDIV_MASK		0x7
444 
445 #define QCA953X_PLL_CONFIG_PWD		BIT(30)
446 
447 #define QCA953X_PLL_CLK_CTRL_CPU_PLL_BYPASS		BIT(2)
448 #define QCA953X_PLL_CLK_CTRL_DDR_PLL_BYPASS		BIT(3)
449 #define QCA953X_PLL_CLK_CTRL_AHB_PLL_BYPASS		BIT(4)
450 #define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT		5
451 #define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_MASK		0x1f
452 #define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT		10
453 #define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_MASK		0x1f
454 #define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT		15
455 #define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_MASK		0x1f
456 #define QCA953X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL		BIT(20)
457 #define QCA953X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL		BIT(21)
458 #define QCA953X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL		BIT(24)
459 
460 #define QCA953X_PLL_CPU_DIT_FRAC_MAX_SHIFT		0
461 #define QCA953X_PLL_CPU_DIT_FRAC_MAX_MASK		0x3f
462 #define QCA953X_PLL_CPU_DIT_FRAC_MIN_SHIFT		6
463 #define QCA953X_PLL_CPU_DIT_FRAC_MIN_MASK		0x3f
464 #define QCA953X_PLL_CPU_DIT_FRAC_STEP_SHIFT		12
465 #define QCA953X_PLL_CPU_DIT_FRAC_STEP_MASK		0x3f
466 #define QCA953X_PLL_CPU_DIT_UPD_CNT_SHIFT		18
467 #define QCA953X_PLL_CPU_DIT_UPD_CNT_MASK		0x3f
468 
469 #define QCA953X_PLL_DDR_DIT_FRAC_MAX_SHIFT		0
470 #define QCA953X_PLL_DDR_DIT_FRAC_MAX_MASK		0x3ff
471 #define QCA953X_PLL_DDR_DIT_FRAC_MIN_SHIFT		9
472 #define QCA953X_PLL_DDR_DIT_FRAC_MIN_MASK		0x3ff
473 #define QCA953X_PLL_DDR_DIT_FRAC_STEP_SHIFT		20
474 #define QCA953X_PLL_DDR_DIT_FRAC_STEP_MASK		0x3f
475 #define QCA953X_PLL_DDR_DIT_UPD_CNT_SHIFT		27
476 #define QCA953X_PLL_DDR_DIT_UPD_CNT_MASK		0x3f
477 
478 #define QCA953X_PLL_DIT_FRAC_EN				BIT(31)
479 
480 #define QCA955X_PLL_CPU_CONFIG_REG			0x00
481 #define QCA955X_PLL_DDR_CONFIG_REG			0x04
482 #define QCA955X_PLL_CLK_CTRL_REG			0x08
483 #define QCA955X_PLL_ETH_XMII_CONTROL_REG		0x28
484 #define QCA955X_PLL_ETH_SGMII_CONTROL_REG		0x48
485 
486 #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT		0
487 #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK		0x3f
488 #define QCA955X_PLL_CPU_CONFIG_NINT_SHIFT		6
489 #define QCA955X_PLL_CPU_CONFIG_NINT_MASK		0x3f
490 #define QCA955X_PLL_CPU_CONFIG_REFDIV_SHIFT		12
491 #define QCA955X_PLL_CPU_CONFIG_REFDIV_MASK		0x1f
492 #define QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT		19
493 #define QCA955X_PLL_CPU_CONFIG_OUTDIV_MASK		0x3
494 
495 #define QCA955X_PLL_DDR_CONFIG_NFRAC_SHIFT		0
496 #define QCA955X_PLL_DDR_CONFIG_NFRAC_MASK		0x3ff
497 #define QCA955X_PLL_DDR_CONFIG_NINT_SHIFT		10
498 #define QCA955X_PLL_DDR_CONFIG_NINT_MASK		0x3f
499 #define QCA955X_PLL_DDR_CONFIG_REFDIV_SHIFT		16
500 #define QCA955X_PLL_DDR_CONFIG_REFDIV_MASK		0x1f
501 #define QCA955X_PLL_DDR_CONFIG_OUTDIV_SHIFT		23
502 #define QCA955X_PLL_DDR_CONFIG_OUTDIV_MASK		0x7
503 
504 #define QCA955X_PLL_CLK_CTRL_CPU_PLL_BYPASS		BIT(2)
505 #define QCA955X_PLL_CLK_CTRL_DDR_PLL_BYPASS		BIT(3)
506 #define QCA955X_PLL_CLK_CTRL_AHB_PLL_BYPASS		BIT(4)
507 #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT		5
508 #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_MASK		0x1f
509 #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT		10
510 #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_MASK		0x1f
511 #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT		15
512 #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_MASK		0x1f
513 #define QCA955X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL		BIT(20)
514 #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL		BIT(21)
515 #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL		BIT(24)
516 
517 #define QCA956X_PLL_CPU_CONFIG_REG			0x00
518 #define QCA956X_PLL_CPU_CONFIG1_REG			0x04
519 #define QCA956X_PLL_DDR_CONFIG_REG			0x08
520 #define QCA956X_PLL_DDR_CONFIG1_REG			0x0c
521 #define QCA956X_PLL_CLK_CTRL_REG			0x10
522 
523 #define QCA956X_PLL_CPU_CONFIG_REFDIV_SHIFT		12
524 #define QCA956X_PLL_CPU_CONFIG_REFDIV_MASK		0x1f
525 #define QCA956X_PLL_CPU_CONFIG_OUTDIV_SHIFT		19
526 #define QCA956X_PLL_CPU_CONFIG_OUTDIV_MASK		0x7
527 
528 #define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_SHIFT		0
529 #define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_MASK		0x1f
530 #define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_SHIFT		5
531 #define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_MASK		0x3fff
532 #define QCA956X_PLL_CPU_CONFIG1_NINT_SHIFT		18
533 #define QCA956X_PLL_CPU_CONFIG1_NINT_MASK		0x1ff
534 
535 #define QCA956X_PLL_DDR_CONFIG_REFDIV_SHIFT		16
536 #define QCA956X_PLL_DDR_CONFIG_REFDIV_MASK		0x1f
537 #define QCA956X_PLL_DDR_CONFIG_OUTDIV_SHIFT		23
538 #define QCA956X_PLL_DDR_CONFIG_OUTDIV_MASK		0x7
539 
540 #define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_SHIFT		0
541 #define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_MASK		0x1f
542 #define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_SHIFT		5
543 #define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_MASK		0x3fff
544 #define QCA956X_PLL_DDR_CONFIG1_NINT_SHIFT		18
545 #define QCA956X_PLL_DDR_CONFIG1_NINT_MASK		0x1ff
546 
547 #define QCA956X_PLL_CLK_CTRL_CPU_PLL_BYPASS		BIT(2)
548 #define QCA956X_PLL_CLK_CTRL_DDR_PLL_BYPASS		BIT(3)
549 #define QCA956X_PLL_CLK_CTRL_AHB_PLL_BYPASS		BIT(4)
550 #define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT		5
551 #define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_MASK		0x1f
552 #define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT		10
553 #define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_MASK		0x1f
554 #define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT		15
555 #define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_MASK		0x1f
556 #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_DDRPLL	BIT(20)
557 #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_CPUPLL	BIT(21)
558 #define QCA956X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL		BIT(24)
559 
560 /*
561  * USB_CONFIG block
562  */
563 #define AR71XX_USB_CTRL_REG_FLADJ			0x00
564 #define AR71XX_USB_CTRL_REG_CONFIG			0x04
565 
566 /*
567  * RESET block
568  */
569 #define AR71XX_RESET_REG_TIMER				0x00
570 #define AR71XX_RESET_REG_TIMER_RELOAD			0x04
571 #define AR71XX_RESET_REG_WDOG_CTRL			0x08
572 #define AR71XX_RESET_REG_WDOG				0x0c
573 #define AR71XX_RESET_REG_MISC_INT_STATUS		0x10
574 #define AR71XX_RESET_REG_MISC_INT_ENABLE		0x14
575 #define AR71XX_RESET_REG_PCI_INT_STATUS			0x18
576 #define AR71XX_RESET_REG_PCI_INT_ENABLE			0x1c
577 #define AR71XX_RESET_REG_GLOBAL_INT_STATUS		0x20
578 #define AR71XX_RESET_REG_RESET_MODULE			0x24
579 #define AR71XX_RESET_REG_PERFC_CTRL			0x2c
580 #define AR71XX_RESET_REG_PERFC0				0x30
581 #define AR71XX_RESET_REG_PERFC1				0x34
582 #define AR71XX_RESET_REG_REV_ID				0x90
583 
584 #define AR913X_RESET_REG_GLOBAL_INT_STATUS		0x18
585 #define AR913X_RESET_REG_RESET_MODULE			0x1c
586 #define AR913X_RESET_REG_PERF_CTRL			0x20
587 #define AR913X_RESET_REG_PERFC0				0x24
588 #define AR913X_RESET_REG_PERFC1				0x28
589 
590 #define AR724X_RESET_REG_RESET_MODULE			0x1c
591 
592 #define AR933X_RESET_REG_RESET_MODULE			0x1c
593 #define AR933X_RESET_REG_BOOTSTRAP			0xac
594 
595 #define AR934X_RESET_REG_RESET_MODULE			0x1c
596 #define AR934X_RESET_REG_BOOTSTRAP			0xb0
597 #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS		0xac
598 
599 #define QCA953X_RESET_REG_RESET_MODULE			0x1c
600 #define QCA953X_RESET_REG_BOOTSTRAP			0xb0
601 #define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS		0xac
602 
603 #define QCA955X_RESET_REG_RESET_MODULE			0x1c
604 #define QCA955X_RESET_REG_BOOTSTRAP			0xb0
605 #define QCA955X_RESET_REG_EXT_INT_STATUS		0xac
606 
607 #define QCA956X_RESET_REG_RESET_MODULE			0x1c
608 #define QCA956X_RESET_REG_BOOTSTRAP			0xb0
609 #define QCA956X_RESET_REG_EXT_INT_STATUS		0xac
610 
611 #define MISC_INT_MIPS_SI_TIMERINT_MASK			BIT(28)
612 #define MISC_INT_ETHSW					BIT(12)
613 #define MISC_INT_TIMER4					BIT(10)
614 #define MISC_INT_TIMER3					BIT(9)
615 #define MISC_INT_TIMER2					BIT(8)
616 #define MISC_INT_DMA					BIT(7)
617 #define MISC_INT_OHCI					BIT(6)
618 #define MISC_INT_PERFC					BIT(5)
619 #define MISC_INT_WDOG					BIT(4)
620 #define MISC_INT_UART					BIT(3)
621 #define MISC_INT_GPIO					BIT(2)
622 #define MISC_INT_ERROR					BIT(1)
623 #define MISC_INT_TIMER					BIT(0)
624 
625 #define AR71XX_RESET_EXTERNAL				BIT(28)
626 #define AR71XX_RESET_FULL_CHIP				BIT(24)
627 #define AR71XX_RESET_CPU_NMI				BIT(21)
628 #define AR71XX_RESET_CPU_COLD				BIT(20)
629 #define AR71XX_RESET_DMA				BIT(19)
630 #define AR71XX_RESET_SLIC				BIT(18)
631 #define AR71XX_RESET_STEREO				BIT(17)
632 #define AR71XX_RESET_DDR				BIT(16)
633 #define AR71XX_RESET_GE1_MAC				BIT(13)
634 #define AR71XX_RESET_GE1_PHY				BIT(12)
635 #define AR71XX_RESET_USBSUS_OVERRIDE			BIT(10)
636 #define AR71XX_RESET_GE0_MAC				BIT(9)
637 #define AR71XX_RESET_GE0_PHY				BIT(8)
638 #define AR71XX_RESET_USB_OHCI_DLL			BIT(6)
639 #define AR71XX_RESET_USB_HOST				BIT(5)
640 #define AR71XX_RESET_USB_PHY				BIT(4)
641 #define AR71XX_RESET_PCI_BUS				BIT(1)
642 #define AR71XX_RESET_PCI_CORE				BIT(0)
643 
644 #define AR7240_RESET_USB_HOST				BIT(5)
645 #define AR7240_RESET_OHCI_DLL				BIT(3)
646 
647 #define AR724X_RESET_GE1_MDIO				BIT(23)
648 #define AR724X_RESET_GE0_MDIO				BIT(22)
649 #define AR724X_RESET_PCIE_PHY_SERIAL			BIT(10)
650 #define AR724X_RESET_PCIE_PHY				BIT(7)
651 #define AR724X_RESET_PCIE				BIT(6)
652 #define AR724X_RESET_USB_HOST				BIT(5)
653 #define AR724X_RESET_USB_PHY				BIT(4)
654 #define AR724X_RESET_USBSUS_OVERRIDE			BIT(3)
655 
656 #define AR913X_RESET_AMBA2WMAC				BIT(22)
657 #define AR913X_RESET_USBSUS_OVERRIDE			BIT(10)
658 #define AR913X_RESET_USB_HOST				BIT(5)
659 #define AR913X_RESET_USB_PHY				BIT(4)
660 
661 #define AR933X_RESET_GE1_MDIO				BIT(23)
662 #define AR933X_RESET_GE0_MDIO				BIT(22)
663 #define AR933X_RESET_GE1_MAC				BIT(13)
664 #define AR933X_RESET_WMAC				BIT(11)
665 #define AR933X_RESET_GE0_MAC				BIT(9)
666 #define AR933X_RESET_ETH_SWITCH				BIT(8)
667 #define AR933X_RESET_USB_HOST				BIT(5)
668 #define AR933X_RESET_USB_PHY				BIT(4)
669 #define AR933X_RESET_USBSUS_OVERRIDE			BIT(3)
670 
671 #define AR934X_RESET_HOST				BIT(31)
672 #define AR934X_RESET_SLIC				BIT(30)
673 #define AR934X_RESET_HDMA				BIT(29)
674 #define AR934X_RESET_EXTERNAL				BIT(28)
675 #define AR934X_RESET_RTC				BIT(27)
676 #define AR934X_RESET_PCIE_EP_INT			BIT(26)
677 #define AR934X_RESET_CHKSUM_ACC				BIT(25)
678 #define AR934X_RESET_FULL_CHIP				BIT(24)
679 #define AR934X_RESET_GE1_MDIO				BIT(23)
680 #define AR934X_RESET_GE0_MDIO				BIT(22)
681 #define AR934X_RESET_CPU_NMI				BIT(21)
682 #define AR934X_RESET_CPU_COLD				BIT(20)
683 #define AR934X_RESET_HOST_RESET_INT			BIT(19)
684 #define AR934X_RESET_PCIE_EP				BIT(18)
685 #define AR934X_RESET_UART1				BIT(17)
686 #define AR934X_RESET_DDR				BIT(16)
687 #define AR934X_RESET_USB_PHY_PLL_PWD_EXT		BIT(15)
688 #define AR934X_RESET_NANDF				BIT(14)
689 #define AR934X_RESET_GE1_MAC				BIT(13)
690 #define AR934X_RESET_ETH_SWITCH_ANALOG			BIT(12)
691 #define AR934X_RESET_USB_PHY_ANALOG			BIT(11)
692 #define AR934X_RESET_HOST_DMA_INT			BIT(10)
693 #define AR934X_RESET_GE0_MAC				BIT(9)
694 #define AR934X_RESET_ETH_SWITCH				BIT(8)
695 #define AR934X_RESET_PCIE_PHY				BIT(7)
696 #define AR934X_RESET_PCIE				BIT(6)
697 #define AR934X_RESET_USB_HOST				BIT(5)
698 #define AR934X_RESET_USB_PHY				BIT(4)
699 #define AR934X_RESET_USBSUS_OVERRIDE			BIT(3)
700 #define AR934X_RESET_LUT				BIT(2)
701 #define AR934X_RESET_MBOX				BIT(1)
702 #define AR934X_RESET_I2S				BIT(0)
703 
704 #define QCA953X_RESET_USB_EXT_PWR			BIT(29)
705 #define QCA953X_RESET_EXTERNAL				BIT(28)
706 #define QCA953X_RESET_RTC				BIT(27)
707 #define QCA953X_RESET_FULL_CHIP				BIT(24)
708 #define QCA953X_RESET_GE1_MDIO				BIT(23)
709 #define QCA953X_RESET_GE0_MDIO				BIT(22)
710 #define QCA953X_RESET_CPU_NMI				BIT(21)
711 #define QCA953X_RESET_CPU_COLD				BIT(20)
712 #define QCA953X_RESET_DDR				BIT(16)
713 #define QCA953X_RESET_USB_PHY_PLL_PWD_EXT		BIT(15)
714 #define QCA953X_RESET_GE1_MAC				BIT(13)
715 #define QCA953X_RESET_ETH_SWITCH_ANALOG			BIT(12)
716 #define QCA953X_RESET_USB_PHY_ANALOG			BIT(11)
717 #define QCA953X_RESET_GE0_MAC				BIT(9)
718 #define QCA953X_RESET_ETH_SWITCH			BIT(8)
719 #define QCA953X_RESET_PCIE_PHY				BIT(7)
720 #define QCA953X_RESET_PCIE				BIT(6)
721 #define QCA953X_RESET_USB_HOST				BIT(5)
722 #define QCA953X_RESET_USB_PHY				BIT(4)
723 #define QCA953X_RESET_USBSUS_OVERRIDE			BIT(3)
724 
725 #define QCA955X_RESET_HOST				BIT(31)
726 #define QCA955X_RESET_SLIC				BIT(30)
727 #define QCA955X_RESET_HDMA				BIT(29)
728 #define QCA955X_RESET_EXTERNAL				BIT(28)
729 #define QCA955X_RESET_RTC				BIT(27)
730 #define QCA955X_RESET_PCIE_EP_INT			BIT(26)
731 #define QCA955X_RESET_CHKSUM_ACC			BIT(25)
732 #define QCA955X_RESET_FULL_CHIP				BIT(24)
733 #define QCA955X_RESET_GE1_MDIO				BIT(23)
734 #define QCA955X_RESET_GE0_MDIO				BIT(22)
735 #define QCA955X_RESET_CPU_NMI				BIT(21)
736 #define QCA955X_RESET_CPU_COLD				BIT(20)
737 #define QCA955X_RESET_HOST_RESET_INT			BIT(19)
738 #define QCA955X_RESET_PCIE_EP				BIT(18)
739 #define QCA955X_RESET_UART1				BIT(17)
740 #define QCA955X_RESET_DDR				BIT(16)
741 #define QCA955X_RESET_USB_PHY_PLL_PWD_EXT		BIT(15)
742 #define QCA955X_RESET_NANDF				BIT(14)
743 #define QCA955X_RESET_GE1_MAC				BIT(13)
744 #define QCA955X_RESET_SGMII_ANALOG			BIT(12)
745 #define QCA955X_RESET_USB_PHY_ANALOG			BIT(11)
746 #define QCA955X_RESET_HOST_DMA_INT			BIT(10)
747 #define QCA955X_RESET_GE0_MAC				BIT(9)
748 #define QCA955X_RESET_SGMII				BIT(8)
749 #define QCA955X_RESET_PCIE_PHY				BIT(7)
750 #define QCA955X_RESET_PCIE				BIT(6)
751 #define QCA955X_RESET_USB_HOST				BIT(5)
752 #define QCA955X_RESET_USB_PHY				BIT(4)
753 #define QCA955X_RESET_USBSUS_OVERRIDE			BIT(3)
754 #define QCA955X_RESET_LUT				BIT(2)
755 #define QCA955X_RESET_MBOX				BIT(1)
756 #define QCA955X_RESET_I2S				BIT(0)
757 
758 #define AR933X_BOOTSTRAP_MDIO_GPIO_EN			BIT(18)
759 #define AR933X_BOOTSTRAP_DDR2				BIT(13)
760 #define AR933X_BOOTSTRAP_EEPBUSY			BIT(4)
761 #define AR933X_BOOTSTRAP_REF_CLK_40			BIT(0)
762 
763 #define AR934X_BOOTSTRAP_SW_OPTION8			BIT(23)
764 #define AR934X_BOOTSTRAP_SW_OPTION7			BIT(22)
765 #define AR934X_BOOTSTRAP_SW_OPTION6			BIT(21)
766 #define AR934X_BOOTSTRAP_SW_OPTION5			BIT(20)
767 #define AR934X_BOOTSTRAP_SW_OPTION4			BIT(19)
768 #define AR934X_BOOTSTRAP_SW_OPTION3			BIT(18)
769 #define AR934X_BOOTSTRAP_SW_OPTION2			BIT(17)
770 #define AR934X_BOOTSTRAP_SW_OPTION1			BIT(16)
771 #define AR934X_BOOTSTRAP_USB_MODE_DEVICE		BIT(7)
772 #define AR934X_BOOTSTRAP_PCIE_RC			BIT(6)
773 #define AR934X_BOOTSTRAP_EJTAG_MODE			BIT(5)
774 #define AR934X_BOOTSTRAP_REF_CLK_40			BIT(4)
775 #define AR934X_BOOTSTRAP_BOOT_FROM_SPI			BIT(2)
776 #define AR934X_BOOTSTRAP_SDRAM_DISABLED			BIT(1)
777 #define AR934X_BOOTSTRAP_DDR1				BIT(0)
778 
779 #define QCA953X_BOOTSTRAP_SW_OPTION2			BIT(12)
780 #define QCA953X_BOOTSTRAP_SW_OPTION1			BIT(11)
781 #define QCA953X_BOOTSTRAP_EJTAG_MODE			BIT(5)
782 #define QCA953X_BOOTSTRAP_REF_CLK_40			BIT(4)
783 #define QCA953X_BOOTSTRAP_SDRAM_DISABLED		BIT(1)
784 #define QCA953X_BOOTSTRAP_DDR1				BIT(0)
785 
786 #define QCA955X_BOOTSTRAP_REF_CLK_40			BIT(4)
787 
788 #define QCA956X_BOOTSTRAP_REF_CLK_40			BIT(2)
789 
790 #define AR934X_PCIE_WMAC_INT_WMAC_MISC			BIT(0)
791 #define AR934X_PCIE_WMAC_INT_WMAC_TX			BIT(1)
792 #define AR934X_PCIE_WMAC_INT_WMAC_RXLP			BIT(2)
793 #define AR934X_PCIE_WMAC_INT_WMAC_RXHP			BIT(3)
794 #define AR934X_PCIE_WMAC_INT_PCIE_RC			BIT(4)
795 #define AR934X_PCIE_WMAC_INT_PCIE_RC0			BIT(5)
796 #define AR934X_PCIE_WMAC_INT_PCIE_RC1			BIT(6)
797 #define AR934X_PCIE_WMAC_INT_PCIE_RC2			BIT(7)
798 #define AR934X_PCIE_WMAC_INT_PCIE_RC3			BIT(8)
799 #define AR934X_PCIE_WMAC_INT_WMAC_ALL \
800 	(AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \
801 	 AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP)
802 
803 #define AR934X_PCIE_WMAC_INT_PCIE_ALL \
804 	(AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \
805 	 AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \
806 	 AR934X_PCIE_WMAC_INT_PCIE_RC3)
807 
808 #define QCA953X_PCIE_WMAC_INT_WMAC_MISC			BIT(0)
809 #define QCA953X_PCIE_WMAC_INT_WMAC_TX			BIT(1)
810 #define QCA953X_PCIE_WMAC_INT_WMAC_RXLP			BIT(2)
811 #define QCA953X_PCIE_WMAC_INT_WMAC_RXHP			BIT(3)
812 #define QCA953X_PCIE_WMAC_INT_PCIE_RC			BIT(4)
813 #define QCA953X_PCIE_WMAC_INT_PCIE_RC0			BIT(5)
814 #define QCA953X_PCIE_WMAC_INT_PCIE_RC1			BIT(6)
815 #define QCA953X_PCIE_WMAC_INT_PCIE_RC2			BIT(7)
816 #define QCA953X_PCIE_WMAC_INT_PCIE_RC3			BIT(8)
817 #define QCA953X_PCIE_WMAC_INT_WMAC_ALL \
818 	(QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \
819 	 QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP)
820 
821 #define QCA953X_PCIE_WMAC_INT_PCIE_ALL \
822 	(QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \
823 	 QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \
824 	 QCA953X_PCIE_WMAC_INT_PCIE_RC3)
825 
826 #define QCA955X_EXT_INT_WMAC_MISC			BIT(0)
827 #define QCA955X_EXT_INT_WMAC_TX				BIT(1)
828 #define QCA955X_EXT_INT_WMAC_RXLP			BIT(2)
829 #define QCA955X_EXT_INT_WMAC_RXHP			BIT(3)
830 #define QCA955X_EXT_INT_PCIE_RC1			BIT(4)
831 #define QCA955X_EXT_INT_PCIE_RC1_INT0			BIT(5)
832 #define QCA955X_EXT_INT_PCIE_RC1_INT1			BIT(6)
833 #define QCA955X_EXT_INT_PCIE_RC1_INT2			BIT(7)
834 #define QCA955X_EXT_INT_PCIE_RC1_INT3			BIT(8)
835 #define QCA955X_EXT_INT_PCIE_RC2			BIT(12)
836 #define QCA955X_EXT_INT_PCIE_RC2_INT0			BIT(13)
837 #define QCA955X_EXT_INT_PCIE_RC2_INT1			BIT(14)
838 #define QCA955X_EXT_INT_PCIE_RC2_INT2			BIT(15)
839 #define QCA955X_EXT_INT_PCIE_RC2_INT3			BIT(16)
840 #define QCA955X_EXT_INT_USB1				BIT(24)
841 #define QCA955X_EXT_INT_USB2				BIT(28)
842 
843 #define QCA955X_EXT_INT_WMAC_ALL \
844 	(QCA955X_EXT_INT_WMAC_MISC | QCA955X_EXT_INT_WMAC_TX | \
845 	 QCA955X_EXT_INT_WMAC_RXLP | QCA955X_EXT_INT_WMAC_RXHP)
846 
847 #define QCA955X_EXT_INT_PCIE_RC1_ALL \
848 	(QCA955X_EXT_INT_PCIE_RC1 | QCA955X_EXT_INT_PCIE_RC1_INT0 | \
849 	 QCA955X_EXT_INT_PCIE_RC1_INT1 | QCA955X_EXT_INT_PCIE_RC1_INT2 | \
850 	 QCA955X_EXT_INT_PCIE_RC1_INT3)
851 
852 #define QCA955X_EXT_INT_PCIE_RC2_ALL \
853 	(QCA955X_EXT_INT_PCIE_RC2 | QCA955X_EXT_INT_PCIE_RC2_INT0 | \
854 	 QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \
855 	 QCA955X_EXT_INT_PCIE_RC2_INT3)
856 
857 #define QCA956X_EXT_INT_WMAC_MISC			BIT(0)
858 #define QCA956X_EXT_INT_WMAC_TX				BIT(1)
859 #define QCA956X_EXT_INT_WMAC_RXLP			BIT(2)
860 #define QCA956X_EXT_INT_WMAC_RXHP			BIT(3)
861 #define QCA956X_EXT_INT_PCIE_RC1			BIT(4)
862 #define QCA956X_EXT_INT_PCIE_RC1_INT0			BIT(5)
863 #define QCA956X_EXT_INT_PCIE_RC1_INT1			BIT(6)
864 #define QCA956X_EXT_INT_PCIE_RC1_INT2			BIT(7)
865 #define QCA956X_EXT_INT_PCIE_RC1_INT3			BIT(8)
866 #define QCA956X_EXT_INT_PCIE_RC2			BIT(12)
867 #define QCA956X_EXT_INT_PCIE_RC2_INT0			BIT(13)
868 #define QCA956X_EXT_INT_PCIE_RC2_INT1			BIT(14)
869 #define QCA956X_EXT_INT_PCIE_RC2_INT2			BIT(15)
870 #define QCA956X_EXT_INT_PCIE_RC2_INT3			BIT(16)
871 #define QCA956X_EXT_INT_USB1				BIT(24)
872 #define QCA956X_EXT_INT_USB2				BIT(28)
873 
874 #define QCA956X_EXT_INT_WMAC_ALL \
875 	(QCA956X_EXT_INT_WMAC_MISC | QCA956X_EXT_INT_WMAC_TX | \
876 	 QCA956X_EXT_INT_WMAC_RXLP | QCA956X_EXT_INT_WMAC_RXHP)
877 
878 #define QCA956X_EXT_INT_PCIE_RC1_ALL \
879 	(QCA956X_EXT_INT_PCIE_RC1 | QCA956X_EXT_INT_PCIE_RC1_INT0 | \
880 	 QCA956X_EXT_INT_PCIE_RC1_INT1 | QCA956X_EXT_INT_PCIE_RC1_INT2 | \
881 	 QCA956X_EXT_INT_PCIE_RC1_INT3)
882 
883 #define QCA956X_EXT_INT_PCIE_RC2_ALL \
884 	(QCA956X_EXT_INT_PCIE_RC2 | QCA956X_EXT_INT_PCIE_RC2_INT0 | \
885 	 QCA956X_EXT_INT_PCIE_RC2_INT1 | QCA956X_EXT_INT_PCIE_RC2_INT2 | \
886 	 QCA956X_EXT_INT_PCIE_RC2_INT3)
887 
888 #define REV_ID_MAJOR_MASK				0xfff0
889 #define REV_ID_MAJOR_AR71XX				0x00a0
890 #define REV_ID_MAJOR_AR913X				0x00b0
891 #define REV_ID_MAJOR_AR7240				0x00c0
892 #define REV_ID_MAJOR_AR7241				0x0100
893 #define REV_ID_MAJOR_AR7242				0x1100
894 #define REV_ID_MAJOR_AR9330				0x0110
895 #define REV_ID_MAJOR_AR9331				0x1110
896 #define REV_ID_MAJOR_AR9341				0x0120
897 #define REV_ID_MAJOR_AR9342				0x1120
898 #define REV_ID_MAJOR_AR9344				0x2120
899 #define REV_ID_MAJOR_QCA9533				0x0140
900 #define REV_ID_MAJOR_QCA9533_V2				0x0160
901 #define REV_ID_MAJOR_QCA9556				0x0130
902 #define REV_ID_MAJOR_QCA9558				0x1130
903 #define REV_ID_MAJOR_TP9343				0x0150
904 #define REV_ID_MAJOR_QCA9561				0x1150
905 
906 #define AR71XX_REV_ID_MINOR_MASK			0x3
907 #define AR71XX_REV_ID_MINOR_AR7130			0x0
908 #define AR71XX_REV_ID_MINOR_AR7141			0x1
909 #define AR71XX_REV_ID_MINOR_AR7161			0x2
910 #define AR913X_REV_ID_MINOR_AR9130			0x0
911 #define AR913X_REV_ID_MINOR_AR9132			0x1
912 
913 #define AR71XX_REV_ID_REVISION_MASK			0x3
914 #define AR71XX_REV_ID_REVISION_SHIFT			2
915 #define AR71XX_REV_ID_REVISION2_MASK			0xf
916 
917 /*
918  * RTC block
919  */
920 #define AR933X_RTC_REG_RESET				0x40
921 #define AR933X_RTC_REG_STATUS				0x44
922 #define AR933X_RTC_REG_DERIVED				0x48
923 #define AR933X_RTC_REG_FORCE_WAKE			0x4c
924 #define AR933X_RTC_REG_INT_CAUSE			0x50
925 #define AR933X_RTC_REG_CAUSE_CLR			0x50
926 #define AR933X_RTC_REG_INT_ENABLE			0x54
927 #define AR933X_RTC_REG_INT_MASKE			0x58
928 
929 #define QCA953X_RTC_REG_SYNC_RESET			0x40
930 #define QCA953X_RTC_REG_SYNC_STATUS			0x44
931 
932 /*
933  * SPI block
934  */
935 #define AR71XX_SPI_REG_FS				0x00
936 #define AR71XX_SPI_REG_CTRL				0x04
937 #define AR71XX_SPI_REG_IOC				0x08
938 #define AR71XX_SPI_REG_RDS				0x0c
939 
940 #define AR71XX_SPI_FS_GPIO				BIT(0)
941 
942 #define AR71XX_SPI_CTRL_RD				BIT(6)
943 #define AR71XX_SPI_CTRL_DIV_MASK			0x3f
944 
945 #define AR71XX_SPI_IOC_DO				BIT(0)
946 #define AR71XX_SPI_IOC_CLK				BIT(8)
947 #define AR71XX_SPI_IOC_CS(n)				BIT(16 + (n))
948 #define AR71XX_SPI_IOC_CS0				AR71XX_SPI_IOC_CS(0)
949 #define AR71XX_SPI_IOC_CS1				AR71XX_SPI_IOC_CS(1)
950 #define AR71XX_SPI_IOC_CS2				AR71XX_SPI_IOC_CS(2)
951 #define AR71XX_SPI_IOC_CS_ALL \
952 	(AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | AR71XX_SPI_IOC_CS2)
953 
954 /*
955  * GPIO block
956  */
957 #define AR71XX_GPIO_REG_OE				0x00
958 #define AR71XX_GPIO_REG_IN				0x04
959 #define AR71XX_GPIO_REG_OUT				0x08
960 #define AR71XX_GPIO_REG_SET				0x0c
961 #define AR71XX_GPIO_REG_CLEAR				0x10
962 #define AR71XX_GPIO_REG_INT_MODE			0x14
963 #define AR71XX_GPIO_REG_INT_TYPE			0x18
964 #define AR71XX_GPIO_REG_INT_POLARITY			0x1c
965 #define AR71XX_GPIO_REG_INT_PENDING			0x20
966 #define AR71XX_GPIO_REG_INT_ENABLE			0x24
967 #define AR71XX_GPIO_REG_FUNC				0x28
968 #define AR933X_GPIO_REG_FUNC				0x30
969 
970 #define AR934X_GPIO_REG_OUT_FUNC0			0x2c
971 #define AR934X_GPIO_REG_OUT_FUNC1			0x30
972 #define AR934X_GPIO_REG_OUT_FUNC2			0x34
973 #define AR934X_GPIO_REG_OUT_FUNC3			0x38
974 #define AR934X_GPIO_REG_OUT_FUNC4			0x3c
975 #define AR934X_GPIO_REG_OUT_FUNC5			0x40
976 #define AR934X_GPIO_REG_FUNC				0x6c
977 
978 #define QCA953X_GPIO_REG_OUT_FUNC0			0x2c
979 #define QCA953X_GPIO_REG_OUT_FUNC1			0x30
980 #define QCA953X_GPIO_REG_OUT_FUNC2			0x34
981 #define QCA953X_GPIO_REG_OUT_FUNC3			0x38
982 #define QCA953X_GPIO_REG_OUT_FUNC4			0x3c
983 #define QCA953X_GPIO_REG_IN_ENABLE0			0x44
984 #define QCA953X_GPIO_REG_FUNC				0x6c
985 
986 #define QCA955X_GPIO_REG_OUT_FUNC0			0x2c
987 #define QCA955X_GPIO_REG_OUT_FUNC1			0x30
988 #define QCA955X_GPIO_REG_OUT_FUNC2			0x34
989 #define QCA955X_GPIO_REG_OUT_FUNC3			0x38
990 #define QCA955X_GPIO_REG_OUT_FUNC4			0x3c
991 #define QCA955X_GPIO_REG_OUT_FUNC5			0x40
992 #define QCA955X_GPIO_REG_FUNC				0x6c
993 
994 #define QCA956X_GPIO_REG_OUT_FUNC0			0x2c
995 #define QCA956X_GPIO_REG_OUT_FUNC1			0x30
996 #define QCA956X_GPIO_REG_OUT_FUNC2			0x34
997 #define QCA956X_GPIO_REG_OUT_FUNC3			0x38
998 #define QCA956X_GPIO_REG_OUT_FUNC4			0x3c
999 #define QCA956X_GPIO_REG_OUT_FUNC5			0x40
1000 #define QCA956X_GPIO_REG_IN_ENABLE0			0x44
1001 #define QCA956X_GPIO_REG_IN_ENABLE3			0x50
1002 #define QCA956X_GPIO_REG_FUNC				0x6c
1003 
1004 #define AR71XX_GPIO_FUNC_STEREO_EN			BIT(17)
1005 #define AR71XX_GPIO_FUNC_SLIC_EN			BIT(16)
1006 #define AR71XX_GPIO_FUNC_SPI_CS2_EN			BIT(13)
1007 #define AR71XX_GPIO_FUNC_SPI_CS1_EN			BIT(12)
1008 #define AR71XX_GPIO_FUNC_UART_EN			BIT(8)
1009 #define AR71XX_GPIO_FUNC_USB_OC_EN			BIT(4)
1010 #define AR71XX_GPIO_FUNC_USB_CLK_EN			BIT(0)
1011 
1012 #define AR724X_GPIO_FUNC_GE0_MII_CLK_EN			BIT(19)
1013 #define AR724X_GPIO_FUNC_SPI_EN				BIT(18)
1014 #define AR724X_GPIO_FUNC_SPI_CS_EN2			BIT(14)
1015 #define AR724X_GPIO_FUNC_SPI_CS_EN1			BIT(13)
1016 #define AR724X_GPIO_FUNC_CLK_OBS5_EN			BIT(12)
1017 #define AR724X_GPIO_FUNC_CLK_OBS4_EN			BIT(11)
1018 #define AR724X_GPIO_FUNC_CLK_OBS3_EN			BIT(10)
1019 #define AR724X_GPIO_FUNC_CLK_OBS2_EN			BIT(9)
1020 #define AR724X_GPIO_FUNC_CLK_OBS1_EN			BIT(8)
1021 #define AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN		BIT(7)
1022 #define AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN		BIT(6)
1023 #define AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN		BIT(5)
1024 #define AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN		BIT(4)
1025 #define AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN		BIT(3)
1026 #define AR724X_GPIO_FUNC_UART_RTS_CTS_EN		BIT(2)
1027 #define AR724X_GPIO_FUNC_UART_EN			BIT(1)
1028 #define AR724X_GPIO_FUNC_JTAG_DISABLE			BIT(0)
1029 
1030 #define AR913X_GPIO_FUNC_WMAC_LED_EN			BIT(22)
1031 #define AR913X_GPIO_FUNC_EXP_PORT_CS_EN			BIT(21)
1032 #define AR913X_GPIO_FUNC_I2S_REFCLKEN			BIT(20)
1033 #define AR913X_GPIO_FUNC_I2S_MCKEN			BIT(19)
1034 #define AR913X_GPIO_FUNC_I2S1_EN			BIT(18)
1035 #define AR913X_GPIO_FUNC_I2S0_EN			BIT(17)
1036 #define AR913X_GPIO_FUNC_SLIC_EN			BIT(16)
1037 #define AR913X_GPIO_FUNC_UART_RTSCTS_EN			BIT(9)
1038 #define AR913X_GPIO_FUNC_UART_EN			BIT(8)
1039 #define AR913X_GPIO_FUNC_USB_CLK_EN			BIT(4)
1040 
1041 #define AR933X_GPIO(x)					BIT(x)
1042 #define AR933X_GPIO_FUNC_SPDIF2TCK			BIT(31)
1043 #define AR933X_GPIO_FUNC_SPDIF_EN			BIT(30)
1044 #define AR933X_GPIO_FUNC_I2SO_22_18_EN			BIT(29)
1045 #define AR933X_GPIO_FUNC_I2S_MCK_EN			BIT(27)
1046 #define AR933X_GPIO_FUNC_I2SO_EN			BIT(26)
1047 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_DUPL		BIT(25)
1048 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_COLL		BIT(24)
1049 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_ACT		BIT(23)
1050 #define AR933X_GPIO_FUNC_SPI_EN				BIT(18)
1051 #define AR933X_GPIO_FUNC_RES_TRUE			BIT(15)
1052 #define AR933X_GPIO_FUNC_SPI_CS_EN2			BIT(14)
1053 #define AR933X_GPIO_FUNC_SPI_CS_EN1			BIT(13)
1054 #define AR933X_GPIO_FUNC_XLNA_EN			BIT(12)
1055 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN		BIT(7)
1056 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN		BIT(6)
1057 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN		BIT(5)
1058 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN		BIT(4)
1059 #define AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN		BIT(3)
1060 #define AR933X_GPIO_FUNC_UART_RTS_CTS_EN		BIT(2)
1061 #define AR933X_GPIO_FUNC_UART_EN			BIT(1)
1062 #define AR933X_GPIO_FUNC_JTAG_DISABLE			BIT(0)
1063 
1064 #define AR934X_GPIO_FUNC_CLK_OBS7_EN			BIT(9)
1065 #define AR934X_GPIO_FUNC_CLK_OBS6_EN			BIT(8)
1066 #define AR934X_GPIO_FUNC_CLK_OBS5_EN			BIT(7)
1067 #define AR934X_GPIO_FUNC_CLK_OBS4_EN			BIT(6)
1068 #define AR934X_GPIO_FUNC_CLK_OBS3_EN			BIT(5)
1069 #define AR934X_GPIO_FUNC_CLK_OBS2_EN			BIT(4)
1070 #define AR934X_GPIO_FUNC_CLK_OBS1_EN			BIT(3)
1071 #define AR934X_GPIO_FUNC_CLK_OBS0_EN			BIT(2)
1072 #define AR934X_GPIO_FUNC_JTAG_DISABLE			BIT(1)
1073 
1074 #define AR934X_GPIO_OUT_GPIO				0
1075 #define AR934X_GPIO_OUT_SPI_CS1				7
1076 #define AR934X_GPIO_OUT_LED_LINK0			41
1077 #define AR934X_GPIO_OUT_LED_LINK1			42
1078 #define AR934X_GPIO_OUT_LED_LINK2			43
1079 #define AR934X_GPIO_OUT_LED_LINK3			44
1080 #define AR934X_GPIO_OUT_LED_LINK4			45
1081 #define AR934X_GPIO_OUT_EXT_LNA0			46
1082 #define AR934X_GPIO_OUT_EXT_LNA1			47
1083 
1084 #define QCA953X_GPIO(x)					BIT(x)
1085 #define QCA953X_GPIO_MUX_MASK(x)			(0xff << (x))
1086 #define QCA953X_GPIO_OUT_MUX_SPI_CS1			10
1087 #define QCA953X_GPIO_OUT_MUX_SPI_CS2			11
1088 #define QCA953X_GPIO_OUT_MUX_SPI_CS0			9
1089 #define QCA953X_GPIO_OUT_MUX_SPI_CLK			8
1090 #define QCA953X_GPIO_OUT_MUX_SPI_MOSI			12
1091 #define QCA953X_GPIO_OUT_MUX_UART0_SOUT			22
1092 #define QCA953X_GPIO_OUT_MUX_LED_LINK1			41
1093 #define QCA953X_GPIO_OUT_MUX_LED_LINK2			42
1094 #define QCA953X_GPIO_OUT_MUX_LED_LINK3			43
1095 #define QCA953X_GPIO_OUT_MUX_LED_LINK4			44
1096 #define QCA953X_GPIO_OUT_MUX_LED_LINK5			45
1097 
1098 #define QCA953X_GPIO_IN_MUX_UART0_SIN			9
1099 #define QCA953X_GPIO_IN_MUX_SPI_DATA_IN			8
1100 
1101 #define QCA956X_GPIO_OUT_MUX_GE0_MDO			32
1102 #define QCA956X_GPIO_OUT_MUX_GE0_MDC			33
1103 
1104 #define AR71XX_GPIO_COUNT				16
1105 #define AR7240_GPIO_COUNT				18
1106 #define AR7241_GPIO_COUNT				20
1107 #define AR913X_GPIO_COUNT				22
1108 #define AR933X_GPIO_COUNT				30
1109 #define AR934X_GPIO_COUNT				23
1110 #define QCA953X_GPIO_COUNT				18
1111 #define QCA955X_GPIO_COUNT				24
1112 #define QCA956X_GPIO_COUNT				23
1113 
1114 /*
1115  * SRIF block
1116  */
1117 #define AR933X_SRIF_DDR_DPLL1_REG			0x240
1118 #define AR933X_SRIF_DDR_DPLL2_REG			0x244
1119 #define AR933X_SRIF_DDR_DPLL3_REG			0x248
1120 #define AR933X_SRIF_DDR_DPLL4_REG			0x24c
1121 
1122 #define AR934X_SRIF_CPU_DPLL1_REG			0x1c0
1123 #define AR934X_SRIF_CPU_DPLL2_REG			0x1c4
1124 #define AR934X_SRIF_CPU_DPLL3_REG			0x1c8
1125 #define AR934X_SRIF_CPU_DPLL4_REG			0x1cc
1126 
1127 #define AR934X_SRIF_DDR_DPLL1_REG			0x240
1128 #define AR934X_SRIF_DDR_DPLL2_REG			0x244
1129 #define AR934X_SRIF_DDR_DPLL3_REG			0x248
1130 #define AR934X_SRIF_DDR_DPLL4_REG			0x24c
1131 
1132 #define AR934X_SRIF_DPLL1_REFDIV_SHIFT			27
1133 #define AR934X_SRIF_DPLL1_REFDIV_MASK			0x1f
1134 #define AR934X_SRIF_DPLL1_NINT_SHIFT			18
1135 #define AR934X_SRIF_DPLL1_NINT_MASK			0x1ff
1136 #define AR934X_SRIF_DPLL1_NFRAC_MASK			0x0003ffff
1137 
1138 #define AR934X_SRIF_DPLL2_LOCAL_PLL			BIT(30)
1139 #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT			13
1140 #define AR934X_SRIF_DPLL2_OUTDIV_MASK			0x7
1141 
1142 #define QCA953X_SRIF_BB_DPLL1_REG			0x180
1143 #define QCA953X_SRIF_BB_DPLL2_REG			0x184
1144 #define QCA953X_SRIF_BB_DPLL3_REG			0x188
1145 
1146 #define QCA953X_SRIF_CPU_DPLL1_REG			0x1c0
1147 #define QCA953X_SRIF_CPU_DPLL2_REG			0x1c4
1148 #define QCA953X_SRIF_CPU_DPLL3_REG			0x1c8
1149 
1150 #define QCA953X_SRIF_DDR_DPLL1_REG			0x240
1151 #define QCA953X_SRIF_DDR_DPLL2_REG			0x244
1152 #define QCA953X_SRIF_DDR_DPLL3_REG			0x248
1153 
1154 #define QCA953X_SRIF_PCIE_DPLL1_REG			0xc00
1155 #define QCA953X_SRIF_PCIE_DPLL2_REG			0xc04
1156 #define QCA953X_SRIF_PCIE_DPLL3_REG			0xc08
1157 
1158 #define QCA953X_SRIF_PMU1_REG				0xc40
1159 #define QCA953X_SRIF_PMU2_REG				0xc44
1160 
1161 #define QCA953X_SRIF_DPLL1_REFDIV_SHIFT			27
1162 #define QCA953X_SRIF_DPLL1_REFDIV_MASK			0x1f
1163 
1164 #define QCA953X_SRIF_DPLL1_NINT_SHIFT			18
1165 #define QCA953X_SRIF_DPLL1_NINT_MASK			0x1ff
1166 #define QCA953X_SRIF_DPLL1_NFRAC_MASK			0x0003ffff
1167 
1168 #define QCA953X_SRIF_DPLL2_LOCAL_PLL			BIT(30)
1169 
1170 #define QCA953X_SRIF_DPLL2_KI_SHIFT			29
1171 #define QCA953X_SRIF_DPLL2_KI_MASK			0x3
1172 
1173 #define QCA953X_SRIF_DPLL2_KD_SHIFT			25
1174 #define QCA953X_SRIF_DPLL2_KD_MASK			0xf
1175 
1176 #define QCA953X_SRIF_DPLL2_PWD				BIT(22)
1177 
1178 #define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT			13
1179 #define QCA953X_SRIF_DPLL2_OUTDIV_MASK			0x7
1180 
1181 /*
1182  * MII_CTRL block
1183  */
1184 #define AR71XX_MII_REG_MII0_CTRL			0x00
1185 #define AR71XX_MII_REG_MII1_CTRL			0x04
1186 
1187 #define AR71XX_MII_CTRL_IF_MASK				3
1188 #define AR71XX_MII_CTRL_SPEED_SHIFT			4
1189 #define AR71XX_MII_CTRL_SPEED_MASK			3
1190 #define AR71XX_MII_CTRL_SPEED_10			0
1191 #define AR71XX_MII_CTRL_SPEED_100			1
1192 #define AR71XX_MII_CTRL_SPEED_1000			2
1193 
1194 #define AR71XX_MII0_CTRL_IF_GMII			0
1195 #define AR71XX_MII0_CTRL_IF_MII				1
1196 #define AR71XX_MII0_CTRL_IF_RGMII			2
1197 #define AR71XX_MII0_CTRL_IF_RMII			3
1198 
1199 #define AR71XX_MII1_CTRL_IF_RGMII			0
1200 #define AR71XX_MII1_CTRL_IF_RMII			1
1201 
1202 /*
1203  * AR933X GMAC interface
1204  */
1205 #define AR933X_GMAC_REG_ETH_CFG				0x00
1206 
1207 #define AR933X_ETH_CFG_RGMII_GE0			BIT(0)
1208 #define AR933X_ETH_CFG_MII_GE0				BIT(1)
1209 #define AR933X_ETH_CFG_GMII_GE0				BIT(2)
1210 #define AR933X_ETH_CFG_MII_GE0_MASTER			BIT(3)
1211 #define AR933X_ETH_CFG_MII_GE0_SLAVE			BIT(4)
1212 #define AR933X_ETH_CFG_MII_GE0_ERR_EN			BIT(5)
1213 #define AR933X_ETH_CFG_SW_PHY_SWAP			BIT(7)
1214 #define AR933X_ETH_CFG_SW_PHY_ADDR_SWAP			BIT(8)
1215 #define AR933X_ETH_CFG_RMII_GE0				BIT(9)
1216 #define AR933X_ETH_CFG_RMII_GE0_SPD_10			0
1217 #define AR933X_ETH_CFG_RMII_GE0_SPD_100			BIT(10)
1218 
1219 /*
1220  * AR934X GMAC Interface
1221  */
1222 #define AR934X_GMAC_REG_ETH_CFG				0x00
1223 
1224 #define AR934X_ETH_CFG_RGMII_GMAC0			BIT(0)
1225 #define AR934X_ETH_CFG_MII_GMAC0			BIT(1)
1226 #define AR934X_ETH_CFG_GMII_GMAC0			BIT(2)
1227 #define AR934X_ETH_CFG_MII_GMAC0_MASTER			BIT(3)
1228 #define AR934X_ETH_CFG_MII_GMAC0_SLAVE			BIT(4)
1229 #define AR934X_ETH_CFG_MII_GMAC0_ERR_EN			BIT(5)
1230 #define AR934X_ETH_CFG_SW_ONLY_MODE			BIT(6)
1231 #define AR934X_ETH_CFG_SW_PHY_SWAP			BIT(7)
1232 #define AR934X_ETH_CFG_SW_APB_ACCESS			BIT(9)
1233 #define AR934X_ETH_CFG_RMII_GMAC0			BIT(10)
1234 #define AR933X_ETH_CFG_MII_CNTL_SPEED			BIT(11)
1235 #define AR934X_ETH_CFG_RMII_GMAC0_MASTER			BIT(12)
1236 #define AR933X_ETH_CFG_SW_ACC_MSB_FIRST			BIT(13)
1237 #define AR934X_ETH_CFG_RXD_DELAY			BIT(14)
1238 #define AR934X_ETH_CFG_RXD_DELAY_MASK			0x3
1239 #define AR934X_ETH_CFG_RXD_DELAY_SHIFT			14
1240 #define AR934X_ETH_CFG_RDV_DELAY			BIT(16)
1241 #define AR934X_ETH_CFG_RDV_DELAY_MASK			0x3
1242 #define AR934X_ETH_CFG_RDV_DELAY_SHIFT			16
1243 
1244 /*
1245  * QCA953X GMAC Interface
1246  */
1247 #define QCA953X_GMAC_REG_ETH_CFG			0x00
1248 
1249 #define QCA953X_ETH_CFG_SW_ONLY_MODE			BIT(6)
1250 #define QCA953X_ETH_CFG_SW_PHY_SWAP			BIT(7)
1251 #define QCA953X_ETH_CFG_SW_APB_ACCESS			BIT(9)
1252 #define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST		BIT(13)
1253 
1254 /*
1255  * QCA955X GMAC Interface
1256  */
1257 
1258 #define QCA955X_GMAC_REG_ETH_CFG			0x00
1259 
1260 #define QCA955X_ETH_CFG_RGMII_EN			BIT(0)
1261 #define QCA955X_ETH_CFG_GE0_SGMII			BIT(6)
1262 
1263 #endif /* __ASM_AR71XX_H */
1264