ixp12x0reg.h revision 1.3 1 /* $NetBSD: ixp12x0reg.h,v 1.3 2003/02/17 20:51:52 ichiro Exp $ */
2
3 /*
4 * Copyright (c) 2002, 2003
5 * Ichiro FUKUHARA <ichiro (at) ichiro.org>.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Ichiro FUKUHARA.
19 * 4. The name of the company nor the name of the author may be used to
20 * endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35
36 #ifndef _IXP12X0REG_H_
37 #define _IXP12X0REG_H_
38
39 /*
40 * Physical memory map for the Intel IXP12X0
41 */
42
43 /*
44 * FFFF FFFF ---------------------------
45 * Device 6
46 * SDRAM
47 * FF00 0000 - FF00 0014
48 * SDRAM Control Register
49 * D000 0000 - DFFF FFFF
50 * Prefetch 256MB
51 * C000 0000 - CFFF FFFF
52 * non-Prefetch 256MB
53 * C000 0000 ---------------------------
54 * Device 5
55 * AMBA Translation (ATU)
56 * B000 0000 ---------------------------
57 * Device 4
58 * Reserved
59 * A000 0000 ---------------------------
60 * Device 3
61 * StrongARM Core System
62 * 9000 0000 ---------------------------
63 * Device 2
64 * Reserved
65 * 8000 0000 ---------------------------
66 * Device 1
67 * PCI UNIT
68 * 6000 0000 - 7FFF FFFF
69 * PCI Memory Cycle Access
70 * 5400 0000 - 5400 FFFF
71 * PCI I/O Cycle Access
72 * 5300 0000 - 53BF FFFF
73 * PCI Type0 Configuration Cycle Access
74 * 5200 0000 - 52FF FFFF
75 * PCI Type1 Configuration Cycle Access
76 * 4200 0000 - 4200 03FF
77 * Local PCI Configuration Space
78 * 4000 0000 ---------------------------
79 * Device 0
80 * SRAM UNIT
81 * 0000 0000 ---------------------------
82 */
83
84
85 /*
86 * Virtual memory map for the Intel IXP12X0 integrated devices
87 *
88 * IXP12x0 processors have many device registers at very lower addresses.
89 * To make user process space wider, we map the registers at lower address
90 * to upper address using adress translation of virtual memory system.
91 *
92 * Some device registers are staticaly mapped on upper address region.
93 * because we have to access them before bus_space is initialized.
94 * Most device is dinamicaly mapped by bus_space_map(). In this case,
95 * the actual mapped (virtual) address are not cared by device drivers.
96 */
97
98 /*
99 * FFFF FFFF ---------------------------
100 *
101 * F400 0000 ---------------------------
102 * PCI Type 0 Configuration Cycle Access
103 * VA F300 0000 == PA 5300 0000 (16Mbyte)
104 * F300 0000 ---------------------------
105 * PCI Type 1 Configuration Cycle Access
106 * VA F200 0000 == PA 5200 0000 (16Mbyte)
107 * F200 0000 ---------------------------
108 * not used
109 * F001 1000 ---------------------------
110 * PCI Registers Accessible Through StrongARM Core
111 * VA F001 0000 == PA 4200 0000 (4kbyte)
112 * F001 0300 - F001 036F TIMER
113 * F001 0200 - F001 0293 PCI_FIQ
114 * F001 0180 - F001 0193 PCI_IRQ
115 * F001 0000 ---------------------------
116 * StrongARM System and Peripheral Registers
117 * VA F001 0000 == PA 9000 0000 (64kbyte)
118 * F000 3400 - F000 3C03 UART
119 * F000 3400 - F000 3C03 UART
120 * F000 2000 - F000 3003 RTC
121 * F000 1C00 - F000 1C03 GPIO_DATA
122 * F000 1800 - F000 1C03 GPIO
123 * F000 1400 - F000 1403 IRQ
124 * F000 1000 - F000 1003 FIQ
125 * F000 0C00 - F000 0C03 PLL_CFG (not used at this addres)
126 * F000 0000 ---------------------------
127 * Kernel text and data
128 * C000 0000 ---------------------------
129 * L2 tables for user process (XXX should be fixed)
130 * 8000 0000 ---------------------------
131 * PCI Registers Accessible Through Memory
132 * VA 6000 0000 == PA 6000 0000 (512Mbyte)
133 * 6000 0000 ---------------------------
134 * PCI Registers Accessible Through I/O
135 * VA 5400 0000 == PA 5400 0000 (1Mbyte)
136 * 5400 0000 ---------------------------
137 * 0000 0000 ---------------------------
138 *
139 */
140
141 /* Virtual address for I/O space */
142 #define IXP12X0_IO_VBASE 0xf0000000UL
143
144 /* StrongARM System and Peripheral Registers */
145 #define IXP12X0_SYS_VBASE IXP12X0_IO_VBASE
146 /* va=0xf0000000 */
147 #define IXP12X0_SYS_HWBASE 0x90000000UL
148 #define IXP12X0_SYS_SIZE 0x00010000UL /* 64Kbyte */
149
150 #define IXP12X0_PLL_CFG (IXP12X0_IO_VBASE + 0x0c00)
151 #define IXP12X0_PLL_CFG_CCF 0x1f
152
153 /* PCI Registers Accessible Through StrongARM Core */
154 #define IXP12X0_PCI_VBASE (IXP12X0_IO_VBASE + IXP12X0_SYS_SIZE)
155 /* va=0xf0010000 */
156 #define IXP12X0_PCI_HWBASE 0x42000000UL
157 #define IXP12X0_PCI_SIZE 0x00001000UL /* 4Kbyte */
158
159 /* PCI I/O Space */
160 #define IXP12X0_PCI_IO_HWBASE 0x54000000UL /* VA == PA */
161 #define IXP12X0_PCI_IO_VBASE IXP12X0_PCI_IO_HWBASE
162 #define IXP12X0_PCI_IO_SIZE 0x00100000UL /* 1Mbyte */
163
164 /* PCI Memory Space */
165 #define IXP12X0_PCI_MEM_HWBASE 0x60000000UL /* VA == PA */
166 #define IXP12X0_PCI_MEM_VBASE IXP12X0_PCI_MEM_HWBASE
167 #define IXP12X0_PCI_MEM_SIZE 0x20000000UL
168
169 /* PCI Type0/1 Configuration address */
170 #define IXP12X0_PCI_TYPE0_HWBASE 0x53000000UL
171 #define IXP12X0_PCI_TYPE0_VBASE 0xf3000000UL
172 #define IXP12X0_PCI_TYPE0_SIZE 0x01000000UL /* 16MB */
173
174 #define IXP12X0_PCI_TYPE1_HWBASE 0x52000000UL
175 #define IXP12X0_PCI_TYPE1_VBASE 0xf2000000UL
176 #define IXP12X0_PCI_TYPE1_SIZE 0x01000000UL /* 16MB */
177
178 /*
179 * SlowPort I/O Register
180 */
181 /* see. arch/evbarm/ixm1200/ixm1200reg.h */
182
183 /* Physical register base addresses */
184 /* #define IXP12X0_GPIO_VBASE */
185 #define IXP12X0_GPIO_HWBASE 0x90001800UL
186 #define IXP12X0_GPIO_SIZE 0x00000800UL
187
188 /* Interrupts */
189 #define IXP12X0_FIQ_VBASE (IXP12X0_IO_VBASE + 0x1000)
190 #define IXP12X0_FIQ_HWBASE 0x90001000UL
191 #define IXP12X0_FIQ_SIZE 0x00000004UL
192 #define IXP12X0_IRQ_VBASE (IXP12X0_IO_VBASE + 0x1400)
193 #define IXP12X0_IRQ_HWBASE 0x90001400UL
194 #define IXP12X0_IRQ_SIZE 0x00000004UL
195
196 /*
197 * Interrupt index assignment
198 *
199 *
200 * FIQ/IRQ bitmap in "StrongARM System and Peripheral Registers"
201 *
202 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
203 * bit 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
204 * +-+-------------------------------------------+-+-+-+-+-+-+-+---+
205 * |M| |U|S|R|S|U|C|P| |
206 * |B| |A|D|T|R|E|I|C| |
207 * |Z| RES |R|R|C|A|N|N|I|RES|
208 * | | |T|A| |M|G|T| | |
209 * | | | |M| | | | | | |
210 * +-+-------------------------------------------+-+-+-+-+-+-+-+---+
211 * 3
212 * index 1 8 7 6 5 4 3 2
213 *
214 *
215 * We Map a software interrupt queue index to the unused bits in the
216 * IRQ/FIQ registers. (in "StrongARM System and Peripheral Registers")
217 *
218 * XXX will need to revisit this if those bits are ever used in future
219 * steppings).
220 *
221 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
222 * bit 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
223 * +-+-+-+-+-+-----------------------------------+-+-+-+-+-+-+-+---+
224 * |M|S|C|N|S| |U|S|R|S|U|C|P| |
225 * |B|O|L|E|E| |A|D|T|R|E|I|C| |
226 * |Z|F|O|T|R| RES |R|R|C|A|N|N|I|RES|
227 * | |T|C| |I| |T|A| |M|G|T| | |
228 * | | |K| |A| | |M| | | | | | |
229 * | | | | |L| | | | | | | | | |
230 * +-+-+-+-+-+-----------------------------------+-+-+-+-+-+-+-+---+
231 * 3 3 2 2 2
232 * index 1 0 9 8 7 8 7 6 5 4 3 2
233 *
234 */
235
236 #define NIRQ 64
237 #define SYS_NIRQ 32
238
239 #define IXP12X0_INTR_MBZ 31
240 #define IXP12X0_INTR_bit30 30
241 #define IXP12X0_INTR_bit29 29
242 #define IXP12X0_INTR_bit28 28
243 #define IXP12X0_INTR_bit27 27
244 #define IXP12X0_INTR_bit26 26
245 #define IXP12X0_INTR_bit25 25
246 #define IXP12X0_INTR_bit24 24
247 #define IXP12X0_INTR_bit23 23
248 #define IXP12X0_INTR_bit22 22
249 #define IXP12X0_INTR_bit21 21
250 #define IXP12X0_INTR_bit20 20
251 #define IXP12X0_INTR_bit19 19
252 #define IXP12X0_INTR_bit18 18
253 #define IXP12X0_INTR_bit17 17
254 #define IXP12X0_INTR_bit16 16
255 #define IXP12X0_INTR_bit15 15
256 #define IXP12X0_INTR_bit14 14
257 #define IXP12X0_INTR_bit13 13
258 #define IXP12X0_INTR_bit12 12
259 #define IXP12X0_INTR_bit11 11
260 #define IXP12X0_INTR_bit10 10
261 #define IXP12X0_INTR_bit9 9
262 #define IXP12X0_INTR_UART 8
263 #define IXP12X0_INTR_SDRAM 7
264 #define IXP12X0_INTR_RTC 6
265 #define IXP12X0_INTR_SRAM 5
266 #define IXP12X0_INTR_UENG 4
267 #define IXP12X0_INTR_CINT 3
268 #define IXP12X0_INTR_PCI 2
269 #define IXP12X0_INTR_bit1 1
270 #define IXP12X0_INTR_bit0 0
271
272 #define IXP12X0_INTR_MASK \
273 ((1U << IXP12X0_INTR_MBZ) \
274 | (1U << IXP12X0_INTR_UART) \
275 | (1U << IXP12X0_INTR_SDRAM) \
276 | (1U << IXP12X0_INTR_RTC) \
277 | (1U << IXP12X0_INTR_SRAM) \
278 | (1U << IXP12X0_INTR_UENG) \
279 | (1U << IXP12X0_INTR_CINT))
280
281 #endif /* _IXP12X0REG_H_ */
282