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