guowenxue
2020-01-09 f2ad9b27bbaec2adafdbf499eee750830a762d9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
#ifndef __S3C2440_H__
#define __S3C2440_H__
 
#define S3C2440_UART_CHANNELS    3
#define S3C2440_SPI_CHANNELS    2
 
/* Memory controller (see manual chapter 5) */
struct s3c2440_memctl {
    volatile unsigned int    BWSCON;
    volatile unsigned int    BANKCON[8];
    volatile unsigned int    REFRESH;
    volatile unsigned int    BANKSIZE;
    volatile unsigned int    MRSRB6;
    volatile unsigned int    MRSRB7;
};
 
 
/* USB HOST (see manual chapter 12) */
struct s3c2440_usb_host {
    volatile unsigned int    HcRevision;
    volatile unsigned int    HcControl;
    volatile unsigned int    HcCommonStatus;
    volatile unsigned int    HcInterruptStatus;
    volatile unsigned int    HcInterruptEnable;
    volatile unsigned int    HcInterruptDisable;
    volatile unsigned int    HcHCCA;
    volatile unsigned int    HcPeriodCuttendED;
    volatile unsigned int    HcControlHeadED;
    volatile unsigned int    HcControlCurrentED;
    volatile unsigned int    HcBulkHeadED;
    volatile unsigned int    HcBuldCurrentED;
    volatile unsigned int    HcDoneHead;
    volatile unsigned int    HcRmInterval;
    volatile unsigned int    HcFmRemaining;
    volatile unsigned int    HcFmNumber;
    volatile unsigned int    HcPeriodicStart;
    volatile unsigned int    HcLSThreshold;
    volatile unsigned int    HcRhDescriptorA;
    volatile unsigned int    HcRhDescriptorB;
    volatile unsigned int    HcRhStatus;
    volatile unsigned int    HcRhPortStatus1;
    volatile unsigned int    HcRhPortStatus2;
};
 
 
/* INTERRUPT (see manual chapter 14) */
struct s3c2440_interrupt {
    volatile unsigned int    SRCPND;
    volatile unsigned int    INTMOD;
    volatile unsigned int    INTMSK;
    volatile unsigned int    PRIORITY;
    volatile unsigned int    INTPND;
    volatile unsigned int    INTOFFSET;
    volatile unsigned int    SUBSRCPND;
    volatile unsigned int    INTSUBMSK;
};
 
 
/* DMAS (see manual chapter 8) */
struct s3c2440_dma {
    volatile unsigned int    DISRC;
    volatile unsigned int    DISRCC;
    volatile unsigned int    DIDST;
    volatile unsigned int    DIDSTC;
    volatile unsigned int    DCON;
    volatile unsigned int    DSTAT;
    volatile unsigned int    DCSRC;
    volatile unsigned int    DCDST;
    volatile unsigned int    DMASKTRIG;
    volatile unsigned int    res[7];
};
 
