blob: 2b88c2982cb0fd0e867ce05fe5d090a522fefb32 [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 *
Sergei Shtylyov01675092008-03-24 23:15:50 +03006 * Copyright 2000-2001, 2006-2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30 /*
31 * some definitions add by takuzo@sm.sony.co.jp and sato@sm.sony.co.jp
32 */
33
34#ifndef _AU1000_H_
35#define _AU1000_H_
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38#ifndef _LANGUAGE_ASSEMBLY
39
40#include <linux/delay.h>
Ralf Baechle786d7cd2006-11-07 09:58:30 +000041#include <linux/types.h>
Ralf Baechle9d360ab2007-10-17 15:38:30 +010042
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040043#include <linux/io.h>
44#include <linux/irq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46/* cpu pipeline flush */
47void static inline au_sync(void)
48{
49 __asm__ volatile ("sync");
50}
51
52void static inline au_sync_udelay(int us)
53{
54 __asm__ volatile ("sync");
55 udelay(us);
56}
57
58void static inline au_sync_delay(int ms)
59{
60 __asm__ volatile ("sync");
61 mdelay(ms);
62}
63
Pete Popov7de8d2322005-04-21 05:31:59 +000064void static inline au_writeb(u8 val, unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070065{
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040066 *(volatile u8 *)reg = val;
Linus Torvalds1da177e2005-04-16 15:20:36 -070067}
68
Pete Popov7de8d2322005-04-21 05:31:59 +000069void static inline au_writew(u16 val, unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070070{
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040071 *(volatile u16 *)reg = val;
Linus Torvalds1da177e2005-04-16 15:20:36 -070072}
73
Pete Popov7de8d2322005-04-21 05:31:59 +000074void static inline au_writel(u32 val, unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075{
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040076 *(volatile u32 *)reg = val;
Linus Torvalds1da177e2005-04-16 15:20:36 -070077}
78
Pete Popov7de8d2322005-04-21 05:31:59 +000079static inline u8 au_readb(unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080{
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040081 return *(volatile u8 *)reg;
Linus Torvalds1da177e2005-04-16 15:20:36 -070082}
83
Pete Popov7de8d2322005-04-21 05:31:59 +000084static inline u16 au_readw(unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070085{
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040086 return *(volatile u16 *)reg;
Linus Torvalds1da177e2005-04-16 15:20:36 -070087}
88
Pete Popov7de8d2322005-04-21 05:31:59 +000089static inline u32 au_readl(unsigned long reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070090{
Sergei Shtylyovff6814d2008-04-30 23:18:35 +040091 return *(volatile u32 *)reg;
Linus Torvalds1da177e2005-04-16 15:20:36 -070092}
93
Manuel Lauss074cf652008-12-21 09:26:21 +010094/* Early Au1000 have a write-only SYS_CPUPLL register. */
95static inline int au1xxx_cpu_has_pll_wo(void)
96{
97 switch (read_c0_prid()) {
98 case 0x00030100: /* Au1000 DA */
99 case 0x00030201: /* Au1000 HA */
100 case 0x00030202: /* Au1000 HB */
101 return 1;
102 }
103 return 0;
104}
105
106/* does CPU need CONFIG[OD] set to fix tons of errata? */
107static inline int au1xxx_cpu_needs_config_od(void)
108{
109 /*
110 * c0_config.od (bit 19) was write only (and read as 0) on the
111 * early revisions of Alchemy SOCs. It disables the bus trans-
112 * action overlapping and needs to be set to fix various errata.
113 */
114 switch (read_c0_prid()) {
115 case 0x00030100: /* Au1000 DA */
116 case 0x00030201: /* Au1000 HA */
117 case 0x00030202: /* Au1000 HB */
118 case 0x01030200: /* Au1500 AB */
119 /*
120 * Au1100/Au1200 errata actually keep silence about this bit,
121 * so we set it just in case for those revisions that require
122 * it to be set according to the (now gone) cpu_table.
123 */
124 case 0x02030200: /* Au1100 AB */
125 case 0x02030201: /* Au1100 BA */
126 case 0x02030202: /* Au1100 BC */
127 case 0x04030201: /* Au1200 AC */
128 return 1;
129 }
130 return 0;
131}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133/* arch/mips/au1000/common/clocks.c */
134extern void set_au1x00_speed(unsigned int new_freq);
135extern unsigned int get_au1x00_speed(void);
136extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
137extern unsigned long get_au1x00_uart_baud_base(void);
Manuel Lauss2699cdf2008-12-21 09:26:24 +0100138extern unsigned long au1xxx_calc_clock(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
140/*
141 * Every board describes its IRQ mapping with this table.
142 */
Ralf Baechle0e6799e2007-10-15 01:07:39 +0100143struct au1xxx_irqmap {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144 int im_irq;
145 int im_type;
146 int im_request;
Ralf Baechle0e6799e2007-10-15 01:07:39 +0100147};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148
Manuel Lauss785e3262008-12-21 09:26:17 +0100149/* core calls this function to let boards initialize other IRQ sources */
150void board_init_irq(void);
151
152/* boards call this to register additional (GPIO) interrupts */
153void au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154
155#endif /* !defined (_LANGUAGE_ASSEMBLY) */
156
Pete Popove3ad1c22005-03-01 06:33:16 +0000157/*
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400158 * SDRAM register offsets
Pete Popove3ad1c22005-03-01 06:33:16 +0000159 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400160#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || \
161 defined(CONFIG_SOC_AU1100)
162#define MEM_SDMODE0 0x0000
163#define MEM_SDMODE1 0x0004
164#define MEM_SDMODE2 0x0008
165#define MEM_SDADDR0 0x000C
166#define MEM_SDADDR1 0x0010
167#define MEM_SDADDR2 0x0014
168#define MEM_SDREFCFG 0x0018
169#define MEM_SDPRECMD 0x001C
170#define MEM_SDAUTOREF 0x0020
171#define MEM_SDWRMD0 0x0024
172#define MEM_SDWRMD1 0x0028
173#define MEM_SDWRMD2 0x002C
174#define MEM_SDSLEEP 0x0030
175#define MEM_SDSMCKE 0x0034
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176
Pete Popove3ad1c22005-03-01 06:33:16 +0000177/*
178 * MEM_SDMODE register content definitions
179 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400180#define MEM_SDMODE_F (1 << 22)
181#define MEM_SDMODE_SR (1 << 21)
182#define MEM_SDMODE_BS (1 << 20)
183#define MEM_SDMODE_RS (3 << 18)
184#define MEM_SDMODE_CS (7 << 15)
185#define MEM_SDMODE_TRAS (15 << 11)
186#define MEM_SDMODE_TMRD (3 << 9)
187#define MEM_SDMODE_TWR (3 << 7)
188#define MEM_SDMODE_TRP (3 << 5)
189#define MEM_SDMODE_TRCD (3 << 3)
190#define MEM_SDMODE_TCL (7 << 0)
Pete Popove3ad1c22005-03-01 06:33:16 +0000191
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400192#define MEM_SDMODE_BS_2Bank (0 << 20)
193#define MEM_SDMODE_BS_4Bank (1 << 20)
194#define MEM_SDMODE_RS_11Row (0 << 18)
195#define MEM_SDMODE_RS_12Row (1 << 18)
196#define MEM_SDMODE_RS_13Row (2 << 18)
197#define MEM_SDMODE_RS_N(N) ((N) << 18)
198#define MEM_SDMODE_CS_7Col (0 << 15)
199#define MEM_SDMODE_CS_8Col (1 << 15)
200#define MEM_SDMODE_CS_9Col (2 << 15)
201#define MEM_SDMODE_CS_10Col (3 << 15)
202#define MEM_SDMODE_CS_11Col (4 << 15)
203#define MEM_SDMODE_CS_N(N) ((N) << 15)
204#define MEM_SDMODE_TRAS_N(N) ((N) << 11)
205#define MEM_SDMODE_TMRD_N(N) ((N) << 9)
206#define MEM_SDMODE_TWR_N(N) ((N) << 7)
207#define MEM_SDMODE_TRP_N(N) ((N) << 5)
208#define MEM_SDMODE_TRCD_N(N) ((N) << 3)
209#define MEM_SDMODE_TCL_N(N) ((N) << 0)
Pete Popove3ad1c22005-03-01 06:33:16 +0000210
211/*
212 * MEM_SDADDR register contents definitions
213 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400214#define MEM_SDADDR_E (1 << 20)
215#define MEM_SDADDR_CSBA (0x03FF << 10)
216#define MEM_SDADDR_CSMASK (0x03FF << 0)
217#define MEM_SDADDR_CSBA_N(N) ((N) & (0x03FF << 22) >> 12)
218#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF << 22) >> 22)
Pete Popove3ad1c22005-03-01 06:33:16 +0000219
220/*
221 * MEM_SDREFCFG register content definitions
222 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400223#define MEM_SDREFCFG_TRC (15 << 28)
224#define MEM_SDREFCFG_TRPM (3 << 26)
225#define MEM_SDREFCFG_E (1 << 25)
226#define MEM_SDREFCFG_RE (0x1ffffff << 0)
227#define MEM_SDREFCFG_TRC_N(N) ((N) << MEM_SDREFCFG_TRC)
228#define MEM_SDREFCFG_TRPM_N(N) ((N) << MEM_SDREFCFG_TRPM)
Pete Popove3ad1c22005-03-01 06:33:16 +0000229#define MEM_SDREFCFG_REF_N(N) (N)
230#endif
231
232/***********************************************************************/
233
234/*
235 * Au1550 SDRAM Register Offsets
236 */
237
238/***********************************************************************/
239
240#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400241#define MEM_SDMODE0 0x0800
242#define MEM_SDMODE1 0x0808
243#define MEM_SDMODE2 0x0810
244#define MEM_SDADDR0 0x0820
245#define MEM_SDADDR1 0x0828
246#define MEM_SDADDR2 0x0830
247#define MEM_SDCONFIGA 0x0840
248#define MEM_SDCONFIGB 0x0848
249#define MEM_SDSTAT 0x0850
250#define MEM_SDERRADDR 0x0858
251#define MEM_SDSTRIDE0 0x0860
252#define MEM_SDSTRIDE1 0x0868
253#define MEM_SDSTRIDE2 0x0870
254#define MEM_SDWRMD0 0x0880
255#define MEM_SDWRMD1 0x0888
256#define MEM_SDWRMD2 0x0890
257#define MEM_SDPRECMD 0x08C0
258#define MEM_SDAUTOREF 0x08C8
259#define MEM_SDSREF 0x08D0
Pete Popove3ad1c22005-03-01 06:33:16 +0000260#define MEM_SDSLEEP MEM_SDSREF
261
Pete Popove3ad1c22005-03-01 06:33:16 +0000262#endif
263
264/*
265 * Physical base addresses for integrated peripherals
266 */
267
268#ifdef CONFIG_SOC_AU1000
269#define MEM_PHYS_ADDR 0x14000000
270#define STATIC_MEM_PHYS_ADDR 0x14001000
271#define DMA0_PHYS_ADDR 0x14002000
272#define DMA1_PHYS_ADDR 0x14002100
273#define DMA2_PHYS_ADDR 0x14002200
274#define DMA3_PHYS_ADDR 0x14002300
275#define DMA4_PHYS_ADDR 0x14002400
276#define DMA5_PHYS_ADDR 0x14002500
277#define DMA6_PHYS_ADDR 0x14002600
278#define DMA7_PHYS_ADDR 0x14002700
279#define IC0_PHYS_ADDR 0x10400000
280#define IC1_PHYS_ADDR 0x11800000
281#define AC97_PHYS_ADDR 0x10000000
282#define USBH_PHYS_ADDR 0x10100000
283#define USBD_PHYS_ADDR 0x10200000
284#define IRDA_PHYS_ADDR 0x10300000
285#define MAC0_PHYS_ADDR 0x10500000
286#define MAC1_PHYS_ADDR 0x10510000
287#define MACEN_PHYS_ADDR 0x10520000
288#define MACDMA0_PHYS_ADDR 0x14004000
289#define MACDMA1_PHYS_ADDR 0x14004200
290#define I2S_PHYS_ADDR 0x11000000
291#define UART0_PHYS_ADDR 0x11100000
292#define UART1_PHYS_ADDR 0x11200000
293#define UART2_PHYS_ADDR 0x11300000
294#define UART3_PHYS_ADDR 0x11400000
295#define SSI0_PHYS_ADDR 0x11600000
296#define SSI1_PHYS_ADDR 0x11680000
297#define SYS_PHYS_ADDR 0x11900000
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400298#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
299#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
300#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000301#endif
302
303/********************************************************************/
304
305#ifdef CONFIG_SOC_AU1500
306#define MEM_PHYS_ADDR 0x14000000
307#define STATIC_MEM_PHYS_ADDR 0x14001000
308#define DMA0_PHYS_ADDR 0x14002000
309#define DMA1_PHYS_ADDR 0x14002100
310#define DMA2_PHYS_ADDR 0x14002200
311#define DMA3_PHYS_ADDR 0x14002300
312#define DMA4_PHYS_ADDR 0x14002400
313#define DMA5_PHYS_ADDR 0x14002500
314#define DMA6_PHYS_ADDR 0x14002600
315#define DMA7_PHYS_ADDR 0x14002700
316#define IC0_PHYS_ADDR 0x10400000
317#define IC1_PHYS_ADDR 0x11800000
318#define AC97_PHYS_ADDR 0x10000000
319#define USBH_PHYS_ADDR 0x10100000
320#define USBD_PHYS_ADDR 0x10200000
321#define PCI_PHYS_ADDR 0x14005000
322#define MAC0_PHYS_ADDR 0x11500000
323#define MAC1_PHYS_ADDR 0x11510000
324#define MACEN_PHYS_ADDR 0x11520000
325#define MACDMA0_PHYS_ADDR 0x14004000
326#define MACDMA1_PHYS_ADDR 0x14004200
327#define I2S_PHYS_ADDR 0x11000000
328#define UART0_PHYS_ADDR 0x11100000
329#define UART3_PHYS_ADDR 0x11400000
330#define GPIO2_PHYS_ADDR 0x11700000
331#define SYS_PHYS_ADDR 0x11900000
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400332#define PCI_MEM_PHYS_ADDR 0x400000000ULL
333#define PCI_IO_PHYS_ADDR 0x500000000ULL
334#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
335#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
336#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
337#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
338#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000339#endif
340
341/********************************************************************/
342
343#ifdef CONFIG_SOC_AU1100
344#define MEM_PHYS_ADDR 0x14000000
345#define STATIC_MEM_PHYS_ADDR 0x14001000
346#define DMA0_PHYS_ADDR 0x14002000
347#define DMA1_PHYS_ADDR 0x14002100
348#define DMA2_PHYS_ADDR 0x14002200
349#define DMA3_PHYS_ADDR 0x14002300
350#define DMA4_PHYS_ADDR 0x14002400
351#define DMA5_PHYS_ADDR 0x14002500
352#define DMA6_PHYS_ADDR 0x14002600
353#define DMA7_PHYS_ADDR 0x14002700
354#define IC0_PHYS_ADDR 0x10400000
355#define SD0_PHYS_ADDR 0x10600000
356#define SD1_PHYS_ADDR 0x10680000
357#define IC1_PHYS_ADDR 0x11800000
358#define AC97_PHYS_ADDR 0x10000000
359#define USBH_PHYS_ADDR 0x10100000
360#define USBD_PHYS_ADDR 0x10200000
361#define IRDA_PHYS_ADDR 0x10300000
362#define MAC0_PHYS_ADDR 0x10500000
363#define MACEN_PHYS_ADDR 0x10520000
364#define MACDMA0_PHYS_ADDR 0x14004000
365#define MACDMA1_PHYS_ADDR 0x14004200
366#define I2S_PHYS_ADDR 0x11000000
367#define UART0_PHYS_ADDR 0x11100000
368#define UART1_PHYS_ADDR 0x11200000
369#define UART3_PHYS_ADDR 0x11400000
370#define SSI0_PHYS_ADDR 0x11600000
371#define SSI1_PHYS_ADDR 0x11680000
372#define GPIO2_PHYS_ADDR 0x11700000
373#define SYS_PHYS_ADDR 0x11900000
374#define LCD_PHYS_ADDR 0x15000000
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400375#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
376#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
377#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000378#endif
379
380/***********************************************************************/
381
382#ifdef CONFIG_SOC_AU1550
383#define MEM_PHYS_ADDR 0x14000000
384#define STATIC_MEM_PHYS_ADDR 0x14001000
385#define IC0_PHYS_ADDR 0x10400000
386#define IC1_PHYS_ADDR 0x11800000
387#define USBH_PHYS_ADDR 0x14020000
388#define USBD_PHYS_ADDR 0x10200000
389#define PCI_PHYS_ADDR 0x14005000
390#define MAC0_PHYS_ADDR 0x10500000
391#define MAC1_PHYS_ADDR 0x10510000
392#define MACEN_PHYS_ADDR 0x10520000
393#define MACDMA0_PHYS_ADDR 0x14004000
394#define MACDMA1_PHYS_ADDR 0x14004200
395#define UART0_PHYS_ADDR 0x11100000
396#define UART1_PHYS_ADDR 0x11200000
397#define UART3_PHYS_ADDR 0x11400000
398#define GPIO2_PHYS_ADDR 0x11700000
399#define SYS_PHYS_ADDR 0x11900000
400#define DDMA_PHYS_ADDR 0x14002000
401#define PE_PHYS_ADDR 0x14008000
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400402#define PSC0_PHYS_ADDR 0x11A00000
403#define PSC1_PHYS_ADDR 0x11B00000
404#define PSC2_PHYS_ADDR 0x10A00000
405#define PSC3_PHYS_ADDR 0x10B00000
406#define PCI_MEM_PHYS_ADDR 0x400000000ULL
407#define PCI_IO_PHYS_ADDR 0x500000000ULL
408#define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL
409#define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL
410#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
411#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
412#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000413#endif
414
415/***********************************************************************/
416
417#ifdef CONFIG_SOC_AU1200
418#define MEM_PHYS_ADDR 0x14000000
419#define STATIC_MEM_PHYS_ADDR 0x14001000
420#define AES_PHYS_ADDR 0x10300000
421#define CIM_PHYS_ADDR 0x14004000
422#define IC0_PHYS_ADDR 0x10400000
423#define IC1_PHYS_ADDR 0x11800000
424#define USBM_PHYS_ADDR 0x14020000
425#define USBH_PHYS_ADDR 0x14020100
426#define UART0_PHYS_ADDR 0x11100000
427#define UART1_PHYS_ADDR 0x11200000
428#define GPIO2_PHYS_ADDR 0x11700000
429#define SYS_PHYS_ADDR 0x11900000
430#define DDMA_PHYS_ADDR 0x14002000
431#define PSC0_PHYS_ADDR 0x11A00000
432#define PSC1_PHYS_ADDR 0x11B00000
Pete Popove3ad1c22005-03-01 06:33:16 +0000433#define SD0_PHYS_ADDR 0x10600000
434#define SD1_PHYS_ADDR 0x10680000
435#define LCD_PHYS_ADDR 0x15000000
436#define SWCNT_PHYS_ADDR 0x1110010C
437#define MAEFE_PHYS_ADDR 0x14012000
438#define MAEBE_PHYS_ADDR 0x14010000
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400439#define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL
440#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL
441#define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL
Pete Popove3ad1c22005-03-01 06:33:16 +0000442#endif
443
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444/* Static Bus Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400445#define MEM_STCFG0 0xB4001000
446#define MEM_STTIME0 0xB4001004
447#define MEM_STADDR0 0xB4001008
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400449#define MEM_STCFG1 0xB4001010
450#define MEM_STTIME1 0xB4001014
451#define MEM_STADDR1 0xB4001018
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400453#define MEM_STCFG2 0xB4001020
454#define MEM_STTIME2 0xB4001024
455#define MEM_STADDR2 0xB4001028
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400457#define MEM_STCFG3 0xB4001030
458#define MEM_STTIME3 0xB4001034
459#define MEM_STADDR3 0xB4001038
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460
461#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400462#define MEM_STNDCTL 0xB4001100
463#define MEM_STSTAT 0xB4001104
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400465#define MEM_STNAND_CMD 0x0
466#define MEM_STNAND_ADDR 0x4
467#define MEM_STNAND_DATA 0x20
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468#endif
469
470/* Interrupt Controller 0 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400471#define IC0_CFG0RD 0xB0400040
472#define IC0_CFG0SET 0xB0400040
473#define IC0_CFG0CLR 0xB0400044
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400475#define IC0_CFG1RD 0xB0400048
476#define IC0_CFG1SET 0xB0400048
477#define IC0_CFG1CLR 0xB040004C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400479#define IC0_CFG2RD 0xB0400050
480#define IC0_CFG2SET 0xB0400050
481#define IC0_CFG2CLR 0xB0400054
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400483#define IC0_REQ0INT 0xB0400054
484#define IC0_SRCRD 0xB0400058
485#define IC0_SRCSET 0xB0400058
486#define IC0_SRCCLR 0xB040005C
487#define IC0_REQ1INT 0xB040005C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400489#define IC0_ASSIGNRD 0xB0400060
490#define IC0_ASSIGNSET 0xB0400060
491#define IC0_ASSIGNCLR 0xB0400064
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400493#define IC0_WAKERD 0xB0400068
494#define IC0_WAKESET 0xB0400068
495#define IC0_WAKECLR 0xB040006C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400497#define IC0_MASKRD 0xB0400070
498#define IC0_MASKSET 0xB0400070
499#define IC0_MASKCLR 0xB0400074
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400501#define IC0_RISINGRD 0xB0400078
502#define IC0_RISINGCLR 0xB0400078
503#define IC0_FALLINGRD 0xB040007C
504#define IC0_FALLINGCLR 0xB040007C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400506#define IC0_TESTBIT 0xB0400080
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507
508/* Interrupt Controller 1 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400509#define IC1_CFG0RD 0xB1800040
510#define IC1_CFG0SET 0xB1800040
511#define IC1_CFG0CLR 0xB1800044
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400513#define IC1_CFG1RD 0xB1800048
514#define IC1_CFG1SET 0xB1800048
515#define IC1_CFG1CLR 0xB180004C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700516
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400517#define IC1_CFG2RD 0xB1800050
518#define IC1_CFG2SET 0xB1800050
519#define IC1_CFG2CLR 0xB1800054
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400521#define IC1_REQ0INT 0xB1800054
522#define IC1_SRCRD 0xB1800058
523#define IC1_SRCSET 0xB1800058
524#define IC1_SRCCLR 0xB180005C
525#define IC1_REQ1INT 0xB180005C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400527#define IC1_ASSIGNRD 0xB1800060
528#define IC1_ASSIGNSET 0xB1800060
529#define IC1_ASSIGNCLR 0xB1800064
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400531#define IC1_WAKERD 0xB1800068
532#define IC1_WAKESET 0xB1800068
533#define IC1_WAKECLR 0xB180006C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400535#define IC1_MASKRD 0xB1800070
536#define IC1_MASKSET 0xB1800070
537#define IC1_MASKCLR 0xB1800074
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400539#define IC1_RISINGRD 0xB1800078
540#define IC1_RISINGCLR 0xB1800078
541#define IC1_FALLINGRD 0xB180007C
542#define IC1_FALLINGCLR 0xB180007C
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400544#define IC1_TESTBIT 0xB1800080
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546/* Interrupt Numbers */
547/* Au1000 */
548#ifdef CONFIG_SOC_AU1000
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100549enum soc_au1000_ints {
Sergei Shtylyov0e8120e2007-12-05 19:08:26 +0300550 AU1000_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100551 AU1000_UART0_INT = AU1000_FIRST_INT,
552 AU1000_UART1_INT, /* au1000 */
553 AU1000_UART2_INT, /* au1000 */
554 AU1000_UART3_INT,
555 AU1000_SSI0_INT, /* au1000 */
556 AU1000_SSI1_INT, /* au1000 */
557 AU1000_DMA_INT_BASE,
558
559 AU1000_TOY_INT = AU1000_FIRST_INT + 14,
560 AU1000_TOY_MATCH0_INT,
561 AU1000_TOY_MATCH1_INT,
562 AU1000_TOY_MATCH2_INT,
563 AU1000_RTC_INT,
564 AU1000_RTC_MATCH0_INT,
565 AU1000_RTC_MATCH1_INT,
566 AU1000_RTC_MATCH2_INT,
567 AU1000_IRDA_TX_INT, /* au1000 */
568 AU1000_IRDA_RX_INT, /* au1000 */
569 AU1000_USB_DEV_REQ_INT,
570 AU1000_USB_DEV_SUS_INT,
571 AU1000_USB_HOST_INT,
572 AU1000_ACSYNC_INT,
573 AU1000_MAC0_DMA_INT,
574 AU1000_MAC1_DMA_INT,
575 AU1000_I2S_UO_INT, /* au1000 */
576 AU1000_AC97C_INT,
577 AU1000_GPIO_0,
578 AU1000_GPIO_1,
579 AU1000_GPIO_2,
580 AU1000_GPIO_3,
581 AU1000_GPIO_4,
582 AU1000_GPIO_5,
583 AU1000_GPIO_6,
584 AU1000_GPIO_7,
585 AU1000_GPIO_8,
586 AU1000_GPIO_9,
587 AU1000_GPIO_10,
588 AU1000_GPIO_11,
589 AU1000_GPIO_12,
590 AU1000_GPIO_13,
591 AU1000_GPIO_14,
592 AU1000_GPIO_15,
593 AU1000_GPIO_16,
594 AU1000_GPIO_17,
595 AU1000_GPIO_18,
596 AU1000_GPIO_19,
597 AU1000_GPIO_20,
598 AU1000_GPIO_21,
599 AU1000_GPIO_22,
600 AU1000_GPIO_23,
601 AU1000_GPIO_24,
602 AU1000_GPIO_25,
603 AU1000_GPIO_26,
604 AU1000_GPIO_27,
605 AU1000_GPIO_28,
606 AU1000_GPIO_29,
607 AU1000_GPIO_30,
608 AU1000_GPIO_31,
609};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700610
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400611#define UART0_ADDR 0xB1100000
612#define UART1_ADDR 0xB1200000
613#define UART2_ADDR 0xB1300000
614#define UART3_ADDR 0xB1400000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700615
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400616#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
617#define USB_HOST_CONFIG 0xB017FFFC
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400619#define AU1000_ETH0_BASE 0xB0500000
620#define AU1000_ETH1_BASE 0xB0510000
621#define AU1000_MAC0_ENABLE 0xB0520000
622#define AU1000_MAC1_ENABLE 0xB0520004
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623#define NUM_ETH_INTERFACES 2
Pete Popove3ad1c22005-03-01 06:33:16 +0000624#endif /* CONFIG_SOC_AU1000 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625
626/* Au1500 */
627#ifdef CONFIG_SOC_AU1500
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100628enum soc_au1500_ints {
Sergei Shtylyov0e8120e2007-12-05 19:08:26 +0300629 AU1500_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100630 AU1500_UART0_INT = AU1500_FIRST_INT,
631 AU1000_PCI_INTA, /* au1500 */
632 AU1000_PCI_INTB, /* au1500 */
633 AU1500_UART3_INT,
634 AU1000_PCI_INTC, /* au1500 */
635 AU1000_PCI_INTD, /* au1500 */
636 AU1000_DMA_INT_BASE,
637
638 AU1000_TOY_INT = AU1500_FIRST_INT + 14,
639 AU1000_TOY_MATCH0_INT,
640 AU1000_TOY_MATCH1_INT,
641 AU1000_TOY_MATCH2_INT,
642 AU1000_RTC_INT,
643 AU1000_RTC_MATCH0_INT,
644 AU1000_RTC_MATCH1_INT,
645 AU1000_RTC_MATCH2_INT,
646 AU1500_PCI_ERR_INT,
bruno randolf6b7d0b22008-06-06 16:42:03 +0200647 AU1500_RESERVED_INT,
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100648 AU1000_USB_DEV_REQ_INT,
649 AU1000_USB_DEV_SUS_INT,
650 AU1000_USB_HOST_INT,
651 AU1000_ACSYNC_INT,
652 AU1500_MAC0_DMA_INT,
653 AU1500_MAC1_DMA_INT,
654 AU1000_AC97C_INT = AU1500_FIRST_INT + 31,
655 AU1000_GPIO_0,
656 AU1000_GPIO_1,
657 AU1000_GPIO_2,
658 AU1000_GPIO_3,
659 AU1000_GPIO_4,
660 AU1000_GPIO_5,
661 AU1000_GPIO_6,
662 AU1000_GPIO_7,
663 AU1000_GPIO_8,
664 AU1000_GPIO_9,
665 AU1000_GPIO_10,
666 AU1000_GPIO_11,
667 AU1000_GPIO_12,
668 AU1000_GPIO_13,
669 AU1000_GPIO_14,
670 AU1000_GPIO_15,
671 AU1500_GPIO_200,
672 AU1500_GPIO_201,
673 AU1500_GPIO_202,
674 AU1500_GPIO_203,
675 AU1500_GPIO_20,
676 AU1500_GPIO_204,
677 AU1500_GPIO_205,
678 AU1500_GPIO_23,
679 AU1500_GPIO_24,
680 AU1500_GPIO_25,
681 AU1500_GPIO_26,
682 AU1500_GPIO_27,
683 AU1500_GPIO_28,
684 AU1500_GPIO_206,
685 AU1500_GPIO_207,
686 AU1500_GPIO_208_215,
687};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700688
Pete Popov2d32ffa2005-03-01 07:54:50 +0000689/* shortcuts */
690#define INTA AU1000_PCI_INTA
691#define INTB AU1000_PCI_INTB
692#define INTC AU1000_PCI_INTC
693#define INTD AU1000_PCI_INTD
694
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400695#define UART0_ADDR 0xB1100000
696#define UART3_ADDR 0xB1400000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400698#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
699#define USB_HOST_CONFIG 0xB017fffc
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400701#define AU1500_ETH0_BASE 0xB1500000
702#define AU1500_ETH1_BASE 0xB1510000
703#define AU1500_MAC0_ENABLE 0xB1520000
704#define AU1500_MAC1_ENABLE 0xB1520004
Linus Torvalds1da177e2005-04-16 15:20:36 -0700705#define NUM_ETH_INTERFACES 2
Pete Popove3ad1c22005-03-01 06:33:16 +0000706#endif /* CONFIG_SOC_AU1500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700707
708/* Au1100 */
709#ifdef CONFIG_SOC_AU1100
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100710enum soc_au1100_ints {
Sergei Shtylyov0e8120e2007-12-05 19:08:26 +0300711 AU1100_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100712 AU1100_UART0_INT,
713 AU1100_UART1_INT,
714 AU1100_SD_INT,
715 AU1100_UART3_INT,
716 AU1000_SSI0_INT,
717 AU1000_SSI1_INT,
718 AU1000_DMA_INT_BASE,
719
720 AU1000_TOY_INT = AU1100_FIRST_INT + 14,
721 AU1000_TOY_MATCH0_INT,
722 AU1000_TOY_MATCH1_INT,
723 AU1000_TOY_MATCH2_INT,
724 AU1000_RTC_INT,
725 AU1000_RTC_MATCH0_INT,
726 AU1000_RTC_MATCH1_INT,
727 AU1000_RTC_MATCH2_INT,
728 AU1000_IRDA_TX_INT,
729 AU1000_IRDA_RX_INT,
730 AU1000_USB_DEV_REQ_INT,
731 AU1000_USB_DEV_SUS_INT,
732 AU1000_USB_HOST_INT,
733 AU1000_ACSYNC_INT,
734 AU1100_MAC0_DMA_INT,
735 AU1100_GPIO_208_215,
736 AU1100_LCD_INT,
737 AU1000_AC97C_INT,
738 AU1000_GPIO_0,
739 AU1000_GPIO_1,
740 AU1000_GPIO_2,
741 AU1000_GPIO_3,
742 AU1000_GPIO_4,
743 AU1000_GPIO_5,
744 AU1000_GPIO_6,
745 AU1000_GPIO_7,
746 AU1000_GPIO_8,
747 AU1000_GPIO_9,
748 AU1000_GPIO_10,
749 AU1000_GPIO_11,
750 AU1000_GPIO_12,
751 AU1000_GPIO_13,
752 AU1000_GPIO_14,
753 AU1000_GPIO_15,
754 AU1000_GPIO_16,
755 AU1000_GPIO_17,
756 AU1000_GPIO_18,
757 AU1000_GPIO_19,
758 AU1000_GPIO_20,
759 AU1000_GPIO_21,
760 AU1000_GPIO_22,
761 AU1000_GPIO_23,
762 AU1000_GPIO_24,
763 AU1000_GPIO_25,
764 AU1000_GPIO_26,
765 AU1000_GPIO_27,
766 AU1000_GPIO_28,
767 AU1000_GPIO_29,
768 AU1000_GPIO_30,
769 AU1000_GPIO_31,
770};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400772#define UART0_ADDR 0xB1100000
773#define UART1_ADDR 0xB1200000
774#define UART3_ADDR 0xB1400000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400776#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
777#define USB_HOST_CONFIG 0xB017FFFC
Linus Torvalds1da177e2005-04-16 15:20:36 -0700778
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400779#define AU1100_ETH0_BASE 0xB0500000
780#define AU1100_MAC0_ENABLE 0xB0520000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781#define NUM_ETH_INTERFACES 1
Pete Popove3ad1c22005-03-01 06:33:16 +0000782#endif /* CONFIG_SOC_AU1100 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700783
784#ifdef CONFIG_SOC_AU1550
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100785enum soc_au1550_ints {
Sergei Shtylyov0e8120e2007-12-05 19:08:26 +0300786 AU1550_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100787 AU1550_UART0_INT = AU1550_FIRST_INT,
788 AU1550_PCI_INTA,
789 AU1550_PCI_INTB,
790 AU1550_DDMA_INT,
791 AU1550_CRYPTO_INT,
792 AU1550_PCI_INTC,
793 AU1550_PCI_INTD,
794 AU1550_PCI_RST_INT,
795 AU1550_UART1_INT,
796 AU1550_UART3_INT,
797 AU1550_PSC0_INT,
798 AU1550_PSC1_INT,
799 AU1550_PSC2_INT,
800 AU1550_PSC3_INT,
801 AU1000_TOY_INT,
802 AU1000_TOY_MATCH0_INT,
803 AU1000_TOY_MATCH1_INT,
804 AU1000_TOY_MATCH2_INT,
805 AU1000_RTC_INT,
806 AU1000_RTC_MATCH0_INT,
807 AU1000_RTC_MATCH1_INT,
808 AU1000_RTC_MATCH2_INT,
809
810 AU1550_NAND_INT = AU1550_FIRST_INT + 23,
811 AU1550_USB_DEV_REQ_INT,
812 AU1000_USB_DEV_REQ_INT = AU1550_USB_DEV_REQ_INT,
813 AU1550_USB_DEV_SUS_INT,
814 AU1000_USB_DEV_SUS_INT = AU1550_USB_DEV_SUS_INT,
815 AU1550_USB_HOST_INT,
816 AU1000_USB_HOST_INT = AU1550_USB_HOST_INT,
817 AU1550_MAC0_DMA_INT,
818 AU1550_MAC1_DMA_INT,
819 AU1000_GPIO_0 = AU1550_FIRST_INT + 32,
820 AU1000_GPIO_1,
821 AU1000_GPIO_2,
822 AU1000_GPIO_3,
823 AU1000_GPIO_4,
824 AU1000_GPIO_5,
825 AU1000_GPIO_6,
826 AU1000_GPIO_7,
827 AU1000_GPIO_8,
828 AU1000_GPIO_9,
829 AU1000_GPIO_10,
830 AU1000_GPIO_11,
831 AU1000_GPIO_12,
832 AU1000_GPIO_13,
833 AU1000_GPIO_14,
834 AU1000_GPIO_15,
835 AU1550_GPIO_200,
836 AU1500_GPIO_201_205, /* Logical or of GPIO201:205 */
837 AU1500_GPIO_16,
838 AU1500_GPIO_17,
839 AU1500_GPIO_20,
840 AU1500_GPIO_21,
841 AU1500_GPIO_22,
842 AU1500_GPIO_23,
843 AU1500_GPIO_24,
844 AU1500_GPIO_25,
845 AU1500_GPIO_26,
846 AU1500_GPIO_27,
847 AU1500_GPIO_28,
848 AU1500_GPIO_206,
849 AU1500_GPIO_207,
850 AU1500_GPIO_208_218, /* Logical or of GPIO208:218 */
851};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852
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
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400859#define UART0_ADDR 0xB1100000
860#define UART1_ADDR 0xB1200000
861#define UART3_ADDR 0xB1400000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700862
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400863#define USB_OHCI_BASE 0x14020000 /* phys addr for ioremap */
864#define USB_OHCI_LEN 0x00060000
865#define USB_HOST_CONFIG 0xB4027ffc
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400867#define AU1550_ETH0_BASE 0xB0500000
868#define AU1550_ETH1_BASE 0xB0510000
869#define AU1550_MAC0_ENABLE 0xB0520000
870#define AU1550_MAC1_ENABLE 0xB0520004
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871#define NUM_ETH_INTERFACES 2
Pete Popove3ad1c22005-03-01 06:33:16 +0000872#endif /* CONFIG_SOC_AU1550 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700873
874#ifdef CONFIG_SOC_AU1200
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100875enum soc_au1200_ints {
Sergei Shtylyov0e8120e2007-12-05 19:08:26 +0300876 AU1200_FIRST_INT = MIPS_CPU_IRQ_BASE + 8,
Ralf Baechle9d360ab2007-10-17 15:38:30 +0100877 AU1200_UART0_INT = AU1200_FIRST_INT,
878 AU1200_SWT_INT,
879 AU1200_SD_INT,
880 AU1200_DDMA_INT,
881 AU1200_MAE_BE_INT,
882 AU1200_GPIO_200,
883 AU1200_GPIO_201,
884 AU1200_GPIO_202,
885 AU1200_UART1_INT,
886 AU1200_MAE_FE_INT,
887 AU1200_PSC0_INT,
888 AU1200_PSC1_INT,
889 AU1200_AES_INT,
890 AU1200_CAMERA_INT,
891 AU1000_TOY_INT,
892 AU1000_TOY_MATCH0_INT,
893 AU1000_TOY_MATCH1_INT,
894 AU1000_TOY_MATCH2_INT,
895 AU1000_RTC_INT,
896 AU1000_RTC_MATCH0_INT,
897 AU1000_RTC_MATCH1_INT,
898 AU1000_RTC_MATCH2_INT,
899
900 AU1200_NAND_INT = AU1200_FIRST_INT + 23,
901 AU1200_GPIO_204,
902 AU1200_GPIO_205,
903 AU1200_GPIO_206,
904 AU1200_GPIO_207,
905 AU1200_GPIO_208_215, /* Logical OR of 208:215 */
906 AU1200_USB_INT,
907 AU1000_USB_HOST_INT = AU1200_USB_INT,
908 AU1200_LCD_INT,
909 AU1200_MAE_BOTH_INT,
910 AU1000_GPIO_0,
911 AU1000_GPIO_1,
912 AU1000_GPIO_2,
913 AU1000_GPIO_3,
914 AU1000_GPIO_4,
915 AU1000_GPIO_5,
916 AU1000_GPIO_6,
917 AU1000_GPIO_7,
918 AU1000_GPIO_8,
919 AU1000_GPIO_9,
920 AU1000_GPIO_10,
921 AU1000_GPIO_11,
922 AU1000_GPIO_12,
923 AU1000_GPIO_13,
924 AU1000_GPIO_14,
925 AU1000_GPIO_15,
926 AU1000_GPIO_16,
927 AU1000_GPIO_17,
928 AU1000_GPIO_18,
929 AU1000_GPIO_19,
930 AU1000_GPIO_20,
931 AU1000_GPIO_21,
932 AU1000_GPIO_22,
933 AU1000_GPIO_23,
934 AU1000_GPIO_24,
935 AU1000_GPIO_25,
936 AU1000_GPIO_26,
937 AU1000_GPIO_27,
938 AU1000_GPIO_28,
939 AU1000_GPIO_29,
940 AU1000_GPIO_30,
941 AU1000_GPIO_31,
942};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700943
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400944#define UART0_ADDR 0xB1100000
945#define UART1_ADDR 0xB1200000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700946
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400947#define USB_UOC_BASE 0x14020020
948#define USB_UOC_LEN 0x20
949#define USB_OHCI_BASE 0x14020100
950#define USB_OHCI_LEN 0x100
951#define USB_EHCI_BASE 0x14020200
952#define USB_EHCI_LEN 0x100
953#define USB_UDC_BASE 0x14022000
954#define USB_UDC_LEN 0x2000
955#define USB_MSR_BASE 0xB4020000
956#define USB_MSR_MCFG 4
957#define USBMSRMCFG_OMEMEN 0
958#define USBMSRMCFG_OBMEN 1
959#define USBMSRMCFG_EMEMEN 2
960#define USBMSRMCFG_EBMEN 3
961#define USBMSRMCFG_DMEMEN 4
962#define USBMSRMCFG_DBMEN 5
963#define USBMSRMCFG_GMEMEN 6
964#define USBMSRMCFG_OHCCLKEN 16
965#define USBMSRMCFG_EHCCLKEN 17
966#define USBMSRMCFG_UDCCLKEN 18
967#define USBMSRMCFG_PHYPLLEN 19
968#define USBMSRMCFG_RDCOMB 30
969#define USBMSRMCFG_PFEN 31
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970
Pete Popove3ad1c22005-03-01 06:33:16 +0000971#endif /* CONFIG_SOC_AU1200 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700972
Sergei Shtylyov0e8120e2007-12-05 19:08:26 +0300973#define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
974#define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31)
975#define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_BASE + 32)
976#define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31)
977
978#define AU1000_MAX_INTR AU1000_INTC1_INT_LAST
Ralf Baechlef3e8d1d2007-10-17 10:58:43 +0100979#define INTX 0xFF /* not valid */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700980
Linus Torvalds1da177e2005-04-16 15:20:36 -0700981/* Programmable Counters 0 and 1 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +0400982#define SYS_BASE 0xB1900000
983#define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
984# define SYS_CNTRL_E1S (1 << 23)
985# define SYS_CNTRL_T1S (1 << 20)
986# define SYS_CNTRL_M21 (1 << 19)
987# define SYS_CNTRL_M11 (1 << 18)
988# define SYS_CNTRL_M01 (1 << 17)
989# define SYS_CNTRL_C1S (1 << 16)
990# define SYS_CNTRL_BP (1 << 14)
991# define SYS_CNTRL_EN1 (1 << 13)
992# define SYS_CNTRL_BT1 (1 << 12)
993# define SYS_CNTRL_EN0 (1 << 11)
994# define SYS_CNTRL_BT0 (1 << 10)
995# define SYS_CNTRL_E0 (1 << 8)
996# define SYS_CNTRL_E0S (1 << 7)
997# define SYS_CNTRL_32S (1 << 5)
998# define SYS_CNTRL_T0S (1 << 4)
999# define SYS_CNTRL_M20 (1 << 3)
1000# define SYS_CNTRL_M10 (1 << 2)
1001# define SYS_CNTRL_M00 (1 << 1)
1002# define SYS_CNTRL_C0S (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001003
1004/* Programmable Counter 0 Registers */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001005#define SYS_TOYTRIM (SYS_BASE + 0)
1006#define SYS_TOYWRITE (SYS_BASE + 4)
1007#define SYS_TOYMATCH0 (SYS_BASE + 8)
1008#define SYS_TOYMATCH1 (SYS_BASE + 0xC)
1009#define SYS_TOYMATCH2 (SYS_BASE + 0x10)
1010#define SYS_TOYREAD (SYS_BASE + 0x40)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001011
1012/* Programmable Counter 1 Registers */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001013#define SYS_RTCTRIM (SYS_BASE + 0x44)
1014#define SYS_RTCWRITE (SYS_BASE + 0x48)
1015#define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
1016#define SYS_RTCMATCH1 (SYS_BASE + 0x50)
1017#define SYS_RTCMATCH2 (SYS_BASE + 0x54)
1018#define SYS_RTCREAD (SYS_BASE + 0x58)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001019
1020/* I2S Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001021#define I2S_DATA 0xB1000000
1022# define I2S_DATA_MASK 0xffffff
1023#define I2S_CONFIG 0xB1000004
1024# define I2S_CONFIG_XU (1 << 25)
1025# define I2S_CONFIG_XO (1 << 24)
1026# define I2S_CONFIG_RU (1 << 23)
1027# define I2S_CONFIG_RO (1 << 22)
1028# define I2S_CONFIG_TR (1 << 21)
1029# define I2S_CONFIG_TE (1 << 20)
1030# define I2S_CONFIG_TF (1 << 19)
1031# define I2S_CONFIG_RR (1 << 18)
1032# define I2S_CONFIG_RE (1 << 17)
1033# define I2S_CONFIG_RF (1 << 16)
1034# define I2S_CONFIG_PD (1 << 11)
1035# define I2S_CONFIG_LB (1 << 10)
1036# define I2S_CONFIG_IC (1 << 9)
1037# define I2S_CONFIG_FM_BIT 7
1038# define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
1039# define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
1040# define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
1041# define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
1042# define I2S_CONFIG_TN (1 << 6)
1043# define I2S_CONFIG_RN (1 << 5)
1044# define I2S_CONFIG_SZ_BIT 0
1045# define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001046
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001047#define I2S_CONTROL 0xB1000008
1048# define I2S_CONTROL_D (1 << 1)
1049# define I2S_CONTROL_CE (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001050
1051/* USB Host Controller */
Sergei Shtylyovc5c64e22005-11-25 22:08:08 +03001052#ifndef USB_OHCI_LEN
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001053#define USB_OHCI_LEN 0x00100000
Sergei Shtylyovc5c64e22005-11-25 22:08:08 +03001054#endif
1055
1056#ifndef CONFIG_SOC_AU1200
Linus Torvalds1da177e2005-04-16 15:20:36 -07001057
1058/* USB Device Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001059#define USBD_EP0RD 0xB0200000
1060#define USBD_EP0WR 0xB0200004
1061#define USBD_EP2WR 0xB0200008
1062#define USBD_EP3WR 0xB020000C
1063#define USBD_EP4RD 0xB0200010
1064#define USBD_EP5RD 0xB0200014
1065#define USBD_INTEN 0xB0200018
1066#define USBD_INTSTAT 0xB020001C
1067# define USBDEV_INT_SOF (1 << 12)
1068# define USBDEV_INT_HF_BIT 6
Mariusz Kozlowski25829b02008-05-23 13:04:28 -07001069# define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001070# define USBDEV_INT_CMPLT_BIT 0
Ralf Baechle49a89ef2007-10-11 23:46:15 +01001071# define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001072#define USBD_CONFIG 0xB0200020
1073#define USBD_EP0CS 0xB0200024
1074#define USBD_EP2CS 0xB0200028
1075#define USBD_EP3CS 0xB020002C
1076#define USBD_EP4CS 0xB0200030
1077#define USBD_EP5CS 0xB0200034
1078# define USBDEV_CS_SU (1 << 14)
1079# define USBDEV_CS_NAK (1 << 13)
1080# define USBDEV_CS_ACK (1 << 12)
1081# define USBDEV_CS_BUSY (1 << 11)
1082# define USBDEV_CS_TSIZE_BIT 1
1083# define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
1084# define USBDEV_CS_STALL (1 << 0)
1085#define USBD_EP0RDSTAT 0xB0200040
1086#define USBD_EP0WRSTAT 0xB0200044
1087#define USBD_EP2WRSTAT 0xB0200048
1088#define USBD_EP3WRSTAT 0xB020004C
1089#define USBD_EP4RDSTAT 0xB0200050
1090#define USBD_EP5RDSTAT 0xB0200054
1091# define USBDEV_FSTAT_FLUSH (1 << 6)
1092# define USBDEV_FSTAT_UF (1 << 5)
1093# define USBDEV_FSTAT_OF (1 << 4)
1094# define USBDEV_FSTAT_FCNT_BIT 0
Ralf Baechle49a89ef2007-10-11 23:46:15 +01001095# define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001096#define USBD_ENABLE 0xB0200058
1097# define USBDEV_ENABLE (1 << 1)
1098# define USBDEV_CE (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001099
Pete Popove3ad1c22005-03-01 06:33:16 +00001100#endif /* !CONFIG_SOC_AU1200 */
1101
Linus Torvalds1da177e2005-04-16 15:20:36 -07001102/* Ethernet Controllers */
1103
1104/* 4 byte offsets from AU1000_ETH_BASE */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001105#define MAC_CONTROL 0x0
1106# define MAC_RX_ENABLE (1 << 2)
1107# define MAC_TX_ENABLE (1 << 3)
1108# define MAC_DEF_CHECK (1 << 5)
1109# define MAC_SET_BL(X) (((X) & 0x3) << 6)
1110# define MAC_AUTO_PAD (1 << 8)
1111# define MAC_DISABLE_RETRY (1 << 10)
1112# define MAC_DISABLE_BCAST (1 << 11)
1113# define MAC_LATE_COL (1 << 12)
1114# define MAC_HASH_MODE (1 << 13)
1115# define MAC_HASH_ONLY (1 << 15)
1116# define MAC_PASS_ALL (1 << 16)
1117# define MAC_INVERSE_FILTER (1 << 17)
1118# define MAC_PROMISCUOUS (1 << 18)
1119# define MAC_PASS_ALL_MULTI (1 << 19)
1120# define MAC_FULL_DUPLEX (1 << 20)
1121# define MAC_NORMAL_MODE 0
1122# define MAC_INT_LOOPBACK (1 << 21)
1123# define MAC_EXT_LOOPBACK (1 << 22)
1124# define MAC_DISABLE_RX_OWN (1 << 23)
1125# define MAC_BIG_ENDIAN (1 << 30)
1126# define MAC_RX_ALL (1 << 31)
1127#define MAC_ADDRESS_HIGH 0x4
1128#define MAC_ADDRESS_LOW 0x8
1129#define MAC_MCAST_HIGH 0xC
1130#define MAC_MCAST_LOW 0x10
1131#define MAC_MII_CNTRL 0x14
1132# define MAC_MII_BUSY (1 << 0)
1133# define MAC_MII_READ 0
1134# define MAC_MII_WRITE (1 << 1)
1135# define MAC_SET_MII_SELECT_REG(X) (((X) & 0x1f) << 6)
1136# define MAC_SET_MII_SELECT_PHY(X) (((X) & 0x1f) << 11)
1137#define MAC_MII_DATA 0x18
1138#define MAC_FLOW_CNTRL 0x1C
1139# define MAC_FLOW_CNTRL_BUSY (1 << 0)
1140# define MAC_FLOW_CNTRL_ENABLE (1 << 1)
1141# define MAC_PASS_CONTROL (1 << 2)
1142# define MAC_SET_PAUSE(X) (((X) & 0xffff) << 16)
1143#define MAC_VLAN1_TAG 0x20
1144#define MAC_VLAN2_TAG 0x24
Linus Torvalds1da177e2005-04-16 15:20:36 -07001145
1146/* Ethernet Controller Enable */
1147
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001148# define MAC_EN_CLOCK_ENABLE (1 << 0)
1149# define MAC_EN_RESET0 (1 << 1)
1150# define MAC_EN_TOSS (0 << 2)
1151# define MAC_EN_CACHEABLE (1 << 3)
1152# define MAC_EN_RESET1 (1 << 4)
1153# define MAC_EN_RESET2 (1 << 5)
1154# define MAC_DMA_RESET (1 << 6)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001155
1156/* Ethernet Controller DMA Channels */
1157
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001158#define MAC0_TX_DMA_ADDR 0xB4004000
1159#define MAC1_TX_DMA_ADDR 0xB4004200
Linus Torvalds1da177e2005-04-16 15:20:36 -07001160/* offsets from MAC_TX_RING_ADDR address */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001161#define MAC_TX_BUFF0_STATUS 0x0
1162# define TX_FRAME_ABORTED (1 << 0)
1163# define TX_JAB_TIMEOUT (1 << 1)
1164# define TX_NO_CARRIER (1 << 2)
1165# define TX_LOSS_CARRIER (1 << 3)
1166# define TX_EXC_DEF (1 << 4)
1167# define TX_LATE_COLL_ABORT (1 << 5)
1168# define TX_EXC_COLL (1 << 6)
1169# define TX_UNDERRUN (1 << 7)
1170# define TX_DEFERRED (1 << 8)
1171# define TX_LATE_COLL (1 << 9)
1172# define TX_COLL_CNT_MASK (0xF << 10)
1173# define TX_PKT_RETRY (1 << 31)
1174#define MAC_TX_BUFF0_ADDR 0x4
1175# define TX_DMA_ENABLE (1 << 0)
1176# define TX_T_DONE (1 << 1)
1177# define TX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3)
1178#define MAC_TX_BUFF0_LEN 0x8
1179#define MAC_TX_BUFF1_STATUS 0x10
1180#define MAC_TX_BUFF1_ADDR 0x14
1181#define MAC_TX_BUFF1_LEN 0x18
1182#define MAC_TX_BUFF2_STATUS 0x20
1183#define MAC_TX_BUFF2_ADDR 0x24
1184#define MAC_TX_BUFF2_LEN 0x28
1185#define MAC_TX_BUFF3_STATUS 0x30
1186#define MAC_TX_BUFF3_ADDR 0x34
1187#define MAC_TX_BUFF3_LEN 0x38
Linus Torvalds1da177e2005-04-16 15:20:36 -07001188
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001189#define MAC0_RX_DMA_ADDR 0xB4004100
1190#define MAC1_RX_DMA_ADDR 0xB4004300
Linus Torvalds1da177e2005-04-16 15:20:36 -07001191/* offsets from MAC_RX_RING_ADDR */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001192#define MAC_RX_BUFF0_STATUS 0x0
1193# define RX_FRAME_LEN_MASK 0x3fff
1194# define RX_WDOG_TIMER (1 << 14)
1195# define RX_RUNT (1 << 15)
1196# define RX_OVERLEN (1 << 16)
1197# define RX_COLL (1 << 17)
1198# define RX_ETHER (1 << 18)
1199# define RX_MII_ERROR (1 << 19)
1200# define RX_DRIBBLING (1 << 20)
1201# define RX_CRC_ERROR (1 << 21)
1202# define RX_VLAN1 (1 << 22)
1203# define RX_VLAN2 (1 << 23)
1204# define RX_LEN_ERROR (1 << 24)
1205# define RX_CNTRL_FRAME (1 << 25)
1206# define RX_U_CNTRL_FRAME (1 << 26)
1207# define RX_MCAST_FRAME (1 << 27)
1208# define RX_BCAST_FRAME (1 << 28)
1209# define RX_FILTER_FAIL (1 << 29)
1210# define RX_PACKET_FILTER (1 << 30)
1211# define RX_MISSED_FRAME (1 << 31)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001212
Ralf Baechle49a89ef2007-10-11 23:46:15 +01001213# define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001214 RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
1215 RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
1216#define MAC_RX_BUFF0_ADDR 0x4
1217# define RX_DMA_ENABLE (1 << 0)
1218# define RX_T_DONE (1 << 1)
1219# define RX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3)
1220# define RX_SET_BUFF_ADDR(X) ((X) & 0xffffffc0)
1221#define MAC_RX_BUFF1_STATUS 0x10
1222#define MAC_RX_BUFF1_ADDR 0x14
1223#define MAC_RX_BUFF2_STATUS 0x20
1224#define MAC_RX_BUFF2_ADDR 0x24
1225#define MAC_RX_BUFF3_STATUS 0x30
1226#define MAC_RX_BUFF3_ADDR 0x34
Linus Torvalds1da177e2005-04-16 15:20:36 -07001227
1228/* UARTS 0-3 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001229#define UART_BASE UART0_ADDR
Sergei Shtylylov492fd5f2006-01-26 04:36:25 +03001230#ifdef CONFIG_SOC_AU1200
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001231#define UART_DEBUG_BASE UART1_ADDR
Sergei Shtylylov492fd5f2006-01-26 04:36:25 +03001232#else
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001233#define UART_DEBUG_BASE UART3_ADDR
Sergei Shtylylov492fd5f2006-01-26 04:36:25 +03001234#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001235
1236#define UART_RX 0 /* Receive buffer */
1237#define UART_TX 4 /* Transmit buffer */
1238#define UART_IER 8 /* Interrupt Enable Register */
1239#define UART_IIR 0xC /* Interrupt ID Register */
1240#define UART_FCR 0x10 /* FIFO Control Register */
1241#define UART_LCR 0x14 /* Line Control Register */
1242#define UART_MCR 0x18 /* Modem Control Register */
1243#define UART_LSR 0x1C /* Line Status Register */
1244#define UART_MSR 0x20 /* Modem Status Register */
1245#define UART_CLK 0x28 /* Baud Rate Clock Divider */
1246#define UART_MOD_CNTRL 0x100 /* Module Control */
1247
1248#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
1249#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
1250#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
1251#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
1252#define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
1253#define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
1254#define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
1255#define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
1256#define UART_FCR_R_TRIGGER_14 0xA0 /* Mask for receive trigger set at 14 */
1257#define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
1258#define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
1259#define UART_FCR_T_TRIGGER_8 0x20 /* Mask for transmit trigger set at 8 */
1260#define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
1261
1262/*
1263 * These are the definitions for the Line Control Register
1264 */
1265#define UART_LCR_SBC 0x40 /* Set break control */
1266#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
1267#define UART_LCR_EPAR 0x10 /* Even parity select */
1268#define UART_LCR_PARITY 0x08 /* Parity Enable */
1269#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
1270#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
1271#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
1272#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
1273#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
1274
1275/*
1276 * These are the definitions for the Line Status Register
1277 */
1278#define UART_LSR_TEMT 0x40 /* Transmitter empty */
1279#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
1280#define UART_LSR_BI 0x10 /* Break interrupt indicator */
1281#define UART_LSR_FE 0x08 /* Frame error indicator */
1282#define UART_LSR_PE 0x04 /* Parity error indicator */
1283#define UART_LSR_OE 0x02 /* Overrun error indicator */
1284#define UART_LSR_DR 0x01 /* Receiver data ready */
1285
1286/*
1287 * These are the definitions for the Interrupt Identification Register
1288 */
1289#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
1290#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
1291#define UART_IIR_MSI 0x00 /* Modem status interrupt */
1292#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
1293#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
1294#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
1295
1296/*
1297 * These are the definitions for the Interrupt Enable Register
1298 */
1299#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
1300#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
1301#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
1302#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
1303
1304/*
1305 * These are the definitions for the Modem Control Register
1306 */
1307#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
1308#define UART_MCR_OUT2 0x08 /* Out2 complement */
1309#define UART_MCR_OUT1 0x04 /* Out1 complement */
1310#define UART_MCR_RTS 0x02 /* RTS complement */
1311#define UART_MCR_DTR 0x01 /* DTR complement */
1312
1313/*
1314 * These are the definitions for the Modem Status Register
1315 */
1316#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
1317#define UART_MSR_RI 0x40 /* Ring Indicator */
1318#define UART_MSR_DSR 0x20 /* Data Set Ready */
1319#define UART_MSR_CTS 0x10 /* Clear to Send */
1320#define UART_MSR_DDCD 0x08 /* Delta DCD */
1321#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
1322#define UART_MSR_DDSR 0x02 /* Delta DSR */
1323#define UART_MSR_DCTS 0x01 /* Delta CTS */
1324#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
1325
Linus Torvalds1da177e2005-04-16 15:20:36 -07001326/* SSIO */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001327#define SSI0_STATUS 0xB1600000
1328# define SSI_STATUS_BF (1 << 4)
1329# define SSI_STATUS_OF (1 << 3)
1330# define SSI_STATUS_UF (1 << 2)
1331# define SSI_STATUS_D (1 << 1)
1332# define SSI_STATUS_B (1 << 0)
1333#define SSI0_INT 0xB1600004
1334# define SSI_INT_OI (1 << 3)
1335# define SSI_INT_UI (1 << 2)
1336# define SSI_INT_DI (1 << 1)
1337#define SSI0_INT_ENABLE 0xB1600008
1338# define SSI_INTE_OIE (1 << 3)
1339# define SSI_INTE_UIE (1 << 2)
1340# define SSI_INTE_DIE (1 << 1)
1341#define SSI0_CONFIG 0xB1600020
1342# define SSI_CONFIG_AO (1 << 24)
1343# define SSI_CONFIG_DO (1 << 23)
1344# define SSI_CONFIG_ALEN_BIT 20
1345# define SSI_CONFIG_ALEN_MASK (0x7 << 20)
1346# define SSI_CONFIG_DLEN_BIT 16
1347# define SSI_CONFIG_DLEN_MASK (0x7 << 16)
1348# define SSI_CONFIG_DD (1 << 11)
1349# define SSI_CONFIG_AD (1 << 10)
1350# define SSI_CONFIG_BM_BIT 8
1351# define SSI_CONFIG_BM_MASK (0x3 << 8)
1352# define SSI_CONFIG_CE (1 << 7)
1353# define SSI_CONFIG_DP (1 << 6)
1354# define SSI_CONFIG_DL (1 << 5)
1355# define SSI_CONFIG_EP (1 << 4)
1356#define SSI0_ADATA 0xB1600024
1357# define SSI_AD_D (1 << 24)
1358# define SSI_AD_ADDR_BIT 16
1359# define SSI_AD_ADDR_MASK (0xff << 16)
1360# define SSI_AD_DATA_BIT 0
1361# define SSI_AD_DATA_MASK (0xfff << 0)
1362#define SSI0_CLKDIV 0xB1600028
1363#define SSI0_CONTROL 0xB1600100
1364# define SSI_CONTROL_CD (1 << 1)
1365# define SSI_CONTROL_E (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001366
1367/* SSI1 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001368#define SSI1_STATUS 0xB1680000
1369#define SSI1_INT 0xB1680004
1370#define SSI1_INT_ENABLE 0xB1680008
1371#define SSI1_CONFIG 0xB1680020
1372#define SSI1_ADATA 0xB1680024
1373#define SSI1_CLKDIV 0xB1680028
1374#define SSI1_ENABLE 0xB1680100
Linus Torvalds1da177e2005-04-16 15:20:36 -07001375
1376/*
1377 * Register content definitions
1378 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001379#define SSI_STATUS_BF (1 << 4)
1380#define SSI_STATUS_OF (1 << 3)
1381#define SSI_STATUS_UF (1 << 2)
1382#define SSI_STATUS_D (1 << 1)
1383#define SSI_STATUS_B (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001384
1385/* SSI_INT */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001386#define SSI_INT_OI (1 << 3)
1387#define SSI_INT_UI (1 << 2)
1388#define SSI_INT_DI (1 << 1)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001389
1390/* SSI_INTEN */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001391#define SSI_INTEN_OIE (1 << 3)
1392#define SSI_INTEN_UIE (1 << 2)
1393#define SSI_INTEN_DIE (1 << 1)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001394
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001395#define SSI_CONFIG_AO (1 << 24)
1396#define SSI_CONFIG_DO (1 << 23)
1397#define SSI_CONFIG_ALEN (7 << 20)
1398#define SSI_CONFIG_DLEN (15 << 16)
1399#define SSI_CONFIG_DD (1 << 11)
1400#define SSI_CONFIG_AD (1 << 10)
1401#define SSI_CONFIG_BM (3 << 8)
1402#define SSI_CONFIG_CE (1 << 7)
1403#define SSI_CONFIG_DP (1 << 6)
1404#define SSI_CONFIG_DL (1 << 5)
1405#define SSI_CONFIG_EP (1 << 4)
1406#define SSI_CONFIG_ALEN_N(N) ((N-1) << 20)
1407#define SSI_CONFIG_DLEN_N(N) ((N-1) << 16)
1408#define SSI_CONFIG_BM_HI (0 << 8)
1409#define SSI_CONFIG_BM_LO (1 << 8)
1410#define SSI_CONFIG_BM_CY (2 << 8)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001411
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001412#define SSI_ADATA_D (1 << 24)
1413#define SSI_ADATA_ADDR (0xFF << 16)
1414#define SSI_ADATA_DATA 0x0FFF
1415#define SSI_ADATA_ADDR_N(N) (N << 16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001416
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001417#define SSI_ENABLE_CD (1 << 1)
1418#define SSI_ENABLE_E (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001419
1420/* IrDA Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001421#define IRDA_BASE 0xB0300000
1422#define IR_RING_PTR_STATUS (IRDA_BASE + 0x00)
1423#define IR_RING_BASE_ADDR_H (IRDA_BASE + 0x04)
1424#define IR_RING_BASE_ADDR_L (IRDA_BASE + 0x08)
1425#define IR_RING_SIZE (IRDA_BASE + 0x0C)
1426#define IR_RING_PROMPT (IRDA_BASE + 0x10)
1427#define IR_RING_ADDR_CMPR (IRDA_BASE + 0x14)
1428#define IR_INT_CLEAR (IRDA_BASE + 0x18)
1429#define IR_CONFIG_1 (IRDA_BASE + 0x20)
1430# define IR_RX_INVERT_LED (1 << 0)
1431# define IR_TX_INVERT_LED (1 << 1)
1432# define IR_ST (1 << 2)
1433# define IR_SF (1 << 3)
1434# define IR_SIR (1 << 4)
1435# define IR_MIR (1 << 5)
1436# define IR_FIR (1 << 6)
1437# define IR_16CRC (1 << 7)
1438# define IR_TD (1 << 8)
1439# define IR_RX_ALL (1 << 9)
1440# define IR_DMA_ENABLE (1 << 10)
1441# define IR_RX_ENABLE (1 << 11)
1442# define IR_TX_ENABLE (1 << 12)
1443# define IR_LOOPBACK (1 << 14)
1444# define IR_SIR_MODE (IR_SIR | IR_DMA_ENABLE | \
1445 IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
1446#define IR_SIR_FLAGS (IRDA_BASE + 0x24)
1447#define IR_ENABLE (IRDA_BASE + 0x28)
1448# define IR_RX_STATUS (1 << 9)
1449# define IR_TX_STATUS (1 << 10)
1450#define IR_READ_PHY_CONFIG (IRDA_BASE + 0x2C)
1451#define IR_WRITE_PHY_CONFIG (IRDA_BASE + 0x30)
1452#define IR_MAX_PKT_LEN (IRDA_BASE + 0x34)
1453#define IR_RX_BYTE_CNT (IRDA_BASE + 0x38)
1454#define IR_CONFIG_2 (IRDA_BASE + 0x3C)
1455# define IR_MODE_INV (1 << 0)
1456# define IR_ONE_PIN (1 << 1)
1457#define IR_INTERFACE_CONFIG (IRDA_BASE + 0x40)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001458
1459/* GPIO */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001460#define SYS_PINFUNC 0xB190002C
1461# define SYS_PF_USB (1 << 15) /* 2nd USB device/host */
1462# define SYS_PF_U3 (1 << 14) /* GPIO23/U3TXD */
1463# define SYS_PF_U2 (1 << 13) /* GPIO22/U2TXD */
1464# define SYS_PF_U1 (1 << 12) /* GPIO21/U1TXD */
1465# define SYS_PF_SRC (1 << 11) /* GPIO6/SROMCKE */
1466# define SYS_PF_CK5 (1 << 10) /* GPIO3/CLK5 */
1467# define SYS_PF_CK4 (1 << 9) /* GPIO2/CLK4 */
1468# define SYS_PF_IRF (1 << 8) /* GPIO15/IRFIRSEL */
1469# define SYS_PF_UR3 (1 << 7) /* GPIO[14:9]/UART3 */
1470# define SYS_PF_I2D (1 << 6) /* GPIO8/I2SDI */
1471# define SYS_PF_I2S (1 << 5) /* I2S/GPIO[29:31] */
1472# define SYS_PF_NI2 (1 << 4) /* NI2/GPIO[24:28] */
1473# define SYS_PF_U0 (1 << 3) /* U0TXD/GPIO20 */
1474# define SYS_PF_RD (1 << 2) /* IRTXD/GPIO19 */
1475# define SYS_PF_A97 (1 << 1) /* AC97/SSL1 */
1476# define SYS_PF_S0 (1 << 0) /* SSI_0/GPIO[16:18] */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001477
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001478/* Au1100 only */
1479# define SYS_PF_PC (1 << 18) /* PCMCIA/GPIO[207:204] */
1480# define SYS_PF_LCD (1 << 17) /* extern lcd/GPIO[203:200] */
1481# define SYS_PF_CS (1 << 16) /* EXTCLK0/32KHz to gpio2 */
1482# define SYS_PF_EX0 (1 << 9) /* GPIO2/clock */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001483
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001484/* Au1550 only. Redefines lots of pins */
1485# define SYS_PF_PSC2_MASK (7 << 17)
1486# define SYS_PF_PSC2_AC97 0
1487# define SYS_PF_PSC2_SPI 0
1488# define SYS_PF_PSC2_I2S (1 << 17)
1489# define SYS_PF_PSC2_SMBUS (3 << 17)
1490# define SYS_PF_PSC2_GPIO (7 << 17)
1491# define SYS_PF_PSC3_MASK (7 << 20)
1492# define SYS_PF_PSC3_AC97 0
1493# define SYS_PF_PSC3_SPI 0
1494# define SYS_PF_PSC3_I2S (1 << 20)
1495# define SYS_PF_PSC3_SMBUS (3 << 20)
1496# define SYS_PF_PSC3_GPIO (7 << 20)
1497# define SYS_PF_PSC1_S1 (1 << 1)
1498# define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001499
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001500/* Au1200 only */
Pete Popove3ad1c22005-03-01 06:33:16 +00001501#ifdef CONFIG_SOC_AU1200
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001502#define SYS_PINFUNC_DMA (1 << 31)
1503#define SYS_PINFUNC_S0A (1 << 30)
1504#define SYS_PINFUNC_S1A (1 << 29)
1505#define SYS_PINFUNC_LP0 (1 << 28)
1506#define SYS_PINFUNC_LP1 (1 << 27)
1507#define SYS_PINFUNC_LD16 (1 << 26)
1508#define SYS_PINFUNC_LD8 (1 << 25)
1509#define SYS_PINFUNC_LD1 (1 << 24)
1510#define SYS_PINFUNC_LD0 (1 << 23)
1511#define SYS_PINFUNC_P1A (3 << 21)
1512#define SYS_PINFUNC_P1B (1 << 20)
1513#define SYS_PINFUNC_FS3 (1 << 19)
1514#define SYS_PINFUNC_P0A (3 << 17)
1515#define SYS_PINFUNC_CS (1 << 16)
1516#define SYS_PINFUNC_CIM (1 << 15)
1517#define SYS_PINFUNC_P1C (1 << 14)
1518#define SYS_PINFUNC_U1T (1 << 12)
1519#define SYS_PINFUNC_U1R (1 << 11)
1520#define SYS_PINFUNC_EX1 (1 << 10)
1521#define SYS_PINFUNC_EX0 (1 << 9)
1522#define SYS_PINFUNC_U0R (1 << 8)
1523#define SYS_PINFUNC_MC (1 << 7)
1524#define SYS_PINFUNC_S0B (1 << 6)
1525#define SYS_PINFUNC_S0C (1 << 5)
1526#define SYS_PINFUNC_P0B (1 << 4)
1527#define SYS_PINFUNC_U0T (1 << 3)
1528#define SYS_PINFUNC_S1B (1 << 2)
Pete Popove3ad1c22005-03-01 06:33:16 +00001529#endif
1530
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001531#define SYS_TRIOUTRD 0xB1900100
1532#define SYS_TRIOUTCLR 0xB1900100
1533#define SYS_OUTPUTRD 0xB1900108
1534#define SYS_OUTPUTSET 0xB1900108
1535#define SYS_OUTPUTCLR 0xB190010C
1536#define SYS_PINSTATERD 0xB1900110
1537#define SYS_PININPUTEN 0xB1900110
Linus Torvalds1da177e2005-04-16 15:20:36 -07001538
1539/* GPIO2, Au1500, Au1550 only */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001540#define GPIO2_BASE 0xB1700000
1541#define GPIO2_DIR (GPIO2_BASE + 0)
1542#define GPIO2_OUTPUT (GPIO2_BASE + 8)
1543#define GPIO2_PINSTATE (GPIO2_BASE + 0xC)
1544#define GPIO2_INTENABLE (GPIO2_BASE + 0x10)
1545#define GPIO2_ENABLE (GPIO2_BASE + 0x14)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001546
1547/* Power Management */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001548#define SYS_SCRATCH0 0xB1900018
1549#define SYS_SCRATCH1 0xB190001C
1550#define SYS_WAKEMSK 0xB1900034
1551#define SYS_ENDIAN 0xB1900038
1552#define SYS_POWERCTRL 0xB190003C
1553#define SYS_WAKESRC 0xB190005C
1554#define SYS_SLPPWR 0xB1900078
1555#define SYS_SLEEP 0xB190007C
Linus Torvalds1da177e2005-04-16 15:20:36 -07001556
1557/* Clock Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001558#define SYS_FREQCTRL0 0xB1900020
1559# define SYS_FC_FRDIV2_BIT 22
1560# define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
1561# define SYS_FC_FE2 (1 << 21)
1562# define SYS_FC_FS2 (1 << 20)
1563# define SYS_FC_FRDIV1_BIT 12
1564# define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
1565# define SYS_FC_FE1 (1 << 11)
1566# define SYS_FC_FS1 (1 << 10)
1567# define SYS_FC_FRDIV0_BIT 2
1568# define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
1569# define SYS_FC_FE0 (1 << 1)
1570# define SYS_FC_FS0 (1 << 0)
1571#define SYS_FREQCTRL1 0xB1900024
1572# define SYS_FC_FRDIV5_BIT 22
1573# define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
1574# define SYS_FC_FE5 (1 << 21)
1575# define SYS_FC_FS5 (1 << 20)
1576# define SYS_FC_FRDIV4_BIT 12
1577# define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
1578# define SYS_FC_FE4 (1 << 11)
1579# define SYS_FC_FS4 (1 << 10)
1580# define SYS_FC_FRDIV3_BIT 2
1581# define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
1582# define SYS_FC_FE3 (1 << 1)
1583# define SYS_FC_FS3 (1 << 0)
1584#define SYS_CLKSRC 0xB1900028
1585# define SYS_CS_ME1_BIT 27
1586# define SYS_CS_ME1_MASK (0x7 << SYS_CS_ME1_BIT)
1587# define SYS_CS_DE1 (1 << 26)
1588# define SYS_CS_CE1 (1 << 25)
1589# define SYS_CS_ME0_BIT 22
1590# define SYS_CS_ME0_MASK (0x7 << SYS_CS_ME0_BIT)
1591# define SYS_CS_DE0 (1 << 21)
1592# define SYS_CS_CE0 (1 << 20)
1593# define SYS_CS_MI2_BIT 17
1594# define SYS_CS_MI2_MASK (0x7 << SYS_CS_MI2_BIT)
1595# define SYS_CS_DI2 (1 << 16)
1596# define SYS_CS_CI2 (1 << 15)
Pete Popov3b495f22005-04-04 01:06:19 +00001597#ifdef CONFIG_SOC_AU1100
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001598# define SYS_CS_ML_BIT 7
1599# define SYS_CS_ML_MASK (0x7 << SYS_CS_ML_BIT)
1600# define SYS_CS_DL (1 << 6)
1601# define SYS_CS_CL (1 << 5)
Pete Popov3b495f22005-04-04 01:06:19 +00001602#else
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001603# define SYS_CS_MUH_BIT 12
1604# define SYS_CS_MUH_MASK (0x7 << SYS_CS_MUH_BIT)
1605# define SYS_CS_DUH (1 << 11)
1606# define SYS_CS_CUH (1 << 10)
1607# define SYS_CS_MUD_BIT 7
1608# define SYS_CS_MUD_MASK (0x7 << SYS_CS_MUD_BIT)
1609# define SYS_CS_DUD (1 << 6)
1610# define SYS_CS_CUD (1 << 5)
Pete Popov3b495f22005-04-04 01:06:19 +00001611#endif
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001612# define SYS_CS_MIR_BIT 2
1613# define SYS_CS_MIR_MASK (0x7 << SYS_CS_MIR_BIT)
1614# define SYS_CS_DIR (1 << 1)
1615# define SYS_CS_CIR (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001616
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001617# define SYS_CS_MUX_AUX 0x1
1618# define SYS_CS_MUX_FQ0 0x2
1619# define SYS_CS_MUX_FQ1 0x3
1620# define SYS_CS_MUX_FQ2 0x4
1621# define SYS_CS_MUX_FQ3 0x5
1622# define SYS_CS_MUX_FQ4 0x6
1623# define SYS_CS_MUX_FQ5 0x7
1624#define SYS_CPUPLL 0xB1900060
1625#define SYS_AUXPLL 0xB1900064
Linus Torvalds1da177e2005-04-16 15:20:36 -07001626
1627/* AC97 Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001628#define AC97C_CONFIG 0xB0000000
1629# define AC97C_RECV_SLOTS_BIT 13
Ralf Baechle49a89ef2007-10-11 23:46:15 +01001630# define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001631# define AC97C_XMIT_SLOTS_BIT 3
Ralf Baechle49a89ef2007-10-11 23:46:15 +01001632# define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001633# define AC97C_SG (1 << 2)
1634# define AC97C_SYNC (1 << 1)
1635# define AC97C_RESET (1 << 0)
1636#define AC97C_STATUS 0xB0000004
1637# define AC97C_XU (1 << 11)
1638# define AC97C_XO (1 << 10)
1639# define AC97C_RU (1 << 9)
1640# define AC97C_RO (1 << 8)
1641# define AC97C_READY (1 << 7)
1642# define AC97C_CP (1 << 6)
1643# define AC97C_TR (1 << 5)
1644# define AC97C_TE (1 << 4)
1645# define AC97C_TF (1 << 3)
1646# define AC97C_RR (1 << 2)
1647# define AC97C_RE (1 << 1)
1648# define AC97C_RF (1 << 0)
1649#define AC97C_DATA 0xB0000008
1650#define AC97C_CMD 0xB000000C
1651# define AC97C_WD_BIT 16
1652# define AC97C_READ (1 << 7)
1653# define AC97C_INDEX_MASK 0x7f
1654#define AC97C_CNTRL 0xB0000010
1655# define AC97C_RS (1 << 1)
1656# define AC97C_CE (1 << 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001657
1658/* Secure Digital (SD) Controller */
1659#define SD0_XMIT_FIFO 0xB0600000
1660#define SD0_RECV_FIFO 0xB0600004
1661#define SD1_XMIT_FIFO 0xB0680000
1662#define SD1_RECV_FIFO 0xB0680004
1663
Ralf Baechle49a89ef2007-10-11 23:46:15 +01001664#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001665/* Au1500 PCI Controller */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001666#define Au1500_CFG_BASE 0xB4005000 /* virtual, KSEG1 addr */
1667#define Au1500_PCI_CMEM (Au1500_CFG_BASE + 0)
1668#define Au1500_PCI_CFG (Au1500_CFG_BASE + 4)
1669# define PCI_ERROR ((1 << 22) | (1 << 23) | (1 << 24) | \
1670 (1 << 25) | (1 << 26) | (1 << 27))
1671#define Au1500_PCI_B2BMASK_CCH (Au1500_CFG_BASE + 8)
1672#define Au1500_PCI_B2B0_VID (Au1500_CFG_BASE + 0xC)
1673#define Au1500_PCI_B2B1_ID (Au1500_CFG_BASE + 0x10)
1674#define Au1500_PCI_MWMASK_DEV (Au1500_CFG_BASE + 0x14)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001675#define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001676#define Au1500_PCI_ERR_ADDR (Au1500_CFG_BASE + 0x1C)
1677#define Au1500_PCI_SPEC_INTACK (Au1500_CFG_BASE + 0x20)
1678#define Au1500_PCI_ID (Au1500_CFG_BASE + 0x100)
1679#define Au1500_PCI_STATCMD (Au1500_CFG_BASE + 0x104)
1680#define Au1500_PCI_CLASSREV (Au1500_CFG_BASE + 0x108)
1681#define Au1500_PCI_HDRTYPE (Au1500_CFG_BASE + 0x10C)
1682#define Au1500_PCI_MBAR (Au1500_CFG_BASE + 0x110)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001683
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001684#define Au1500_PCI_HDR 0xB4005100 /* virtual, KSEG1 addr */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001685
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001686/*
1687 * All of our structures, like PCI resource, have 32-bit members.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001688 * Drivers are expected to do an ioremap on the PCI MEM resource, but it's
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001689 * hard to store 0x4 0000 0000 in a 32-bit type. We require a small patch
Linus Torvalds1da177e2005-04-16 15:20:36 -07001690 * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001691 * (u32)Au1500_PCI_MEM_END and change those to the full 36-bit PCI MEM
1692 * addresses. For PCI I/O, it's simpler because we get to do the ioremap
Linus Torvalds1da177e2005-04-16 15:20:36 -07001693 * ourselves and then adjust the device's resources.
1694 */
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001695#define Au1500_EXT_CFG 0x600000000ULL
1696#define Au1500_EXT_CFG_TYPE1 0x680000000ULL
1697#define Au1500_PCI_IO_START 0x500000000ULL
1698#define Au1500_PCI_IO_END 0x5000FFFFFULL
1699#define Au1500_PCI_MEM_START 0x440000000ULL
1700#define Au1500_PCI_MEM_END 0x44FFFFFFFULL
Linus Torvalds1da177e2005-04-16 15:20:36 -07001701
Sergei Shtylyovdd99d962007-12-10 20:28:51 +03001702#define PCI_IO_START 0x00001000
1703#define PCI_IO_END 0x000FFFFF
1704#define PCI_MEM_START 0x40000000
1705#define PCI_MEM_END 0x4FFFFFFF
1706
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001707#define PCI_FIRST_DEVFN (0 << 3)
1708#define PCI_LAST_DEVFN (19 << 3)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001709
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001710#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
1711#define IOPORT_RESOURCE_END 0xffffffff
1712#define IOMEM_RESOURCE_START 0x10000000
1713#define IOMEM_RESOURCE_END 0xffffffff
Linus Torvalds1da177e2005-04-16 15:20:36 -07001714
Pete Popove3ad1c22005-03-01 06:33:16 +00001715#else /* Au1000 and Au1100 and Au1200 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001716
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001717/* Don't allow any legacy ports probing */
1718#define IOPORT_RESOURCE_START 0x10000000
1719#define IOPORT_RESOURCE_END 0xffffffff
1720#define IOMEM_RESOURCE_START 0x10000000
1721#define IOMEM_RESOURCE_END 0xffffffff
Linus Torvalds1da177e2005-04-16 15:20:36 -07001722
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001723#define PCI_IO_START 0
1724#define PCI_IO_END 0
1725#define PCI_MEM_START 0
1726#define PCI_MEM_END 0
Linus Torvalds1da177e2005-04-16 15:20:36 -07001727#define PCI_FIRST_DEVFN 0
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001728#define PCI_LAST_DEVFN 0
Linus Torvalds1da177e2005-04-16 15:20:36 -07001729
1730#endif
1731
Pete Popove3ad1c22005-03-01 06:33:16 +00001732#ifndef _LANGUAGE_ASSEMBLY
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001733typedef volatile struct {
Pete Popove3ad1c22005-03-01 06:33:16 +00001734 /* 0x0000 */ u32 toytrim;
1735 /* 0x0004 */ u32 toywrite;
1736 /* 0x0008 */ u32 toymatch0;
1737 /* 0x000C */ u32 toymatch1;
1738 /* 0x0010 */ u32 toymatch2;
1739 /* 0x0014 */ u32 cntrctrl;
1740 /* 0x0018 */ u32 scratch0;
1741 /* 0x001C */ u32 scratch1;
1742 /* 0x0020 */ u32 freqctrl0;
1743 /* 0x0024 */ u32 freqctrl1;
1744 /* 0x0028 */ u32 clksrc;
1745 /* 0x002C */ u32 pinfunc;
1746 /* 0x0030 */ u32 reserved0;
1747 /* 0x0034 */ u32 wakemsk;
1748 /* 0x0038 */ u32 endian;
1749 /* 0x003C */ u32 powerctrl;
1750 /* 0x0040 */ u32 toyread;
1751 /* 0x0044 */ u32 rtctrim;
1752 /* 0x0048 */ u32 rtcwrite;
1753 /* 0x004C */ u32 rtcmatch0;
1754 /* 0x0050 */ u32 rtcmatch1;
1755 /* 0x0054 */ u32 rtcmatch2;
1756 /* 0x0058 */ u32 rtcread;
1757 /* 0x005C */ u32 wakesrc;
1758 /* 0x0060 */ u32 cpupll;
1759 /* 0x0064 */ u32 auxpll;
1760 /* 0x0068 */ u32 reserved1;
1761 /* 0x006C */ u32 reserved2;
1762 /* 0x0070 */ u32 reserved3;
1763 /* 0x0074 */ u32 reserved4;
1764 /* 0x0078 */ u32 slppwr;
1765 /* 0x007C */ u32 sleep;
1766 /* 0x0080 */ u32 reserved5[32];
1767 /* 0x0100 */ u32 trioutrd;
1768#define trioutclr trioutrd
1769 /* 0x0104 */ u32 reserved6;
1770 /* 0x0108 */ u32 outputrd;
1771#define outputset outputrd
1772 /* 0x010C */ u32 outputclr;
1773 /* 0x0110 */ u32 pinstaterd;
1774#define pininputen pinstaterd
Pete Popove3ad1c22005-03-01 06:33:16 +00001775} AU1X00_SYS;
1776
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001777static AU1X00_SYS * const sys = (AU1X00_SYS *)SYS_BASE;
Pete Popove3ad1c22005-03-01 06:33:16 +00001778
1779#endif
Sergei Shtylyovff6814d2008-04-30 23:18:35 +04001780
Pete Popove3ad1c22005-03-01 06:33:16 +00001781#endif