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