RTEMS 7.0-rc1
Loading...
Searching...
No Matches
s3c2400.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-with-RTEMS-exception */
2
11/*
12 * Copyright (C) 2005 Philippe Simons <loki_666@fastmail.fm>
13 *
14 * The license and distribution terms for this file may be
15 * found in the file LICENSE in this distribution or at
16 * http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef S3C2400_H_
20#define S3C2400_H_
21
22/* to be used in assembly code */
23#define rINTOFFSET_ADDR 0x14400014
24/* Memory control */
25#define rBWSCON (*(volatile unsigned *)0x14000000)
26#define rBANKCON0 (*(volatile unsigned *)0x14000004)
27#define rBANKCON1 (*(volatile unsigned *)0x14000008)
28#define rBANKCON2 (*(volatile unsigned *)0x1400000C)
29#define rBANKCON3 (*(volatile unsigned *)0x14000010)
30#define rBANKCON4 (*(volatile unsigned *)0x14000014)
31#define rBANKCON5 (*(volatile unsigned *)0x14000018)
32#define rBANKCON6 (*(volatile unsigned *)0x1400001C)
33#define rBANKCON7 (*(volatile unsigned *)0x14000020)
34#define rREFRESH (*(volatile unsigned *)0x14000024)
35#define rBANKSIZE (*(volatile unsigned *)0x14000028)
36#define rMRSRB6 (*(volatile unsigned *)0x1400002C)
37#define rMRSRB7 (*(volatile unsigned *)0x14000030)
38
39
40/* INTERRUPT */
41#define rSRCPND (*(volatile unsigned *)0x14400000)
42#define rINTMOD (*(volatile unsigned *)0x14400004)
43#define rINTMSK (*(volatile unsigned *)0x14400008)
44#define rPRIORITY (*(volatile unsigned *)0x1440000C)
45#define rINTPND (*(volatile unsigned *)0x14400010)
46#define rINTOFFSET (*(volatile unsigned *)0x14400014)
47
48
49/* DMA */
50#define rDISRC0 (*(volatile unsigned *)0x14600000)
51#define rDIDST0 (*(volatile unsigned *)0x14600004)
52#define rDCON0 (*(volatile unsigned *)0x14600008)
53#define rDSTAT0 (*(volatile unsigned *)0x1460000C)
54#define rDCSRC0 (*(volatile unsigned *)0x14600010)
55#define rDCDST0 (*(volatile unsigned *)0x14600014)
56#define rDMASKTRIG0 (*(volatile unsigned *)0x14600018)
57#define rDISRC1 (*(volatile unsigned *)0x14600020)
58#define rDIDST1 (*(volatile unsigned *)0x14600024)
59#define rDCON1 (*(volatile unsigned *)0x14600028)
60#define rDSTAT1 (*(volatile unsigned *)0x1460002C)
61#define rDCSRC1 (*(volatile unsigned *)0x14600030)
62#define rDCDST1 (*(volatile unsigned *)0x14600034)
63#define rDMASKTRIG1 (*(volatile unsigned *)0x14600038)
64#define rDISRC2 (*(volatile unsigned *)0x14600040)
65#define rDIDST2 (*(volatile unsigned *)0x14600044)
66#define rDCON2 (*(volatile unsigned *)0x14600048)
67#define rDSTAT2 (*(volatile unsigned *)0x1460004C)
68#define rDCSRC2 (*(volatile unsigned *)0x14600050)
69#define rDCDST2 (*(volatile unsigned *)0x14600054)
70#define rDMASKTRIG2 (*(volatile unsigned *)0x14600058)
71#define rDISRC3 (*(volatile unsigned *)0x14600060)
72#define rDIDST3 (*(volatile unsigned *)0x14600064)
73#define rDCON3 (*(volatile unsigned *)0x14600068)
74#define rDSTAT3 (*(volatile unsigned *)0x1460006C)
75#define rDCSRC3 (*(volatile unsigned *)0x14600070)
76#define rDCDST3 (*(volatile unsigned *)0x14600074)
77#define rDMASKTRIG3 (*(volatile unsigned *)0x14600078)
78
79
80/* CLOCK & POWER MANAGEMENT */
81#define rLOCKTIME (*(volatile unsigned *)0x14800000)
82#define rMPLLCON (*(volatile unsigned *)0x14800004)
83#define rUPLLCON (*(volatile unsigned *)0x14800008)
84#define rCLKCON (*(volatile unsigned *)0x1480000C)
85#define rCLKSLOW (*(volatile unsigned *)0x14800010)
86#define rCLKDIVN (*(volatile unsigned *)0x14800014)
87
88
89/* LCD CONTROLLER */
90#define rLCDCON1 (*(volatile unsigned *)0x14A00000)
91#define rLCDCON2 (*(volatile unsigned *)0x14A00004)
92#define rLCDCON3 (*(volatile unsigned *)0x14A00008)
93#define rLCDCON4 (*(volatile unsigned *)0x14A0000C)
94#define rLCDCON5 (*(volatile unsigned *)0x14A00010)
95#define rLCDSADDR1 (*(volatile unsigned *)0x14A00014)
96#define rLCDSADDR2 (*(volatile unsigned *)0x14A00018)
97#define rLCDSADDR3 (*(volatile unsigned *)0x14A0001C)
98#define rREDLUT (*(volatile unsigned *)0x14A00020)
99#define rGREENLUT (*(volatile unsigned *)0x14A00024)
100#define rBLUELUT (*(volatile unsigned *)0x14A00028)
101#define rDP1_2 (*(volatile unsigned *)0x14A0002C)
102#define rDP4_7 (*(volatile unsigned *)0x14A00030)
103#define rDP3_5 (*(volatile unsigned *)0x14A00034)
104#define rDP2_3 (*(volatile unsigned *)0x14A00038)
105#define rDP5_7 (*(volatile unsigned *)0x14A0003c)
106#define rDP3_4 (*(volatile unsigned *)0x14A00040)
107#define rDP4_5 (*(volatile unsigned *)0x14A00044)
108#define rDP6_7 (*(volatile unsigned *)0x14A00048)
109#define rDITHMODE (*(volatile unsigned *)0x14A0004C)
110#define rTPAL (*(volatile unsigned *)0x14A00050)
111#define GP32_PALETTE (*(volatile unsigned *)0x14A00400) /* SJS */
112
113
114/* UART */
115#define rULCON0 (*(volatile unsigned char *)0x15000000)
116#define rUCON0 (*(volatile unsigned short *)0x15000004)
117#define rUFCON0 (*(volatile unsigned char *)0x15000008)
118#define rUMCON0 (*(volatile unsigned char *)0x1500000C)
119#define rUTRSTAT0 (*(volatile unsigned char *)0x15000010)
120#define rUERSTAT0 (*(volatile unsigned char *)0x15000014)
121#define rUFSTAT0 (*(volatile unsigned short *)0x15000018)
122#define rUMSTAT0 (*(volatile unsigned char *)0x1500001C)
123#define rUBRDIV0 (*(volatile unsigned short *)0x15000028)
124
125#define rULCON1 (*(volatile unsigned char *)0x15004000)
126#define rUCON1 (*(volatile unsigned short *)0x15004004)
127#define rUFCON1 (*(volatile unsigned char *)0x15004008)
128#define rUMCON1 (*(volatile unsigned char *)0x1500400C)
129#define rUTRSTAT1 (*(volatile unsigned char *)0x15004010)
130#define rUERSTAT1 (*(volatile unsigned char *)0x15004014)
131#define rUFSTAT1 (*(volatile unsigned short *)0x15004018)
132#define rUMSTAT1 (*(volatile unsigned char *)0x1500401C)
133#define rUBRDIV1 (*(volatile unsigned short *)0x15004028)
134
135#ifdef __BIG_ENDIAN
136#define rUTXH0 (*(volatile unsigned char *)0x15000023)
137#define rURXH0 (*(volatile unsigned char *)0x15000027)
138#define rUTXH1 (*(volatile unsigned char *)0x15004023)
139#define rURXH1 (*(volatile unsigned char *)0x15004027)
140
141#define WrUTXH0(ch) (*(volatile unsigned char *)0x15000023)=(unsigned char)(ch)
142#define RdURXH0() (*(volatile unsigned char *)0x15000027)
143#define WrUTXH1(ch) (*(volatile unsigned char *)0x15004023)=(unsigned char)(ch)
144#define RdURXH1() (*(volatile unsigned char *)0x15004027)
145
146#define UTXH0 (0x15000020+3) /* byte_access address by DMA */
147#define URXH0 (0x15000024+3)
148#define UTXH1 (0x15004020+3)
149#define URXH1 (0x15004024+3)
150
151#else /* Little Endian */
152#define rUTXH0 (*(volatile unsigned char *)0x15000020)
153#define rURXH0 (*(volatile unsigned char *)0x15000024)
154#define rUTXH1 (*(volatile unsigned char *)0x15004020)
155#define rURXH1 (*(volatile unsigned char *)0x15004024)
156
157#define WrUTXH0(ch) (*(volatile unsigned char *)0x15000020)=(unsigned char)(ch)
158#define RdURXH0() (*(volatile unsigned char *)0x15000024)
159#define WrUTXH1(ch) (*(volatile unsigned char *)0x15004020)=(unsigned char)(ch)
160#define RdURXH1() (*(volatile unsigned char *)0x15004024)
161
162#define UTXH0 (0x15000020) /* byte_access address by DMA */
163#define URXH0 (0x15000024)
164#define UTXH1 (0x15004020)
165#define URXH1 (0x15004024)
166#endif
167
168
169/* PWM TIMER */
170#define rTCFG0 (*(volatile unsigned *)0x15100000)
171#define rTCFG1 (*(volatile unsigned *)0x15100004)
172#define rTCON (*(volatile unsigned *)0x15100008)
173#define rTCNTB0 (*(volatile unsigned *)0x1510000C)
174#define rTCMPB0 (*(volatile unsigned *)0x15100010)
175#define rTCNTO0 (*(volatile unsigned *)0x15100014)
176#define rTCNTB1 (*(volatile unsigned *)0x15100018)
177#define rTCMPB1 (*(volatile unsigned *)0x1510001C)
178#define rTCNTO1 (*(volatile unsigned *)0x15100020)
179#define rTCNTB2 (*(volatile unsigned *)0x15100024)
180#define rTCMPB2 (*(volatile unsigned *)0x15100028)
181#define rTCNTO2 (*(volatile unsigned *)0x1510002C)
182#define rTCNTB3 (*(volatile unsigned *)0x15100030)
183#define rTCMPB3 (*(volatile unsigned *)0x15100034)
184#define rTCNTO3 (*(volatile unsigned *)0x15100038)
185#define rTCNTB4 (*(volatile unsigned *)0x1510003C)
186#define rTCNTO4 (*(volatile unsigned *)0x15100040)
187
188
189/* USB DEVICE */
190#define rFUNC_ADDR_REG (*(volatile unsigned *)0x15200140)
191#define rPWR_REG (*(volatile unsigned *)0x15200144)
192#define rINT_REG (*(volatile unsigned *)0x15200148)
193#define rINT_MASK_REG (*(volatile unsigned *)0x1520014C)
194#define rFRAME_NUM_REG (*(volatile unsigned *)0x15200150)
195#define rRESUME_CON_REG (*(volatile unsigned *)0x15200154)
196#define rEP0_CSR (*(volatile unsigned *)0x15200160)
197#define rEP0_MAXP (*(volatile unsigned *)0x15200164)
198#define rEP0_OUT_CNT (*(volatile unsigned *)0x15200168)
199#define rEP0_FIFO (*(volatile unsigned *)0x1520016C)
200#define rEP1_IN_CSR (*(volatile unsigned *)0x15200180)
201#define rEP1_IN_MAXP (*(volatile unsigned *)0x15200184)
202#define rEP1_FIFO (*(volatile unsigned *)0x15200188)
203#define rEP2_IN_CSR (*(volatile unsigned *)0x15200190)
204#define rEP2_IN_MAXP (*(volatile unsigned *)0x15200194)
205#define rEP2_FIFO (*(volatile unsigned *)0x15200198)
206#define rEP3_OUT_CSR (*(volatile unsigned *)0x152001A0)
207#define rEP3_OUT_MAXP (*(volatile unsigned *)0x152001A4)
208#define rEP3_OUT_CNT (*(volatile unsigned *)0x152001A8)
209#define rEP3_FIFO (*(volatile unsigned *)0x152001AC)
210#define rEP4_OUT_CSR (*(volatile unsigned *)0x152001B0)
211#define rEP4_OUT_MAXP (*(volatile unsigned *)0x152001B4)
212#define rEP4_OUT_CNT (*(volatile unsigned *)0x152001B8)
213#define rEP4_FIFO (*(volatile unsigned *)0x152001BC)
214#define rDMA_CON (*(volatile unsigned *)0x152001C0)
215#define rDMA_UNIT (*(volatile unsigned *)0x152001C4)
216#define rDMA_FIFO (*(volatile unsigned *)0x152001C8)
217#define rDMA_TX (*(volatile unsigned *)0x152001CC)
218#define rTEST_MODE (*(volatile unsigned *)0x152001F4)
219#define rIN_CON_REG (*(volatile unsigned *)0x152001F8)
220
221
222/* WATCH DOG TIMER */
223#define rWTCON (*(volatile unsigned *)0x15300000)
224#define rWTDAT (*(volatile unsigned *)0x15300004)
225#define rWTCNT (*(volatile unsigned *)0x15300008)
226
227
228/* IIC */
229#define rIICCON (*(volatile unsigned *)0x15400000)
230#define rIICSTAT (*(volatile unsigned *)0x15400004)
231#define rIICADD (*(volatile unsigned *)0x15400008)
232#define rIICDS (*(volatile unsigned *)0x1540000C)
233
234
235/* IIS */
236#define rIISCON (*(volatile unsigned *)0x15508000)
237#define rIISMOD (*(volatile unsigned *)0x15508004)
238#define rIISPSR (*(volatile unsigned *)0x15508008)
239#define rIISFIFCON (*(volatile unsigned *)0x1550800C)
240
241#ifdef __BIG_ENDIAN
242#define IISFIF ((volatile unsigned short *)0x15508012)
243
244#else /* Little Endian */
245#define IISFIF ((volatile unsigned short *)0x15508010)
246#endif
247
248
249/* I/O PORT */
250#define rPACON (*(volatile unsigned *)0x15600000)
251#define rPADAT (*(volatile unsigned *)0x15600004)
252
253#define rPBCON (*(volatile unsigned *)0x15600008)
254#define rPBDAT (*(volatile unsigned *)0x1560000C)
255#define rPBUP (*(volatile unsigned *)0x15600010)
256
257#define rPCCON (*(volatile unsigned *)0x15600014)
258#define rPCDAT (*(volatile unsigned *)0x15600018)
259#define rPCUP (*(volatile unsigned *)0x1560001C)
260
261#define rPDCON (*(volatile unsigned *)0x15600020)
262#define rPDDAT (*(volatile unsigned *)0x15600024)
263#define rPDUP (*(volatile unsigned *)0x15600028)
264
265#define rPECON (*(volatile unsigned *)0x1560002C)
266#define rPEDAT (*(volatile unsigned *)0x15600030)
267#define rPEUP (*(volatile unsigned *)0x15600034)
268
269#define rPFCON (*(volatile unsigned *)0x15600038)
270#define rPFDAT (*(volatile unsigned *)0x1560003C)
271#define rPFUP (*(volatile unsigned *)0x15600040)
272
273#define rPGCON (*(volatile unsigned *)0x15600044)
274#define rPGDAT (*(volatile unsigned *)0x15600048)
275#define rPGUP (*(volatile unsigned *)0x1560004C)
276
277#define rOPENCR (*(volatile unsigned *)0x15600050)
278#define rMISCCR (*(volatile unsigned *)0x15600054)
279#define rEXTINT (*(volatile unsigned *)0x15600058)
280
281
282/* RTC */
283#ifdef __BIG_ENDIAN
284#define rRTCCON (*(volatile unsigned char *)0x15700043)
285#define rRTCALM (*(volatile unsigned char *)0x15700053)
286#define rALMSEC (*(volatile unsigned char *)0x15700057)
287#define rALMMIN (*(volatile unsigned char *)0x1570005B)
288#define rALMHOUR (*(volatile unsigned char *)0x1570005F)
289#define rALMDAY (*(volatile unsigned char *)0x15700063)
290#define rALMMON (*(volatile unsigned char *)0x15700067)
291#define rALMYEAR (*(volatile unsigned char *)0x1570006B)
292#define rRTCRST (*(volatile unsigned char *)0x1570006F)
293#define rBCDSEC (*(volatile unsigned char *)0x15700073)
294#define rBCDMIN (*(volatile unsigned char *)0x15700077)
295#define rBCDHOUR (*(volatile unsigned char *)0x1570007B)
296#define rBCDDAY (*(volatile unsigned char *)0x1570007F)
297#define rBCDDATE (*(volatile unsigned char *)0x15700083)
298#define rBCDMON (*(volatile unsigned char *)0x15700087)
299#define rBCDYEAR (*(volatile unsigned char *)0x1570008B)
300#define rTICINT (*(volatile unsigned char *)0x15700047)
301
302#else /* Little Endian */
303#define rRTCCON (*(volatile unsigned char *)0x15700040)
304#define rRTCALM (*(volatile unsigned char *)0x15700050)
305#define rALMSEC (*(volatile unsigned char *)0x15700054)
306#define rALMMIN (*(volatile unsigned char *)0x15700058)
307#define rALMHOUR (*(volatile unsigned char *)0x1570005C)
308#define rALMDAY (*(volatile unsigned char *)0x15700060)
309#define rALMMON (*(volatile unsigned char *)0x15700064)
310#define rALMYEAR (*(volatile unsigned char *)0x15700068)
311#define rRTCRST (*(volatile unsigned char *)0x1570006C)
312#define rBCDSEC (*(volatile unsigned char *)0x15700070)
313#define rBCDMIN (*(volatile unsigned char *)0x15700074)
314#define rBCDHOUR (*(volatile unsigned char *)0x15700078)
315#define rBCDDAY (*(volatile unsigned char *)0x1570007C)
316#define rBCDDATE (*(volatile unsigned char *)0x15700080)
317#define rBCDMON (*(volatile unsigned char *)0x15700084)
318#define rBCDYEAR (*(volatile unsigned char *)0x15700088)
319#define rTICINT (*(volatile unsigned char *)0x15700044)
320#endif
321
322
323/* ADC */
324#define rADCCON (*(volatile unsigned *)0x15800000)
325#define rADCDAT (*(volatile unsigned *)0x15800004)
326
327
328/* SPI */
329#define rSPCON (*(volatile unsigned *)0x15900000)
330#define rSPSTA (*(volatile unsigned *)0x15900004)
331#define rSPPIN (*(volatile unsigned *)0x15900008)
332#define rSPPRE (*(volatile unsigned *)0x1590000C)
333#define rSPTDAT (*(volatile unsigned *)0x15900010)
334#define rSPRDAT (*(volatile unsigned *)0x15900014)
335
336
337/* MMC INTERFACE */
338#define rMMCON (*(volatile unsigned *)0x15a00000)
339#define rMMCRR (*(volatile unsigned *)0x15a00004)
340#define rMMFCON (*(volatile unsigned *)0x15a00008)
341#define rMMSTA (*(volatile unsigned *)0x15a0000C)
342#define rMMFSTA (*(volatile unsigned *)0x15a00010)
343#define rMMPRE (*(volatile unsigned *)0x15a00014)
344#define rMMLEN (*(volatile unsigned *)0x15a00018)
345#define rMMCR7 (*(volatile unsigned *)0x15a0001C)
346#define rMMRSP0 (*(volatile unsigned *)0x15a00020)
347#define rMMRSP1 (*(volatile unsigned *)0x15a00024)
348#define rMMRSP2 (*(volatile unsigned *)0x15a00028)
349#define rMMRSP3 (*(volatile unsigned *)0x15a0002C)
350#define rMMCMD0 (*(volatile unsigned *)0x15a00030)
351#define rMMCMD1 (*(volatile unsigned *)0x15a00034)
352#define rMMCR16 (*(volatile unsigned *)0x15a00038)
353#define rMMDAT (*(volatile unsigned *)0x15a0003C)
354
355
356#define _ISR_STARTADDRESS rtems_vector_table
357/* ISR */
358#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
359#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
360#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
361#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xC))
362#define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
363#define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
364#define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
365#define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1C))
366
367#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x20))
368#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x24))
369#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
370#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x2C))
371#define pISR_EINT4 (*(unsigned *)(_ISR_STARTADDRESS+0x30))
372#define pISR_EINT5 (*(unsigned *)(_ISR_STARTADDRESS+0x34))
373#define pISR_EINT6 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
374#define pISR_EINT7 (*(unsigned *)(_ISR_STARTADDRESS+0x3C))
375#define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x40))
376#define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x44))
377#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
378#define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x4C))
379#define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
380#define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
381#define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
382#define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x5C))
383#define pISR_NOTUSED (*(unsigned *)(_ISR_STARTADDRESS+0x60))
384#define pISR_DMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
385#define pISR_DMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
386#define pISR_DMA2 (*(unsigned *)(_ISR_STARTADDRESS+0x6C))
387#define pISR_DMA3 (*(unsigned *)(_ISR_STARTADDRESS+0x70))
388#define pISR_MMC (*(unsigned *)(_ISR_STARTADDRESS+0x74))
389#define pISR_SPI (*(unsigned *)(_ISR_STARTADDRESS+0x78))
390#define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x7C))
391#define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
392#define pISR_USBD (*(unsigned *)(_ISR_STARTADDRESS+0x84))
393#define pISR_USBH (*(unsigned *)(_ISR_STARTADDRESS+0x88))
394#define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x8C))
395#define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x90))
396#define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x94))
397#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x98))
398#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0xA0))
399
400
401/* PENDING BIT */
402#define BIT_EINT0 (0x1)
403#define BIT_EINT1 (0x1<<1)
404#define BIT_EINT2 (0x1<<2)
405#define BIT_EINT3 (0x1<<3)
406#define BIT_EINT4 (0x1<<4)
407#define BIT_EINT5 (0x1<<5)
408#define BIT_EINT6 (0x1<<6)
409#define BIT_EINT7 (0x1<<7)
410#define BIT_TICK (0x1<<8)
411#define BIT_WDT (0x1<<9)
412#define BIT_TIMER0 (0x1<<10)
413#define BIT_TIMER1 (0x1<<11)
414#define BIT_TIMER2 (0x1<<12)
415#define BIT_TIMER3 (0x1<<13)
416#define BIT_TIMER4 (0x1<<14)
417#define BIT_UERR01 (0x1<<15)
418#define BIT_NOTUSED (0x1<<16)
419#define BIT_DMA0 (0x1<<17)
420#define BIT_DMA1 (0x1<<18)
421#define BIT_DMA2 (0x1<<19)
422#define BIT_DMA3 (0x1<<20)
423#define BIT_MMC (0x1<<21)
424#define BIT_SPI (0x1<<22)
425#define BIT_URXD0 (0x1<<23)
426#define BIT_URXD1 (0x1<<24)
427#define BIT_USBD (0x1<<25)
428#define BIT_USBH (0x1<<26)
429#define BIT_IIC (0x1<<27)
430#define BIT_UTXD0 (0x1<<28)
431#define BIT_UTXD1 (0x1<<29)
432#define BIT_RTC (0x1<<30)
433#define BIT_ADC (0x1<<31)
434#define BIT_ALLMSK (0xFFFFFFFF)
435
436#define ClearPending(bit) {\
437 rSRCPND = bit;\
438 rINTPND = bit;\
439 rINTPND;\
440 }
441/* Wait until rINTPND is changed for the case that the ISR is very short. */
442
443#ifndef ASM
444/* Typedefs */
445typedef union {
446 struct _reg {
447 unsigned STOP_BIT:1; /* Enters STOP mode. This bit isn't be */
448 /* cleared automatically. */
449 unsigned SL_IDLE:1; /* SL_IDLE mode option. This bit isn't cleared */
450 /* automatically. To enter SL_IDLE mode, */
451 /* CLKCON register has to be 0xe. */
452 unsigned IDLE_BIT:1; /* Enters IDLE mode. This bit isn't be cleared */
453 /* automatically. */
454 unsigned LCDC:1; /* Controls HCLK into LCDC block */
455 unsigned USB_host:1; /* Controls HCLK into USB host block */
456 unsigned USB_device:1; /* Controls PCLK into USB device block */
457 unsigned PWMTIMER:1; /* Controls PCLK into PWMTIMER block */
458 unsigned MMC:1; /* Controls PCLK into MMC interface block */
459 unsigned UART0:1; /* Controls PCLK into UART0 block */
460 unsigned UART1:1; /* Controls PCLK into UART1 block */
461 unsigned GPIO:1; /* Controls PCLK into GPIO block */
462 unsigned RTC:1; /* Controls PCLK into RTC control block. Even if */
463 /* this bit is cleared to 0, RTC timer is alive. */
464 unsigned ADC:1; /* Controls PCLK into ADC block */
465 unsigned IIC:1; /* Controls PCLK into IIC block */
466 unsigned IIS:1; /* Controls PCLK into IIS block */
467 unsigned SPI:1; /* Controls PCLK into SPI block */
468 } reg;
469 unsigned long all;
470} CLKCON;
471
472typedef union
473{
474 struct {
475 unsigned ENVID:1; /* LCD video output and the logic 1=enable/0=disable. */
476 unsigned BPPMODE:4; /* 1011 = 8 bpp for TFT, 1100 = 16 bpp for TFT, */
477 /* 1110 = 16 bpp TFT skipmode */
478 unsigned PNRMODE:2; /* TFT: 3 */
479 unsigned MMODE:1; /* This bit determines the toggle rate of the VM. */
480 /* 0 = Each Frame, 1 = The rate defined by the MVAL */
481 unsigned CLKVAL:10; /* TFT: VCLK = HCLK / [(CLKVAL+1) x 2] (CLKVAL >= 1) */
482 unsigned LINECNT:10; /* (read only) These bits provide the status of the */
483 /* line counter. Down count from LINEVAL to 0 */
484 } reg;
485 unsigned long all;
486} LCDCON1;
487
488typedef union {
489 struct {
490 unsigned VSPW:6; /* TFT: Vertical sync pulse width determines the */
491 /* VSYNC pulse's high level width by counting the */
492 /* number of inactive lines. */
493 unsigned VFPD:8; /* TFT: Vertical front porch is the number of */
494 /* inactive lines at the end of a frame, before */
495 /* vertical synchronization period. */
496 unsigned LINEVAL:10; /* TFT/STN: These bits determine the vertical size */
497 /* of LCD panel. */
498 unsigned VBPD:8; /* TFT: Vertical back porch is the number of inactive */
499 /* lines at the start of a frame, after */
500 /* vertical synchronization period. */
501 } reg;
502 unsigned long all;
503} LCDCON2;
504
505typedef union {
506 struct {
507 unsigned HFPD:8; /* TFT: Horizontal front porch is the number of */
508 /* VCLK periods between the end of active data */
509 /* and the rising edge of HSYNC. */
510 unsigned HOZVAL:11; /* TFT/STN: These bits determine the horizontal */
511 /* size of LCD panel. 2n bytes. */
512 unsigned HBPD:7; /* TFT: Horizontal back porch is the number of VCLK */
513 /* periods between the falling edge of HSYNC and */
514 /* the start of active data. */
515 } reg;
516 unsigned long all;
517} LCDCON3;
518
519typedef union {
520 struct {
521 unsigned HSPW:8; /* TFT: Horizontal sync pulse width determines the */
522 /* HSYNC pulse's high level width by counting the */
523 /* number of the VCLK. */
524 unsigned MVAL:8; /* STN: */
525 unsigned ADDVAL:8; /* TFT: Palette Index offset value */
526 unsigned PALADDEN:1; /* TFT: Palette Index offset enable. */
527 /* 0 = Disable 1 = Enable */
528 } reg;
529 unsigned long all;
530} LCDCON4;
531
532typedef union {
533 struct {
534 unsigned HWSWP:1; /* STN/TFT: Half-Word swap control bit. */
535 /* 0 = Swap Disable 1 = Swap Enable */
536 unsigned BSWP:1; /* STN/TFT: Byte swap control bit. */
537 /* 0 = Swap Disable 1 = Swap Enable */
538 unsigned ENLEND:1; /* TFT: LEND output signal enable/disable. */
539 /* 0 = Disable LEND signal. */
540 /* 1 = Enable LEND signal */
541 unsigned RESERVED1:1;
542 unsigned INVENDLINE:1;/* TFT: This bit indicates the LEND signal */
543 /* polarity. 0 = normal 1 = inverted */
544 unsigned RESERVED2:1;
545 unsigned INVVDEN:1; /* TFT: This bit indicates the VDEN signal */
546 /* polarity. */
547 /* 0 = normal 1 = inverted */
548 unsigned INVVD:1; /* STN/TFT: This bit indicates the VD (video data) */
549 /* pulse polarity. 0 = Normal. */
550 /* 1 = VD is inverted. */
551 unsigned INVVFRAME:1; /* STN/TFT: This bit indicates the VFRAME/VSYNC */
552 /* pulse polarity. 0 = normal 1 = inverted */
553 unsigned INVVLINE:1; /* STN/TFT: This bit indicates the VLINE/HSYNC */
554 /* pulse polarity. 0 = normal 1 = inverted */
555 unsigned INVVCLK:1; /* STN/TFT: This bit controls the polarity of the */
556 /* VCLK active edge. 0 = The video data is */
557 /* fetched at VCLK falling edge. 1 = The video */
558 /* data is fetched at VCLK rising edge */
559 unsigned RESERVED3:2;
560 unsigned SELFREF:1; /* STN: */
561 unsigned SLOWCLKSYNC:1; /* STN: */
562 unsigned RESERVED4:2; /* must be 0 */
563 unsigned HSTATUS:2; /* TFT: Horizontal Status (Read only) */
564 /* 00 = HSYNC */
565 /* 01 = BACK Porch. */
566 /* 10 = ACTIVE */
567 /* 11 = FRONT Porch */
568 unsigned _VSTATUS:2; /* TFT: Vertical Status (Read only). */
569 /* 00 = VSYNC */
570 /* 01 = BACK Porch. */
571 /* 10 = ACTIVE */
572 /* 11 = FRONT Porch */
573 } reg;
574 unsigned long all;
575} LCDCON5;
576
577typedef union {
578 struct {
579 unsigned LCDBASEU:21; /* For single-scan LCD: These bits indicate */
580 /* A[21:1] of the start address of the LCD */
581 /* frame buffer. */
582 unsigned LCDBANK:7; /* A[28:22] */
583 } reg;
584 unsigned long all;
585} LCDSADDR1;
586
587typedef union {
588 struct {
589 unsigned LCDBASEL:21; /* For single scan LCD: These bits indicate A[21:1]*/
590 /* of the end address of the LCD frame buffer. */
591 /* LCDBASEL = ((the fame end address) >>1) + 1 */
592 /* = LCDBASEU + (PAGEWIDTH+OFFSIZE)x(LINEVAL+1) */
593 } reg;
594 unsigned long all;
595} LCDSADDR2;
596
597typedef union {
598 struct {
599 unsigned PAGEWIDTH:11; /* Virtual screen page width(the number of half */
600 /* words) This value defines the width of the */
601 /* view port in the frame */
602 unsigned OFFSIZE:11; /* Virtual screen offset size(the number of half */
603 /* words) This value defines the difference */
604 /* between the address of the last half word */
605 /* displayed on the previous LCD line and the */
606 /* address of the first half word to be */
607 /* displayed in the new LCD line. */
608 } reg;
609 unsigned long all;
610} LCDSADDR3;
611
612/*
613 *
614 */
615
616typedef union {
617 struct {
618 unsigned IISIFENA:1; /* IIS interface enable (start) */
619 unsigned IISPSENA:1; /* IIS prescaler enable */
620 unsigned RXCHIDLE:1; /* Receive channel idle command */
621 unsigned TXCHIDLE:1; /* Transmit channel idle command */
622 unsigned RXDMAENA:1; /* Receive DMA service request enable */
623 unsigned TXDMAENA:1; /* Transmit DMA service request enable */
624 unsigned RXFIFORDY:1; /* Receive FIFO ready flag (read only) */
625 unsigned TXFIFORDY:1; /* Transmit FIFO ready flag (read only) */
626 unsigned LRINDEX:1; /* Left/right channel index (read only) */
627 } reg;
628 unsigned long all;
629} IISCON;
630
631typedef union {
632 struct {
633 unsigned SBCLKFS:2; /* Serial bit clock frequency select */
634 unsigned MCLKFS:1; /* Master clock frequency select */
635 unsigned SDBITS:1; /* Serial data bit per channel */
636 unsigned SIFMT:1; /* Serial interface format */
637 unsigned ACTLEVCH:1; /* Active level pf left/right channel */
638 unsigned TXRXMODE:2; /* Transmit/receive mode select */
639 unsigned MODE:1; /* Master/slave mode select */
640 } reg;
641 unsigned long all;
642} IISMOD;
643
644typedef union {
645 struct {
646 unsigned PSB:5; /* Prescaler control B */
647 unsigned PSA:5; /* Prescaler control A */
648 } reg;
649 unsigned long all;
650} IISPSR;
651
652typedef union {
653 struct {
654 unsigned RXFIFOCNT:4; /* (read only) */
655 unsigned TXFIFOCNT:4; /* (read only) */
656 /*signed RXFIFOENA:1; /* */
657 unsigned TXFIFOENA:1; /* */
658 unsigned RXFIFOMODE:1; /* */
659 unsigned TXFIFOMODE:1; /* */
660 } reg;
661 unsigned long all;
662} IISSFIFCON;
663
664typedef union {
665 struct {
666 unsigned FENTRY:16; /* */
667 } reg;
668 unsigned long all;
669} IISSFIF;
670#endif //ASM
671
672#define LCD_WIDTH 240
673#define LCD_HEIGHT 320
674#define LCD_ASPECT ((float)(LCD_WIDTH/LCD_HEIGHT))
675
676#define GP32_KEY_SELECT 512
677#define GP32_KEY_START 256
678#define GP32_KEY_A 64
679#define GP32_KEY_B 32
680#define GP32_KEY_L 16
681#define GP32_KEY_R 128
682#define GP32_KEY_UP 8
683#define GP32_KEY_DOWN 2
684#define GP32_KEY_LEFT 1
685#define GP32_KEY_RIGHT 4
686
687#endif /*S3C2400_H_*/
Definition: s3c2400.h:446
Definition: s3c2400.h:445
Definition: s3c2400.h:616
Definition: s3c2400.h:631
Definition: s3c2400.h:644
Definition: s3c2400.h:652
Definition: s3c2400.h:664
Definition: s3c2400.h:473
Definition: s3c2400.h:488
Definition: s3c2400.h:505
Definition: s3c2400.h:519
Definition: s3c2400.h:532
Definition: s3c2400.h:577
Definition: s3c2400.h:587
Definition: s3c2400.h:597