struct s3c2440_dmas {
    struct s3c2440_dma    dma[4];
};
 
 
struct s3c2440_clock_power {
    volatile unsigned int    LOCKTIME;
    volatile unsigned int    MPLLCON;
    volatile unsigned int    UPLLCON;
    volatile unsigned int    CLKCON;
    volatile unsigned int    CLKSLOW;
    volatile unsigned int    CLKDIVN;
    volatile unsigned int CAMDIVN;
};
 
 
/* LCD CONTROLLER (see manual chapter 15) */
struct s3c2440_lcd {
    volatile unsigned int    LCDCON1;
    volatile unsigned int    LCDCON2;
    volatile unsigned int    LCDCON3;
    volatile unsigned int    LCDCON4;
    volatile unsigned int    LCDCON5;
    volatile unsigned int    LCDSADDR1;
    volatile unsigned int    LCDSADDR2;
    volatile unsigned int    LCDSADDR3;
    volatile unsigned int    REDLUT;
    volatile unsigned int    GREENLUT;
    volatile unsigned int    BLUELUT;
    volatile unsigned int    res[8];
    volatile unsigned int    DITHMODE;
    volatile unsigned int    TPAL;
    volatile unsigned int    LCDINTPND;
    volatile unsigned int    LCDSRCPND;
    volatile unsigned int    LCDINTMSK;
    volatile unsigned int    TCONSEL;
};
 
 
/* NAND FLASH (see S3C2440 manual chapter 6) */
struct s3c2440_nand {
    volatile unsigned int    NFCONF;
    volatile unsigned int    NFCONT;
    volatile unsigned int    NFCMD;
    volatile unsigned int    NFADDR;
    volatile unsigned int    NFDATA;
    volatile unsigned int    NFMECCD0;
    volatile unsigned int    NFMECCD1;
    volatile unsigned int    NFSECCD;
    volatile unsigned int    NFSTAT;
    volatile unsigned int    NFESTAT0;
    volatile unsigned int    NFESTAT1;
    volatile unsigned int    NFMECC0;
    volatile unsigned int    NFMECC1;
    volatile unsigned int    NFSECC;
    volatile unsigned int    NFSBLK;
    volatile unsigned int    NFEBLK;
};
 
 
/* UART (see manual chapter 11) */
struct s3c2440_uart {
    volatile unsigned int    ULCON;
    volatile unsigned int    UCON;
    volatile unsigned int    UFCON;
    volatile unsigned int    UMCON;
    volatile unsigned int    UTRSTAT;
    volatile unsigned int    UERSTAT;
    volatile unsigned int    UFSTAT;
    volatile unsigned int    UMSTAT;
#ifdef __BIG_ENDIAN
    volatile unsigned char    res1[3];
    volatile unsigned char    UTXH;
    volatile unsigned char    res2[3];
    volatile unsigned char    URXH;
#else /* Little Endian */
    volatile unsigned char    UTXH;
    volatile unsigned char    res1[3];
    volatile unsigned char    URXH;
    volatile unsigned char    res2[3];
#endif
    volatile unsigned int    UBRDIV;
};
 
 
/* PWM TIMER (see manual chapter 10) */
struct s3c2440_timer {
    volatile unsigned int    TCNTB;
    volatile unsigned int    TCMPB;
    volatile unsigned int    TCNTO;
};
 
struct s3c2440_timers {
    volatile unsigned int    TCFG0;
    volatile unsigned int    TCFG1;
    volatile unsigned int    TCON;
    struct s3c2440_timer    ch[4];
    volatile unsigned int    TCNTB4;
    volatile unsigned int    TCNTO4;
};
 
 
/* USB DEVICE (see manual chapter 13) */
struct s3c2440_usb_dev_fifos {
#ifdef __BIG_ENDIAN
    volatile unsigned char    res[3];
    volatile unsigned char    EP_FIFO_REG;
#else /*  little endian */
    volatile unsigned char    EP_FIFO_REG;
    volatile unsigned char    res[3];
#endif
};
 
struct s3c2440_usb_dev_dmas {
#ifdef __BIG_ENDIAN
    volatile unsigned char    res1[3];
    volatile unsigned char    EP_DMA_CON;
    volatile unsigned char    res2[3];
    volatile unsigned char    EP_DMA_UNIT;
    volatile unsigned char    res3[3];
    volatile unsigned char    EP_DMA_FIFO;
    volatile unsigned char    res4[3];
    volatile unsigned char    EP_DMA_TTC_L;
    volatile unsigned char    res5[3];
    volatile unsigned char    EP_DMA_TTC_M;
    volatile unsigned char    res6[3];
    volatile unsigned char    EP_DMA_TTC_H;
#else /*  little endian */
    volatile unsigned char    EP_DMA_CON;
    volatile unsigned char    res1[3];
    volatile unsigned char    EP_DMA_UNIT;
    volatile unsigned char    res2[3];
    volatile unsigned char    EP_DMA_FIFO;
    volatile unsigned char    res3[3];
    volatile unsigned char    EP_DMA_TTC_L;
    volatile unsigned char    res4[3];
    volatile unsigned char    EP_DMA_TTC_M;
    volatile unsigned char    res5[3];
    volatile unsigned char    EP_DMA_TTC_H;
    volatile unsigned char    res6[3];
#endif
};
 
