blob: cd6719cf5ede8726b26200791085ffc060141a83 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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#include <linux/config.h>
39
40#ifndef _LANGUAGE_ASSEMBLY
41
42#include <linux/delay.h>
43#include <asm/io.h>
44
45/* cpu pipeline flush */
46void static inline au_sync(void)
47{
48 __asm__ volatile ("sync");
49}
50
51void static inline au_sync_udelay(int us)
52{
53 __asm__ volatile ("sync");
54 udelay(us);
55}
56
57void static inline au_sync_delay(int ms)
58{
59 __asm__ volatile ("sync");
60 mdelay(ms);
61}
62
Pete Popov7de8d232005-04-21 05:31:59 +000063void static inline au_writeb(u8 val, unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070064{
65 *(volatile u8 *)(reg) = val;
66}
67
Pete Popov7de8d232005-04-21 05:31:59 +000068void static inline au_writew(u16 val, unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070069{
70 *(volatile u16 *)(reg) = val;
71}
72
Pete Popov7de8d232005-04-21 05:31:59 +000073void static inline au_writel(u32 val, unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070074{
75 *(volatile u32 *)(reg) = val;
76}
77
Pete Popov7de8d232005-04-21 05:31:59 +000078static inline u8 au_readb(unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070079{
Pete Popov7de8d232005-04-21 05:31:59 +000080 return (*(volatile u8 *)reg);
Linus Torvalds1da177e2005-04-16 15:20:36 -070081}
82
Pete Popov7de8d232005-04-21 05:31:59 +000083static inline u16 au_readw(unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070084{
Pete Popov7de8d232005-04-21 05:31:59 +000085 return (*(volatile u16 *)reg);
Linus Torvalds1da177e2005-04-16 15:20:36 -070086}
87
Pete Popov7de8d232005-04-21 05:31:59 +000088static inline u32 au_readl(unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070089{
Pete Popov7de8d232005-04-21 05:31:59 +000090 return (*(volatile u32 *)reg);
Linus Torvalds1da177e2005-04-16 15:20:36 -070091}
92
93/* These next three functions should be a generic part of the MIPS
94 * kernel (with the 'au_' removed from the name) and selected for
95 * processors that support the instructions.
96 * Taken from PPC tree. -- Dan
97 */
98/* Return the bit position of the most significant 1 bit in a word */
99static __inline__ int __ilog2(unsigned int x)
100{
101 int lz;
102
103 asm volatile (
104 ".set\tnoreorder\n\t"
105 ".set\tnoat\n\t"
106 ".set\tmips32\n\t"
107 "clz\t%0,%1\n\t"
108 ".set\tmips0\n\t"
109 ".set\tat\n\t"
110 ".set\treorder"
111 : "=r" (lz)
112 : "r" (x));
113
114 return 31 - lz;
115}
116
117static __inline__ int au_ffz(unsigned int x)
118{
119 if ((x = ~x) == 0)
120 return 32;
121 return __ilog2(x & -x);
122}
123
124/*
125 * ffs: find first bit set. This is defined the same way as
126 * the libc and compiler builtin ffs routines, therefore
127 * differs in spirit from the above ffz (man ffs).
128 */
129static __inline__ int au_ffs(int x)
130{
131 return __ilog2(x & -x) + 1;
132}
133
134/* arch/mips/au1000/common/clocks.c */
135extern void set_au1x00_speed(unsigned int new_freq);
136extern unsigned int get_au1x00_speed(void);
137extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
138extern unsigned long get_au1x00_uart_baud_base(void);
139extern void set_au1x00_lcd_clock(void);
140extern unsigned int get_au1x00_lcd_clock(void);
141
142/*
143 * Every board describes its IRQ mapping with this table.
144 */
145typedef struct au1xxx_irqmap {
146 int im_irq;
147 int im_type;
148 int im_request;
149} au1xxx_irq_map_t;
150
151/*
152 * init_IRQ looks for a table with this name.
153 */
154extern au1xxx_irq_map_t au1xxx_irq_map[];
155
156#endif /* !defined (_LANGUAGE_ASSEMBLY) */
157
158#ifdef CONFIG_PM
159/* no CP0 timer irq */
160#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
161#else
162#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
163#endif
164
Pete Popove3ad1c22005-03-01 06:33:16 +0000165/*
166 * SDRAM Register Offsets
167 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
Pete Popove3ad1c22005-03-01 06:33:16 +0000169#define MEM_SDMODE0 (0x0000)
170#define MEM_SDMODE1 (0x0004)
171#define MEM_SDMODE2 (0x0008)
172#define MEM_SDADDR0 (0x000C)
173#define MEM_SDADDR1 (0x0010)
174#define MEM_SDADDR2 (0x0014)
175#define MEM_SDREFCFG (0x0018)
176#define MEM_SDPRECMD (0x001C)
177#define MEM_SDAUTOREF (0x0020)
178#define MEM_SDWRMD0 (0x0024)
179#define MEM_SDWRMD1 (0x0028)
180#define MEM_SDWRMD2 (0x002C)
181#define MEM_SDSLEEP (0x0030)
182#define MEM_SDSMCKE (0x0034)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183
Pete Popove3ad1c22005-03-01 06:33:16 +0000184/*
185 * MEM_SDMODE register content definitions
186 */
187#define MEM_SDMODE_F (1<<22)
188#define MEM_SDMODE_SR (1<<21)
189#define MEM_SDMODE_BS (1<<20)
190#define MEM_SDMODE_RS (3<<18)
191#define MEM_SDMODE_CS (7<<15)
192#define MEM_SDMODE_TRAS (15<<11)
193#define MEM_SDMODE_TMRD (3<<9)
194#define MEM_SDMODE_TWR (3<<7)
195#define MEM_SDMODE_TRP (3<<5)
196#define MEM_SDMODE_TRCD (3<<3)
197#define MEM_SDMODE_TCL (7<<0)
198
199#define MEM_SDMODE_BS_2Bank (0<<20)
200#define MEM_SDMODE_BS_4Bank (1<<20)
201#define MEM_SDMODE_RS_11Row (0<<18)
202#define MEM_SDMODE_RS_12Row (1<<18)
203#define MEM_SDMODE_RS_13Row (2<<18)
204#define MEM_SDMODE_RS_N(N) ((N)<<18)
205#define MEM_SDMODE_CS_7Col (0<<15)
206#define MEM_SDMODE_CS_8Col (1<<15)
207#define MEM_SDMODE_CS_9Col (2<<15)
208#define MEM_SDMODE_CS_10Col (3<<15)
209#define MEM_SDMODE_CS_11Col (4<<15)
210#define MEM_SDMODE_CS_N(N) ((N)<<15)
211#define MEM_SDMODE_TRAS_N(N) ((N)<<11)
212#define MEM_SDMODE_TMRD_N(N) ((N)<<9)
213#define MEM_SDMODE_TWR_N(N) ((N)<<7)
214#define MEM_SDMODE_TRP_N(N) ((N)<<5)
215#define MEM_SDMODE_TRCD_N(N) ((N)<<3)
216#define MEM_SDMODE_TCL_N(N) ((N)<<0)
217
218/*
219 * MEM_SDADDR register contents definitions
220 */
221#define MEM_SDADDR_E (1<<20)
222#define MEM_SDADDR_CSBA (0x03FF<<10)
223#define MEM_SDADDR_CSMASK (0x03FF<<0)
224#define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12)
225#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22)
226
227/*
228 * MEM_SDREFCFG register content definitions
229 */
230#define MEM_SDREFCFG_TRC (15<<28)
231#define MEM_SDREFCFG_TRPM (3<<26)
232#define MEM_SDREFCFG_E (1<<25)
233#define MEM_SDREFCFG_RE (0x1ffffff<<0)
234#define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC)
235#define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM)
236#define MEM_SDREFCFG_REF_N(N) (N)
237#endif
238
239/***********************************************************************/
240
241/*
242 * Au1550 SDRAM Register Offsets
243 */
244
245/***********************************************************************/
246
247#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
248#define MEM_SDMODE0 (0x0800)
249#define MEM_SDMODE1 (0x0808)
250#define MEM_SDMODE2 (0x0810)
251#define MEM_SDADDR0 (0x0820)
252#define MEM_SDADDR1 (0x0828)
253#define MEM_SDADDR2 (0x0830)
254#define MEM_SDCONFIGA (0x0840)
255#define MEM_SDCONFIGB (0x0848)
256#define MEM_SDSTAT (0x0850)
257#define MEM_SDERRADDR (0x0858)
258#define MEM_SDSTRIDE0 (0x0860)
259#define MEM_SDSTRIDE1 (0x0868)
260#define MEM_SDSTRIDE2 (0x0870)
261#define MEM_SDWRMD0 (0x0880)
262#define MEM_SDWRMD1 (0x0888)
263#define MEM_SDWRMD2 (0x0890)
264#define MEM_SDPRECMD (0x08C0)
265#define MEM_SDAUTOREF (0x08C8)
266#define MEM_SDSREF (0x08D0)
267#define MEM_SDSLEEP MEM_SDSREF
268
Pete Popove3ad1c22005-03-01 06:33:16 +0000269#endif
270
271/*
272 * Physical base addresses for integrated peripherals
273 */
274
275#ifdef CONFIG_SOC_AU1000
276#define MEM_PHYS_ADDR 0x14000000
277#define STATIC_MEM_PHYS_ADDR 0x14001000
278#define DMA0_PHYS_ADDR 0x14002000
279#define DMA1_PHYS_ADDR 0x14002100
280#define DMA2_PHYS_ADDR 0x14002200
281#define DMA3_PHYS_ADDR 0x14002300
282#define DMA4_PHYS_ADDR 0x14002400
283#define DMA5_PHYS_ADDR 0x14002500
284#define DMA6_PHYS_ADDR 0x14002600
285#define DMA7_PHYS_ADDR 0x14002700
286#define IC0_PHYS_ADDR 0x10400000
287#define IC1_PHYS_ADDR 0x11800000
288#define AC97_PHYS_ADDR 0x10000000
289#define USBH_PHYS_ADDR 0x10100000
290#define USBD_PHYS_ADDR 0x10200000
291#define IRDA_PHYS_ADDR 0x10300000
292#define MAC0_PHYS_ADDR 0x10500000
293#define MAC1_PHYS_ADDR 0x10510000
294#define MACEN_PHYS_ADDR 0x10520000
295#define MACDMA0_PHYS_ADDR 0x14004000
296#define MACDMA1_PHYS_ADDR 0x14004200
297#define I2S_PHYS_ADDR 0x11000000
298#define UART0_PHYS_ADDR 0x11100000
299#define UART1_PHYS_ADDR 0x11200000
300#define UART2_PHYS_ADDR 0x11300000
301#define UART3_PHYS_ADDR 0x11400000
302#define SSI0_PHYS_ADDR 0x11600000
303#define SSI1_PHYS_ADDR 0x11680000
304#define SYS_PHYS_ADDR 0x11900000
Pete Popov7de8d232005-04-21 05:31:59 +0000305#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
306#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
307#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000308#endif
309
310/********************************************************************/
311
312#ifdef CONFIG_SOC_AU1500
313#define MEM_PHYS_ADDR 0x14000000
314#define STATIC_MEM_PHYS_ADDR 0x14001000
315#define DMA0_PHYS_ADDR 0x14002000
316#define DMA1_PHYS_ADDR 0x14002100
317#define DMA2_PHYS_ADDR 0x14002200
318#define DMA3_PHYS_ADDR 0x14002300
319#define DMA4_PHYS_ADDR 0x14002400
320#define DMA5_PHYS_ADDR 0x14002500
321#define DMA6_PHYS_ADDR 0x14002600
322#define DMA7_PHYS_ADDR 0x14002700
323#define IC0_PHYS_ADDR 0x10400000
324#define IC1_PHYS_ADDR 0x11800000
325#define AC97_PHYS_ADDR 0x10000000
326#define USBH_PHYS_ADDR 0x10100000
327#define USBD_PHYS_ADDR 0x10200000
328#define PCI_PHYS_ADDR 0x14005000
329#define MAC0_PHYS_ADDR 0x11500000
330#define MAC1_PHYS_ADDR 0x11510000
331#define MACEN_PHYS_ADDR 0x11520000
332#define MACDMA0_PHYS_ADDR 0x14004000
333#define MACDMA1_PHYS_ADDR 0x14004200
334#define I2S_PHYS_ADDR 0x11000000
335#define UART0_PHYS_ADDR 0x11100000
336#define UART3_PHYS_ADDR 0x11400000
337#define GPIO2_PHYS_ADDR 0x11700000
338#define SYS_PHYS_ADDR 0x11900000
Pete Popov7de8d232005-04-21 05:31:59 +0000339#define PCI_MEM_PHYS_ADDR 0x400000000ULL
340#define PCI_IO_PHYS_ADDR 0x500000000ULL
341#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
342#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
343#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
344#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
345#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000346#endif
347
348/********************************************************************/
349
350#ifdef CONFIG_SOC_AU1100
351#define MEM_PHYS_ADDR 0x14000000
352#define STATIC_MEM_PHYS_ADDR 0x14001000
353#define DMA0_PHYS_ADDR 0x14002000
354#define DMA1_PHYS_ADDR 0x14002100
355#define DMA2_PHYS_ADDR 0x14002200
356#define DMA3_PHYS_ADDR 0x14002300
357#define DMA4_PHYS_ADDR 0x14002400
358#define DMA5_PHYS_ADDR 0x14002500
359#define DMA6_PHYS_ADDR 0x14002600
360#define DMA7_PHYS_ADDR 0x14002700
361#define IC0_PHYS_ADDR 0x10400000
362#define SD0_PHYS_ADDR 0x10600000
363#define SD1_PHYS_ADDR 0x10680000
364#define IC1_PHYS_ADDR 0x11800000
365#define AC97_PHYS_ADDR 0x10000000
366#define USBH_PHYS_ADDR 0x10100000
367#define USBD_PHYS_ADDR 0x10200000
368#define IRDA_PHYS_ADDR 0x10300000
369#define MAC0_PHYS_ADDR 0x10500000
370#define MACEN_PHYS_ADDR 0x10520000
371#define MACDMA0_PHYS_ADDR 0x14004000
372#define MACDMA1_PHYS_ADDR 0x14004200
373#define I2S_PHYS_ADDR 0x11000000
374#define UART0_PHYS_ADDR 0x11100000
375#define UART1_PHYS_ADDR 0x11200000
376#define UART3_PHYS_ADDR 0x11400000
377#define SSI0_PHYS_ADDR 0x11600000
378#define SSI1_PHYS_ADDR 0x11680000
379#define GPIO2_PHYS_ADDR 0x11700000
380#define SYS_PHYS_ADDR 0x11900000
381#define LCD_PHYS_ADDR 0x15000000
Pete Popov7de8d232005-04-21 05:31:59 +0000382#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
383#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
384#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000385#endif
386
387/***********************************************************************/
388
389#ifdef CONFIG_SOC_AU1550
390#define MEM_PHYS_ADDR 0x14000000
391#define STATIC_MEM_PHYS_ADDR 0x14001000
392#define IC0_PHYS_ADDR 0x10400000
393#define IC1_PHYS_ADDR 0x11800000
394#define USBH_PHYS_ADDR 0x14020000
395#define USBD_PHYS_ADDR 0x10200000
396#define PCI_PHYS_ADDR 0x14005000
397#define MAC0_PHYS_ADDR 0x10500000
398#define MAC1_PHYS_ADDR 0x10510000
399#define MACEN_PHYS_ADDR 0x10520000
400#define MACDMA0_PHYS_ADDR 0x14004000
401#define MACDMA1_PHYS_ADDR 0x14004200
402#define UART0_PHYS_ADDR 0x11100000
403#define UART1_PHYS_ADDR 0x11200000
404#define UART3_PHYS_ADDR 0x11400000
405#define GPIO2_PHYS_ADDR 0x11700000
406#define SYS_PHYS_ADDR 0x11900000
407#define DDMA_PHYS_ADDR 0x14002000
408#define PE_PHYS_ADDR 0x14008000
409#define PSC0_PHYS_ADDR 0x11A00000
410#define PSC1_PHYS_ADDR 0x11B00000
411#define PSC2_PHYS_ADDR 0x10A00000
412#define PSC3_PHYS_ADDR 0x10B00000
Pete Popov7de8d232005-04-21 05:31:59 +0000413#define PCI_MEM_PHYS_ADDR 0x400000000ULL
414#define PCI_IO_PHYS_ADDR 0x500000000ULL
415#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
416#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
417#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
418#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
419#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000420#endif
421
422/***********************************************************************/
423
424#ifdef CONFIG_SOC_AU1200
425#define MEM_PHYS_ADDR 0x14000000
426#define STATIC_MEM_PHYS_ADDR 0x14001000
427#define AES_PHYS_ADDR 0x10300000
428#define CIM_PHYS_ADDR 0x14004000
429#define IC0_PHYS_ADDR 0x10400000
430#define IC1_PHYS_ADDR 0x11800000
431#define USBM_PHYS_ADDR 0x14020000
432#define USBH_PHYS_ADDR 0x14020100
433#define UART0_PHYS_ADDR 0x11100000
434#define UART1_PHYS_ADDR 0x11200000
435#define GPIO2_PHYS_ADDR 0x11700000
436#define SYS_PHYS_ADDR 0x11900000
437#define DDMA_PHYS_ADDR 0x14002000
438#define PSC0_PHYS_ADDR 0x11A00000
439#define PSC1_PHYS_ADDR 0x11B00000
Pete Popove3ad1c22005-03-01 06:33:16 +0000440#define SD0_PHYS_ADDR 0x10600000
441#define SD1_PHYS_ADDR 0x10680000
442#define LCD_PHYS_ADDR 0x15000000
443#define SWCNT_PHYS_ADDR 0x1110010C
444#define MAEFE_PHYS_ADDR 0x14012000
445#define MAEBE_PHYS_ADDR 0x14010000
Pete Popov7de8d232005-04-21 05:31:59 +0000446#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
447#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
448#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000449#endif
450
451
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452/* Static Bus Controller */
453#define MEM_STCFG0 0xB4001000
454#define MEM_STTIME0 0xB4001004
455#define MEM_STADDR0 0xB4001008
456
457#define MEM_STCFG1 0xB4001010
458#define MEM_STTIME1 0xB4001014
459#define MEM_STADDR1 0xB4001018
460
461#define MEM_STCFG2 0xB4001020
462#define MEM_STTIME2 0xB4001024
463#define MEM_STADDR2 0xB4001028
464
465#define MEM_STCFG3 0xB4001030
466#define MEM_STTIME3 0xB4001034
467#define MEM_STADDR3 0xB4001038
468
469#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
470#define MEM_STNDCTL 0xB4001100
471#define MEM_STSTAT 0xB4001104
472
473#define MEM_STNAND_CMD (0x0)
474#define MEM_STNAND_ADDR (0x4)
475#define MEM_STNAND_DATA (0x20)
476#endif
477
478/* Interrupt Controller 0 */
479#define IC0_CFG0RD 0xB0400040
480#define IC0_CFG0SET 0xB0400040
481#define IC0_CFG0CLR 0xB0400044
482
483#define IC0_CFG1RD 0xB0400048
484#define IC0_CFG1SET 0xB0400048
485#define IC0_CFG1CLR 0xB040004C
486
487#define IC0_CFG2RD 0xB0400050
488#define IC0_CFG2SET 0xB0400050
489#define IC0_CFG2CLR 0xB0400054
490
491#define IC0_REQ0INT 0xB0400054
492#define IC0_SRCRD 0xB0400058
493#define IC0_SRCSET 0xB0400058
494#define IC0_SRCCLR 0xB040005C
495#define IC0_REQ1INT 0xB040005C
496
497#define IC0_ASSIGNRD 0xB0400060
498#define IC0_ASSIGNSET 0xB0400060
499#define IC0_ASSIGNCLR 0xB0400064
500
501#define IC0_WAKERD 0xB0400068
502#define IC0_WAKESET 0xB0400068
503#define IC0_WAKECLR 0xB040006C
504
505#define IC0_MASKRD 0xB0400070
506#define IC0_MASKSET 0xB0400070
507#define IC0_MASKCLR 0xB0400074
508
509#define IC0_RISINGRD 0xB0400078
510#define IC0_RISINGCLR 0xB0400078
511#define IC0_FALLINGRD 0xB040007C
512#define IC0_FALLINGCLR 0xB040007C
513
514#define IC0_TESTBIT 0xB0400080
515
516/* Interrupt Controller 1 */
517#define IC1_CFG0RD 0xB1800040
518#define IC1_CFG0SET 0xB1800040
519#define IC1_CFG0CLR 0xB1800044
520
521#define IC1_CFG1RD 0xB1800048
522#define IC1_CFG1SET 0xB1800048
523#define IC1_CFG1CLR 0xB180004C
524
525#define IC1_CFG2RD 0xB1800050
526#define IC1_CFG2SET 0xB1800050
527#define IC1_CFG2CLR 0xB1800054
528
529#define IC1_REQ0INT 0xB1800054
530#define IC1_SRCRD 0xB1800058
531#define IC1_SRCSET 0xB1800058
532#define IC1_SRCCLR 0xB180005C
533#define IC1_REQ1INT 0xB180005C
534
535#define IC1_ASSIGNRD 0xB1800060
536#define IC1_ASSIGNSET 0xB1800060
537#define IC1_ASSIGNCLR 0xB1800064
538
539#define IC1_WAKERD 0xB1800068
540#define IC1_WAKESET 0xB1800068
541#define IC1_WAKECLR 0xB180006C
542
543#define IC1_MASKRD 0xB1800070
544#define IC1_MASKSET 0xB1800070
545#define IC1_MASKCLR 0xB1800074
546
547#define IC1_RISINGRD 0xB1800078
548#define IC1_RISINGCLR 0xB1800078
549#define IC1_FALLINGRD 0xB180007C
550#define IC1_FALLINGCLR 0xB180007C
551
552#define IC1_TESTBIT 0xB1800080
553
554/* Interrupt Configuration Modes */
555#define INTC_INT_DISABLED 0
556#define INTC_INT_RISE_EDGE 0x1
557#define INTC_INT_FALL_EDGE 0x2
558#define INTC_INT_RISE_AND_FALL_EDGE 0x3
559#define INTC_INT_HIGH_LEVEL 0x5
560#define INTC_INT_LOW_LEVEL 0x6
561#define INTC_INT_HIGH_AND_LOW_LEVEL 0x7
562
563/* Interrupt Numbers */
564/* Au1000 */
565#ifdef CONFIG_SOC_AU1000
566#define AU1000_UART0_INT 0
567#define AU1000_UART1_INT 1 /* au1000 */
568#define AU1000_UART2_INT 2 /* au1000 */
569#define AU1000_UART3_INT 3
570#define AU1000_SSI0_INT 4 /* au1000 */
571#define AU1000_SSI1_INT 5 /* au1000 */
572#define AU1000_DMA_INT_BASE 6
573#define AU1000_TOY_INT 14
574#define AU1000_TOY_MATCH0_INT 15
575#define AU1000_TOY_MATCH1_INT 16
576#define AU1000_TOY_MATCH2_INT 17
577#define AU1000_RTC_INT 18
578#define AU1000_RTC_MATCH0_INT 19
579#define AU1000_RTC_MATCH1_INT 20
580#define AU1000_RTC_MATCH2_INT 21
581#define AU1000_IRDA_TX_INT 22 /* au1000 */
582#define AU1000_IRDA_RX_INT 23 /* au1000 */
583#define AU1000_USB_DEV_REQ_INT 24
584#define AU1000_USB_DEV_SUS_INT 25
585#define AU1000_USB_HOST_INT 26
586#define AU1000_ACSYNC_INT 27
587#define AU1000_MAC0_DMA_INT 28
588#define AU1000_MAC1_DMA_INT 29
589#define AU1000_I2S_UO_INT 30 /* au1000 */
590#define AU1000_AC97C_INT 31
591#define AU1000_GPIO_0 32
592#define AU1000_GPIO_1 33
593#define AU1000_GPIO_2 34
594#define AU1000_GPIO_3 35
595#define AU1000_GPIO_4 36
596#define AU1000_GPIO_5 37
597#define AU1000_GPIO_6 38
598#define AU1000_GPIO_7 39
599#define AU1000_GPIO_8 40
600#define AU1000_GPIO_9 41
601#define AU1000_GPIO_10 42
602#define AU1000_GPIO_11 43
603#define AU1000_GPIO_12 44
604#define AU1000_GPIO_13 45
605#define AU1000_GPIO_14 46
606#define AU1000_GPIO_15 47
607#define AU1000_GPIO_16 48
608#define AU1000_GPIO_17 49
609#define AU1000_GPIO_18 50
610#define AU1000_GPIO_19 51
611#define AU1000_GPIO_20 52
612#define AU1000_GPIO_21 53
613#define AU1000_GPIO_22 54
614#define AU1000_GPIO_23 55
615#define AU1000_GPIO_24 56
616#define AU1000_GPIO_25 57
617#define AU1000_GPIO_26 58
618#define AU1000_GPIO_27 59
619#define AU1000_GPIO_28 60
620#define AU1000_GPIO_29 61
621#define AU1000_GPIO_30 62
622#define AU1000_GPIO_31 63
623
624#define UART0_ADDR 0xB1100000
625#define UART1_ADDR 0xB1200000
626#define UART2_ADDR 0xB1300000
627#define UART3_ADDR 0xB1400000
628
629#define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
630#define USB_HOST_CONFIG 0xB017fffc
631
632#define AU1000_ETH0_BASE 0xB0500000
633#define AU1000_ETH1_BASE 0xB0510000
634#define AU1000_MAC0_ENABLE 0xB0520000
635#define AU1000_MAC1_ENABLE 0xB0520004
636#define NUM_ETH_INTERFACES 2
Pete Popove3ad1c22005-03-01 06:33:16 +0000637#endif /* CONFIG_SOC_AU1000 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638
639/* Au1500 */
640#ifdef CONFIG_SOC_AU1500
641#define AU1500_UART0_INT 0
642#define AU1000_PCI_INTA 1 /* au1500 */
643#define AU1000_PCI_INTB 2 /* au1500 */
644#define AU1500_UART3_INT 3
645#define AU1000_PCI_INTC 4 /* au1500 */
646#define AU1000_PCI_INTD 5 /* au1500 */
647#define AU1000_DMA_INT_BASE 6
648#define AU1000_TOY_INT 14
649#define AU1000_TOY_MATCH0_INT 15
650#define AU1000_TOY_MATCH1_INT 16
651#define AU1000_TOY_MATCH2_INT 17
652#define AU1000_RTC_INT 18
653#define AU1000_RTC_MATCH0_INT 19
654#define AU1000_RTC_MATCH1_INT 20
655#define AU1000_RTC_MATCH2_INT 21
656#define AU1500_PCI_ERR_INT 22
657#define AU1000_USB_DEV_REQ_INT 24
658#define AU1000_USB_DEV_SUS_INT 25
659#define AU1000_USB_HOST_INT 26
660#define AU1000_ACSYNC_INT 27
661#define AU1500_MAC0_DMA_INT 28
662#define AU1500_MAC1_DMA_INT 29
663#define AU1000_AC97C_INT 31
664#define AU1000_GPIO_0 32
665#define AU1000_GPIO_1 33
666#define AU1000_GPIO_2 34
667#define AU1000_GPIO_3 35
668#define AU1000_GPIO_4 36
669#define AU1000_GPIO_5 37
670#define AU1000_GPIO_6 38
671#define AU1000_GPIO_7 39
672#define AU1000_GPIO_8 40
673#define AU1000_GPIO_9 41
674#define AU1000_GPIO_10 42
675#define AU1000_GPIO_11 43
676#define AU1000_GPIO_12 44
677#define AU1000_GPIO_13 45
678#define AU1000_GPIO_14 46
679#define AU1000_GPIO_15 47
680#define AU1500_GPIO_200 48
681#define AU1500_GPIO_201 49
682#define AU1500_GPIO_202 50
683#define AU1500_GPIO_203 51
684#define AU1500_GPIO_20 52
685#define AU1500_GPIO_204 53
686#define AU1500_GPIO_205 54
687#define AU1500_GPIO_23 55
688#define AU1500_GPIO_24 56
689#define AU1500_GPIO_25 57
690#define AU1500_GPIO_26 58
691#define AU1500_GPIO_27 59
692#define AU1500_GPIO_28 60
693#define AU1500_GPIO_206 61
694#define AU1500_GPIO_207 62
695#define AU1500_GPIO_208_215 63
696
Pete Popov2d32ffa2005-03-01 07:54:50 +0000697/* shortcuts */
698#define INTA AU1000_PCI_INTA
699#define INTB AU1000_PCI_INTB
700#define INTC AU1000_PCI_INTC
701#define INTD AU1000_PCI_INTD
702
Linus Torvalds1da177e2005-04-16 15:20:36 -0700703#define UART0_ADDR 0xB1100000
704#define UART3_ADDR 0xB1400000
705
706#define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
707#define USB_HOST_CONFIG 0xB017fffc
708
709#define AU1500_ETH0_BASE 0xB1500000
710#define AU1500_ETH1_BASE 0xB1510000
711#define AU1500_MAC0_ENABLE 0xB1520000
712#define AU1500_MAC1_ENABLE 0xB1520004
713#define NUM_ETH_INTERFACES 2
Pete Popove3ad1c22005-03-01 06:33:16 +0000714#endif /* CONFIG_SOC_AU1500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715
716/* Au1100 */
717#ifdef CONFIG_SOC_AU1100
718#define AU1100_UART0_INT 0
719#define AU1100_UART1_INT 1
720#define AU1100_SD_INT 2
721#define AU1100_UART3_INT 3
722#define AU1000_SSI0_INT 4
723#define AU1000_SSI1_INT 5
724#define AU1000_DMA_INT_BASE 6
725#define AU1000_TOY_INT 14
726#define AU1000_TOY_MATCH0_INT 15
727#define AU1000_TOY_MATCH1_INT 16
728#define AU1000_TOY_MATCH2_INT 17
729#define AU1000_RTC_INT 18
730#define AU1000_RTC_MATCH0_INT 19
731#define AU1000_RTC_MATCH1_INT 20
732#define AU1000_RTC_MATCH2_INT 21
733#define AU1000_IRDA_TX_INT 22
734#define AU1000_IRDA_RX_INT 23
735#define AU1000_USB_DEV_REQ_INT 24
736#define AU1000_USB_DEV_SUS_INT 25
737#define AU1000_USB_HOST_INT 26
738#define AU1000_ACSYNC_INT 27
739#define AU1100_MAC0_DMA_INT 28
740#define AU1100_GPIO_208_215 29
741#define AU1100_LCD_INT 30
742#define AU1000_AC97C_INT 31
743#define AU1000_GPIO_0 32
744#define AU1000_GPIO_1 33
745#define AU1000_GPIO_2 34
746#define AU1000_GPIO_3 35
747#define AU1000_GPIO_4 36
748#define AU1000_GPIO_5 37
749#define AU1000_GPIO_6 38
750#define AU1000_GPIO_7 39
751#define AU1000_GPIO_8 40
752#define AU1000_GPIO_9 41
753#define AU1000_GPIO_10 42
754#define AU1000_GPIO_11 43
755#define AU1000_GPIO_12 44
756#define AU1000_GPIO_13 45
757#define AU1000_GPIO_14 46
758#define AU1000_GPIO_15 47
Pete Popove3ad1c22005-03-01 06:33:16 +0000759#define AU1000_GPIO_16 48
760#define AU1000_GPIO_17 49
761#define AU1000_GPIO_18 50
762#define AU1000_GPIO_19 51
763#define AU1000_GPIO_20 52
764#define AU1000_GPIO_21 53
765#define AU1000_GPIO_22 54
766#define AU1000_GPIO_23 55
767#define AU1000_GPIO_24 56
768#define AU1000_GPIO_25 57
769#define AU1000_GPIO_26 58
770#define AU1000_GPIO_27 59
771#define AU1000_GPIO_28 60
772#define AU1000_GPIO_29 61
773#define AU1000_GPIO_30 62
774#define AU1000_GPIO_31 63
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775
776#define UART0_ADDR 0xB1100000
777#define UART1_ADDR 0xB1200000
778#define UART3_ADDR 0xB1400000
779
780#define USB_OHCI_BASE 0x10100000 // phys addr for ioremap
781#define USB_HOST_CONFIG 0xB017fffc
782
783#define AU1100_ETH0_BASE 0xB0500000
784#define AU1100_MAC0_ENABLE 0xB0520000
785#define NUM_ETH_INTERFACES 1
Pete Popove3ad1c22005-03-01 06:33:16 +0000786#endif /* CONFIG_SOC_AU1100 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787
788#ifdef CONFIG_SOC_AU1550
789#define AU1550_UART0_INT 0
790#define AU1550_PCI_INTA 1
791#define AU1550_PCI_INTB 2
792#define AU1550_DDMA_INT 3
793#define AU1550_CRYPTO_INT 4
794#define AU1550_PCI_INTC 5
795#define AU1550_PCI_INTD 6
796#define AU1550_PCI_RST_INT 7
797#define AU1550_UART1_INT 8
798#define AU1550_UART3_INT 9
799#define AU1550_PSC0_INT 10
800#define AU1550_PSC1_INT 11
801#define AU1550_PSC2_INT 12
802#define AU1550_PSC3_INT 13
Pete Popove3ad1c22005-03-01 06:33:16 +0000803#define AU1000_TOY_INT 14
804#define AU1000_TOY_MATCH0_INT 15
805#define AU1000_TOY_MATCH1_INT 16
806#define AU1000_TOY_MATCH2_INT 17
807#define AU1000_RTC_INT 18
808#define AU1000_RTC_MATCH0_INT 19
809#define AU1000_RTC_MATCH1_INT 20
810#define AU1000_RTC_MATCH2_INT 21
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811#define AU1550_NAND_INT 23
812#define AU1550_USB_DEV_REQ_INT 24
813#define AU1550_USB_DEV_SUS_INT 25
814#define AU1550_USB_HOST_INT 26
815#define AU1000_USB_DEV_REQ_INT AU1550_USB_DEV_REQ_INT
816#define AU1000_USB_DEV_SUS_INT AU1550_USB_DEV_SUS_INT
817#define AU1000_USB_HOST_INT AU1550_USB_HOST_INT
818#define AU1550_MAC0_DMA_INT 27
819#define AU1550_MAC1_DMA_INT 28
820#define AU1000_GPIO_0 32
821#define AU1000_GPIO_1 33
822#define AU1000_GPIO_2 34
823#define AU1000_GPIO_3 35
824#define AU1000_GPIO_4 36
825#define AU1000_GPIO_5 37
826#define AU1000_GPIO_6 38
827#define AU1000_GPIO_7 39
828#define AU1000_GPIO_8 40
829#define AU1000_GPIO_9 41
830#define AU1000_GPIO_10 42
831#define AU1000_GPIO_11 43
832#define AU1000_GPIO_12 44
833#define AU1000_GPIO_13 45
834#define AU1000_GPIO_14 46
835#define AU1000_GPIO_15 47
836#define AU1550_GPIO_200 48
837#define AU1500_GPIO_201_205 49 // Logical or of GPIO201:205
838#define AU1500_GPIO_16 50
839#define AU1500_GPIO_17 51
840#define AU1500_GPIO_20 52
841#define AU1500_GPIO_21 53
842#define AU1500_GPIO_22 54
843#define AU1500_GPIO_23 55
844#define AU1500_GPIO_24 56
845#define AU1500_GPIO_25 57
846#define AU1500_GPIO_26 58
847#define AU1500_GPIO_27 59
848#define AU1500_GPIO_28 60
849#define AU1500_GPIO_206 61
850#define AU1500_GPIO_207 62
851#define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218
852
Pete Popov2d32ffa2005-03-01 07:54:50 +0000853/* shortcuts */
854#define INTA AU1550_PCI_INTA
855#define INTB AU1550_PCI_INTB
856#define INTC AU1550_PCI_INTC
857#define INTD AU1550_PCI_INTD
858
Linus Torvalds1da177e2005-04-16 15:20:36 -0700859#define UART0_ADDR 0xB1100000
860#define UART1_ADDR 0xB1200000
861#define UART3_ADDR 0xB1400000
862
863#define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
864#define USB_HOST_CONFIG 0xB4027ffc
865
866#define AU1550_ETH0_BASE 0xB0500000
867#define AU1550_ETH1_BASE 0xB0510000
868#define AU1550_MAC0_ENABLE 0xB0520000
869#define AU1550_MAC1_ENABLE 0xB0520004
870#define NUM_ETH_INTERFACES 2
Pete Popove3ad1c22005-03-01 06:33:16 +0000871#endif /* CONFIG_SOC_AU1550 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700872
873#ifdef CONFIG_SOC_AU1200
874#define AU1200_UART0_INT 0
875#define AU1200_SWT_INT 1
876#define AU1200_SD_INT 2
877#define AU1200_DDMA_INT 3
878#define AU1200_MAE_BE_INT 4
879#define AU1200_GPIO_200 5
880#define AU1200_GPIO_201 6
881#define AU1200_GPIO_202 7
882#define AU1200_UART1_INT 8
883#define AU1200_MAE_FE_INT 9
884#define AU1200_PSC0_INT 10
885#define AU1200_PSC1_INT 11
886#define AU1200_AES_INT 12
887#define AU1200_CAMERA_INT 13
Pete Popove3ad1c22005-03-01 06:33:16 +0000888#define AU1000_TOY_INT 14
889#define AU1000_TOY_MATCH0_INT 15
890#define AU1000_TOY_MATCH1_INT 16
891#define AU1000_TOY_MATCH2_INT 17
892#define AU1000_RTC_INT 18
893#define AU1000_RTC_MATCH0_INT 19
894#define AU1000_RTC_MATCH1_INT 20
895#define AU1000_RTC_MATCH2_INT 21
Linus Torvalds1da177e2005-04-16 15:20:36 -0700896#define AU1200_NAND_INT 23
897#define AU1200_GPIO_204 24
898#define AU1200_GPIO_205 25
899#define AU1200_GPIO_206 26
900#define AU1200_GPIO_207 27
901#define AU1200_GPIO_208_215 28 // Logical OR of 208:215
902#define AU1200_USB_INT 29
Pete Popove3ad1c22005-03-01 06:33:16 +0000903#define AU1000_USB_HOST_INT AU1200_USB_INT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700904#define AU1200_LCD_INT 30
905#define AU1200_MAE_BOTH_INT 31
906#define AU1000_GPIO_0 32
907#define AU1000_GPIO_1 33
908#define AU1000_GPIO_2 34
909#define AU1000_GPIO_3 35
910#define AU1000_GPIO_4 36
911#define AU1000_GPIO_5 37
912#define AU1000_GPIO_6 38
913#define AU1000_GPIO_7 39
914#define AU1000_GPIO_8 40
915#define AU1000_GPIO_9 41
916#define AU1000_GPIO_10 42
917#define AU1000_GPIO_11 43
918#define AU1000_GPIO_12 44
919#define AU1000_GPIO_13 45
920#define AU1000_GPIO_14 46
921#define AU1000_GPIO_15 47
922#define AU1000_GPIO_16 48
923#define AU1000_GPIO_17 49
924#define AU1000_GPIO_18 50
925#define AU1000_GPIO_19 51
926#define AU1000_GPIO_20 52
927#define AU1000_GPIO_21 53
928#define AU1000_GPIO_22 54
929#define AU1000_GPIO_23 55
930#define AU1000_GPIO_24 56
931#define AU1000_GPIO_25 57
932#define AU1000_GPIO_26 58
933#define AU1000_GPIO_27 59
934#define AU1000_GPIO_28 60
935#define AU1000_GPIO_29 61
936#define AU1000_GPIO_30 62
937#define AU1000_GPIO_31 63
938
939#define UART0_ADDR 0xB1100000
940#define UART1_ADDR 0xB1200000
941
Pete Popove3ad1c22005-03-01 06:33:16 +0000942#define USB_UOC_BASE 0x14020020
943#define USB_UOC_LEN 0x20
944#define USB_OHCI_BASE 0x14020100
945#define USB_OHCI_LEN 0x100
946#define USB_EHCI_BASE 0x14020200
947#define USB_EHCI_LEN 0x100
948#define USB_UDC_BASE 0x14022000
949#define USB_UDC_LEN 0x2000
950#define USB_MSR_BASE 0xB4020000
951#define USB_MSR_MCFG 4
952#define USBMSRMCFG_OMEMEN 0
953#define USBMSRMCFG_OBMEN 1
954#define USBMSRMCFG_EMEMEN 2
955#define USBMSRMCFG_EBMEN 3
956#define USBMSRMCFG_DMEMEN 4
957#define USBMSRMCFG_DBMEN 5
958#define USBMSRMCFG_GMEMEN 6
959#define USBMSRMCFG_OHCCLKEN 16
960#define USBMSRMCFG_EHCCLKEN 17
961#define USBMSRMCFG_UDCCLKEN 18
962#define USBMSRMCFG_PHYPLLEN 19
963#define USBMSRMCFG_RDCOMB 30
964#define USBMSRMCFG_PFEN 31
Linus Torvalds1da177e2005-04-16 15:20:36 -0700965
Pete Popove3ad1c22005-03-01 06:33:16 +0000966#endif /* CONFIG_SOC_AU1200 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700967
968#define AU1000_LAST_INTC0_INT 31
Pete Popove3ad1c22005-03-01 06:33:16 +0000969#define AU1000_LAST_INTC1_INT 63
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970#define AU1000_MAX_INTR 63
Pete Popov2d32ffa2005-03-01 07:54:50 +0000971#define INTX 0xFF /* not valid */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700972
Linus Torvalds1da177e2005-04-16 15:20:36 -0700973/* Programmable Counters 0 and 1 */
974#define SYS_BASE 0xB1900000
975#define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
976 #define SYS_CNTRL_E1S (1<<23)
977 #define SYS_CNTRL_T1S (1<<20)
978 #define SYS_CNTRL_M21 (1<<19)
979 #define SYS_CNTRL_M11 (1<<18)
980 #define SYS_CNTRL_M01 (1<<17)
981 #define SYS_CNTRL_C1S (1<<16)
982 #define SYS_CNTRL_BP (1<<14)
983 #define SYS_CNTRL_EN1 (1<<13)
984 #define SYS_CNTRL_BT1 (1<<12)
985 #define SYS_CNTRL_EN0 (1<<11)
986 #define SYS_CNTRL_BT0 (1<<10)
987 #define SYS_CNTRL_E0 (1<<8)
988 #define SYS_CNTRL_E0S (1<<7)
989 #define SYS_CNTRL_32S (1<<5)
990 #define SYS_CNTRL_T0S (1<<4)
991 #define SYS_CNTRL_M20 (1<<3)
992 #define SYS_CNTRL_M10 (1<<2)
993 #define SYS_CNTRL_M00 (1<<1)
994 #define SYS_CNTRL_C0S (1<<0)
995
996/* Programmable Counter 0 Registers */
997#define SYS_TOYTRIM (SYS_BASE + 0)
998#define SYS_TOYWRITE (SYS_BASE + 4)
999#define SYS_TOYMATCH0 (SYS_BASE + 8)
1000#define SYS_TOYMATCH1 (SYS_BASE + 0xC)
1001#define SYS_TOYMATCH2 (SYS_BASE + 0x10)
1002#define SYS_TOYREAD (SYS_BASE + 0x40)
1003
1004/* Programmable Counter 1 Registers */
1005#define SYS_RTCTRIM (SYS_BASE + 0x44)
1006#define SYS_RTCWRITE (SYS_BASE + 0x48)
1007#define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
1008#define SYS_RTCMATCH1 (SYS_BASE + 0x50)
1009#define SYS_RTCMATCH2 (SYS_BASE + 0x54)
1010#define SYS_RTCREAD (SYS_BASE + 0x58)
1011
1012/* I2S Controller */
1013#define I2S_DATA 0xB1000000
1014 #define I2S_DATA_MASK (0xffffff)
1015#define I2S_CONFIG 0xB1000004
1016 #define I2S_CONFIG_XU (1<<25)
1017 #define I2S_CONFIG_XO (1<<24)
1018 #define I2S_CONFIG_RU (1<<23)
1019 #define I2S_CONFIG_RO (1<<22)
1020 #define I2S_CONFIG_TR (1<<21)
1021 #define I2S_CONFIG_TE (1<<20)
1022 #define I2S_CONFIG_TF (1<<19)
1023 #define I2S_CONFIG_RR (1<<18)
1024 #define I2S_CONFIG_RE (1<<17)
1025 #define I2S_CONFIG_RF (1<<16)
1026 #define I2S_CONFIG_PD (1<<11)
1027 #define I2S_CONFIG_LB (1<<10)
1028 #define I2S_CONFIG_IC (1<<9)
1029 #define I2S_CONFIG_FM_BIT 7
1030 #define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
1031 #define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
1032 #define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
1033 #define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
1034 #define I2S_CONFIG_TN (1<<6)
1035 #define I2S_CONFIG_RN (1<<5)
1036 #define I2S_CONFIG_SZ_BIT 0
1037 #define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
1038
1039#define I2S_CONTROL 0xB1000008
1040 #define I2S_CONTROL_D (1<<1)
1041 #define I2S_CONTROL_CE (1<<0)
1042
Pete Popove3ad1c22005-03-01 06:33:16 +00001043#ifndef CONFIG_SOC_AU1200
1044
Linus Torvalds1da177e2005-04-16 15:20:36 -07001045/* USB Host Controller */
1046#define USB_OHCI_LEN 0x00100000
1047
1048/* USB Device Controller */
1049#define USBD_EP0RD 0xB0200000
1050#define USBD_EP0WR 0xB0200004
1051#define USBD_EP2WR 0xB0200008
1052#define USBD_EP3WR 0xB020000C
1053#define USBD_EP4RD 0xB0200010
1054#define USBD_EP5RD 0xB0200014
1055#define USBD_INTEN 0xB0200018
1056#define USBD_INTSTAT 0xB020001C
1057 #define USBDEV_INT_SOF (1<<12)
1058 #define USBDEV_INT_HF_BIT 6
1059 #define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
1060 #define USBDEV_INT_CMPLT_BIT 0
1061 #define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
1062#define USBD_CONFIG 0xB0200020
1063#define USBD_EP0CS 0xB0200024
1064#define USBD_EP2CS 0xB0200028
1065#define USBD_EP3CS 0xB020002C
1066#define USBD_EP4CS 0xB0200030
1067#define USBD_EP5CS 0xB0200034
1068 #define USBDEV_CS_SU (1<<14)
1069 #define USBDEV_CS_NAK (1<<13)
1070 #define USBDEV_CS_ACK (1<<12)
1071 #define USBDEV_CS_BUSY (1<<11)
1072 #define USBDEV_CS_TSIZE_BIT 1
1073 #define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
1074 #define USBDEV_CS_STALL (1<<0)
1075#define USBD_EP0RDSTAT 0xB0200040
1076#define USBD_EP0WRSTAT 0xB0200044
1077#define USBD_EP2WRSTAT 0xB0200048
1078#define USBD_EP3WRSTAT 0xB020004C
1079#define USBD_EP4RDSTAT 0xB0200050
1080#define USBD_EP5RDSTAT 0xB0200054
1081 #define USBDEV_FSTAT_FLUSH (1<<6)
1082 #define USBDEV_FSTAT_UF (1<<5)
1083 #define USBDEV_FSTAT_OF (1<<4)
1084 #define USBDEV_FSTAT_FCNT_BIT 0
1085 #define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
1086#define USBD_ENABLE 0xB0200058
1087 #define USBDEV_ENABLE (1<<1)
1088 #define USBDEV_CE (1<<0)
1089
Pete Popove3ad1c22005-03-01 06:33:16 +00001090#endif /* !CONFIG_SOC_AU1200 */
1091
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092/* Ethernet Controllers */
1093
1094/* 4 byte offsets from AU1000_ETH_BASE */
1095#define MAC_CONTROL 0x0
1096 #define MAC_RX_ENABLE (1<<2)
1097 #define MAC_TX_ENABLE (1<<3)
1098 #define MAC_DEF_CHECK (1<<5)
1099 #define MAC_SET_BL(X) (((X)&0x3)<<6)
1100 #define MAC_AUTO_PAD (1<<8)
1101 #define MAC_DISABLE_RETRY (1<<10)
1102 #define MAC_DISABLE_BCAST (1<<11)
1103 #define MAC_LATE_COL (1<<12)
1104 #define MAC_HASH_MODE (1<<13)
1105 #define MAC_HASH_ONLY (1<<15)
1106 #define MAC_PASS_ALL (1<<16)
1107 #define MAC_INVERSE_FILTER (1<<17)
1108 #define MAC_PROMISCUOUS (1<<18)
1109 #define MAC_PASS_ALL_MULTI (1<<19)
1110 #define MAC_FULL_DUPLEX (1<<20)
1111 #define MAC_NORMAL_MODE 0
1112 #define MAC_INT_LOOPBACK (1<<21)
1113 #define MAC_EXT_LOOPBACK (1<<22)
1114 #define MAC_DISABLE_RX_OWN (1<<23)
1115 #define MAC_BIG_ENDIAN (1<<30)
1116 #define MAC_RX_ALL (1<<31)
1117#define MAC_ADDRESS_HIGH 0x4
1118#define MAC_ADDRESS_LOW 0x8
1119#define MAC_MCAST_HIGH 0xC
1120#define MAC_MCAST_LOW 0x10
1121#define MAC_MII_CNTRL 0x14
1122 #define MAC_MII_BUSY (1<<0)
1123 #define MAC_MII_READ 0
1124 #define MAC_MII_WRITE (1<<1)
1125 #define MAC_SET_MII_SELECT_REG(X) (((X)&0x1f)<<6)
1126 #define MAC_SET_MII_SELECT_PHY(X) (((X)&0x1f)<<11)
1127#define MAC_MII_DATA 0x18
1128#define MAC_FLOW_CNTRL 0x1C
1129 #define MAC_FLOW_CNTRL_BUSY (1<<0)
1130 #define MAC_FLOW_CNTRL_ENABLE (1<<1)
1131 #define MAC_PASS_CONTROL (1<<2)
1132 #define MAC_SET_PAUSE(X) (((X)&0xffff)<<16)
1133#define MAC_VLAN1_TAG 0x20
1134#define MAC_VLAN2_TAG 0x24
1135
1136/* Ethernet Controller Enable */
1137
1138 #define MAC_EN_CLOCK_ENABLE (1<<0)
1139 #define MAC_EN_RESET0 (1<<1)
1140 #define MAC_EN_TOSS (0<<2)
1141 #define MAC_EN_CACHEABLE (1<<3)
1142 #define MAC_EN_RESET1 (1<<4)
1143 #define MAC_EN_RESET2 (1<<5)
1144 #define MAC_DMA_RESET (1<<6)
1145
1146/* Ethernet Controller DMA Channels */
1147
1148#define MAC0_TX_DMA_ADDR 0xB4004000
1149#define MAC1_TX_DMA_ADDR 0xB4004200
1150/* offsets from MAC_TX_RING_ADDR address */
1151#define MAC_TX_BUFF0_STATUS 0x0
1152 #define TX_FRAME_ABORTED (1<<0)
1153 #define TX_JAB_TIMEOUT (1<<1)
1154 #define TX_NO_CARRIER (1<<2)
1155 #define TX_LOSS_CARRIER (1<<3)
1156 #define TX_EXC_DEF (1<<4)
1157 #define TX_LATE_COLL_ABORT (1<<5)
1158 #define TX_EXC_COLL (1<<6)
1159 #define TX_UNDERRUN (1<<7)
1160 #define TX_DEFERRED (1<<8)
1161 #define TX_LATE_COLL (1<<9)
1162 #define TX_COLL_CNT_MASK (0xF<<10)
1163 #define TX_PKT_RETRY (1<<31)
1164#define MAC_TX_BUFF0_ADDR 0x4
1165 #define TX_DMA_ENABLE (1<<0)
1166 #define TX_T_DONE (1<<1)
1167 #define TX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
1168#define MAC_TX_BUFF0_LEN 0x8
1169#define MAC_TX_BUFF1_STATUS 0x10
1170#define MAC_TX_BUFF1_ADDR 0x14
1171#define MAC_TX_BUFF1_LEN 0x18
1172#define MAC_TX_BUFF2_STATUS 0x20
1173#define MAC_TX_BUFF2_ADDR 0x24
1174#define MAC_TX_BUFF2_LEN 0x28
1175#define MAC_TX_BUFF3_STATUS 0x30
1176#define MAC_TX_BUFF3_ADDR 0x34
1177#define MAC_TX_BUFF3_LEN 0x38
1178
1179#define MAC0_RX_DMA_ADDR 0xB4004100
1180#define MAC1_RX_DMA_ADDR 0xB4004300
1181/* offsets from MAC_RX_RING_ADDR */
1182#define MAC_RX_BUFF0_STATUS 0x0
1183 #define RX_FRAME_LEN_MASK 0x3fff
1184 #define RX_WDOG_TIMER (1<<14)
1185 #define RX_RUNT (1<<15)
1186 #define RX_OVERLEN (1<<16)
1187 #define RX_COLL (1<<17)
1188 #define RX_ETHER (1<<18)
1189 #define RX_MII_ERROR (1<<19)
1190 #define RX_DRIBBLING (1<<20)
1191 #define RX_CRC_ERROR (1<<21)
1192 #define RX_VLAN1 (1<<22)
1193 #define RX_VLAN2 (1<<23)
1194 #define RX_LEN_ERROR (1<<24)
1195 #define RX_CNTRL_FRAME (1<<25)
1196 #define RX_U_CNTRL_FRAME (1<<26)
1197 #define RX_MCAST_FRAME (1<<27)
1198 #define RX_BCAST_FRAME (1<<28)
1199 #define RX_FILTER_FAIL (1<<29)
1200 #define RX_PACKET_FILTER (1<<30)
1201 #define RX_MISSED_FRAME (1<<31)
1202
1203 #define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
1204 RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
1205 RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
1206#define MAC_RX_BUFF0_ADDR 0x4
1207 #define RX_DMA_ENABLE (1<<0)
1208 #define RX_T_DONE (1<<1)
1209 #define RX_GET_DMA_BUFFER(X) (((X)>>2)&0x3)
1210 #define RX_SET_BUFF_ADDR(X) ((X)&0xffffffc0)
1211#define MAC_RX_BUFF1_STATUS 0x10
1212#define MAC_RX_BUFF1_ADDR 0x14
1213#define MAC_RX_BUFF2_STATUS 0x20
1214#define MAC_RX_BUFF2_ADDR 0x24
1215#define MAC_RX_BUFF3_STATUS 0x30
1216#define MAC_RX_BUFF3_ADDR 0x34
1217
1218
1219/* UARTS 0-3 */
1220#define UART_BASE UART0_ADDR
1221#define UART_DEBUG_BASE UART3_ADDR
1222
1223#define UART_RX 0 /* Receive buffer */
1224#define UART_TX 4 /* Transmit buffer */
1225#define UART_IER 8 /* Interrupt Enable Register */
1226#define UART_IIR 0xC /* Interrupt ID Register */
1227#define UART_FCR 0x10 /* FIFO Control Register */
1228#define UART_LCR 0x14 /* Line Control Register */
1229#define UART_MCR 0x18 /* Modem Control Register */
1230#define UART_LSR 0x1C /* Line Status Register */
1231#define UART_MSR 0x20 /* Modem Status Register */
1232#define UART_CLK 0x28 /* Baud Rate Clock Divider */
1233#define UART_MOD_CNTRL 0x100 /* Module Control */
1234
1235#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
1236#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
1237#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
1238#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
1239#define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
1240#define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
1241#define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
1242#define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
1243#define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
1244#define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
1245#define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
1246#define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
1247#define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
1248
1249/*
1250 * These are the definitions for the Line Control Register
1251 */
1252#define UART_LCR_SBC 0x40 /* Set break control */
1253#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
1254#define UART_LCR_EPAR 0x10 /* Even parity select */
1255#define UART_LCR_PARITY 0x08 /* Parity Enable */
1256#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
1257#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
1258#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
1259#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
1260#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
1261
1262/*
1263 * These are the definitions for the Line Status Register
1264 */
1265#define UART_LSR_TEMT 0x40 /* Transmitter empty */
1266#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
1267#define UART_LSR_BI 0x10 /* Break interrupt indicator */
1268#define UART_LSR_FE 0x08 /* Frame error indicator */
1269#define UART_LSR_PE 0x04 /* Parity error indicator */
1270#define UART_LSR_OE 0x02 /* Overrun error indicator */
1271#define UART_LSR_DR 0x01 /* Receiver data ready */
1272
1273/*
1274 * These are the definitions for the Interrupt Identification Register
1275 */
1276#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
1277#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
1278#define UART_IIR_MSI 0x00 /* Modem status interrupt */
1279#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
1280#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
1281#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
1282
1283/*
1284 * These are the definitions for the Interrupt Enable Register
1285 */
1286#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
1287#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
1288#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
1289#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
1290
1291/*
1292 * These are the definitions for the Modem Control Register
1293 */
1294#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
1295#define UART_MCR_OUT2 0x08 /* Out2 complement */
1296#define UART_MCR_OUT1 0x04 /* Out1 complement */
1297#define UART_MCR_RTS 0x02 /* RTS complement */
1298#define UART_MCR_DTR 0x01 /* DTR complement */
1299
1300/*
1301 * These are the definitions for the Modem Status Register
1302 */
1303#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
1304#define UART_MSR_RI 0x40 /* Ring Indicator */
1305#define UART_MSR_DSR 0x20 /* Data Set Ready */
1306#define UART_MSR_CTS 0x10 /* Clear to Send */
1307#define UART_MSR_DDCD 0x08 /* Delta DCD */
1308#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
1309#define UART_MSR_DDSR 0x02 /* Delta DSR */
1310#define UART_MSR_DCTS 0x01 /* Delta CTS */
1311#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
1312
1313
1314
1315/* SSIO */
1316#define SSI0_STATUS 0xB1600000
1317 #define SSI_STATUS_BF (1<<4)
1318 #define SSI_STATUS_OF (1<<3)
1319 #define SSI_STATUS_UF (1<<2)
1320 #define SSI_STATUS_D (1<<1)
1321 #define SSI_STATUS_B (1<<0)
1322#define SSI0_INT 0xB1600004
1323 #define SSI_INT_OI (1<<3)
1324 #define SSI_INT_UI (1<<2)
1325 #define SSI_INT_DI (1<<1)
1326#define SSI0_INT_ENABLE 0xB1600008
1327 #define SSI_INTE_OIE (1<<3)
1328 #define SSI_INTE_UIE (1<<2)
1329 #define SSI_INTE_DIE (1<<1)
1330#define SSI0_CONFIG 0xB1600020
1331 #define SSI_CONFIG_AO (1<<24)
1332 #define SSI_CONFIG_DO (1<<23)
1333 #define SSI_CONFIG_ALEN_BIT 20
1334 #define SSI_CONFIG_ALEN_MASK (0x7<<20)
1335 #define SSI_CONFIG_DLEN_BIT 16
1336 #define SSI_CONFIG_DLEN_MASK (0x7<<16)
1337 #define SSI_CONFIG_DD (1<<11)
1338 #define SSI_CONFIG_AD (1<<10)
1339 #define SSI_CONFIG_BM_BIT 8
1340 #define SSI_CONFIG_BM_MASK (0x3<<8)
1341 #define SSI_CONFIG_CE (1<<7)
1342 #define SSI_CONFIG_DP (1<<6)
1343 #define SSI_CONFIG_DL (1<<5)
1344 #define SSI_CONFIG_EP (1<<4)
1345#define SSI0_ADATA 0xB1600024
1346 #define SSI_AD_D (1<<24)
1347 #define SSI_AD_ADDR_BIT 16
1348 #define SSI_AD_ADDR_MASK (0xff<<16)
1349 #define SSI_AD_DATA_BIT 0
1350 #define SSI_AD_DATA_MASK (0xfff<<0)
1351#define SSI0_CLKDIV 0xB1600028
1352#define SSI0_CONTROL 0xB1600100
1353 #define SSI_CONTROL_CD (1<<1)
1354 #define SSI_CONTROL_E (1<<0)
1355
1356/* SSI1 */
1357#define SSI1_STATUS 0xB1680000
1358#define SSI1_INT 0xB1680004
1359#define SSI1_INT_ENABLE 0xB1680008
1360#define SSI1_CONFIG 0xB1680020
1361#define SSI1_ADATA 0xB1680024
1362#define SSI1_CLKDIV 0xB1680028
1363#define SSI1_ENABLE 0xB1680100
1364
1365/*
1366 * Register content definitions
1367 */
1368#define SSI_STATUS_BF (1<<4)
1369#define SSI_STATUS_OF (1<<3)
1370#define SSI_STATUS_UF (1<<2)
1371#define SSI_STATUS_D (1<<1)
1372#define SSI_STATUS_B (1<<0)
1373
1374/* SSI_INT */
1375#define SSI_INT_OI (1<<3)
1376#define SSI_INT_UI (1<<2)
1377#define SSI_INT_DI (1<<1)
1378
1379/* SSI_INTEN */
1380#define SSI_INTEN_OIE (1<<3)
1381#define SSI_INTEN_UIE (1<<2)
1382#define SSI_INTEN_DIE (1<<1)
1383
1384#define SSI_CONFIG_AO (1<<24)
1385#define SSI_CONFIG_DO (1<<23)
1386#define SSI_CONFIG_ALEN (7<<20)
1387#define SSI_CONFIG_DLEN (15<<16)
1388#define SSI_CONFIG_DD (1<<11)
1389#define SSI_CONFIG_AD (1<<10)
1390#define SSI_CONFIG_BM (3<<8)
1391#define SSI_CONFIG_CE (1<<7)
1392#define SSI_CONFIG_DP (1<<6)
1393#define SSI_CONFIG_DL (1<<5)
1394#define SSI_CONFIG_EP (1<<4)
1395#define SSI_CONFIG_ALEN_N(N) ((N-1)<<20)
1396#define SSI_CONFIG_DLEN_N(N) ((N-1)<<16)
1397#define SSI_CONFIG_BM_HI (0<<8)
1398#define SSI_CONFIG_BM_LO (1<<8)
1399#define SSI_CONFIG_BM_CY (2<<8)
1400
1401#define SSI_ADATA_D (1<<24)
1402#define SSI_ADATA_ADDR (0xFF<<16)
1403#define SSI_ADATA_DATA (0x0FFF)
1404#define SSI_ADATA_ADDR_N(N) (N<<16)
1405
1406#define SSI_ENABLE_CD (1<<1)
1407#define SSI_ENABLE_E (1<<0)
1408
1409
1410/* IrDA Controller */
1411#define IRDA_BASE 0xB0300000
1412#define IR_RING_PTR_STATUS (IRDA_BASE+0x00)
1413#define IR_RING_BASE_ADDR_H (IRDA_BASE+0x04)
1414#define IR_RING_BASE_ADDR_L (IRDA_BASE+0x08)
1415#define IR_RING_SIZE (IRDA_BASE+0x0C)
1416#define IR_RING_PROMPT (IRDA_BASE+0x10)
1417#define IR_RING_ADDR_CMPR (IRDA_BASE+0x14)
1418#define IR_INT_CLEAR (IRDA_BASE+0x18)
1419#define IR_CONFIG_1 (IRDA_BASE+0x20)
1420 #define IR_RX_INVERT_LED (1<<0)
1421 #define IR_TX_INVERT_LED (1<<1)
1422 #define IR_ST (1<<2)
1423 #define IR_SF (1<<3)
1424 #define IR_SIR (1<<4)
1425 #define IR_MIR (1<<5)
1426 #define IR_FIR (1<<6)
1427 #define IR_16CRC (1<<7)
1428 #define IR_TD (1<<8)
1429 #define IR_RX_ALL (1<<9)
1430 #define IR_DMA_ENABLE (1<<10)
1431 #define IR_RX_ENABLE (1<<11)
1432 #define IR_TX_ENABLE (1<<12)
1433 #define IR_LOOPBACK (1<<14)
1434 #define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \
1435 IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
1436#define IR_SIR_FLAGS (IRDA_BASE+0x24)
1437#define IR_ENABLE (IRDA_BASE+0x28)
1438 #define IR_RX_STATUS (1<<9)
1439 #define IR_TX_STATUS (1<<10)
1440#define IR_READ_PHY_CONFIG (IRDA_BASE+0x2C)
1441#define IR_WRITE_PHY_CONFIG (IRDA_BASE+0x30)
1442#define IR_MAX_PKT_LEN (IRDA_BASE+0x34)
1443#define IR_RX_BYTE_CNT (IRDA_BASE+0x38)
1444#define IR_CONFIG_2 (IRDA_BASE+0x3C)
1445 #define IR_MODE_INV (1<<0)
1446 #define IR_ONE_PIN (1<<1)
1447#define IR_INTERFACE_CONFIG (IRDA_BASE+0x40)
1448
1449/* GPIO */
1450#define SYS_PINFUNC 0xB190002C
1451 #define SYS_PF_USB (1<<15) /* 2nd USB device/host */
1452 #define SYS_PF_U3 (1<<14) /* GPIO23/U3TXD */
1453 #define SYS_PF_U2 (1<<13) /* GPIO22/U2TXD */
1454 #define SYS_PF_U1 (1<<12) /* GPIO21/U1TXD */
1455 #define SYS_PF_SRC (1<<11) /* GPIO6/SROMCKE */
1456 #define SYS_PF_CK5 (1<<10) /* GPIO3/CLK5 */
1457 #define SYS_PF_CK4 (1<<9) /* GPIO2/CLK4 */
1458 #define SYS_PF_IRF (1<<8) /* GPIO15/IRFIRSEL */
1459 #define SYS_PF_UR3 (1<<7) /* GPIO[14:9]/UART3 */
1460 #define SYS_PF_I2D (1<<6) /* GPIO8/I2SDI */
1461 #define SYS_PF_I2S (1<<5) /* I2S/GPIO[29:31] */
1462 #define SYS_PF_NI2 (1<<4) /* NI2/GPIO[24:28] */
1463 #define SYS_PF_U0 (1<<3) /* U0TXD/GPIO20 */
1464 #define SYS_PF_RD (1<<2) /* IRTXD/GPIO19 */
1465 #define SYS_PF_A97 (1<<1) /* AC97/SSL1 */
1466 #define SYS_PF_S0 (1<<0) /* SSI_0/GPIO[16:18] */
1467
1468/* Au1100 Only */
1469 #define SYS_PF_PC (1<<18) /* PCMCIA/GPIO[207:204] */
1470 #define SYS_PF_LCD (1<<17) /* extern lcd/GPIO[203:200] */
1471 #define SYS_PF_CS (1<<16) /* EXTCLK0/32khz to gpio2 */
1472 #define SYS_PF_EX0 (1<<9) /* gpio2/clock */
1473
1474/* Au1550 Only. Redefines lots of pins */
1475 #define SYS_PF_PSC2_MASK (7 << 17)
1476 #define SYS_PF_PSC2_AC97 (0)
1477 #define SYS_PF_PSC2_SPI (0)
1478 #define SYS_PF_PSC2_I2S (1 << 17)
1479 #define SYS_PF_PSC2_SMBUS (3 << 17)
1480 #define SYS_PF_PSC2_GPIO (7 << 17)
1481 #define SYS_PF_PSC3_MASK (7 << 20)
1482 #define SYS_PF_PSC3_AC97 (0)
1483 #define SYS_PF_PSC3_SPI (0)
1484 #define SYS_PF_PSC3_I2S (1 << 20)
1485 #define SYS_PF_PSC3_SMBUS (3 << 20)
1486 #define SYS_PF_PSC3_GPIO (7 << 20)
1487 #define SYS_PF_PSC1_S1 (1 << 1)
1488 #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
1489
Pete Popove3ad1c22005-03-01 06:33:16 +00001490/* Au1200 Only */
1491#ifdef CONFIG_SOC_AU1200
1492#define SYS_PINFUNC_DMA (1<<31)
1493#define SYS_PINFUNC_S0A (1<<30)
1494#define SYS_PINFUNC_S1A (1<<29)
1495#define SYS_PINFUNC_LP0 (1<<28)
1496#define SYS_PINFUNC_LP1 (1<<27)
1497#define SYS_PINFUNC_LD16 (1<<26)
1498#define SYS_PINFUNC_LD8 (1<<25)
1499#define SYS_PINFUNC_LD1 (1<<24)
1500#define SYS_PINFUNC_LD0 (1<<23)
1501#define SYS_PINFUNC_P1A (3<<21)
1502#define SYS_PINFUNC_P1B (1<<20)
1503#define SYS_PINFUNC_FS3 (1<<19)
1504#define SYS_PINFUNC_P0A (3<<17)
1505#define SYS_PINFUNC_CS (1<<16)
1506#define SYS_PINFUNC_CIM (1<<15)
1507#define SYS_PINFUNC_P1C (1<<14)
1508#define SYS_PINFUNC_U1T (1<<12)
1509#define SYS_PINFUNC_U1R (1<<11)
1510#define SYS_PINFUNC_EX1 (1<<10)
1511#define SYS_PINFUNC_EX0 (1<<9)
1512#define SYS_PINFUNC_U0R (1<<8)
1513#define SYS_PINFUNC_MC (1<<7)
1514#define SYS_PINFUNC_S0B (1<<6)
1515#define SYS_PINFUNC_S0C (1<<5)
1516#define SYS_PINFUNC_P0B (1<<4)
1517#define SYS_PINFUNC_U0T (1<<3)
1518#define SYS_PINFUNC_S1B (1<<2)
1519#endif
1520
Linus Torvalds1da177e2005-04-16 15:20:36 -07001521#define SYS_TRIOUTRD 0xB1900100
1522#define SYS_TRIOUTCLR 0xB1900100
1523#define SYS_OUTPUTRD 0xB1900108
1524#define SYS_OUTPUTSET 0xB1900108
1525#define SYS_OUTPUTCLR 0xB190010C
1526#define SYS_PINSTATERD 0xB1900110
1527#define SYS_PININPUTEN 0xB1900110
1528
1529/* GPIO2, Au1500, Au1550 only */
1530#define GPIO2_BASE 0xB1700000
1531#define GPIO2_DIR (GPIO2_BASE + 0)
1532#define GPIO2_OUTPUT (GPIO2_BASE + 8)
1533#define GPIO2_PINSTATE (GPIO2_BASE + 0xC)
1534#define GPIO2_INTENABLE (GPIO2_BASE + 0x10)
1535#define GPIO2_ENABLE (GPIO2_BASE + 0x14)
1536
1537/* Power Management */
1538#define SYS_SCRATCH0 0xB1900018
1539#define SYS_SCRATCH1 0xB190001C
1540#define SYS_WAKEMSK 0xB1900034
1541#define SYS_ENDIAN 0xB1900038
1542#define SYS_POWERCTRL 0xB190003C
1543#define SYS_WAKESRC 0xB190005C
1544#define SYS_SLPPWR 0xB1900078
1545#define SYS_SLEEP 0xB190007C
1546
1547/* Clock Controller */
1548#define SYS_FREQCTRL0 0xB1900020
1549 #define SYS_FC_FRDIV2_BIT 22
1550 #define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
1551 #define SYS_FC_FE2 (1<<21)
1552 #define SYS_FC_FS2 (1<<20)
1553 #define SYS_FC_FRDIV1_BIT 12
1554 #define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
1555 #define SYS_FC_FE1 (1<<11)
1556 #define SYS_FC_FS1 (1<<10)
1557 #define SYS_FC_FRDIV0_BIT 2
1558 #define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
1559 #define SYS_FC_FE0 (1<<1)
1560 #define SYS_FC_FS0 (1<<0)
1561#define SYS_FREQCTRL1 0xB1900024
1562 #define SYS_FC_FRDIV5_BIT 22
1563 #define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
1564 #define SYS_FC_FE5 (1<<21)
1565 #define SYS_FC_FS5 (1<<20)
1566 #define SYS_FC_FRDIV4_BIT 12
1567 #define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
1568 #define SYS_FC_FE4 (1<<11)
1569 #define SYS_FC_FS4 (1<<10)
1570 #define SYS_FC_FRDIV3_BIT 2
1571 #define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
1572 #define SYS_FC_FE3 (1<<1)
1573 #define SYS_FC_FS3 (1<<0)
1574#define SYS_CLKSRC 0xB1900028
1575 #define SYS_CS_ME1_BIT 27
1576 #define SYS_CS_ME1_MASK (0x7<<SYS_CS_ME1_BIT)
1577 #define SYS_CS_DE1 (1<<26)
1578 #define SYS_CS_CE1 (1<<25)
1579 #define SYS_CS_ME0_BIT 22
1580 #define SYS_CS_ME0_MASK (0x7<<SYS_CS_ME0_BIT)
1581 #define SYS_CS_DE0 (1<<21)
1582 #define SYS_CS_CE0 (1<<20)
1583 #define SYS_CS_MI2_BIT 17
1584 #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT)
1585 #define SYS_CS_DI2 (1<<16)
1586 #define SYS_CS_CI2 (1<<15)
Pete Popov3b495f22005-04-04 01:06:19 +00001587#ifdef CONFIG_SOC_AU1100
1588 #define SYS_CS_ML_BIT 7
1589 #define SYS_CS_ML_MASK (0x7<<SYS_CS_ML_BIT)
1590 #define SYS_CS_DL (1<<6)
1591 #define SYS_CS_CL (1<<5)
1592#else
Linus Torvalds1da177e2005-04-16 15:20:36 -07001593 #define SYS_CS_MUH_BIT 12
1594 #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT)
1595 #define SYS_CS_DUH (1<<11)
1596 #define SYS_CS_CUH (1<<10)
1597 #define SYS_CS_MUD_BIT 7
1598 #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT)
1599 #define SYS_CS_DUD (1<<6)
1600 #define SYS_CS_CUD (1<<5)
Pete Popov3b495f22005-04-04 01:06:19 +00001601#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001602 #define SYS_CS_MIR_BIT 2
1603 #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT)
1604 #define SYS_CS_DIR (1<<1)
1605 #define SYS_CS_CIR (1<<0)
1606
1607 #define SYS_CS_MUX_AUX 0x1
1608 #define SYS_CS_MUX_FQ0 0x2
1609 #define SYS_CS_MUX_FQ1 0x3
1610 #define SYS_CS_MUX_FQ2 0x4
1611 #define SYS_CS_MUX_FQ3 0x5
1612 #define SYS_CS_MUX_FQ4 0x6
1613 #define SYS_CS_MUX_FQ5 0x7
1614#define SYS_CPUPLL 0xB1900060
1615#define SYS_AUXPLL 0xB1900064
1616
1617/* AC97 Controller */
1618#define AC97C_CONFIG 0xB0000000
1619 #define AC97C_RECV_SLOTS_BIT 13
1620 #define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
1621 #define AC97C_XMIT_SLOTS_BIT 3
1622 #define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
1623 #define AC97C_SG (1<<2)
1624 #define AC97C_SYNC (1<<1)
1625 #define AC97C_RESET (1<<0)
1626#define AC97C_STATUS 0xB0000004
1627 #define AC97C_XU (1<<11)
1628 #define AC97C_XO (1<<10)
1629 #define AC97C_RU (1<<9)
1630 #define AC97C_RO (1<<8)
1631 #define AC97C_READY (1<<7)
1632 #define AC97C_CP (1<<6)
1633 #define AC97C_TR (1<<5)
1634 #define AC97C_TE (1<<4)
1635 #define AC97C_TF (1<<3)
1636 #define AC97C_RR (1<<2)
1637 #define AC97C_RE (1<<1)
1638 #define AC97C_RF (1<<0)
1639#define AC97C_DATA 0xB0000008
1640#define AC97C_CMD 0xB000000C
1641 #define AC97C_WD_BIT 16
1642 #define AC97C_READ (1<<7)
1643 #define AC97C_INDEX_MASK 0x7f
1644#define AC97C_CNTRL 0xB0000010
1645 #define AC97C_RS (1<<1)
1646 #define AC97C_CE (1<<0)
1647
1648
1649/* Secure Digital (SD) Controller */
1650#define SD0_XMIT_FIFO 0xB0600000
1651#define SD0_RECV_FIFO 0xB0600004
1652#define SD1_XMIT_FIFO 0xB0680000
1653#define SD1_RECV_FIFO 0xB0680004
1654
Linus Torvalds1da177e2005-04-16 15:20:36 -07001655#if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
1656/* Au1500 PCI Controller */
1657#define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
1658#define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0)
1659#define Au1500_PCI_CFG (Au1500_CFG_BASE + 4)
1660 #define PCI_ERROR ((1<<22) | (1<<23) | (1<<24) | (1<<25) | (1<<26) | (1<<27))
1661#define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8)
1662#define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC)
1663#define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10)
1664#define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14)
1665#define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
1666#define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C)
1667#define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20)
1668#define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100)
1669#define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104)
1670#define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108)
1671#define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C)
1672#define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110)
1673
1674#define Au1500_PCI_HDR 0xB4005100 // virtual, kseg0 addr
1675
1676/* All of our structures, like pci resource, have 32 bit members.
1677 * Drivers are expected to do an ioremap on the PCI MEM resource, but it's
1678 * hard to store 0x4 0000 0000 in a 32 bit type. We require a small patch
1679 * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
1680 * (u32)Au1500_PCI_MEM_END and change those to the full 36 bit PCI MEM
1681 * addresses. For PCI IO, it's simpler because we get to do the ioremap
1682 * ourselves and then adjust the device's resources.
1683 */
1684#define Au1500_EXT_CFG 0x600000000ULL
1685#define Au1500_EXT_CFG_TYPE1 0x680000000ULL
1686#define Au1500_PCI_IO_START 0x500000000ULL
1687#define Au1500_PCI_IO_END 0x5000FFFFFULL
1688#define Au1500_PCI_MEM_START 0x440000000ULL
1689#define Au1500_PCI_MEM_END 0x44FFFFFFFULL
1690
1691#define PCI_IO_START (Au1500_PCI_IO_START + 0x1000)
1692#define PCI_IO_END (Au1500_PCI_IO_END)
1693#define PCI_MEM_START (Au1500_PCI_MEM_START)
1694#define PCI_MEM_END (Au1500_PCI_MEM_END)
1695#define PCI_FIRST_DEVFN (0<<3)
1696#define PCI_LAST_DEVFN (19<<3)
1697
1698#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
1699#define IOPORT_RESOURCE_END 0xffffffff
1700#define IOMEM_RESOURCE_START 0x10000000
1701#define IOMEM_RESOURCE_END 0xffffffff
1702
1703 /*
1704 * Borrowed from the PPC arch:
1705 * The following macro is used to lookup irqs in a standard table
1706 * format for those PPC systems that do not already have PCI
1707 * interrupts properly routed.
1708 */
1709 /* FIXME - double check this from asm-ppc/pci-bridge.h */
1710#define PCI_IRQ_TABLE_LOOKUP \
1711 ({ long _ctl_ = -1; \
1712 if (idsel >= min_idsel && idsel <= max_idsel && pin <= irqs_per_slot) \
1713 _ctl_ = pci_irq_table[idsel - min_idsel][pin-1]; \
1714 _ctl_; })
1715
1716
Pete Popove3ad1c22005-03-01 06:33:16 +00001717#else /* Au1000 and Au1100 and Au1200 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001718
1719/* don't allow any legacy ports probing */
Pete Popove3ad1c22005-03-01 06:33:16 +00001720#define IOPORT_RESOURCE_START 0x10000000
Linus Torvalds1da177e2005-04-16 15:20:36 -07001721#define IOPORT_RESOURCE_END 0xffffffff
1722#define IOMEM_RESOURCE_START 0x10000000
1723#define IOMEM_RESOURCE_END 0xffffffff
1724
Linus Torvalds1da177e2005-04-16 15:20:36 -07001725#define PCI_IO_START 0
1726#define PCI_IO_END 0
1727#define PCI_MEM_START 0
Ralf Baechle42a3b4f2005-09-03 15:56:17 -07001728#define PCI_MEM_END 0
Linus Torvalds1da177e2005-04-16 15:20:36 -07001729#define PCI_FIRST_DEVFN 0
1730#define PCI_LAST_DEVFN 0
Linus Torvalds1da177e2005-04-16 15:20:36 -07001731
1732#endif
1733
Pete Popove3ad1c22005-03-01 06:33:16 +00001734#ifndef _LANGUAGE_ASSEMBLY
1735typedef volatile struct
1736{
1737 /* 0x0000 */ u32 toytrim;
1738 /* 0x0004 */ u32 toywrite;
1739 /* 0x0008 */ u32 toymatch0;
1740 /* 0x000C */ u32 toymatch1;
1741 /* 0x0010 */ u32 toymatch2;
1742 /* 0x0014 */ u32 cntrctrl;
1743 /* 0x0018 */ u32 scratch0;
1744 /* 0x001C */ u32 scratch1;
1745 /* 0x0020 */ u32 freqctrl0;
1746 /* 0x0024 */ u32 freqctrl1;
1747 /* 0x0028 */ u32 clksrc;
1748 /* 0x002C */ u32 pinfunc;
1749 /* 0x0030 */ u32 reserved0;
1750 /* 0x0034 */ u32 wakemsk;
1751 /* 0x0038 */ u32 endian;
1752 /* 0x003C */ u32 powerctrl;
1753 /* 0x0040 */ u32 toyread;
1754 /* 0x0044 */ u32 rtctrim;
1755 /* 0x0048 */ u32 rtcwrite;
1756 /* 0x004C */ u32 rtcmatch0;
1757 /* 0x0050 */ u32 rtcmatch1;
1758 /* 0x0054 */ u32 rtcmatch2;
1759 /* 0x0058 */ u32 rtcread;
1760 /* 0x005C */ u32 wakesrc;
1761 /* 0x0060 */ u32 cpupll;
1762 /* 0x0064 */ u32 auxpll;
1763 /* 0x0068 */ u32 reserved1;
1764 /* 0x006C */ u32 reserved2;
1765 /* 0x0070 */ u32 reserved3;
1766 /* 0x0074 */ u32 reserved4;
1767 /* 0x0078 */ u32 slppwr;
1768 /* 0x007C */ u32 sleep;
1769 /* 0x0080 */ u32 reserved5[32];
1770 /* 0x0100 */ u32 trioutrd;
1771#define trioutclr trioutrd
1772 /* 0x0104 */ u32 reserved6;
1773 /* 0x0108 */ u32 outputrd;
1774#define outputset outputrd
1775 /* 0x010C */ u32 outputclr;
1776 /* 0x0110 */ u32 pinstaterd;
1777#define pininputen pinstaterd
1778
1779} AU1X00_SYS;
1780
1781static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
1782
1783#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001784/* Processor information base on prid.
1785 * Copied from PowerPC.
1786 */
Pete Popove3ad1c22005-03-01 06:33:16 +00001787#ifndef _LANGUAGE_ASSEMBLY
Linus Torvalds1da177e2005-04-16 15:20:36 -07001788struct cpu_spec {
1789 /* CPU is matched via (PRID & prid_mask) == prid_value */
1790 unsigned int prid_mask;
1791 unsigned int prid_value;
1792
1793 char *cpu_name;
1794 unsigned char cpu_od; /* Set Config[OD] */
1795 unsigned char cpu_bclk; /* Enable BCLK switching */
1796};
1797
1798extern struct cpu_spec cpu_specs[];
1799extern struct cpu_spec *cur_cpu_spec[];
1800#endif
Pete Popove3ad1c22005-03-01 06:33:16 +00001801
1802#endif
1803