]> git.sur5r.net Git - u-boot/blob - include/asm-arm/arch-s3c24x0/s3c24x0.h
Merge branch 'master' into next
[u-boot] / include / asm-arm / arch-s3c24x0 / s3c24x0.h
1 /*
2  * (C) Copyright 2003
3  * David Müller ELSOFT AG Switzerland. d.mueller@elsoft.ch
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23
24 /************************************************
25  * NAME     : s3c24x0.h
26  * Version  : 31.3.2003
27  *
28  * common stuff for SAMSUNG S3C24X0 SoC
29  ************************************************/
30
31 #ifndef __S3C24X0_H__
32 #define __S3C24X0_H__
33
34 /* Memory controller (see manual chapter 5) */
35 struct s3c24x0_memctl {
36         u32     BWSCON;
37         u32     BANKCON[8];
38         u32     REFRESH;
39         u32     BANKSIZE;
40         u32     MRSRB6;
41         u32     MRSRB7;
42 };
43
44
45 /* USB HOST (see manual chapter 12) */
46 struct s3c24x0_usb_host {
47         u32     HcRevision;
48         u32     HcControl;
49         u32     HcCommonStatus;
50         u32     HcInterruptStatus;
51         u32     HcInterruptEnable;
52         u32     HcInterruptDisable;
53         u32     HcHCCA;
54         u32     HcPeriodCuttendED;
55         u32     HcControlHeadED;
56         u32     HcControlCurrentED;
57         u32     HcBulkHeadED;
58         u32     HcBuldCurrentED;
59         u32     HcDoneHead;
60         u32     HcRmInterval;
61         u32     HcFmRemaining;
62         u32     HcFmNumber;
63         u32     HcPeriodicStart;
64         u32     HcLSThreshold;
65         u32     HcRhDescriptorA;
66         u32     HcRhDescriptorB;
67         u32     HcRhStatus;
68         u32     HcRhPortStatus1;
69         u32     HcRhPortStatus2;
70 };
71
72
73 /* INTERRUPT (see manual chapter 14) */
74 struct s3c24x0_interrupt {
75         u32     SRCPND;
76         u32     INTMOD;
77         u32     INTMSK;
78         u32     PRIORITY;
79         u32     INTPND;
80         u32     INTOFFSET;
81 #ifdef CONFIG_S3C2410
82         u32     SUBSRCPND;
83         u32     INTSUBMSK;
84 #endif
85 };
86
87
88 /* DMAS (see manual chapter 8) */
89 struct s3c24x0_dma {
90         u32     DISRC;
91 #ifdef CONFIG_S3C2410
92         u32     DISRCC;
93 #endif
94         u32     DIDST;
95 #ifdef CONFIG_S3C2410
96         u32     DIDSTC;
97 #endif
98         u32     DCON;
99         u32     DSTAT;
100         u32     DCSRC;
101         u32     DCDST;
102         u32     DMASKTRIG;
103 #ifdef CONFIG_S3C2400
104         u32     res[1];
105 #endif
106 #ifdef CONFIG_S3C2410
107         u32     res[7];
108 #endif
109 };
110
111 struct s3c24x0_dmas {
112         struct s3c24x0_dma      dma[4];
113 };
114
115
116 /* CLOCK & POWER MANAGEMENT (see S3C2400 manual chapter 6) */
117 /*                          (see S3C2410 manual chapter 7) */
118 struct s3c24x0_clock_power {
119         u32     LOCKTIME;
120         u32     MPLLCON;
121         u32     UPLLCON;
122         u32     CLKCON;
123         u32     CLKSLOW;
124         u32     CLKDIVN;
125 };
126
127
128 /* LCD CONTROLLER (see manual chapter 15) */
129 struct s3c24x0_lcd {
130         u32     LCDCON1;
131         u32     LCDCON2;
132         u32     LCDCON3;
133         u32     LCDCON4;
134         u32     LCDCON5;
135         u32     LCDSADDR1;
136         u32     LCDSADDR2;
137         u32     LCDSADDR3;
138         u32     REDLUT;
139         u32     GREENLUT;
140         u32     BLUELUT;
141         u32     res[8];
142         u32     DITHMODE;
143         u32     TPAL;
144 #ifdef CONFIG_S3C2410
145         u32     LCDINTPND;
146         u32     LCDSRCPND;
147         u32     LCDINTMSK;
148         u32     LPCSEL;
149 #endif
150 };
151
152
153 /* NAND FLASH (see S3C2410 manual chapter 6) */
154 struct s3c2410_nand {
155         u32     NFCONF;
156         u32     NFCMD;
157         u32     NFADDR;
158         u32     NFDATA;
159         u32     NFSTAT;
160         u32     NFECC;
161 };
162
163
164 /* UART (see manual chapter 11) */
165 struct s3c24x0_uart {
166         u32     ULCON;
167         u32     UCON;
168         u32     UFCON;
169         u32     UMCON;
170         u32     UTRSTAT;
171         u32     UERSTAT;
172         u32     UFSTAT;
173         u32     UMSTAT;
174 #ifdef __BIG_ENDIAN
175         u8      res1[3];
176         u8      UTXH;
177         u8      res2[3];
178         u8      URXH;
179 #else /* Little Endian */
180         u8      UTXH;
181         u8      res1[3];
182         u8      URXH;
183         u8      res2[3];
184 #endif
185         u32     UBRDIV;
186 };
187
188
189 /* PWM TIMER (see manual chapter 10) */
190 struct s3c24x0_timer {
191         u32     TCNTB;
192         u32     TCMPB;
193         u32     TCNTO;
194 };
195
196 struct s3c24x0_timers {
197         u32     TCFG0;
198         u32     TCFG1;
199         u32     TCON;
200         struct s3c24x0_timer    ch[4];
201         u32     TCNTB4;
202         u32     TCNTO4;
203 };
204
205
206 /* USB DEVICE (see manual chapter 13) */
207 struct s3c24x0_usb_dev_fifos {
208 #ifdef __BIG_ENDIAN
209         u8      res[3];
210         u8      EP_FIFO_REG;
211 #else /*  little endian */
212         u8      EP_FIFO_REG;
213         u8      res[3];
214 #endif
215 };
216
217 struct s3c24x0_usb_dev_dmas {
218 #ifdef __BIG_ENDIAN
219         u8      res1[3];
220         u8      EP_DMA_CON;
221         u8      res2[3];
222         u8      EP_DMA_UNIT;
223         u8      res3[3];
224         u8      EP_DMA_FIFO;
225         u8      res4[3];
226         u8      EP_DMA_TTC_L;
227         u8      res5[3];
228         u8      EP_DMA_TTC_M;
229         u8      res6[3];
230         u8      EP_DMA_TTC_H;
231 #else /*  little endian */
232         u8      EP_DMA_CON;
233         u8      res1[3];
234         u8      EP_DMA_UNIT;
235         u8      res2[3];
236         u8      EP_DMA_FIFO;
237         u8      res3[3];
238         u8      EP_DMA_TTC_L;
239         u8      res4[3];
240         u8      EP_DMA_TTC_M;
241         u8      res5[3];
242         u8      EP_DMA_TTC_H;
243         u8      res6[3];
244 #endif
245 };
246
247 struct s3c24x0_usb_device {
248 #ifdef __BIG_ENDIAN
249         u8      res1[3];
250         u8      FUNC_ADDR_REG;
251         u8      res2[3];
252         u8      PWR_REG;
253         u8      res3[3];
254         u8      EP_INT_REG;
255         u8      res4[15];
256         u8      USB_INT_REG;
257         u8      res5[3];
258         u8      EP_INT_EN_REG;
259         u8      res6[15];
260         u8      USB_INT_EN_REG;
261         u8      res7[3];
262         u8      FRAME_NUM1_REG;
263         u8      res8[3];
264         u8      FRAME_NUM2_REG;
265         u8      res9[3];
266         u8      INDEX_REG;
267         u8      res10[7];
268         u8      MAXP_REG;
269         u8      res11[3];
270         u8      EP0_CSR_IN_CSR1_REG;
271         u8      res12[3];
272         u8      IN_CSR2_REG;
273         u8      res13[7];
274         u8      OUT_CSR1_REG;
275         u8      res14[3];
276         u8      OUT_CSR2_REG;
277         u8      res15[3];
278         u8      OUT_FIFO_CNT1_REG;
279         u8      res16[3];
280         u8      OUT_FIFO_CNT2_REG;
281 #else /*  little endian */
282         u8      FUNC_ADDR_REG;
283         u8      res1[3];
284         u8      PWR_REG;
285         u8      res2[3];
286         u8      EP_INT_REG;
287         u8      res3[15];
288         u8      USB_INT_REG;
289         u8      res4[3];
290         u8      EP_INT_EN_REG;
291         u8      res5[15];
292         u8      USB_INT_EN_REG;
293         u8      res6[3];
294         u8      FRAME_NUM1_REG;
295         u8      res7[3];
296         u8      FRAME_NUM2_REG;
297         u8      res8[3];
298         u8      INDEX_REG;
299         u8      res9[7];
300         u8      MAXP_REG;
301         u8      res10[7];
302         u8      EP0_CSR_IN_CSR1_REG;
303         u8      res11[3];
304         u8      IN_CSR2_REG;
305         u8      res12[3];
306         u8      OUT_CSR1_REG;
307         u8      res13[7];
308         u8      OUT_CSR2_REG;
309         u8      res14[3];
310         u8      OUT_FIFO_CNT1_REG;
311         u8      res15[3];
312         u8      OUT_FIFO_CNT2_REG;
313         u8      res16[3];
314 #endif /*  __BIG_ENDIAN */
315         struct s3c24x0_usb_dev_fifos    fifo[5];
316         struct s3c24x0_usb_dev_dmas     dma[5];
317 };
318
319
320 /* WATCH DOG TIMER (see manual chapter 18) */
321 struct s3c24x0_watchdog {
322         u32     WTCON;
323         u32     WTDAT;
324         u32     WTCNT;
325 };
326
327
328 /* IIC (see manual chapter 20) */
329 struct s3c24x0_i2c {
330         u32     IICCON;
331         u32     IICSTAT;
332         u32     IICADD;
333         u32     IICDS;
334 };
335
336
337 /* IIS (see manual chapter 21) */
338 struct s3c24x0_i2s {
339 #ifdef __BIG_ENDIAN
340         u16     res1;
341         u16     IISCON;
342         u16     res2;
343         u16     IISMOD;
344         u16     res3;
345         u16     IISPSR;
346         u16     res4;
347         u16     IISFCON;
348         u16     res5;
349         u16     IISFIFO;
350 #else /*  little endian */
351         u16     IISCON;
352         u16     res1;
353         u16     IISMOD;
354         u16     res2;
355         u16     IISPSR;
356         u16     res3;
357         u16     IISFCON;
358         u16     res4;
359         u16     IISFIFO;
360         u16     res5;
361 #endif
362 };
363
364
365 /* I/O PORT (see manual chapter 9) */
366 struct s3c24x0_gpio {
367 #ifdef CONFIG_S3C2400
368         u32     PACON;
369         u32     PADAT;
370
371         u32     PBCON;
372         u32     PBDAT;
373         u32     PBUP;
374
375         u32     PCCON;
376         u32     PCDAT;
377         u32     PCUP;
378
379         u32     PDCON;
380         u32     PDDAT;
381         u32     PDUP;
382
383         u32     PECON;
384         u32     PEDAT;
385         u32     PEUP;
386
387         u32     PFCON;
388         u32     PFDAT;
389         u32     PFUP;
390
391         u32     PGCON;
392         u32     PGDAT;
393         u32     PGUP;
394
395         u32     OPENCR;
396
397         u32     MISCCR;
398         u32     EXTINT;
399 #endif
400 #ifdef CONFIG_S3C2410
401         u32     GPACON;
402         u32     GPADAT;
403         u32     res1[2];
404         u32     GPBCON;
405         u32     GPBDAT;
406         u32     GPBUP;
407         u32     res2;
408         u32     GPCCON;
409         u32     GPCDAT;
410         u32     GPCUP;
411         u32     res3;
412         u32     GPDCON;
413         u32     GPDDAT;
414         u32     GPDUP;
415         u32     res4;
416         u32     GPECON;
417         u32     GPEDAT;
418         u32     GPEUP;
419         u32     res5;
420         u32     GPFCON;
421         u32     GPFDAT;
422         u32     GPFUP;
423         u32     res6;
424         u32     GPGCON;
425         u32     GPGDAT;
426         u32     GPGUP;
427         u32     res7;
428         u32     GPHCON;
429         u32     GPHDAT;
430         u32     GPHUP;
431         u32     res8;
432
433         u32     MISCCR;
434         u32     DCLKCON;
435         u32     EXTINT0;
436         u32     EXTINT1;
437         u32     EXTINT2;
438         u32     EINTFLT0;
439         u32     EINTFLT1;
440         u32     EINTFLT2;
441         u32     EINTFLT3;
442         u32     EINTMASK;
443         u32     EINTPEND;
444         u32     GSTATUS0;
445         u32     GSTATUS1;
446         u32     GSTATUS2;
447         u32     GSTATUS3;
448         u32     GSTATUS4;
449 #endif
450 };
451
452
453 /* RTC (see manual chapter 17) */
454 struct s3c24x0_rtc {
455 #ifdef __BIG_ENDIAN
456         u8      res1[67];
457         u8      RTCCON;
458         u8      res2[3];
459         u8      TICNT;
460         u8      res3[11];
461         u8      RTCALM;
462         u8      res4[3];
463         u8      ALMSEC;
464         u8      res5[3];
465         u8      ALMMIN;
466         u8      res6[3];
467         u8      ALMHOUR;
468         u8      res7[3];
469         u8      ALMDATE;
470         u8      res8[3];
471         u8      ALMMON;
472         u8      res9[3];
473         u8      ALMYEAR;
474         u8      res10[3];
475         u8      RTCRST;
476         u8      res11[3];
477         u8      BCDSEC;
478         u8      res12[3];
479         u8      BCDMIN;
480         u8      res13[3];
481         u8      BCDHOUR;
482         u8      res14[3];
483         u8      BCDDATE;
484         u8      res15[3];
485         u8      BCDDAY;
486         u8      res16[3];
487         u8      BCDMON;
488         u8      res17[3];
489         u8      BCDYEAR;
490 #else /*  little endian */
491         u8      res0[64];
492         u8      RTCCON;
493         u8      res1[3];
494         u8      TICNT;
495         u8      res2[11];
496         u8      RTCALM;
497         u8      res3[3];
498         u8      ALMSEC;
499         u8      res4[3];
500         u8      ALMMIN;
501         u8      res5[3];
502         u8      ALMHOUR;
503         u8      res6[3];
504         u8      ALMDATE;
505         u8      res7[3];
506         u8      ALMMON;
507         u8      res8[3];
508         u8      ALMYEAR;
509         u8      res9[3];
510         u8      RTCRST;
511         u8      res10[3];
512         u8      BCDSEC;
513         u8      res11[3];
514         u8      BCDMIN;
515         u8      res12[3];
516         u8      BCDHOUR;
517         u8      res13[3];
518         u8      BCDDATE;
519         u8      res14[3];
520         u8      BCDDAY;
521         u8      res15[3];
522         u8      BCDMON;
523         u8      res16[3];
524         u8      BCDYEAR;
525         u8      res17[3];
526 #endif
527 };
528
529
530 /* ADC (see manual chapter 16) */
531 struct s3c2400_adc {
532         u32     ADCCON;
533         u32     ADCDAT;
534 };
535
536
537 /* ADC (see manual chapter 16) */
538 struct s3c2410_adc {
539         u32     ADCCON;
540         u32     ADCTSC;
541         u32     ADCDLY;
542         u32     ADCDAT0;
543         u32     ADCDAT1;
544 };
545
546
547 /* SPI (see manual chapter 22) */
548 struct s3c24x0_spi_channel {
549         u8      SPCON;
550         u8      res1[3];
551         u8      SPSTA;
552         u8      res2[3];
553         u8      SPPIN;
554         u8      res3[3];
555         u8      SPPRE;
556         u8      res4[3];
557         u8      SPTDAT;
558         u8      res5[3];
559         u8      SPRDAT;
560         u8      res6[3];
561         u8      res7[16];
562 };
563
564 struct s3c24x0_spi {
565         struct s3c24x0_spi_channel      ch[S3C24X0_SPI_CHANNELS];
566 };
567
568
569 /* MMC INTERFACE (see S3C2400 manual chapter 19) */
570 struct s3c2400_mmc {
571 #ifdef __BIG_ENDIAN
572         u8      res1[3];
573         u8      MMCON;
574         u8      res2[3];
575         u8      MMCRR;
576         u8      res3[3];
577         u8      MMFCON;
578         u8      res4[3];
579         u8      MMSTA;
580         u16     res5;
581         u16     MMFSTA;
582         u8      res6[3];
583         u8      MMPRE;
584         u16     res7;
585         u16     MMLEN;
586         u8      res8[3];
587         u8      MMCR7;
588         u32     MMRSP[4];
589         u8      res9[3];
590         u8      MMCMD0;
591         u32     MMCMD1;
592         u16     res10;
593         u16     MMCR16;
594         u8      res11[3];
595         u8      MMDAT;
596 #else
597         u8      MMCON;
598         u8      res1[3];
599         u8      MMCRR;
600         u8      res2[3];
601         u8      MMFCON;
602         u8      res3[3];
603         u8      MMSTA;
604         u8      res4[3];
605         u16     MMFSTA;
606         u16     res5;
607         u8      MMPRE;
608         u8      res6[3];
609         u16     MMLEN;
610         u16     res7;
611         u8      MMCR7;
612         u8      res8[3];
613         u32     MMRSP[4];
614         u8      MMCMD0;
615         u8      res9[3];
616         u32     MMCMD1;
617         u16     MMCR16;
618         u16     res10;
619         u8      MMDAT;
620         u8      res11[3];
621 #endif
622 };
623
624
625 /* SD INTERFACE (see S3C2410 manual chapter 19) */
626 struct s3c2410_sdi {
627         u32     SDICON;
628         u32     SDIPRE;
629         u32     SDICARG;
630         u32     SDICCON;
631         u32     SDICSTA;
632         u32     SDIRSP0;
633         u32     SDIRSP1;
634         u32     SDIRSP2;
635         u32     SDIRSP3;
636         u32     SDIDTIMER;
637         u32     SDIBSIZE;
638         u32     SDIDCON;
639         u32     SDIDCNT;
640         u32     SDIDSTA;
641         u32     SDIFSTA;
642 #ifdef __BIG_ENDIAN
643         u8      res[3];
644         u8      SDIDAT;
645 #else
646         u8      SDIDAT;
647         u8      res[3];
648 #endif
649         u32     SDIIMSK;
650 };
651
652 #endif /*__S3C24X0_H__*/