diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-01-04 15:28:14 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-01-18 13:30:24 -0500 |
commit | d4a67d9dc8a5a80c4ec1814791af8c0252c158b8 (patch) | |
tree | 28c9797f2ec5bf46325e1d5dd7db675ac0ac6713 /arch/mips/include/asm/mach-ath79/ar71xx_regs.h | |
parent | 94bb0c1ab293c298a8852e4f10c4215bad6daa9b (diff) |
MIPS: Add initial support for the Atheros AR71XX/AR724X/AR931X SoCs
This patch adds initial support for various Atheros SoCs based on the
MIPS 24Kc core. The following models are supported at the moment:
- AR7130
- AR7141
- AR7161
- AR9130
- AR9132
- AR7240
- AR7241
- AR7242
The current patch contains minimal support only, but the resulting
kernel can boot into user-space with using of an initramfs image on
various boards which are using these SoCs. Support for more built-in
devices and individual boards will be implemented in further patches.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Cc: Cliff Holden <Cliff.Holden@Atheros.com>
Cc: Kathy Giori <Kathy.Giori@Atheros.com>
Patchwork: https://patchwork.linux-mips.org/patch/1947/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/mach-ath79/ar71xx_regs.h')
-rw-r--r-- | arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h new file mode 100644 index 000000000000..5a9e5e179463 --- /dev/null +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * Atheros AR71XX/AR724X/AR913X SoC register definitions | ||
3 | * | ||
4 | * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> | ||
5 | * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> | ||
6 | * | ||
7 | * Parts of this file are based on Atheros' 2.6.15 BSP | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_MACH_AR71XX_REGS_H | ||
15 | #define __ASM_MACH_AR71XX_REGS_H | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/bitops.h> | ||
21 | |||
22 | #define AR71XX_APB_BASE 0x18000000 | ||
23 | |||
24 | #define AR71XX_DDR_CTRL_BASE (AR71XX_APB_BASE + 0x00000000) | ||
25 | #define AR71XX_DDR_CTRL_SIZE 0x100 | ||
26 | #define AR71XX_UART_BASE (AR71XX_APB_BASE + 0x00020000) | ||
27 | #define AR71XX_UART_SIZE 0x100 | ||
28 | #define AR71XX_PLL_BASE (AR71XX_APB_BASE + 0x00050000) | ||
29 | #define AR71XX_PLL_SIZE 0x100 | ||
30 | #define AR71XX_RESET_BASE (AR71XX_APB_BASE + 0x00060000) | ||
31 | #define AR71XX_RESET_SIZE 0x100 | ||
32 | |||
33 | /* | ||
34 | * DDR_CTRL block | ||
35 | */ | ||
36 | #define AR71XX_DDR_REG_PCI_WIN0 0x7c | ||
37 | #define AR71XX_DDR_REG_PCI_WIN1 0x80 | ||
38 | #define AR71XX_DDR_REG_PCI_WIN2 0x84 | ||
39 | #define AR71XX_DDR_REG_PCI_WIN3 0x88 | ||
40 | #define AR71XX_DDR_REG_PCI_WIN4 0x8c | ||
41 | #define AR71XX_DDR_REG_PCI_WIN5 0x90 | ||
42 | #define AR71XX_DDR_REG_PCI_WIN6 0x94 | ||
43 | #define AR71XX_DDR_REG_PCI_WIN7 0x98 | ||
44 | #define AR71XX_DDR_REG_FLUSH_GE0 0x9c | ||
45 | #define AR71XX_DDR_REG_FLUSH_GE1 0xa0 | ||
46 | #define AR71XX_DDR_REG_FLUSH_USB 0xa4 | ||
47 | #define AR71XX_DDR_REG_FLUSH_PCI 0xa8 | ||
48 | |||
49 | #define AR724X_DDR_REG_FLUSH_GE0 0x7c | ||
50 | #define AR724X_DDR_REG_FLUSH_GE1 0x80 | ||
51 | #define AR724X_DDR_REG_FLUSH_USB 0x84 | ||
52 | #define AR724X_DDR_REG_FLUSH_PCIE 0x88 | ||
53 | |||
54 | #define AR913X_DDR_REG_FLUSH_GE0 0x7c | ||
55 | #define AR913X_DDR_REG_FLUSH_GE1 0x80 | ||
56 | #define AR913X_DDR_REG_FLUSH_USB 0x84 | ||
57 | #define AR913X_DDR_REG_FLUSH_WMAC 0x88 | ||
58 | |||
59 | /* | ||
60 | * PLL block | ||
61 | */ | ||
62 | #define AR71XX_PLL_REG_CPU_CONFIG 0x00 | ||
63 | #define AR71XX_PLL_REG_SEC_CONFIG 0x04 | ||
64 | #define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10 | ||
65 | #define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14 | ||
66 | |||
67 | #define AR71XX_PLL_DIV_SHIFT 3 | ||
68 | #define AR71XX_PLL_DIV_MASK 0x1f | ||
69 | #define AR71XX_CPU_DIV_SHIFT 16 | ||
70 | #define AR71XX_CPU_DIV_MASK 0x3 | ||
71 | #define AR71XX_DDR_DIV_SHIFT 18 | ||
72 | #define AR71XX_DDR_DIV_MASK 0x3 | ||
73 | #define AR71XX_AHB_DIV_SHIFT 20 | ||
74 | #define AR71XX_AHB_DIV_MASK 0x7 | ||
75 | |||
76 | #define AR724X_PLL_REG_CPU_CONFIG 0x00 | ||
77 | #define AR724X_PLL_REG_PCIE_CONFIG 0x18 | ||
78 | |||
79 | #define AR724X_PLL_DIV_SHIFT 0 | ||
80 | #define AR724X_PLL_DIV_MASK 0x3ff | ||
81 | #define AR724X_PLL_REF_DIV_SHIFT 10 | ||
82 | #define AR724X_PLL_REF_DIV_MASK 0xf | ||
83 | #define AR724X_AHB_DIV_SHIFT 19 | ||
84 | #define AR724X_AHB_DIV_MASK 0x1 | ||
85 | #define AR724X_DDR_DIV_SHIFT 22 | ||
86 | #define AR724X_DDR_DIV_MASK 0x3 | ||
87 | |||
88 | #define AR913X_PLL_REG_CPU_CONFIG 0x00 | ||
89 | #define AR913X_PLL_REG_ETH_CONFIG 0x04 | ||
90 | #define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14 | ||
91 | #define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18 | ||
92 | |||
93 | #define AR913X_PLL_DIV_SHIFT 0 | ||
94 | #define AR913X_PLL_DIV_MASK 0x3ff | ||
95 | #define AR913X_DDR_DIV_SHIFT 22 | ||
96 | #define AR913X_DDR_DIV_MASK 0x3 | ||
97 | #define AR913X_AHB_DIV_SHIFT 19 | ||
98 | #define AR913X_AHB_DIV_MASK 0x1 | ||
99 | |||
100 | /* | ||
101 | * RESET block | ||
102 | */ | ||
103 | #define AR71XX_RESET_REG_TIMER 0x00 | ||
104 | #define AR71XX_RESET_REG_TIMER_RELOAD 0x04 | ||
105 | #define AR71XX_RESET_REG_WDOG_CTRL 0x08 | ||
106 | #define AR71XX_RESET_REG_WDOG 0x0c | ||
107 | #define AR71XX_RESET_REG_MISC_INT_STATUS 0x10 | ||
108 | #define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14 | ||
109 | #define AR71XX_RESET_REG_PCI_INT_STATUS 0x18 | ||
110 | #define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c | ||
111 | #define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20 | ||
112 | #define AR71XX_RESET_REG_RESET_MODULE 0x24 | ||
113 | #define AR71XX_RESET_REG_PERFC_CTRL 0x2c | ||
114 | #define AR71XX_RESET_REG_PERFC0 0x30 | ||
115 | #define AR71XX_RESET_REG_PERFC1 0x34 | ||
116 | #define AR71XX_RESET_REG_REV_ID 0x90 | ||
117 | |||
118 | #define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18 | ||
119 | #define AR913X_RESET_REG_RESET_MODULE 0x1c | ||
120 | #define AR913X_RESET_REG_PERF_CTRL 0x20 | ||
121 | #define AR913X_RESET_REG_PERFC0 0x24 | ||
122 | #define AR913X_RESET_REG_PERFC1 0x28 | ||
123 | |||
124 | #define AR724X_RESET_REG_RESET_MODULE 0x1c | ||
125 | |||
126 | #define MISC_INT_DMA BIT(7) | ||
127 | #define MISC_INT_OHCI BIT(6) | ||
128 | #define MISC_INT_PERFC BIT(5) | ||
129 | #define MISC_INT_WDOG BIT(4) | ||
130 | #define MISC_INT_UART BIT(3) | ||
131 | #define MISC_INT_GPIO BIT(2) | ||
132 | #define MISC_INT_ERROR BIT(1) | ||
133 | #define MISC_INT_TIMER BIT(0) | ||
134 | |||
135 | #define AR71XX_RESET_EXTERNAL BIT(28) | ||
136 | #define AR71XX_RESET_FULL_CHIP BIT(24) | ||
137 | #define AR71XX_RESET_CPU_NMI BIT(21) | ||
138 | #define AR71XX_RESET_CPU_COLD BIT(20) | ||
139 | #define AR71XX_RESET_DMA BIT(19) | ||
140 | #define AR71XX_RESET_SLIC BIT(18) | ||
141 | #define AR71XX_RESET_STEREO BIT(17) | ||
142 | #define AR71XX_RESET_DDR BIT(16) | ||
143 | #define AR71XX_RESET_GE1_MAC BIT(13) | ||
144 | #define AR71XX_RESET_GE1_PHY BIT(12) | ||
145 | #define AR71XX_RESET_USBSUS_OVERRIDE BIT(10) | ||
146 | #define AR71XX_RESET_GE0_MAC BIT(9) | ||
147 | #define AR71XX_RESET_GE0_PHY BIT(8) | ||
148 | #define AR71XX_RESET_USB_OHCI_DLL BIT(6) | ||
149 | #define AR71XX_RESET_USB_HOST BIT(5) | ||
150 | #define AR71XX_RESET_USB_PHY BIT(4) | ||
151 | #define AR71XX_RESET_PCI_BUS BIT(1) | ||
152 | #define AR71XX_RESET_PCI_CORE BIT(0) | ||
153 | |||
154 | #define AR724X_RESET_GE1_MDIO BIT(23) | ||
155 | #define AR724X_RESET_GE0_MDIO BIT(22) | ||
156 | #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) | ||
157 | #define AR724X_RESET_PCIE_PHY BIT(7) | ||
158 | #define AR724X_RESET_PCIE BIT(6) | ||
159 | #define AR724X_RESET_OHCI_DLL BIT(3) | ||
160 | |||
161 | #define AR913X_RESET_AMBA2WMAC BIT(22) | ||
162 | |||
163 | #define REV_ID_MAJOR_MASK 0xfff0 | ||
164 | #define REV_ID_MAJOR_AR71XX 0x00a0 | ||
165 | #define REV_ID_MAJOR_AR913X 0x00b0 | ||
166 | #define REV_ID_MAJOR_AR7240 0x00c0 | ||
167 | #define REV_ID_MAJOR_AR7241 0x0100 | ||
168 | #define REV_ID_MAJOR_AR7242 0x1100 | ||
169 | |||
170 | #define AR71XX_REV_ID_MINOR_MASK 0x3 | ||
171 | #define AR71XX_REV_ID_MINOR_AR7130 0x0 | ||
172 | #define AR71XX_REV_ID_MINOR_AR7141 0x1 | ||
173 | #define AR71XX_REV_ID_MINOR_AR7161 0x2 | ||
174 | #define AR71XX_REV_ID_REVISION_MASK 0x3 | ||
175 | #define AR71XX_REV_ID_REVISION_SHIFT 2 | ||
176 | |||
177 | #define AR913X_REV_ID_MINOR_MASK 0x3 | ||
178 | #define AR913X_REV_ID_MINOR_AR9130 0x0 | ||
179 | #define AR913X_REV_ID_MINOR_AR9132 0x1 | ||
180 | #define AR913X_REV_ID_REVISION_MASK 0x3 | ||
181 | #define AR913X_REV_ID_REVISION_SHIFT 2 | ||
182 | |||
183 | #define AR724X_REV_ID_REVISION_MASK 0x3 | ||
184 | |||
185 | /* | ||
186 | * SPI block | ||
187 | */ | ||
188 | #define AR71XX_SPI_REG_FS 0x00 /* Function Select */ | ||
189 | #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ | ||
190 | #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ | ||
191 | #define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ | ||
192 | |||
193 | #define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ | ||
194 | |||
195 | #define AR71XX_SPI_CTRL_RD BIT(6) /* Remap Disable */ | ||
196 | #define AR71XX_SPI_CTRL_DIV_MASK 0x3f | ||
197 | |||
198 | #define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ | ||
199 | #define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ | ||
200 | #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) | ||
201 | #define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0) | ||
202 | #define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1) | ||
203 | #define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2) | ||
204 | #define AR71XX_SPI_IOC_CS_ALL (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \ | ||
205 | AR71XX_SPI_IOC_CS2) | ||
206 | |||
207 | #endif /* __ASM_MACH_AR71XX_REGS_H */ | ||