xref: /linux/arch/mips/include/asm/mach-ath79/ar71xx_regs.h (revision 42184768b36b2dad88a3705d689891b5da884c85)
1d4a67d9dSGabor Juhos /*
2d4a67d9dSGabor Juhos  *  Atheros AR71XX/AR724X/AR913X SoC register definitions
3d4a67d9dSGabor Juhos  *
4703327ddSGabor Juhos  *  Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
5d4a67d9dSGabor Juhos  *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
6d4a67d9dSGabor Juhos  *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7d4a67d9dSGabor Juhos  *
8703327ddSGabor Juhos  *  Parts of this file are based on Atheros' 2.6.15/2.6.31 BSP
9d4a67d9dSGabor Juhos  *
10d4a67d9dSGabor Juhos  *  This program is free software; you can redistribute it and/or modify it
11d4a67d9dSGabor Juhos  *  under the terms of the GNU General Public License version 2 as published
12d4a67d9dSGabor Juhos  *  by the Free Software Foundation.
13d4a67d9dSGabor Juhos  */
14d4a67d9dSGabor Juhos 
15d4a67d9dSGabor Juhos #ifndef __ASM_MACH_AR71XX_REGS_H
16d4a67d9dSGabor Juhos #define __ASM_MACH_AR71XX_REGS_H
17d4a67d9dSGabor Juhos 
18d4a67d9dSGabor Juhos #include <linux/types.h>
19d4a67d9dSGabor Juhos #include <linux/init.h>
20d4a67d9dSGabor Juhos #include <linux/io.h>
21d4a67d9dSGabor Juhos #include <linux/bitops.h>
22d4a67d9dSGabor Juhos 
23d4a67d9dSGabor Juhos #define AR71XX_APB_BASE		0x18000000
247e98aa46SGabor Juhos #define AR71XX_EHCI_BASE	0x1b000000
257e98aa46SGabor Juhos #define AR71XX_EHCI_SIZE	0x1000
267e98aa46SGabor Juhos #define AR71XX_OHCI_BASE	0x1c000000
277e98aa46SGabor Juhos #define AR71XX_OHCI_SIZE	0x1000
2868a1d316SGabor Juhos #define AR71XX_SPI_BASE		0x1f000000
2968a1d316SGabor Juhos #define AR71XX_SPI_SIZE		0x01000000
30d4a67d9dSGabor Juhos 
31d4a67d9dSGabor Juhos #define AR71XX_DDR_CTRL_BASE	(AR71XX_APB_BASE + 0x00000000)
32d4a67d9dSGabor Juhos #define AR71XX_DDR_CTRL_SIZE	0x100
33d4a67d9dSGabor Juhos #define AR71XX_UART_BASE	(AR71XX_APB_BASE + 0x00020000)
34d4a67d9dSGabor Juhos #define AR71XX_UART_SIZE	0x100
357e98aa46SGabor Juhos #define AR71XX_USB_CTRL_BASE	(AR71XX_APB_BASE + 0x00030000)
367e98aa46SGabor Juhos #define AR71XX_USB_CTRL_SIZE	0x100
376eae43c5SGabor Juhos #define AR71XX_GPIO_BASE        (AR71XX_APB_BASE + 0x00040000)
386eae43c5SGabor Juhos #define AR71XX_GPIO_SIZE        0x100
39d4a67d9dSGabor Juhos #define AR71XX_PLL_BASE		(AR71XX_APB_BASE + 0x00050000)
40d4a67d9dSGabor Juhos #define AR71XX_PLL_SIZE		0x100
41d4a67d9dSGabor Juhos #define AR71XX_RESET_BASE	(AR71XX_APB_BASE + 0x00060000)
42d4a67d9dSGabor Juhos #define AR71XX_RESET_SIZE	0x100
43d4a67d9dSGabor Juhos 
447e98aa46SGabor Juhos #define AR7240_USB_CTRL_BASE	(AR71XX_APB_BASE + 0x00030000)
457e98aa46SGabor Juhos #define AR7240_USB_CTRL_SIZE	0x100
467e98aa46SGabor Juhos #define AR7240_OHCI_BASE	0x1b000000
477e98aa46SGabor Juhos #define AR7240_OHCI_SIZE	0x1000
487e98aa46SGabor Juhos 
497e98aa46SGabor Juhos #define AR724X_EHCI_BASE	0x1b000000
507e98aa46SGabor Juhos #define AR724X_EHCI_SIZE	0x1000
517e98aa46SGabor Juhos 
527e98aa46SGabor Juhos #define AR913X_EHCI_BASE	0x1b000000
537e98aa46SGabor Juhos #define AR913X_EHCI_SIZE	0x1000
54f5b35d0bSGabor Juhos #define AR913X_WMAC_BASE	(AR71XX_APB_BASE + 0x000C0000)
55f5b35d0bSGabor Juhos #define AR913X_WMAC_SIZE	0x30000
56f5b35d0bSGabor Juhos 
570bd3acdfSGabor Juhos #define AR933X_UART_BASE	(AR71XX_APB_BASE + 0x00020000)
580bd3acdfSGabor Juhos #define AR933X_UART_SIZE	0x14
5934cfcd26SGabor Juhos #define AR933X_WMAC_BASE	(AR71XX_APB_BASE + 0x00100000)
6034cfcd26SGabor Juhos #define AR933X_WMAC_SIZE	0x20000
61c279b775SGabor Juhos #define AR933X_EHCI_BASE	0x1b000000
62c279b775SGabor Juhos #define AR933X_EHCI_SIZE	0x1000
63c279b775SGabor Juhos 
64d4a67d9dSGabor Juhos /*
65d4a67d9dSGabor Juhos  * DDR_CTRL block
66d4a67d9dSGabor Juhos  */
67d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN0		0x7c
68d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN1		0x80
69d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN2		0x84
70d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN3		0x88
71d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN4		0x8c
72d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN5		0x90
73d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN6		0x94
74d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN7		0x98
75d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE0	0x9c
76d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE1	0xa0
77d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_USB	0xa4
78d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_PCI	0xa8
79d4a67d9dSGabor Juhos 
80d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE0	0x7c
81d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE1	0x80
82d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_USB	0x84
83d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_PCIE	0x88
84d4a67d9dSGabor Juhos 
85d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE0	0x7c
86d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE1	0x80
87d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_USB	0x84
88d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_WMAC	0x88
89d4a67d9dSGabor Juhos 
9054eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE0	0x7c
9154eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE1	0x80
9254eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_USB	0x84
9354eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_WMAC	0x88
9454eed4c7SGabor Juhos 
95fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_GE0	0x9c
96fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_GE1	0xa0
97fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_USB	0xa4
98fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_PCIE	0xa8
99fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_WMAC	0xac
100fce5cc6eSGabor Juhos 
101d4a67d9dSGabor Juhos /*
102d4a67d9dSGabor Juhos  * PLL block
103d4a67d9dSGabor Juhos  */
104d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_CPU_CONFIG	0x00
105d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_SEC_CONFIG	0x04
106d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH0_INT_CLOCK	0x10
107d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH1_INT_CLOCK	0x14
108d4a67d9dSGabor Juhos 
109d4a67d9dSGabor Juhos #define AR71XX_PLL_DIV_SHIFT		3
110d4a67d9dSGabor Juhos #define AR71XX_PLL_DIV_MASK		0x1f
111d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_SHIFT		16
112d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_MASK		0x3
113d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_SHIFT		18
114d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_MASK		0x3
115d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_SHIFT		20
116d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_MASK		0x7
117d4a67d9dSGabor Juhos 
118d4a67d9dSGabor Juhos #define AR724X_PLL_REG_CPU_CONFIG	0x00
119d4a67d9dSGabor Juhos #define AR724X_PLL_REG_PCIE_CONFIG	0x18
120d4a67d9dSGabor Juhos 
121d4a67d9dSGabor Juhos #define AR724X_PLL_DIV_SHIFT		0
122d4a67d9dSGabor Juhos #define AR724X_PLL_DIV_MASK		0x3ff
123d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_SHIFT	10
124d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_MASK		0xf
125d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_SHIFT		19
126d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_MASK		0x1
127d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_SHIFT		22
128d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_MASK		0x3
129d4a67d9dSGabor Juhos 
130d4a67d9dSGabor Juhos #define AR913X_PLL_REG_CPU_CONFIG	0x00
131d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH_CONFIG	0x04
132d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH0_INT_CLOCK	0x14
133d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH1_INT_CLOCK	0x18
134d4a67d9dSGabor Juhos 
135d4a67d9dSGabor Juhos #define AR913X_PLL_DIV_SHIFT		0
136d4a67d9dSGabor Juhos #define AR913X_PLL_DIV_MASK		0x3ff
137d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_SHIFT		22
138d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_MASK		0x3
139d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_SHIFT		19
140d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_MASK		0x1
141d4a67d9dSGabor Juhos 
14204225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REG	0x00
14304225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_REG	0x08
14404225e1dSGabor Juhos 
14504225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_SHIFT	10
14604225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_MASK		0x3f
14704225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT	16
14804225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_MASK	0x1f
14904225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT	23
15004225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK	0x7
15104225e1dSGabor Juhos 
15204225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_BYPASS		BIT(2)
15304225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_SHIFT	5
15404225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_MASK	0x3
15504225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_SHIFT	10
15604225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_MASK	0x3
15704225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT	15
15804225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK	0x7
15904225e1dSGabor Juhos 
1608889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REG		0x00
1618889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REG		0x04
1628889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG		0x08
1638889612bSGabor Juhos 
1648889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT	0
1658889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK	0x3f
1668889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT	6
1678889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_MASK		0x3f
1688889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT	12
1698889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK	0x1f
1708889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT	19
1718889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK	0x3
1728889612bSGabor Juhos 
1738889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT	0
1748889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK	0x3ff
1758889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT	10
1768889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_MASK		0x3f
1778889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT	16
1788889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK	0x1f
1798889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT	23
1808889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK	0x7
1818889612bSGabor Juhos 
1828889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS	BIT(2)
1838889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS	BIT(3)
1848889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS	BIT(4)
1858889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT	5
1868889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK	0x1f
1878889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT	10
1888889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK	0x1f
1898889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT	15
1908889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK	0x1f
1918889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL	BIT(20)
1928889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL	BIT(21)
1938889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL	BIT(24)
1948889612bSGabor Juhos 
195d4a67d9dSGabor Juhos /*
1967e98aa46SGabor Juhos  * USB_CONFIG block
1977e98aa46SGabor Juhos  */
1987e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_FLADJ	0x00
1997e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_CONFIG	0x04
2007e98aa46SGabor Juhos 
2017e98aa46SGabor Juhos /*
202d4a67d9dSGabor Juhos  * RESET block
203d4a67d9dSGabor Juhos  */
204d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER			0x00
205d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER_RELOAD		0x04
206d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG_CTRL		0x08
207d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG			0x0c
208d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_STATUS	0x10
209d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_ENABLE	0x14
210d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_STATUS		0x18
211d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_ENABLE		0x1c
212d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_GLOBAL_INT_STATUS	0x20
213d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_RESET_MODULE		0x24
214d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC_CTRL		0x2c
215d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC0			0x30
216d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC1			0x34
217d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_REV_ID			0x90
218d4a67d9dSGabor Juhos 
219d4a67d9dSGabor Juhos #define AR913X_RESET_REG_GLOBAL_INT_STATUS	0x18
220d4a67d9dSGabor Juhos #define AR913X_RESET_REG_RESET_MODULE		0x1c
221d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERF_CTRL		0x20
222d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC0			0x24
223d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC1			0x28
224d4a67d9dSGabor Juhos 
225d4a67d9dSGabor Juhos #define AR724X_RESET_REG_RESET_MODULE		0x1c
226d4a67d9dSGabor Juhos 
2277ee15d8aSGabor Juhos #define AR933X_RESET_REG_RESET_MODULE		0x1c
22804225e1dSGabor Juhos #define AR933X_RESET_REG_BOOTSTRAP		0xac
22904225e1dSGabor Juhos 
230*42184768SGabor Juhos #define AR934X_RESET_REG_RESET_MODULE		0x1c
2318889612bSGabor Juhos #define AR934X_RESET_REG_BOOTSTRAP		0xb0
232fce5cc6eSGabor Juhos #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS	0xac
2338889612bSGabor Juhos 
234d2b4ac1eSGabor Juhos #define MISC_INT_ETHSW			BIT(12)
235d2b4ac1eSGabor Juhos #define MISC_INT_TIMER4			BIT(10)
236d2b4ac1eSGabor Juhos #define MISC_INT_TIMER3			BIT(9)
237d2b4ac1eSGabor Juhos #define MISC_INT_TIMER2			BIT(8)
238d4a67d9dSGabor Juhos #define MISC_INT_DMA			BIT(7)
239d4a67d9dSGabor Juhos #define MISC_INT_OHCI			BIT(6)
240d4a67d9dSGabor Juhos #define MISC_INT_PERFC			BIT(5)
241d4a67d9dSGabor Juhos #define MISC_INT_WDOG			BIT(4)
242d4a67d9dSGabor Juhos #define MISC_INT_UART			BIT(3)
243d4a67d9dSGabor Juhos #define MISC_INT_GPIO			BIT(2)
244d4a67d9dSGabor Juhos #define MISC_INT_ERROR			BIT(1)
245d4a67d9dSGabor Juhos #define MISC_INT_TIMER			BIT(0)
246d4a67d9dSGabor Juhos 
247d4a67d9dSGabor Juhos #define AR71XX_RESET_EXTERNAL		BIT(28)
248d4a67d9dSGabor Juhos #define AR71XX_RESET_FULL_CHIP		BIT(24)
249d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_NMI		BIT(21)
250d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_COLD		BIT(20)
251d4a67d9dSGabor Juhos #define AR71XX_RESET_DMA		BIT(19)
252d4a67d9dSGabor Juhos #define AR71XX_RESET_SLIC		BIT(18)
253d4a67d9dSGabor Juhos #define AR71XX_RESET_STEREO		BIT(17)
254d4a67d9dSGabor Juhos #define AR71XX_RESET_DDR		BIT(16)
255d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_MAC		BIT(13)
256d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_PHY		BIT(12)
257d4a67d9dSGabor Juhos #define AR71XX_RESET_USBSUS_OVERRIDE	BIT(10)
258d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_MAC		BIT(9)
259d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_PHY		BIT(8)
260d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_OHCI_DLL	BIT(6)
261d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_HOST		BIT(5)
262d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_PHY		BIT(4)
263d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_BUS		BIT(1)
264d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_CORE		BIT(0)
265d4a67d9dSGabor Juhos 
2667e98aa46SGabor Juhos #define AR7240_RESET_USB_HOST		BIT(5)
2677e98aa46SGabor Juhos #define AR7240_RESET_OHCI_DLL		BIT(3)
2687e98aa46SGabor Juhos 
269d4a67d9dSGabor Juhos #define AR724X_RESET_GE1_MDIO		BIT(23)
270d4a67d9dSGabor Juhos #define AR724X_RESET_GE0_MDIO		BIT(22)
271d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY_SERIAL	BIT(10)
272d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY		BIT(7)
273d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE		BIT(6)
2747e98aa46SGabor Juhos #define AR724X_RESET_USB_HOST		BIT(5)
2757e98aa46SGabor Juhos #define AR724X_RESET_USB_PHY		BIT(4)
2767e98aa46SGabor Juhos #define AR724X_RESET_USBSUS_OVERRIDE	BIT(3)
277d4a67d9dSGabor Juhos 
278d4a67d9dSGabor Juhos #define AR913X_RESET_AMBA2WMAC		BIT(22)
2797e98aa46SGabor Juhos #define AR913X_RESET_USBSUS_OVERRIDE	BIT(10)
2807e98aa46SGabor Juhos #define AR913X_RESET_USB_HOST		BIT(5)
2817e98aa46SGabor Juhos #define AR913X_RESET_USB_PHY		BIT(4)
282d4a67d9dSGabor Juhos 
28334cfcd26SGabor Juhos #define AR933X_RESET_WMAC		BIT(11)
284c279b775SGabor Juhos #define AR933X_RESET_USB_HOST		BIT(5)
285c279b775SGabor Juhos #define AR933X_RESET_USB_PHY		BIT(4)
286c279b775SGabor Juhos #define AR933X_RESET_USBSUS_OVERRIDE	BIT(3)
287c279b775SGabor Juhos 
28804225e1dSGabor Juhos #define AR933X_BOOTSTRAP_REF_CLK_40	BIT(0)
28904225e1dSGabor Juhos 
2908889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION8	BIT(23)
2918889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION7	BIT(22)
2928889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION6	BIT(21)
2938889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION5	BIT(20)
2948889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION4	BIT(19)
2958889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION3	BIT(18)
2968889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION2	BIT(17)
2978889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION1	BIT(16)
2988889612bSGabor Juhos #define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7)
2998889612bSGabor Juhos #define AR934X_BOOTSTRAP_PCIE_RC	BIT(6)
3008889612bSGabor Juhos #define AR934X_BOOTSTRAP_EJTAG_MODE	BIT(5)
3018889612bSGabor Juhos #define AR934X_BOOTSTRAP_REF_CLK_40	BIT(4)
3028889612bSGabor Juhos #define AR934X_BOOTSTRAP_BOOT_FROM_SPI	BIT(2)
3038889612bSGabor Juhos #define AR934X_BOOTSTRAP_SDRAM_DISABLED	BIT(1)
3048889612bSGabor Juhos #define AR934X_BOOTSTRAP_DDR1		BIT(0)
3058889612bSGabor Juhos 
306fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_MISC		BIT(0)
307fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_TX		BIT(1)
308fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_RXLP		BIT(2)
309fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_RXHP		BIT(3)
310fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC		BIT(4)
311fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC0		BIT(5)
312fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC1		BIT(6)
313fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC2		BIT(7)
314fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC3		BIT(8)
315fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_ALL \
316fce5cc6eSGabor Juhos 	(AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \
317fce5cc6eSGabor Juhos 	 AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP)
318fce5cc6eSGabor Juhos 
319fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_ALL \
320fce5cc6eSGabor Juhos 	(AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \
321fce5cc6eSGabor Juhos 	 AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \
322fce5cc6eSGabor Juhos 	 AR934X_PCIE_WMAC_INT_PCIE_RC3)
323fce5cc6eSGabor Juhos 
324d4a67d9dSGabor Juhos #define REV_ID_MAJOR_MASK		0xfff0
325d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR71XX		0x00a0
326d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR913X		0x00b0
327d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7240		0x00c0
328d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7241		0x0100
329d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7242		0x1100
3306d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9330		0x0110
3316d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9331		0x1110
332703327ddSGabor Juhos #define REV_ID_MAJOR_AR9341		0x0120
333703327ddSGabor Juhos #define REV_ID_MAJOR_AR9342		0x1120
334703327ddSGabor Juhos #define REV_ID_MAJOR_AR9344		0x2120
335d4a67d9dSGabor Juhos 
336d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_MASK	0x3
337d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7130	0x0
338d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7141	0x1
339d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7161	0x2
340d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_MASK	0x3
341d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_SHIFT	2
342d4a67d9dSGabor Juhos 
343d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_MASK	0x3
344d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9130	0x0
345d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9132	0x1
346d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_MASK	0x3
347d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_SHIFT	2
348d4a67d9dSGabor Juhos 
3496d1c8fdeSGabor Juhos #define AR933X_REV_ID_REVISION_MASK	0x3
3506d1c8fdeSGabor Juhos 
351d4a67d9dSGabor Juhos #define AR724X_REV_ID_REVISION_MASK	0x3
352d4a67d9dSGabor Juhos 
353d8411466SGabor Juhos #define AR934X_REV_ID_REVISION_MASK     0xf
354d8411466SGabor Juhos 
355d4a67d9dSGabor Juhos /*
356d4a67d9dSGabor Juhos  * SPI block
357d4a67d9dSGabor Juhos  */
358d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_FS	0x00	/* Function Select */
359d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_CTRL	0x04	/* SPI Control */
360d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_IOC	0x08	/* SPI I/O Control */
361d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_RDS	0x0c	/* Read Data Shift */
362d4a67d9dSGabor Juhos 
363d4a67d9dSGabor Juhos #define AR71XX_SPI_FS_GPIO	BIT(0)	/* Enable GPIO mode */
364d4a67d9dSGabor Juhos 
365d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_RD	BIT(6)	/* Remap Disable */
366d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_DIV_MASK 0x3f
367d4a67d9dSGabor Juhos 
368d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_DO	BIT(0)	/* Data Out pin */
369d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CLK	BIT(8)	/* CLK pin */
370d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS(n)	BIT(16 + (n))
371d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS0	AR71XX_SPI_IOC_CS(0)
372d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS1	AR71XX_SPI_IOC_CS(1)
373d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS2	AR71XX_SPI_IOC_CS(2)
374d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS_ALL	(AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \
375d4a67d9dSGabor Juhos 				 AR71XX_SPI_IOC_CS2)
376d4a67d9dSGabor Juhos 
3776eae43c5SGabor Juhos /*
3786eae43c5SGabor Juhos  * GPIO block
3796eae43c5SGabor Juhos  */
3806eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OE		0x00
3816eae43c5SGabor Juhos #define AR71XX_GPIO_REG_IN		0x04
3826eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OUT		0x08
3836eae43c5SGabor Juhos #define AR71XX_GPIO_REG_SET		0x0c
3846eae43c5SGabor Juhos #define AR71XX_GPIO_REG_CLEAR		0x10
3856eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_MODE	0x14
3866eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_TYPE	0x18
3876eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_POLARITY	0x1c
3886eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_PENDING	0x20
3896eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_ENABLE	0x24
3906eae43c5SGabor Juhos #define AR71XX_GPIO_REG_FUNC		0x28
3916eae43c5SGabor Juhos 
3926eae43c5SGabor Juhos #define AR71XX_GPIO_COUNT		16
3936eae43c5SGabor Juhos #define AR724X_GPIO_COUNT		18
3946eae43c5SGabor Juhos #define AR913X_GPIO_COUNT		22
395fdfbcf47SGabor Juhos #define AR933X_GPIO_COUNT		30
3965b5b544eSGabor Juhos #define AR934X_GPIO_COUNT		23
3976eae43c5SGabor Juhos 
398d4a67d9dSGabor Juhos #endif /* __ASM_MACH_AR71XX_REGS_H */
399