ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-arm / arch-sa1100 / system3.h
1 /*
2  * linux/include/asm-arm/arch-sa1100/system3.h
3  *
4  * Copyright (C) 2001 Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
5  *
6  * $Id: system3.h,v 1.2.4.2 2001/12/04 14:58:50 seletz Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * $Log: system3.h,v $
13  * Revision 1.2.4.2  2001/12/04 14:58:50  seletz
14  * - removed neponset hack
15  * - removed irq definitions (now in irqs.h)
16  *
17  * Revision 1.2.4.1  2001/12/04 12:51:18  seletz
18  * - re-added from linux_2_4_8_ac12_rmk1_np1_pt1
19  *
20  * Revision 1.2.2.2  2001/11/16 13:58:43  seletz
21  * - simplified cpld register access
22  *
23  * Revision 1.2.2.1  2001/10/15 16:17:20  seletz
24  * - first revision
25  *
26  *
27  */
28
29 #ifndef __ASM_ARCH_HARDWARE_H
30 #error "include <asm/hardware.h> instead"
31 #endif
32
33 /* System 3 LCD */
34 #define SYS3LCD                 SKPEN0
35 #define SYS3LCDBACKL    SKPEN1
36 #define SYS3LCDBRIGHT   SKPWM0
37 #define SYS3LCDCONTR    SKPWM1
38
39 #define PT_CPLD_BASE            (0x10000000)
40 #define PT_SMC_BASE                     (0x18000000)
41 #define PT_SA1111_BASE          (0x40000000)
42
43 #define SA1111_BASE                     PT_SA1111_BASE
44
45 #define Ptcpld_p2v( x ) ((x) - PT_CPLD_BASE + 0xf3000000)
46 #define Ptcpld_v2p( x ) ((x) - 0xf3000000 + PT_CPLD_BASE)
47
48 #define _PT_SYSID       ( PT_CPLD_BASE + 0x00 )
49 #define _PT_IRQSR       ( PT_CPLD_BASE + 0x24 )
50 #define _PT_CTRL0       ( PT_CPLD_BASE + 0x90 )
51 #define _PT_CTRL1       ( PT_CPLD_BASE + 0xA0 )
52 #define _PT_CTRL2       ( PT_CPLD_BASE + 0xB0 )
53
54 #define PT_SYSID        (*((volatile u_char *)Ptcpld_p2v( _PT_SYSID )))
55 #define PT_IRQSR        (*((volatile u_char *)Ptcpld_p2v( _PT_IRQSR )))
56 #define PT_CTRL0        (*((volatile u_char *)Ptcpld_p2v( _PT_CTRL0 )))
57 #define PT_CTRL1        (*((volatile u_char *)Ptcpld_p2v( _PT_CTRL1 )))
58 #define PT_CTRL2        (*((volatile u_char *)Ptcpld_p2v( _PT_CTRL2 )))
59
60 #define PTCTRL0_set( x )        PT_CTRL0 |= (x)
61 #define PTCTRL1_set( x )        PT_CTRL1 |= (x)
62 #define PTCTRL2_set( x )        PT_CTRL2 |= (x)
63 #define PTCTRL0_clear( x )      PT_CTRL0 &= ~(x)
64 #define PTCTRL1_clear( x )      PT_CTRL1 &= ~(x)
65 #define PTCTRL2_clear( x )      PT_CTRL2 &= ~(x)
66
67 /* System ID register */
68
69 /* IRQ Source Register */
70 #define PT_IRR_LAN              ( 1<<0 )
71 #define PT_IRR_X                ( 1<<1 )
72 #define PT_IRR_SA1111   ( 1<<2 )
73 #define PT_IRR_RS1              ( 1<<3 )
74 #define PT_IRR_RS1_RING ( 1<<4 )
75 #define PT_IRR_RS1_DCD  ( 1<<5 )
76 #define PT_IRR_RS1_DSR  ( 1<<6 )
77 #define PT_IRR_RS2              ( 1<<7 )
78
79 /* FIXME */
80 #define PT_IRR_USAR             ( 1<<1 )
81
82 /* CTRL 0 */
83 #define PT_CTRL0_USBSLAVE       ( 1<<0 )
84 #define PT_CTRL0_USBHOST        ( 1<<1 )
85 #define PT_CTRL0_LCD_BL         ( 1<<2 )
86 #define PT_CTRL0_LAN_EN         ( 1<<3 )        /* active low */
87 #define PT_CTRL0_IRDA_M(x)      ( (((u_char)x)&0x03)<<4 )
88 #define PT_CTRL0_IRDA_M0        ( 1<<4 )
89 #define PT_CTRL0_IRDA_M1        ( 1<<5 )
90 #define PT_CTRL0_IRDA_FSEL      ( 1<<6 )
91 #define PT_CTRL0_LCD_EN         ( 1<<7 )
92
93 #define PT_CTRL0_INIT   ( PT_CTRL0_USBSLAVE | PT_CTRL0_USBHOST | \
94                                                 PT_CTRL0_LCD_BL | PT_CTRL0_LAN_EN | PT_CTRL0_LCD_EN )
95
96 /* CTRL 1 */
97 #define PT_CTRL1_RS3_MUX(x) ( (((u_char)x)&0x03)<<0 )
98 #define PT_CTRL1_RS3_MUX0       ( 1<<0 )
99 #define PT_CTRL1_RS3_MUX1       ( 1<<1 )
100 #define PT_CTRL1_RS3_RST        ( 1<<2 )
101 #define PT_CTRL1_RS3_RS485_TERM ( 1<<4 )
102 #define PT_CTRL1_X                      ( 1<<4 )
103 #define PT_CTRL1_PCMCIA_A0VPP   ( 1<<6 )
104 #define PT_CTRL1_PCMCIA_A1VPP   ( 1<<7 )
105
106 #define PT_RS3_MUX_ALIRS        ( 0 )
107 #define PT_RS3_MUX_IDATA        ( 1 )
108 #define PT_RS3_MUX_RADIO        ( 2 )
109 #define PT_RS3_MUX_RS485        ( 3 )
110
111 /* CTRL 2 */
112 #define PT_CTRL2_RS1_RTS        ( 1<<0 )
113 #define PT_CTRL2_RS1_DTR        ( 1<<1 )