s3c24x0.h 9.6 KB

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