blob: 3e07d3da104d17b61bac2de80790b92f18ccc886 [file] [log] [blame]
Sascha Hauerc0a5f852009-02-02 14:11:54 +01001/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_MX31_H__
12#define __ASM_ARCH_MXC_MX31_H__
13
Sascha Hauerc0a5f852009-02-02 14:11:54 +010014/*
15 * MX31 memory map:
16 *
17 * Virt Phys Size What
18 * ---------------------------------------------------------------------------
19 * FC000000 43F00000 1M AIPS 1
20 * FC100000 50000000 1M SPBA
21 * FC200000 53F00000 1M AIPS 2
22 * FC500000 60000000 128M ROMPATCH
23 * FC400000 68000000 128M AVIC
24 * 70000000 256M IPU (MAX M2)
25 * 80000000 256M CSD0 SDRAM/DDR
26 * 90000000 256M CSD1 SDRAM/DDR
27 * A0000000 128M CS0 Flash
28 * A8000000 128M CS1 Flash
29 * B0000000 32M CS2
30 * B2000000 32M CS3
31 * F4000000 B4000000 32M CS4
32 * B6000000 32M CS5
33 * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers
34 * C0000000 64M PCMCIA/CF
35 */
36
Sascha Hauerc0a5f852009-02-02 14:11:54 +010037/*
38 * L2CC
39 */
40#define L2CC_BASE_ADDR 0x30000000
41#define L2CC_SIZE SZ_1M
42
43/*
44 * AIPS 1
45 */
46#define AIPS1_BASE_ADDR 0x43F00000
47#define AIPS1_BASE_ADDR_VIRT 0xFC000000
48#define AIPS1_SIZE SZ_1M
49
50#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000)
51#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000)
52#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000)
53#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000)
54#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000)
55#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000)
56#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
57#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
58#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
59#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
60#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
61#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
62#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
63#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
64#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
65#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
66#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
67#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
68
69/*
70 * SPBA global module enabled #0
71 */
72#define SPBA0_BASE_ADDR 0x50000000
73#define SPBA0_BASE_ADDR_VIRT 0xFC100000
74#define SPBA0_SIZE SZ_1M
75
76#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
77#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
78#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
79#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
80#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
81#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
82
83/*
84 * AIPS 2
85 */
86#define AIPS2_BASE_ADDR 0x53F00000
87#define AIPS2_BASE_ADDR_VIRT 0xFC200000
88#define AIPS2_SIZE SZ_1M
Uwe Kleine-Könige6767562009-11-10 10:20:30 +010089
Sascha Hauerc0a5f852009-02-02 14:11:54 +010090#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
91#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
92#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
93#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
94#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
95#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
96#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
97#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
98#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
99#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
100#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
101#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000)
102#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
103#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
104#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
105#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
106
107/*
108 * ROMP and AVIC
109 */
110#define ROMP_BASE_ADDR 0x60000000
111#define ROMP_BASE_ADDR_VIRT 0xFC500000
112#define ROMP_SIZE SZ_1M
113
114#define AVIC_BASE_ADDR 0x68000000
115#define AVIC_BASE_ADDR_VIRT 0xFC400000
116#define AVIC_SIZE SZ_1M
117
118/*
Uwe Kleine-Könige6767562009-11-10 10:20:30 +0100119 * Memory regions and CS
120 */
121#define IPU_MEM_BASE_ADDR 0x70000000
122#define CSD0_BASE_ADDR 0x80000000
123#define CSD1_BASE_ADDR 0x90000000
124
125#define CS0_BASE_ADDR 0xA0000000
126#define CS1_BASE_ADDR 0xA8000000
127#define CS2_BASE_ADDR 0xB0000000
128#define CS3_BASE_ADDR 0xB2000000
129
130#define CS4_BASE_ADDR 0xB4000000
131#define CS4_BASE_ADDR_VIRT 0xF4000000
132#define CS4_SIZE SZ_32M
133
134#define CS5_BASE_ADDR 0xB6000000
135#define CS5_BASE_ADDR_VIRT 0xF6000000
136#define CS5_SIZE SZ_32M
137
138
139/*
Sascha Hauerc0a5f852009-02-02 14:11:54 +0100140 * NAND, SDRAM, WEIM, M3IF, EMI controllers
141 */
142#define X_MEMC_BASE_ADDR 0xB8000000
143#define X_MEMC_BASE_ADDR_VIRT 0xFC320000
144#define X_MEMC_SIZE SZ_64K
145
146#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
147#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
148#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
149#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
150#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR
151
Uwe Kleine-Könige6767562009-11-10 10:20:30 +0100152#define PCMCIA_MEM_BASE_ADDR 0xBC000000
Sascha Hauerc0a5f852009-02-02 14:11:54 +0100153
154/*!
155 * This macro defines the physical to virtual address mapping for all the
156 * peripheral modules. It is used by passing in the physical address as x
157 * and returning the virtual address. If the physical address is not mapped,
158 * it returns 0xDEADBEEF
159 */
160#define IO_ADDRESS(x) \
Sascha Hauercc83e402009-02-19 12:48:35 +0100161 (void __force __iomem *) \
Sascha Hauerc0a5f852009-02-02 14:11:54 +0100162 (((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\
163 ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\
164 ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\
165 ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\
166 ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\
167 ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\
168 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\
169 0xDEADBEEF)
170
171/*
172 * define the address mapping macros: in physical address order
173 */
174#define L2CC_IO_ADDRESS(x) \
175 (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT)
176
177#define AIPS1_IO_ADDRESS(x) \
178 (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT)
179
180#define SPBA0_IO_ADDRESS(x) \
181 (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT)
182
183#define AIPS2_IO_ADDRESS(x) \
184 (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT)
185
186#define ROMP_IO_ADDRESS(x) \
187 (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT)
188
189#define AVIC_IO_ADDRESS(x) \
190 (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT)
191
192#define CS4_IO_ADDRESS(x) \
193 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
194
Magnus Lilja135cad32009-05-17 20:18:08 +0200195#define CS5_IO_ADDRESS(x) \
196 (((x) - CS5_BASE_ADDR) + CS5_BASE_ADDR_VIRT)
197
Sascha Hauerc0a5f852009-02-02 14:11:54 +0100198#define X_MEMC_IO_ADDRESS(x) \
199 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
200
201#define PCMCIA_IO_ADDRESS(x) \
202 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
203
204/*
205 * Interrupt numbers
206 */
207#define MXC_INT_I2C3 3
208#define MXC_INT_I2C2 4
209#define MXC_INT_RTIC 6
210#define MXC_INT_I2C 10
211#define MXC_INT_CSPI2 13
212#define MXC_INT_CSPI1 14
213#define MXC_INT_ATA 15
214#define MXC_INT_UART3 18
215#define MXC_INT_IIM 19
216#define MXC_INT_RNGA 22
217#define MXC_INT_EVTMON 23
218#define MXC_INT_KPP 24
219#define MXC_INT_RTC 25
220#define MXC_INT_PWM 26
221#define MXC_INT_EPIT2 27
222#define MXC_INT_EPIT1 28
223#define MXC_INT_GPT 29
224#define MXC_INT_POWER_FAIL 30
225#define MXC_INT_UART2 32
226#define MXC_INT_NANDFC 33
227#define MXC_INT_SDMA 34
228#define MXC_INT_MSHC1 39
229#define MXC_INT_IPU_ERR 41
230#define MXC_INT_IPU_SYN 42
231#define MXC_INT_UART1 45
232#define MXC_INT_ECT 48
233#define MXC_INT_SCC_SCM 49
234#define MXC_INT_SCC_SMN 50
235#define MXC_INT_GPIO2 51
236#define MXC_INT_GPIO1 52
237#define MXC_INT_WDOG 55
238#define MXC_INT_GPIO3 56
239#define MXC_INT_EXT_POWER 58
240#define MXC_INT_EXT_TEMPER 59
241#define MXC_INT_EXT_SENSOR60 60
242#define MXC_INT_EXT_SENSOR61 61
243#define MXC_INT_EXT_WDOG 62
244#define MXC_INT_EXT_TV 63
245
246#define PROD_SIGNATURE 0x1 /* For MX31 */
247
248/* silicon revisions specific to i.MX31 */
249#define CHIP_REV_1_0 0x10
250#define CHIP_REV_1_1 0x11
251#define CHIP_REV_1_2 0x12
252#define CHIP_REV_1_3 0x13
253#define CHIP_REV_2_0 0x20
254#define CHIP_REV_2_1 0x21
255#define CHIP_REV_2_2 0x22
256#define CHIP_REV_2_3 0x23
257#define CHIP_REV_3_0 0x30
258#define CHIP_REV_3_1 0x31
259#define CHIP_REV_3_2 0x32
260
261#define SYSTEM_REV_MIN CHIP_REV_1_0
262#define SYSTEM_REV_NUM 3
263
Sascha Hauerc0a5f852009-02-02 14:11:54 +0100264/* Mandatory defines used globally */
265
Sascha Hauerc0a5f852009-02-02 14:11:54 +0100266#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
267
268extern unsigned int system_rev;
269
270static inline int mx31_revision(void)
271{
272 return system_rev;
273}
274#endif
275
276#endif /* __ASM_ARCH_MXC_MX31_H__ */