struct s3c2440_usb_device {
#ifdef __BIG_ENDIAN
    volatile unsigned char    res1[3];
    volatile unsigned char    FUNC_ADDR_REG;
    volatile unsigned char    res2[3];
    volatile unsigned char    PWR_REG;
    volatile unsigned char    res3[3];
    volatile unsigned char    EP_INT_REG;
    volatile unsigned char    res4[15];
    volatile unsigned char    USB_INT_REG;
    volatile unsigned char    res5[3];
    volatile unsigned char    EP_INT_EN_REG;
    volatile unsigned char    res6[15];
    volatile unsigned char    USB_INT_EN_REG;
    volatile unsigned char    res7[3];
    volatile unsigned char    FRAME_NUM1_REG;
    volatile unsigned char    res8[3];
    volatile unsigned char    FRAME_NUM2_REG;
    volatile unsigned char    res9[3];
    volatile unsigned char    INDEX_REG;
    volatile unsigned char    res10[7];
    volatile unsigned char    MAXP_REG;
    volatile unsigned char    res11[3];
    volatile unsigned char    EP0_CSR_IN_CSR1_REG;
    volatile unsigned char    res12[3];
    volatile unsigned char    IN_CSR2_REG;
    volatile unsigned char    res13[7];
    volatile unsigned char    OUT_CSR1_REG;
    volatile unsigned char    res14[3];
    volatile unsigned char    OUT_CSR2_REG;
    volatile unsigned char    res15[3];
    volatile unsigned char    OUT_FIFO_CNT1_REG;
    volatile unsigned char    res16[3];
    volatile unsigned char    OUT_FIFO_CNT2_REG;
#else /*  little endian */
    volatile unsigned char    FUNC_ADDR_REG;
    volatile unsigned char    res1[3];
    volatile unsigned char    PWR_REG;
    volatile unsigned char    res2[3];
    volatile unsigned char    EP_INT_REG;
    volatile unsigned char    res3[15];
    volatile unsigned char    USB_INT_REG;
    volatile unsigned char    res4[3];
    volatile unsigned char    EP_INT_EN_REG;
    volatile unsigned char    res5[15];
    volatile unsigned char    USB_INT_EN_REG;
    volatile unsigned char    res6[3];
    volatile unsigned char    FRAME_NUM1_REG;
    volatile unsigned char    res7[3];
    volatile unsigned char    FRAME_NUM2_REG;
    volatile unsigned char    res8[3];
    volatile unsigned char    INDEX_REG;
    volatile unsigned char    res9[7];
    volatile unsigned char    MAXP_REG;
    volatile unsigned char    res10[7];
    volatile unsigned char    EP0_CSR_IN_CSR1_REG;
    volatile unsigned char    res11[3];
    volatile unsigned char    IN_CSR2_REG;
    volatile unsigned char    res12[3];
    volatile unsigned char    OUT_CSR1_REG;
    volatile unsigned char    res13[7];
    volatile unsigned char    OUT_CSR2_REG;
    volatile unsigned char    res14[3];
    volatile unsigned char    OUT_FIFO_CNT1_REG;
    volatile unsigned char    res15[3];
    volatile unsigned char    OUT_FIFO_CNT2_REG;
    volatile unsigned char    res16[3];
#endif /*  __BIG_ENDIAN */
    struct s3c2440_usb_dev_fifos    fifo[5];
    struct s3c2440_usb_dev_dmas    dma[5];
};
 
 
/* WATCH DOG TIMER (see manual chapter 18) */
struct s3c2440_watchdog {
    volatile unsigned int    WTCON;
    volatile unsigned int    WTDAT;
    volatile unsigned int    WTCNT;
};
 
 
/* IIC (see manual chapter 20) */
struct s3c2440_i2c {
    volatile unsigned int    IICCON;
    volatile unsigned int    IICSTAT;
    volatile unsigned int    IICADD;
    volatile unsigned int    IICDS;
};
 
 
/* IIS (see manual chapter 21) */
struct s3c2440_i2s {
#ifdef __BIG_ENDIAN
    volatile unsigned short    res1;
    volatile unsigned short    IISCON;
    volatile unsigned short    res2;
    volatile unsigned short    IISMOD;
    volatile unsigned short    res3;
    volatile unsigned short    IISPSR;
    volatile unsigned short    res4;
    volatile unsigned short    IISFCON;
    volatile unsigned short    res5;
    volatile unsigned short    IISFIFO;
#else /*  little endian */
    volatile unsigned short    IISCON;
    volatile unsigned short    res1;
    volatile unsigned short    IISMOD;
    volatile unsigned short    res2;
    volatile unsigned short    IISPSR;
    volatile unsigned short    res3;
    volatile unsigned short    IISFCON;
    volatile unsigned short    res4;
    volatile unsigned short    IISFIFO;
    volatile unsigned short    res5;
#endif
};
 
 
/* I/O PORT (see manual chapter 9) */
struct s3c2440_gpio {
    volatile unsigned int    GPACON;
    volatile unsigned int    GPADAT;
    volatile unsigned int    res1[2];
    volatile unsigned int    GPBCON;
    volatile unsigned int    GPBDAT;
    volatile unsigned int    GPBUP;
    volatile unsigned int    res2;
    volatile unsigned int    GPCCON;
    volatile unsigned int    GPCDAT;
    volatile unsigned int    GPCUP;
    volatile unsigned int    res3;
    volatile unsigned int    GPDCON;
    volatile unsigned int    GPDDAT;
    volatile unsigned int    GPDUP;
    volatile unsigned int    res4;
    volatile unsigned int    GPECON;
    volatile unsigned int    GPEDAT;
    volatile unsigned int    GPEUP;
    volatile unsigned int    res5;
    volatile unsigned int    GPFCON;
    volatile unsigned int    GPFDAT;
    volatile unsigned int    GPFUP;
    volatile unsigned int    res6;
    volatile unsigned int    GPGCON;
    volatile unsigned int    GPGDAT;
    volatile unsigned int    GPGUP;
    volatile unsigned int    res7;
    volatile unsigned int    GPHCON;
    volatile unsigned int    GPHDAT;
    volatile unsigned int    GPHUP;
    volatile unsigned int    res8;
 
