]> git.sur5r.net Git - u-boot/blob - arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
I2C: Move struct s3c24x0_i2c to a common place.
[u-boot] / arch / arm / include / asm / 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 #if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
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 #if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
92         u32     disrcc;
93 #endif
94         u32     didst;
95 #if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
96         u32     didstc;
97 #endif
98         u32     dcon;
99         u32     dstat;
100         u32     dcsrc;
101         u32     dcdst;
102         u32     dmasktrig;
103 #if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) \
104                 || defined(CONFIG_S3C2440)
105         u32     res[1];
106 #endif
107 };
108
109 struct s3c24x0_dmas {
110         struct s3c24x0_dma      dma[4];
111 };
112
113
114 /* CLOCK & POWER MANAGEMENT (see S3C2400 manual chapter 6) */
115 /*                          (see S3C2410 manual chapter 7) */
116 struct s3c24x0_clock_power {
117         u32     locktime;
118         u32     mpllcon;
119         u32     upllcon;
120         u32     clkcon;
121         u32     clkslow;
122         u32     clkdivn;
123 #if defined(CONFIG_S3C2440)
124         u32     camdivn;
125 #endif
126 };
127
128
129 /* LCD CONTROLLER (see manual chapter 15) */
130 struct s3c24x0_lcd {
131         u32     lcdcon1;
132         u32     lcdcon2;
133         u32     lcdcon3;
134         u32     lcdcon4;
135         u32     lcdcon5;
136         u32     lcdsaddr1;
137         u32     lcdsaddr2;
138         u32     lcdsaddr3;
139         u32     redlut;
140         u32     greenlut;
141         u32     bluelut;
142         u32     res[8];
143         u32     dithmode;
144         u32     tpal;
145 #if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
146         u32     lcdintpnd;
147         u32     lcdsrcpnd;
148         u32     lcdintmsk;
149         u32     lpcsel;
150 #endif
151 };
152
153
154 #ifdef CONFIG_S3C2410
155 /* NAND FLASH (see S3C2410 manual chapter 6) */
156 struct s3c2410_nand {
157         u32     nfconf;
158         u32     nfcmd;
159         u32     nfaddr;
160         u32     nfdata;
161         u32     nfstat;
162         u32     nfecc;
163 };
164 #endif
165 #ifdef CONFIG_S3C2440
166 /* NAND FLASH (see S3C2440 manual chapter 6) */
167 struct s3c2440_nand {
168         u32     nfconf;
169         u32     nfcont;
170         u32     nfcmd;
171         u32     nfaddr;
172         u32     nfdata;
173         u32     nfeccd0;
174         u32     nfeccd1;
175         u32     nfeccd;
176         u32     nfstat;
177         u32     nfstat0;
178         u32     nfstat1;
179 };
180 #endif
181
182
183 /* UART (see manual chapter 11) */
184 struct s3c24x0_uart {
185         u32     ulcon;
186         u32     ucon;
187         u32     ufcon;
188         u32     umcon;
189         u32     utrstat;
190         u32     uerstat;
191         u32     ufstat;
192         u32     umstat;
193 #ifdef __BIG_ENDIAN
194         u8      res1[3];
195         u8      utxh;
196         u8      res2[3];
197         u8      urxh;
198 #else /* Little Endian */
199         u8      utxh;
200         u8      res1[3];
201         u8      urxh;
202         u8      res2[3];
203 #endif
204         u32     ubrdiv;
205 };
206
207
208 /* PWM TIMER (see manual chapter 10) */
209 struct s3c24x0_timer {
210         u32     tcntb;
211         u32     tcmpb;
212         u32     tcnto;
213 };
214
215 struct s3c24x0_timers {
216         u32     tcfg0;
217         u32     tcfg1;
218         u32     tcon;
219         struct s3c24x0_timer    ch[4];
220         u32     tcntb4;
221         u32     tcnto4;
222 };
223
224
225 /* USB DEVICE (see manual chapter 13) */
226 struct s3c24x0_usb_dev_fifos {
227 #ifdef __BIG_ENDIAN
228         u8      res[3];
229         u8      ep_fifo_reg;
230 #else /*  little endian */
231         u8      ep_fifo_reg;
232         u8      res[3];
233 #endif
234 };
235
236 struct s3c24x0_usb_dev_dmas {
237 #ifdef __BIG_ENDIAN
238         u8      res1[3];
239         u8      ep_dma_con;
240         u8      res2[3];
241         u8      ep_dma_unit;
242         u8      res3[3];
243         u8      ep_dma_fifo;
244         u8      res4[3];
245         u8      ep_dma_ttc_l;
246         u8      res5[3];
247         u8      ep_dma_ttc_m;
248         u8      res6[3];
249         u8      ep_dma_ttc_h;
250 #else /*  little endian */
251         u8      ep_dma_con;
252         u8      res1[3];
253         u8      ep_dma_unit;
254         u8      res2[3];
255         u8      ep_dma_fifo;
256         u8      res3[3];
257         u8      ep_dma_ttc_l;
258         u8      res4[3];
259         u8      ep_dma_ttc_m;
260         u8      res5[3];
261         u8      ep_dma_ttc_h;
262         u8      res6[3];
263 #endif
264 };
265
266 struct s3c24x0_usb_device {
267 #ifdef __BIG_ENDIAN
268         u8      res1[3];
269         u8      func_addr_reg;
270         u8      res2[3];
271         u8      pwr_reg;
272         u8      res3[3];
273         u8      ep_int_reg;
274         u8      res4[15];
275         u8      usb_int_reg;
276         u8      res5[3];
277         u8      ep_int_en_reg;
278         u8      res6[15];
279         u8      usb_int_en_reg;
280         u8      res7[3];
281         u8      frame_num1_reg;
282         u8      res8[3];
283         u8      frame_num2_reg;
284         u8      res9[3];
285         u8      index_reg;
286         u8      res10[7];
287         u8      maxp_reg;
288         u8      res11[3];
289         u8      ep0_csr_in_csr1_reg;
290         u8      res12[3];
291         u8      in_csr2_reg;
292         u8      res13[7];
293         u8      out_csr1_reg;
294         u8      res14[3];
295         u8      out_csr2_reg;
296         u8      res15[3];
297         u8      out_fifo_cnt1_reg;
298         u8      res16[3];
299         u8      out_fifo_cnt2_reg;
300 #else /*  little endian */
301         u8      func_addr_reg;
302         u8      res1[3];
303         u8      pwr_reg;
304         u8      res2[3];
305         u8      ep_int_reg;
306         u8      res3[15];
307         u8      usb_int_reg;
308         u8      res4[3];
309         u8      ep_int_en_reg;
310         u8      res5[15];
311         u8      usb_int_en_reg;
312         u8      res6[3];
313         u8      frame_num1_reg;
314         u8      res7[3];
315         u8      frame_num2_reg;
316         u8      res8[3];
317         u8      index_reg;
318         u8      res9[7];
319         u8      maxp_reg;
320         u8      res10[7];
321         u8      ep0_csr_in_csr1_reg;
322         u8      res11[3];
323         u8      in_csr2_reg;
324         u8      res12[3];
325         u8      out_csr1_reg;
326         u8      res13[7];
327         u8      out_csr2_reg;
328         u8      res14[3];
329         u8      out_fifo_cnt1_reg;
330         u8      res15[3];
331         u8      out_fifo_cnt2_reg;
332         u8      res16[3];
333 #endif /*  __BIG_ENDIAN */
334         struct s3c24x0_usb_dev_fifos    fifo[5];
335         struct s3c24x0_usb_dev_dmas     dma[5];
336 };
337
338
339 /* WATCH DOG TIMER (see manual chapter 18) */
340 struct s3c24x0_watchdog {
341         u32     wtcon;
342         u32     wtdat;
343         u32     wtcnt;
344 };
345
346 /* IIS (see manual chapter 21) */
347 struct s3c24x0_i2s {
348 #ifdef __BIG_ENDIAN
349         u16     res1;
350         u16     iiscon;
351         u16     res2;
352         u16     iismod;
353         u16     res3;
354         u16     iispsr;
355         u16     res4;
356         u16     iisfcon;
357         u16     res5;
358         u16     iisfifo;
359 #else /*  little endian */
360         u16     iiscon;
361         u16     res1;
362         u16     iismod;
363         u16     res2;
364         u16     iispsr;
365         u16     res3;
366         u16     iisfcon;
367         u16     res4;
368         u16     iisfifo;
369         u16     res5;
370 #endif
371 };
372
373
374 /* I/O PORT (see manual chapter 9) */
375 struct s3c24x0_gpio {
376 #ifdef CONFIG_S3C2400
377         u32     pacon;
378         u32     padat;
379
380         u32     pbcon;
381         u32     pbdat;
382         u32     pbup;
383
384         u32     pccon;
385         u32     pcdat;
386         u32     pcup;
387
388         u32     pdcon;
389         u32     pddat;
390         u32     pdup;
391
392         u32     pecon;
393         u32     pedat;
394         u32     peup;
395
396         u32     pfcon;
397         u32     pfdat;
398         u32     pfup;
399
400         u32     pgcon;
401         u32     pgdat;
402         u32     pgup;
403
404         u32     opencr;
405
406         u32     misccr;
407         u32     extint;
408 #endif
409 #ifdef CONFIG_S3C2410
410         u32     gpacon;
411         u32     gpadat;
412         u32     res1[2];
413         u32     gpbcon;
414         u32     gpbdat;
415         u32     gpbup;
416         u32     res2;
417         u32     gpccon;
418         u32     gpcdat;
419         u32     gpcup;
420         u32     res3;
421         u32     gpdcon;
422         u32     gpddat;
423         u32     gpdup;
424         u32     res4;
425         u32     gpecon;
426         u32     gpedat;
427         u32     gpeup;
428         u32     res5;
429         u32     gpfcon;
430         u32     gpfdat;
431         u32     gpfup;
432         u32     res6;
433         u32     gpgcon;
434         u32     gpgdat;
435         u32     gpgup;
436         u32     res7;
437         u32     gphcon;
438         u32     gphdat;
439         u32     gphup;
440         u32     res8;
441
442         u32     misccr;
443         u32     dclkcon;
444         u32     extint0;
445         u32     extint1;
446         u32     extint2;
447         u32     eintflt0;
448         u32     eintflt1;
449         u32     eintflt2;
450         u32     eintflt3;
451         u32     eintmask;
452         u32     eintpend;
453         u32     gstatus0;
454         u32     gstatus1;
455         u32     gstatus2;
456         u32     gstatus3;
457         u32     gstatus4;
458 #endif
459 #if defined(CONFIG_S3C2440)
460         u32     gpacon;
461         u32     gpadat;
462         u32     res1[2];
463         u32     gpbcon;
464         u32     gpbdat;
465         u32     gpbup;
466         u32     res2;
467         u32     gpccon;
468         u32     gpcdat;
469         u32     gpcup;
470         u32     res3;
471         u32     gpdcon;
472         u32     gpddat;
473         u32     gpdup;
474         u32     res4;
475         u32     gpecon;
476         u32     gpedat;
477         u32     gpeup;
478         u32     res5;
479         u32     gpfcon;
480         u32     gpfdat;
481         u32     gpfup;
482         u32     res6;
483         u32     gpgcon;
484         u32     gpgdat;
485         u32     gpgup;
486         u32     res7;
487         u32     gphcon;
488         u32     gphdat;
489         u32     gphup;
490         u32     res8;
491
492         u32     misccr;
493         u32     dclkcon;
494         u32     extint0;
495         u32     extint1;
496         u32     extint2;
497         u32     eintflt0;
498         u32     eintflt1;
499         u32     eintflt2;
500         u32     eintflt3;
501         u32     eintmask;
502         u32     eintpend;
503         u32     gstatus0;
504         u32     gstatus1;
505         u32     gstatus2;
506         u32     gstatus3;
507         u32     gstatus4;
508
509         u32     res9;
510         u32     dsc0;
511         u32     dsc1;
512         u32     mslcon;
513         u32     gpjcon;
514         u32     gpjdat;
515         u32     gpjup;
516         u32     res10;
517 #endif
518 };
519
520
521 /* RTC (see manual chapter 17) */
522 struct s3c24x0_rtc {
523 #ifdef __BIG_ENDIAN
524         u8      res1[67];
525         u8      rtccon;
526         u8      res2[3];
527         u8      ticnt;
528         u8      res3[11];
529         u8      rtcalm;
530         u8      res4[3];
531         u8      almsec;
532         u8      res5[3];
533         u8      almmin;
534         u8      res6[3];
535         u8      almhour;
536         u8      res7[3];
537         u8      almdate;
538         u8      res8[3];
539         u8      almmon;
540         u8      res9[3];
541         u8      almyear;
542         u8      res10[3];
543         u8      rtcrst;
544         u8      res11[3];
545         u8      bcdsec;
546         u8      res12[3];
547         u8      bcdmin;
548         u8      res13[3];
549         u8      bcdhour;
550         u8      res14[3];
551         u8      bcddate;
552         u8      res15[3];
553         u8      bcdday;
554         u8      res16[3];
555         u8      bcdmon;
556         u8      res17[3];
557         u8      bcdyear;
558 #else /*  little endian */
559         u8      res0[64];
560         u8      rtccon;
561         u8      res1[3];
562         u8      ticnt;
563         u8      res2[11];
564         u8      rtcalm;
565         u8      res3[3];
566         u8      almsec;
567         u8      res4[3];
568         u8      almmin;
569         u8      res5[3];
570         u8      almhour;
571         u8      res6[3];
572         u8      almdate;
573         u8      res7[3];
574         u8      almmon;
575         u8      res8[3];
576         u8      almyear;
577         u8      res9[3];
578         u8      rtcrst;
579         u8      res10[3];
580         u8      bcdsec;
581         u8      res11[3];
582         u8      bcdmin;
583         u8      res12[3];
584         u8      bcdhour;
585         u8      res13[3];
586         u8      bcddate;
587         u8      res14[3];
588         u8      bcdday;
589         u8      res15[3];
590         u8      bcdmon;
591         u8      res16[3];
592         u8      bcdyear;
593         u8      res17[3];
594 #endif
595 };
596
597
598 /* ADC (see manual chapter 16) */
599 struct s3c2400_adc {
600         u32     adccon;
601         u32     adcdat;
602 };
603
604
605 /* ADC (see manual chapter 16) */
606 struct s3c2410_adc {
607         u32     adccon;
608         u32     adctsc;
609         u32     adcdly;
610         u32     adcdat0;
611         u32     adcdat1;
612 };
613
614
615 /* SPI (see manual chapter 22) */
616 struct s3c24x0_spi_channel {
617         u8      spcon;
618         u8      res1[3];
619         u8      spsta;
620         u8      res2[3];
621         u8      sppin;
622         u8      res3[3];
623         u8      sppre;
624         u8      res4[3];
625         u8      sptdat;
626         u8      res5[3];
627         u8      sprdat;
628         u8      res6[3];
629         u8      res7[16];
630 };
631
632 struct s3c24x0_spi {
633         struct s3c24x0_spi_channel      ch[S3C24X0_SPI_CHANNELS];
634 };
635
636
637 /* MMC INTERFACE (see S3C2400 manual chapter 19) */
638 struct s3c2400_mmc {
639 #ifdef __BIG_ENDIAN
640         u8      res1[3];
641         u8      mmcon;
642         u8      res2[3];
643         u8      mmcrr;
644         u8      res3[3];
645         u8      mmfcon;
646         u8      res4[3];
647         u8      mmsta;
648         u16     res5;
649         u16     mmfsta;
650         u8      res6[3];
651         u8      mmpre;
652         u16     res7;
653         u16     mmlen;
654         u8      res8[3];
655         u8      mmcr7;
656         u32     mmrsp[4];
657         u8      res9[3];
658         u8      mmcmd0;
659         u32     mmcmd1;
660         u16     res10;
661         u16     mmcr16;
662         u8      res11[3];
663         u8      mmdat;
664 #else
665         u8      mmcon;
666         u8      res1[3];
667         u8      mmcrr;
668         u8      res2[3];
669         u8      mmfcon;
670         u8      res3[3];
671         u8      mmsta;
672         u8      res4[3];
673         u16     mmfsta;
674         u16     res5;
675         u8      mmpre;
676         u8      res6[3];
677         u16     mmlen;
678         u16     res7;
679         u8      mmcr7;
680         u8      res8[3];
681         u32     mmrsp[4];
682         u8      mmcmd0;
683         u8      res9[3];
684         u32     mmcmd1;
685         u16     mmcr16;
686         u16     res10;
687         u8      mmdat;
688         u8      res11[3];
689 #endif
690 };
691
692
693 /* SD INTERFACE (see S3C2410 manual chapter 19) */
694 struct s3c2410_sdi {
695         u32     sdicon;
696         u32     sdipre;
697         u32     sdicarg;
698         u32     sdiccon;
699         u32     sdicsta;
700         u32     sdirsp0;
701         u32     sdirsp1;
702         u32     sdirsp2;
703         u32     sdirsp3;
704         u32     sdidtimer;
705         u32     sdibsize;
706         u32     sdidcon;
707         u32     sdidcnt;
708         u32     sdidsta;
709         u32     sdifsta;
710 #ifdef __BIG_ENDIAN
711         u8      res[3];
712         u8      sdidat;
713 #else
714         u8      sdidat;
715         u8      res[3];
716 #endif
717         u32     sdiimsk;
718 };
719
720 #endif /*__S3C24X0_H__*/