1 |
1276 |
phoenix |
/*
|
2 |
|
|
*
|
3 |
|
|
* BRIEF MODULE DESCRIPTION
|
4 |
|
|
* Include file for Alchemy Semiconductor's Au1k CPU.
|
5 |
|
|
*
|
6 |
|
|
* Copyright 2000,2001 MontaVista Software Inc.
|
7 |
|
|
* Author: MontaVista Software, Inc.
|
8 |
|
|
* ppopov@mvista.com or source@mvista.com
|
9 |
|
|
*
|
10 |
|
|
* This program is free software; you can redistribute it and/or modify it
|
11 |
|
|
* under the terms of the GNU General Public License as published by the
|
12 |
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
13 |
|
|
* option) any later version.
|
14 |
|
|
*
|
15 |
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
16 |
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
17 |
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
18 |
|
|
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
19 |
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
20 |
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
21 |
|
|
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
22 |
|
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
24 |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25 |
|
|
*
|
26 |
|
|
* You should have received a copy of the GNU General Public License along
|
27 |
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
28 |
|
|
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
29 |
|
|
*/
|
30 |
|
|
|
31 |
|
|
/*
|
32 |
|
|
* some definitions add by takuzo@sm.sony.co.jp and sato@sm.sony.co.jp
|
33 |
|
|
*/
|
34 |
|
|
|
35 |
|
|
#ifndef _AU1000_H_
|
36 |
|
|
#define _AU1000_H_
|
37 |
|
|
|
38 |
|
|
#ifndef _LANGUAGE_ASSEMBLY
|
39 |
|
|
|
40 |
|
|
#include <linux/delay.h>
|
41 |
|
|
#include <asm/io.h>
|
42 |
|
|
|
43 |
|
|
/* cpu pipeline flush */
|
44 |
|
|
void static inline au_sync(void)
|
45 |
|
|
{
|
46 |
|
|
__asm__ volatile ("sync");
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
void static inline au_sync_udelay(int us)
|
50 |
|
|
{
|
51 |
|
|
__asm__ volatile ("sync");
|
52 |
|
|
udelay(us);
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
void static inline au_sync_delay(int ms)
|
56 |
|
|
{
|
57 |
|
|
__asm__ volatile ("sync");
|
58 |
|
|
mdelay(ms);
|
59 |
|
|
}
|
60 |
|
|
|
61 |
|
|
void static inline au_writeb(u8 val, int reg)
|
62 |
|
|
{
|
63 |
|
|
*(volatile u8 *)(reg) = val;
|
64 |
|
|
}
|
65 |
|
|
|
66 |
|
|
void static inline au_writew(u16 val, int reg)
|
67 |
|
|
{
|
68 |
|
|
*(volatile u16 *)(reg) = val;
|
69 |
|
|
}
|
70 |
|
|
|
71 |
|
|
void static inline au_writel(u32 val, int reg)
|
72 |
|
|
{
|
73 |
|
|
*(volatile u32 *)(reg) = val;
|
74 |
|
|
}
|
75 |
|
|
|
76 |
|
|
static inline u8 au_readb(unsigned long port)
|
77 |
|
|
{
|
78 |
|
|
return (*(volatile u8 *)port);
|
79 |
|
|
}
|
80 |
|
|
|
81 |
|
|
static inline u16 au_readw(unsigned long port)
|
82 |
|
|
{
|
83 |
|
|
return (*(volatile u16 *)port);
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
static inline u32 au_readl(unsigned long port)
|
87 |
|
|
{
|
88 |
|
|
return (*(volatile u32 *)port);
|
89 |
|
|
}
|
90 |
|
|
|
91 |
|
|
/* These next three functions should be a generic part of the MIPS
|
92 |
|
|
* kernel (with the 'au_' removed from the name) and selected for
|
93 |
|
|
* processors that support the instructions.
|
94 |
|
|
* Taken from PPC tree. -- Dan
|
95 |
|
|
*/
|
96 |
|
|
/* Return the bit position of the most significant 1 bit in a word */
|
97 |
|
|
static __inline__ int __ilog2(unsigned int x)
|
98 |
|
|
{
|
99 |
|
|
int lz;
|
100 |
|
|
|
101 |
|
|
asm volatile (
|
102 |
|
|
".set\tnoreorder\n\t"
|
103 |
|
|
".set\tnoat\n\t"
|
104 |
|
|
".set\tmips32\n\t"
|
105 |
|
|
"clz\t%0,%1\n\t"
|
106 |
|
|
".set\tmips0\n\t"
|
107 |
|
|
".set\tat\n\t"
|
108 |
|
|
".set\treorder"
|
109 |
|
|
: "=r" (lz)
|
110 |
|
|
: "r" (x));
|
111 |
|
|
|
112 |
|
|
return 31 - lz;
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
static __inline__ int au_ffz(unsigned int x)
|
116 |
|
|
{
|
117 |
|
|
if ((x = ~x) == 0)
|
118 |
|
|
return 32;
|
119 |
|
|
return __ilog2(x & -x);
|
120 |
|
|
}
|
121 |
|
|
|
122 |
|
|
/*
|
123 |
|
|
* ffs: find first bit set. This is defined the same way as
|
124 |
|
|
* the libc and compiler builtin ffs routines, therefore
|
125 |
|
|
* differs in spirit from the above ffz (man ffs).
|
126 |
|
|
*/
|
127 |
|
|
static __inline__ int au_ffs(int x)
|
128 |
|
|
{
|
129 |
|
|
return __ilog2(x & -x) + 1;
|
130 |
|
|
}
|
131 |
|
|
|
132 |
|
|
/* arch/mips/au1000/common/clocks.c */
|
133 |
|
|
extern void set_au1x00_speed(unsigned int new_freq);
|
134 |
|
|
extern unsigned int get_au1x00_speed(void);
|
135 |
|
|
extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
|
136 |
|
|
extern unsigned long get_au1x00_uart_baud_base(void);
|
137 |
|
|
extern void set_au1x00_lcd_clock(void);
|
138 |
|
|
extern unsigned int get_au1x00_lcd_clock(void);
|
139 |
|
|
|
140 |
|
|
/*
|
141 |
|
|
* Every board describes its IRQ mapping with this table.
|
142 |
|
|
*/
|
143 |
|
|
typedef struct au1xxx_irqmap {
|
144 |
|
|
int im_irq;
|
145 |
|
|
int im_type;
|
146 |
|
|
int im_request;
|
147 |
|
|
} au1xxx_irq_map_t;
|
148 |
|
|
|
149 |
|
|
/*
|
150 |
|
|
* init_IRQ looks for a table with this name.
|
151 |
|
|
*/
|
152 |
|
|
extern au1xxx_irq_map_t au1xxx_irq_map[];
|
153 |
|
|
|
154 |
|
|
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
|
155 |
|
|
|
156 |
|
|
#ifdef CONFIG_PM
|
157 |
|
|
/* no CP0 timer irq */
|
158 |
|
|
#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
|
159 |
|
|
#else
|
160 |
|
|
#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
|
161 |
|
|
#endif
|
162 |
|
|
|
163 |
|
|
/* SDRAM Controller */
|
164 |
|
|
#define MEM_SDMODE0 0xB4000000
|
165 |
|
|
#define MEM_SDMODE1 0xB4000004
|
166 |
|
|
#define MEM_SDMODE2 0xB4000008
|
167 |
|
|
|
168 |
|
|
#define MEM_SDADDR0 0xB400000C
|
169 |
|
|
#define MEM_SDADDR1 0xB4000010
|
170 |
|
|
#define MEM_SDADDR2 0xB4000014
|
171 |
|
|
|
172 |
|
|
#define MEM_SDREFCFG 0xB4000018
|
173 |
|
|
#define MEM_SDPRECMD 0xB400001C
|
174 |
|
|
#define MEM_SDAUTOREF 0xB4000020
|
175 |
|
|
|
176 |
|
|
#define MEM_SDWRMD0 0xB4000024
|
177 |
|
|
#define MEM_SDWRMD1 0xB4000028
|
178 |
|
|
#define MEM_SDWRMD2 0xB400002C
|
179 |
|
|
|
180 |
|
|
#define MEM_SDSLEEP 0xB4000030
|
181 |
|
|
#define MEM_SDSMCKE 0xB4000034
|
182 |
|
|
|
183 |
|
|
/* Static Bus Controller */
|
184 |
|
|
#define MEM_STCFG0 0xB4001000
|
185 |
|
|
#define MEM_STTIME0 0xB4001004
|
186 |
|
|
#define MEM_STADDR0 0xB4001008
|
187 |
|
|
|
188 |
|
|
#define MEM_STCFG1 0xB4001010
|
189 |
|
|
#define MEM_STTIME1 0xB4001014
|
190 |
|
|
#define MEM_STADDR1 0xB4001018
|
191 |
|
|
|
192 |
|
|
#define MEM_STCFG2 0xB4001020
|
193 |
|
|
#define MEM_STTIME2 0xB4001024
|
194 |
|
|
#define MEM_STADDR2 0xB4001028
|
195 |
|
|
|
196 |
|
|
#define MEM_STCFG3 0xB4001030
|
197 |
|
|
#define MEM_STTIME3 0xB4001034
|
198 |
|
|
#define MEM_STADDR3 0xB4001038
|
199 |
|
|
|
200 |
|
|
/* Interrupt Controller 0 */
|
201 |
|
|
#define IC0_CFG0RD 0xB0400040
|
202 |
|
|
#define IC0_CFG0SET 0xB0400040
|
203 |
|
|
#define IC0_CFG0CLR 0xB0400044
|
204 |
|
|
|
205 |
|
|
#define IC0_CFG1RD 0xB0400048
|
206 |
|
|
#define IC0_CFG1SET 0xB0400048
|
207 |
|
|
#define IC0_CFG1CLR 0xB040004C
|
208 |
|
|
|
209 |
|
|
#define IC0_CFG2RD 0xB0400050
|
210 |
|
|
#define IC0_CFG2SET 0xB0400050
|
211 |
|
|
#define IC0_CFG2CLR 0xB0400054
|
212 |
|
|
|
213 |
|
|
#define IC0_REQ0INT 0xB0400054
|
214 |
|
|
#define IC0_SRCRD 0xB0400058
|
215 |
|
|
#define IC0_SRCSET 0xB0400058
|
216 |
|
|
#define IC0_SRCCLR 0xB040005C
|
217 |
|
|
#define IC0_REQ1INT 0xB040005C
|
218 |
|
|
|
219 |
|
|
#define IC0_ASSIGNRD 0xB0400060
|
220 |
|
|
#define IC0_ASSIGNSET 0xB0400060
|
221 |
|
|
#define IC0_ASSIGNCLR 0xB0400064
|
222 |
|
|
|
223 |
|
|
#define IC0_WAKERD 0xB0400068
|
224 |
|
|
#define IC0_WAKESET 0xB0400068
|
225 |
|
|
#define IC0_WAKECLR 0xB040006C
|
226 |
|
|
|
227 |
|
|
#define IC0_MASKRD 0xB0400070
|
228 |
|
|
#define IC0_MASKSET 0xB0400070
|
229 |
|
|
#define IC0_MASKCLR 0xB0400074
|
230 |
|
|
|
231 |
|
|
#define IC0_RISINGRD 0xB0400078
|
232 |
|
|
#define IC0_RISINGCLR 0xB0400078
|
233 |
|
|
#define IC0_FALLINGRD 0xB040007C
|
234 |
|
|
#define IC0_FALLINGCLR 0xB040007C
|
235 |
|
|
|
236 |
|
|
#define IC0_TESTBIT 0xB0400080
|
237 |
|
|
|
238 |
|
|
/* Interrupt Controller 1 */
|
239 |
|
|
#define IC1_CFG0RD 0xB1800040
|
240 |
|
|
#define IC1_CFG0SET 0xB1800040
|
241 |
|
|
#define IC1_CFG0CLR 0xB1800044
|
242 |
|
|
|
243 |
|
|
#define IC1_CFG1RD 0xB1800048
|
244 |
|
|
#define IC1_CFG1SET 0xB1800048
|
245 |
|
|
#define IC1_CFG1CLR 0xB180004C
|
246 |
|
|
|
247 |
|
|
#define IC1_CFG2RD 0xB1800050
|
248 |
|
|
#define IC1_CFG2SET 0xB1800050
|
249 |
|
|
#define IC1_CFG2CLR 0xB1800054
|
250 |
|
|
|
251 |
|
|
#define IC1_REQ0INT 0xB1800054
|
252 |
|
|
#define IC1_SRCRD 0xB1800058
|
253 |
|
|
#define IC1_SRCSET 0xB1800058
|
254 |
|
|
#define IC1_SRCCLR 0xB180005C
|
255 |
|
|
#define IC1_REQ1INT 0xB180005C
|
256 |
|
|
|
257 |
|
|
#define IC1_ASSIGNRD 0xB1800060
|
258 |
|
|
#define IC1_ASSIGNSET 0xB1800060
|
259 |
|
|
#define IC1_ASSIGNCLR 0xB1800064
|
260 |
|
|
|
261 |
|
|
#define IC1_WAKERD 0xB1800068
|
262 |
|
|
#define IC1_WAKESET 0xB1800068
|
263 |
|
|
#define IC1_WAKECLR 0xB180006C
|
264 |
|
|
|
265 |
|
|
#define IC1_MASKRD 0xB1800070
|
266 |
|
|
#define IC1_MASKSET 0xB1800070
|
267 |
|
|
#define IC1_MASKCLR 0xB1800074
|
268 |
|
|
|
269 |
|
|
#define IC1_RISINGRD 0xB1800078
|
270 |
|
|
#define IC1_RISINGCLR 0xB1800078
|
271 |
|
|
#define IC1_FALLINGRD 0xB180007C
|
272 |
|
|
#define IC1_FALLINGCLR 0xB180007C
|
273 |
|
|
|
274 |
|
|
#define IC1_TESTBIT 0xB1800080
|
275 |
|
|
|
276 |
|
|
/* Interrupt Configuration Modes */
|
277 |
|
|
#define INTC_INT_DISABLED 0
|
278 |
|
|
#define INTC_INT_RISE_EDGE 0x1
|
279 |
|
|
#define INTC_INT_FALL_EDGE 0x2
|
280 |
|
|
#define INTC_INT_RISE_AND_FALL_EDGE 0x3
|
281 |
|
|
#define INTC_INT_HIGH_LEVEL 0x5
|
282 |
|
|
#define INTC_INT_LOW_LEVEL 0x6
|
283 |
|
|
#define INTC_INT_HIGH_AND_LOW_LEVEL 0x7
|
284 |
|
|
|
285 |
|
|
/* Interrupt Numbers */
|
286 |
|
|
#define AU1000_UART0_INT 0
|
287 |
|
|
#define AU1000_UART1_INT 1 /* au1000 */
|
288 |
|
|
#define AU1000_UART2_INT 2 /* au1000 */
|
289 |
|
|
|
290 |
|
|
#define AU1000_PCI_INTA 1 /* au1500 */
|
291 |
|
|
#define AU1000_PCI_INTB 2 /* au1500 */
|
292 |
|
|
|
293 |
|
|
#define AU1000_UART3_INT 3
|
294 |
|
|
|
295 |
|
|
#define AU1000_SSI0_INT 4 /* au1000 */
|
296 |
|
|
#define AU1000_SSI1_INT 5 /* au1000 */
|
297 |
|
|
|
298 |
|
|
#define AU1000_PCI_INTC 4 /* au1500 */
|
299 |
|
|
#define AU1000_PCI_INTD 5 /* au1500 */
|
300 |
|
|
|
301 |
|
|
#define AU1000_DMA_INT_BASE 6
|
302 |
|
|
#define AU1000_TOY_INT 14
|
303 |
|
|
#define AU1000_TOY_MATCH0_INT 15
|
304 |
|
|
#define AU1000_TOY_MATCH1_INT 16
|
305 |
|
|
#define AU1000_TOY_MATCH2_INT 17
|
306 |
|
|
#define AU1000_RTC_INT 18
|
307 |
|
|
#define AU1000_RTC_MATCH0_INT 19
|
308 |
|
|
#define AU1000_RTC_MATCH1_INT 20
|
309 |
|
|
#define AU1000_RTC_MATCH2_INT 21
|
310 |
|
|
#define AU1000_IRDA_TX_INT 22 /* au1000 */
|
311 |
|
|
#define AU1000_IRDA_RX_INT 23 /* au1000 */
|
312 |
|
|
#define AU1000_USB_DEV_REQ_INT 24
|
313 |
|
|
#define AU1000_USB_DEV_SUS_INT 25
|
314 |
|
|
#define AU1000_USB_HOST_INT 26
|
315 |
|
|
#define AU1000_ACSYNC_INT 27
|
316 |
|
|
#define AU1000_MAC0_DMA_INT 28
|
317 |
|
|
#define AU1000_MAC1_DMA_INT 29
|
318 |
|
|
#define AU1000_ETH0_IRQ AU1000_MAC0_DMA_INT
|
319 |
|
|
#define AU1000_ETH1_IRQ AU1000_MAC1_DMA_INT
|
320 |
|
|
#define AU1000_I2S_UO_INT 30 /* au1000 */
|
321 |
|
|
#define AU1000_AC97C_INT 31
|
322 |
|
|
#define AU1000_LAST_INTC0_INT AU1000_AC97C_INT
|
323 |
|
|
#define AU1000_GPIO_0 32
|
324 |
|
|
#define AU1000_GPIO_1 33
|
325 |
|
|
#define AU1000_GPIO_2 34
|
326 |
|
|
#define AU1000_GPIO_3 35
|
327 |
|
|
#define AU1000_GPIO_4 36
|
328 |
|
|
#define AU1000_GPIO_5 37
|
329 |
|
|
#define AU1000_GPIO_6 38
|
330 |
|
|
#define AU1000_GPIO_7 39
|
331 |
|
|
#define AU1000_GPIO_8 40
|
332 |
|
|
#define AU1000_GPIO_9 41
|
333 |
|
|
#define AU1000_GPIO_10 42
|
334 |
|
|
#define AU1000_GPIO_11 43
|
335 |
|
|
#define AU1000_GPIO_12 44
|
336 |
|
|
#define AU1000_GPIO_13 45
|
337 |
|
|
#define AU1000_GPIO_14 46
|
338 |
|
|
#define AU1000_GPIO_15 47
|
339 |
|
|
|
340 |
|
|
/* Au1000 only */
|
341 |
|
|
#define AU1000_GPIO_16 48
|
342 |
|
|
#define AU1000_GPIO_17 49
|
343 |
|
|
#define AU1000_GPIO_18 50
|
344 |
|
|
#define AU1000_GPIO_19 51
|
345 |
|
|
#define AU1000_GPIO_20 52
|
346 |
|
|
#define AU1000_GPIO_21 53
|
347 |
|
|
#define AU1000_GPIO_22 54
|
348 |
|
|
#define AU1000_GPIO_23 55
|
349 |
|
|
#define AU1000_GPIO_24 56
|
350 |
|
|
#define AU1000_GPIO_25 57
|
351 |
|
|
#define AU1000_GPIO_26 58
|
352 |
|
|
#define AU1000_GPIO_27 59
|
353 |
|
|
#define AU1000_GPIO_28 60
|
354 |
|
|
#define AU1000_GPIO_29 61
|
355 |
|
|
#define AU1000_GPIO_30 62
|
356 |
|
|
#define AU1000_GPIO_31 63
|
357 |
|
|
|
358 |
|
|
/* Au1500 only */
|
359 |
|
|
#define AU1500_GPIO_200 48
|
360 |
|
|
#define AU1500_GPIO_201 49
|
361 |
|
|
#define AU1500_GPIO_202 50
|
362 |
|
|
#define AU1500_GPIO_203 51
|
363 |
|
|
#define AU1500_GPIO_20 52
|
364 |
|
|
#define AU1500_GPIO_204 53
|
365 |
|
|
#define AU1500_GPIO_205 54
|
366 |
|
|
#define AU1500_GPIO_23 55
|
367 |
|
|
#define AU1500_GPIO_24 56
|
368 |
|
|
#define AU1500_GPIO_25 57
|
369 |
|
|
#define AU1500_GPIO_26 58
|
370 |
|
|
#define AU1500_GPIO_27 59
|
371 |
|
|
#define AU1500_GPIO_28 60
|
372 |
|
|
#define AU1500_GPIO_206 61
|
373 |
|
|
#define AU1500_GPIO_207 62
|
374 |
|
|
#define AU1500_GPIO_208_215 63
|
375 |
|
|
|
376 |
|
|
#define AU1000_MAX_INTR 63
|
377 |
|
|
|
378 |
|
|
#define AU1100_SD 2
|
379 |
|
|
#define AU1100_GPIO_208_215 29
|
380 |
|
|
// Seperate defines for AU1550 SOC
|
381 |
|
|
#define AU1550_UART0_INT AU1000_UART0_INT
|
382 |
|
|
#define AU1550_PCI_INTA AU1000_PCI_INTA
|
383 |
|
|
#define AU1550_PCI_INTB AU1000_PCI_INTB
|
384 |
|
|
#define AU1550_DDMA_INT 3
|
385 |
|
|
#define AU1550_CRYPTO_INT 4
|
386 |
|
|
#define AU1550_PCI_INTC 5
|
387 |
|
|
#define AU1550_PCI_INTD 6
|
388 |
|
|
#define AU1550_PCI_RST_INT 7
|
389 |
|
|
#define AU1550_UART1_INT 8
|
390 |
|
|
#define AU1550_UART3_INT 9
|
391 |
|
|
#define AU1550_PSC0_INT 10
|
392 |
|
|
#define AU1550_PSC1_INT 11
|
393 |
|
|
#define AU1550_PSC2_INT 12
|
394 |
|
|
#define AU1550_PSC3_INT 13
|
395 |
|
|
#define AU1550_TOY_INT 14
|
396 |
|
|
#define AU1550_TOY_MATCH0_INT 15
|
397 |
|
|
#define AU1550_TOY_MATCH1_INT 16
|
398 |
|
|
#define AU1550_TOY_MATCH2_INT 17
|
399 |
|
|
#define AU1550_RTC_INT 18
|
400 |
|
|
#define AU1550_RTC_MATCH0_INT 19
|
401 |
|
|
#define AU1550_RTC_MATCH1_INT 20
|
402 |
|
|
#define AU1550_RTC_MATCH2_INT 21
|
403 |
|
|
#define AU1550_NAND_INT 23
|
404 |
|
|
#define AU1550_USB_DEV_REQ_INT 24
|
405 |
|
|
#define AU1550_USB_DEV_SUS_INT 25
|
406 |
|
|
#define AU1550_USB_HOST_INT 26
|
407 |
|
|
#define AU1550_MAC0_DMA_INT 27
|
408 |
|
|
#define AU1550_MAC1_DMA_INT 28
|
409 |
|
|
#define AU1550_ETH0_IRQ AU1550_MAC0_DMA_INT
|
410 |
|
|
#define AU1550_ETH1_IRQ AU1550_MAC1_DMA_INT
|
411 |
|
|
|
412 |
|
|
#define AU1550_GPIO_200 48
|
413 |
|
|
#define AU1500_GPIO_201_205 49 // Logical or of GPIO201:205
|
414 |
|
|
#define AU1500_GPIO_16 50
|
415 |
|
|
#define AU1500_GPIO_17 51
|
416 |
|
|
#define AU1500_GPIO_20 52
|
417 |
|
|
#define AU1500_GPIO_21 53
|
418 |
|
|
#define AU1500_GPIO_22 54
|
419 |
|
|
#define AU1500_GPIO_23 55
|
420 |
|
|
#define AU1500_GPIO_24 56
|
421 |
|
|
#define AU1500_GPIO_25 57
|
422 |
|
|
#define AU1500_GPIO_26 58
|
423 |
|
|
#define AU1500_GPIO_27 59
|
424 |
|
|
#define AU1500_GPIO_28 60
|
425 |
|
|
#define AU1500_GPIO_206 61
|
426 |
|
|
#define AU1500_GPIO_207 62
|
427 |
|
|
#define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218
|
428 |
|
|
|
429 |
|
|
// REDEFINE SECONDARY GPIO BLOCK INTO IC1 CONTROLLER HERE
|
430 |
|
|
|
431 |
|
|
|
432 |
|
|
/* Programmable Counters 0 and 1 */
|
433 |
|
|
#define SYS_BASE 0xB1900000
|
434 |
|
|
#define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
|
435 |
|
|
#define SYS_CNTRL_E1S (1<<23)
|
436 |
|
|
#define SYS_CNTRL_T1S (1<<20)
|
437 |
|
|
#define SYS_CNTRL_M21 (1<<19)
|
438 |
|
|
#define SYS_CNTRL_M11 (1<<18)
|
439 |
|
|
#define SYS_CNTRL_M01 (1<<17)
|
440 |
|
|
#define SYS_CNTRL_C1S (1<<16)
|
441 |
|
|
#define SYS_CNTRL_BP (1<<14)
|
442 |
|
|
#define SYS_CNTRL_EN1 (1<<13)
|
443 |
|
|
#define SYS_CNTRL_BT1 (1<<12)
|
444 |
|
|
#define SYS_CNTRL_EN0 (1<<11)
|
445 |
|
|
#define SYS_CNTRL_BT0 (1<<10)
|
446 |
|
|
#define SYS_CNTRL_E0 (1<<8)
|
447 |
|
|
#define SYS_CNTRL_E0S (1<<7)
|
448 |
|
|
#define SYS_CNTRL_32S (1<<5)
|
449 |
|
|
#define SYS_CNTRL_T0S (1<<4)
|
450 |
|
|
#define SYS_CNTRL_M20 (1<<3)
|
451 |
|
|
#define SYS_CNTRL_M10 (1<<2)
|
452 |
|
|
#define SYS_CNTRL_M00 (1<<1)
|
453 |
|
|
#define SYS_CNTRL_C0S (1<<0)
|
454 |
|
|
|
455 |
|
|
/* Programmable Counter 0 Registers */
|
456 |
|
|
#define SYS_TOYTRIM (SYS_BASE + 0)
|
457 |
|
|
#define SYS_TOYWRITE (SYS_BASE + 4)
|
458 |
|
|
#define SYS_TOYMATCH0 (SYS_BASE + 8)
|
459 |
|
|
#define SYS_TOYMATCH1 (SYS_BASE + 0xC)
|
460 |
|
|
#define SYS_TOYMATCH2 (SYS_BASE + 0x10)
|
461 |
|
|
#define SYS_TOYREAD (SYS_BASE + 0x40)
|
462 |
|
|
|
463 |
|
|
/* Programmable Counter 1 Registers */
|
464 |
|
|
#define SYS_RTCTRIM (SYS_BASE + 0x44)
|
465 |
|
|
#define SYS_RTCWRITE (SYS_BASE + 0x48)
|
466 |
|
|
#define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
|
467 |
|
|
#define SYS_RTCMATCH1 (SYS_BASE + 0x50)
|
468 |
|
|
#define SYS_RTCMATCH2 (SYS_BASE + 0x54)
|
469 |
|
|
#define SYS_RTCREAD (SYS_BASE + 0x58)
|
470 |
|
|
|
471 |
|
|
/* I2S Controller */
|
472 |
|
|
#define I2S_DATA 0xB1000000
|
473 |
|
|
#define I2S_DATA_MASK (0xffffff)
|
474 |
|
|
#define I2S_CONFIG 0xB1000004
|
475 |
|
|
#define I2S_CONFIG_XU (1<<25)
|
476 |
|
|
#define I2S_CONFIG_XO (1<<24)
|
477 |
|
|
#define I2S_CONFIG_RU (1<<23)
|
478 |
|
|
#define I2S_CONFIG_RO (1<<22)
|
479 |
|
|
#define I2S_CONFIG_TR (1<<21)
|
480 |
|
|
#define I2S_CONFIG_TE (1<<20)
|
481 |
|
|
#define I2S_CONFIG_TF (1<<19)
|
482 |
|
|
#define I2S_CONFIG_RR (1<<18)
|
483 |
|
|
#define I2S_CONFIG_RE (1<<17)
|
484 |
|
|
#define I2S_CONFIG_RF (1<<16)
|
485 |
|
|
#define I2S_CONFIG_PD (1<<11)
|
486 |
|
|
#define I2S_CONFIG_LB (1<<10)
|
487 |
|
|
#define I2S_CONFIG_IC (1<<9)
|
488 |
|
|
#define I2S_CONFIG_FM_BIT 7
|
489 |
|
|
#define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
|
490 |
|
|
#define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
|
491 |
|
|
#define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
|
492 |
|
|
#define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
|
493 |
|
|
#define I2S_CONFIG_TN (1<<6)
|
494 |
|
|
#define I2S_CONFIG_RN (1<<5)
|
495 |
|
|
#define I2S_CONFIG_SZ_BIT 0
|
496 |
|
|
#define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
|
497 |
|
|
|
498 |
|
|
#define I2S_CONTROL 0xB1000008
|
499 |
|
|
#define I2S_CONTROL_D (1<<1)
|
500 |
|
|
#define I2S_CONTROL_CE (1<<0)
|
501 |
|
|
|
502 |
|
|
/* USB Host Controller */
|
503 |
|
|
// We pass USB_OHCI_BASE to ioremap, so it needs to be a physical address
|
504 |
|
|
#if defined( CONFIG_SOC_AU1550 )
|
505 |
|
|
#define USB_OHCI_BASE 0x14020000
|
506 |
|
|
#define USB_OHCI_LEN 0x00100000
|
507 |
|
|
#define USB_HOST_CONFIG 0xB4027ffc
|
508 |
|
|
#else
|
509 |
|
|
#define USB_OHCI_BASE 0x10100000
|
510 |
|
|
#define USB_OHCI_LEN 0x00100000
|
511 |
|
|
#define USB_HOST_CONFIG 0xB017fffc
|
512 |
|
|
#endif
|
513 |
|
|
|
514 |
|
|
/* USB Device Controller */
|
515 |
|
|
#define USBD_EP0RD 0xB0200000
|
516 |
|
|
#define USBD_EP0WR 0xB0200004
|
517 |
|
|
#define USBD_EP2WR 0xB0200008
|
518 |
|
|
#define USBD_EP3WR 0xB020000C
|
519 |
|
|
#define USBD_EP4RD 0xB0200010
|
520 |
|
|
#define USBD_EP5RD 0xB0200014
|
521 |
|
|
#define USBD_INTEN 0xB0200018
|
522 |
|
|
#define USBD_INTSTAT 0xB020001C
|
523 |
|
|
#define USBDEV_INT_SOF (1<<12)
|
524 |
|
|
#define USBDEV_INT_HF_BIT 6
|
525 |
|
|
#define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
|
526 |
|
|
#define USBDEV_INT_CMPLT_BIT 0
|
527 |
|
|
#define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
|
528 |
|
|
#define USBD_CONFIG 0xB0200020
|
529 |
|
|
#define USBD_EP0CS 0xB0200024
|
530 |
|
|
#define USBD_EP2CS 0xB0200028
|
531 |
|
|
#define USBD_EP3CS 0xB020002C
|
532 |
|
|
#define USBD_EP4CS 0xB0200030
|
533 |
|
|
#define USBD_EP5CS 0xB0200034
|
534 |
|
|
#define USBDEV_CS_SU (1<<14)
|
535 |
|
|
#define USBDEV_CS_NAK (1<<13)
|
536 |
|
|
#define USBDEV_CS_ACK (1<<12)
|
537 |
|
|
#define USBDEV_CS_BUSY (1<<11)
|
538 |
|
|
#define USBDEV_CS_TSIZE_BIT 1
|
539 |
|
|
#define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
|
540 |
|
|
#define USBDEV_CS_STALL (1<<0)
|
541 |
|
|
#define USBD_EP0RDSTAT 0xB0200040
|
542 |
|
|
#define USBD_EP0WRSTAT 0xB0200044
|
543 |
|
|
#define USBD_EP2WRSTAT 0xB0200048
|
544 |
|
|
#define USBD_EP3WRSTAT 0xB020004C
|
545 |
|
|
#define USBD_EP4RDSTAT 0xB0200050
|
546 |
|
|
#define USBD_EP5RDSTAT 0xB0200054
|
547 |
|
|
#define USBDEV_FSTAT_FLUSH (1<<6)
|
548 |
|
|
#define USBDEV_FSTAT_UF (1<<5)
|
549 |
|
|
#define USBDEV_FSTAT_OF (1<<4)
|
550 |
|
|
#define USBDEV_FSTAT_FCNT_BIT 0
|
551 |
|
|
#define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
|
552 |
|
|
#define USBD_ENABLE 0xB0200058
|
553 |
|
|
#define USBDEV_ENABLE (1<<1)
|
554 |
|
|
#define USBDEV_CE (1<<0)
|
555 |
|
|
|
556 |
|
|
/* Ethernet Controllers */
|
557 |
|
|
#define AU1000_ETH0_BASE 0xB0500000
|
558 |
|
|
#define AU1000_ETH1_BASE 0xB0510000
|
559 |
|
|
#define AU1500_ETH0_BASE 0xB1500000
|
560 |
|
|
#define AU1500_ETH1_BASE 0xB1510000
|
561 |
|
|
#define AU1100_ETH0_BASE 0xB0500000
|
562 |
|
|
#define AU1550_ETH0_BASE 0xB0500000
|
563 |
|
|
#define AU1550_ETH1_BASE 0xB0510000
|
564 |
|
|
|
565 |
|
|
/* 4 byte offsets from AU1000_ETH_BASE */
|
566 |
|
|
#define MAC_CONTROL 0x0
|
567 |
|
|
#define MAC_RX_ENABLE (1<<2)
|
568 |
|
|
#define MAC_TX_ENABLE (1<<3)
|
569 |
|
|
#define MAC_DEF_CHECK (1<<5)
|
570 |
|
|
#define MAC_SET_BL(X) (((X)&0x3)<<6)
|
571 |
|
|
#define MAC_AUTO_PAD (1<<8)
|
572 |
|
|
#define MAC_DISABLE_RETRY (1<<10)
|
573 |
|
|
#define MAC_DISABLE_BCAST (1<<11)
|
574 |
|
|
#define MAC_LATE_COL (1<<12)
|
575 |
|
|
#define MAC_HASH_MODE (1<<13)
|
576 |
|
|
#define MAC_HASH_ONLY (1<<15)
|
577 |
|
|
#define MAC_PASS_ALL (1<<16)
|
578 |
|
|
#define MAC_INVERSE_FILTER (1<<17)
|
579 |
|
|
#define MAC_PROMISCUOUS (1<<18)
|
580 |
|
|
#define MAC_PASS_ALL_MULTI (1<<19)
|
581 |
|
|
#define MAC_FULL_DUPLEX (1<<20)
|
582 |
|
|
#define MAC_NORMAL_MODE 0
|
583 |
|
|
#define MAC_INT_LOOPBACK (1<<21)
|
584 |
|
|
#define MAC_EXT_LOOPBACK (1<<22)
|
585 |
|
|
#define MAC_DISABLE_RX_OWN (1<<23)
|
586 |
|
|
#define MAC_BIG_ENDIAN (1<<30)
|
587 |
|
|
#define MAC_RX_ALL (1<<31)
|
588 |
|
|
#define MAC_ADDRESS_HIGH 0x4
|
589 |
|
|
#define MAC_ADDRESS_LOW 0x8
|
590 |
|
|
#define MAC_MCAST_HIGH 0xC
|
591 |
|
|
#define MAC_MCAST_LOW 0x10
|
592 |
|
|
#define MAC_MII_CNTRL 0x14
|
593 |
|
|
#define MAC_MII_BUSY (1<<0)
|
594 |
|
|
#define MAC_MII_READ 0
|
595 |
|
|
#define MAC_MII_WRITE (1<<1)
|
596 |
|
|
#define MAC_SET_MII_SELECT_REG(X) (((X)&0x1f)<<6)
|
597 |
|
|
#define MAC_SET_MII_SELECT_PHY(X) (((X)&0x1f)<<11)
|
598 |
|
|
#define MAC_MII_DATA 0x18
|
599 |
|
|
#define MAC_FLOW_CNTRL 0x1C
|
600 |
|
|
#define MAC_FLOW_CNTRL_BUSY (1<<0)
|
601 |
|
|
#define MAC_FLOW_CNTRL_ENABLE (1<<1)
|
602 |
|
|
#define MAC_PASS_CONTROL (1<<2)
|
603 |
|
|
#define MAC_SET_PAUSE(X) (((X)&0xffff)<<16)
|
604 |
|
|
#define MAC_VLAN1_TAG 0x20
|
605 |
|
|
#define MAC_VLAN2_TAG 0x24
|
606 |
|
|
|
607 |
|
|
/* Ethernet Controller Enable */
|
608 |
|
|
#define AU1000_MAC0_ENABLE 0xB0520000
|
609 |
|
|
#define AU1000_MAC1_ENABLE 0xB0520004
|
610 |
|
|
#define AU1500_MAC0_ENABLE 0xB1520000
|
611 |
|
|
#define AU1500_MAC1_ENABLE 0xB1520004
|
612 |
|
|
#define AU1100_MAC0_ENABLE 0xB0520000
|
613 |
|
|
|
614 |
|
|
#define MAC_EN_CLOCK_ENABLE (1<<0)
|
615 |
|
|
#define MAC_EN_RESET0 (1<<1)
|
616 |
|
|
#define MAC_EN_TOSS (0<<2)
|
617 |
|
|
#define MAC_EN_CACHEABLE (1<<3)
|
618 |
|
|
#define MAC_EN_RESET1 (1<<4)
|
619 |
|
|
#define MAC_EN_RESET2 (1<<5)
|
620 |
|
|
#define MAC_DMA_RESET (1<<6)
|
621 |
|
|
|
622 |
|
|
/* Ethernet Controller DMA Channels */
|
623 |
|
|
|
624 |
|
|
#define MAC0_TX_DMA_ADDR 0xB4004000
|
625 |
|
|
#define MAC1_TX_DMA_ADDR 0xB4004200
|
626 |
|
|
/* offsets from MAC_TX_RING_ADDR address */
|
627 |
|
|
#define MAC_TX_BUFF0_STATUS 0x0
|
628 |
|
|
#define TX_FRAME_ABORTED (1<<0)
|
629 |
|
|
#define TX_JAB_TIMEOUT (1<<1)
|
630 |
|
|
#define TX_NO_CARRIER (1<<2)
|
631 |
|
|
#define TX_LOSS_CARRIER (1<<3)
|
632 |
|
|
#define TX_EXC_DEF (1<<4)
|
633 |
|
|
#define TX_LATE_COLL_ABORT (1<<5)
|
634 |
|
|
#define TX_EXC_COLL (1<<6)
|
635 |
|
|
#define TX_UNDERRUN (1<<7)
|
636 |
|
|
#define TX_DEFERRED (1<<8)
|
637 |
|
|
#define TX_LATE_COLL (1<<9)
|
638 |
|
|
#define TX_COLL_CNT_MASK (0xF<<10)
|
639 |
|
|
#define TX_PKT_RETRY (1<<31)
|
640 |
|
|
#define MAC_TX_BUFF0_ADDR 0x4
|
641 |
|
|
#define TX_DMA_ENABLE (1<<0)
|
642 |
|
|
#define TX_T_DONE (1<<1)
|
643 |
|
|
#define TX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
|
644 |
|
|
#define MAC_TX_BUFF0_LEN 0x8
|
645 |
|
|
#define MAC_TX_BUFF1_STATUS 0x10
|
646 |
|
|
#define MAC_TX_BUFF1_ADDR 0x14
|
647 |
|
|
#define MAC_TX_BUFF1_LEN 0x18
|
648 |
|
|
#define MAC_TX_BUFF2_STATUS 0x20
|
649 |
|
|
#define MAC_TX_BUFF2_ADDR 0x24
|
650 |
|
|
#define MAC_TX_BUFF2_LEN 0x28
|
651 |
|
|
#define MAC_TX_BUFF3_STATUS 0x30
|
652 |
|
|
#define MAC_TX_BUFF3_ADDR 0x34
|
653 |
|
|
#define MAC_TX_BUFF3_LEN 0x38
|
654 |
|
|
|
655 |
|
|
#define MAC0_RX_DMA_ADDR 0xB4004100
|
656 |
|
|
#define MAC1_RX_DMA_ADDR 0xB4004300
|
657 |
|
|
/* offsets from MAC_RX_RING_ADDR */
|
658 |
|
|
#define MAC_RX_BUFF0_STATUS 0x0
|
659 |
|
|
#define RX_FRAME_LEN_MASK 0x3fff
|
660 |
|
|
#define RX_WDOG_TIMER (1<<14)
|
661 |
|
|
#define RX_RUNT (1<<15)
|
662 |
|
|
#define RX_OVERLEN (1<<16)
|
663 |
|
|
#define RX_COLL (1<<17)
|
664 |
|
|
#define RX_ETHER (1<<18)
|
665 |
|
|
#define RX_MII_ERROR (1<<19)
|
666 |
|
|
#define RX_DRIBBLING (1<<20)
|
667 |
|
|
#define RX_CRC_ERROR (1<<21)
|
668 |
|
|
#define RX_VLAN1 (1<<22)
|
669 |
|
|
#define RX_VLAN2 (1<<23)
|
670 |
|
|
#define RX_LEN_ERROR (1<<24)
|
671 |
|
|
#define RX_CNTRL_FRAME (1<<25)
|
672 |
|
|
#define RX_U_CNTRL_FRAME (1<<26)
|
673 |
|
|
#define RX_MCAST_FRAME (1<<27)
|
674 |
|
|
#define RX_BCAST_FRAME (1<<28)
|
675 |
|
|
#define RX_FILTER_FAIL (1<<29)
|
676 |
|
|
#define RX_PACKET_FILTER (1<<30)
|
677 |
|
|
#define RX_MISSED_FRAME (1<<31)
|
678 |
|
|
|
679 |
|
|
#define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
|
680 |
|
|
RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
|
681 |
|
|
RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
|
682 |
|
|
#define MAC_RX_BUFF0_ADDR 0x4
|
683 |
|
|
#define RX_DMA_ENABLE (1<<0)
|
684 |
|
|
#define RX_T_DONE (1<<1)
|
685 |
|
|
#define RX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
|
686 |
|
|
#define RX_SET_BUFF_ADDR(X) ((X)&0xffffffc0)
|
687 |
|
|
#define MAC_RX_BUFF1_STATUS 0x10
|
688 |
|
|
#define MAC_RX_BUFF1_ADDR 0x14
|
689 |
|
|
#define MAC_RX_BUFF2_STATUS 0x20
|
690 |
|
|
#define MAC_RX_BUFF2_ADDR 0x24
|
691 |
|
|
#define MAC_RX_BUFF3_STATUS 0x30
|
692 |
|
|
#define MAC_RX_BUFF3_ADDR 0x34
|
693 |
|
|
|
694 |
|
|
|
695 |
|
|
/* UARTS 0-3 */
|
696 |
|
|
#define UART0_ADDR 0xB1100000
|
697 |
|
|
#define UART1_ADDR 0xB1200000
|
698 |
|
|
#define UART2_ADDR 0xB1300000
|
699 |
|
|
#define UART3_ADDR 0xB1400000
|
700 |
|
|
#define UART_BASE UART0_ADDR
|
701 |
|
|
#define UART_DEBUG_BASE UART3_ADDR
|
702 |
|
|
|
703 |
|
|
#define UART_RX 0 /* Receive buffer */
|
704 |
|
|
#define UART_TX 4 /* Transmit buffer */
|
705 |
|
|
#define UART_IER 8 /* Interrupt Enable Register */
|
706 |
|
|
#define UART_IIR 0xC /* Interrupt ID Register */
|
707 |
|
|
#define UART_FCR 0x10 /* FIFO Control Register */
|
708 |
|
|
#define UART_LCR 0x14 /* Line Control Register */
|
709 |
|
|
#define UART_MCR 0x18 /* Modem Control Register */
|
710 |
|
|
#define UART_LSR 0x1C /* Line Status Register */
|
711 |
|
|
#define UART_MSR 0x20 /* Modem Status Register */
|
712 |
|
|
#define UART_CLK 0x28 /* Baud Rate Clock Divider */
|
713 |
|
|
#define UART_MOD_CNTRL 0x100 /* Module Control */
|
714 |
|
|
|
715 |
|
|
#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
|
716 |
|
|
#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
|
717 |
|
|
#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
|
718 |
|
|
#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
|
719 |
|
|
#define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
|
720 |
|
|
#define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
|
721 |
|
|
#define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
|
722 |
|
|
#define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
|
723 |
|
|
#define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
|
724 |
|
|
#define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
|
725 |
|
|
#define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
|
726 |
|
|
#define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
|
727 |
|
|
#define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
|
728 |
|
|
|
729 |
|
|
/*
|
730 |
|
|
* These are the definitions for the Line Control Register
|
731 |
|
|
*/
|
732 |
|
|
#define UART_LCR_SBC 0x40 /* Set break control */
|
733 |
|
|
#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
|
734 |
|
|
#define UART_LCR_EPAR 0x10 /* Even parity select */
|
735 |
|
|
#define UART_LCR_PARITY 0x08 /* Parity Enable */
|
736 |
|
|
#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
|
737 |
|
|
#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
|
738 |
|
|
#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
|
739 |
|
|
#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
|
740 |
|
|
#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
|
741 |
|
|
|
742 |
|
|
/*
|
743 |
|
|
* These are the definitions for the Line Status Register
|
744 |
|
|
*/
|
745 |
|
|
#define UART_LSR_TEMT 0x40 /* Transmitter empty */
|
746 |
|
|
#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
|
747 |
|
|
#define UART_LSR_BI 0x10 /* Break interrupt indicator */
|
748 |
|
|
#define UART_LSR_FE 0x08 /* Frame error indicator */
|
749 |
|
|
#define UART_LSR_PE 0x04 /* Parity error indicator */
|
750 |
|
|
#define UART_LSR_OE 0x02 /* Overrun error indicator */
|
751 |
|
|
#define UART_LSR_DR 0x01 /* Receiver data ready */
|
752 |
|
|
|
753 |
|
|
/*
|
754 |
|
|
* These are the definitions for the Interrupt Identification Register
|
755 |
|
|
*/
|
756 |
|
|
#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
|
757 |
|
|
#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
|
758 |
|
|
#define UART_IIR_MSI 0x00 /* Modem status interrupt */
|
759 |
|
|
#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
|
760 |
|
|
#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
|
761 |
|
|
#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
|
762 |
|
|
|
763 |
|
|
/*
|
764 |
|
|
* These are the definitions for the Interrupt Enable Register
|
765 |
|
|
*/
|
766 |
|
|
#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
|
767 |
|
|
#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
|
768 |
|
|
#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
|
769 |
|
|
#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
|
770 |
|
|
|
771 |
|
|
/*
|
772 |
|
|
* These are the definitions for the Modem Control Register
|
773 |
|
|
*/
|
774 |
|
|
#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
|
775 |
|
|
#define UART_MCR_OUT2 0x08 /* Out2 complement */
|
776 |
|
|
#define UART_MCR_OUT1 0x04 /* Out1 complement */
|
777 |
|
|
#define UART_MCR_RTS 0x02 /* RTS complement */
|
778 |
|
|
#define UART_MCR_DTR 0x01 /* DTR complement */
|
779 |
|
|
|
780 |
|
|
/*
|
781 |
|
|
* These are the definitions for the Modem Status Register
|
782 |
|
|
*/
|
783 |
|
|
#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
|
784 |
|
|
#define UART_MSR_RI 0x40 /* Ring Indicator */
|
785 |
|
|
#define UART_MSR_DSR 0x20 /* Data Set Ready */
|
786 |
|
|
#define UART_MSR_CTS 0x10 /* Clear to Send */
|
787 |
|
|
#define UART_MSR_DDCD 0x08 /* Delta DCD */
|
788 |
|
|
#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
|
789 |
|
|
#define UART_MSR_DDSR 0x02 /* Delta DSR */
|
790 |
|
|
#define UART_MSR_DCTS 0x01 /* Delta CTS */
|
791 |
|
|
#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
|
792 |
|
|
|
793 |
|
|
|
794 |
|
|
|
795 |
|
|
/* SSIO */
|
796 |
|
|
#define SSI0_STATUS 0xB1600000
|
797 |
|
|
#define SSI_STATUS_BF (1<<4)
|
798 |
|
|
#define SSI_STATUS_OF (1<<3)
|
799 |
|
|
#define SSI_STATUS_UF (1<<2)
|
800 |
|
|
#define SSI_STATUS_D (1<<1)
|
801 |
|
|
#define SSI_STATUS_B (1<<0)
|
802 |
|
|
#define SSI0_INT 0xB1600004
|
803 |
|
|
#define SSI_INT_OI (1<<3)
|
804 |
|
|
#define SSI_INT_UI (1<<2)
|
805 |
|
|
#define SSI_INT_DI (1<<1)
|
806 |
|
|
#define SSI0_INT_ENABLE 0xB1600008
|
807 |
|
|
#define SSI_INTE_OIE (1<<3)
|
808 |
|
|
#define SSI_INTE_UIE (1<<2)
|
809 |
|
|
#define SSI_INTE_DIE (1<<1)
|
810 |
|
|
#define SSI0_CONFIG 0xB1600020
|
811 |
|
|
#define SSI_CONFIG_AO (1<<24)
|
812 |
|
|
#define SSI_CONFIG_DO (1<<23)
|
813 |
|
|
#define SSI_CONFIG_ALEN_BIT 20
|
814 |
|
|
#define SSI_CONFIG_ALEN_MASK (0x7<<20)
|
815 |
|
|
#define SSI_CONFIG_DLEN_BIT 16
|
816 |
|
|
#define SSI_CONFIG_DLEN_MASK (0x7<<16)
|
817 |
|
|
#define SSI_CONFIG_DD (1<<11)
|
818 |
|
|
#define SSI_CONFIG_AD (1<<10)
|
819 |
|
|
#define SSI_CONFIG_BM_BIT 8
|
820 |
|
|
#define SSI_CONFIG_BM_MASK (0x3<<8)
|
821 |
|
|
#define SSI_CONFIG_CE (1<<7)
|
822 |
|
|
#define SSI_CONFIG_DP (1<<6)
|
823 |
|
|
#define SSI_CONFIG_DL (1<<5)
|
824 |
|
|
#define SSI_CONFIG_EP (1<<4)
|
825 |
|
|
#define SSI0_ADATA 0xB1600024
|
826 |
|
|
#define SSI_AD_D (1<<24)
|
827 |
|
|
#define SSI_AD_ADDR_BIT 16
|
828 |
|
|
#define SSI_AD_ADDR_MASK (0xff<<16)
|
829 |
|
|
#define SSI_AD_DATA_BIT 0
|
830 |
|
|
#define SSI_AD_DATA_MASK (0xfff<<0)
|
831 |
|
|
#define SSI0_CLKDIV 0xB1600028
|
832 |
|
|
#define SSI0_CONTROL 0xB1600100
|
833 |
|
|
#define SSI_CONTROL_CD (1<<1)
|
834 |
|
|
#define SSI_CONTROL_E (1<<0)
|
835 |
|
|
|
836 |
|
|
/* SSI1 */
|
837 |
|
|
#define SSI1_STATUS 0xB1680000
|
838 |
|
|
#define SSI1_INT 0xB1680004
|
839 |
|
|
#define SSI1_INT_ENABLE 0xB1680008
|
840 |
|
|
#define SSI1_CONFIG 0xB1680020
|
841 |
|
|
#define SSI1_ADATA 0xB1680024
|
842 |
|
|
#define SSI1_CLKDIV 0xB1680028
|
843 |
|
|
#define SSI1_ENABLE 0xB1680100
|
844 |
|
|
|
845 |
|
|
/*
|
846 |
|
|
* Register content definitions
|
847 |
|
|
*/
|
848 |
|
|
#define SSI_STATUS_BF (1<<4)
|
849 |
|
|
#define SSI_STATUS_OF (1<<3)
|
850 |
|
|
#define SSI_STATUS_UF (1<<2)
|
851 |
|
|
#define SSI_STATUS_D (1<<1)
|
852 |
|
|
#define SSI_STATUS_B (1<<0)
|
853 |
|
|
|
854 |
|
|
/* SSI_INT */
|
855 |
|
|
#define SSI_INT_OI (1<<3)
|
856 |
|
|
#define SSI_INT_UI (1<<2)
|
857 |
|
|
#define SSI_INT_DI (1<<1)
|
858 |
|
|
|
859 |
|
|
/* SSI_INTEN */
|
860 |
|
|
#define SSI_INTEN_OIE (1<<3)
|
861 |
|
|
#define SSI_INTEN_UIE (1<<2)
|
862 |
|
|
#define SSI_INTEN_DIE (1<<1)
|
863 |
|
|
|
864 |
|
|
#define SSI_CONFIG_AO (1<<24)
|
865 |
|
|
#define SSI_CONFIG_DO (1<<23)
|
866 |
|
|
#define SSI_CONFIG_ALEN (7<<20)
|
867 |
|
|
#define SSI_CONFIG_DLEN (15<<16)
|
868 |
|
|
#define SSI_CONFIG_DD (1<<11)
|
869 |
|
|
#define SSI_CONFIG_AD (1<<10)
|
870 |
|
|
#define SSI_CONFIG_BM (3<<8)
|
871 |
|
|
#define SSI_CONFIG_CE (1<<7)
|
872 |
|
|
#define SSI_CONFIG_DP (1<<6)
|
873 |
|
|
#define SSI_CONFIG_DL (1<<5)
|
874 |
|
|
#define SSI_CONFIG_EP (1<<4)
|
875 |
|
|
#define SSI_CONFIG_ALEN_N(N) ((N-1)<<20)
|
876 |
|
|
#define SSI_CONFIG_DLEN_N(N) ((N-1)<<16)
|
877 |
|
|
#define SSI_CONFIG_BM_HI (0<<8)
|
878 |
|
|
#define SSI_CONFIG_BM_LO (1<<8)
|
879 |
|
|
#define SSI_CONFIG_BM_CY (2<<8)
|
880 |
|
|
|
881 |
|
|
#define SSI_ADATA_D (1<<24)
|
882 |
|
|
#define SSI_ADATA_ADDR (0xFF<<16)
|
883 |
|
|
#define SSI_ADATA_DATA (0x0FFF)
|
884 |
|
|
#define SSI_ADATA_ADDR_N(N) (N<<16)
|
885 |
|
|
|
886 |
|
|
#define SSI_ENABLE_CD (1<<1)
|
887 |
|
|
#define SSI_ENABLE_E (1<<0)
|
888 |
|
|
|
889 |
|
|
|
890 |
|
|
/* IrDA Controller */
|
891 |
|
|
#define IRDA_BASE 0xB0300000
|
892 |
|
|
#define IR_RING_PTR_STATUS (IRDA_BASE+0x00)
|
893 |
|
|
#define IR_RING_BASE_ADDR_H (IRDA_BASE+0x04)
|
894 |
|
|
#define IR_RING_BASE_ADDR_L (IRDA_BASE+0x08)
|
895 |
|
|
#define IR_RING_SIZE (IRDA_BASE+0x0C)
|
896 |
|
|
#define IR_RING_PROMPT (IRDA_BASE+0x10)
|
897 |
|
|
#define IR_RING_ADDR_CMPR (IRDA_BASE+0x14)
|
898 |
|
|
#define IR_INT_CLEAR (IRDA_BASE+0x18)
|
899 |
|
|
#define IR_CONFIG_1 (IRDA_BASE+0x20)
|
900 |
|
|
#define IR_RX_INVERT_LED (1<<0)
|
901 |
|
|
#define IR_TX_INVERT_LED (1<<1)
|
902 |
|
|
#define IR_ST (1<<2)
|
903 |
|
|
#define IR_SF (1<<3)
|
904 |
|
|
#define IR_SIR (1<<4)
|
905 |
|
|
#define IR_MIR (1<<5)
|
906 |
|
|
#define IR_FIR (1<<6)
|
907 |
|
|
#define IR_16CRC (1<<7)
|
908 |
|
|
#define IR_TD (1<<8)
|
909 |
|
|
#define IR_RX_ALL (1<<9)
|
910 |
|
|
#define IR_DMA_ENABLE (1<<10)
|
911 |
|
|
#define IR_RX_ENABLE (1<<11)
|
912 |
|
|
#define IR_TX_ENABLE (1<<12)
|
913 |
|
|
#define IR_LOOPBACK (1<<14)
|
914 |
|
|
#define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \
|
915 |
|
|
IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
|
916 |
|
|
#define IR_SIR_FLAGS (IRDA_BASE+0x24)
|
917 |
|
|
#define IR_ENABLE (IRDA_BASE+0x28)
|
918 |
|
|
#define IR_RX_STATUS (1<<9)
|
919 |
|
|
#define IR_TX_STATUS (1<<10)
|
920 |
|
|
#define IR_READ_PHY_CONFIG (IRDA_BASE+0x2C)
|
921 |
|
|
#define IR_WRITE_PHY_CONFIG (IRDA_BASE+0x30)
|
922 |
|
|
#define IR_MAX_PKT_LEN (IRDA_BASE+0x34)
|
923 |
|
|
#define IR_RX_BYTE_CNT (IRDA_BASE+0x38)
|
924 |
|
|
#define IR_CONFIG_2 (IRDA_BASE+0x3C)
|
925 |
|
|
#define IR_MODE_INV (1<<0)
|
926 |
|
|
#define IR_ONE_PIN (1<<1)
|
927 |
|
|
#define IR_INTERFACE_CONFIG (IRDA_BASE+0x40)
|
928 |
|
|
|
929 |
|
|
/* GPIO */
|
930 |
|
|
#define SYS_PINFUNC 0xB190002C
|
931 |
|
|
#define SYS_PF_USB (1<<15) /* 2nd USB device/host */
|
932 |
|
|
#define SYS_PF_U3 (1<<14) /* GPIO23/U3TXD */
|
933 |
|
|
#define SYS_PF_U2 (1<<13) /* GPIO22/U2TXD */
|
934 |
|
|
#define SYS_PF_U1 (1<<12) /* GPIO21/U1TXD */
|
935 |
|
|
#define SYS_PF_SRC (1<<11) /* GPIO6/SROMCKE */
|
936 |
|
|
#define SYS_PF_CK5 (1<<10) /* GPIO3/CLK5 */
|
937 |
|
|
#define SYS_PF_CK4 (1<<9) /* GPIO2/CLK4 */
|
938 |
|
|
#define SYS_PF_IRF (1<<8) /* GPIO15/IRFIRSEL */
|
939 |
|
|
#define SYS_PF_UR3 (1<<7) /* GPIO[14:9]/UART3 */
|
940 |
|
|
#define SYS_PF_I2D (1<<6) /* GPIO8/I2SDI */
|
941 |
|
|
#define SYS_PF_I2S (1<<5) /* I2S/GPIO[29:31] */
|
942 |
|
|
#define SYS_PF_NI2 (1<<4) /* NI2/GPIO[24:28] */
|
943 |
|
|
#define SYS_PF_U0 (1<<3) /* U0TXD/GPIO20 */
|
944 |
|
|
#define SYS_PF_RD (1<<2) /* IRTXD/GPIO19 */
|
945 |
|
|
#define SYS_PF_A97 (1<<1) /* AC97/SSL1 */
|
946 |
|
|
#define SYS_PF_S0 (1<<0) /* SSI_0/GPIO[16:18] */
|
947 |
|
|
|
948 |
|
|
/* Au1100 Only */
|
949 |
|
|
#define SYS_PF_PC (1<<18) /* PCMCIA/GPIO[207:204] */
|
950 |
|
|
#define SYS_PF_LCD (1<<17) /* extern lcd/GPIO[203:200] */
|
951 |
|
|
#define SYS_PF_CS (1<<16) /* EXTCLK0/32khz to gpio2 */
|
952 |
|
|
#define SYS_PF_EX0 (1<<9) /* gpio2/clock */
|
953 |
|
|
|
954 |
|
|
#define SYS_TRIOUTRD 0xB1900100
|
955 |
|
|
#define SYS_TRIOUTCLR 0xB1900100
|
956 |
|
|
#define SYS_OUTPUTRD 0xB1900108
|
957 |
|
|
#define SYS_OUTPUTSET 0xB1900108
|
958 |
|
|
#define SYS_OUTPUTCLR 0xB190010C
|
959 |
|
|
#define SYS_PINSTATERD 0xB1900110
|
960 |
|
|
#define SYS_PININPUTEN 0xB1900110
|
961 |
|
|
|
962 |
|
|
/* GPIO2, Au1500 only */
|
963 |
|
|
#define GPIO2_BASE 0xB1700000
|
964 |
|
|
#define GPIO2_DIR (GPIO2_BASE + 0)
|
965 |
|
|
#define GPIO2_OUTPUT (GPIO2_BASE + 8)
|
966 |
|
|
#define GPIO2_PINSTATE (GPIO2_BASE + 0xC)
|
967 |
|
|
#define GPIO2_INTENABLE (GPIO2_BASE + 0x10)
|
968 |
|
|
#define GPIO2_ENABLE (GPIO2_BASE + 0x14)
|
969 |
|
|
|
970 |
|
|
/* Power Management */
|
971 |
|
|
#define SYS_SCRATCH0 0xB1900018
|
972 |
|
|
#define SYS_SCRATCH1 0xB190001C
|
973 |
|
|
#define SYS_WAKEMSK 0xB1900034
|
974 |
|
|
#define SYS_ENDIAN 0xB1900038
|
975 |
|
|
#define SYS_POWERCTRL 0xB190003C
|
976 |
|
|
#define SYS_WAKESRC 0xB190005C
|
977 |
|
|
#define SYS_SLPPWR 0xB1900078
|
978 |
|
|
#define SYS_SLEEP 0xB190007C
|
979 |
|
|
|
980 |
|
|
/* Clock Controller */
|
981 |
|
|
#define SYS_FREQCTRL0 0xB1900020
|
982 |
|
|
#define SYS_FC_FRDIV2_BIT 22
|
983 |
|
|
#define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
|
984 |
|
|
#define SYS_FC_FE2 (1<<21)
|
985 |
|
|
#define SYS_FC_FS2 (1<<20)
|
986 |
|
|
#define SYS_FC_FRDIV1_BIT 12
|
987 |
|
|
#define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
|
988 |
|
|
#define SYS_FC_FE1 (1<<11)
|
989 |
|
|
#define SYS_FC_FS1 (1<<10)
|
990 |
|
|
#define SYS_FC_FRDIV0_BIT 2
|
991 |
|
|
#define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
|
992 |
|
|
#define SYS_FC_FE0 (1<<1)
|
993 |
|
|
#define SYS_FC_FS0 (1<<0)
|
994 |
|
|
#define SYS_FREQCTRL1 0xB1900024
|
995 |
|
|
#define SYS_FC_FRDIV5_BIT 22
|
996 |
|
|
#define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
|
997 |
|
|
#define SYS_FC_FE5 (1<<21)
|
998 |
|
|
#define SYS_FC_FS5 (1<<20)
|
999 |
|
|
#define SYS_FC_FRDIV4_BIT 12
|
1000 |
|
|
#define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
|
1001 |
|
|
#define SYS_FC_FE4 (1<<11)
|
1002 |
|
|
#define SYS_FC_FS4 (1<<10)
|
1003 |
|
|
#define SYS_FC_FRDIV3_BIT 2
|
1004 |
|
|
#define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
|
1005 |
|
|
#define SYS_FC_FE3 (1<<1)
|
1006 |
|
|
#define SYS_FC_FS3 (1<<0)
|
1007 |
|
|
#define SYS_CLKSRC 0xB1900028
|
1008 |
|
|
#define SYS_CS_ME1_BIT 27
|
1009 |
|
|
#define SYS_CS_ME1_MASK (0x7<<SYS_CS_ME1_BIT)
|
1010 |
|
|
#define SYS_CS_DE1 (1<<26)
|
1011 |
|
|
#define SYS_CS_CE1 (1<<25)
|
1012 |
|
|
#define SYS_CS_ME0_BIT 22
|
1013 |
|
|
#define SYS_CS_ME0_MASK (0x7<<SYS_CS_ME0_BIT)
|
1014 |
|
|
#define SYS_CS_DE0 (1<<21)
|
1015 |
|
|
#define SYS_CS_CE0 (1<<20)
|
1016 |
|
|
#define SYS_CS_MI2_BIT 17
|
1017 |
|
|
#define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT)
|
1018 |
|
|
#define SYS_CS_DI2 (1<<16)
|
1019 |
|
|
#define SYS_CS_CI2 (1<<15)
|
1020 |
|
|
#define SYS_CS_MUH_BIT 12
|
1021 |
|
|
#define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT)
|
1022 |
|
|
#define SYS_CS_DUH (1<<11)
|
1023 |
|
|
#define SYS_CS_CUH (1<<10)
|
1024 |
|
|
#define SYS_CS_MUD_BIT 7
|
1025 |
|
|
#define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT)
|
1026 |
|
|
#define SYS_CS_DUD (1<<6)
|
1027 |
|
|
#define SYS_CS_CUD (1<<5)
|
1028 |
|
|
#define SYS_CS_MIR_BIT 2
|
1029 |
|
|
#define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT)
|
1030 |
|
|
#define SYS_CS_DIR (1<<1)
|
1031 |
|
|
#define SYS_CS_CIR (1<<0)
|
1032 |
|
|
|
1033 |
|
|
#define SYS_CS_MUX_AUX 0x1
|
1034 |
|
|
#define SYS_CS_MUX_FQ0 0x2
|
1035 |
|
|
#define SYS_CS_MUX_FQ1 0x3
|
1036 |
|
|
#define SYS_CS_MUX_FQ2 0x4
|
1037 |
|
|
#define SYS_CS_MUX_FQ3 0x5
|
1038 |
|
|
#define SYS_CS_MUX_FQ4 0x6
|
1039 |
|
|
#define SYS_CS_MUX_FQ5 0x7
|
1040 |
|
|
#define SYS_CPUPLL 0xB1900060
|
1041 |
|
|
#define SYS_AUXPLL 0xB1900064
|
1042 |
|
|
|
1043 |
|
|
/* AC97 Controller */
|
1044 |
|
|
#define AC97C_CONFIG 0xB0000000
|
1045 |
|
|
#define AC97C_RECV_SLOTS_BIT 13
|
1046 |
|
|
#define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
|
1047 |
|
|
#define AC97C_XMIT_SLOTS_BIT 3
|
1048 |
|
|
#define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
|
1049 |
|
|
#define AC97C_SG (1<<2)
|
1050 |
|
|
#define AC97C_SYNC (1<<1)
|
1051 |
|
|
#define AC97C_RESET (1<<0)
|
1052 |
|
|
#define AC97C_STATUS 0xB0000004
|
1053 |
|
|
#define AC97C_XU (1<<11)
|
1054 |
|
|
#define AC97C_XO (1<<10)
|
1055 |
|
|
#define AC97C_RU (1<<9)
|
1056 |
|
|
#define AC97C_RO (1<<8)
|
1057 |
|
|
#define AC97C_READY (1<<7)
|
1058 |
|
|
#define AC97C_CP (1<<6)
|
1059 |
|
|
#define AC97C_TR (1<<5)
|
1060 |
|
|
#define AC97C_TE (1<<4)
|
1061 |
|
|
#define AC97C_TF (1<<3)
|
1062 |
|
|
#define AC97C_RR (1<<2)
|
1063 |
|
|
#define AC97C_RE (1<<1)
|
1064 |
|
|
#define AC97C_RF (1<<0)
|
1065 |
|
|
#define AC97C_DATA 0xB0000008
|
1066 |
|
|
#define AC97C_CMD 0xB000000C
|
1067 |
|
|
#define AC97C_WD_BIT 16
|
1068 |
|
|
#define AC97C_READ (1<<7)
|
1069 |
|
|
#define AC97C_INDEX_MASK 0x7f
|
1070 |
|
|
#define AC97C_CNTRL 0xB0000010
|
1071 |
|
|
#define AC97C_RS (1<<1)
|
1072 |
|
|
#define AC97C_CE (1<<0)
|
1073 |
|
|
|
1074 |
|
|
#if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
|
1075 |
|
|
/* Au1500 PCI Controller */
|
1076 |
|
|
#define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
|
1077 |
|
|
#define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0)
|
1078 |
|
|
#define Au1500_PCI_CFG (Au1500_CFG_BASE + 4)
|
1079 |
|
|
#define PCI_ERROR ((1<<22) | (1<<23) | (1<<24) | (1<<25) | (1<<26) | (1<<27))
|
1080 |
|
|
#define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8)
|
1081 |
|
|
#define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC)
|
1082 |
|
|
#define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10)
|
1083 |
|
|
#define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14)
|
1084 |
|
|
#define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
|
1085 |
|
|
#define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C)
|
1086 |
|
|
#define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20)
|
1087 |
|
|
#define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100)
|
1088 |
|
|
#define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104)
|
1089 |
|
|
#define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108)
|
1090 |
|
|
#define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C)
|
1091 |
|
|
#define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110)
|
1092 |
|
|
|
1093 |
|
|
#define Au1500_PCI_HDR 0xB4005100 // virtual, kseg0 addr
|
1094 |
|
|
|
1095 |
|
|
/* All of our structures, like pci resource, have 32 bit members.
|
1096 |
|
|
* Drivers are expected to do an ioremap on the PCI MEM resource, but it's
|
1097 |
|
|
* hard to store 0x4 0000 0000 in a 32 bit type. We require a small patch
|
1098 |
|
|
* to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
|
1099 |
|
|
* (u32)Au1500_PCI_MEM_END and change those to the full 36 bit PCI MEM
|
1100 |
|
|
* addresses. For PCI IO, it's simpler because we get to do the ioremap
|
1101 |
|
|
* ourselves and then adjust the device's resources.
|
1102 |
|
|
*/
|
1103 |
|
|
#define Au1500_EXT_CFG 0x600000000
|
1104 |
|
|
#define Au1500_EXT_CFG_TYPE1 0x680000000
|
1105 |
|
|
#define Au1500_PCI_IO_START 0x500000000
|
1106 |
|
|
#define Au1500_PCI_IO_END 0x5000FFFFF
|
1107 |
|
|
#define Au1500_PCI_MEM_START 0x440000000
|
1108 |
|
|
#define Au1500_PCI_MEM_END 0x44FFFFFFF
|
1109 |
|
|
|
1110 |
|
|
#define PCI_IO_START (Au1500_PCI_IO_START + 0x300)
|
1111 |
|
|
#define PCI_IO_END (Au1500_PCI_IO_END)
|
1112 |
|
|
#define PCI_MEM_START (Au1500_PCI_MEM_START)
|
1113 |
|
|
#define PCI_MEM_END (Au1500_PCI_MEM_END)
|
1114 |
|
|
#define PCI_FIRST_DEVFN (0<<3)
|
1115 |
|
|
#define PCI_LAST_DEVFN (19<<3)
|
1116 |
|
|
|
1117 |
|
|
#define IOPORT_RESOURCE_START 0x00000000
|
1118 |
|
|
#define IOPORT_RESOURCE_END 0xffffffff
|
1119 |
|
|
#define IOMEM_RESOURCE_START 0x10000000
|
1120 |
|
|
#define IOMEM_RESOURCE_END 0xffffffff
|
1121 |
|
|
|
1122 |
|
|
#else /* Au1000 and Au1100 */
|
1123 |
|
|
|
1124 |
|
|
/* don't allow any legacy ports probing */
|
1125 |
|
|
#define IOPORT_RESOURCE_START 0x10000000;
|
1126 |
|
|
#define IOPORT_RESOURCE_END 0xffffffff
|
1127 |
|
|
#define IOMEM_RESOURCE_START 0x10000000
|
1128 |
|
|
#define IOMEM_RESOURCE_END 0xffffffff
|
1129 |
|
|
|
1130 |
|
|
#ifdef CONFIG_MIPS_PB1000
|
1131 |
|
|
#define PCI_IO_START 0x10000000
|
1132 |
|
|
#define PCI_IO_END 0x1000ffff
|
1133 |
|
|
#define PCI_MEM_START 0x18000000
|
1134 |
|
|
#define PCI_MEM_END 0x18ffffff
|
1135 |
|
|
#define PCI_FIRST_DEVFN 0
|
1136 |
|
|
#define PCI_LAST_DEVFN 1
|
1137 |
|
|
#else
|
1138 |
|
|
/* no PCI bus controller */
|
1139 |
|
|
#define PCI_IO_START 0
|
1140 |
|
|
#define PCI_IO_END 0
|
1141 |
|
|
#define PCI_MEM_START 0
|
1142 |
|
|
#define PCI_MEM_END 0
|
1143 |
|
|
#define PCI_FIRST_DEVFN 0
|
1144 |
|
|
#define PCI_LAST_DEVFN 0
|
1145 |
|
|
#endif
|
1146 |
|
|
|
1147 |
|
|
#endif
|
1148 |
|
|
|
1149 |
|
|
#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
|
1150 |
|
|
#define NUM_ETH_INTERFACES 2
|
1151 |
|
|
#elif defined(CONFIG_SOC_AU1100)
|
1152 |
|
|
#define NUM_ETH_INTERFACES 1
|
1153 |
|
|
#endif
|
1154 |
|
|
|
1155 |
|
|
#endif
|