ar9344reg.h revision 1.1 1 /* $NetBSD: ar9344reg.h,v 1.1 2011/07/07 05:06:44 matt Exp $ */
2
3 /*-
4 * Copyright (c) 2010 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas of 3am Software Foundry.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifndef _MIPS_ATHEROS_AR9344REG_H_
33 #define _MIPS_ATHEROS_AR9344REG_H_
34
35 #define AR9344_MEM0_BASE 0x00000000 /* sdram */
36 #define AR9344_MEM1_BASE 0x08000000 /* sdram/flash */
37 #define AR9344_MEM3_BASE 0x10000000 /* flash */
38 #define AR7100_PCI_BASE 0x17001000
39 #define ARCHIP_DDR_BASE 0x18000000
40 #define AR9344_UART0_BASE 0x18020000 /* low speed */
41 #define AR7100_UART_BASE 0x18020000 /* low speed */
42 #define AR9344_USB_CONFIG_BASE 0x18030000
43 #define AR9344_GPIO_BASE 0x18040000
44 #define ARCHIP_PLL_BASE 0x18050000
45 #define ARCHIP_RESET_BASE 0x18060000
46 #define AR9344_GMAC_BASE 0x18070000
47 #define AR7100_MII_BASE 0x18070000
48 #define AR9344_GMAC0_INGRESS_BASE 0x18080000
49 #define AR7100_GMAC0_BASE 0x18090000
50 #define AR9344_MBOX_BASE 0x180A0000
51 #define AR7100_GMAC1_BASE 0x180A0000
52 #define AR9344_SLIC_BASE 0x180A9000
53 #define AR9344_STEREO_BASE 0x180B0000
54 #define AR9344_MDIO_BASE 0x180B8000
55 #define AR9344_PCIE_RC_BASE 0x180F0000
56 #define AR9344_WDMA_BASE 0x18100000
57 #define AR9344_RTC_BASE 0x18107000
58 #define AR9344_UART1_BASE 0x18150000 /* high speed */
59 #define AR9344_GMAC0_BASE 0x19000000
60 #define AR9344_GMAC1_BASE 0x1A000000
61 #define AR9344_USB_BASE 0x1B000000
62 #define AR7100_EHCI_BASE 0x1B000000
63 #define AR9344_NAND_BASE 0x1B000200
64 #define AR7100_OHCI_BASE 0x1C000000
65 #define AR7100_SPI_BASE 0x1F000000
66 #define AR9344_SPI_BASE 0x1FFF0000
67
68 /*
69 * PLL registers -- offset relative to AR9344_PLL_BASE
70 */
71 #define ARCHIP_PLL_CPU_PLL_CONFIG 0x0000
72 #define ARCHIP_PLL_DDR_PLL_CONFIG 0x0004
73 #define ARCHIP_PLL_CPU_DDR_CLOCK_CONTROL 0x0008
74
75 #define AR9344_PLL_PCIE_PLL_CONFIG 0x0010
76 #define AR9344_PLL_PCIE_PLL_DITHER_DIV_MAX 0x0014
77 #define AR9344_PLL_PCIE_PLL_DITHER_DIV_MIN 0x0018
78 #define AR9344_PLL_PCIE_PLL_DITHER_STEP 0x001c
79 #define AR9344_PLL_SWITCH_CLOCK_SPARE 0x0024
80 #define AR9344_PLL_CURRENT_PCIE_PLL_DITHER 0x0028
81 #define AR9344_PLL_ETH_XMII_CONTROL 0x002c
82 #define AR9344_PLL_AUDIO_PLL_CONFIG 0x0030
83 #define AR9344_PLL_AUDIO_PLL_MODULATION 0x0034
84 #define AR9344_PLL_AUDIO_PLL_MOD_STEP 0x0038
85 #define AR9344_PLL_CURRENT_AUDIO_PLL_MODULATION 0x003c
86 #define AR9344_PLL_DDR_PLL_DITHER 0x0044
87 #define AR9344_PLL_CPU_PLL_DITHER 0x0048
88
89 #define AR9344_CPU_PLL_CONFIG_UPDATING __BIT(31)
90 #define AR9344_CPU_PLL_CONFIG_PLLPWD __BIT(30)
91 #define AR9344_CPU_PLL_CONFIG_OUTDIV __BITS(19,21)
92 #define AR9344_CPU_PLL_CONFIG_RANGE __BITS(18,17)
93 #define AR9344_CPU_PLL_CONFIG_REFDIV __BITS(12,16)
94 #define AR9344_CPU_PLL_CONFIG_NINT __BITS(6,11)
95 #define AR9344_CPU_PLL_CONFIG_NFRAC __BITS(0,5)
96
97 #define AR7100_CPU_PLL_SW_UPDATE __BIT(31)
98 #define AR7100_PLL_LOCKED __BIT(30)
99 #define AR7100_CPU_PLL_AHB_DIV __BITS(22,20)
100 #define AR7100_CPU_PLL_DDR_DIV_SEL __BITS(19,18)
101 #define AR7100_CPU_PLL_CPU_DIV_SEL __BITS(17,16)
102 #define AR7100_PLL_PLL_LOOP_BW __BITS(15,12)
103 #define AR7100_PLL_PLL_DIV_IN __BITS(11,10)
104 #define AR7100_PLL_PLL_DIV_OUT __BITS(9,8)
105 #define AR7100_PLL_PLL_FB __BITS(7,3)
106 #define AR7100_CPU_PLL_PLL_BYPASS __BIT(1)
107 #define AR7100_PLL_PLL_POWER_DOWN __BIT(0)
108
109 #define AR9344_DDR_PLL_CONFIG_UPDATING __BIT(31)
110 #define AR9344_DDR_PLL_CONFIG_PLLPWD __BIT(30)
111 #define AR9344_DDR_PLL_CONFIG_OUTDIV __BITS(23,25)
112 #define AR9344_DDR_PLL_CONFIG_RANGE __BITS(21,22)
113 #define AR9344_DDR_PLL_CONFIG_REFDIV __BITS(16,20)
114 #define AR9344_DDR_PLL_CONFIG_NINT __BITS(10,15)
115 #define AR9344_DDR_PLL_CONFIG_NFRAC __BITS(0,9)
116
117 #define AR9344_CPU_DDR_CLOCK_CONTROL_AHBCLK_FROM_DDRPLL __BIT(24)
118 #define AR9344_CPU_DDR_CLOCK_CONTROL_CPU_RESET_EN_BP_DEASRT __BIT(23)
119 #define AR9344_CPU_DDR_CLOCK_CONTROL_CPU_RESET_EN_BP_ASRT __BIT(22)
120 #define AR9344_CPU_DDR_CLOCK_CONTROL_DDRCLK_FROM_DDRPLL __BIT(21)
121 #define AR9344_CPU_DDR_CLOCK_CONTROL_CPUCLK_FROM_CPUPLL __BIT(20)
122 #define AR9344_CPU_DDR_CLOCK_CONTROL_AHB_POST_DIV __BITS(15,19)
123 #define AR9344_CPU_DDR_CLOCK_CONTROL_DDR_POST_DIV __BITS(10,14)
124 #define AR9344_CPU_DDR_CLOCK_CONTROL_CPU_POST_DIV __BITS(5,9)
125 #define AR9344_CPU_DDR_CLOCK_CONTROL_AHB_PLL_BYPASS __BIT(4)
126 #define AR9344_CPU_DDR_CLOCK_CONTROL_DDR_PLL_BYPASS __BIT(3)
127 #define AR9344_CPU_DDR_CLOCK_CONTROL_CPU_PLL_BYPASS __BIT(2)
128 #define AR9344_CPU_DDR_CLOCK_CONTROL_RESET_SWITCH __BIT(1)
129
130 /*
131 * RESET registers -- offset relative to ARCHIP_RESET_BASE
132 */
133 #define ARCHIP_RESET_TIMER 0x0000
134 #define ARCHIP_RESET_TIMER_RELOAD 0x0004
135 #define ARCHIP_RESET_WDOG_CTL 0x0008
136 #define ARCHIP_RESET_WDOG_TIMER 0x000c
137 #define ARCHIP_RESET_MISC_INTSTAT 0x0010
138 #define ARCHIP_RESET_MISC_INTMASK 0x0014
139 #define AR9344_RESET_INTSTAT 0x0018
140 #define AR7100_RESET_PCI_INTSTAT 0x0018
141 #define AR9344_RESET_RESETCTL 0x001c
142 #define AR7100_RESET_PCI_INTMASK 0x001c
143 #define AR7100_RESET_INTSTAT 0x0020
144 #define AR7100_RESET_RESETCTL 0x0024
145 #define ARCHIP_RESET_REVISION 0x0090
146 #define AR9344_RESET_WMAC_INTSTAT 0x00AC
147 #define AR9344_RESET_BOOTSTRAP 0x00B0
148 #define AR9344_RESET_MISC2 0x00BC
149
150 /* WDOG_CTL watchdog control bits */
151 #define ARCHIP_WDOG_CTL_LAST __BIT(31)
152 #define ARCHIP_WDOG_CTL_IGNORE 0x00000000
153 #define ARCHIP_WDOG_CTL_INT 0x00000001
154 #define ARCHIP_WDOG_CTL_NMI 0x00000002
155 #define ARCHIP_WDOG_CTL_RESET 0x00000003
156
157 /* Resets */
158 #define AR9344_RESETCTL_I2S_RESET __BIT(0)
159 #define AR7100_RESETCTL_PCI_CORE_RESET __BIT(0)
160 #define AR9344_RESETCTL_MBOX_RESET __BIT(1)
161 #define AR7100_RESETCTL_PCI_BUS_RESET __BIT(1)
162 #define AR9344_RESETCTL_LUT_RESET __BIT(2)
163 #define AR9344_RESETCTL_USB_PHY_SUSPEND_OVERRIDE __BIT(3)
164 #define ARCHIP_RESETCTL_USB_PHY_RESET __BIT(4)
165 #define ARCHIP_RESETCTL_USB_HOST_RESET __BIT(5)
166 #define AR9344_RESETCTL_PCIE_RESET __BIT(6)
167 #define AR7100_RESETCTL_USB_OHCI_DLL_RESET __BIT(6)
168 #define AR9344_RESETCTL_PCIE_PHY_RESET __BIT(7)
169 #define AR9344_RESETCTL_ETH_SWITCH_RESET __BIT(8)
170 #define AR7100_RESETCTL_GMAC0_PHY_RESET __BIT(8)
171 #define ARCHIP_RESETCTL_GMAC0_MAC_RESET __BIT(9)
172 #define AR9344_RESETCTL_HOST_DMA_INT __BIT(10)
173 #define AR9344_RESETCTL_USB_PHY_ARESET __BIT(11)
174 #define AR9344_RESETCTL_ETH_SWITCH_ARESET __BIT(12)
175 #define AR7100_RESETCTL_GMAC1_PHY_RESET __BIT(12)
176 #define ARCHIP_RESETCTL_GMAC1_MAC_RESET __BIT(13)
177 #define AR9344_RESETCTL_NANDF_RESET __BIT(14)
178 #define AR9344_RESETCTL_USB_PHY_PLL_PWD_EXT __BIT(15)
179 #define ARCHIP_RESETCTL_DDR_RESET __BIT(16)
180 #define AR9344_RESETCTL_UART1_RESET __BIT(17)
181 #define AR7100_RESETCTL_I2S_RESET __BIT(17)
182 #define AR9344_RESETCTL_PCIEEP_RESET __BIT(18)
183 #define AR7100_RESETCTL_SLIC_RESET __BIT(18)
184 #define AR9344_RESETCTL_HOST_RESET_INT __BIT(19)
185 #define AR7100_RESETCTL_DMA_RESET __BIT(19)
186 #define ARCHIP_RESETCTL_CPU_COLD_RESET __BIT(20)
187 #define ARCHIP_RESETCTL_CPU_NMI __BIT(21)
188 #define AR9344_RESETCTL_RESET_GMAC0_MDIO __BIT(22)
189 #define AR9344_RESETCTL_RESET_GMAC1_MDIO __BIT(23)
190 #define ARCHIP_RESETCTL_FULL_CHIP_RESET __BIT(24)
191 #define AR9344_RESETCTL_CHKSUM_ACC_RESET __BIT(25)
192 #define AR9344_RESETCTL_PCIEEP_RST_INT __BIT(26)
193 #define AR9344_RESETCTL_RTC_RESET __BIT(27)
194 #define ARCHIP_RESETCTL_EXTERNAL_RESET __BIT(28)
195 #define AR9344_RESETCTL_HDMA_RESET __BIT(29)
196 #define AR9344_RESETCTL_SLIC_RESET __BIT(30)
197 #define AR9344_RESETCTL_HOST_RESET __BIT(31)
198
199 /* Revision ids */
200 #define AR9344_REVISION_WMAC_MAJOR(x) (((x) >> 12) & 0xf)
201 #define AR9344_REVISION_WMAC_MINOR(x) (((x) >> 8) & 0xf)
202 #define AR9344_REVISION_WMAC(x) (((x) >> 8) & 0xff)
203 #define AR9344_REVISION_MAJOR(x) (((x) >> 4) & 0xf)
204 #define AR9344_REVISION_MINOR(x) (((x) >> 0) & 0xf)
205 #define AR9344_REVISION_CHIPID(x) (((x) >> 0) & 0xff)
206
207 #define AR5311_REVISION_MAJ 0x1
208 #define AR7240_REVISION_MAJ 0x4
209 #define AR2313_REVISION_MAJ 0x5
210 #define AR7100_REVISION_MAJ 0xA
211 #define AR5315_REVISION_MAJ 0xB
212 #define AR9344_REVISION_MAJ 0xC
213
214 #define ARCHIP_AR5312 0x42
215 #define ARCHIP_AR7130 0xA0
216 #define ARCHIP_AR7141 0xA1
217 #define ARCHIP_AR7161 0xA2
218 #define ARCHIP_AR9344 0xC0
219 #define ARCHIP_AR9103 0xB0
220 #define ARCHIP_AR5315 0xB0
221
222 #define ARWMAC_AR5312 0x52
223 #define ARWMAC_AR5312_2 0x57
224 #define ARWMAC_AR2313 0x58
225 #define ARWMAC_AR2315LITE 0x86
226 #define ARWMAC_AR2315 0x87
227 #define ARWMAC_AR2317 0x91
228
229 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_8 __BIT(31)
230 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_7 __BIT(30)
231 #define AR9344_BOOTSTRAP_DDR_WIDTH __BIT(29)
232 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_5 __BIT(28)
233 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_4 __BIT(27)
234 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_3 __BIT(26)
235 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_2 __BIT(25)
236 #define AR9344_BOOTSTRAP_SOFTWARE_OPTION_1 __BIT(24)
237 #define AR9344_BOOTSTRAP_USB_MODE __BIT(7)
238 #define AR9344_BOOTSTRAP_EJTAG_MODE __BIT(5)
239 #define AR9344_BOOTSTRAP_REF_CLK_40 __BIT(4)
240 #define AR9344_BOOTSTRAP_BOOT_SELECT __BIT(2)
241 #define AR9344_BOOTSTRAP_SDRAM_DISABLE __BIT(1)
242 #define AR9344_BOOTSTRAP_DDR_SELECT __BIT(0)
243
244 /*
245 * DDR registers -- offset relative to ARCHIP_DDR_BASE
246 */
247 #define AR9344_DDR_CONFIG 0x0000
248 #define AR9344_DDR_CONFIG2 0x0004
249 #define AR9344_DDR_MODE_REGISTER 0x0008
250 #define AR9344_DDR_EXTENDED_MOD_REGISTER 0x000c
251 #define AR9344_DDR_CONTROL 0x0010
252 #define AR9344_DDR_REFRESH 0x0014
253 #define AR9344_DDR_RD_DATA_THIS_CYCLE 0x0018
254 #define AR9344_DDR_TAP_CONTROL_0 0x001c
255 #define AR9344_DDR_TAP_CONTROL_1 0x0020
256 #define AR9344_DDR_TAP_CONTROL_2 0x0024
257 #define AR9344_DDR_TAP_CONTROL_3 0x0028
258 #define AR9344_DDR_WB_FLUSH_GMAC0 0x009c
259 #define AR9344_DDR_WB_FLUSH_GMAC1 0x00a0
260 #define AR9344_DDR_WB_FLUSH_USB 0x00a4
261 #define AR9344_DDR_WB_FLUSH_PCIE 0x00a8
262 #define AR9344_DDR_WB_FLUSH_WMAC 0x00ac
263 #define AR9344_DDR_WB_FLUSH_SRC1 0x00b0
264 #define AR9344_DDR_WB_FLUSH_SRC2 0x00b4
265 #define AR9344_DDR_DDR2_CONFIG 0x00b8
266 #define AR9344_DDR_EMR2 0x00bc
267 #define AR9344_DDR_EMR3 0x00c0
268 #define AR9344_AHB_MASTER_TIMEOUT_MAX 0x00cc
269 #define AR9344_AHB_MASTER_TIMEOUT_CURRENT 0x00d0
270 #define AR9344_AHB_MASTER_TIMEOUT_SLAVE_ADDR 0x00d4
271 #define AR9344_DDR_CTL_CONFIG 0x0108
272 #define AR9344_DDR_SF_CTL 0x0110
273 #define AR9344_SF_TIMER 0x0114
274 #define AR9344_WMAC_FLUSH 0x0128
275
276 /* memory config 1 bits */
277 #define AR9344_MEM_CFG1_BANK0 __BITS(8,10)
278 #define AR9344_MEM_CFG1_BANK1 __BITS(12,14)
279
280 #define ARCHIP_REG_DDR_WB_FLUSH_GMAC0 0x009c
281 #define ARCHIP_REG_DDR_WB_FLUSH_GMAC1 0x00a0
282 #define ARCHIP_REG_DDR_WB_FLUSH_USB 0x00a4
283 #define AR9344_REG_DDR_WB_FLUSH_PCIERC 0x00a8
284 #define AR7100_REG_DDR_WB_FLUSH_PCI 0x00a8
285 #define AR9344_REG_DDR_WB_FLUSH_WMAC 0x00ac
286 #define AR9344_REG_DDR_WB_FLUSH_PCIEEP 0x00b0
287 #define AR9344_REG_DDR_WB_FLUSH_CSUM 0x00b4
288
289 #define AR7100_PCI_WINDOW_0 0x7c
290 #define AR7100_PCI_WINDOW_1 0x80
291 #define AR7100_PCI_WINDOW_2 0x84
292 #define AR7100_PCI_WINDOW_3 0x88
293 #define AR7100_PCI_WINDOW_4 0x8c
294 #define AR7100_PCI_WINDOW_5 0x90
295 #define AR7100_PCI_WINDOW_6 0x94
296 #define AR7100_PCI_WINDOW_7 0x98
297
298 #define AR7100_PCI_LCL_CFG_CMD 0x00
299 #define AR7100_PCI_LCL_CFG_CMD_BE __BITS(20,23)
300 #define AR7100_PCI_LCL_CFG_CMD_CMD __BITS(16,19)
301 #define AR7100_PCI_LCL_CFG_CMD_READ __SHIFTIN(0, AR7100_PCI_LCL_CFG_CMD_CMD)
302 #define AR7100_PCI_LCL_CFG_CMD_WRITE __SHIFTIN(1, AR7100_PCI_LCL_CFG_CMD_CMD)
303 #define AR7100_PCI_LCL_CFG_CMD_ADDRESS __BITS(0,11)
304 #define AR7100_PCI_LCL_CFG_WDATA 0x04
305 #define AR7100_PCI_LCL_CFG_RDATA 0x08
306 #define AR7100_PCI_CFG_ADDR 0x0c
307 #define AR7100_PCI_CFG_CMD 0x10
308 #define AR7100_PCI_CFG_CMD_BE __BITS(4,7)
309 #define AR7100_PCI_CFG_CMD_CMD __BITS(0,3)
310 #define AR7100_PCI_CFG_WDATA 0x14
311 #define AR7100_PCI_CFG_RDATA 0x18
312 #define AR7100_PCI_ERROR 0x1c
313 #define AR7100_PCI_ERROR_PARITY __BIT(0)
314 #define AR7100_PCI_ERROR_FATAL __BIT(1)
315 #define AR7100_PCI_ERROR_ADDR 0x20
316 #define AR7100_AHB_ERROR 0x24
317 #define AR7100_AHB_ERROR_ADDR 0x28
318
319 #define AR9344_SPI_FUNCTION_SELECT 0x0000
320 #define AR9344_SPI_FUNCTION_SLEECT_FUNCTION_SELECT __BIT(0)
321 #define AR9344_SPI_CONTROL 0x0004
322 #define AR9344_SPI_CONTROL_TSHSL_CNT __BITS(8,13)
323 #define AR9344_SPI_CONTROL_SPI_RELOCATE __BIT(7)
324 #define AR9344_SPI_CONTROL_REMAP_DISABLE __BIT(6)
325 #define AR9344_SPI_CONTROL_CLOCK_DIVIDER __BITS(0,5)
326 #define AR9344_SPI_IO_CONTROL 0x0008
327 #define AR9344_SPI_IO_CONTROL_IO_CS2_DISABLE __BIT(18)
328 #define AR9344_SPI_IO_CONTROL_IO_CS1_DISABLE __BIT(17)
329 #define AR9344_SPI_IO_CONTROL_IO_CS0_DISABLE __BIT(16)
330 #define AR9344_SPI_IO_CONTROL_IO_CLK __BIT(8)
331 #define AR9344_SPI_IO_CONTROL_IO_DO __BIT(0)
332 #define AR9344_SPI_READ_DATA 0x000c
333 #define AR9344_SPI_SHIFT_DATAOUT 0x0010
334 #define AR9344_SPI_SHIFT_CNT 0x0014
335 #define AR9344_SPI_SHIFT_CNT_SHIFT_EN __BIT(31)
336 #define AR9344_SPI_SHIFT_CNT_SHIFT_CHNL_2 __BIT(30)
337 #define AR9344_SPI_SHIFT_CNT_SHIFT_CHNL_1 __BIT(29)
338 #define AR9344_SPI_SHIFT_CNT_SHIFT_CHNL_0 __BIT(28)
339 #define AR9344_SPI_SHIFT_CNT_SHIFT_CLKOUT __BIT(27)
340 #define AR9344_SPI_SHIFT_CNT_TERMINATE __BIT(26)
341 #define AR9344_SPI_SHIFT_CNT_SHIFT_COUNT __BITS(0,6)
342 #define AR9344_SPI_SHIFT_DATAIN 0x0018
343
344 /* helper macro for accessing system registers without bus space */
345 #define REGVAL(x) *((volatile uint32_t *)(MIPS_PHYS_TO_KSEG1((x))))
346 #define GETRESETREG(x) REGVAL((x) + ARCHIP_RESET_BASE)
347 #define PUTRESETREG(x,v) (REGVAL((x) + ARCHIP_RESET_BASE)) = (v)
348 #define GETPLLREG(x) REGVAL((x) + ARCHIP_PLL_BASE)
349 #define PUTPLLREG(x,v) (REGVAL((x) + ARCHIP_PLL_BASE)) = (v)
350 #define GETDDRREG(x) REGVAL((x) + ARCHIP_DDR_BASE)
351 #define PUTDDRREG(x,v) (REGVAL((x) + ARCHIP_DDR_BASE)) = (v)
352
353 /*
354 * Interrupts.
355 */
356 #define AR9344_CPU_IRQ_PCIERC 0
357 #define AR7100_CPU_IRQ_PCI 0
358 #define ARCHIP_CPU_IRQ_USB 1
359 #define ARCHIP_CPU_IRQ_GMAC0 2
360 #define ARCHIP_CPU_IRQ_GMAC1 3
361 #define ARCHIP_CPU_IRQ_MISC 4
362 #define ARCHIP_CPU_IRQ_TIMER 5
363 #define AR9344_CPU_IRQ_PCIEEP_HSTDMA 6
364
365 #define AR9344_MISC_IRQ_TIMER 0
366 #define AR9344_MISC_IRQ_ERROR 1
367 #define AR9344_MISC_IRQ_GPIO 2
368 #define AR9344_MISC_IRQ_UART0 3
369 #define AR9344_MISC_IRQ_WDOG 4
370 #define AR9344_MISC_IRQ_PC 5
371 #define AR9344_MISC_IRQ_UART1 6
372 #define AR9344_MISC_IRQ_MBOX 7
373 #define AR9344_MISC_IRQ_TIMER2 8
374 #define AR9344_MISC_IRQ_TIMER3 9
375 #define AR9344_MISC_IRQ_TIMER4 10
376 #define AR9344_MISC_IRQ_DDR_PERF 11
377 #define AR9344_MISC_IRQ_SW_MAC 12
378 #define AR9344_MISC_IRQ_LUTS_AGER 13
379 #define AR9344_MISC_IRQ_RES14 14
380 #define AR9344_MISC_IRQ_CHKSUM_ACC 15
381 #define AR9344_MISC_IRQ_DDR_SF_ENTRY 16
382 #define AR9344_MISC_IRQ_DDR_SF_EXIT 17
383 #define AR9344_MISC_IRQ_DDR_ACT_IN_SF 18
384 #define AR9344_MISC_IRQ_SLIC 19
385 #define AR9344_MISC_IRQ_WOW 20
386 #define AR9344_MISC_IRQ_NANDF 21
387
388 #define AR7100_MISC_IRQ_TIMER 0
389 #define AR7100_MISC_IRQ_ERROR 1
390 #define AR7100_MISC_IRQ_GPIO 2
391 #define AR7100_MISC_IRQ_UART0 3
392 #define AR7100_MISC_IRQ_WDOG 4
393 #define AR7100_MISC_IRQ_PC 5
394 #define AR7100_MISC_IRQ_OHCI 6
395 #define AR7100_MISC_IRQ_DMA 7
396
397 #define AR9344_WMAC_IRQ_WMAC_MISC_INT 0
398 #define AR9344_WMAC_IRQ_WMAC_TX_INT 1
399 #define AR9344_WMAC_IRQ_WMAC_RXLP_INT 2
400 #define AR9344_WMAC_IRQ_WMAC_RXHP_INT 3
401 #define AR9344_WMAC_IRQ_PCIE_RC_INT 4
402 #define AR9344_WMAC_IRQ_PCIE_RC_INT0 5
403 #define AR9344_WMAC_IRQ_PCIE_RC_INT1 6
404 #define AR9344_WMAC_IRQ_PCIE_RC_INT2 7
405 #define AR9344_WMAC_IRQ_PCIE_RC_INT3 8
406
407 #endif /* _MIPS_ATHEROS_AR9344REG_H_ */
408