fix to allow usb modules to compile
[linux-2.4.21-pre4.git] / arch / ppc / platforms / ibmstb3.h
1 /*
2  * ibmstbx.h
3  *
4  *      This was dirived from the ppc4xx.h and all stbx specific definitions
5  *      are located here.
6  *
7  *      Armin Kuster <akuster@mvista.com>
8  *      Tom Rini <trini@mvista.com>
9  *      Oct, 2001
10  *
11  *
12  *
13  * Copyright 2001 MontaVista Softare Inc.
14  *
15  * This program is free software; you can redistribute  it and/or modify it
16  *  under  the terms of  the GNU General Public License as published by the
17  *  Free Software Foundation;  either version 2 of the  License, or (at your
18  *  option) any later version.
19  *
20  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR   IMPLIED
21  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
22  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
23  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT,  INDIRECT,
24  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
26  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
28  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  *  You should have received a copy of the  GNU General Public License along
32  *  with this program; if not, write  to the Free Software Foundation, Inc.,
33  *  675 Mass Ave, Cambridge, MA 02139, USA.
34  *
35  *      Version 1.0 Oct 10, 2001 - A. Kuster
36  *      Initial version  - moved stbx  specific out of ibm4xx.h
37  *
38  *      Version 1.1 Oct 25, 2001 - T. Rini
39  *      Lots of cleanups, and we get included by the board-specific file.
40  *
41  *      Version 1.2 Jan 16, 2002 - A. Kuster
42  *      Removed common dcr offests that are now in ibm405.h 
43  *
44  *      Version 1.3 Feb 22, 2002 - Armin & David Gibson
45  *      Added early serial boot #define support
46  *      added UIC define 
47  *
48  *      Version 1.3 03/29/02 - Armin
49  *       Changed i2c support to ocp standard
50  *
51  *      Version 1.4 05/06/02 - Armin
52  *       removed IIC_IRQ now using core_ocp[];
53  *
54  *       Version 1.5 07/22/02 - Armin
55  *       added default power manament settings
56  *
57  */
58
59 #ifdef __KERNEL__
60 #ifndef __ASM_IBMSTBX_H__
61 #define __ASM_IBMSTBX_H__
62
63 #include <linux/config.h>
64 #include <platforms/ibm_ocp.h>
65
66 /* ibm405.h at bottom of this file */
67
68 /*
69  * Memory map for the IBM "Redwood-4" STB03xxx evaluation board.
70  *
71  * The  STB03xxx internal i/o addresses don't work for us 1:1,
72  * so we need to map them at a well know virtual address.
73  *
74  * 4000 000x   uart1           -> 0xe000 000x
75  * 4001 00xx   ppu
76  * 4002 00xx   smart card
77  * 4003 000x   iic
78  * 4004 000x   uart0
79  * 4005 0xxx   timer
80  * 4006 00xx   gpio
81  * 4007 00xx   smart card
82  * 400b 000x   iic
83  * 400c 000x   scp
84  * 400d 000x   modem
85  */
86
87 #define STB03xxx_IO_BASE        ((uint)0xe0000000)
88 #define PPC4xx_ONB_IO_PADDR     ((uint)0x40000000)
89 #define PPC4xx_ONB_IO_VADDR     STB03xxx_IO_BASE
90 #define PPC4xx_ONB_IO_SIZE      ((uint)14*64*1024)
91
92 /* Since we're into address mapping hacks, at least try to hide
93  * it under a macro.....
94  */
95 #define STB03xxx_MAP_IO_ADDR(a) (((uint)(a) & 0x000fffff) + PPC4xx_ONB_IO_VADDR)
96
97 #define RS_TABLE_SIZE           1
98 #define UART0_INT               20
99 #ifdef __BOOTER__
100 #define UART0_IO_BASE           0x40040000
101 #else
102 #define UART0_IO_BASE           0xe0040000
103 #endif
104
105  /* UART 0 is duped here so when the SICC is the default console
106   * then ttys1 is configured properly - armin 
107   */
108
109 #define UART1_INT               20
110 #ifdef __BOOTER__
111 #define UART1_IO_BASE           0x40040000
112 #else
113 #define UART1_IO_BASE           0xe0040000
114 #endif
115
116 /* need to make this work in scheme - armin */
117
118 #define SICC0_INTRX             21
119 #define SICC0_INTTX             22
120 #define SICC0_IO_BASE           ((uint* )0x40000000)
121
122 #define IIC0_BASE       0x40030000
123 #define IIC1_BASE       0x400b0000
124 #define OPB0_BASE       0x40010000
125 #define GPIO0_BASE      0x40060000
126 #define IIC0_IRQ        9
127 #define IIC1_IRQ        10
128 #define IIC_OWN         0x55
129 #define IIC_CLOCK       50
130
131 #define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
132
133 #define STD_UART_OP(num)                                        \
134         { 0, BASE_BAUD, 0, UART##num##_INT,                     \
135                 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST),        \
136                 iomem_base: (u8 *)UART##num##_IO_BASE,          \
137                 io_type: SERIAL_IO_MEM},
138
139 #if defined(CONFIG_UART0_TTYS0)
140 #define SERIAL_DEBUG_IO_BASE    UART0_IO_BASE
141 #define SERIAL_PORT_DFNS        \
142         STD_UART_OP(0)
143 #endif
144
145 #if defined(CONFIG_UART0_TTYS1)
146 #define SERIAL_DEBUG_IO_BASE    UART1_IO_BASE
147 #define SERIAL_PORT_DFNS        \
148         STD_UART_OP(1)
149 #endif
150
151 /* ------------------------------------------------------------------------- */
152
153 #define DCRN_DCRX_BASE          0x020
154 #define DCRN_CIC_BASE           0x030
155 #define DCRN_UIC0_BASE          0x040
156 #define DCRN_PLB0_BASE          0x054
157 #define DCRN_PLB1_BASE          0x064
158 #define DCRN_EBIMC_BASE         0x070
159 #define DCRN_POB0_BASE          0x0B0
160
161 #define DCRN_BE_BASE            0x090
162 #define DCRN_DMA0_BASE          0x0C0
163 #define DCRN_DMA1_BASE          0x0C8
164 #define DCRN_DMA2_BASE          0x0D0
165 #define DCRN_DMA3_BASE          0x0D8
166 #define DCRNCAP_DMA_CC          1       /* have DMA chained count capability */
167 #define DCRN_DMASR_BASE         0x0E0
168
169 #define DCRN_CPMFR_BASE         0x102
170 #define DCRN_SCCR_BASE          0x120
171 #define UIC0 DCRN_UIC0_BASE
172
173 #define IBM_CPM_IIC0    0x80000000      /* IIC 0 interface */
174 #define IBM_CPM_I1284   0x40000000      /* IEEE-1284 */
175 #define IBM_CPM_IIC1    0x20000000      /* IIC 1 interface */
176 #define IBM_CPM_CPU     0x10000000      /* PPC405B3 clock control */
177 #define IBM_CPM_AUD     0x08000000      /* Audio Decoder */
178 #define IBM_CPM_EBIU    0x04000000      /* External Bus Interface Unit */
179 #define IBM_CPM_SDRAM1  0x02000000      /* SDRAM 1 memory controller */
180 #define IBM_CPM_DMA     0x01000000      /* DMA controller */
181 #define IBM_CPM_UART1   0x00100000      /* Serial 1 / Infrared */
182 #define IBM_CPM_UART0   0x00080000      /* Serial 0 / 16550 */
183 #define IBM_CPM_DCRX    0x00040000      /* DCR Extension */
184 #define IBM_CPM_SC0     0x00020000      /* Smart Card 0 */
185 #define IBM_CPM_SC1     0x00008000      /* Smart Card 1 */
186 #define IBM_CPM_SDRAM0  0x00004000      /* SDRAM 0 memory controller */
187 #define IBM_CPM_XPT54   0x00002000      /* Transport - 54 Mhz */
188 #define IBM_CPM_CBS     0x00001000      /* Cross Bar Switch */
189 #define IBM_CPM_GPT     0x00000800      /* GPTPWM */
190 #define IBM_CPM_GPIO0   0x00000400      /* General Purpose IO 0 */
191 #define IBM_CPM_DENC    0x00000200      /* Digital video Encoder */
192 #define IBM_CPM_TMRCLK  0x00000100      /* CPU timers */
193 #define IBM_CPM_XPT27   0x00000080      /* Transport - 27 Mhz */
194 #define IBM_CPM_UIC     0x00000040      /* Universal Interrupt Controller */
195 #define IBM_CPM_MSI     0x00000010      /* Modem Serial Interface (SSP) */
196 #define IBM_CPM_UART2   0x00000008      /* Serial Control Port */
197 #define IBM_CPM_DSCR    0x00000004      /* Descrambler */
198 #define IBM_CPM_VID2    0x00000002      /* Video Decoder clock domain 2 */
199
200 #define DFLT_IBM4xx_PM  ~(IBM_CPM_CPU | IBM_CPM_EBIU | IBM_CPM_SDRAM1 \
201                         | IBM_CPM_DMA | IBM_CPM_CBS | IBM_CPM_SDRAM0 \
202                         | IBM_CPM_XPT54 | IBM_CPM_TMRCLK | IBM_CPM_XPT27 \
203                         | IBM_CPM_UIC)
204
205 #ifdef DCRN_CIC_BASE
206 #define DCRN_CICCR      (DCRN_CIC_BASE + 0x0)   /* CIC Control Register */
207 #define DCRN_DMAS1      (DCRN_CIC_BASE + 0x1)   /* DMA Select1 Register */
208 #define DCRN_DMAS2      (DCRN_CIC_BASE + 0x2)   /* DMA Select2 Register */
209 #define DCRN_CICVCR     (DCRN_CIC_BASE + 0x3)   /* CIC Video COntro Register */
210 #define DCRN_CICSEL3    (DCRN_CIC_BASE + 0x5)   /* CIC Select 3 Register */
211 #define DCRN_SGPO       (DCRN_CIC_BASE + 0x6)   /* CIC GPIO Output Register */
212 #define DCRN_SGPOD      (DCRN_CIC_BASE + 0x7)   /* CIC GPIO OD Register */
213 #define DCRN_SGPTC      (DCRN_CIC_BASE + 0x8)   /* CIC GPIO Tristate Ctrl Reg */
214 #define DCRN_SGPI       (DCRN_CIC_BASE + 0x9)   /* CIC GPIO Input Reg */
215 #endif
216
217 #ifdef DCRN_DCRX_BASE
218 #define DCRN_DCRXICR    (DCRN_DCRX_BASE + 0x0)  /* Internal Control Register */
219 #define DCRN_DCRXISR    (DCRN_DCRX_BASE + 0x1)  /* Internal Status Register */
220 #define DCRN_DCRXECR    (DCRN_DCRX_BASE + 0x2)  /* External Control Register */
221 #define DCRN_DCRXESR    (DCRN_DCRX_BASE + 0x3)  /* External Status Register */
222 #define DCRN_DCRXTAR    (DCRN_DCRX_BASE + 0x4)  /* Target Address Register */
223 #define DCRN_DCRXTDR    (DCRN_DCRX_BASE + 0x5)  /* Target Data Register */
224 #define DCRN_DCRXIGR    (DCRN_DCRX_BASE + 0x6)  /* Interrupt Generation Register */
225 #define DCRN_DCRXBCR    (DCRN_DCRX_BASE + 0x7)  /* Line Buffer Control Register */
226 #endif
227
228 #ifdef DCRN_EBC_BASE
229 #define DCRN_EBCCFGADR  (DCRN_EBC_BASE + 0x0)   /* Peripheral Controller Address */
230 #define DCRN_EBCCFGDATA (DCRN_EBC_BASE + 0x1)   /* Peripheral Controller Data */
231 #endif
232
233 #ifdef DCRN_EBIMC_BASE
234 #define DCRN_BRCRH0     (DCRN_EBIMC_BASE + 0x0) /* Bus Region Config High 0 */
235 #define DCRN_BRCRH1     (DCRN_EBIMC_BASE + 0x1) /* Bus Region Config High 1 */
236 #define DCRN_BRCRH2     (DCRN_EBIMC_BASE + 0x2) /* Bus Region Config High 2 */
237 #define DCRN_BRCRH3     (DCRN_EBIMC_BASE + 0x3) /* Bus Region Config High 3 */
238 #define DCRN_BRCRH4     (DCRN_EBIMC_BASE + 0x4) /* Bus Region Config High 4 */
239 #define DCRN_BRCRH5     (DCRN_EBIMC_BASE + 0x5) /* Bus Region Config High 5 */
240 #define DCRN_BRCRH6     (DCRN_EBIMC_BASE + 0x6) /* Bus Region Config High 6 */
241 #define DCRN_BRCRH7     (DCRN_EBIMC_BASE + 0x7) /* Bus Region Config High 7 */
242 #define DCRN_BRCR0      (DCRN_EBIMC_BASE + 0x10)        /* BRC 0 */
243 #define DCRN_BRCR1      (DCRN_EBIMC_BASE + 0x11)        /* BRC 1 */
244 #define DCRN_BRCR2      (DCRN_EBIMC_BASE + 0x12)        /* BRC 2 */
245 #define DCRN_BRCR3      (DCRN_EBIMC_BASE + 0x13)        /* BRC 3 */
246 #define DCRN_BRCR4      (DCRN_EBIMC_BASE + 0x14)        /* BRC 4 */
247 #define DCRN_BRCR5      (DCRN_EBIMC_BASE + 0x15)        /* BRC 5 */
248 #define DCRN_BRCR6      (DCRN_EBIMC_BASE + 0x16)        /* BRC 6 */
249 #define DCRN_BRCR7      (DCRN_EBIMC_BASE + 0x17)        /* BRC 7 */
250 #define DCRN_BEAR0      (DCRN_EBIMC_BASE + 0x20)        /* Bus Error Address Register */
251 #define DCRN_BESR0      (DCRN_EBIMC_BASE + 0x21)        /* Bus Error Status Register */
252 #define DCRN_BIUCR      (DCRN_EBIMC_BASE + 0x2A)        /* Bus Interfac Unit Ctrl Reg */
253 #endif
254
255 #ifdef DCRN_SCCR_BASE
256 #define DCRN_SCCR       (DCRN_SCCR_BASE + 0x0)
257 #endif
258
259 #ifdef DCRN_SDRAM0_BASE
260 #define DCRN_SDRAM0_CFGADDR     (DCRN_SDRAM0_BASE + 0x0)        /* Memory Controller Address */
261 #define DCRN_SDRAM0_CFGDATA     (DCRN_SDRAM0_BASE + 0x1)        /* Memory Controller Data */
262 #endif
263
264 #ifdef DCRN_OCM0_BASE
265 #define DCRN_OCMISARC   (DCRN_OCM0_BASE + 0x0)  /* OCM Instr Side Addr Range Compare */
266 #define DCRN_OCMISCR    (DCRN_OCM0_BASE + 0x1)  /* OCM Instr Side Control */
267 #define DCRN_OCMDSARC   (DCRN_OCM0_BASE + 0x2)  /* OCM Data Side Addr Range Compare */
268 #define DCRN_OCMDSCR    (DCRN_OCM0_BASE + 0x3)  /* OCM Data Side Control */
269 #endif
270
271 #define REDWOOD_IDE_CMD         0xf2100000
272 #define REDWOOD_IDE_CTRL        0xf4100000
273 #define IDE_DMA_ADDR            0xfce00000
274 #define IDE0_IRQ                25
275
276
277 #include <platforms/ibm405.h>
278
279 #endif                          /* __ASM_IBMSTBX_H__ */
280 #endif                          /* __KERNEL__ */