    volatile unsigned int    MISCCR;
    volatile unsigned int    DCLKCON;
    volatile unsigned int    EXTINT0;
    volatile unsigned int    EXTINT1;
    volatile unsigned int    EXTINT2;
    volatile unsigned int    EINTFLT0;
    volatile unsigned int    EINTFLT1;
    volatile unsigned int    EINTFLT2;
    volatile unsigned int    EINTFLT3;
    volatile unsigned int    EINTMASK;
    volatile unsigned int    EINTPEND;
    volatile unsigned int    GSTATUS0;
    volatile unsigned int    GSTATUS1;
    volatile unsigned int    GSTATUS2;
    volatile unsigned int    GSTATUS3;
    volatile unsigned int    GSTATUS4;
};
 
 
/* RTC (see manual chapter 17) */
struct s3c2440_rtc {
#ifdef __BIG_ENDIAN
    volatile unsigned char    res1[67];
    volatile unsigned char    RTCCON;
    volatile unsigned char    res2[3];
    volatile unsigned char    TICNT;
    volatile unsigned char    res3[11];
    volatile unsigned char    RTCALM;
    volatile unsigned char    res4[3];
    volatile unsigned char    ALMSEC;
    volatile unsigned char    res5[3];
    volatile unsigned char    ALMMIN;
    volatile unsigned char    res6[3];
    volatile unsigned char    ALMHOUR;
    volatile unsigned char    res7[3];
    volatile unsigned char    ALMDATE;
    volatile unsigned char    res8[3];
    volatile unsigned char    ALMMON;
    volatile unsigned char    res9[3];
    volatile unsigned char    ALMYEAR;
    volatile unsigned char    res10[3];
    volatile unsigned char    RTCRST;
    volatile unsigned char    res11[3];
    volatile unsigned char    BCDSEC;
    volatile unsigned char    res12[3];
    volatile unsigned char    BCDMIN;
    volatile unsigned char    res13[3];
    volatile unsigned char    BCDHOUR;
    volatile unsigned char    res14[3];
    volatile unsigned char    BCDDATE;
    volatile unsigned char    res15[3];
    volatile unsigned char    BCDDAY;
    volatile unsigned char    res16[3];
    volatile unsigned char    BCDMON;
    volatile unsigned char    res17[3];
    volatile unsigned char    BCDYEAR;
#else /*  little endian */
    volatile unsigned char    res0[64];
    volatile unsigned char    RTCCON;
    volatile unsigned char    res1[3];
    volatile unsigned char    TICNT;
    volatile unsigned char    res2[11];
    volatile unsigned char    RTCALM;
    volatile unsigned char    res3[3];
    volatile unsigned char    ALMSEC;
    volatile unsigned char    res4[3];
    volatile unsigned char    ALMMIN;
    volatile unsigned char    res5[3];
    volatile unsigned char    ALMHOUR;
    volatile unsigned char    res6[3];
    volatile unsigned char    ALMDATE;
    volatile unsigned char    res7[3];
    volatile unsigned char    ALMMON;
    volatile unsigned char    res8[3];
    volatile unsigned char    ALMYEAR;
    volatile unsigned char    res9[3];
    volatile unsigned char    RTCRST;
    volatile unsigned char    res10[3];
    volatile unsigned char    BCDSEC;
    volatile unsigned char    res11[3];
    volatile unsigned char    BCDMIN;
    volatile unsigned char    res12[3];
    volatile unsigned char    BCDHOUR;
    volatile unsigned char    res13[3];
    volatile unsigned char    BCDDATE;
    volatile unsigned char    res14[3];
    volatile unsigned char    BCDDAY;
    volatile unsigned char    res15[3];
    volatile unsigned char    BCDMON;
    volatile unsigned char    res16[3];
    volatile unsigned char    BCDYEAR;
    volatile unsigned char    res17[3];
#endif
};
 
 
/* ADC (see manual chapter 16) */
struct s3c2440_adc {
    volatile unsigned int    ADCCON;
    volatile unsigned int    ADCTSC;
    volatile unsigned int    ADCDLY;
    volatile unsigned int    ADCDAT0;
    volatile unsigned int    ADCDAT1;
    volatile unsigned int ADCUPDN;
};
 
 
/* SPI (see manual chapter 22) */
struct s3c2440_spi_channel {
    volatile unsigned char    SPCON;
    volatile unsigned char    res1[3];
    volatile unsigned char    SPSTA;
    volatile unsigned char    res2[3];
    volatile unsigned char    SPPIN;
    volatile unsigned char    res3[3];
    volatile unsigned char    SPPRE;
    volatile unsigned char    res4[3];
    volatile unsigned char    SPTDAT;
    volatile unsigned char    res5[3];
    volatile unsigned char    SPRDAT;
    volatile unsigned char    res6[3];
    volatile unsigned char    res7[16];
};
 
