at91rm9200reg.h revision 1.2 1 /* $Id: at91rm9200reg.h,v 1.2 2008/07/03 01:15:38 matt Exp $ */
2 /* $NetBSD: at91rm9200reg.h,v 1.2 2008/07/03 01:15:38 matt Exp $ */
3
4 /*
5 * Copyright (c) 2007 Embedtronics Oy
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 _AT91RM9200REG_H_
37 #define _AT91RM9200REG_H_
38
39 #include <arm/at91/at91reg.h>
40
41 /*
42 * Physical memory map for the AT91RM9200
43 */
44
45 /*
46 * ffff ffff ---------------------------
47 * System Peripherals
48 * fffe 4000 ---------------------------
49 * User Peripherals
50 * fffa 0000 ---------------------------
51 * (not used)
52 * 9000 0000 ---------------------------
53 * EBI Chip Select 7
54 * 8000 0000 ---------------------------
55 * EBI Chip Select 6 / CF logic
56 * 7000 0000 ---------------------------
57 * EBI Chip Select 5 / CF logic
58 * 6000 0000 ---------------------------
59 * EBI Chip Select 4 / CF logic
60 * 5000 0000 ---------------------------
61 * EBI Chip Select 3 / NANDFlash
62 * 4000 0000 ---------------------------
63 * EBI Chip Select 2
64 * 3000 0000 ---------------------------
65 * EBI Chip Select 1 / SDRAM
66 * 2000 0000 ---------------------------
67 * EBI Chip Select 0 / BFC
68 * 1000 0000 ---------------------------
69 * (not used)
70 * 0030 0000 ---------------------------
71 * USB HOST User Interface
72 * 0020 0000 ---------------------------
73 * SRAM
74 * 0010 0000 ---------------------------
75 * Boot memory
76 * 0000 0000 ---------------------------
77 */
78
79
80 /*
81 * Virtual memory map for the AT91RM9200 integrated devices
82 *
83 * Some device registers are statically mapped on upper address region.
84 * because we have to access them before bus_space is initialized.
85 * Most devices are dynamicaly mapped by bus_space_map(). In this case,
86 * the actual mapped (virtual) address are not cared by device drivers.
87 */
88
89 /*
90 * FFFF FFFF ---------------------------
91 * APB bus (1 MB)
92 * FFF0 0000 ---------------------------
93 * (not used)
94 * E000 0000 ---------------------------
95 * Kernel text and data
96 * C000 0000 ---------------------------
97 * (not used)
98 * 0000 0000 ---------------------------
99 *
100 */
101
102 #define AT91RM9200_BOOTMEM_BASE 0x00000000U
103 #define AT91RM9200_BOOTMEM_SIZE 0x00100000U
104
105 #define AT91RM9200_ROM_BASE 0x00100000U
106 #define AT91RM9200_ROM_SIZE 0x00100000U
107
108 #define AT91RM9200_SRAM_BASE 0x00200000U
109 #define AT91RM9200_SRAM_SIZE 0x00004000U
110
111 #define AT91RM9200_UHP_BASE 0x00300000U
112 #define AT91RM9200_UHP_SIZE 0x00100000U
113
114 #define AT91RM9200_CS0_BASE 0x10000000U
115 #define AT91RM9200_CS0_SIZE 0x10000000U
116
117 #define AT91RM9200_CS1_BASE 0x20000000U
118 #define AT91RM9200_CS1_SIZE 0x10000000U
119
120 #define AT91RM9200_SDRAM_BASE AT91RM9200_CS1_BASE
121
122 #define AT91RM9200_CS2_BASE 0x30000000U
123 #define AT91RM9200_CS2_SIZE 0x10000000U
124
125 #define AT91RM9200_CS3_BASE 0x40000000U
126 #define AT91RM9200_CS3_SIZE 0x10000000U
127
128 #define AT91RM9200_CS4_BASE 0x50000000U
129 #define AT91RM9200_CS4_SIZE 0x10000000U
130
131 #define AT91RM9200_CS5_BASE 0x60000000U
132 #define AT91RM9200_CS5_SIZE 0x10000000U
133
134 #define AT91RM9200_CS6_BASE 0x70000000U
135 #define AT91RM9200_CS6_SIZE 0x10000000U
136
137 #define AT91RM9200_CS7_BASE 0x80000000U
138 #define AT91RM9200_CS7_SIZE 0x10000000U
139
140 /* Virtual address for I/O space */
141 #define AT91RM9200_APB_VBASE 0xfff00000U
142 #define AT91RM9200_APB_HWBASE 0xfff00000U
143 #define AT91RM9200_APB_SIZE 0x00100000U
144
145 /* Peripherals: */
146 #include <arm/at91/at91pdcreg.h>
147
148 #define AT91RM9200_TC0_BASE 0xFFFA0000U
149 #define AT91RM9200_TC1_BASE 0xFFFA0040U
150 #define AT91RM9200_TC2_BASE 0xFFFA0080U
151 #define AT91RM9200_TCB012_BASE 0xFFFA00C0U
152 #define AT91RM9200_TC3_BASE 0xFFFA4000U
153 #define AT91RM9200_TC4_BASE 0xFFFA4040U
154 #define AT91RM9200_TC5_BASE 0xFFFA4080U
155 #define AT91RM9200_TCB345_BASE 0xFFFA40C0U
156 #define AT91RM9200_TC_SIZE 0x4000U
157 //#include <arm/at91/at91tcreg.h>
158
159 #define AT91RM9200_UDP_BASE 0xFFF80000U
160 #define AT91RM9200_UDP_SIZE 0x4000U
161 //#include <arm/at91/at91udpreg.h>
162
163 #define AT91RM9200_MCI_BASE 0xFFFB4000U
164 #define AT91RM9200_TWI_BASE 0xFFFB8000U
165 #include <arm/at91/at91twireg.h>
166
167 #define AT91RM9200_EMAC_BASE 0xFFFBC000U
168 #define AT91RM9200_EMAC_SIZE 0x4000U
169 #include <arm/at91/at91emacreg.h>
170
171 #define AT91RM9200_USART0_BASE 0xFFFC0000U
172 #define AT91RM9200_USART1_BASE 0xFFFC4000U
173 #define AT91RM9200_USART2_BASE 0xFFFC8000U
174 #define AT91RM9200_USART3_BASE 0xFFFCC000U
175 #define AT91RM9200_USART_SIZE 0x4000U
176 #include <arm/at91/at91usartreg.h>
177
178 #define AT91RM9200_SSC0_BASE 0xFFFD0000U
179 #define AT91RM9200_SSC1_BASE 0xFFFD4000U
180 #define AT91RM9200_SSC2_BASE 0xFFFD8000U
181 #define AT91RM9200_SSC_SIZE 0x4000U
182 //#include <arm/at91/at91sscreg.h>
183
184 #define AT91RM9200_SPI_BASE 0xFFFE0000U
185 #define AT91RM9200_SPI_SIZE 0x4000U
186 #include <arm/at91/at91spireg.h>
187
188 #define AT91RM9200_AIC_BASE 0xFFFFF000U
189 #define AT91RM9200_AIC_SIZE 0x200U
190 #include <arm/at91/at91aicreg.h>
191
192 #define AT91RM9200_DBGU_BASE 0xFFFFF200U
193 #define AT91RM9200_DBGU_SIZE 0x200U
194 #include <arm/at91/at91dbgureg.h>
195
196 #define AT91RM9200_PIOA_BASE 0xFFFFF400U
197 #define AT91RM9200_PIOB_BASE 0xFFFFF600U
198 #define AT91RM9200_PIOC_BASE 0xFFFFF800U
199 #define AT91RM9200_PIOD_BASE 0xFFFFFA00U
200 #define AT91RM9200_PIO_SIZE 0x200U
201 #define AT91_PIO_SIZE AT91RM9200_PIO_SIZE // for generic AT91 code
202 #include <arm/at91/at91pioreg.h>
203
204 #define PIOA_READ(_reg) *((volatile uint32_t *)(AT91RM9200_PIOA_BASE + (_reg)))
205 #define PIOA_WRITE(_reg, _val) do {*((volatile uint32_t *)(AT91RM9200_PIOA_BASE + (_reg))) = (_val);} while (0)
206 #define PIOB_READ(_reg) *((volatile uint32_t *)(AT91RM9200_PIOB_BASE + (_reg)))
207 #define PIOB_WRITE(_reg, _val) do {*((volatile uint32_t *)(AT91RM9200_PIOB_BASE + (_reg))) = (_val);} while (0)
208 #define PIOC_READ(_reg) *((volatile uint32_t *)(AT91RM9200_PIOC_BASE + (_reg)))
209 #define PIOC_WRITE(_reg, _val) do {*((volatile uint32_t *)(AT91RM9200_PIOC_BASE + (_reg))) = (_val);} while (0)
210 #define PIOD_READ(_reg) *((volatile uint32_t *)(AT91RM9200_PIOD_BASE + (_reg)))
211 #define PIOD_WRITE(_reg, _val) do {*((volatile uint32_t *)(AT91RM9200_PIOD_BASE + (_reg))) = (_val);} while (0)
212
213
214 #define AT91RM9200_PMC_BASE 0xFFFFFC00U
215 #define AT91RM9200_PMC_SIZE 0x100U
216 #include <arm/at91/at91pmcreg.h>
217
218 #define AT91RM9200_ST_BASE 0xFFFFFD00U
219 #define AT91RM9200_ST_SIZE 0x100U
220 #include <arm/at91/at91streg.h>
221
222 #define AT91RM9200_RTC_BASE 0xFFFFFE00U
223 #define AT91RM9200_RTC_SIZE 0x100U
224 //#include <arm/at91/at91rtcreg.h>
225
226 // peripheral identifiers:
227 /* peripheral identifiers: */
228 enum {
229 PID_FIQ = 0, /* 0 */
230 PID_SYSIRQ, /* 1 */
231 PID_PIOA, /* 2 */
232 PID_PIOB, /* 3 */
233 PID_PIOC, /* 4 */
234 PID_PIOD, /* 5 */
235 PID_US0, /* 6 */
236 PID_US1, /* 7 */
237 PID_US2, /* 8 */
238 PID_US3, /* 9 */
239 PID_MCI, /* 10 */
240 PID_UDP, /* 11 */
241 PID_TWI, /* 12 */
242 PID_SPI, /* 13 */
243 PID_SSC0, /* 14 */
244 PID_SSC1, /* 15 */
245 PID_SSC2, /* 16 */
246 PID_TC0, /* 17 */
247 PID_TC1, /* 18 */
248 PID_TC2, /* 19 */
249 PID_TC3, /* 20 */
250 PID_TC4, /* 21 */
251 PID_TC5, /* 22 */
252 PID_UHP, /* 23 */
253 PID_EMAC, /* 24 */
254 PID_IRQ0, /* 25 */
255 PID_IRQ1, /* 26 */
256 PID_IRQ2, /* 27 */
257 PID_IRQ3, /* 28 */
258 PID_IRQ4, /* 29 */
259 PID_IRQ5, /* 30 */
260 PID_IRQ6, /* 31 */
261 };
262
263 #endif /* _AT91RM9200REG_H_ */
264