Linux-2.6.12-rc2
[safe/jmp/linux-2.6] / arch / ppc / platforms / 4xx / ibmstbx25.h
1 /*
2  * arch/ppc/platforms/4xx/ibmstbx25.h
3  *
4  * Author: Armin Kuster <akuster@mvista.com>
5  *
6  * 2002 (c) MontaVista, Software, Inc.  This file is licensed under
7  * the terms of the GNU General Public License version 2.  This program
8  * is licensed "as is" without any warranty of any kind, whether express
9  * or implied.
10  */
11
12 #ifdef __KERNEL__
13 #ifndef __ASM_IBMSTBX25_H__
14 #define __ASM_IBMSTBX25_H__
15
16 #include <linux/config.h>
17
18 /* serial port defines */
19 #define STBx25xx_IO_BASE        ((uint)0xe0000000)
20 #define PPC4xx_ONB_IO_PADDR     STBx25xx_IO_BASE
21 #define PPC4xx_ONB_IO_VADDR     ((uint)0xe0000000)
22 #define PPC4xx_ONB_IO_SIZE      ((uint)14*64*1024)
23
24 /*
25  * map STBxxxx internal i/o address (0x400x00xx) to an address
26  * which is below the 2GB limit...
27  *
28  * 4000 000x    uart1           -> 0xe000 000x
29  * 4001 00xx    uart2
30  * 4002 00xx    smart card
31  * 4003 000x    iic
32  * 4004 000x    uart0
33  * 4005 0xxx    timer
34  * 4006 00xx    gpio
35  * 4007 00xx    smart card
36  * 400b 000x    iic
37  * 400c 000x    scp
38  * 400d 000x    modem
39  * 400e 000x    uart2
40 */
41 #define STBx25xx_MAP_IO_ADDR(a) (((uint)(a)) + (STBx25xx_IO_BASE - 0x40000000))
42
43 #define RS_TABLE_SIZE   3
44
45 #define OPB_BASE_START  0x40000000
46 #define EBIU_BASE_START 0xF0100000
47 #define DCR_BASE_START  0x0000
48
49 #ifdef __BOOTER__
50 #define UART1_IO_BASE   0x40000000
51 #define UART2_IO_BASE   0x40010000
52 #else
53 #define UART1_IO_BASE   0xe0000000
54 #define UART2_IO_BASE   0xe0010000
55 #endif
56 #define SC0_BASE        0x40020000      /* smart card #0 */
57 #define IIC0_BASE       0x40030000
58 #ifdef __BOOTER__
59 #define UART0_IO_BASE   0x40040000
60 #else
61 #define UART0_IO_BASE   0xe0040000
62 #endif
63 #define SCC0_BASE       0x40040000      /* Serial 0 controller IrdA */
64 #define GPT0_BASE       0x40050000      /* General purpose timers */
65 #define GPIO0_BASE      0x40060000
66 #define SC1_BASE        0x40070000      /* smart card #1 */
67 #define SCP0_BASE       0x400C0000      /* Serial Controller Port */
68 #define SSP0_BASE       0x400D0000      /* Sync serial port */
69
70 #define IDE0_BASE               0xf0100000
71 #define REDWOOD_IDE_CTRL        0xf1100000
72
73 #define RTCFPC_IRQ      0
74 #define XPORT_IRQ       1
75 #define AUD_IRQ         2
76 #define AID_IRQ         3
77 #define DMA0            4
78 #define DMA1_IRQ        5
79 #define DMA2_IRQ        6
80 #define DMA3_IRQ        7
81 #define SC0_IRQ         8
82 #define IIC0_IRQ        9
83 #define IIR0_IRQ        10
84 #define GPT0_IRQ        11
85 #define GPT1_IRQ        12
86 #define SCP0_IRQ        13
87 #define SSP0_IRQ        14
88 #define GPT2_IRQ        15      /* count down timer */
89 #define SC1_IRQ         16
90 /* IRQ 17 - 19  external */
91 #define UART0_INT       20
92 #define UART1_INT       21
93 #define UART2_INT       22
94 #define XPTDMA_IRQ      23
95 #define DCRIDE_IRQ      24
96 /* IRQ 25 - 30 external */
97 #define IDE0_IRQ        26
98
99 #define IIC_NUMS        1
100 #define UART_NUMS       3
101 #define IIC_OWN         0x55
102 #define IIC_CLOCK       50
103
104 #define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
105
106 #define STD_UART_OP(num)                                        \
107         { 0, BASE_BAUD, 0, UART##num##_INT,                     \
108                 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST),        \
109                 iomem_base: (u8 *)UART##num##_IO_BASE,          \
110                 io_type: SERIAL_IO_MEM},
111
112 #if defined(CONFIG_UART0_TTYS0)
113 #define SERIAL_DEBUG_IO_BASE    UART0_IO_BASE
114 #define SERIAL_PORT_DFNS        \
115         STD_UART_OP(0)          \
116         STD_UART_OP(1)          \
117         STD_UART_OP(2)
118 #endif
119
120 #if defined(CONFIG_UART0_TTYS1)
121 #define SERIAL_DEBUG_IO_BASE    UART2_IO_BASE
122 #define SERIAL_PORT_DFNS        \
123         STD_UART_OP(1)          \
124         STD_UART_OP(0)          \
125         STD_UART_OP(2)
126 #endif
127
128 #if defined(CONFIG_UART0_TTYS2)
129 #define SERIAL_DEBUG_IO_BASE    UART2_IO_BASE
130 #define SERIAL_PORT_DFNS        \
131         STD_UART_OP(2)          \
132         STD_UART_OP(0)          \
133         STD_UART_OP(1)
134 #endif
135
136 #define DCRN_BE_BASE            0x090
137 #define DCRN_DMA0_BASE          0x0C0
138 #define DCRN_DMA1_BASE          0x0C8
139 #define DCRN_DMA2_BASE          0x0D0
140 #define DCRN_DMA3_BASE          0x0D8
141 #define DCRNCAP_DMA_CC          1       /* have DMA chained count capability */
142 #define DCRN_DMASR_BASE         0x0E0
143 #define DCRN_PLB0_BASE          0x054
144 #define DCRN_PLB1_BASE          0x064
145 #define DCRN_POB0_BASE          0x0B0
146 #define DCRN_SCCR_BASE          0x120
147 #define DCRN_UIC0_BASE          0x040
148 #define DCRN_BE_BASE            0x090
149 #define DCRN_DMA0_BASE          0x0C0
150 #define DCRN_DMA1_BASE          0x0C8
151 #define DCRN_DMA2_BASE          0x0D0
152 #define DCRN_DMA3_BASE          0x0D8
153 #define DCRN_CIC_BASE           0x030
154 #define DCRN_DMASR_BASE         0x0E0
155 #define DCRN_EBIMC_BASE         0x070
156 #define DCRN_DCRX_BASE          0x020
157 #define DCRN_CPMFR_BASE         0x102
158 #define DCRN_SCCR_BASE          0x120
159 #define DCRN_RTCFP_BASE         0x310
160
161 #define UIC0 DCRN_UIC0_BASE
162
163 #define IBM_CPM_IIC0    0x80000000      /* IIC 0 interface */
164 #define IBM_CPM_CPU     0x10000000      /* PPC405B3 clock control */
165 #define IBM_CPM_AUD     0x08000000      /* Audio Decoder */
166 #define IBM_CPM_EBIU    0x04000000      /* External Bus Interface Unit */
167 #define IBM_CPM_IRR     0x02000000      /* Infrared receiver */
168 #define IBM_CPM_DMA     0x01000000      /* DMA controller */
169 #define IBM_CPM_UART2   0x00200000      /* Serial Control Port */
170 #define IBM_CPM_UART1   0x00100000      /* Serial 1 / Infrared */
171 #define IBM_CPM_UART0   0x00080000      /* Serial 0 / 16550 */
172 #define IBM_PM_DCRIDE   0x00040000      /* DCR timeout & IDE line Mode clock */
173 #define IBM_CPM_SC0     0x00020000      /* Smart Card 0 */
174 #define IBM_CPM_VID     0x00010000      /* reserved */
175 #define IBM_CPM_SC1     0x00008000      /* Smart Card 0 */
176 #define IBM_CPM_XPT0    0x00002000      /* Transport - 54 Mhz */
177 #define IBM_CPM_CBS     0x00001000      /* Cross Bar Switch */
178 #define IBM_CPM_GPT     0x00000800      /* GPTPWM */
179 #define IBM_CPM_GPIO0   0x00000400      /* General Purpose IO 0 */
180 #define IBM_CPM_DENC    0x00000200      /* Digital video Encoder */
181 #define IBM_CPM_C405T   0x00000100      /* CPU timers */
182 #define IBM_CPM_XPT27   0x00000080      /* Transport - 27 Mhz */
183 #define IBM_CPM_UIC     0x00000040      /* Universal Interrupt Controller */
184 #define IBM_CPM_RTCFPC  0x00000020      /* Realtime clock and front panel */
185 #define IBM_CPM_SSP     0x00000010      /* Modem Serial Interface (SSP) */
186 #define IBM_CPM_VID2    0x00000002      /* Video Decoder clock domain 2 */
187 #define DFLT_IBM4xx_PM  ~(IBM_CPM_CPU | IBM_CPM_EBIU | IBM_CPM_DMA      \
188                         | IBM_CPM_CBS | IBM_CPM_XPT0 | IBM_CPM_C405T    \
189                         | IBM_CPM_XPT27 | IBM_CPM_UIC)
190
191 #define DCRN_BEAR       (DCRN_BE_BASE + 0x0)    /* Bus Error Address Register */
192 #define DCRN_BESR       (DCRN_BE_BASE + 0x1)    /* Bus Error Syndrome Register */
193 /* DCRN_BESR */
194 #define BESR_DSES       0x80000000      /* Data-Side Error Status */
195 #define BESR_DMES       0x40000000      /* DMA Error Status */
196 #define BESR_RWS        0x20000000      /* Read/Write Status */
197 #define BESR_ETMASK     0x1C000000      /* Error Type */
198 #define ET_PROT         0
199 #define ET_PARITY       1
200 #define ET_NCFG         2
201 #define ET_BUSERR       4
202 #define ET_BUSTO        6
203
204 #define CHR1_CETE       0x00800000      /* CPU external timer enable */
205 #define CHR1_PCIPW      0x00008000      /* PCI Int enable/Peripheral Write enable */
206
207 #define DCRN_CICCR      (DCRN_CIC_BASE + 0x0)   /* CIC Control Register */
208 #define DCRN_DMAS1      (DCRN_CIC_BASE + 0x1)   /* DMA Select1 Register */
209 #define DCRN_DMAS2      (DCRN_CIC_BASE + 0x2)   /* DMA Select2 Register */
210 #define DCRN_CICVCR     (DCRN_CIC_BASE + 0x3)   /* CIC Video COntro Register */
211 #define DCRN_CICSEL3    (DCRN_CIC_BASE + 0x5)   /* CIC Select 3 Register */
212 #define DCRN_SGPO       (DCRN_CIC_BASE + 0x6)   /* CIC GPIO Output Register */
213 #define DCRN_SGPOD      (DCRN_CIC_BASE + 0x7)   /* CIC GPIO OD Register */
214 #define DCRN_SGPTC      (DCRN_CIC_BASE + 0x8)   /* CIC GPIO Tristate Ctrl Reg */
215 #define DCRN_SGPI       (DCRN_CIC_BASE + 0x9)   /* CIC GPIO Input Reg */
216
217 #define DCRN_DCRXICR    (DCRN_DCRX_BASE + 0x0)  /* Internal Control Register */
218 #define DCRN_DCRXISR    (DCRN_DCRX_BASE + 0x1)  /* Internal Status Register */
219 #define DCRN_DCRXECR    (DCRN_DCRX_BASE + 0x2)  /* External Control Register */
220 #define DCRN_DCRXESR    (DCRN_DCRX_BASE + 0x3)  /* External Status Register */
221 #define DCRN_DCRXTAR    (DCRN_DCRX_BASE + 0x4)  /* Target Address Register */
222 #define DCRN_DCRXTDR    (DCRN_DCRX_BASE + 0x5)  /* Target Data Register */
223 #define DCRN_DCRXIGR    (DCRN_DCRX_BASE + 0x6)  /* Interrupt Generation Register */
224 #define DCRN_DCRXBCR    (DCRN_DCRX_BASE + 0x7)  /* Line Buffer Control Register */
225
226 #define DCRN_BRCRH0     (DCRN_EBIMC_BASE + 0x0) /* Bus Region Config High 0 */
227 #define DCRN_BRCRH1     (DCRN_EBIMC_BASE + 0x1) /* Bus Region Config High 1 */
228 #define DCRN_BRCRH2     (DCRN_EBIMC_BASE + 0x2) /* Bus Region Config High 2 */
229 #define DCRN_BRCRH3     (DCRN_EBIMC_BASE + 0x3) /* Bus Region Config High 3 */
230 #define DCRN_BRCRH4     (DCRN_EBIMC_BASE + 0x4) /* Bus Region Config High 4 */
231 #define DCRN_BRCRH5     (DCRN_EBIMC_BASE + 0x5) /* Bus Region Config High 5 */
232 #define DCRN_BRCRH6     (DCRN_EBIMC_BASE + 0x6) /* Bus Region Config High 6 */
233 #define DCRN_BRCRH7     (DCRN_EBIMC_BASE + 0x7) /* Bus Region Config High 7 */
234 #define DCRN_BRCR0      (DCRN_EBIMC_BASE + 0x10)        /* BRC 0 */
235 #define DCRN_BRCR1      (DCRN_EBIMC_BASE + 0x11)        /* BRC 1 */
236 #define DCRN_BRCR2      (DCRN_EBIMC_BASE + 0x12)        /* BRC 2 */
237 #define DCRN_BRCR3      (DCRN_EBIMC_BASE + 0x13)        /* BRC 3 */
238 #define DCRN_BRCR4      (DCRN_EBIMC_BASE + 0x14)        /* BRC 4 */
239 #define DCRN_BRCR5      (DCRN_EBIMC_BASE + 0x15)        /* BRC 5 */
240 #define DCRN_BRCR6      (DCRN_EBIMC_BASE + 0x16)        /* BRC 6 */
241 #define DCRN_BRCR7      (DCRN_EBIMC_BASE + 0x17)        /* BRC 7 */
242 #define DCRN_BEAR0      (DCRN_EBIMC_BASE + 0x20)        /* Bus Error Address Register */
243 #define DCRN_BESR0      (DCRN_EBIMC_BASE + 0x21)        /* Bus Error Status Register */
244 #define DCRN_BIUCR      (DCRN_EBIMC_BASE + 0x2A)        /* Bus Interfac Unit Ctrl Reg */
245
246 #define DCRN_RTC_FPC0_CNTL      (DCRN_RTCFP_BASE + 0x00)        /* RTC cntl */
247 #define DCRN_RTC_FPC0_INT       (DCRN_RTCFP_BASE + 0x01)        /* RTC Interrupt */
248 #define DCRN_RTC_FPC0_TIME      (DCRN_RTCFP_BASE + 0x02)        /* RTC time reg */
249 #define DCRN_RTC_FPC0_ALRM      (DCRN_RTCFP_BASE + 0x03)        /* RTC Alarm reg */
250 #define DCRN_RTC_FPC0_D1        (DCRN_RTCFP_BASE + 0x04)        /* LED Data 1 */
251 #define DCRN_RTC_FPC0_D2        (DCRN_RTCFP_BASE + 0x05)        /* LED Data 2 */
252 #define DCRN_RTC_FPC0_D3        (DCRN_RTCFP_BASE + 0x06)        /* LED Data 3 */
253 #define DCRN_RTC_FPC0_D4        (DCRN_RTCFP_BASE + 0x07)        /* LED Data 4 */
254 #define DCRN_RTC_FPC0_D5        (DCRN_RTCFP_BASE + 0x08)        /* LED Data 5 */
255 #define DCRN_RTC_FPC0_FCNTL     (DCRN_RTCFP_BASE + 0x09)        /* LED control */
256 #define DCRN_RTC_FPC0_BRT       (DCRN_RTCFP_BASE + 0x0A)        /* Brightness cntl */
257
258 #include <asm/ibm405.h>
259
260 #endif                          /* __ASM_IBMSTBX25_H__ */
261 #endif                          /* __KERNEL__ */