i.MX27: Add some missing device base addresses
[barebox-mini2440.git] / arch / arm / mach-imx / include / mach / imx27-regs.h
blob8d0bcda7260287899330a8e70299174b8ed7f1fc
1 #ifndef _IMX27_REGS_H
2 #define _IMX27_REGS_H
4 #ifndef _IMX_REGS_H
5 #error "Please do not include directly"
6 #endif
8 #define IMX_IO_BASE 0x10000000
10 #define IMX_AIPI1_BASE (0x00000 + IMX_IO_BASE)
11 #define IMX_WDT_BASE (0x02000 + IMX_IO_BASE)
12 #define IMX_TIM1_BASE (0x03000 + IMX_IO_BASE)
13 #define IMX_TIM2_BASE (0x04000 + IMX_IO_BASE)
14 #define IMX_TIM3_BASE (0x05000 + IMX_IO_BASE)
15 #define IMX_UART1_BASE (0x0a000 + IMX_IO_BASE)
16 #define IMX_UART2_BASE (0x0b000 + IMX_IO_BASE)
17 #define IMX_UART3_BASE (0x0c000 + IMX_IO_BASE)
18 #define IMX_UART4_BASE (0x0d000 + IMX_IO_BASE)
19 #define IMX_SPI1_BASE (0x0e000 + IMX_IO_BASE)
20 #define IMX_I2C1_BASE (0x12000 + IMX_IO_BASE)
21 #define IMX_GPIO_BASE (0x15000 + IMX_IO_BASE)
22 #define IMX_TIM4_BASE (0x19000 + IMX_IO_BASE)
23 #define IMX_TIM5_BASE (0x1a000 + IMX_IO_BASE)
24 #define IMX_UART5_BASE (0x1b000 + IMX_IO_BASE)
25 #define IMX_UART6_BASE (0x1c000 + IMX_IO_BASE)
26 #define IMX_I2C2_BASE (0x1d000 + IMX_IO_BASE)
27 #define IMX_TIM6_BASE (0x1f000 + IMX_IO_BASE)
28 #define IMX_AIPI2_BASE (0x20000 + IMX_IO_BASE)
29 #define IMX_FB_BASE (0x21000 + IMX_IO_BASE)
30 #define IMX_PLL_BASE (0x27000 + IMX_IO_BASE)
31 #define IMX_SYSTEM_CTL_BASE (0x27800 + IMX_IO_BASE)
32 #define IMX_OTG_BASE (0x24000 + IMX_IO_BASE)
33 #define IMX_FEC_BASE (0x2b000 + IMX_IO_BASE)
35 #define IMX_NFC_BASE (0xd8000000)
36 #define IMX_ESD_BASE (0xd8001000)
37 #define IMX_WEIM_BASE (0xd8002000)
39 /* AIPI */
40 #define AIPI1_PSR0 __REG(IMX_AIPI1_BASE + 0x00)
41 #define AIPI1_PSR1 __REG(IMX_AIPI1_BASE + 0x04)
42 #define AIPI2_PSR0 __REG(IMX_AIPI2_BASE + 0x00)
43 #define AIPI2_PSR1 __REG(IMX_AIPI2_BASE + 0x04)
45 /* System Control */
46 #define CID __REG(IMX_SYSTEM_CTL_BASE + 0x0) /* Chip ID Register */
47 #define FMCR __REG(IMX_SYSTEM_CTL_BASE + 0x14) /* Function Multeplexing Control Register */
48 #define GPCR __REG(IMX_SYSTEM_CTL_BASE + 0x18) /* Global Peripheral Control Register */
49 #define WBCR __REG(IMX_SYSTEM_CTL_BASE + 0x1C) /* Well Bias Control Register */
50 #define DSCR(x) __REG(IMX_SYSTEM_CTL_BASE + 0x1C + ((x) << 2)) /* Driving Strength Control Register 1 - 13 */
52 #define GPCR_BOOT_SHIFT 16
53 #define GPCR_BOOT_MASK (0xf << GPCR_BOOT_SHIFT)
54 #define GPCR_BOOT_UART_USB 0
55 #define GPCR_BOOT_8BIT_NAND_2k 2
56 #define GPCR_BOOT_16BIT_NAND_2k 3
57 #define GPCR_BOOT_16BIT_NAND_512 4
58 #define GPCR_BOOT_16BIT_CS0 5
59 #define GPCR_BOOT_32BIT_CS0 6
60 #define GPCR_BOOT_8BIT_NAND_512 7
62 /* Chip Select Registers */
63 #define CS0U __REG(IMX_WEIM_BASE + 0x00) /* Chip Select 0 Upper Register */
64 #define CS0L __REG(IMX_WEIM_BASE + 0x04) /* Chip Select 0 Lower Register */
65 #define CS0A __REG(IMX_WEIM_BASE + 0x08) /* Chip Select 0 Addition Register */
66 #define CS1U __REG(IMX_WEIM_BASE + 0x10) /* Chip Select 1 Upper Register */
67 #define CS1L __REG(IMX_WEIM_BASE + 0x14) /* Chip Select 1 Lower Register */
68 #define CS1A __REG(IMX_WEIM_BASE + 0x18) /* Chip Select 1 Addition Register */
69 #define CS2U __REG(IMX_WEIM_BASE + 0x20) /* Chip Select 2 Upper Register */
70 #define CS2L __REG(IMX_WEIM_BASE + 0x24) /* Chip Select 2 Lower Register */
71 #define CS2A __REG(IMX_WEIM_BASE + 0x28) /* Chip Select 2 Addition Register */
72 #define CS3U __REG(IMX_WEIM_BASE + 0x30) /* Chip Select 3 Upper Register */
73 #define CS3L __REG(IMX_WEIM_BASE + 0x34) /* Chip Select 3 Lower Register */
74 #define CS3A __REG(IMX_WEIM_BASE + 0x38) /* Chip Select 3 Addition Register */
75 #define CS4U __REG(IMX_WEIM_BASE + 0x40) /* Chip Select 4 Upper Register */
76 #define CS4L __REG(IMX_WEIM_BASE + 0x44) /* Chip Select 4 Lower Register */
77 #define CS4A __REG(IMX_WEIM_BASE + 0x48) /* Chip Select 4 Addition Register */
78 #define CS5U __REG(IMX_WEIM_BASE + 0x50) /* Chip Select 5 Upper Register */
79 #define CS5L __REG(IMX_WEIM_BASE + 0x54) /* Chip Select 5 Lower Register */
80 #define CS5A __REG(IMX_WEIM_BASE + 0x58) /* Chip Select 5 Addition Register */
81 #define EIM __REG(IMX_WEIM_BASE + 0x60) /* WEIM Configuration Register */
83 #include "esdctl.h"
85 /* Watchdog Registers*/
86 #define WCR __REG(IMX_WDT_BASE + 0x00) /* Watchdog Control Register */
87 #define WSR __REG(IMX_WDT_BASE + 0x04) /* Watchdog Service Register */
88 #define WSTR __REG(IMX_WDT_BASE + 0x08) /* Watchdog Status Register */
90 /* important definition of some bits of WCR */
91 #define WCR_WDE 0x04
93 /* PLL registers */
94 #define CSCR __REG(IMX_PLL_BASE + 0x00) /* Clock Source Control Register */
95 #define MPCTL0 __REG(IMX_PLL_BASE + 0x04) /* MCU PLL Control Register 0 */
96 #define MPCTL1 __REG(IMX_PLL_BASE + 0x08) /* MCU PLL Control Register 1 */
97 #define SPCTL0 __REG(IMX_PLL_BASE + 0x0c) /* System PLL Control Register 0 */
98 #define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */
99 #define OSC26MCTL __REG(IMX_PLL_BASE + 0x14) /* Oscillator 26M Register */
100 #define PCDR0 __REG(IMX_PLL_BASE + 0x18) /* Peripheral Clock Divider Register 0 */
101 #define PCDR1 __REG(IMX_PLL_BASE + 0x1c) /* Peripheral Clock Divider Register 1 */
102 #define PCCR0 __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Control Register 0 */
103 #define PCCR1 __REG(IMX_PLL_BASE + 0x24) /* Peripheral Clock Control Register 1 */
104 #define CCSR __REG(IMX_PLL_BASE + 0x28) /* Clock Control Status Register */
106 #define CSCR_MPEN (1 << 0)
107 #define CSCR_SPEN (1 << 1)
108 #define CSCR_FPM_EN (1 << 2)
109 #define CSCR_OSC26M_DIS (1 << 3)
110 #define CSCR_OSC26M_DIV1P5 (1 << 4)
111 #define CSCR_AHB_DIV(d) (((d) & 0x3) << 8)
112 #define CSCR_ARM_DIV(d) (((d) & 0x3) << 12)
113 #define CSCR_ARM_SRC_MPLL (1 << 15)
114 #define CSCR_MCU_SEL (1 << 16)
115 #define CSCR_SP_SEL (1 << 17)
116 #define CSCR_MPLL_RESTART (1 << 18)
117 #define CSCR_SPLL_RESTART (1 << 19)
118 #define CSCR_MSHC_SEL (1 << 20)
119 #define CSCR_H264_SEL (1 << 21)
120 #define CSCR_SSI1_SEL (1 << 22)
121 #define CSCR_SSI2_SEL (1 << 23)
122 #define CSCR_SD_CNT(d) (((d) & 0x3) << 24)
123 #define CSCR_USB_DIV(d) (((d) & 0x7) << 28)
124 #define CSCR_UPDATE_DIS (1 << 31)
126 #define MPCTL1_BRMO (1 << 6)
127 #define MPCTL1_LF (1 << 15)
129 #define PCCR0_SSI2_EN (1 << 0)
130 #define PCCR0_SSI1_EN (1 << 1)
131 #define PCCR0_SLCDC_EN (1 << 2)
132 #define PCCR0_SDHC3_EN (1 << 3)
133 #define PCCR0_SDHC2_EN (1 << 4)
134 #define PCCR0_SDHC1_EN (1 << 5)
135 #define PCCR0_SDC_EN (1 << 6)
136 #define PCCR0_SAHARA_EN (1 << 7)
137 #define PCCR0_RTIC_EN (1 << 8)
138 #define PCCR0_RTC_EN (1 << 9)
139 #define PCCR0_PWM_EN (1 << 11)
140 #define PCCR0_OWIRE_EN (1 << 12)
141 #define PCCR0_MSHC_EN (1 << 13)
142 #define PCCR0_LCDC_EN (1 << 14)
143 #define PCCR0_KPP_EN (1 << 15)
144 #define PCCR0_IIM_EN (1 << 16)
145 #define PCCR0_I2C2_EN (1 << 17)
146 #define PCCR0_I2C1_EN (1 << 18)
147 #define PCCR0_GPT6_EN (1 << 19)
148 #define PCCR0_GPT5_EN (1 << 20)
149 #define PCCR0_GPT4_EN (1 << 21)
150 #define PCCR0_GPT3_EN (1 << 22)
151 #define PCCR0_GPT2_EN (1 << 23)
152 #define PCCR0_GPT1_EN (1 << 24)
153 #define PCCR0_GPIO_EN (1 << 25)
154 #define PCCR0_FEC_EN (1 << 26)
155 #define PCCR0_EMMA_EN (1 << 27)
156 #define PCCR0_DMA_EN (1 << 28)
157 #define PCCR0_CSPI3_EN (1 << 29)
158 #define PCCR0_CSPI2_EN (1 << 30)
159 #define PCCR0_CSPI1_EN (1 << 31)
161 #define PCCR1_MSHC_BAUDEN (1 << 2)
162 #define PCCR1_NFC_BAUDEN (1 << 3)
163 #define PCCR1_SSI2_BAUDEN (1 << 4)
164 #define PCCR1_SSI1_BAUDEN (1 << 5)
165 #define PCCR1_H264_BAUDEN (1 << 6)
166 #define PCCR1_PERCLK4_EN (1 << 7)
167 #define PCCR1_PERCLK3_EN (1 << 8)
168 #define PCCR1_PERCLK2_EN (1 << 9)
169 #define PCCR1_PERCLK1_EN (1 << 10)
170 #define PCCR1_HCLK_USB (1 << 11)
171 #define PCCR1_HCLK_SLCDC (1 << 12)
172 #define PCCR1_HCLK_SAHARA (1 << 13)
173 #define PCCR1_HCLK_RTIC (1 << 14)
174 #define PCCR1_HCLK_LCDC (1 << 15)
175 #define PCCR1_HCLK_H264 (1 << 16)
176 #define PCCR1_HCLK_FEC (1 << 17)
177 #define PCCR1_HCLK_EMMA (1 << 18)
178 #define PCCR1_HCLK_EMI (1 << 19)
179 #define PCCR1_HCLK_DMA (1 << 20)
180 #define PCCR1_HCLK_CSI (1 << 21)
181 #define PCCR1_HCLK_BROM (1 << 22)
182 #define PCCR1_HCLK_ATA (1 << 23)
183 #define PCCR1_WDT_EN (1 << 24)
184 #define PCCR1_USB_EN (1 << 25)
185 #define PCCR1_UART6_EN (1 << 26)
186 #define PCCR1_UART5_EN (1 << 27)
187 #define PCCR1_UART4_EN (1 << 28)
188 #define PCCR1_UART3_EN (1 << 29)
189 #define PCCR1_UART2_EN (1 << 30)
190 #define PCCR1_UART1_EN (1 << 31)
192 #define CCSR_32K_SR (1 << 15)
194 /* SDRAM Controller registers bitfields */
195 #define ESDCTL_PRCT(x) (((x) & 3f) << 0)
196 #define ESDCTL_BL (1 << 7)
197 #define ESDCTL_FP (1 << 8)
198 #define ESDCTL_PWDT(x) (((x) & 3) << 10)
199 #define ESDCTL_SREFR(x) (((x) & 7) << 13)
200 #define ESDCTL_DSIZ_16_UPPER (0 << 16)
201 #define ESDCTL_DSIZ_16_LOWER (0 << 16)
202 #define ESDCTL_DSIZ_32 (0 << 16)
203 #define ESDCTL_COL8 (0 << 20)
204 #define ESDCTL_COL9 (1 << 20)
205 #define ESDCTL_COL10 (2 << 20)
206 #define ESDCTL_ROW11 (0 << 24)
207 #define ESDCTL_ROW12 (1 << 24)
208 #define ESDCTL_ROW13 (2 << 24)
209 #define ESDCTL_ROW14 (3 << 24)
210 #define ESDCTL_ROW15 (4 << 24)
211 #define ESDCTL_SP (1 << 27)
212 #define ESDCTL_SMODE_NORMAL (0 << 28)
213 #define ESDCTL_SMODE_PRECHAGRE (1 << 28)
214 #define ESDCTL_SMODE_AUTO_REF (2 << 28)
215 #define ESDCTL_SMODE_LOAD_MODE (3 << 28)
216 #define ESDCTL_SMODE_MAN_REF (4 << 28)
217 #define ESDCTL_SDE (1 << 31)
219 #define ESDCFG_TRC(x) (((x) & 0xf) << 0)
220 #define ESDCFG_TRCD(x) (((x) & 0x7) << 4)
221 #define ESDCFG_TCAS(x) (((x) & 0x3) << 8)
222 #define ESDCFG_TRRD(x) (((x) & 0x3) << 10)
223 #define ESDCFG_TRAS(x) (((x) & 0x7) << 12)
224 #define ESDCFG_TWR (1 << 15)
225 #define ESDCFG_TMRD(x) (((x) & 0x3) << 16)
226 #define ESDCFG_TRP(x) (((x) & 0x3) << 18)
227 #define ESDCFG_TWTR (1 << 20)
228 #define ESDCFG_TXP(x) (((x) & 0x3) << 21)
230 #define ESDMISC_RST (1 << 1)
231 #define ESDMISC_MDDREN (1 << 2)
232 #define ESDMISC_MDDR_DL_RST (1 << 3)
233 #define ESDMISC_MDDR_MDIS (1 << 4)
234 #define ESDMISC_LHD (1 << 5)
235 #define ESDMISC_MA10_SHARE (1 << 6)
236 #define ESDMISC_SDRAM_RDY (1 << 6)
239 * Definitions for the clocksource driver
241 /* Part 1: Registers */
242 # define GPT_TCTL 0x00
243 # define GPT_TPRER 0x04
244 # define GPT_TCMP 0x08
245 # define GPT_TCR 0x0c
246 # define GPT_TCN 0x10
247 # define GPT_TSTAT 0x14
249 /* Part 2: Bitfields */
250 #define TCTL_SWR (1<<15) /* Software reset */
251 #define TCTL_FRR (1<<8) /* Freerun / restart */
252 #define TCTL_CAP (3<<6) /* Capture Edge */
253 #define TCTL_OM (1<<5) /* output mode */
254 #define TCTL_IRQEN (1<<4) /* interrupt enable */
255 #define TCTL_CLKSOURCE (1) /* Clock source bit position */
256 #define TCTL_TEN (1) /* Timer enable */
257 #define TPRER_PRES (0xff) /* Prescale */
258 #define TSTAT_CAPT (1<<1) /* Capture event */
259 #define TSTAT_COMP (1) /* Compare event */
261 #define IMX_CS0_BASE 0xC0000000
262 #define IMX_CS1_BASE 0xC8000000
263 #define IMX_CS2_BASE 0xD0000000
264 #define IMX_CS3_BASE 0xD2000000
265 #define IMX_CS4_BASE 0xD4000000
266 #define IMX_CS5_BASE 0xD6000000
268 #endif /* _IMX27_REGS_H */