2 * (C) Copyright 2009 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __ASM_ARCH_MX5_IMX_REGS_H__
8 #define __ASM_ARCH_MX5_IMX_REGS_H__
12 #if defined(CONFIG_MX51)
13 #define IRAM_BASE_ADDR 0x1FFE0000 /* internal ram */
14 #define IPU_SOC_BASE_ADDR 0x40000000
15 #define IPU_SOC_OFFSET 0x1E000000
16 #define SPBA0_BASE_ADDR 0x70000000
17 #define AIPS1_BASE_ADDR 0x73F00000
18 #define AIPS2_BASE_ADDR 0x83F00000
19 #define CSD0_BASE_ADDR 0x90000000
20 #define CSD1_BASE_ADDR 0xA0000000
21 #define NFC_BASE_ADDR_AXI 0xCFFF0000
22 #define CS1_BASE_ADDR 0xB8000000
23 #elif defined(CONFIG_MX53)
24 #define IPU_SOC_BASE_ADDR 0x18000000
25 #define IPU_SOC_OFFSET 0x06000000
26 #define SPBA0_BASE_ADDR 0x50000000
27 #define AIPS1_BASE_ADDR 0x53F00000
28 #define AIPS2_BASE_ADDR 0x63F00000
29 #define CSD0_BASE_ADDR 0x70000000
30 #define CSD1_BASE_ADDR 0xB0000000
31 #define NFC_BASE_ADDR_AXI 0xF7FF0000
32 #define IRAM_BASE_ADDR 0xF8000000
33 #define CS1_BASE_ADDR 0xF4000000
34 #define SATA_BASE_ADDR 0x10000000
36 #error "CPU_TYPE not defined"
39 #define IRAM_SIZE 0x00020000 /* 128 KB */
42 * SPBA global module enabled #0
44 #define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000)
45 #define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000)
46 #define UART3_BASE (SPBA0_BASE_ADDR + 0x0000C000)
47 #define CSPI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
48 #define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
49 #define MMC_SDHC3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
50 #define MMC_SDHC4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
51 #define SPDIF_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000)
52 #define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000)
53 #define SLIM_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000)
54 #define HSI2C_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000)
55 #define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
60 #define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
61 #define GPIO1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
62 #define GPIO2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
63 #define GPIO3_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
64 #define GPIO4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
65 #define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
66 #define WDOG1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
67 #define WDOG2_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
68 #define GPT1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
69 #define SRTC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
70 #define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
71 #define EPIT1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
72 #define EPIT2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
73 #define PWM1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
74 #define PWM2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
75 #define UART1_BASE (AIPS1_BASE_ADDR + 0x000BC000)
76 #define UART2_BASE (AIPS1_BASE_ADDR + 0x000C0000)
77 #define SRC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D0000)
78 #define CCM_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D4000)
79 #define GPC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D8000)
81 #if defined(CONFIG_MX53)
82 #define GPIO5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000DC000)
83 #define GPIO6_BASE_ADDR (AIPS1_BASE_ADDR + 0x000E0000)
84 #define GPIO7_BASE_ADDR (AIPS1_BASE_ADDR + 0x000E4000)
85 #define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x000EC000)
86 #define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000F0000)
91 #define PLL1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
92 #define PLL2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000)
93 #define PLL3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000)
95 #define PLL4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008c000)
97 #define AHBMAX_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
98 #define IIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
99 #define CSU_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000)
100 #define ARM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000)
101 #define OWIRE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
102 #define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000)
103 #define CSPI2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
104 #define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
105 #define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000)
106 #define ROMCP_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000)
107 #define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000)
108 #define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
109 #define I2C2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
110 #define I2C1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000)
111 #define SSI1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
112 #define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
113 #define M4IF_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
114 #define ESDCTL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D9000)
115 #define WEIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DA000)
116 #define NFC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DB000)
117 #define EMI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DBF00)
118 #define MIPI_HSC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
119 #define ATA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
120 #define SIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E4000)
121 #define SSI3BASE_ADDR (AIPS2_BASE_ADDR + 0x000E8000)
122 #define FEC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
123 #define TVE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F0000)
124 #define VPU_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F4000)
125 #define SAHARA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000)
127 #if defined(CONFIG_MX53)
128 #define UART5_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
141 #define CREP (1 << 7)
142 #define BL(x) (((x) & 0x7) << 8)
144 #define BCD(x) (((x) & 0x3) << 12)
145 #define BCS(x) (((x) & 0x3) << 14)
146 #define DSZ(x) (((x) & 0x7) << 16)
148 #define CSREC(x) (((x) & 0x7) << 20)
149 #define AUS (1 << 23)
150 #define GBC(x) (((x) & 0x7) << 24)
152 #define PSZ(x) (((x) & 0x0f << 28)
157 #define ADH(x) (((x) & 0x3))
158 #define DAPS(x) (((x) & 0x0f << 4)
161 #define MUX16_BYP (1 << 12)
166 #define RCSN(x) (((x) & 0x7))
167 #define RCSA(x) (((x) & 0x7) << 4)
168 #define OEN(x) (((x) & 0x7) << 8)
169 #define OEA(x) (((x) & 0x7) << 12)
170 #define RADVN(x) (((x) & 0x7) << 16)
171 #define RAL (1 << 19)
172 #define RADVA(x) (((x) & 0x7) << 20)
173 #define RWSC(x) (((x) & 0x3f) << 24)
178 #define RBEN(x) (((x) & 0x7))
180 #define RBEA(x) (((x) & 0x7) << 4)
181 #define RL(x) (((x) & 0x3) << 8)
182 #define PAT(x) (((x) & 0x7) << 12)
183 #define APR (1 << 15)
188 #define WCSN(x) (((x) & 0x7))
189 #define WCSA(x) (((x) & 0x7) << 3)
190 #define WEN(x) (((x) & 0x7) << 6)
191 #define WEA(x) (((x) & 0x7) << 9)
192 #define WBEN(x) (((x) & 0x7) << 12)
193 #define WBEA(x) (((x) & 0x7) << 15)
194 #define WADVN(x) (((x) & 0x7) << 18)
195 #define WADVA(x) (((x) & 0x7) << 21)
196 #define WWSC(x) (((x) & 0x3f) << 24)
197 #define WBED1 (1 << 30)
198 #define WAL (1 << 31)
206 * CSPI register definitions
209 #define MXC_CSPICTRL_EN (1 << 0)
210 #define MXC_CSPICTRL_MODE (1 << 1)
211 #define MXC_CSPICTRL_XCH (1 << 2)
212 #define MXC_CSPICTRL_MODE_MASK (0xf << 4)
213 #define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
214 #define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
215 #define MXC_CSPICTRL_PREDIV(x) (((x) & 0xF) << 12)
216 #define MXC_CSPICTRL_POSTDIV(x) (((x) & 0xF) << 8)
217 #define MXC_CSPICTRL_SELCHAN(x) (((x) & 0x3) << 18)
218 #define MXC_CSPICTRL_MAXBITS 0xfff
219 #define MXC_CSPICTRL_TC (1 << 7)
220 #define MXC_CSPICTRL_RXOVF (1 << 6)
221 #define MXC_CSPIPERIOD_32KHZ (1 << 15)
222 #define MAX_SPI_BYTES 32
224 /* Bit position inside CTRL register to be associated with SS */
225 #define MXC_CSPICTRL_CHAN 18
227 /* Bit position inside CON register to be associated with SS */
228 #define MXC_CSPICON_PHA 0 /* SCLK phase control */
229 #define MXC_CSPICON_POL 4 /* SCLK polarity */
230 #define MXC_CSPICON_SSPOL 12 /* SS polarity */
231 #define MXC_CSPICON_CTL 20 /* inactive state of SCLK */
232 #define MXC_SPI_BASE_ADDRESSES \
238 * Number of GPIO pins per port
240 #define GPIO_NUM_PIN 32
242 #define IIM_SREV 0x24
243 #define ROM_SI_REV 0x48
245 #define NFC_BUF_SIZE 0x1000
248 #define M4IF_FBPM0 0x40
249 #define M4IF_FIDBP 0x48
250 #define M4IF_GENP_WEIM_MM_MASK 0x00000001
251 #define WEIM_GCR2_MUX16_BYP_GRANT_MASK 0x00001000
253 /* Assuming 24MHz input clock with doubler ON */
255 #define DP_OP_864 ((8 << 4) + ((1 - 1) << 0))
256 #define DP_MFD_864 (180 - 1) /* PL Dither mode */
257 #define DP_MFN_864 180
258 #define DP_MFN_800_DIT 60 /* PL Dither mode */
260 #define DP_OP_850 ((8 << 4) + ((1 - 1) << 0))
261 #define DP_MFD_850 (48 - 1)
262 #define DP_MFN_850 41
264 #define DP_OP_800 ((8 << 4) + ((1 - 1) << 0))
265 #define DP_MFD_800 (3 - 1)
268 #define DP_OP_700 ((7 << 4) + ((1 - 1) << 0))
269 #define DP_MFD_700 (24 - 1)
272 #define DP_OP_665 ((6 << 4) + ((1 - 1) << 0))
273 #define DP_MFD_665 (96 - 1)
274 #define DP_MFN_665 89
276 #define DP_OP_532 ((5 << 4) + ((1 - 1) << 0))
277 #define DP_MFD_532 (24 - 1)
278 #define DP_MFN_532 13
280 #define DP_OP_400 ((8 << 4) + ((2 - 1) << 0))
281 #define DP_MFD_400 (3 - 1)
284 #define DP_OP_455 ((9 << 4) + ((2 - 1) << 0))
285 #define DP_MFD_455 (48 - 1)
286 #define DP_MFN_455 23
288 #define DP_OP_216 ((6 << 4) + ((3 - 1) << 0))
289 #define DP_MFD_216 (4 - 1)
292 #define IMX_IIM_BASE (IIM_BASE_ADDR)
294 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
295 #include <asm/types.h>
297 #define __REG(x) (*((volatile u32 *)(x)))
298 #define __REG16(x) (*((volatile u16 *)(x)))
299 #define __REG8(x) (*((volatile u8 *)(x)))
335 #if defined(CONFIG_MX53)
399 #if defined(CONFIG_MX51)
408 #elif defined(CONFIG_MX53)
419 /* System Reset Controller (SRC) */
430 u32 lpscmr; /* 0x00 */
431 u32 lpsclr; /* 0x04 */
432 u32 lpsar; /* 0x08 */
433 u32 lpsmcr; /* 0x0c */
436 u32 lppdr; /* 0x18 */
438 u32 hpcmr; /* 0x20 */
439 u32 hpclr; /* 0x24 */
440 u32 hpamr; /* 0x28 */
441 u32 hpalr; /* 0x2c */
443 u32 hpisr; /* 0x34 */
444 u32 hpienr; /* 0x38 */
479 #if defined(CONFIG_MX51)
481 #elif defined(CONFIG_MX53)
486 struct fuse_bank0_regs {
490 #if defined(CONFIG_MX51)
492 #elif defined(CONFIG_MX53)
497 struct fuse_bank1_regs {
503 #if defined(CONFIG_MX53)
504 struct fuse_bank4_regs {
511 #endif /* __ASSEMBLER__*/
513 #endif /* __ASM_ARCH_MX5_IMX_REGS_H__ */