imx51reg.h revision 1.1.2.2 1 /* $NetBSD: imx51reg.h,v 1.1.2.2 2010/11/15 14:38:22 uebayasi Exp $ */
2 /*-
3 * Copyright (c) 2007 The NetBSD Foundation, Inc.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef _ARM_IMX_IMX51REG_H_
32 #define _ARM_IMX_IMX51REG_H_
33
34 #define BOOTROM_BASE 0x00000000
35 #define BOOTROM_SIZE 0x9000
36
37 #define SCCRAM_BASE 0x1ffe0000
38 #define SCCRAM_SIZE 0x20000
39
40 #define GPUMEM_BASE 0x20000000
41 #define GPUMEM_SIZE 0x20000
42
43 #define GPU_BASE 0x30000000
44 #define GPU_SIZE 0x10000000
45
46 /* LCD controller */
47 #define IPUEX_BASE 0x40000000
48 #define IPUEX_SIZE 0x20000000
49
50 #define DEBUGROM_BASE 0x60000000
51 #define DEBUGROM_SIZE 0x1000
52
53 #define ESDHC1_BASE 0x70004000
54 #define ESDHC2_BASE 0x70008000
55 #define ESDHC3_BASE 0x70020000
56 #define ESDHC4_BASE 0x70024000
57 #define ESDHC_SIZE 0x4000
58
59 #define UART1_BASE 0x73fbc000
60 #define UART2_BASE 0x73fc0000
61 #define UART3_BASE 0x7000c000
62 /* register definitions in imxuartreg.h */
63
64 #define ECSPI1_BASE 0x70010000
65 #define ECSPI2_BASE 0x83fac000
66 #define ECSPI_SIZE 0x4000
67
68 #define SSI1_BASE 0x83fcc000
69 #define SSI2_BASE 0x70014000
70 #define SSI3_BASE 0x83fe8000
71 /* register definitions in imxssireg.h */
72
73 #define SPDIF_BASE 0x70028000
74 #define SPDIF_SIZE 0x4000
75
76 #define PATA_UDMA_BASE 0x70030000
77 #define PATA_UDMA_SIZE 0x4000
78 #define PATA_PIO_BASE 0x83fe0000
79 #define PATA_PIO_SIZE 0x4000
80
81 #define SLM_BASE 0x70034000
82 #define SLM_SIZE 0x4000
83
84 #define HSI2C_BASE 0x70038000
85 #define HSI2C_SIZE 0x4000
86
87 #define SPBA_BASE 0x7003c000
88 #define SPBA_SIZE 0x4000
89
90 #define USBOH3_BASE 0x73f80000
91 #define USBOH3_PL301_BASE 0x73fc4000
92 #define USB_OTG_BASE 0x43F88000
93 #define USB_EHCI1_BASE 0x43F88200
94 #define USB_EHCI2_BASE 0x43F88400
95 #define USB_EHCI_SIZE 0x0200
96 #define USB_CONTROL 0x43F88600
97
98
99 /* GPIO module */
100
101 #define GPIO_BASE(n) (0x73f84000 + 0x4000 * ((n)-1))
102
103 #define GPIO1_BASE GPIO_BASE(1)
104 #define GPIO2_BASE GPIO_BASE(2)
105 #define GPIO3_BASE GPIO_BASE(3)
106 #define GPIO4_BASE GPIO_BASE(4)
107
108 #define GPIO_NPINS 32
109 #define GPIO_NGROUPS 3
110
111 #define KPP_BASE 0x73f94000
112 /* register definitions in imxkppreg.h */
113
114 #define WDOG1_BASE 0x73f98000
115 #define WDOG2_BASE 0x73f9c000
116 #define WDOG_SIZE 0x4000
117
118 #define GPT_BASE 0x73fa0000
119 #define GPT_SIZE 0x4000
120
121 #define SRTC_BASE 0x73fa4000
122 #define SRTC_SIZE 0x4000
123
124 /* IO multiplexor */
125 #define IOMUXC_BASE 0x73fa8000
126 #define IOMUXC_SIZE 0x4000
127
128 #define IOMUXC_MUX_CTL 0x001c /* multiprex control */
129 #define IOMUX_CONFIG_ALT0 (0)
130 #define IOMUX_CONFIG_ALT1 (1)
131 #define IOMUX_CONFIG_ALT2 (2)
132 #define IOMUX_CONFIG_ALT3 (3)
133 #define IOMUX_CONFIG_ALT4 (4)
134 #define IOMUX_CONFIG_ALT5 (5)
135 #define IOMUX_CONFIG_ALT6 (6)
136 #define IOMUX_CONFIG_ALT7 (7)
137 #define IOMUXC_PAD_CTL 0x03f0 /* pad control */
138 #define PAD_CTL_HYS_NONE (0x0 << 8)
139 #define PAD_CTL_HYS_ENABLE (0x1 << 8)
140 #define PAD_CTL_PKE_NONE (0x0 << 7)
141 #define PAD_CTL_PKE_ENABLE (0x1 << 7)
142 #define PAD_CTL_PUE_KEEPER (0x0 << 6)
143 #define PAD_CTL_PUE_PULL (0x1 << 6)
144 #define PAD_CTL_PUS_100K_PD (0x0 << 4)
145 #define PAD_CTL_PUS_47K_PU (0x1 << 4)
146 #define PAD_CTL_PUS_100K_PU (0x2 << 4)
147 #define PAD_CTL_PUS_22K_PU (0x3 << 4)
148 #define PAD_CTL_ODE_CMOS (0x0 << 3)
149 #define PAD_CTL_ODE_OpenDrain (0x1 << 3)
150 #define PAD_CTL_DSE_LOW (0x0 << 1)
151 #define PAD_CTL_DSE_MID (0x1 << 1)
152 #define PAD_CTL_DSE_HIGH (0x2 << 1)
153 #define PAD_CTL_DSE_MAX (0x3 << 1)
154 #define PAD_CTL_SRE_SLOW (0x0 << 0)
155 #define PAD_CTL_SRE_FAST (0x1 << 0)
156 #define IOMUXC_INPUT_CTL 0x08c4 /* input control */
157 #define INPUT_DAISY_0 0
158 #define INPUT_DAISY_1 1
159 #define INPUT_DAISY_2 2
160 #define INPUT_DAISY_3 3
161 #define INPUT_DAISY_4 4
162 #define INPUT_DAISY_5 5
163 #define INPUT_DAISY_6 6
164 #define INPUT_DAISY_7 7
165
166 /*
167 * IOMUX index
168 */
169 #define IOMUX_PIN_TO_MUX_ADDRESS(pin) (((pin) >> 16) & 0xffff)
170 #define IOMUX_PIN_TO_PAD_ADDRESS(pin) (((pin) >> 0) & 0xffff)
171
172 #define IOMUX_PIN(mux_adr, pad_adr) \
173 (((mux_adr) << 16) | (((pad_adr) << 0)))
174 #define IOMUX_MUX_NONE 0xffff
175 #define IOMUX_PAD_NONE 0xffff
176
177 /* EPIT */
178 #define EPIT1_BASE 0x73FAC000
179 #define EPIT2_BASE 0x73FB0000
180 /* register definitions in imxepitreg.h */
181
182 #define PWM1_BASE 0x73fb4000
183 #define PWM2_BASE 0x73fb8000
184 #define PWM_SIZE 0x4000
185
186 #define SRC_BASE 0x73fd0000
187 #define SRC_SIZE 0x4000
188
189 #define CCM_BASE 0x73fd4000
190 #define CCM_SIZE 0x4000
191
192 #define GPC_BASE 0x73fd8000
193 #define GPC_SIZE 0x4000
194
195 #define DPLLIP1_BASE 0x83f80000
196 #define DPLLIP2_BASE 0x83f84000
197 #define DPLLIP3_BASE 0x83f88000
198 #define DPLLIP_SIZE 0x4000
199
200 #define AHBMAX_BASE 0x83f94000
201 #define AHBMAX_SIZE 0x4000
202
203 #define IIM_BASE 0x83f98000
204 #define IIM_SIZE 0x4000
205
206 #define CSU_BASE 0x83f9c000
207 #define CSU_SIZE 0x4000
208
209 #define OWIRE_BASE 0x83fa4000 /* 1-wire */
210 #define OWIRE_SIZE 0x4000
211
212 #define FIRI_BASE 0x83fa8000
213 #define FIRI_SIZE 0x4000
214
215
216 #define SDMA_BASE 0x83fb0000
217 #define SDMA_SIZE 0x4000
218 /* see imxsdmareg.h for register definitions */
219
220 #define SCC_BASE 0x83fb4000
221 #define SCC_SIZE 0x4000
222
223 #define ROMCP_BASE 0x83fb8000
224 #define ROMCP_SIZE 0x4000
225
226 #define RTIC_BASE 0x83fbc000
227 #define RTIC_SIZE 0x4000
228
229 #define CSPI_BASE 0x83fc0000
230 #define CSPI_SIZE 0x4000
231
232 #define I2C1_BASE 0x83fc8000
233 #define I2C2_BASE 0x83fc4000
234 /* register definitions in imxi2creg.h */
235
236 #define AUDMUX_BASE 0x83fd0000
237 #define AUDMUX_SIZE 0x4000
238 #define AUDMUX_PTCR(n) ((n - 1) * 0x8)
239 #define PTCR_TFSDIR (1 << 31)
240 #define PTCR_TFSEL(x) (((x) & 0x7) << 27)
241 #define PTCR_TCLKDIR (1 << 26)
242 #define PTCR_TCSEL(x) (((x) & 0x7) << 22)
243 #define PTCR_RFSDIR (1 << 21)
244 #define PTCR_RFSEL(x) (((x) & 0x7) << 17)
245 #define PTCR_RCLKDIR (1 << 16)
246 #define PTCR_RCSEL(x) (((x) & 0x7) << 12)
247 #define PTCR_SYN (1 << 11)
248
249 #define AUDMUX_PDCR(n) ((n - 1) * 0x8 + 0x4)
250 #define PDCR_RXDSEL(x) (((x) & 0x7) << 13)
251 #define PDCR_TXRXEN (1 << 12)
252 #define PDCR_MODE(x) (((x) & 0x3) << 8)
253 #define PDCR_INMMASK(x) (((x) & 0xff) << 0)
254 #define AUDMUX_CNMCR 0x38
255
256 #define EMI_BASE 0x83fd8000
257 #define EMI_SIZE 0x4000
258
259 #define SIM_BASE 0x83fe4000
260 #define SIM_SIZE 0x4000
261
262 #define FEC_BASE 0x83fec000
263 #define FEC_SIZE 0x4000
264 #define TVE_BASE 0x83ff0000
265 #define TVE_SIZE 0x4000
266 #define VPU_BASE 0x83ff4000
267 #define VPU_SIZE 0x4000
268 #define SAHARA_BASE 0x83ff8000
269 #define SAHARA_SIZE 0x4000
270
271 #define CSD0DDR_BASE 0x90000000
272 #define CSD1DDR_BASE 0xa0000000
273 #define CSDDDR_SIZE 0x10000000 /* 256MiB */
274 #define CS0_BASE 0xb0000000
275 #define CS0_SIZE 0x08000000 /* 128MiB */
276 #define CS1_BASE 0xb8000000
277 #define CS1_SIZE 0x08000000 /* 128MiB */
278 #define CS2_BASE 0xc0000000
279 #define CS2_SIZE 0x08000000 /* 128MiB */
280 #define CS3_BASE 0xc8000000
281 #define CS3_SIZE 0x04000000 /* 64MiB */
282 #define CS4_BASE 0xcc000000
283 #define CS4_SIZE 0x02000000 /* 32MiB */
284 #define CS5_BASE 0xcefe0000
285 #define CS5_SIZE 0x00010000 /* 32MiB */
286 #define NAND_FLASH_BASE 0xcfff0000 /* internal buffer */
287 #define NAND_FLASH_SIZE 0x00010000
288
289 #define GPU2D_BASE 0xd0000000
290 #define GPU2D_SIZE 0x10000000
291
292 #define TZIC_BASE 0xe0000000
293 /* register definitions in imx51_tzicreg.h */
294
295 #endif /* _ARM_IMX_IMX51REG_H_ */
296