struct s3c2440_spi {
    struct s3c2440_spi_channel    ch[S3C2440_SPI_CHANNELS];
};
 
 
struct s3c2440_sdi {
    volatile unsigned int    SDICON;
    volatile unsigned int    SDIPRE;
    volatile unsigned int    SDICARG;
    volatile unsigned int    SDICCON;
    volatile unsigned int    SDICSTA;
    volatile unsigned int    SDIRSP0;
    volatile unsigned int    SDIRSP1;
    volatile unsigned int    SDIRSP2;
    volatile unsigned int    SDIRSP3;
    volatile unsigned int    SDIDTIMER;
    volatile unsigned int    SDIBSIZE;
    volatile unsigned int    SDIDCON;
    volatile unsigned int    SDIDCNT;
    volatile unsigned int    SDIDSTA;
    volatile unsigned int    SDIFSTA;
#ifdef __BIG_ENDIAN
    volatile unsigned char    res[3];
    volatile unsigned char    SDIDAT;
#else
    volatile unsigned char    SDIDAT;
    volatile unsigned char    res[3];
#endif
    volatile unsigned int    SDIIMSK;
};
 
 
 
/* S3C2440 only supports 512 Byte HW ECC */
#define S3C2440_ECCSIZE        512
#define S3C2440_ECCBYTES    3
 
enum s3c2440_uarts_nr {
    S3C2440_UART0 = 0,
    S3C2440_UART1 = 1,
    S3C2440_UART2 = 2
};
 
