2 * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
4 * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
6 * SPDX-License-Identifier: GPL-2.0+
9 #ifndef __ASM_ARCH_MX35_H
10 #define __ASM_ARCH_MX35_H
17 #define IRAM_BASE_ADDR 0x10000000 /* internal ram */
18 #define IRAM_SIZE 0x00020000 /* 128 KB */
20 #define LOW_LEVEL_SRAM_STACK 0x1001E000
25 #define AIPS1_BASE_ADDR 0x43F00000
26 #define AIPS1_CTRL_BASE_ADDR AIPS1_BASE_ADDR
27 #define MAX_BASE_ADDR 0x43F04000
28 #define EVTMON_BASE_ADDR 0x43F08000
29 #define CLKCTL_BASE_ADDR 0x43F0C000
30 #define I2C1_BASE_ADDR 0x43F80000
31 #define I2C3_BASE_ADDR 0x43F84000
32 #define ATA_BASE_ADDR 0x43F8C000
33 #define UART1_BASE 0x43F90000
34 #define UART2_BASE 0x43F94000
35 #define I2C2_BASE_ADDR 0x43F98000
36 #define CSPI1_BASE_ADDR 0x43FA4000
37 #define IOMUXC_BASE_ADDR 0x43FAC000
42 #define SPBA_BASE_ADDR 0x50000000
43 #define UART3_BASE 0x5000C000
44 #define CSPI2_BASE_ADDR 0x50010000
45 #define ATA_DMA_BASE_ADDR 0x50020000
46 #define FEC_BASE_ADDR 0x50038000
47 #define SPBA_CTRL_BASE_ADDR 0x5003C000
52 #define AIPS2_BASE_ADDR 0x53F00000
53 #define AIPS2_CTRL_BASE_ADDR AIPS2_BASE_ADDR
54 #define CCM_BASE_ADDR 0x53F80000
55 #define GPT1_BASE_ADDR 0x53F90000
56 #define EPIT1_BASE_ADDR 0x53F94000
57 #define EPIT2_BASE_ADDR 0x53F98000
58 #define GPIO3_BASE_ADDR 0x53FA4000
59 #define MMC_SDHC1_BASE_ADDR 0x53FB4000
60 #define MMC_SDHC2_BASE_ADDR 0x53FB8000
61 #define MMC_SDHC3_BASE_ADDR 0x53FBC000
62 #define IPU_CTRL_BASE_ADDR 0x53FC0000
63 #define GPIO1_BASE_ADDR 0x53FCC000
64 #define GPIO2_BASE_ADDR 0x53FD0000
65 #define SDMA_BASE_ADDR 0x53FD4000
66 #define RTC_BASE_ADDR 0x53FD8000
67 #define WDOG1_BASE_ADDR 0x53FDC000
68 #define PWM_BASE_ADDR 0x53FE0000
69 #define RTIC_BASE_ADDR 0x53FEC000
70 #define IIM_BASE_ADDR 0x53FF0000
71 #define IMX_USB_BASE 0x53FF4000
72 #define IMX_USB_PORT_OFFSET 0x400
74 #define IMX_CCM_BASE CCM_BASE_ADDR
79 #define ROMPATCH_BASE_ADDR 0x60000000
80 #define AVIC_BASE_ADDR 0x68000000
83 * NAND, SDRAM, WEIM, M3IF, EMI controllers
85 #define EXT_MEM_CTRL_BASE 0xB8000000
86 #define ESDCTL_BASE_ADDR 0xB8001000
87 #define WEIM_BASE_ADDR 0xB8002000
88 #define WEIM_CTRL_CS0 WEIM_BASE_ADDR
89 #define WEIM_CTRL_CS1 (WEIM_BASE_ADDR + 0x10)
90 #define WEIM_CTRL_CS2 (WEIM_BASE_ADDR + 0x20)
91 #define WEIM_CTRL_CS3 (WEIM_BASE_ADDR + 0x30)
92 #define WEIM_CTRL_CS4 (WEIM_BASE_ADDR + 0x40)
93 #define WEIM_CTRL_CS5 (WEIM_BASE_ADDR + 0x50)
94 #define M3IF_BASE_ADDR 0xB8003000
95 #define EMI_BASE_ADDR 0xB8004000
97 #define NFC_BASE_ADDR 0xBB000000
100 * Memory regions and CS
102 #define IPU_MEM_BASE_ADDR 0x70000000
103 #define CSD0_BASE_ADDR 0x80000000
104 #define CSD1_BASE_ADDR 0x90000000
105 #define CS0_BASE_ADDR 0xA0000000
106 #define CS1_BASE_ADDR 0xA8000000
107 #define CS2_BASE_ADDR 0xB0000000
108 #define CS3_BASE_ADDR 0xB2000000
109 #define CS4_BASE_ADDR 0xB4000000
110 #define CS5_BASE_ADDR 0xB6000000
113 * IRQ Controller Register Definitions.
115 #define AVIC_NIMASK 0x04
116 #define AVIC_INTTYPEH 0x18
117 #define AVIC_INTTYPEL 0x1C
120 #define L2CC_BASE_ADDR 0x30000000
121 #define L2_CACHE_LINE_SIZE 32
122 #define L2_CACHE_CTL_REG 0x100
123 #define L2_CACHE_AUX_CTL_REG 0x104
124 #define L2_CACHE_SYNC_REG 0x730
125 #define L2_CACHE_INV_LINE_REG 0x770
126 #define L2_CACHE_INV_WAY_REG 0x77C
127 #define L2_CACHE_CLEAN_LINE_REG 0x7B0
128 #define L2_CACHE_CLEAN_INV_LINE_REG 0x7F0
129 #define L2_CACHE_DBG_CTL_REG 0xF40
131 #define CLKMODE_AUTO 0
132 #define CLKMODE_CONSUMER 1
134 #define PLL_PD(x) (((x) & 0xf) << 26)
135 #define PLL_MFD(x) (((x) & 0x3ff) << 16)
136 #define PLL_MFI(x) (((x) & 0xf) << 10)
137 #define PLL_MFN(x) (((x) & 0x3ff) << 0)
139 #define _PLL_BRM(x) ((x) << 31)
140 #define _PLL_PD(x) (((x) - 1) << 26)
141 #define _PLL_MFD(x) (((x) - 1) << 16)
142 #define _PLL_MFI(x) ((x) << 10)
143 #define _PLL_MFN(x) (x)
144 #define _PLL_SETTING(brm, pd, mfd, mfi, mfn) \
145 (_PLL_BRM(brm) | _PLL_PD(pd) | _PLL_MFD(mfd) | _PLL_MFI(mfi) |\
148 #define CCM_MPLL_532_HZ _PLL_SETTING(1, 1, 12, 11, 1)
149 #define CCM_MPLL_399_HZ _PLL_SETTING(0, 1, 16, 8, 5)
150 #define CCM_PPLL_300_HZ _PLL_SETTING(0, 1, 4, 6, 1)
152 #define CSCR_U(x) (WEIM_CTRL_CS#x + 0)
153 #define CSCR_L(x) (WEIM_CTRL_CS#x + 4)
154 #define CSCR_A(x) (WEIM_CTRL_CS#x + 8)
156 #define IIM_SREV 0x24
157 #define ROMPATCH_REV 0x40
159 #define IPU_CONF IPU_CTRL_BASE_ADDR
161 #define IPU_CONF_PXL_ENDIAN (1<<8)
162 #define IPU_CONF_DU_EN (1<<7)
163 #define IPU_CONF_DI_EN (1<<6)
164 #define IPU_CONF_ADC_EN (1<<5)
165 #define IPU_CONF_SDC_EN (1<<4)
166 #define IPU_CONF_PF_EN (1<<3)
167 #define IPU_CONF_ROT_EN (1<<2)
168 #define IPU_CONF_IC_EN (1<<1)
169 #define IPU_CONF_CSI_EN (1<<0)
172 * CSPI register definitions
175 #define MXC_CSPICTRL_EN (1 << 0)
176 #define MXC_CSPICTRL_MODE (1 << 1)
177 #define MXC_CSPICTRL_XCH (1 << 2)
178 #define MXC_CSPICTRL_SMC (1 << 3)
179 #define MXC_CSPICTRL_POL (1 << 4)
180 #define MXC_CSPICTRL_PHA (1 << 5)
181 #define MXC_CSPICTRL_SSCTL (1 << 6)
182 #define MXC_CSPICTRL_SSPOL (1 << 7)
183 #define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
184 #define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
185 #define MXC_CSPICTRL_DATARATE(x) (((x) & 0x7) << 16)
186 #define MXC_CSPICTRL_TC (1 << 7)
187 #define MXC_CSPICTRL_RXOVF (1 << 6)
188 #define MXC_CSPICTRL_MAXBITS 0xfff
189 #define MXC_CSPIPERIOD_32KHZ (1 << 15)
190 #define MAX_SPI_BYTES 4
192 #define MXC_SPI_BASE_ADDRESSES \
196 #define GPIO_PORT_NUM 3
197 #define GPIO_NUM_PIN 32
199 #define CHIP_REV_1_0 0x10
200 #define CHIP_REV_2_0 0x20
202 #define BOARD_REV_1_0 0x0
203 #define BOARD_REV_2_0 0x1
205 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
206 #include <asm/types.h>
208 /* Clock Control Module (CCM) registers */
210 u32 ccmr; /* Control */
211 u32 pdr0; /* Post divider 0 */
212 u32 pdr1; /* Post divider 1 */
213 u32 pdr2; /* Post divider 2 */
214 u32 pdr3; /* Post divider 3 */
215 u32 pdr4; /* Post divider 4 */
216 u32 rcsr; /* CCM Status */
217 u32 mpctl; /* Core PLL Control */
218 u32 ppctl; /* Peripheral PLL Control */
219 u32 acmr; /* Audio clock mux */
220 u32 cosr; /* Clock out source */
221 u32 cgr0; /* Clock Gating Control 0 */
222 u32 cgr1; /* Clock Gating Control 1 */
223 u32 cgr2; /* Clock Gating Control 2 */
224 u32 cgr3; /* Clock Gating Control 3 */
226 u32 dcvr0; /* DPTC Comparator 0 */
227 u32 dcvr1; /* DPTC Comparator 0 */
228 u32 dcvr2; /* DPTC Comparator 0 */
229 u32 dcvr3; /* DPTC Comparator 0 */
230 u32 ltr0; /* Load Tracking 0 */
231 u32 ltr1; /* Load Tracking 1 */
232 u32 ltr2; /* Load Tracking 2 */
233 u32 ltr3; /* Load Tracking 3 */
234 u32 ltbr0; /* Load Tracking Buffer 0 */
237 /* IIM control registers */
261 struct fuse_bank0_regs {
267 struct fuse_bank1_regs {
273 /* General Purpose Timer (GPT) registers */
275 u32 ctrl; /* control */
276 u32 pre; /* prescaler */
277 u32 stat; /* status */
278 u32 intr; /* interrupt */
279 u32 cmp[3]; /* output compare 1-3 */
280 u32 capt[2]; /* input capture 1-2 */
281 u32 counter; /* counter */
307 #define ESDC_MISC_RST (1 << 1)
308 #define ESDC_MISC_MDDR_EN (1 << 2)
309 #define ESDC_MISC_MDDR_DL_RST (1 << 3)
310 #define ESDC_MISC_DDR_EN (1 << 8)
311 #define ESDC_MISC_DDR2_EN (1 << 9)
313 /* Multi-Layer AHB Crossbar Switch (MAX) registers */
348 /* AHB <-> IP-Bus Interface (AIPS) */
366 * NFMS bit in RCSR register for pagesize of nandflash
369 #define NFMS_NF_DWIDTH 14
370 #define NFMS_NF_PG_SZ 8
372 #define CCM_RCSR_NF_16BIT_SEL (1 << 14)
377 * Generic timer support
379 #ifdef CONFIG_MX35_CLK32
380 #define CONFIG_SYS_TIMER_RATE CONFIG_MX35_CLK32
382 #define CONFIG_SYS_TIMER_RATE 32768
385 #define CONFIG_SYS_TIMER_COUNTER (GPT1_BASE_ADDR+36)
387 #endif /* __ASM_ARCH_MX35_H */