s3c24x0.h 11 KB

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