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))
559 #define DEV_INFO (*(volatile unsigned long *)(AHB0_UDC + 0x10))
560 #define EN_INT (*(volatile unsigned long *)(AHB0_UDC + 0x14))
561 #define EN_SOF_INTR (1<<0)
562 #define EN_SETUP_INTR (1<<1)
563 #define EN_IN0_INTR (1<<2)
564 #define EN_OUT0_INTR (1<<3)
565 #define EN_USBRST_INTR (1<<4)
566 #define EN_RESUME_INTR (1<<5)
567 #define EN_SUSP_INTR (1<<6)
569 #define EN_BOUT1_INTR (1<<8)
570 #define EN_BIN2_INTR (1<<9)
571 #define EN_IIN3_INTR (1<<10)
572 #define EN_BOUT4_INTR (1<<11)
573 #define EN_BIN5_INTR (1<<12)
574 #define EN_IIN6_INTR (1<<13)
575 #define EN_BOUT7_INTR (1<<14)
576 #define EN_BIN8_INTR (1<<15)
577 #define EN_IIN9_INTR (1<<16)
578 #define EN_BOUT10_INTR (1<<17)
579 #define EN_BIN11_INTR (1<<18)
580 #define EN_IIN12_INTR (1<<19)
581 #define EN_BOUT13_INTR (1<<20)
582 #define EN_BIN14_INTR (1<<21)
583 #define EN_IIN15_INTR (1<<22)
584 /* bits 23-26 TEST */
585 /* bits 27-31 reserved */
587 #define INT2FLAG (*(volatile unsigned long *)(AHB0_UDC + 0x18))
588 #define SOF_INTR (1<<0)
589 #define SETUP_INTR (1<<1)
590 #define IN0_INTR (1<<2)
591 #define OUT0_INTR (1<<3)
592 #define USBRST_INTR (1<<4)
593 #define RESUME_INTR (1<<5)
594 #define SUSP_INTR (1<<6)
596 #define BOUT1_INTR (1<<8)
597 #define BIN2_INTR (1<<9)
598 #define IIN3_INTR (1<<10)
599 #define BOUT4_INTR (1<<11)
600 #define BIN5_INTR (1<<12)
601 #define IIN6_INTR (1<<13)
602 #define BOUT7_INTR (1<<14)
603 #define BIN8_INTR (1<<15)
604 #define IIN9_INTR (1<<16)
605 #define BOUT10_INTR (1<<17)
606 #define BIN11_INTR (1<<18)
607 #define IIN12_INTR (1<<19)
608 #define BOUT13_INTR (1<<20)
609 #define BIN14_INTR (1<<21)
610 #define IIN15_INTR (1<<22)
611 /* bits 23-26 TEST */
612 /* bits 27-31 reserved */
614 #define INTCON (*(volatile unsigned long *)(AHB0_UDC + 0x1C))
615 #define SETUP1 (*(volatile unsigned long *)(AHB0_UDC + 0x20))
616 #define SETUP2 (*(volatile unsigned long *)(AHB0_UDC + 0x24))
617 #define AHBCON (*(volatile unsigned long *)(AHB0_UDC + 0x28))
619 #define RX0STAT (*(volatile unsigned long *)(AHB0_UDC + 0x30))
620 #define RX0CON (*(volatile unsigned long *)(AHB0_UDC + 0x34))
621 #define RX0FFRC (1<<0)
622 #define RX0CLR (1<<1)
623 #define RX0STALL (1<<2)
624 #define RX0NAK (1<<3)
626 #define RX0VOIDINTEN (1<<5)
627 #define RX0ERRINTEN (1<<6)
628 #define RX0ACKINTEN (1<<7)
629 /* bits 8-31 reserved */
631 #define RX0DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x38))
632 #define RX0DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x3C))
633 #define TX0STAT (*(volatile unsigned long *)(AHB0_UDC + 0x40))
634 #define TX0CON (*(volatile unsigned long *)(AHB0_UDC + 0x44))
635 #define TX0CLR (1<<0)
636 #define TX0STALL (1<<1)
637 #define TX0NAK (1<<2)
639 #define TX0VOIDINTEN (1<<4)
640 #define TX0ERRINTEN (1<<5)
641 #define TX0ACKINTEN (1<<6)
642 /* bits 7-31 reserved */
644 #define TX0BUF (*(volatile unsigned long *)(AHB0_UDC + 0x48))
645 #define TX0FULL (1<<0)
646 #define TX0URF (1<<1)
647 /* bits 2-31 reserved */
649 #define TX0DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x4C))
650 #define TX0DMAINSTA (1<<0)
651 /* bits 1-31 reserved */
653 #define TX0DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x50))
654 #define RX1STAT (*(volatile unsigned long *)(AHB0_UDC + 0x54))
655 #define RX1CON (*(volatile unsigned long *)(AHB0_UDC + 0x58))
656 #define RX1DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x5C))
657 #define RX1DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x60))
658 #define TX2STAT (*(volatile unsigned long *)(AHB0_UDC + 0x64))
659 #define TX2CON (*(volatile unsigned long *)(AHB0_UDC + 0x68))
660 #define TX2BUF (*(volatile unsigned long *)(AHB0_UDC + 0x6C))
661 #define TX2DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x70))
662 #define TX2DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x74))
663 #define TX3STAT (*(volatile unsigned long *)(AHB0_UDC + 0x78))
664 #define TX3CON (*(volatile unsigned long *)(AHB0_UDC + 0x7C))
665 #define TX3BUF (*(volatile unsigned long *)(AHB0_UDC + 0x80))
666 #define TX3DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x84))
667 #define TX3DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x88))
668 #define RX4STAT (*(volatile unsigned long *)(AHB0_UDC + 0x8C))
669 #define RX4CON (*(volatile unsigned long *)(AHB0_UDC + 0x90))
670 #define RX4DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x94))
671 #define RX4DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x98))
672 #define TX5STAT (*(volatile unsigned long *)(AHB0_UDC + 0x9C))
673 #define TX5CON (*(volatile unsigned long *)(AHB0_UDC + 0xA0))
674 #define TX5BUF (*(volatile unsigned long *)(AHB0_UDC + 0xA4))
675 #define TX5DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xA8))
676 #define TX5DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xAC))
677 #define TX6STAT (*(volatile unsigned long *)(AHB0_UDC + 0xB0))
678 #define TX6CON (*(volatile unsigned long *)(AHB0_UDC + 0xB4))
679 #define TX6BUF (*(volatile unsigned long *)(AHB0_UDC + 0xB8))
680 #define TX6DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xBC))
681 #define TX6DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xC0))
682 #define RX7STAT (*(volatile unsigned long *)(AHB0_UDC + 0xC4))
683 #define RX7CON (*(volatile unsigned long *)(AHB0_UDC + 0xC8))
684 #define RX7DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0xCC))
685 #define RX7DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0xD0))
686 #define TX8STAT (*(volatile unsigned long *)(AHB0_UDC + 0xD4))
687 #define TX8CON (*(volatile unsigned long *)(AHB0_UDC + 0xD8))
688 #define TX8BUF (*(volatile unsigned long *)(AHB0_UDC + 0xDC))
689 #define TX8DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xE0))
690 #define TX8DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xE4))
691 #define TX9STAT (*(volatile unsigned long *)(AHB0_UDC + 0xE8))
692 #define TX9CON (*(volatile unsigned long *)(AHB0_UDC + 0xEC))
693 #define TX9BUF (*(volatile unsigned long *)(AHB0_UDC + 0xF0))
694 #define TX9DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0xF4))
695 #define TX9DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0xF8))
696 #define RX10STAT (*(volatile unsigned long *)(AHB0_UDC + 0xFC))
697 #define RX10CON (*(volatile unsigned long *)(AHB0_UDC + 0x100))
698 #define RX10DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x104))
699 #define RX10DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x108))
700 #define TX11STAT (*(volatile unsigned long *)(AHB0_UDC + 0x10C))
701 #define TX11CON (*(volatile unsigned long *)(AHB0_UDC + 0x110))
702 #define TX11BUF (*(volatile unsigned long *)(AHB0_UDC + 0x114))
703 #define TX11DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x118))
704 #define TX11DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x11C))
705 #define TX12STAT (*(volatile unsigned long *)(AHB0_UDC + 0x120))
706 #define TX12CON (*(volatile unsigned long *)(AHB0_UDC + 0x124))
707 #define TX12BUF (*(volatile unsigned long *)(AHB0_UDC + 0x128))
708 #define TX12DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x12C))
709 #define TX12DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x130))
710 #define RX13STAT (*(volatile unsigned long *)(AHB0_UDC + 0x134))
711 #define RX13CON (*(volatile unsigned long *)(AHB0_UDC + 0x138))
712 #define RX13DMACTLO (*(volatile unsigned long *)(AHB0_UDC + 0x13C))
713 #define RX13DMAOUTLMADDR (*(volatile unsigned long *)(AHB0_UDC + 0x140))
714 #define TX14STAT (*(volatile unsigned long *)(AHB0_UDC + 0x144))
715 #define TX14CON (*(volatile unsigned long *)(AHB0_UDC + 0x148))
716 #define TX14BUF (*(volatile unsigned long *)(AHB0_UDC + 0x14C))
717 #define TX14DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x150))
718 #define TX14DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x154))
719 #define TX15STAT (*(volatile unsigned long *)(AHB0_UDC + 0x158))
720 #define TX15CON (*(volatile unsigned long *)(AHB0_UDC + 0x15C))
721 #define TX15BUF (*(volatile unsigned long *)(AHB0_UDC + 0x160))
722 #define TX15DMAINCTL (*(volatile unsigned long *)(AHB0_UDC + 0x164))
723 #define TX15DMALM_IADDR (*(volatile unsigned long *)(AHB0_UDC + 0x168))
725 /* USB host controller */
726 #define AHB0_UHC (ARM_BUS0_BASE + 0x000A4000)
727 /* documentation missing */
729 /* 0x180A8000 - 0x180B0000 reserved */
731 /* Static/SDRAM memory controller */
732 #define AHB0_SDRSTMC (ARM_BUS0_BASE + 0x000B0000)
733 #define MCSDR_MODE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x100))
734 #define MCSDR_ADDMAP (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x104))
735 #define MCSDR_ADDCFG (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x108))
736 #define MCSDR_BASIC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x10C))
737 #define MCSDR_T_REF (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x110))
738 #define MCSDR_T_RFC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x114))
739 #define MCSDR_T_MRD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x118))
740 #define MCSDR_T_RP (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x120))
741 #define MCSDR_T_RCD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x124))
743 #define MCST0_T_CEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x200))
744 #define MCST0_T_CE2WE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x204))
745 #define MCST0_WEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x208))
746 #define MCST0_T_WE2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x20C))
747 #define MCST0_T_CEWDR (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x210))
748 #define MCST0_T_CE2RD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x214))
749 #define MCST0_T_RDWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x218))
750 #define MCST0_T_RD2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x21C))
751 #define MCST0_BASIC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x220))
753 #define MCST1_T_CEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x300))
754 #define MCST1_T_CE2WE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x304))
755 #define MCST1_WEWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x308))
756 #define MCST1_T_WE2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x30C))
757 #define MCST1_T_CEWDR (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x310))
758 #define MCST1_T_CE2RD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x314))
759 #define MCST1_T_RDWD (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x318))
760 #define MCST1_T_RD2CE (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x31C))
761 #define MCST1_BASIC (*(volatile unsigned long *)(AHB0_SDRSTMC + 0x320))
763 /* 0x180B4000 - 0x180C000 reserved */
765 /* VIP - video input processor */
766 #define AHB0_VIP (ARM_BUS0_BASE + 0x000C0000)
768 /* 0x180C4000 - 0x180E8000 reserved */
770 /* NAND flash controller */
771 #define AHB0_NANDC (ARM_BUS0_BASE + 0x000E8000)
773 #define FMCTL (*(volatile unsigned long *)(AHB0_NANDC))
774 #define FM_RDY (1<<5) /* status of line R/B# */
775 #define FM_PROTECT (1<<4) /* WP# line (active low) */
776 /* bits 0-3 are chip selects */
778 #define FMWAIT (*(volatile unsigned long *)(AHB0_NANDC + 0x04))
779 #define FLCTL (*(volatile unsigned long *)(AHB0_NANDC + 0x08))
780 #define FL_RDY (1<<12)
781 #define FL_COR_EN (1<<11)
782 #define FL_INT_EN (1<<10)
783 #define FL_XFER_EN (1<<9)
784 #define FL_INTCLR_EN (1<<8)
785 /* bits 3-7 unknown */
786 #define FL_START (1<<2)
788 #define FL_RST (1<<0)
790 #define BCHCTL (*(volatile unsigned long *)(AHB0_NANDC + 0x0C))
791 /* bit 13 is used but unknown */
792 /* bit 12 is used but unknown */
793 #define BCH_WR (1<<1)
794 #define BCH_RST (1<<0)
796 #define BCHST (*(volatile unsigned long *)(AHB0_NANDC + 0xD0))
800 #define FLASH_DATA(n) (*(volatile unsigned char *)(AHB0_NANDC + 0x200 + (n<<9)))
801 #define FLASH_ADDR(n) (*(volatile unsigned char *)(AHB0_NANDC + 0x204 + (n<<9)))
802 #define FLASH_CMD(n) (*(volatile unsigned char *)(AHB0_NANDC + 0x208 + (n<<9)))
804 #define PAGE_BUF (*(volatile unsigned char *)(AHB0_NANDC + 0xA00))
805 #define SPARE_BUF (*(volatile unsigned char *)(AHB0_NANDC + 0x1200))
807 #define AHB0_ROM (ARM_BUS0_BASE + 0x000EC000)
808 #define AHB0_ES3 (ARM_BUS0_BASE + 0x000F4000)
809 #define AHB0_ES4 (ARM_BUS0_BASE + 0x000F8000)
810 #define AHB0_ES5 (ARM_BUS0_BASE + 0x000FC000)
811 #define AHB0_ES6 (ARM_BUS0_BASE + 0x00100000)
812 #define AHB0_EMD_SRAM (ARM_BUS0_BASE + 0x00200000)
814 /* 0x18204000 - 0x1840000 reserved */
816 /* 0x18400000 - 0x18484000 reserved*/
818 #define AHB1_ARBITER 0x18484000
819 /* 0x18488000 - 0x186E8000 reserved*/
822 #define AHB1_LCDC 0x186E8000
823 #define LCDC_CTRL (*(volatile unsigned long *)(AHB1_LCDC + 0x00))
824 /* bits 14-31 reserved */
825 #define ALPHA24B (1<<13)
826 #define UVBUFEXCH (1<<12)
827 #define ALPHA(x) (((x)&0x07)<<9)
829 #define LCDC_MCU (1<<7)
830 #define RGB24B (1<<6)
831 #define START_EVEN (1<<5)
832 #define EVEN_EN (1<<4)
833 #define RGB_DUMMY(x) (((x)&0x03)<<2)
834 #define LCDC_EN (1<<1)
835 #define LCDC_STOP (1<<0)
836 #define MCU_CTRL (*(volatile unsigned long *)(AHB1_LCDC + 0x04))
838 #define ALPHA_BASE(x) (((x)&0x3f)<<8)
839 #define MCU_CTRL_FIFO_EN (1<<6)
840 #define MCU_CTRL_RS_HIGH (1<<5)
841 #define MCU_CTRL_BUFF_WRITE (1<<2)
842 #define MCU_CTRL_BUFF_START (1<<1)
843 #define MCU_CTRL_BYPASS (1<<0)
845 #define HOR_PERIOD (*(volatile unsigned long *)(AHB1_LCDC + 0x08))
846 #define VERT_PERIOD (*(volatile unsigned long *)(AHB1_LCDC + 0x0C))
847 #define HOR_PW (*(volatile unsigned long *)(AHB1_LCDC + 0x10))
848 #define VERT_PW (*(volatile unsigned long *)(AHB1_LCDC + 0x14))
849 #define HOR_ACT (*(volatile unsigned long *)(AHB1_LCDC + 0x18))
850 #define VERT_ACT (*(volatile unsigned long *)(AHB1_LCDC + 0x1C))
851 #define HOR_BP (*(volatile unsigned long *)(AHB1_LCDC + 0x20))
852 #define VERT_BP (*(volatile unsigned long *)(AHB1_LCDC + 0x24))
853 #define LINE0_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x28))
854 #define LINE_ALPHA_EN (1<<14)
855 #define LINE_SCALE_EN (1<<13)
856 #define LINE_GBR (1<<12)
857 #define LINE_RGB (0<<12)
858 #define LINE_YUV_SRC (1<<11)
859 #define LINE_RGB_SRC (0<<11)
860 /* bits 0-10 Y_BASE */
862 #define LINE0_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x2C))
863 #define LINE1_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x30))
864 #define LINE1_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x34))
865 #define LINE2_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x38))
866 #define LINE2_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x3C))
867 #define LINE3_YADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x40))
868 #define LINE3_UVADDR (*(volatile unsigned long *)(AHB1_LCDC + 0x44))
869 #define START_X (*(volatile unsigned long *)(AHB1_LCDC + 0x48))
870 #define START_Y (*(volatile unsigned long *)(AHB1_LCDC + 0x4C))
871 #define DELTA_X (*(volatile unsigned long *)(AHB1_LCDC + 0x50))
872 #define DELTA_Y (*(volatile unsigned long *)(AHB1_LCDC + 0x54))
873 #define LCDC_INTR_MASK (*(volatile unsigned long *)(AHB1_LCDC + 0x58))
874 #define INTR_MASK_LINE (1<<3)
875 #define INTR_MASK_EVENLINE (0<<3)
876 #define INTR_MASK_BUFF (1<<2)
877 #define INTR_MASK_VERT (1<<1)
878 #define INTR_MASK_HOR (1<<0)
880 #define LCDC_STA (*(volatile unsigned long *)(AHB1_LCDC + 0x7C))
881 #define LCDC_MCU_IDLE (1<<12)
883 #define LCD_COMMAND (*(volatile unsigned long *)(AHB1_LCDC + 0x1000))
884 #define LCD_DATA (*(volatile unsigned long *)(AHB1_LCDC + 0x1004))
886 #define LCD_BUFF (*(volatile unsigned long *)(AHB1_LCDC + 0x2000))
887 /* High speed ADC interface */
888 #define AHB1_HS_ADC 0x186EC000
889 #define HSADC_DATA (*(volatile unsigned long *)(AHB1_HS_ADC + 0x00))
890 #define HSADC_CTRL (*(volatile unsigned long *)(AHB1_HS_ADC + 0x04))
891 #define HSADC_IER (*(volatile unsigned long *)(AHB1_HS_ADC + 0x08))
892 #define HSADC_ISR (*(volatile unsigned long *)(AHB1_HS_ADC + 0x0C))
894 /* AHB-to-AHB DMA controller */
895 #define AHB1_DWDMA 0x186F0000
896 #define DWDMA_SAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x00 + 0x58*n))
897 #define DWDMA_DAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x08 + 0x58*n))
898 #define DWDMA_LLP(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x10 + 0x58*n))
899 #define DWDMA_CTL_L(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x18 + 0x58*n))
900 #define CTLL_LLP_SRC_EN (1<<28)
901 #define CTLL_LLP_DST_EN (1<<27)
902 #define CTLL_SMS_M2 (1<<25)
903 #define CTLL_SMS_M1 (0<<25)
904 #define CTLL_DMS_M2 (1<<23)
905 #define CTLL_DMS_M1 (0<<23)
906 #define CTLL_FC_PER2PER (3<<20)
907 #define CTLL_FC_PER2MEM (2<<20)
908 #define CTLL_FC_MEM2PER (1<<20)
909 #define CTLL_FC_MEM2MEM (0<<20)
910 /* bit 19 reserved */
911 #define CTLL_DST_SCATTER_EN (1<<18)
912 #define CTLL_SRC_GATHER_EN (1<<17)
913 #define CTLL_SRC_MSIZE_32 (4<<14)
914 #define CTLL_SRC_MSIZE_16 (3<<14)
915 #define CTLL_SRC_MSIZE_8 (2<<14)
916 #define CTLL_SRC_MSIZE_4 (1<<14)
917 #define CTLL_SRC_MSIZE_1 (0<<14)
918 #define CTLL_DST_MSIZE_32 (4<<11)
919 #define CTLL_DST_MSIZE_16 (3<<11)
920 #define CTLL_DST_MSIZE_8 (2<<11)
921 #define CTLL_DST_MSIZE_4 (1<<11)
922 #define CTLL_DST_MSIZE_1 (0<<11)
923 #define CTLL_SINC_NO (2<<9)
924 #define CTLL_SINC_DEC (1<<9)
925 #define CTLL_SINC_INC (0<<9)
926 #define CTLL_DINC_NO (2<<7)
927 #define CTLL_DINC_DEC (1<<7)
928 #define CTLL_DINC_INC (0<<7)
929 #define CTLL_SRC_TR_WIDTH_32 (2<<4)
930 #define CTLL_SRC_TR_WIDTH_16 (1<<4)
931 #define CTLL_SRC_TR_WIDTH_8 (0<<4)
932 #define CTLL_DST_TR_WIDTH_32 (2<<1)
933 #define CTLL_DST_TR_WIDTH_16 (1<<1)
934 #define CTLL_DST_TR_WIDTH_8 (0<<1)
935 #define CTLL_INT_EN (1<<0)
937 #define DWDMA_CTL_H(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x1C + 0x58*n))
938 #define DWDMA_SSTAT(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x20 + 0x58*n))
939 #define DWDMA_DSTAT(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x28 + 0x58*n))
940 #define DWDMA_SSTATAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x30 + 0x58*n))
941 #define DWDMA_DSTATAR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x38 + 0x58*n))
942 #define DWDMA_CFG_L(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x40 + 0x58*n))
943 #define CFGL_RELOAD_DST (1<<31)
944 #define CFGL_RELOAD_SRC (1<<30)
945 #define CFGL_MAX_ABRST(n) ((n)<<20)
946 #define CFGL_SRC_HS_POL_LOW (1<<19)
947 #define CFGL_DST_HS_POL_LOW (1<<18)
948 #define CFGL_LOCK_B (1<<17)
949 #define CFGL_LOCK_CH (1<<16)
950 #define CFGL_LOCK_B_L(n) (((n)&0x03)<<14)
951 #define CFGL_LOCK_CH_L(n) (((n)&0x03)<<12)
952 #define CFGL_HS_SEL_SRC (1<<11)
953 #define CFGL_HS_SEL_DST (1<<10)
954 #define CFGL_FIFO_EMPTY (1<<9)
955 #define CFGL_CH_SUSP (1<<8)
956 #define CFGL_CH_PRIOR(n) (((n) & 0x03)<<5)
957 /* bits 0-4 reserved */
958 #define DWDMA_CFG_H(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x44 + 0x58*n))
959 #define CFGH_DST_PER(n) (((n)&0x0F)<<11)
960 #define CFGH_SRC_PER(n) (((n)&0x0F)<<7)
961 #define CFGH_SRC_UPD_EN (1<<6)
962 #define CFGH_DST_UPD_EN (1<<5)
963 #define CFGH_PROTCTL(n) (((n)&0x07)<<2)
964 #define CFGH_FIFO_MODE (1<<1)
965 #define CFGH_FC_MODE (1<<0)
967 #define DWDMA_SGR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x48 + 0x58*n))
968 #define DWDMA_DSR(n) (*(volatile unsigned long *)(AHB1_DWDMA + 0x50 + 0x58*n))
970 #define DWDMA_RAW_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x2C0))
971 #define DWDMA_RAW_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x2C8))
972 #define DWDMA_RAW_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x2D0))
973 #define DWDMA_RAW_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x2D8))
974 #define DWDMA_RAW_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x2E0))
976 #define DWDMA_STATUS_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x2E8))
977 #define DWDMA_STATUS_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x2F0))
978 #define DWDMA_STATUS_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x2F8))
979 #define DWDMA_STATUS_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x300))
980 #define DWDMA_STATUS_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x308))
982 #define DWDMA_MASK_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x310))
983 #define DWDMA_MASK_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x318))
984 #define DWDMA_MASK_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x320))
985 #define DWDMA_MASK_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x328))
986 #define DWDMA_MASK_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x330))
988 #define DWDMA_CLEAR_TFR (*(volatile unsigned long *)(AHB1_DWDMA + 0x338))
989 #define DWDMA_CLEAR_BLOCK (*(volatile unsigned long *)(AHB1_DWDMA + 0x340))
990 #define DWDMA_CLEAR_SRCTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x348))
991 #define DWDMA_CLEAR_DSTTRAN (*(volatile unsigned long *)(AHB1_DWDMA + 0x350))
992 #define DWDMA_CLEAR_ERR (*(volatile unsigned long *)(AHB1_DWDMA + 0x358))
994 #define DWDMA_STATUS_INT (*(volatile unsigned long *)(AHB1_DWDMA + 0x360))
996 #define DWDMA_REQ_SRC (*(volatile unsigned long *)(AHB1_DWDMA + 0x368))
997 #define DWDMA_REQ_DST (*(volatile unsigned long *)(AHB1_DWDMA + 0x370))
998 #define DWDMA_S_REQ_SRC (*(volatile unsigned long *)(AHB1_DWDMA + 0x378))
999 #define DWDMA_S_REQ_DST (*(volatile unsigned long *)(AHB1_DWDMA + 0x380))
1000 #define DWDMA_L_REQ_SRC (*(volatile unsigned long *)(AHB1_DWDMA + 0x388))
1001 #define DWDMA_L_REQ_DST (*(volatile unsigned long *)(AHB1_DWDMA + 0x390))
1003 #define DWDMA_DMA_CFG (*(volatile unsigned long *)(AHB1_DWDMA + 0x398))
1004 #define GLOB_EN (1<<0)
1005 #define DWDMA_DMA_CHEN (*(volatile unsigned long *)(AHB1_DWDMA + 0x3A0))
1006 #define DMACHEN_CH0 (0x101<<0)
1007 #define DMACHEN_CH1 (0x101<<1)
1008 #define DMACHEN_CH2 (0x101<<2)
1009 #define DMACHEN_CH3 (0x101<<3)
1011 /* ARM7 cache controller */
1012 #define ARM_CACHE_CTRL 0xEFFF0000
1013 #define DEVID (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x00))
1014 #define CACHEOP (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x04))
1015 #define CACHELKDN (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x08))
1017 #define MEMMAPA (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x10))
1018 #define MEMMAPB (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x14))
1019 #define MEMMAPC (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x18))
1020 #define MEMMAPD (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x1C))
1021 #define PFCNTRA_CTRL (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x20))
1022 #define PFCNTRA (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x24))
1023 #define PFCNTRB_CTRL (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x28))
1024 #define PFCNTRB (*(volatile unsigned long *)(ARM_CACHE_CTRL + 0x2C))
1026 /* Timer frequency */
1027 #define TIMER_FREQ 50000000