Sansa Clip+ has no button light
[kugel-rb.git] / firmware / export / s3c2440.h
blobda2ea8937f998a387682c1e349b600a665ca2edd
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Marcoen Hirschberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __S3C2440_H__
22 #define __S3C2440_H__
24 #define LCD_BUFFER_SIZE (320*240*2)
25 #define TTB_SIZE (0x4000)
26 /* must be 16Kb (0x4000) aligned */
27 #define TTB_BASE_ADDR (0x30000000 + (MEMORYSIZE*1024*1024) - TTB_SIZE)
28 #define LCD_FRAME_ADDR (TTB_BASE_ADDR - LCD_BUFFER_SIZE)
30 #define TTB_BASE ((unsigned long *)TTB_BASE_ADDR) /* End of memory */
31 #define FRAME ((unsigned short *)LCD_FRAME_ADDR) /* Right before TTB */
33 /* Memory Controllers */
35 #define BWSCON (*(volatile unsigned long *)0x48000000) /* Bus width & wait status control */
36 #define BANKCON0 (*(volatile unsigned long *)0x48000004) /* Boot ROM control */
37 #define BANKCON1 (*(volatile unsigned long *)0x48000008) /* BANK1 control */
38 #define BANKCON2 (*(volatile unsigned long *)0x4800000C) /* BANK2 control */
39 #define BANKCON3 (*(volatile unsigned long *)0x48000010) /* BANK3 control */
40 #define BANKCON4 (*(volatile unsigned long *)0x48000014) /* BANK4 control */
41 #define BANKCON5 (*(volatile unsigned long *)0x48000018) /* BANK5 control */
42 #define BANKCON6 (*(volatile unsigned long *)0x4800001C) /* BANK6 control */
43 #define BANKCON7 (*(volatile unsigned long *)0x48000020) /* BANK7 control */
44 #define REFRESH (*(volatile unsigned long *)0x48000024) /* DRAM/SDRAM refresh control */
45 #define BANKSIZE (*(volatile unsigned long *)0x48000028) /* Flexible bank size */
46 #define MRSRB6 (*(volatile unsigned long *)0x4800002C) /* Mode register set for SDRAM BANK6 */
47 #define MRSRB7 (*(volatile unsigned long *)0x48000030) /* Mode register set for SDRAM BANK7 */
49 /* USB Host Controller */
51 #define OHCI_BASE 0x49000000
53 /* Interrupt Controller */
55 #define SRCPND (*(volatile unsigned long *)0x4A000000) /* Interrupt request status */
56 #define INTMOD (*(volatile unsigned long *)0x4A000004) /* Interrupt mode control */
57 #define INTMSK (*(volatile unsigned long *)0x4A000008) /* Interrupt mask control */
58 #define PRIORITY (*(volatile unsigned long *)0x4A00000C) /* IRQ priority control */
59 #define INTPND (*(volatile unsigned long *)0x4A000010) /* Interrupt request status */
60 #define INTOFFSET (*(volatile unsigned long *)0x4A000014) /* Interrupt request source offset */
61 #define SUBSRCPND (*(volatile unsigned long *)0x4A000018) /* Sub source pending */
62 #define INTSUBMSK (*(volatile unsigned long *)0x4A00001C) /* Interrupt sub mask */
64 /* Interrupt indexes - INTOFFSET - IRQ mode only */
65 /* Arbiter 5 => Arbiter 6 Req 5 */
66 #define ADC_INTOFFSET 31 /* REQ4 */
67 #define RTC_INTOFFSET 30 /* REQ3 */
68 #define SPI1_INTOFFSET 29 /* REQ2 */
69 #define UART0_INTOFFSET 28 /* REQ1 */
70 /* Arbiter 4 => Arbiter 6 Req 4 */
71 #define IIC_INTOFFSET 27 /* REQ5 */
72 #define USBH_INTOFFSET 26 /* REQ4 */
73 #define USBD_INTOFFSET 25 /* REQ3 */
74 #define NFCON_INTOFFSET 24 /* REQ2 */
75 #define UART1_INTOFFSET 23 /* REQ1 */
76 #define SPI0_INTOFFSET 22 /* REQ0 */
77 /* Arbiter 3 => Arbiter 6 Req 3 */
78 #define SDI_INTOFFSET 21 /* REQ5 */
79 #define DMA3_INTOFFSET 20 /* REQ4 */
80 #define DMA2_INTOFFSET 19 /* REQ3 */
81 #define DMA1_INTOFFSET 18 /* REQ2 */
82 #define DMA0_INTOFFSET 17 /* REQ1 */
83 #define LCD_INTOFFSET 16 /* REQ0 */
84 /* Arbiter 2 => Arbiter 6 Req 2 */
85 #define UART2_INTOFFSET 15 /* REQ5 */
86 #define TIMER4_INTOFFSET 14 /* REQ4 */
87 #define TIMER3_INTOFFSET 13 /* REQ3 */
88 #define TIMER2_INTOFFSET 12 /* REQ2 */
89 #define TIMER1_INTOFFSET 11 /* REQ1 */
90 #define TIMER0_INTOFFSET 10 /* REQ0 */
91 /* Arbiter 1 => Arbiter 6 Req 1 */
92 #define WDT_AC97_INTOFFSET 9 /* REQ5 */
93 #define TICK_INTOFFSET 8 /* REQ4 */
94 #define nBATT_FLT_INTOFFSET 7 /* REQ3 */
95 #define CAM_INTOFFSET 6 /* REQ2 */
96 #define EINT8_23_INTOFFSET 5 /* REQ1 */
97 #define EINT4_7_INTOFFSET 4 /* REQ0 */
98 /* Arbiter 0 => Arbiter 6 Req 0 */
99 #define EINT3_INTOFFSET 3 /* REQ4 */
100 #define EINT2_INTOFFSET 2 /* REQ3 */
101 #define EINT1_INTOFFSET 1 /* REQ2 */
102 #define EINT0_INTOFFSET 0 /* REQ1 */
104 /* Interrupt bitmasks - SRCPND, INTMOD, INTMSK, INTPND */
105 /* Arbiter 5 => Arbiter 6 Req 5 */
106 #define ADC_MASK (1 << 31) /* REQ4 */
107 #define RTC_MASK (1 << 30) /* REQ3 */
108 #define SPI1_MASK (1 << 29) /* REQ2 */
109 #define UART0_MASK (1 << 28) /* REQ1 */
110 /* Arbiter 4 => Arbiter 6 Req 4 */
111 #define IIC_MASK (1 << 27) /* REQ5 */
112 #define USBH_MASK (1 << 26) /* REQ4 */
113 #define USBD_MASK (1 << 25) /* REQ3 */
114 #define NFCON_MASK (1 << 24) /* REQ2 */
115 #define UART1_MASK (1 << 23) /* REQ1 */
116 #define SPI0_MASK (1 << 22) /* REQ0 */
117 /* Arbiter 3 => Arbiter 6 Req 3 */
118 #define SDI_MASK (1 << 21) /* REQ5 */
119 #define DMA3_MASK (1 << 20) /* REQ4 */
120 #define DMA2_MASK (1 << 19) /* REQ3 */
121 #define DMA1_MASK (1 << 18) /* REQ2 */
122 #define DMA0_MASK (1 << 17) /* REQ1 */
123 #define LCD_MASK (1 << 16) /* REQ0 */
124 /* Arbiter 2 => Arbiter 6 Req 2 */
125 #define UART2_MASK (1 << 15) /* REQ5 */
126 #define TIMER4_MASK (1 << 14) /* REQ4 */
127 #define TIMER3_MASK (1 << 13) /* REQ3 */
128 #define TIMER2_MASK (1 << 12) /* REQ2 */
129 #define TIMER1_MASK (1 << 11) /* REQ1 */
130 #define TIMER0_MASK (1 << 10) /* REQ0 */
131 /* Arbiter 1 => Arbiter 6 Req 1 */
132 #define WDT_AC97_MASK (1 << 9) /* REQ5 */
133 #define TICK_MASK (1 << 8) /* REQ4 */
134 #define nBATT_FLT_MASK (1 << 7) /* REQ3 */
135 #define CAM_MASK (1 << 6) /* REQ2 */
136 #define EINT8_23_MASK (1 << 5) /* REQ1 */
137 #define EINT4_7_MASK (1 << 4) /* REQ0 */
138 /* Arbiter 0 => Arbiter 6 Req 0 */
139 #define EINT3_MASK (1 << 3) /* REQ4 */
140 #define EINT2_MASK (1 << 2) /* REQ3 */
141 #define EINT1_MASK (1 << 1) /* REQ2 */
142 #define EINT0_MASK (1 << 0) /* REQ1 */
144 /* DMA */
146 #define DISRC0 (*(volatile unsigned long *)0x4B000000) /* DMA 0 initial source */
147 #define DISRCC0 (*(volatile unsigned long *)0x4B000004) /* DMA 0 initial source control */
148 #define DIDST0 (*(volatile unsigned long *)0x4B000008) /* DMA 0 initial destination */
149 #define DIDSTC0 (*(volatile unsigned long *)0x4B00000C) /* DMA 0 initial destination control */
150 #define DCON0 (*(volatile unsigned long *)0x4B000010) /* DMA 0 control */
151 #define DSTAT0 (*(volatile unsigned long *)0x4B000014) /* DMA 0 count */
152 #define DCSRC0 (*(volatile unsigned long *)0x4B000018) /* DMA 0 current source */
153 #define DCDST0 (*(volatile unsigned long *)0x4B00001C) /* DMA 0 current destination */
154 #define DMASKTRIG0 (*(volatile unsigned long *)0x4B000020) /* DMA 0 mask trigger */
155 #define DISRC1 (*(volatile unsigned long *)0x4B000040) /* DMA 1 initial source */
156 #define DISRCC1 (*(volatile unsigned long *)0x4B000044) /* DMA 1 initial source control */
157 #define DIDST1 (*(volatile unsigned long *)0x4B000048) /* DMA 1 initial destination */
158 #define DIDSTC1 (*(volatile unsigned long *)0x4B00004C) /* DMA 1 initial destination control */
159 #define DCON1 (*(volatile unsigned long *)0x4B000050) /* DMA 1 control */
160 #define DSTAT1 (*(volatile unsigned long *)0x4B000054) /* DMA 1 count */
161 #define DCSRC1 (*(volatile unsigned long *)0x4B000058) /* DMA 1 current source */
162 #define DCDST1 (*(volatile unsigned long *)0x4B00005C) /* DMA 1 current destination */
163 #define DMASKTRIG1 (*(volatile unsigned long *)0x4B000060) /* DMA 1 mask trigger */
164 #define DISRC2 (*(volatile unsigned long *)0x4B000080) /* DMA 2 initial source */
165 #define DISRCC2 (*(volatile unsigned long *)0x4B000084) /* DMA 2 initial source control */
166 #define DIDST2 (*(volatile unsigned long *)0x4B000088) /* DMA 2 initial destination */
167 #define DIDSTC2 (*(volatile unsigned long *)0x4B00008C) /* DMA 2 initial destination control */
168 #define DCON2 (*(volatile unsigned long *)0x4B000090) /* DMA 2 control */
169 #define DSTAT2 (*(volatile unsigned long *)0x4B000094) /* DMA 2 count */
170 #define DCSRC2 (*(volatile unsigned long *)0x4B000098) /* DMA 2 current source */
171 #define DCDST2 (*(volatile unsigned long *)0x4B00009C) /* DMA 2 current destination */
172 #define DMASKTRIG2 (*(volatile unsigned long *)0x4B0000A0) /* DMA 2 mask trigger */
173 #define DISRC3 (*(volatile unsigned long *)0x4B0000C0) /* DMA 3 initial source */
174 #define DISRCC3 (*(volatile unsigned long *)0x4B0000C4) /* DMA 3 initial source control */
175 #define DIDST3 (*(volatile unsigned long *)0x4B0000C8) /* DMA 3 initial destination */
176 #define DIDSTC3 (*(volatile unsigned long *)0x4B0000CC) /* DMA 3 initial destination control */
177 #define DCON3 (*(volatile unsigned long *)0x4B0000D0) /* DMA 3 control */
178 #define DSTAT3 (*(volatile unsigned long *)0x4B0000D4) /* DMA 3 count */
179 #define DCSRC3 (*(volatile unsigned long *)0x4B0000D8) /* DMA 3 current source */
180 #define DCDST3 (*(volatile unsigned long *)0x4B0000DC) /* DMA 3 current destination */
181 #define DMASKTRIG3 (*(volatile unsigned long *)0x4B0000E0) /* DMA 3 mask trigger */
183 #define DISRCC_LOC_AHB (0 << 1)
184 #define DISRCC_LOC_APB (1 << 1)
185 #define DISRCC_INC_AUTO (0 << 0)
186 #define DISRCC_INC_FIXED (1 << 0)
188 #define DIDSTC_CHK_INT_TC_ZERO (0 << 2)
189 #define DIDSTC_CHK_INT_AFTER_RELOAD (1 << 2)
190 #define DIDSTC_LOC_AHB (0 << 1)
191 #define DIDSTC_LOC_APB (1 << 1)
192 #define DIDSTC_INC_AUTO (0 << 0)
193 #define DIDSTC_INC_FIXED (1 << 0)
195 #define DCON_DMD_HS (1 << 31)
196 #define DCON_SYNC_APB (0 << 30)
197 #define DCON_SYNC_AHB (1 << 30)
198 #define DCON_INT (1 << 29)
199 #define DCON_TSZ (1 << 28)
200 #define DCON_SERVMODE_WHOLE (1 << 27)
201 #define DCON_HWSRCSEL (1 << 24)
202 #define DCON_HW_SEL (1 << 23)
203 #define DCON_NO_RELOAD (1 << 22)
204 #define DCON_DSZ_MASK (3 << 20)
205 #define DCON_DSZ_BYTE (0 << 20)
206 #define DCON_DSZ_HALF_WORD (1 << 20)
207 #define DCON_DSZ_WORD (2 << 20)
208 #define DCON_TC (1 << 0)
210 #define DSTAT_STAT_BUSY (1 << 20)
211 #define DSTAT_CURR_TC (1 << 0)
213 #define DMASKTRIG_STOP (1 << 2)
214 #define DMASKTRIG_ON (1 << 1)
215 #define DMASKTRIG_SW_TRIG (1 << 0)
217 /* Get DMA request source (HWSRCSEL) from the map for the specified channel */
218 #define DMA_GET_SRC(map,channel) ( ((map) << (channel*8)) & 0xff)
220 #define DMA_CH0(x) (x<<0)
221 #define DMA_CH1(x) (x<<8)
222 #define DMA_CH2(x) (x<<16)
223 #define DMA_CH3(x) (x<<24)
225 #define DMA_INVALID 0xff
226 #define DMA_INV0 DMA_CH0(DMA_INVALID)
227 #define DMA_INV1 DMA_CH1(DMA_INVALID)
228 #define DMA_INV2 DMA_CH2(DMA_INVALID)
229 #define DMA_INV3 DMA_CH3(DMA_INVALID)
231 /* This map encodes the DMA request source field (HWSRCSEL) since it's value
232 * depends on channel number and peripheral type.
234 #define DMA_SRC_MAP_XDREQ0 (DMA_CH0(0) | DMA_INV1 | DMA_INV2 | DMA_INV3)
235 #define DMA_SRC_MAP_XDREQ1 (DMA_INV0 | DMA_CH1(0) | DMA_INV2 | DMA_INV3)
236 #define DMA_SRC_MAP_USB_EP1 (DMA_CH0(4) | DMA_INV1 | DMA_INV2 | DMA_INV3)
237 #define DMA_SRC_MAP_USB_EP2 (DMA_INV0 | DMA_CH1(4) | DMA_INV2 | DMA_INV3)
238 #define DMA_SRC_MAP_USB_EP3 (DMA_INV0 | DMA_INV1 | DMA_CH2(4) | DMA_INV3)
239 #define DMA_SRC_MAP_USB_EP4 (DMA_INV0 | DMA_INV1 | DMA_INV2 | DMA_CH3(4))
240 #define DMA_SRC_MAP_SDI (DMA_CH0(2) | DMA_CH1(6) | DMA_CH2(2) | DMA_CH3(1))
241 #define DMA_SRC_MAP_UART0 (DMA_CH0(1) | DMA_INV1 | DMA_INV2 | DMA_INV3)
242 #define DMA_SRC_MAP_UART1 (DMA_INV0 | DMA_CH1(1) | DMA_INV2 | DMA_INV3)
243 #define DMA_SRC_MAP_UART2 (DMA_INV0 | DMA_INV1 | DMA_INV2 | DMA_CH3(0))
244 #define DMA_SRC_MAP_I2SSDO (DMA_CH0(5) | DMA_INV1 | DMA_CH2(0) | DMA_INV3)
245 #define DMA_SRC_MAP_I2SSDI (DMA_INV0 | DMA_CH1(2) | DMA_CH2(1) | DMA_INV3)
246 #define DMA_SRC_MAP_PCMOUT (DMA_INV0 | DMA_CH1(5) | DMA_INV2 | DMA_CH3(6))
247 #define DMA_SRC_MAP_PCMIN (DMA_CH0(6) | DMA_INV1 | DMA_CH2(5) | DMA_INV3)
248 #define DMA_SRC_MAP_MICIN (DMA_INV0 | DMA_INV1 | DMA_CH2(6) | DMA_CH3(5))
249 #define DMA_SRC_MAP_SPI0 (DMA_INV0 | DMA_CH1(3) | DMA_INV2 | DMA_INV3)
250 #define DMA_SRC_MAP_SPI1 (DMA_INV0 | DMA_INV1 | DMA_INV2 | DMA_CH3(2))
251 #define DMA_SRC_MAP_TIMER (DMA_CH0(3) | DMA_INV1 | DMA_CH2(3) | DMA_CH3(3))
253 /* Clock & Power Management */
255 #define LOCKTIME (*(volatile unsigned long *)0x4C000000) /* PLL lock time counter */
256 #define MPLLCON (*(volatile unsigned long *)0x4C000004) /* MPLL control */
257 #define UPLLCON (*(volatile unsigned long *)0x4C000008) /* UPLL control */
258 #define CLKCON (*(volatile unsigned long *)0x4C00000C) /* Clock generator control */
259 #define CLKSLOW (*(volatile unsigned long *)0x4C000010) /* Slow clock control */
260 #define CLKDIVN (*(volatile unsigned long *)0x4C000014) /* Clock divider control */
261 #define CAMDIVN (*(volatile unsigned long *)0x4C000018) /* Camera clock divider control */
263 /* LCD Controller */
265 #define LCDCON1 (*(volatile unsigned long *)0x4D000000) /* LCD control 1 */
266 #define LCDCON2 (*(volatile unsigned long *)0x4D000004) /* LCD control 2 */
267 #define LCDCON3 (*(volatile unsigned long *)0x4D000008) /* LCD control 3 */
268 #define LCDCON4 (*(volatile unsigned long *)0x4D00000C) /* LCD control 4 */
269 #define LCDCON5 (*(volatile unsigned long *)0x4D000010) /* LCD control 5 */
270 #define LCDSADDR1 (*(volatile unsigned long *)0x4D000014) /* STN/TFT: frame buffer start address 1 */
271 #define LCDSADDR2 (*(volatile unsigned long *)0x4D000018) /* STN/TFT: frame buffer start address 2 */
272 #define LCDSADDR3 (*(volatile unsigned long *)0x4D00001C) /* STN/TFT: virtual screen address set */
273 #define REDLUT (*(volatile unsigned long *)0x4D000020) /* STN: red lookup table */
274 #define GREENLUT (*(volatile unsigned long *)0x4D000024) /* STN: green lookup table */
275 #define BLUELUT (*(volatile unsigned long *)0x4D000028) /* STN: blue lookup table */
276 #define DITHMODE (*(volatile unsigned long *)0x4D00004C) /* STN: dithering mode */
277 #define TPAL (*(volatile unsigned long *)0x4D000050) /* TFT: temporary palette */
278 #define LCDINTPND (*(volatile unsigned long *)0x4D000054) /* LCD interrupt pending */
279 #define LCDSRCPND (*(volatile unsigned long *)0x4D000058) /* LCD interrupt source */
280 #define LCDINTMSK (*(volatile unsigned long *)0x4D00005C) /* LCD interrupt mask */
281 #define TCONSEL (*(volatile unsigned long *)0x4D000060) /* TCON(LPC3600/LCC3600) control */
283 /* NAND Flash */
285 #define NFCONF (*(volatile unsigned long *)0x4E000000) /* NAND flash configuration */
286 #define NFCONT (*(volatile unsigned long *)0x4E000004) /* NAND flash control */
287 #define NFCMD (*(volatile unsigned long *)0x4E000008) /* NAND flash command */
288 #define NFADDR (*(volatile unsigned long *)0x4E00000C) /* NAND flash address */
289 #define NFDATA (*(volatile unsigned long *)0x4E000010) /* NAND flash data */
290 #define NFMECC0 (*(volatile unsigned long *)0x4E000014) /* NAND flash main area ECC0/1 */
291 #define NFMECC1 (*(volatile unsigned long *)0x4E000018) /* NAND flash main area ECC2/3 */
292 #define NFSECC (*(volatile unsigned long *)0x4E00001C) /* NAND flash spare area ECC */
293 #define NFSTAT (*(volatile unsigned long *)0x4E000020) /* NAND flash operation status */
294 #define NFESTAT0 (*(volatile unsigned long *)0x4E000024) /* NAND flash ECC status for I/O[7:0] */
295 #define NFESTAT1 (*(volatile unsigned long *)0x4E000028) /* NAND flash ECC status for I/O[15:8] */
296 #define NFMECCSTAT0 (*(volatile unsigned long *)0x4E00002C) /* NAND flash main area ECC0 status */
297 #define NFMECCSTAT1 (*(volatile unsigned long *)0x4E000030) /* NAND flash main area ECC1 status */
298 #define NFSECCSTAT (*(volatile unsigned long *)0x4E000034) /* NAND flash spare area ECC status */
299 #define NFSBLK (*(volatile unsigned long *)0x4E000038) /* NAND flash start block address */
300 #define NFEBLK (*(volatile unsigned long *)0x4E00003C) /* NAND flash end block address */
302 /* Camera Interface */
304 #define CISRCFMT (*(volatile unsigned long *)0x4F000000) /* Input source format */
305 #define CIWDOFST (*(volatile unsigned long *)0x4F000004) /* Window offset register */
306 #define CIGCTRL (*(volatile unsigned long *)0x4F000008) /* Global control register */
307 #define CICOYSA1 (*(volatile unsigned long *)0x4F000018) /* Y 1st frame start address for codec DMA */
308 #define CICOYSA2 (*(volatile unsigned long *)0x4F00001C) /* Y 2nd frame start address for codec DMA */
309 #define CICOYSA3 (*(volatile unsigned long *)0x4F000020) /* Y 3nd frame start address for codec DMA */
310 #define CICOYSA4 (*(volatile unsigned long *)0x4F000024) /* Y 4th frame start address for codec DMA */
311 #define CICOCBSA1 (*(volatile unsigned long *)0x4F000028) /* Cb 1st frame start address for codec DMA */
312 #define CICOCBSA2 (*(volatile unsigned long *)0x4F00002C) /* Cb 2nd frame start address for codec DMA */
313 #define CICOCBSA3 (*(volatile unsigned long *)0x4F000030) /* Cb 3nd frame start address for codec DMA */
314 #define CICOCBSA4 (*(volatile unsigned long *)0x4F000034) /* Cb 4th frame start address for codec DMA */
315 #define CICOCRSA1 (*(volatile unsigned long *)0x4F000038) /* Cr 1st frame start address for codec DMA */
316 #define CICOCRSA2 (*(volatile unsigned long *)0x4F00003C) /* Cr 2nd frame start address for codec DMA */
317 #define CICOCRSA3 (*(volatile unsigned long *)0x4F000040) /* Cr 3nd frame start address for codec DMA */
318 #define CICOCRSA4 (*(volatile unsigned long *)0x4F000044) /* Cr 4th frame start address for codec DMA */
319 #define CICOTRGFMT (*(volatile unsigned long *)0x4F000048) /* Target image format of codec DMA */
320 #define CICOCTRL (*(volatile unsigned long *)0x4F00004C)
322 /* Codec DMA control related */
324 #define CICOSCPRERATIO (*(volatile unsigned long *)0x4F000050) /* Codec pre-scaler ratio control */
325 #define CICOSCPREDST (*(volatile unsigned long *)0x4F000054) /* Codec pre-scaler destination format */
326 #define CICOSCCTRL (*(volatile unsigned long *)0x4F000058) /* Codec main-scaler control */
327 #define CICOTAREA (*(volatile unsigned long *)0x4F00005C) /* Codec scaler target area */
328 #define CICOSTATUS (*(volatile unsigned long *)0x4F000064) /* Codec path status */
329 #define CIPRCLRSA1 (*(volatile unsigned long *)0x4F00006C) /* RGB 1st frame start address for preview DMA */
330 #define CIPRCLRSA2 (*(volatile unsigned long *)0x4F000070) /* RGB 2nd frame start address for preview DMA */
331 #define CIPRCLRSA3 (*(volatile unsigned long *)0x4F000074) /* RGB 3nd frame start address for preview DMA */
332 #define CIPRCLRSA4 (*(volatile unsigned long *)0x4F000078) /* RGB 4th frame start address for preview DMA */
333 #define CIPRTRGFMT (*(volatile unsigned long *)0x4F00007C) /* Target image format of preview DMA */
334 #define CIPRCTRL (*(volatile unsigned long *)0x4F000080) /* Preview DMA control related */
335 #define CIPRSCPRERATIO (*(volatile unsigned long *)0x4F000084) /* Preview pre-scaler ratio control */
336 #define CIPRSCPREDST (*(volatile unsigned long *)0x4F000088) /* Preview pre-scaler destination format */
337 #define CIPRSCCTRL (*(volatile unsigned long *)0x4F00008C) /* Preview main-scaler control */
338 #define CIPRTAREA (*(volatile unsigned long *)0x4F000090) /* Preview scaler target area */
339 #define CIPRSTATUS (*(volatile unsigned long *)0x4F000098) /* Preview path status */
340 #define CIIMGCPT (*(volatile unsigned long *)0x4F0000A0) /* Image capture enable command */
342 /* UART */
344 #define ULCON0 (*(volatile unsigned long *)0x50000000) /* UART 0 line control */
345 #define UCON0 (*(volatile unsigned long *)0x50000004) /* UART 0 control */
346 #define UFCON0 (*(volatile unsigned long *)0x50000008) /* UART 0 FIFO control */
347 #define UMCON0 (*(volatile unsigned long *)0x5000000C) /* UART 0 modem control */
348 #define UTRSTAT0 (*(volatile unsigned long *)0x50000010) /* UART 0 Tx/Rx status */
349 #define UERSTAT0 (*(volatile unsigned long *)0x50000014) /* UART 0 Rx error status */
350 #define UFSTAT0 (*(volatile unsigned long *)0x50000018) /* UART 0 FIFO status */
351 #define UMSTAT0 (*(volatile unsigned long *)0x5000001C) /* UART 0 modem status */
352 #define UTXH0 (*(volatile unsigned char *)0x50000020) /* UART 0 transmission hold */
353 #define URXH0 (*(volatile unsigned char *)0x50000024) /* UART 0 receive buffer */
354 #define UBRDIV0 (*(volatile unsigned long *)0x50000028) /* UART 0 baud rate divisor */
355 #define ULCON1 (*(volatile unsigned long *)0x50004000) /* UART 1 line control */
356 #define UCON1 (*(volatile unsigned long *)0x50004004) /* UART 1 control */
357 #define UFCON1 (*(volatile unsigned long *)0x50004008) /* UART 1 FIFO control */
358 #define UMCON1 (*(volatile unsigned long *)0x5000400C) /* UART 1 modem control */
359 #define UTRSTAT1 (*(volatile unsigned long *)0x50004010) /* UART 1 Tx/Rx status */
360 #define UERSTAT1 (*(volatile unsigned long *)0x50004014) /* UART 1 Rx error status */
361 #define UFSTAT1 (*(volatile unsigned long *)0x50004018) /* UART 1 FIFO status */
362 #define UMSTAT1 (*(volatile unsigned long *)0x5000401C) /* UART 1 modem status */
363 #define UTXH1 (*(volatile unsigned char*)0x50004020) /* UART 1 transmission hold */
364 #define URXH1 (*(volatile unsigned char*)0x50004024) /* UART 1 receive buffer */
365 #define UBRDIV1 (*(volatile unsigned long *)0x50004028) /* UART 1 baud rate divisor */
366 #define ULCON2 (*(volatile unsigned long *)0x50008000) /* UART 2 line control */
367 #define UCON2 (*(volatile unsigned long *)0x50008004) /* UART 2 control */
368 #define UFCON2 (*(volatile unsigned long *)0x50008008) /* UART 2 FIFO control */
369 #define UTRSTAT2 (*(volatile unsigned long *)0x50008010) /* UART 2 Tx/Rx status */
370 #define UERSTAT2 (*(volatile unsigned long *)0x50008014) /* UART 2 Rx error status */
371 #define UFSTAT2 (*(volatile unsigned long *)0x50008018) /* UART 2 FIFO status */
372 #define UTXH2 (*(volatile unsigned char*)0x50008020) /* UART 2 transmission hold */
373 #define URXH2 (*(volatile unsigned char*)0x50008024) /* UART 2 receive buffer */
374 #define UBRDIV2 (*(volatile unsigned long *)0x50008028) /* UART 2 baud rate divisor */
376 /* PWM Timer */
378 #define TCFG0 (*(volatile unsigned long *)0x51000000) /* Timer configuration */
379 #define TCFG1 (*(volatile unsigned long *)0x51000004) /* Timer configuration */
380 #define TCON (*(volatile unsigned long *)0x51000008) /* Timer control */
381 #define TCNTB0 (*(volatile unsigned long *)0x5100000C) /* Timer count buffer 0 */
382 #define TCMPB0 (*(volatile unsigned long *)0x51000010) /* Timer compare buffer 0 */
383 #define TCNTO0 (*(volatile unsigned long *)0x51000014) /* Timer count observation 0 */
384 #define TCNTB1 (*(volatile unsigned long *)0x51000018) /* Timer count buffer 1 */
385 #define TCMPB1 (*(volatile unsigned long *)0x5100001C) /* Timer compare buffer 1 */
386 #define TCNTO1 (*(volatile unsigned long *)0x51000020) /* Timer count observation 1 */
387 #define TCNTB2 (*(volatile unsigned long *)0x51000024) /* Timer count buffer 2 */
388 #define TCMPB2 (*(volatile unsigned long *)0x51000028) /* Timer compare buffer 2 */
389 #define TCNTO2 (*(volatile unsigned long *)0x5100002C) /* Timer count observation 2 */
390 #define TCNTB3 (*(volatile unsigned long *)0x51000030) /* Timer count buffer 3 */
391 #define TCMPB3 (*(volatile unsigned long *)0x51000034) /* Timer compare buffer 3 */
392 #define TCNTO3 (*(volatile unsigned long *)0x51000038) /* Timer count observation 3 */
393 #define TCNTB4 (*(volatile unsigned long *)0x5100003C) /* Timer count buffer 4 */
394 #define TCNTO4 (*(volatile unsigned long *)0x51000040) /* Timer count observation 4 */
396 /* USB Device */
398 #define FUNC_ADDR_REG (*(volatile unsigned char *)0x52000140) /* Function address */
399 #define PWR_REG (*(volatile unsigned char *)0x52000144) /* Power management */
400 #define EP_INT_REG (*(volatile unsigned char *)0x52000148) /* EP interrupt pending and clear */
401 #define USB_INT_REG (*(volatile unsigned char *)0x52000158) /* USB interrupt pending and clear */
402 #define EP_INT_EN_REG (*(volatile unsigned char *)0x5200015C) /* Interrupt enable */
403 #define USB_INT_EN_REG (*(volatile unsigned char *)0x5200016C) /* Interrupt enable */
404 #define FRAME_NUM1_REG (*(volatile unsigned char *)0x52000170) /* Frame number lower byte */
405 #define FRAME_NUM2_REG (*(volatile unsigned char *)0x52000174) /* Frame number higher byte */
406 #define INDEX_REG (*(volatile unsigned char *)0x52000178) /* Register index */
407 #define EP0_CSR (*(volatile unsigned char *)0x52000184) /* Endpoint 0 status */
408 #define IN_CSR1_REG (*(volatile unsigned char *)0x52000184) /* In endpoint control status */
409 #define IN_CSR2_REG (*(volatile unsigned char *)0x52000188) /* In endpoint control status */
410 #define MAXP_REG (*(volatile unsigned char *)0x52000180) /* Endpoint max packet */
411 #define OUT_CSR1_REG (*(volatile unsigned char *)0x52000190) /* Out endpoint control status */
412 #define OUT_CSR2_REG (*(volatile unsigned char *)0x52000194) /* Out endpoint control status */
413 #define OUT_FIFO_CNT1_REG (*(volatile unsigned char *)0x52000198) /* Endpoint out write count */
414 #define OUT_FIFO_CNT2_REG (*(volatile unsigned char *)0x5200019C) /* Endpoint out write count */
415 #define EP0_FIFO (*(volatile unsigned char *)0x520001C0) /* Endpoint 0 FIFO */
416 #define EP1_FIFO (*(volatile unsigned char *)0x520001C4) /* Endpoint 1 FIFO */
417 #define EP2_FIFO (*(volatile unsigned char *)0x520001C8) /* Endpoint 2 FIFO */
418 #define EP3_FIFO (*(volatile unsigned char *)0x520001CC) /* Endpoint 3 FIFO */
419 #define EP4_FIFO (*(volatile unsigned char *)0x520001D0) /* Endpoint 4 FIFO */
420 #define EP1_DMA_CON (*(volatile unsigned char *)0x52000200) /* EP1 DMA Interface control */
421 #define EP1_DMA_UNIT (*(volatile unsigned char *)0x52000204) /* EP1 DMA Tx unit counter */
422 #define EP1_DMA_FIFO (*(volatile unsigned char *)0x52000208) /* EP1 DMA Tx FIFO counter */
423 #define EP1_DMA_TTC_L (*(volatile unsigned char *)0x5200020C) /* EP1 DMA Total Tx counter */
424 #define EP1_DMA_TTC_M (*(volatile unsigned char *)0x52000210) /* EP1 DMA Total Tx counter */
425 #define EP1_DMA_TTC_H (*(volatile unsigned char *)0x52000214) /* EP1 DMA Total Tx counter */
426 #define EP2_DMA_CON (*(volatile unsigned char *)0x52000218) /* EP2 DMA interface control */
427 #define EP2_DMA_UNIT (*(volatile unsigned char *)0x5200021C) /* EP2 DMA Tx Unit counter */
428 #define EP2_DMA_FIFO (*(volatile unsigned char *)0x52000220) /* EP2 DMA Tx FIFO counter */
429 #define EP2_DMA_TTC_L (*(volatile unsigned char *)0x52000224) /* EP2 DMA total Tx counter */
430 #define EP2_DMA_TTC_M (*(volatile unsigned char *)0x52000228) /* EP2 DMA total Tx counter */
431 #define EP2_DMA_TTC_H (*(volatile unsigned char *)0x5200022C) /* EP2 DMA Total Tx counter */
432 #define EP3_DMA_CON (*(volatile unsigned char *)0x52000240) /* EP3 DMA Interface control */
433 #define EP3_DMA_UNIT (*(volatile unsigned char *)0x52000244) /* EP3 DMA Tx Unit counter */
434 #define EP3_DMA_FIFO (*(volatile unsigned char *)0x52000248) /* EP3 DMA Tx FIFO counter */
435 #define EP3_DMA_TTC_L (*(volatile unsigned char *)0x5200024C) /* EP3 DMA Total Tx counter */
436 #define EP3_DMA_TTC_M (*(volatile unsigned char *)0x52000250) /* EP3 DMA Total Tx counter */
437 #define EP3_DMA_TTC_H (*(volatile unsigned char *)0x52000254) /* EP3 DMA Total Tx counter */
438 #define EP4_DMA_CON (*(volatile unsigned char *)0x52000258) /* EP4 DMA Interface control */
439 #define EP4_DMA_UNIT (*(volatile unsigned char *)0x5200025C) /* EP4 DMA Tx Unit counter */
440 #define EP4_DMA_FIFO (*(volatile unsigned char *)0x52000260) /* EP4 DMA Tx FIFO counter */
441 #define EP4_DMA_TTC_L (*(volatile unsigned char *)0x52000264) /* EP4 DMA Total Tx counter */
442 #define EP4_DMA_TTC_M (*(volatile unsigned char *)0x52000268) /* EP4 DMA Total Tx counter */
443 #define EP4_DMA_TTC_H (*(volatile unsigned char *)0x5200026C) /* EP4 DMA Total Tx counter */
445 /* Watchdog Timer */
447 #define WTCON (*(volatile unsigned long *)0x53000000) /* Watchdog timer mode */
448 #define WTDAT (*(volatile unsigned long *)0x53000004) /* Watchdog timer data */
449 #define WTCNT (*(volatile unsigned long *)0x53000008) /* Watchdog timer count */
451 /* IIC */
453 #define IICCON (*(volatile unsigned long *)0x54000000) /* IIC control */
454 #define IICSTAT (*(volatile unsigned long *)0x54000004) /* IIC status */
455 #define IICADD (*(volatile unsigned long *)0x54000008) /* IIC address */
456 #define IICDS (*(volatile unsigned long *)0x5400000C) /* IIC data shift */
457 #define IICLC (*(volatile unsigned long *)0x54000010) /* IIC multi-master line control */
459 /* IIS */
461 #define IISCON (*(volatile unsigned long *)0x55000000) /* IIS control */
462 #define IISMOD (*(volatile unsigned long *)0x55000004) /* IIS mode */
463 #define IISPSR (*(volatile unsigned long *)0x55000008) /* IIS prescaler */
464 #define IISFCON (*(volatile unsigned long *)0x5500000C) /* IIS FIFO control */
465 #define IISFIFO (*(volatile unsigned short *)0x55000010) /* IIS FIFO entry */
467 #define IISCON_RIGHT_CHANNEL (1 << 8)
468 #define IISCON_TX_FIFO_NOT_EMPTY (1 << 7)
469 #define IISCON_RX_FIFO_NOT_FULL (1 << 6)
470 #define IISCON_TX_DMA_REQUEST (1 << 5)
471 #define IISCON_RX_DMA_REQUEST (1 << 4)
472 #define IISCON_TX_IDLE (1 << 3)
473 #define IISCON_RX_IDLE (1 << 2)
474 #define IISCON_IIS_PRESCALER_ENABLE (1 << 1)
475 #define IISCON_IIS_INTERFACE_ENABLE (1 << 0)
477 #define IISMOD_MASTER_CLOCK_PCLK (0 << 9)
478 #define IISMOD_MASTER_CLOCK_MPLLIN (1 << 9)
479 #define IISMOD_MASTER_MODE (0 << 8)
480 #define IISMOD_SLAVE_MODE (1 << 8)
481 #define IISMOD_NO_TRANSFER (0 << 6)
482 #define IISMOD_RECEIVE_MODE (1 << 6)
483 #define IISMOD_TRANSMIT_MODE (2 << 6)
484 #define IISMOD_TRANSMIT_RECEIVE_MODE (3 << 6)
485 #define IISMOD_LOW_LEFT (0 << 5)
486 #define IISMOD_HIGH_LEFT (1 << 5)
487 #define IISMOD_IIS (0 << 4)
488 #define IISMOD_MSB (1 << 4)
489 #define IISMOD_8_BIT (0 << 3)
490 #define IISMOD_16_BIT (1 << 3)
491 #define IISMOD_MASTER_CLOCK_256FS (0 << 2)
492 #define IISMOD_MASTER_CLOCK_384FS (1 << 2)
493 #define IISMOD_BIT_CLOCK_16FS (0 << 0)
494 #define IISMOD_BIT_CLOCK_32FS (1 << 0)
495 #define IISMOD_BIT_CLOCK_48FS (2 << 0)
497 #define IISPSR_PRESCALER_A (1 << 5)
498 #define IISPSR_PRESCALER_B (1 << 0)
500 /* I/O port */
502 #define GPACON (*(volatile unsigned long *)0x56000000) /* Port A control */
503 #define GPADAT (*(volatile unsigned long *)0x56000004) /* Port A data */
504 #define GPBCON (*(volatile unsigned long *)0x56000010) /* Port B control */
505 #define GPBDAT (*(volatile unsigned long *)0x56000014) /* Port B data */
506 #define GPBUP (*(volatile unsigned long *)0x56000018) /* Pull-up control B */
507 #define GPCCON (*(volatile unsigned long *)0x56000020) /* Port C control */
508 #define GPCDAT (*(volatile unsigned long *)0x56000024) /* Port C data */
509 #define GPCUP (*(volatile unsigned long *)0x56000028) /* Pull-up control C */
510 #define GPDCON (*(volatile unsigned long *)0x56000030) /* Port D control */
511 #define GPDDAT (*(volatile unsigned long *)0x56000034) /* Port D data */
512 #define GPDUP (*(volatile unsigned long *)0x56000038) /* Pull-up control D */
513 #define GPECON (*(volatile unsigned long *)0x56000040) /* Port E control */
514 #define GPEDAT (*(volatile unsigned long *)0x56000044) /* Port E data */
515 #define GPEUP (*(volatile unsigned long *)0x56000048) /* Pull-up control E */
516 #define GPFCON (*(volatile unsigned long *)0x56000050) /* Port F control */
517 #define GPFDAT (*(volatile unsigned long *)0x56000054) /* Port F data */
518 #define GPFUP (*(volatile unsigned long *)0x56000058) /* Pull-up control F */
519 #define GPGCON (*(volatile unsigned long *)0x56000060) /* Port G control */
520 #define GPGDAT (*(volatile unsigned long *)0x56000064) /* Port G data */
521 #define GPGUP (*(volatile unsigned long *)0x56000068) /* Pull-up control G */
522 #define GPHCON (*(volatile unsigned long *)0x56000070) /* Port H control */
523 #define GPHDAT (*(volatile unsigned long *)0x56000074) /* Port H data */
524 #define GPHUP (*(volatile unsigned long *)0x56000078) /* Pull-up control H */
525 #define MISCCR (*(volatile unsigned long *)0x56000080) /* Miscellaneous control */
526 #define DCLKCON (*(volatile unsigned long *)0x56000084) /* DCLK0/1 control */
527 #define EXTINT0 (*(volatile unsigned long *)0x56000088) /* External interrupt control register 0 */
528 #define EXTINT1 (*(volatile unsigned long *)0x5600008C) /* External interrupt control register 1 */
529 #define EXTINT2 (*(volatile unsigned long *)0x56000090) /* External interrupt control register 2 */
530 #define EINTFLT0 (*(volatile unsigned long *)0x56000094) /* Reserved */
531 #define EINTFLT1 (*(volatile unsigned long *)0x56000098) /* Reserved */
532 #define EINTFLT2 (*(volatile unsigned long *)0x5600009C) /* External interrupt filter control register 2 */
533 #define EINTFLT3 (*(volatile unsigned long *)0x560000A0) /* External interrupt filter control register 3 */
534 #define EINTMASK (*(volatile unsigned long *)0x560000A4) /* External interrupt mask */
535 #define EINTPEND (*(volatile unsigned long *)0x560000A8) /* External interrupt pending */
536 #define GSTATUS0 (*(volatile unsigned long *)0x560000AC) /* External pin status */
537 #define GSTATUS1 (*(volatile unsigned long *)0x560000B0) /* Chip ID */
538 #define GSTATUS2 (*(volatile unsigned long *)0x560000B4) /* Reset status */
539 #define GSTATUS3 (*(volatile unsigned long *)0x560000B8) /* Inform register */
540 #define GSTATUS4 (*(volatile unsigned long *)0x560000BC) /* Inform register */
541 #define MSLCON (*(volatile unsigned long *)0x560000CC) /* Memory sleep control register */
542 #define GPJCON (*(volatile unsigned long *)0x560000D0) /* Port J control */
543 #define GPJDAT (*(volatile unsigned long *)0x560000D4) /* Port J data */
544 #define GPJUP (*(volatile unsigned long *)0x560000D8) /* Pull-up control J */
546 /* RTC */
548 #define RTCCON (*(volatile unsigned char *)0x57000040) /* RTC control */
549 #define TICNT (*(volatile unsigned char *)0x57000044) /* Tick time count */
550 #define RTCALM (*(volatile unsigned char *)0x57000050) /* RTC alarm control */
551 #define ALMSEC (*(volatile unsigned char *)0x57000054) /* Alarm second */
552 #define ALMMIN (*(volatile unsigned char *)0x57000058) /* Alarm minute */
553 #define ALMHOUR (*(volatile unsigned char *)0x5700005C) /* Alarm hour */
554 #define ALMDATE (*(volatile unsigned char *)0x57000060) /* alarm day */
555 #define ALMMON (*(volatile unsigned char *)0x57000064) /* Alarm month */
556 #define ALMYEAR (*(volatile unsigned char *)0x57000068) /* Alarm year */
557 #define BCDSEC (*(volatile unsigned char *)0x57000070) /* BCD second */
558 #define BCDMIN (*(volatile unsigned char *)0x57000074) /* BCD minute */
559 #define BCDHOUR (*(volatile unsigned char *)0x57000078) /* BCD hour */
560 #define BCDDATE (*(volatile unsigned char *)0x5700007C) /* BCD day */
561 #define BCDDAY (*(volatile unsigned char *)0x57000080) /* BCD date */
562 #define BCDMON (*(volatile unsigned char *)0x57000084) /* BCD month */
563 #define BCDYEAR (*(volatile unsigned char *)0x57000088) /* BCD year */
565 /* A/D Converter */
567 #define ADCCON (*(volatile unsigned long *)0x58000000) /* ADC control */
568 #define ADCTSC (*(volatile unsigned long *)0x58000004) /* ADC touch screen control */
569 #define ADCDLY (*(volatile unsigned long *)0x58000008) /* ADC start or interval delay */
570 #define ADCDAT0 (*(volatile unsigned long *)0x5800000C) /* ADC conversion data */
571 #define ADCDAT1 (*(volatile unsigned long *)0x58000010) /* ADC conversion data */
572 #define ADCUPDN (*(volatile unsigned long *)0x58000014) /* Stylus up or down interrupt status */
574 /* SPI */
576 #define SPCON0 (*(volatile unsigned long *)0x59000000) /* SPI control */
577 #define SPSTA0 (*(volatile unsigned long *)0x59000004) /* SPI status */
578 #define SPPIN0 (*(volatile unsigned long *)0x59000008) /* SPI pin control */
579 #define SPPRE0 (*(volatile unsigned long *)0x5900000C) /* SPI baud rate prescaler */
580 #define SPTDAT0 (*(volatile unsigned long *)0x59000010) /* SPI Tx data */
581 #define SPRDAT0 (*(volatile unsigned long *)0x59000014) /* SPI Rx data */
582 #define SPCON1 (*(volatile unsigned long *)0x59000020) /* SPI control */
583 #define SPSTA1 (*(volatile unsigned long *)0x59000024) /* SPI status */
584 #define SPPIN1 (*(volatile unsigned long *)0x59000028) /* SPI pin control */
585 #define SPPRE1 (*(volatile unsigned long *)0x5900002C) /* SPI baud rate prescaler */
586 #define SPTDAT1 (*(volatile unsigned long *)0x59000030) /* SPI Tx data */
587 #define SPRDAT1 (*(volatile unsigned long *)0x59000034) /* SPI Rx data */
589 /* SD Interface */
591 #define SDICON (*(volatile unsigned long *)0x5A000000) /* SDI control */
592 #define SDIPRE (*(volatile unsigned long *)0x5A000004) /* SDI baud rate prescaler */
593 #define SDICARG (*(volatile unsigned long *)0x5A000008) /* SDI command argument */
594 #define SDICCON (*(volatile unsigned long *)0x5A00000C) /* SDI command control */
595 #define SDICSTA (*(volatile unsigned long *)0x5A000010) /* SDI command status */
596 #define SDIRSP0 (*(volatile unsigned long *)0x5A000014) /* SDI response */
597 #define SDIRSP1 (*(volatile unsigned long *)0x5A000018) /* SDI response */
598 #define SDIRSP2 (*(volatile unsigned long *)0x5A00001C) /* SDI response */
599 #define SDIRSP3 (*(volatile unsigned long *)0x5A000020) /* SDI response */
600 #define SDIDTIMER (*(volatile unsigned long *)0x5A000024) /* SDI data / busy timer */
601 #define SDIBSIZE (*(volatile unsigned long *)0x5A000028) /* SDI block size */
602 #define SDIDCON (*(volatile unsigned long *)0x5A00002C) /* SDI data control */
603 #define SDIDCNT (*(volatile unsigned long *)0x5A000030) /* SDI data remain counter */
604 #define SDIDSTA (*(volatile unsigned long *)0x5A000034) /* SDI data status */
605 #define SDIFSTA (*(volatile unsigned long *)0x5A000038) /* SDI FIFO status */
606 #define SDIIMSK (*(volatile unsigned long *)0x5A00003C) /* SDI interrupt mask */
608 /* SDI data - LE = Little Endian, BE = Big Endian */
609 #define SDIDAT_LLE (*(volatile unsigned long *)0x5A000040) /* 32 bit */
610 #define SDIDAT_HLE (*(volatile unsigned short *)0x5A000044) /* 16 */
611 #define SDIDAT_BLE (*(volatile unsigned char *)0x5A000048) /* 8 */
612 #define SDIDAT_LBE (*(volatile unsigned long *)0x5A00004C) /* 32 */
613 #define SDIDAT_HBE (*(volatile unsigned short *)0x5A000041) /* 16 */
614 #define SDIDAT_BBE (*(volatile unsigned char *)0x5A000043) /* 8 */
616 /* SDI register bit definitions. S3C2440 is a superset of S3C2410 */
618 #define S3C2440_SDICON_SDRESET (1<<8)
619 #define S3C2440_SDICON_MMCCLOCK (1<<5)
620 #define S3C2410_SDICON_BYTEORDER (1<<4)
621 #define S3C2410_SDICON_SDIOIRQ (1<<3)
622 #define S3C2410_SDICON_RWAITEN (1<<2)
623 #define S3C2410_SDICON_FIFORESET (1<<1)
624 #define S3C2410_SDICON_CLOCKTYPE (1<<0)
626 #define S3C2410_SDICMDCON_ABORT (1<<12)
627 #define S3C2410_SDICMDCON_WITHDATA (1<<11)
628 #define S3C2410_SDICMDCON_LONGRSP (1<<10)
629 #define S3C2410_SDICMDCON_WAITRSP (1<<9)
630 #define S3C2410_SDICMDCON_CMDSTART (1<<8)
631 #define S3C2410_SDICMDCON_SENDERHOST (1<<6)
632 #define S3C2410_SDICMDCON_INDEX (0x3f)
634 #define S3C2410_SDICMDSTAT_CRCFAIL (1<<12)
635 #define S3C2410_SDICMDSTAT_CMDSENT (1<<11)
636 #define S3C2410_SDICMDSTAT_CMDTIMEOUT (1<<10)
637 #define S3C2410_SDICMDSTAT_RSPFIN (1<<9)
638 #define S3C2410_SDICMDSTAT_XFERING (1<<8)
639 #define S3C2410_SDICMDSTAT_INDEX (0xff)
641 #define S3C2440_SDIDCON_DS_BYTE (0<<22)
642 #define S3C2440_SDIDCON_DS_HALFWORD (1<<22)
643 #define S3C2440_SDIDCON_DS_WORD (2<<22)
644 #define S3C2410_SDIDCON_IRQPERIOD (1<<21)
645 #define S3C2410_SDIDCON_TXAFTERRESP (1<<20)
646 #define S3C2410_SDIDCON_RXAFTERCMD (1<<19)
647 #define S3C2410_SDIDCON_BUSYAFTERCMD (1<<18)
648 #define S3C2410_SDIDCON_BLOCKMODE (1<<17)
649 #define S3C2410_SDIDCON_WIDEBUS (1<<16)
650 #define S3C2410_SDIDCON_DMAEN (1<<15)
651 #define S3C2410_SDIDCON_STOP (0<<14)
652 #define S3C2440_SDIDCON_DATSTART (1<<14)
653 #define S3C2410_SDIDCON_DATMODE (3<<12)
654 #define S3C2410_SDIDCON_BLKNUM (0xfff)
656 /* constants for S3C2410_SDIDCON_DATMODE */
657 #define S3C2410_SDIDCON_XFER_READY (0<<12)
658 #define S3C2410_SDIDCON_XFER_CHKSTART (1<<12)
659 #define S3C2410_SDIDCON_XFER_RXSTART (2<<12)
660 #define S3C2410_SDIDCON_XFER_TXSTART (3<<12)
662 #define S3C2410_SDIDCNT_BLKNUM_MASK (0xFFF)
663 #define S3C2410_SDIDCNT_BLKNUM_SHIFT (12)
665 #define S3C2410_SDIDSTA_RDYWAITREQ (1<<10)
666 #define S3C2410_SDIDSTA_SDIOIRQDETECT (1<<9)
667 #define S3C2410_SDIDSTA_FIFOFAIL (1<<8) /* reserved on 2440 */
668 #define S3C2410_SDIDSTA_CRCFAIL (1<<7)
669 #define S3C2410_SDIDSTA_RXCRCFAIL (1<<6)
670 #define S3C2410_SDIDSTA_DATATIMEOUT (1<<5)
671 #define S3C2410_SDIDSTA_XFERFINISH (1<<4)
672 #define S3C2410_SDIDSTA_BUSYFINISH (1<<3)
673 #define S3C2410_SDIDSTA_SBITERR (1<<2) /* reserved on 2410a/2440 */
674 #define S3C2410_SDIDSTA_TXDATAON (1<<1)
675 #define S3C2410_SDIDSTA_RXDATAON (1<<0)
677 #define S3C2410_SDIDSTA_CLEAR_BITS ( S3C2410_SDIDSTA_BUSYFINISH | \
678 S3C2410_SDIDSTA_XFERFINISH | S3C2410_SDIDSTA_DATATIMEOUT | \
679 S3C2410_SDIDSTA_RXCRCFAIL | S3C2410_SDIDSTA_CRCFAIL | \
680 S3C2410_SDIDSTA_SDIOIRQDETECT | S3C2410_SDIDSTA_RDYWAITREQ )
682 #define S3C2440_SDIFSTA_FIFORESET (1<<16)
683 #define S3C2440_SDIFSTA_FIFOFAIL (3<<14) /* 3 is correct (2 bits) */
684 #define S3C2410_SDIFSTA_TFDET (1<<13)
685 #define S3C2410_SDIFSTA_RFDET (1<<12)
686 #define S3C2410_SDIFSTA_TFHALF (1<<11)
687 #define S3C2410_SDIFSTA_TFEMPTY (1<<10)
688 #define S3C2410_SDIFSTA_RFLAST (1<<9)
689 #define S3C2410_SDIFSTA_RFFULL (1<<8)
690 #define S3C2410_SDIFSTA_RFHALF (1<<7)
691 #define S3C2410_SDIFSTA_COUNTMASK (0x7f)
693 #define S3C2410_SDIIMSK_RESPONSECRC (1<<17)
694 #define S3C2410_SDIIMSK_CMDSENT (1<<16)
695 #define S3C2410_SDIIMSK_CMDTIMEOUT (1<<15)
696 #define S3C2410_SDIIMSK_RESPONSEND (1<<14)
697 #define S3C2410_SDIIMSK_READWAIT (1<<13)
698 #define S3C2410_SDIIMSK_SDIOIRQ (1<<12)
699 #define S3C2410_SDIIMSK_FIFOFAIL (1<<11)
700 #define S3C2410_SDIIMSK_CRCSTATUS (1<<10)
701 #define S3C2410_SDIIMSK_DATACRC (1<<9)
702 #define S3C2410_SDIIMSK_DATATIMEOUT (1<<8)
703 #define S3C2410_SDIIMSK_DATAFINISH (1<<7)
704 #define S3C2410_SDIIMSK_BUSYFINISH (1<<6)
705 #define S3C2410_SDIIMSK_SBITERR (1<<5) /* reserved 2440/2410a */
706 #define S3C2410_SDIIMSK_TXFIFOHALF (1<<4)
707 #define S3C2410_SDIIMSK_TXFIFOEMPTY (1<<3)
708 #define S3C2410_SDIIMSK_RXFIFOLAST (1<<2)
709 #define S3C2410_SDIIMSK_RXFIFOFULL (1<<1)
710 #define S3C2410_SDIIMSK_RXFIFOHALF (1<<0)
712 /* AC97 Audio-CODEC Interface */
714 #define AC_GLBCTRL (*(volatile unsigned long *)0x5B000000) /* AC97 global control register */
715 #define AC_GLBSTAT (*(volatile unsigned long *)0x5B000004) /* AC97 global status register */
716 #define AC_CODEC_CMD (*(volatile unsigned long *)0x5B000008) /* AC97 codec command register */
717 #define AC_CODEC_STAT (*(volatile unsigned long *)0x5B00000C) /* AC97 codec status register */
718 #define AC_PCMADDR (*(volatile unsigned long *)0x5B000010) /* AC97 PCM out/in channel FIFO address register */
719 #define AC_MICADDR (*(volatile unsigned long *)0x5B000014) /* AC97 mic in channel FIFO address register */
720 #define AC_PCMDATA (*(volatile unsigned long *)0x5B000018) /* AC97 PCM out/in channel FIFO data register */
721 #define AC_MICDATA (*(volatile unsigned long *)0x5B00001C) /* AC97 MIC in channel FIFO data register */
723 /* Memory banks */
725 #define BANK0 0x00000000
726 #define BANK1 0x08000000
727 #define BANK2 0x10000000
728 #define BANK3 0x18000000
729 #define BANK4 0x20000000
730 #define BANK5 0x28000000
731 #define DRAM0 0x30000000
732 #define DRAM1 0x31000000
733 #define BOOTRAM 0x40000000
735 /* Timer frequency */
737 /* timer is based on PCLK and minimum division is 2 */
738 #define TIMER_FREQ (49156800/2)
739 #define TIMER234_PRESCALE 21
741 /* I/O Port macros */
743 #define GPIO_INPUT 0
744 #define GPIO_OUTPUT 1
745 #define GPIO_FUNCTION 2
746 #define GPIO_ALT_FUNCTION 3
748 #define GPIO_PULLUP_DISABLE 1
749 #define GPIO_PULLUP_ENABLE 0
751 #define S3C2440_GPIO_CONFIG(port,pin,function) port = ( (port & ~(3<<(pin*2)) ) | (function<<(pin*2)) )
752 #define S3C2440_GPIO_PULLUP(port,pin,state) port = ( (port & ~(1<<pin ) ) | (state<<pin ) )
755 #endif /* __S3C2440_H__ */