/* S3C2440 device base addresses */
#define S3C2440_MEMCTL_BASE            0x48000000
#define S3C2440_USB_HOST_BASE        0x49000000
#define S3C2440_INTERRUPT_BASE        0x4A000000
#define S3C2440_DMA_BASE            0x4B000000
#define S3C2440_CLOCK_POWER_BASE    0x4C000000
#define S3C2440_LCD_BASE            0x4D000000
#define S3C2440_NAND_BASE            0x4E000000
#define S3C2440_UART_BASE            0x50000000
#define S3C2440_TIMER_BASE            0x51000000
#define S3C2440_USB_DEVICE_BASE        0x52000140
#define S3C2440_WATCHDOG_BASE        0x53000000
#define S3C2440_I2C_BASE            0x54000000
#define S3C2440_I2S_BASE            0x55000000
#define S3C2440_GPIO_BASE            0x56000000
#define S3C2440_RTC_BASE            0x57000000
#define S3C2440_ADC_BASE            0x58000000
#define S3C2440_SPI_BASE            0x59000000
#define S3C2440_SDI_BASE            0x5A000000
 
 
static inline struct s3c2440_memctl *s3c2440_get_base_memctl(void)
{
    return (struct s3c2440_memctl *)S3C2440_MEMCTL_BASE;
}
 
static inline struct s3c2440_usb_host *s3c2440_get_base_usb_host(void)
{
    return (struct s3c2440_usb_host *)S3C2440_USB_HOST_BASE;
}
 
static inline struct s3c2440_interrupt *s3c2440_get_base_interrupt(void)
{
    return (struct s3c2440_interrupt *)S3C2440_INTERRUPT_BASE;
}
 
static inline struct s3c2440_dmas *s3c2440_get_base_dmas(void)
{
    return (struct s3c2440_dmas *)S3C2440_DMA_BASE;
}
 
static inline struct s3c2440_clock_power *s3c2440_get_base_clock_power(void)
{
    return (struct s3c2440_clock_power *)S3C2440_CLOCK_POWER_BASE;
}
 
static inline struct s3c2440_lcd *s3c2440_get_base_lcd(void)
{
    return (struct s3c2440_lcd *)S3C2440_LCD_BASE;
}
 
static inline struct s3c2440_nand *s3c2440_get_base_nand(void)
{
    return (struct s3c2440_nand *)S3C2440_NAND_BASE;
}
 
static inline struct s3c2440_uart *s3c2440_get_base_uart(enum s3c2440_uarts_nr n)
{
    return (struct s3c2440_uart *)(S3C2440_UART_BASE + (n * 0x4000));
}
 
static inline struct s3c2440_timers *s3c2440_get_base_timers(void)
{
    return (struct s3c2440_timers *)S3C2440_TIMER_BASE;
}
 
static inline struct s3c2440_usb_device *s3c2440_get_base_usb_device(void)
{
    return (struct s3c2440_usb_device *)S3C2440_USB_DEVICE_BASE;
}
 
static inline struct s3c2440_watchdog *s3c2440_get_base_watchdog(void)
{
    return (struct s3c2440_watchdog *)S3C2440_WATCHDOG_BASE;
}
 
static inline struct s3c2440_i2c *s3c2440_get_base_i2c(void)
{
    return (struct s3c2440_i2c *)S3C2440_I2C_BASE;
}
 
static inline struct s3c2440_i2s *s3c2440_get_base_i2s(void)
{
    return (struct s3c2440_i2s *)S3C2440_I2S_BASE;
}
 
static inline struct s3c2440_gpio *s3c2440_get_base_gpio(void)
{
    return (struct s3c2440_gpio *)S3C2440_GPIO_BASE;
}
 
static inline struct s3c2440_rtc *s3c2440_get_base_rtc(void)
{
    return (struct s3c2440_rtc *)S3C2440_RTC_BASE;
}
 
static inline struct s3c2440_adc *s3c2440_get_base_adc(void)
{
    return (struct s3c2440_adc *)S3C2440_ADC_BASE;
}
 
static inline struct s3c2440_spi *s3c2440_get_base_spi(void)
{
    return (struct s3c2440_spi *)S3C2440_SPI_BASE;
}
 
static inline struct s3c2440_sdi *s3c2440_get_base_sdi(void)
{
    return (struct s3c2440_sdi *)S3C2440_SDI_BASE;
}
 
#endif /*__S3C2440_H__*/