1 /* ARM part only for now */
2 #define AHB_SRAM 0x00000000
4 #define ARM_BUS0_BASE 0x18000000
5 #define ARM_BUS1_BASE 0x18400000
7 #define FLASH_BANK0 0x10000000
8 #define FLASH_BANK1 0x11000000
10 #define USB_NUM_ENDPOINTS 16
11 #define USB_DEVBSS_ATTR
14 #define APB0_TIMER (ARM_BUS0_BASE + 0x00000000)
15 #define TMR0LR (*(volatile unsigned long *)(APB0_TIMER + 0x00))
16 #define TMR0CVR (*(volatile unsigned long *)(APB0_TIMER + 0x04))
17 #define TMR0CON (*(volatile unsigned long *)(APB0_TIMER + 0x08))
19 #define TMR1LR (*(volatile unsigned long *)(APB0_TIMER + 0x10))
20 #define TMR1CVR (*(volatile unsigned long *)(APB0_TIMER + 0x14))
21 #define TMR1CON (*(volatile unsigned long *)(APB0_TIMER + 0x18))
23 #define TMR2LR (*(volatile unsigned long *)(APB0_TIMER + 0x20))
24 #define TMR2CVR (*(volatile unsigned long *)(APB0_TIMER + 0x24))
25 #define TMR2CON (*(volatile unsigned long *)(APB0_TIMER + 0x28))
28 #define APB0_UART0 (ARM_BUS0_BASE + 0x00004000)
29 #define UART0_RBR (*(volatile unsigned long *)(APB0_UART0 + 0x00))
30 #define UART0_THR (*(volatile unsigned long *)(APB0_UART0 + 0x00))
31 #define UART0_DLL (*(volatile unsigned long *)(APB0_UART0 + 0x00))
32 #define UART0_DLH (*(volatile unsigned long *)(APB0_UART0 + 0x04))
33 #define UART0_IER (*(volatile unsigned long *)(APB0_UART0 + 0x04))
34 #define UART0_IIR (*(volatile unsigned long *)(APB0_UART0 + 0x08))
35 #define UART0_FCR (*(volatile unsigned long *)(APB0_UART0 + 0x08))
36 #define UART0_LCR (*(volatile unsigned long *)(APB0_UART0 + 0x0C))
37 #define UART0_MCR (*(volatile unsigned long *)(APB0_UART0 + 0x10))
38 #define UART0_LSR (*(volatile unsigned long *)(APB0_UART0 + 0x14))
39 #define UART0_MSR (*(volatile unsigned long *)(APB0_UART0 + 0x18))
42 #define APB0_UART1 (ARM_BUS0_BASE + 0x00008000)
43 #define UART1_RBR (*(volatile unsigned long *)(APB0_UART1 + 0x00))
44 #define UART1_THR (*(volatile unsigned long *)(APB0_UART1 + 0x00))
45 #define UART1_DLL (*(volatile unsigned long *)(APB0_UART1 + 0x00))
46 #define UART1_DLH (*(volatile unsigned long *)(APB0_UART1 + 0x04))
47 #define UART1_IER (*(volatile unsigned long *)(APB0_UART1 + 0x04))
48 #define UART1_IIR (*(volatile unsigned long *)(APB0_UART1 + 0x08))
49 #define UART1_FCR (*(volatile unsigned long *)(APB0_UART1 + 0x08))
50 #define UART1_LCR (*(volatile unsigned long *)(APB0_UART1 + 0x0C))
51 #define UART1_MCR (*(volatile unsigned long *)(APB0_UART1 + 0x10))
52 #define UART1_LSR (*(volatile unsigned long *)(APB0_UART1 + 0x14))
53 #define UART1_MSR (*(volatile unsigned long *)(APB0_UART1 + 0x18))
55 /* GPIO ports A,B,C,D */
56 #define APB0_GPIO0 (ARM_BUS0_BASE + 0x0000C000)
57 #define GPIO_PADR (*(volatile unsigned long *)(APB0_GPIO0 + 0x00))
58 #define GPIO_PACON (*(volatile unsigned long *)(APB0_GPIO0 + 0x04))
59 #define GPIO_PBDR (*(volatile unsigned long *)(APB0_GPIO0 + 0x08))
60 #define GPIO_PBCON (*(volatile unsigned long *)(APB0_GPIO0 + 0x0C))
61 #define GPIO_PCDR (*(volatile unsigned long *)(APB0_GPIO0 + 0x10))
62 #define GPIO_PCCON (*(volatile unsigned long *)(APB0_GPIO0 + 0x14))
63 #define GPIO_PDDR (*(volatile unsigned long *)(APB0_GPIO0 + 0x18))
64 #define GPIO_PDCON (*(volatile unsigned long *)(APB0_GPIO0 + 0x1C))
65 #define GPIO_TEST (*(volatile unsigned long *)(APB0_GPIO0 + 0x20))
66 #define GPIO_IEA (*(volatile unsigned long *)(APB0_GPIO0 + 0x24))
67 #define GPIO_IEB (*(volatile unsigned long *)(APB0_GPIO0 + 0x28))
68 #define GPIO_IEC (*(volatile unsigned long *)(APB0_GPIO0 + 0x2C))
69 #define GPIO_IED (*(volatile unsigned long *)(APB0_GPIO0 + 0x30))
70 #define GPIO_ISA (*(volatile unsigned long *)(APB0_GPIO0 + 0x34))
71 #define GPIO_ISB (*(volatile unsigned long *)(APB0_GPIO0 + 0x38))
72 #define GPIO_ISC (*(volatile unsigned long *)(APB0_GPIO0 + 0x3C))
73 #define GPIO_ISD (*(volatile unsigned long *)(APB0_GPIO0 + 0x40))
74 #define GPIO_IBEA (*(volatile unsigned long *)(APB0_GPIO0 + 0x44))
75 #define GPIO_IBEB (*(volatile unsigned long *)(APB0_GPIO0 + 0x48))
76 #define GPIO_IBEC (*(volatile unsigned long *)(APB0_GPIO0 + 0x4C))
77 #define GPIO_IBED (*(volatile unsigned long *)(APB0_GPIO0 + 0x50))
78 #define GPIO_IEVA (*(volatile unsigned long *)(APB0_GPIO0 + 0x54))
79 #define GPIO_IEVB (*(volatile unsigned long *)(APB0_GPIO0 + 0x58))
80 #define GPIO_IEVC (*(volatile unsigned long *)(APB0_GPIO0 + 0x5C))
81 #define GPIO_IEVD (*(volatile unsigned long *)(APB0_GPIO0 + 0x60))
82 #define GPIO_ICA (*(volatile unsigned long *)(APB0_GPIO0 + 0x64))
83 #define GPIO_ICB (*(volatile unsigned long *)(APB0_GPIO0 + 0x68))
84 #define GPIO_ICC (*(volatile unsigned long *)(APB0_GPIO0 + 0x6C))
85 #define GPIO_ICD (*(volatile unsigned long *)(APB0_GPIO0 + 0x70))
86 #define GPIO_ISR (*(volatile unsigned long *)(APB0_GPIO0 + 0x74))
89 #define APB0_WDT (ARM_BUS0_BASE + 0x00010000)
90 #define WDTLR (*(volatile unsigned long *)(APB0_WDT + 0x00))
91 #define WDTCVR (*(volatile unsigned long *)(APB0_WDT + 0x04))
92 #define WDTCON (*(volatile unsigned long *)(APB0_WDT + 0x08))
94 /* RTC module documentation missing */
95 #define APB0_RTC (ARM_BUS0_BASE + 0x00014000)
96 #define RTC_TIME (*(volatile unsigned long *)(APB0_RTC + 0x00))
97 #define RTC_DATE (*(volatile unsigned long *)(APB0_RTC + 0x04))
98 #define RTC_TALARM (*(volatile unsigned long *)(APB0_RTC + 0x08))
99 #define RTC_DALARM (*(volatile unsigned long *)(APB0_RTC + 0x0C))
100 #define RTC_CTRL (*(volatile unsigned long *)(APB0_RTC + 0x10))
101 #define RTC_RESET (*(volatile unsigned long *)(APB0_RTC + 0x14))
102 #define RTC_PWOFF (*(volatile unsigned long *)(APB0_RTC + 0x18))
103 #define RTC_PWFAIL (*(volatile unsigned long *)(APB0_RTC + 0x1C))
106 #define APB0_SPI (ARM_BUS0_BASE + 0x00018000)
107 #define SPI_TXR (*(volatile unsigned long *)(APB0_SPI + 0x00))
108 #define SPI_RXR (*(volatile unsigned long *)(APB0_SPI + 0x00))
109 #define SPI_IER (*(volatile unsigned long *)(APB0_SPI + 0x04))
110 #define SPI_FCR (*(volatile unsigned long *)(APB0_SPI + 0x08))
111 #define SPI_FWCR (*(volatile unsigned long *)(APB0_SPI + 0x0C))
112 #define SPI_DLYCR (*(volatile unsigned long *)(APB0_SPI + 0x10))
113 #define SPI_TXCR (*(volatile unsigned long *)(APB0_SPI + 0x14))
114 #define SPI_RXCR (*(volatile unsigned long *)(APB0_SPI + 0x18))
115 #define SPI_SSCR (*(volatile unsigned long *)(APB0_SPI + 0x1C))
116 #define SPI_ISR (*(volatile unsigned long *)(APB0_SPI + 0x20))
119 #define APB0_SCU (ARM_BUS0_BASE + 0x0001C000)
120 #define SCU_ID (*(volatile unsigned long *)(APB0_SCU + 0x00))
121 #define SCU_REMAP (*(volatile unsigned long *)(APB0_SCU + 0x04))
122 #define SCU_PLLCON1 (*(volatile unsigned long *)(APB0_SCU + 0x08))
123 #define SCU_PLLCON2 (*(volatile unsigned long *)(APB0_SCU + 0x0C))
124 #define SCU_PLLCON3 (*(volatile unsigned long *)(APB0_SCU + 0x10))
125 #define SCU_DIVCON1 (*(volatile unsigned long *)(APB0_SCU + 0x14))
126 #define SCU_CLKCFG (*(volatile unsigned long *)(APB0_SCU + 0x18))
127 #define SCU_RSTCFG (*(volatile unsigned long *)(APB0_SCU + 0x1C))
128 #define SCU_PWM (*(volatile unsigned long *)(APB0_SCU + 0x20))
129 #define SCU_CPUPD (*(volatile unsigned long *)(APB0_SCU + 0x24))
130 #define SCU_CHIPCFG (*(volatile unsigned long *)(APB0_SCU + 0x28))
131 #define SCU_STATUS (*(volatile unsigned long *)(APB0_SCU + 0x2C))
132 #define SCU_IOMUXA_CON (*(volatile unsigned long *)(APB0_SCU + 0x30))
133 /* 20 - 31 reserved */
134 #define IOMUX_I2S_PAD (1<<19)
135 #define IOMUX_I2S_CODEC (0<<19)
136 #define IOMUX_I2C_PAD (1<<18)
137 #define IOMUX_I2C_CODEC (0<<18)
138 #define IOMUX_GPIO_B7 (2<<16)
139 #define IOMUX_NAND_CS3 (1<<16)
140 #define IOMUX_I2C_SDA (0<<16)
141 #define IOMUX_GPIO_B6 (2<<14)
142 #define IOMUX_NAND_CS2 (1<<14)
143 #define IOMUX_I2C_SCL (0<<14)
144 #define IOMUX_SPI (2<<12)
145 #define IOMUX_SD (1<<12)
146 #define IOMUX_GPIO_B05 (0<<12)
147 #define IOMUX_LCD_VSYNC (1<<11)
148 #define IOMUX_GPIO_A7 (0<<11)
149 #define IOMUX_LCD_DEN (1<<10)
150 #define IOMUX_GPIO_A6 (0<<10)
151 #define IOMUX_NAND_CS1 (1<<9)
152 #define IOMUX_GPIO_A5 (0<<9)
153 #define IOMUX_LCD_D22 (1<<8)
154 #define IOMUX_GPIO_A4 (0<<8)
155 #define IOMUX_UART0_NRTS (2<<6)
156 #define IOMUX_LCD_D20 (1<<6)
157 #define IOMUX_GPIO_A3 (0<<6)
158 #define IOMUX_UART0_NCTS (2<<4)
159 #define IOMUX_LCD_D18 (1<<4)
160 #define IOMUX_GPIO_A2 (0<<4)
161 #define IOMUX_UART0_TXD (2<<2)
162 #define IOMUX_LCD_D17 (1<<2)
163 #define IOMUX_GPIO_A1 (0<<2)
164 #define IOMUX_UART0_RXD (2<<0)
165 #define IOMUX_LCD_D16 (1<<0)
166 #define IOMUX_GPIO_A0 (0<<0)
168 #define SCU_IOMUXB_CON (*(volatile unsigned long *)(APB0_SCU + 0x34))
169 /* bits 31 - 23 reserved */
170 #define IOMUX_HADC (1<<22)
171 #define IOMUX_VIP (0<<22)
172 #define IOMUX_SDRAM_CKE (1<<21)
173 #define IOMUX_GPIO_D3 (0<<21)
174 #define IOMUX_UHC_VBUS (1<<20)
175 #define IOMUX_GPIO_F4 (0<<20)
176 #define IOMUX_UHC_OCUR (1<<19)
177 #define IOMUX_GPIO_F3 (0<<19)
178 #define IOMUX_GPIO_F2 (1<<18)
179 #define IOMUX_SDRAM_A12 (0<<18)
180 #define IOMUX_GPIO_F1 (1<<17)
181 #define IOMUX_SDRAM_A11 (0<<17)
182 #define IOMUX_VIP_CLK (1<<16)
183 #define IOMUX_GPIO_F0 (0<<16)
184 #define IOMUX_LCD_D815 (1<<15)
185 #define IOMUX_GPIO_E07 (0<<15)
186 #define IOMUX_PWM3 (1<<14)
187 #define IOMUX_GPIO_D7 (0<<14)
188 #define IOMUX_PWM2 (1<<13)
189 #define IOMUX_GPIO_D6 (0<<13)
190 #define IOMUX_PWM1 (1<<12)
191 #define IOMUX_GPIO_D5 (0<<12)
192 #define IOMUX_PWM0 (1<<11)
193 #define IOMUX_GPIO_D4 (0<<11)
194 #define IOMUX_SD_WPA (1<<10)
195 #define IOMUX_GPIO_D2 (0<<10)
196 #define IOMUX_UART1_RXD (2<<8)
197 #define IOMUX_SD_CDA (1<<8)
198 #define IOMUX_GPIO_D1 (0<<8)
199 #define IOMUX_UART1_TXD (2<<6)
200 #define IOMUX_SD_PCA (1<<6)
201 #define IOMUX_GPIO_D0 (0<<6)
202 #define IOMUX_STMEM_CS1 (1<<5)
203 #define IOMUX_GPIO_C7 (0<<5)
204 #define IOMUX_I2S_CLK (1<<4)
205 #define IOMUX_GPIO_C6 (0<<4)
206 #define IOMUX_I2S_SDO (1<<3)
207 #define IOMUX_GPIO_C5 (0<<3)
208 #define IOMUX_I2S_SDI (1<<2)
209 #define IOMUX_GPIO_C4 (0<<2)
210 #define IOMUX_I2S_LRCK (1<<1)
211 #define IOMUX_GPIO_C3 (0<<1)
212 #define IOMUX_I2S_SCLK (1<<0)
213 #define IOMUX_GPIO_C2 (0<<0)
215 #define SCU_GPIOUPCON (*(volatile unsigned long *)(APB0_SCU + 0x38))
216 #define SCU_DIVCON2 (*(volatile unsigned long *)(APB0_SCU + 0x3C))
219 #define APB0_I2C (ARM_BUS0_BASE + 0x00020000)
220 #define I2C_MTXR (*(volatile unsigned long *)(APB0_I2C + 0x00))
221 #define I2C_MRXR (*(volatile unsigned long *)(APB0_I2C + 0x04))
222 #define I2C_STXR (*(volatile unsigned long *)(APB0_I2C + 0x08))
223 #define I2C_SRXR (*(volatile unsigned long *)(APB0_I2C + 0x0C))
224 #define I2C_SADDR (*(volatile unsigned long *)(APB0_I2C + 0x10))
225 #define I2C_IER (*(volatile unsigned long *)(APB0_I2C + 0x14))
226 #define I2C_ISR (*(volatile unsigned long *)(APB0_I2C + 0x18))
227 #define I2C_LCMR (*(volatile unsigned long *)(APB0_I2C + 0x1C))
228 #define I2C_LSR (*(volatile unsigned long *)(APB0_I2C + 0x20))
229 #define I2C_CONR (*(volatile unsigned long *)(APB0_I2C + 0x24))
230 #define I2C_OPR (*(volatile unsigned long *)(APB0_I2C + 0x28))
232 /* SD card controller */
233 #define APB0_SD (ARM_BUS0_BASE + 0x00024000)
234 #define MMU_CTRL (*(volatile unsigned long *)(APB0_SD + 0x00))
235 #define MMU_BIG_ENDIAN (1<<12)
236 #define MMU_DMA_START (1<<11)
237 #define MMU_DMA_WRITE (1<<10)
238 #define MMU_MMU0_BUFI (0<<9)
239 #define MMU_MMU0_BUFII (1<<9)
240 #define MMU_CPU_BUFI (0<<8)
241 #define MMU_CPU_BUFII (1<<8)
242 #define MMU_BUFII_RESET (1<<7)
243 #define MMU_BUFII_END (1<<6)
244 #define MMU_BUFII_BYTE (0<<4)
245 #define MMU_BUFII_HALFWORD (1<<4)
246 #define MMU_BUFII_WORD (3<<4)
247 #define MMU_BUFI_RESET (1<<3)
248 #define MMU_BUFI_END (1<<2)
249 #define MMU_BUFI_BYTE (0<<0)
250 #define MMU_BUFI_HALFWORD (1<<0)
251 #define MMU_BUFI_WORD (3<<0)
253 #define MMU_PNRI (*(volatile unsigned long *)(APB0_SD + 0x04))
254 #define CUR_PNRI (*(volatile unsigned long *)(APB0_SD + 0x08))
255 #define MMU_PNRII (*(volatile unsigned long *)(APB0_SD + 0x0C))
256 #define CUR_PNRII (*(volatile unsigned long *)(APB0_SD + 0x10))
257 #define MMU_ADDR (*(volatile unsigned long *)(APB0_SD + 0x14))
258 #define CUR_ADDR (*(volatile unsigned long *)(APB0_SD + 0x18))
259 #define MMU_DATA (*(volatile unsigned long *)(APB0_SD + 0x1C))
261 #define SD_CTRL (*(volatile unsigned long *)(APB0_SD + 0x20))
262 #define SD_PWR_CD (1<<13)
263 #define SD_PWR_CPU (0<<13)
264 #define SD_DETECT_CDDAT3 (1<<12)
265 #define SD_DETECT_MECH (0<<12)
266 #define SD_CLOCK_DIS (1<<11)
267 #define SD_CLOCK_EN (0<<11)
268 #define SD_DIV(x) ((x)&0x7ff)
270 #define SD_INT (*(volatile unsigned long *)(APB0_SD + 0x24))
271 #define CMD_RES_STAT (1<<6)
272 #define DATA_XFER_STAT (1<<5)
273 #define CD_DETECT_STAT (1<<4)
274 #define CMD_RES_INT_EN (1<<2)
275 #define DATA_XFER_INT_EN (1<<1)
276 #define CD_DETECT_IN_EN (1<<0)
278 #define SD_CARD (*(volatile unsigned long *)(APB0_SD + 0x28))
279 #define SD_CARD_SELECT (1<<7)
280 #define SD_CARD_PWR_EN (1<<6)
281 #define SD_CARD_DETECT_INT_EN (1<<5)
282 #define SD_CARD_BSY (1<<2)
283 #define SD_CARD_WRITE_PROTECT (1<<1)
284 #define SD_CARD_DETECT (1<<0)
286 #define SD_CMDREST (*(volatile unsigned long *)(APB0_SD + 0x30))
287 #define CMD_XFER_START (1<<13)
288 #define CMD_XFER_END (0<<13)
289 #define RES_XFER_START (1<<12)
290 #define RES_XFER_END (0<<12)
291 #define RES_R1 (0<<9)
292 #define RES_R1b (1<<9)
293 #define RES_R2 (2<<9)
294 #define RES_R3 (3<<9)
295 #define RES_R6 (6<<9)
296 #define CMD_RES_ERROR (1<<8)
297 /* bits 0-5 cmd index */
299 #define SD_CMDRES (*(volatile unsigned long *)(APB0_SD + 0x34))
300 #define STAT_CMD_XFER_START (1<<8)
301 #define STAT_RES_XFER_START (1<<7)
302 #define STAT_CMD_RES_ERR (1<<6)
303 #define STAT_CMD_RES_BUS_ERR (1<<5)
304 #define STAT_RES_TIMEOUT_ERR (1<<4)
305 #define STAT_RES_STARTBIT_ERR (1<<3)
306 #define STAT_RES_INDEX_ERR (1<<2)
307 #define STAT_RES_CRC_ERR (1<<1)
308 #define STAT_RES_ENDBIT_ERR (1<<0)
310 #define SD_DATAT (*(volatile unsigned long *)(APB0_SD + 0x3C))
311 #define DATA_XFER_START (1<<13)
312 #define DATA_XFER_WRITE (1<<12)
313 #define DATA_XFER_READ (0<<12)
314 #define DATA_BUS_4LINES (1<<11) /* rk2705/6/8 does not support this mode */
315 #define DATA_BUS_1LINE (0<<11)
316 #define DATA_XFER_DMA_EN (1<<10)
317 #define DATA_XFER_DMA_DIS (0<<10)
318 #define DATA_XFER_MULTI (1<<9)
319 #define DATA_XFER_SINGLE (0<<9)
320 #define DATA_XFER_ERR (1<<8)
321 #define DATA_BUS_ERR (1<<7)
322 #define DATA_TIMEOUT_ERR (1<<6)
323 #define DATA_CRC_ERR (1<<5)
324 #define READ_DAT_STARTBIT_ERR (1<<4)
325 #define READ_DAT_ENDBIT_ERR (1<<3)
326 #define WRITE_DAT_NOERR (2<<0)
327 #define WRITE_DAT_CRC_ERR (5<<0)
328 #define WRITE_DAT_NO_RES (7<<0)
330 #define SD_CMD (*(volatile unsigned long *)(APB0_SD + 0x40))
331 #define SD_RES3 (*(volatile unsigned long *)(APB0_SD + 0x44))
332 #define SD_RES2 (*(volatile unsigned long *)(APB0_SD + 0x48))
333 #define SD_RES1 (*(volatile unsigned long *)(APB0_SD + 0x4C))
334 #define SD_RES0 (*(volatile unsigned long *)(APB0_SD + 0x50))
337 #define APB0_I2S (ARM_BUS0_BASE + 0x00028000)
338 #define I2S_OPR (*(volatile unsigned long *)(APB0_I2S + 0x00))
339 #define I2S_TXR (*(volatile unsigned long *)(APB0_I2S + 0x04))
340 #define I2S_RXR (*(volatile unsigned long *)(APB0_I2S + 0x08))
341 #define I2S_TXCTL (*(volatile unsigned long *)(APB0_I2S + 0x0C))
342 #define I2S_RXCTL (*(volatile unsigned long *)(APB0_I2S + 0x10))
343 #define I2S_FIFOSTS (*(volatile unsigned long *)(APB0_I2S + 0x14))
344 #define I2S_IER (*(volatile unsigned long *)(APB0_I2S + 0x18))
345 #define I2S_ISR (*(volatile unsigned long *)(APB0_I2S + 0x1C))
348 #define APB0_PWM (ARM_BUS0_BASE + 0x0002C000)
349 #define PWMT0_CNTR (*(volatile unsigned long *)(APB0_PWM + 0x00))
350 #define PWMT0_HRC (*(volatile unsigned long *)(APB0_PWM + 0x04))
351 #define PWMT0_LRC (*(volatile unsigned long *)(APB0_PWM + 0x08))
352 #define PWMT0_CTRL (*(volatile unsigned long *)(APB0_PWM + 0x0C))
353 #define PWMT1_CNTR (*(volatile unsigned long *)(APB0_PWM + 0x10))
354 #define PWMT1_HRC (*(volatile unsigned long *)(APB0_PWM + 0x14))
355 #define PWMT1_LRC (*(volatile unsigned long *)(APB0_PWM + 0x18))
356 #define PWMT1_CTRL (*(volatile unsigned long *)(APB0_PWM + 0x1C))
357 #define PWMT2_CNTR (*(volatile unsigned long *)(APB0_PWM + 0x20))
358 #define PWMT2_HRC (*(volatile unsigned long *)(APB0_PWM + 0x24))
359 #define PWMT2_LRC (*(volatile unsigned long *)(APB0_PWM + 0x28))
360 #define PWMT2_CTRL (*(volatile unsigned long *)(APB0_PWM + 0x2C))
361 #define PWMT3_CNTR (*(volatile unsigned long *)(APB0_PWM + 0x30))
362 #define PWMT3_HRC (*(volatile unsigned long *)(APB0_PWM + 0x34))
363 #define PWMT3_LRC (*(volatile unsigned long *)(APB0_PWM + 0x38))
364 #define PWMT3_CTRL (*(volatile unsigned long *)(APB0_PWM + 0x3C))
367 #define APB0_ADC0 (ARM_BUS0_BASE + 0x00030000)
368 #define ADC_DATA (*(volatile unsigned long *)(APB0_ADC0 + 0x00))
369 #define ADC_STAT (*(volatile unsigned long *)(APB0_ADC0 + 0x04))
370 #define ADC_CTRL (*(volatile unsigned long *)(APB0_ADC0 + 0x08))
372 /* 0x18034000 - 0x18038000 reserved */
375 #define APB0_GPIO1 (ARM_BUS0_BASE + 0x00038000)
376 #define GPIO_PEDR (*(volatile unsigned long *)(APB0_GPIO1 + 0x00))
377 #define GPIO_PECON (*(volatile unsigned long *)(APB0_GPIO1 + 0x04))
378 #define GPIO_PFDR (*(volatile unsigned long *)(APB0_GPIO1 + 0x08))
379 #define GPIO_PFCON (*(volatile unsigned long *)(APB0_GPIO1 + 0x0C))
381 #define GPIO1_TEST (*(volatile unsigned long *)(APB0_GPIO1 + 0x20))
382 #define GPIO_IEE (*(volatile unsigned long *)(APB0_GPIO1 + 0x24))
383 #define GPIO_IEF (*(volatile unsigned long *)(APB0_GPIO1 + 0x28))
385 #define GPIO_ISE (*(volatile unsigned long *)(APB0_GPIO1 + 0x34))
386 #define GPIO_ISF (*(volatile unsigned long *)(APB0_GPIO1 + 0x38))
388 #define GPIO_IBEE (*(volatile unsigned long *)(APB0_GPIO1 + 0x44))
389 #define GPIO_IBEF (*(volatile unsigned long *)(APB0_GPIO1 + 0x48))
391 #define GPIO_IEVE (*(volatile unsigned long *)(APB0_GPIO1 + 0x54))
392 #define GPIO_IEVF (*(volatile unsigned long *)(APB0_GPIO1 + 0x58))
394 #define GPIO_ICE (*(volatile unsigned long *)(APB0_GPIO1 + 0x64))
395 #define GPIO_ICF (*(volatile unsigned long *)(APB0_GPIO1 + 0x68))
397 #define GPIO1_ISR (*(volatile unsigned long *)(APB0_GPIO1 + 0x74))
400 /* 0x1803C000 - 0x18080000 reserved */
402 /* Interrupt controller */
403 #define AHB0_INTC (ARM_BUS0_BASE + 0x00080000)
404 #define INTC_SCR0 (*(volatile unsigned long *)(AHB0_INTC + 0x00))
405 #define INTC_SCR1 (*(volatile unsigned long *)(AHB0_INTC + 0x04))
406 #define INTC_SCR2 (*(volatile unsigned long *)(AHB0_INTC + 0x08))
407 #define INTC_SCR3 (*(volatile unsigned long *)(AHB0_INTC + 0x0C))
408 #define INTC_SCR4 (*(volatile unsigned long *)(AHB0_INTC + 0x10))
409 #define INTC_SCR5 (*(volatile unsigned long *)(AHB0_INTC + 0x14))
410 #define INTC_SCR6 (*(volatile unsigned long *)(AHB0_INTC + 0x18))
411 #define INTC_SCR7 (*(volatile unsigned long *)(AHB0_INTC + 0x1C))
412 #define INTC_SCR8 (*(volatile unsigned long *)(AHB0_INTC + 0x20))
413 #define INTC_SCR9 (*(volatile unsigned long *)(AHB0_INTC + 0x24))
414 #define INTC_SCR10 (*(volatile unsigned long *)(AHB0_INTC + 0x28))
415 #define INTC_SCR11 (*(volatile unsigned long *)(AHB0_INTC + 0x2C))
416 #define INTC_SCR12 (*(volatile unsigned long *)(AHB0_INTC + 0x30))
417 #define INTC_SCR13 (*(volatile unsigned long *)(AHB0_INTC + 0x34))
418 #define INTC_SCR14 (*(volatile unsigned long *)(AHB0_INTC + 0x38))
419 #define INTC_SCR15 (*(volatile unsigned long *)(AHB0_INTC + 0x3C))
420 #define INTC_SCR16 (*(volatile unsigned long *)(AHB0_INTC + 0x40))
421 #define INTC_SCR17 (*(volatile unsigned long *)(AHB0_INTC + 0x44))
422 #define INTC_SCR18 (*(volatile unsigned long *)(AHB0_INTC + 0x48))
423 #define INTC_SCR19 (*(volatile unsigned long *)(AHB0_INTC + 0x4C))
424 #define INTC_SCR20 (*(volatile unsigned long *)(AHB0_INTC + 0x50))
425 #define INTC_SCR21 (*(volatile unsigned long *)(AHB0_INTC + 0x54))
426 #define INTC_SCR22 (*(volatile unsigned long *)(AHB0_INTC + 0x58))
427 #define INTC_SCR23 (*(volatile unsigned long *)(AHB0_INTC + 0x5C))
428 #define INTC_SCR24 (*(volatile unsigned long *)(AHB0_INTC + 0x60))
429 #define INTC_SCR25 (*(volatile unsigned long *)(AHB0_INTC + 0x64))
430 #define INTC_SCR26 (*(volatile unsigned long *)(AHB0_INTC + 0x68))
431 #define INTC_SCR27 (*(volatile unsigned long *)(AHB0_INTC + 0x6C))
432 #define INTC_SCR28 (*(volatile unsigned long *)(AHB0_INTC + 0x70))
433 #define INTC_SCR29 (*(volatile unsigned long *)(AHB0_INTC + 0x74))
434 #define INTC_SCR30 (*(volatile unsigned long *)(AHB0_INTC + 0x78))
435 #define INTC_SCR31 (*(volatile unsigned long *)(AHB0_INTC + 0x7C))
437 #define INTC_ISR (*(volatile unsigned long *)(AHB0_INTC + 0x104))
438 #define INTC_IPR (*(volatile unsigned long *)(AHB0_INTC + 0x108))
439 #define INTC_IMR (*(volatile unsigned long *)(AHB0_INTC + 0x10C))
441 #define INTC_IECR (*(volatile unsigned long *)(AHB0_INTC + 0x114))
442 #define INTC_ICCR (*(volatile unsigned long *)(AHB0_INTC + 0x118))
443 #define INTC_ISCR (*(volatile unsigned long *)(AHB0_INTC + 0x11C))
445 #define INTC_TEST (*(volatile unsigned long *)(AHB0_INTC + 0x124))
447 /* Bus arbiter module */
448 #define AHB0_ARBITER (ARM_BUS0_BASE + 0x00084000)
449 #define ARB_MODE (*(volatile unsigned long *)(AHB0_ARBITER + 0x00))
450 #define ARB_PRIO1 (*(volatile unsigned long *)(AHB0_ARBITER + 0x04))
451 #define ARB_PRIO2 (*(volatile unsigned long *)(AHB0_ARBITER + 0x08))
452 #define ARB_PRIO3 (*(volatile unsigned long *)(AHB0_ARBITER + 0x0C))
453 #define ARB_PRIO4 (*(volatile unsigned long *)(AHB0_ARBITER + 0x10))
454 #define ARB_PRIO5 (*(volatile unsigned long *)(AHB0_ARBITER + 0x14))
455 #define ARB_PRIO6 (*(volatile unsigned long *)(AHB0_ARBITER + 0x18))
456 #define ARB_PRIO7 (*(volatile unsigned long *)(AHB0_ARBITER + 0x1C))
457 #define ARB_PRIO8 (*(volatile unsigned long *)(AHB0_ARBITER + 0x20))
458 #define ARB_PRIO9 (*(volatile unsigned long *)(AHB0_ARBITER + 0x24))
459 #define ARB_PRIO10 (*(volatile unsigned long *)(AHB0_ARBITER + 0x28))
460 #define ARB_PRIO11 (*(volatile unsigned long *)(AHB0_ARBITER + 0x2C))
461 #define ARB_PRIO12 (*(volatile unsigned long *)(AHB0_ARBITER + 0x30))
462 #define ARB_PRIO13 (*(volatile unsigned long *)(AHB0_ARBITER + 0x34))
463 #define ARB_PRIO14 (*(volatile unsigned long *)(AHB0_ARBITER + 0x38))
464 #define ARB_PRIO15 (*(volatile unsigned long *)(AHB0_ARBITER + 0x3C))
466 /* Interprocessor communication module */
467 #define AHB0_CPU_MAILBOX (ARM_BUS0_BASE + 0x00088000)
468 #define MAILBOX_ID (*(volatile unsigned long *)(AHB0_CPU_MAILBOX + 0x00))
469 #define H2C_STA (*(volatile unsigned long *)(AHB0_CPU_MAILBOX + 0x10))
470 #define H2C0_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x20))
471 #define H2C0_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x24))
472 #define H2C1_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x28))
473 #define H2C1_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x2C))
474 #define H2C2_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x30))
475 #define H2C2_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x24))
476 #define H2C3_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x38))
477 #define H2C3_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x3C))
479 #define C2H_STA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x40))
480 #define C2H0_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x50))
481 #define C2H0_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x54))
482 #define C2H1_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x58))
483 #define C2H1_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x5C))
484 #define C2H2_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x60))
485 #define C2H2_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x64))
486 #define C2H3_DATA (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x68))
487 #define C2H3_CMD (*(volatile unsigned long *)(AHB0_CPU_MAILBOC + 0x6C))
490 #define AHB0_CPU_DEBUGIF (ARM_BUS0_BASE + 0x0008C000)
493 #define AHB0_HDMA (ARM_BUS0_BASE + 0x00090000)
494 #define HDMA_CON0 (*(volatile unsigned long *)(AHB0_HDMA + 0x00))
495 #define HDMA_CON1 (*(volatile unsigned long *)(AHB0_HDMA + 0x04))
496 #define HDMA_ISRC0 (*(volatile unsigned long *)(AHB0_HDMA + 0x08))
497 #define HDMA_IDST0 (*(volatile unsigned long *)(AHB0_HDMA + 0x0C))
498 #define HDMA_ICNT0 (*(volatile unsigned long *)(AHB0_HDMA + 0x10))
499 #define HDMA_ISRC1 (*(volatile unsigned long *)(AHB0_HDMA + 0x14))
500 #define HDMA_IDST1 (*(volatile unsigned long *)(AHB0_HDMA + 0x18))
501 #define HDMA_ICNT1 (*(volatile unsigned long *)(AHB0_HDMA + 0x1C))
502 #define HDMA_CSRC0 (*(volatile unsigned long *)(AHB0_HDMA + 0x20))
503 #define HDMA_CDST0 (*(volatile unsigned long *)(AHB0_HDMA + 0x24))
504 #define HDMA_CCNT0 (*(volatile unsigned long *)(AHB0_HDMA + 0x28))
505 #define HDMA_CSRC1 (*(volatile unsigned long *)(AHB0_HDMA + 0x2C))
506 #define HDMA_CDST1 (*(volatile unsigned long *)(AHB0_HDMA + 0x30))
507 #define HDMA_CCNT1 (*(volatile unsigned long *)(AHB0_HDMA + 0x34))
508 #define HDMA_ISR (*(volatile unsigned long *)(AHB0_HDMA + 0x38))
509 #define HDMA_DSR (*(volatile unsigned long *)(AHB0_HDMA + 0x3C))
510 #define HDMA_ISCNT0 (*(volatile unsigned long *)(AHB0_HDMA + 0x40))
511 #define HDMA_IPNCNTD0 (*(volatile unsigned long *)(AHB0_HDMA + 0x44))
512 #define HDMA_IADDR_BS0 (*(volatile unsigned long *)(AHB0_HDMA + 0x48))
513 #define HDMA_ISCNT1 (*(volatile unsigned long *)(AHB0_HDMA + 0x4C))
514 #define HDMA_IPNCNTD1 (*(volatile unsigned long *)(AHB0_HDMA + 0x50))
515 #define HDMA_IADDR_BS1 (*(volatile unsigned long *)(AHB0_HDMA + 0x54))
516 #define HDMA_CSCNT0 (*(volatile unsigned long *)(AHB0_HDMA + 0x58))
517 #define HDMA_CPNCNTD0 (*(volatile unsigned long *)(AHB0_HDMA + 0x5C))
518 #define HDMA_CADDR_BS0 (*(volatile unsigned long *)(AHB0_HDMA + 0x60))
519 #define HDMA_CSCNT1 (*(volatile unsigned long *)(AHB0_HDMA + 0x64))
520 #define HDMA_CPNCNTD1 (*(volatile unsigned long *)(AHB0_HDMA + 0x68))
521 #define HDMA_CADDR_BS1 (*(volatile unsigned long *)(AHB0_HDMA + 0x6C))
522 #define HDMA_PACNT0 (*(volatile unsigned long *)(AHB0_HDMA + 0x70))
523 #define HDMA_PACNT1 (*(volatile unsigned long *)(AHB0_HDMA + 0x74))
525 /* AHB-to-AHB bridge controller */
526 #define AHB0_A2A_DMA (ARM_BUS0_BASE + 0x00094000)
527 #define A2A_CON0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x00))
528 #define A2A_ISRC0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x04))
529 #define A2A_IDST0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x08))
530 #define A2A_ICNT0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x0C))
531 #define A2A_CSRC0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x10))
532 #define A2A_CDST0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x14))
533 #define A2A_CCNT0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x18))
534 #define A2A_CON1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x1C))
535 #define A2A_ISRC1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x20))
536 #define A2A_IDST1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x24))
537 #define A2A_ICNT1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x28))
538 #define A2A_CSRC1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x2C))
539 #define A2A_CDST1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x30))
540 #define A2A_CCNT1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x34))
541 #define A2A_INT_STS (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x38))
542 #define A2A_DMA_STS (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x3C))
543 #define A2A_ERR_ADR0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x40))
544 #define A2A_ERR_OP0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x44))
545 #define A2A_ERR_ADR1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x48))
546 #define A2A_ERR_OP1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x4C))
547 #define A2A_LCNT0 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x50))
548 #define A2A_LCNT1 (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x54))
549 #define A2A_DOMAIN (*(volatile unsigned long *)(AHB0_A2A_DMA + 0x58))
551 /* 0x18098000 - 0x180A000 reserved */
553 /* USB device controller */
554 #define AHB0_UDC (ARM_BUS0_BASE + 0x000A0000)
555 #define PHY_TEST_EN (*(volatile unsigned long *)(AHB0_UDC + 0x00))
556 #define PHY_TEST (*(volatile unsigned long *)(AHB0_UDC + 0x04))
557 #define DEV_CTL (*(volatile unsigned long *)(AHB0_UDC + 0x08))
558 #define DEV_RMTWKP (1<<2)
559 #define DEV_SELF_PWR (1<<3)
560 #define DEV_SOFT_CN (1<<4)
561 #define DEV_RESUME (1<<5)
562 #define DEV_PHY16BIT (1<<6)
563 #define SOFT_POR (1<<7)
564 #define CSR_DONE (1<<8)
566 #define DEV_INFO (*(volatile unsigned long *)(AHB0_UDC + 0x10))
567 #define DEV_EN (1<<7)
568 #define VBUS_STS (1<<20)
569 #define DEV_SPEED (3<<21)
571 #define EN_INT (*(volatile unsigned long *)(AHB0_UDC + 0x14))
572 #define EN_SOF_INTR (1<<0)
573 #define EN_SETUP_INTR (1<<1)
574 #define EN_IN0_INTR (1<<2)
575 #define EN_OUT0_INTR (1<<3)
576 #define EN_USBRST_INTR (1<<4)
577 #define EN_RESUME_INTR (1<<5)
578 #define EN_SUSP_INTR (1<<6)
580 #define EN_BOUT1_INTR (1<<8)
581 #define EN_BIN2_INTR (1<<9)
582 #define EN_IIN3_INTR (1<<10)
583 #define EN_BOUT4_INTR (1<<11)
584 #define EN_BIN5_INTR (1<<12)
585 #define EN_IIN6_INTR (1<<13)
586 #define EN_BOUT7_INTR (1<<14)
587 #define EN_BIN8_INTR (1<<15)
588 #define EN_IIN9_INTR (1<<16)
589 #define EN_BOUT10_INTR (1<<17)
590 #define EN_BIN11_INTR (1<<18)
591 #define EN_IIN12_INTR (1<<19)
592 #define EN_BOUT13_INTR (1<<20)
593 #define EN_BIN14_INTR (1<<21)
594 #define EN_IIN15_INTR (1<<22)
595 /* bits 23-26 TEST */
596 /* bits 27-31 reserved */
598 #define INT2FLAG (*(volatile unsigned long *)(AHB0_UDC + 0x18))
599 #define SOF_INTR (1<<0)
600 #define SETUP_INTR (1<<1)
601 #define IN0_INTR (1<<2)
602 #define OUT0_INTR (1<<3)
603 #define USBRST_INTR (1<<4)
604 #define RESUME_INTR (1<<5)
605 #define SUSP_INTR (1<<6)
606 #define CONN_INTR (1<<7) /* marked as reserved in DS */
607 #define BOUT1_INTR (1<<8)
608 #define BIN2_INTR (1<<9)
609 #define IIN3_INTR (1<<10)
610 #define BOUT4_INTR (1<<11)
611 #define BIN5_INTR (1<<12)
612 #define IIN6_INTR (1<<13)
613 #define BOUT7_INTR (1<<14)
614 #define BIN8_INTR (1<<15)
615 #define IIN9_INTR (1<<16)
616 #define BOUT10_INTR (1<<17)
617 #define BIN11_INTR (1<<18)
618 #define IIN12_INTR (1<<19)
619 #define BOUT13_INTR (1<<20)
620 #define BIN14_INTR (1<<21)
621 #define IIN15_INTR (1<<22)
622 /* bits 23-26 TEST */
623 /* bits 27-31 reserved */
625 #define INTCON (*(volatile unsigned long *)(AHB0_UDC + 0x1C))
626 #define UDC_INTEN (1<<0)
627 #define UDC_INTEDGE_TRIG (1<<1)
628 #define UDC_INTHIGH_ACT (1<<2)
630 #define SETUP1 (*(volatile unsigned long *)(AHB0_UDC + 0x20))
631 #define SETUP2 (*(volatile unsigned long *)(AHB0_UDC + 0x24))
632 #define AHBCON (*(volatile unsigned long *)(AHB0_UDC + 0x28))
633 #define RX0STAT (*(volatile unsigned long *)(AHB0_UDC + 0x30))
634 #define RX0CON (*(volatile unsigned long *)(AHB0_UDC + 0x34))
635 #define RX0DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x38))
636 #define RX0DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x3C))
637 #define TX0STAT (*(volatile unsigned long *)(AHB0_UDC + 0x40))
638 #define TX0CON (*(volatile unsigned long *)(AHB0_UDC + 0x44))
639 #define TX0BUF (*(volatile unsigned long *)(AHB0_UDC + 0x48))
640 #define TX0DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x4C))
641 #define TX0DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x50))
642 #define RX1STAT (*(volatile unsigned long *)(AHB0_UDC + 0x54))
643 #define RX1CON (*(volatile unsigned long *)(AHB0_UDC + 0x58))
644 #define RX1DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x5C))
645 #define RX1DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x60))
646 #define TX2STAT (*(volatile unsigned long *)(AHB0_UDC + 0x64))
647 #define TX2CON (*(volatile unsigned long *)(AHB0_UDC + 0x68))
648 #define TX2BUF (*(volatile unsigned long *)(AHB0_UDC + 0x6C))
649 #define TX2DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x70))
650 #define TX2DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x74))
651 #define TX3STAT (*(volatile unsigned long *)(AHB0_UDC + 0x78))
652 #define TX3CON (*(volatile unsigned long *)(AHB0_UDC + 0x7C))
653 #define TX3BUF (*(volatile unsigned long *)(AHB0_UDC + 0x80))
654 #define TX3DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x84))
655 #define TX3DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x88))
656 #define RX4STAT (*(volatile unsigned long *)(AHB0_UDC + 0x8C))
657 #define RX4CON (*(volatile unsigned long *)(AHB0_UDC + 0x90))
658 #define RX4DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x94))
659 #define RX4DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x98))
660 #define TX5STAT (*(volatile unsigned long *)(AHB0_UDC + 0x9C))
661 #define TX5CON (*(volatile unsigned long *)(AHB0_UDC + 0xA0))
662 #define TX5BUF (*(volatile unsigned long *)(AHB0_UDC + 0xA4))
663 #define TX5DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xA8))
664 #define TX5DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xAC))
665 #define TX6STAT (*(volatile unsigned long *)(AHB0_UDC + 0xB0))
666 #define TX6CON (*(volatile unsigned long *)(AHB0_UDC + 0xB4))
667 #define TX6BUF (*(volatile unsigned long *)(AHB0_UDC + 0xB8))
668 #define TX6DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xBC))
669 #define TX6DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xC0))
670 #define RX7STAT (*(volatile unsigned long *)(AHB0_UDC + 0xC4))
671 #define RX7CON (*(volatile unsigned long *)(AHB0_UDC + 0xC8))
672 #define RX7DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0xCC))
673 #define RX7DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0xD0))
674 #define TX8STAT (*(volatile unsigned long *)(AHB0_UDC + 0xD4))
675 #define TX8CON (*(volatile unsigned long *)(AHB0_UDC + 0xD8))
676 #define TX8BUF (*(volatile unsigned long *)(AHB0_UDC + 0xDC))
677 #define TX8DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xE0))
678 #define TX8DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xE4))
679 #define TX9STAT (*(volatile unsigned long *)(AHB0_UDC + 0xE8))
680 #define TX9CON (*(volatile unsigned long *)(AHB0_UDC + 0xEC))
681 #define TX9BUF (*(volatile unsigned long *)(AHB0_UDC + 0xF0))
682 #define TX9DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xF4))
683 #define TX9DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xF8))
684 #define RX10STAT (*(volatile unsigned long *)(AHB0_UDC + 0xFC))
685 #define RX10CON (*(volatile unsigned long *)(AHB0_UDC + 0x100))
686 #define RX10DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x104))
687 #define RX10DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x108))
688 #define TX11STAT (*(volatile unsigned long *)(AHB0_UDC + 0x10C))
689 #define TX11CON (*(volatile unsigned long *)(AHB0_UDC + 0x110))
690 #define TX11BUF (*(volatile unsigned long *)(AHB0_UDC + 0x114))
691 #define TX11DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x118))
692 #define TX11DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x11C))
693 #define TX12STAT (*(volatile unsigned long *)(AHB0_UDC + 0x120))
694 #define TX12CON (*(volatile unsigned long *)(AHB0_UDC + 0x124))
695 #define TX12BUF (*(volatile unsigned long *)(AHB0_UDC + 0x128))
696 #define TX12DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x12C))
697 #define TX12DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x130))
698 #define RX13STAT (*(volatile unsigned long *)(AHB0_UDC + 0x134))
699 #define RX13CON (*(volatile unsigned long *)(AHB0_UDC + 0x138))
700 #define RX13DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x13C))
701 #define RX13DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x140))
702 #define TX14STAT (*(volatile unsigned long *)(AHB0_UDC + 0x144))
703 #define TX14CON (*(volatile unsigned long *)(AHB0_UDC + 0x148))
704 #define TX14BUF (*(volatile unsigned long *)(AHB0_UDC + 0x14C))
705 #define TX14DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x150))
706 #define TX14DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x154))
707 #define TX15STAT (*(volatile unsigned long *)(AHB0_UDC + 0x158))
708 #define TX15CON (*(volatile unsigned long *)(AHB0_UDC + 0x15C))
709 #define TX15BUF (*(volatile unsigned long *)(AHB0_UDC + 0x160))
710 #define TX15DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x164))
711 #define TX15DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x168))
714 /* bits 10:0 RXLEN */
715 /* bits 15:11 reserved */
716 #define RXVOID (1<<16)
717 #define RXERR (1<<17)
718 #define RXACK (1<<18)
719 #define RXCFINT (1<<19) /* reserved for EP0 */
720 /* bits 23:20 reserved */
721 #define RXFULL (1<<24)
722 #define RXOVF (1<<25)
723 /* bits 31:26 reserved */
726 #define RXFFRC (1<<0)
728 #define RXSTALL (1<<2)
730 #define RXEPEN (1<<4)
731 #define RXVOIDINTEN (1<<5)
732 #define RXERRINTEN (1<<6)
733 #define RXACKINTEN (1<<7)
734 /* bits 31:8 reserved for EP0 */
735 /* bits 31:14 reserved for others */
738 /* bits 10:0 TXLEN */
739 /* bits 15:11 reserved */
740 #define TXVOID (1<<16)
741 #define TXERR (1<<17)
742 #define TXACK (1<<18)
743 #define TXDMADN (1<<19) /* reserved for EP0 */
744 #define TXCFINT (1<<20) /* reserved for EP0 */
745 /* bits 31:21 reserved */
749 #define TXSTALL (1<<1)
751 #define TXEPEN (1<<3) /* reserved for EP0 */
752 #define TXVOIDINTEN (1<<4)
753 #define TXERRINTEN (1<<5)
754 #define TXACKINTEN (1<<6)
755 #define TXDMADNEN (1<<7) /* reserved for EP0 */
756 /* bits 31:8 reserved */
759 #define TXFULL (1<<0)
761 #define TXDS0 (1<<2) /* reserved for EP0 */
762 #define TXDS1 (1<<3) /* reserved for EP0 */
763 /* bits 31:4 reserved */
766 #define DMA_START (1<<0)
767 /* bits 31:1 reserved */
769 /* USB host controller */
770 #define AHB0_UHC (ARM_BUS0_BASE + 0x000A4000)
771 /* documentation missing */
773 /* 0x180A8000 - 0x180B0000 reserved */
775 /* Static/SDRAM memory controller */
776 #define AHB0_SDRSTMC (ARM_BUS0_BASE + 0x000B0000)
777 #define MCSDR_MODE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x100))
778 #define MCSDR_ADDMAP (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x104))
779 #define MCSDR_ADDCFG (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x108))
780 #define MCSDR_BASIC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x10C))
781 #define MCSDR_T_REF (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x110))
782 #define MCSDR_T_RFC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x114))
783 #define MCSDR_T_MRD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x118))
784 #define MCSDR_T_RP (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x120))
785 #define MCSDR_T_RCD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x124))
787 #define MCST0_T_CEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x200))
788 #define MCST0_T_CE2WE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x204))
789 #define MCST0_WEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x208))
790 #define MCST0_T_WE2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x20C))
791 #define MCST0_T_CEWDR (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x210))
792 #define MCST0_T_CE2RD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x214))
793 #define MCST0_T_RDWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x218))
794 #define MCST0_T_RD2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x21C))
795 #define MCST0_BASIC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x220))
797 #define MCST1_T_CEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x300))
798 #define MCST1_T_CE2WE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x304))
799 #define MCST1_WEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x308))
800 #define MCST1_T_WE2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x30C))
801 #define MCST1_T_CEWDR (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x310))
802 #define MCST1_T_CE2RD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x314))
803 #define MCST1_T_RDWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x318))
804 #define MCST1_T_RD2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x31C))
805 #define MCST1_BASIC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x320))
807 /* 0x180B4000 - 0x180C000 reserved */
809 /* VIP - video input processor */
810 #define AHB0_VIP (ARM_BUS0_BASE + 0x000C0000)
812 /* 0x180C4000 - 0x180E8000 reserved */
814 /* NAND flash controller */
815 #define AHB0_NANDC (ARM_BUS0_BASE + 0x000E8000)
817 #define FMCTL (*(volatile unsigned long *)(AHB0_NANDC))
818 #define FM_RDY (1<<5) /* status of line R/B# */
819 #define FM_PROTECT (1<<4) /* WP# line (active low) */
820 /* bits 0-3 are chip selects */
822 #define FMWAIT (*(volatile unsigned long *)(AHB0_NANDC + 0x04))
823 #define FLCTL (*(volatile unsigned long *)(AHB0_NANDC + 0x08))
824 #define FL_RDY (1<<12)
825 #define FL_COR_EN (1<<11)
826 #define FL_INT_EN (1<<10)
827 #define FL_XFER_EN (1<<9)
828 #define FL_INTCLR_EN (1<<8)
829 /* bits 3-7 unknown */
830 #define FL_START (1<<2)
832 #define FL_RST (1<<0)
834 #define BCHCTL (*(volatile unsigned long *)(AHB0_NANDC + 0x0C))
835 /* bit 13 is used but unknown */
836 /* bit 12 is used but unknown */
837 #define BCH_WR (1<<1)
838 #define BCH_RST (1<<0)
840 #define BCHST (*(volatile unsigned long *)(AHB0_NANDC + 0xD0))
844 #define FLASH_DATA(n) (*(volatile unsigned char *)(AHB0_NANDC + 0x200 + (n<<9)))
845 #define FLASH_ADDR(n) (*(volatile unsigned char *)(AHB0_NANDC + 0x204 + (n<<9)))
846 #define FLASH_CMD(n) (*(volatile unsigned char *)(AHB0_NANDC + 0x208 + (n<<9)))
848 #define PAGE_BUF (*(volatile unsigned char *)(AHB0_NANDC + 0xA00))
849 #define SPARE_BUF (*(volatile unsigned char *)(AHB0_NANDC + 0x1200))
851 #define AHB0_ROM (ARM_BUS0_BASE + 0x000EC000)
852 #define AHB0_ES3 (ARM_BUS0_BASE + 0x000F4000)
853 #define AHB0_ES4 (ARM_BUS0_BASE + 0x000F8000)
854 #define AHB0_ES5 (ARM_BUS0_BASE + 0x000FC000)
855 #define AHB0_ES6 (ARM_BUS0_BASE + 0x00100000)
856 #define AHB0_EMD_SRAM (ARM_BUS0_BASE + 0x00200000)
858 /* 0x18204000 - 0x1840000 reserved */
860 /* 0x18400000 - 0x18484000 reserved*/
862 #define AHB1_ARBITER 0x18484000
863 /* 0x18488000 - 0x186E8000 reserved*/
866 #define AHB1_LCDC 0x186E8000
867 #define LCDC_CTRL (*(volatile unsigned long *)(AHB1_LCDC + 0x00))
868 /* bits 14-31 reserved */
869 #define ALPHA24B (1<<13)
870 #define UVBUFEXCH (1<<12)
871 #define ALPHA(x) (((x)&0x07)<<9)
873 #define LCDC_MCU (1<<7)
874 #define RGB24B (1<<6)
875 #define START_EVEN (1<<5)
876 #define EVEN_EN (1<<4)
877 #define RGB_DUMMY(x) (((x)&0x03)<<2)
878 #define LCDC_EN (1<<1)
879 #define LCDC_STOP (1<<0)
880 #define MCU_CTRL (*(volatile unsigned long *)(AHB1_LCDC + 0x04))
882 #define ALPHA_BASE(x) (((x)&0x3f)<<8)
883 #define MCU_CTRL_FIFO_EN (1<<6)
884 #define MCU_CTRL_RS_HIGH (1<<5)
885 #define MCU_CTRL_BUFF_WRITE (1<<2)
886 #define MCU_CTRL_BUFF_START (1<<1)
887 #define MCU_CTRL_BYPASS (1<<0)
889 #define HOR_PERIOD (*(volatile unsigned long *)(AHB1_LCDC + 0x08))
890 #define VERT_PERIOD (*(volatile unsigned long *)(AHB1_LCDC + 0x0C))
891 #define HOR_PW (*(volatile unsigned long *)(AHB1_LCDC + 0x10))
892 #define VERT_PW (*(volatile unsigned long *)(AHB1_LCDC + 0x14))
893 #define HOR_BP (*(volatile unsigned long *)(AHB1_LCDC + 0x18))
894 #define VERT_BP (*(volatile unsigned long *)(AHB1_LCDC + 0x1C))
895 #define HOR_ACT (*(volatile unsigned long *)(AHB1_LCDC + 0x20))
896 #define VERT_ACT (*(volatile unsigned long *)(AHB1_LCDC + 0x24))
897 #define LINE0_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x28))
898 #define LINE_ALPHA_EN (1<<14)
899 #define LINE_SCALE_EN (1<<13)
900 #define LINE_GBR (1<<12)
901 #define LINE_RGB (0<<12)
902 #define LINE_YUV_SRC (1<<11)
903 #define LINE_RGB_SRC (0<<11)
904 /* bits 0-10 Y_BASE */
906 #define LINE0_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x2C))
907 #define LINE1_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x30))
908 #define LINE1_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x34))
909 #define LINE2_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x38))
910 #define LINE2_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x3C))
911 #define LINE3_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x40))
912 #define LINE3_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x44))
913 #define START_X (*(volatile unsigned long *)(AHB1_LCDC + 0x48))
914 #define START_Y (*(volatile unsigned long *)(AHB1_LCDC + 0x4C))
915 #define DELTA_X (*(volatile unsigned long *)(AHB1_LCDC + 0x50))
916 #define DELTA_Y (*(volatile unsigned long *)(AHB1_LCDC + 0x54))
917 #define LCDC_INTR_MASK (*(volatile unsigned long *)(AHB1_LCDC + 0x58))
918 #define INTR_MASK_LINE (1<<3)
919 #define INTR_MASK_EVENLINE (0<<3)
920 #define INTR_MASK_BUFF (1<<2)
921 #define INTR_MASK_VERT (1<<1)
922 #define INTR_MASK_HOR (1<<0)
924 #define ALPHA_ALX (*(volatile unsigned long *)(AHB1_LCDC + 0x5C))
925 #define ALPHA_ATY (*(volatile unsigned long *)(AHB1_LCDC + 0x60))
926 #define ALPHA_ARX (*(volatile unsigned long *)(AHB1_LCDC + 0x64))
927 #define ALPHA_ABY (*(volatile unsigned long *)(AHB1_LCDC + 0x68))
929 #define ALPHA_BLX (*(volatile unsigned long *)(AHB1_LCDC + 0x6C))
930 #define ALPHA_BTY (*(volatile unsigned long *)(AHB1_LCDC + 0x70))
931 #define ALPHA_BRX (*(volatile unsigned long *)(AHB1_LCDC + 0x74))
932 #define ALPHA_BBY (*(volatile unsigned long *)(AHB1_LCDC + 0x78))
934 #define LCDC_STA (*(volatile unsigned long *)(AHB1_LCDC + 0x7C))
935 #define LCDC_MCU_IDLE (1<<12)
937 #define LCD_COMMAND (*(volatile unsigned long *)(AHB1_LCDC + 0x1000))
938 #define LCD_DATA (*(volatile unsigned long *)(AHB1_LCDC + 0x1004))
940 #define LCD_BUFF ((volatile void *)(AHB1_LCDC + 0x2000))
941 /* High speed ADC interface */
942 #define AHB1_HS_ADC 0x186EC000
943 #define HSADC_DATA (*(volatile unsigned long *)(AHB1_HS_ADC + 0x00))
944 #define HSADC_CTRL (*(volatile unsigned long *)(AHB1_HS_ADC + 0x04))
945 #define HSADC_IER (*(volatile unsigned long *)(AHB1_HS_ADC + 0x08))
946 #define HSADC_ISR (*(volatile unsigned long *)(AHB1_HS_ADC + 0x0C))
948 /* AHB-to-AHB DMA controller */
949 #define AHB1_DWDMA 0x186F0000
950 #define DWDMA_SAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x00 + 0x58*n))
951 #define DWDMA_DAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x08 + 0x58*n))
952 #define DWDMA_LLP(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x10 + 0x58*n))
953 #define DWDMA_CTL_L(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x18 + 0x58*n))
954 #define CTLL_LLP_SRC_EN (1<<28)
955 #define CTLL_LLP_DST_EN (1<<27)
956 #define CTLL_SMS_M2 (1<<25)
957 #define CTLL_SMS_M1 (0<<25)
958 #define CTLL_DMS_M2 (1<<23)
959 #define CTLL_DMS_M1 (0<<23)
960 #define CTLL_FC_PER2PER (3<<20)
961 #define CTLL_FC_PER2MEM (2<<20)
962 #define CTLL_FC_MEM2PER (1<<20)
963 #define CTLL_FC_MEM2MEM (0<<20)
964 /* bit 19 reserved */
965 #define CTLL_DST_SCATTER_EN (1<<18)
966 #define CTLL_SRC_GATHER_EN (1<<17)
967 #define CTLL_SRC_MSIZE_32 (4<<14)
968 #define CTLL_SRC_MSIZE_16 (3<<14)
969 #define CTLL_SRC_MSIZE_8 (2<<14)
970 #define CTLL_SRC_MSIZE_4 (1<<14)
971 #define CTLL_SRC_MSIZE_1 (0<<14)
972 #define CTLL_DST_MSIZE_32 (4<<11)
973 #define CTLL_DST_MSIZE_16 (3<<11)
974 #define CTLL_DST_MSIZE_8 (2<<11)
975 #define CTLL_DST_MSIZE_4 (1<<11)
976 #define CTLL_DST_MSIZE_1 (0<<11)
977 #define CTLL_SINC_NO (2<<9)
978 #define CTLL_SINC_DEC (1<<9)
979 #define CTLL_SINC_INC (0<<9)
980 #define CTLL_DINC_NO (2<<7)
981 #define CTLL_DINC_DEC (1<<7)
982 #define CTLL_DINC_INC (0<<7)
983 #define CTLL_SRC_TR_WIDTH_32 (2<<4)
984 #define CTLL_SRC_TR_WIDTH_16 (1<<4)
985 #define CTLL_SRC_TR_WIDTH_8 (0<<4)
986 #define CTLL_DST_TR_WIDTH_32 (2<<1)
987 #define CTLL_DST_TR_WIDTH_16 (1<<1)
988 #define CTLL_DST_TR_WIDTH_8 (0<<1)
989 #define CTLL_INT_EN (1<<0)
991 #define DWDMA_CTL_H(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x1C + 0x58*n))
992 #define DWDMA_SSTAT(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x20 + 0x58*n))
993 #define DWDMA_DSTAT(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x28 + 0x58*n))
994 #define DWDMA_SSTATAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x30 + 0x58*n))
995 #define DWDMA_DSTATAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x38 + 0x58*n))
996 #define DWDMA_CFG_L(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x40 + 0x58*n))
997 #define CFGL_RELOAD_DST (1<<31)
998 #define CFGL_RELOAD_SRC (1<<30)
999 #define CFGL_MAX_ABRST(n) ((n)<<20)
1000 #define CFGL_SRC_HS_POL_LOW (1<<19)
1001 #define CFGL_DST_HS_POL_LOW (1<<18)
1002 #define CFGL_LOCK_B (1<<17)
1003 #define CFGL_LOCK_CH (1<<16)
1004 #define CFGL_LOCK_B_L(n) (((n)&0x03)<<14)
1005 #define CFGL_LOCK_CH_L(n) (((n)&0x03)<<12)
1006 #define CFGL_HS_SEL_SRC (1<<11)
1007 #define CFGL_HS_SEL_DST (1<<10)
1008 #define CFGL_FIFO_EMPTY (1<<9)
1009 #define CFGL_CH_SUSP (1<<8)
1010 #define CFGL_CH_PRIOR(n) (((n) & 0x03)<<5)
1011 /* bits 0-4 reserved */
1012 #define DWDMA_CFG_H(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x44 + 0x58*n))
1013 #define CFGH_DST_PER(n) (((n)&0x0F)<<11)
1014 #define CFGH_SRC_PER(n) (((n)&0x0F)<<7)
1015 #define CFGH_SRC_UPD_EN (1<<6)
1016 #define CFGH_DST_UPD_EN (1<<5)
1017 #define CFGH_PROTCTL(n) (((n)&0x07)<<2)
1018 #define CFGH_FIFO_MODE (1<<1)
1019 #define CFGH_FC_MODE (1<<0)
1021 #define DWDMA_SGR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x48 + 0x58*n))
1022 #define DWDMA_DSR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x50 + 0x58*n))
1024 #define DWDMA_RAW_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x2C0))
1025 #define DWDMA_RAW_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x2C8))
1026 #define DWDMA_RAW_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x2D0))
1027 #define DWDMA_RAW_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x2D8))
1028 #define DWDMA_RAW_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x2E0))
1030 #define DWDMA_STATUS_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x2E8))
1031 #define DWDMA_STATUS_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x2F0))
1032 #define DWDMA_STATUS_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x2F8))
1033 #define DWDMA_STATUS_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x300))
1034 #define DWDMA_STATUS_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x308))
1036 #define DWDMA_MASK_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x310))
1037 #define DWDMA_MASK_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x318))
1038 #define DWDMA_MASK_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x320))
1039 #define DWDMA_MASK_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x328))
1040 #define DWDMA_MASK_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x330))
1042 #define DWDMA_CLEAR_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x338))
1043 #define DWDMA_CLEAR_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x340))
1044 #define DWDMA_CLEAR_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x348))
1045 #define DWDMA_CLEAR_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x350))
1046 #define DWDMA_CLEAR_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x358))
1048 #define DWDMA_STATUS_INT (*(volatile unsigned long *)(AHB1_DWDMA + 0x360))
1050 #define DWDMA_REQ_SRC (*(volatile unsigned long *)(AHB1_DWDMA + 0x368))
1051 #define DWDMA_REQ_DST (*(volatile unsigned long *)(AHB1_DWDMA + 0x370))
1052 #define DWDMA_S_REQ_SRC (*(volatile unsigned long *)(AHB1_DWDMA + 0x378))
1053 #define DWDMA_S_REQ_DST (*(volatile unsigned long *)(AHB1_DWDMA + 0x380))
1054 #define DWDMA_L_REQ_SRC (*(volatile unsigned long *)(AHB1_DWDMA + 0x388))
1055 #define DWDMA_L_REQ_DST (*(volatile unsigned long *)(AHB1_DWDMA + 0x390))
1057 #define DWDMA_DMA_CFG (*(volatile unsigned long *)(AHB1_DWDMA + 0x398))
1058 #define GLOB_EN (1<<0)
1059 #define DWDMA_DMA_CHEN (*(volatile unsigned long *)(AHB1_DWDMA + 0x3A0))
1060 #define DMACHEN_CH0 (0x101<<0)
1061 #define DMACHEN_CH1 (0x101<<1)
1062 #define DMACHEN_CH2 (0x101<<2)
1063 #define DMACHEN_CH3 (0x101<<3)
1065 /* ARM7 cache controller */
1066 #define ARM_CACHE_CTRL 0xEFFF0000
1067 #define DEVID (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x00))
1068 #define CACHEOP (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x04))
1069 #define CACHELKDN (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x08))
1071 #define MEMMAPA (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x10))
1072 #define MEMMAPB (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x14))
1073 #define MEMMAPC (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x18))
1074 #define MEMMAPD (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x1C))
1075 #define PFCNTRA_CTRL (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x20))
1076 #define PFCNTRA (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x24))
1077 #define PFCNTRB_CTRL (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x28))
1078 #define PFCNTRB (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x2C))
1080 /* Timer frequency */
1081 #define TIMER_FREQ 50000000