s3c2400.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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 : s3c2400.h
  25. * Version : 31.3.2003
  26. *
  27. * Based on S3C2400X User's manual Rev 1.1
  28. ************************************************/
  29. #ifndef __S3C2400_H__
  30. #define __S3C2400_H__
  31. #define S3C24X0_UART_CHANNELS 2
  32. #define S3C24X0_SPI_CHANNELS 1
  33. #define PALETTE (0x14A00400) /* SJS */
  34. typedef enum {
  35. S3C24X0_UART0,
  36. S3C24X0_UART1,
  37. } S3C24X0_UARTS_NR;
  38. /* S3C2400 device base addresses */
  39. #define S3C24X0_MEMCTL_BASE 0x14000000
  40. #define S3C24X0_USB_HOST_BASE 0x14200000
  41. #define S3C24X0_INTERRUPT_BASE 0x14400000
  42. #define S3C24X0_DMA_BASE 0x14600000
  43. #define S3C24X0_CLOCK_POWER_BASE 0x14800000
  44. #define S3C24X0_LCD_BASE 0x14A00000
  45. #define S3C24X0_UART_BASE 0x15000000
  46. #define S3C24X0_TIMER_BASE 0x15100000
  47. #define S3C24X0_USB_DEVICE_BASE 0x15200140
  48. #define S3C24X0_WATCHDOG_BASE 0x15300000
  49. #define S3C24X0_I2C_BASE 0x15400000
  50. #define S3C24X0_I2S_BASE 0x15508000
  51. #define S3C24X0_GPIO_BASE 0x15600000
  52. #define S3C24X0_RTC_BASE 0x15700000
  53. #define S3C24X0_ADC_BASE 0x15800000
  54. #define S3C24X0_SPI_BASE 0x15900000
  55. #define S3C2400_MMC_BASE 0x15A00000
  56. /* include common stuff */
  57. #include <s3c24x0.h>
  58. static inline S3C24X0_MEMCTL * S3C24X0_GetBase_MEMCTL(void)
  59. {
  60. return (S3C24X0_MEMCTL * const)S3C24X0_MEMCTL_BASE;
  61. }
  62. static inline S3C24X0_USB_HOST * S3C24X0_GetBase_USB_HOST(void)
  63. {
  64. return (S3C24X0_USB_HOST * const)S3C24X0_USB_HOST_BASE;
  65. }
  66. static inline S3C24X0_INTERRUPT * S3C24X0_GetBase_INTERRUPT(void)
  67. {
  68. return (S3C24X0_INTERRUPT * const)S3C24X0_INTERRUPT_BASE;
  69. }
  70. static inline S3C24X0_DMAS * S3C24X0_GetBase_DMAS(void)
  71. {
  72. return (S3C24X0_DMAS * const)S3C24X0_DMA_BASE;
  73. }
  74. static inline S3C24X0_CLOCK_POWER * S3C24X0_GetBase_CLOCK_POWER(void)
  75. {
  76. return (S3C24X0_CLOCK_POWER * const)S3C24X0_CLOCK_POWER_BASE;
  77. }
  78. static inline S3C24X0_LCD * S3C24X0_GetBase_LCD(void)
  79. {
  80. return (S3C24X0_LCD * const)S3C24X0_LCD_BASE;
  81. }
  82. static inline S3C24X0_UART * S3C24X0_GetBase_UART(S3C24X0_UARTS_NR nr)
  83. {
  84. return (S3C24X0_UART * const)(S3C24X0_UART_BASE + (nr * 0x4000));
  85. }
  86. static inline S3C24X0_TIMERS * S3C24X0_GetBase_TIMERS(void)
  87. {
  88. return (S3C24X0_TIMERS * const)S3C24X0_TIMER_BASE;
  89. }
  90. static inline S3C24X0_USB_DEVICE * S3C24X0_GetBase_USB_DEVICE(void)
  91. {
  92. return (S3C24X0_USB_DEVICE * const)S3C24X0_USB_DEVICE_BASE;
  93. }
  94. static inline S3C24X0_WATCHDOG * S3C24X0_GetBase_WATCHDOG(void)
  95. {
  96. return (S3C24X0_WATCHDOG * const)S3C24X0_WATCHDOG_BASE;
  97. }
  98. static inline S3C24X0_I2C * S3C24X0_GetBase_I2C(void)
  99. {
  100. return (S3C24X0_I2C * const)S3C24X0_I2C_BASE;
  101. }
  102. static inline S3C24X0_I2S * S3C24X0_GetBase_I2S(void)
  103. {
  104. return (S3C24X0_I2S * const)S3C24X0_I2S_BASE;
  105. }
  106. static inline S3C24X0_GPIO * S3C24X0_GetBase_GPIO(void)
  107. {
  108. return (S3C24X0_GPIO * const)S3C24X0_GPIO_BASE;
  109. }
  110. static inline S3C24X0_RTC * S3C24X0_GetBase_RTC(void)
  111. {
  112. return (S3C24X0_RTC * const)S3C24X0_RTC_BASE;
  113. }
  114. static inline S3C2400_ADC * S3C2400_GetBase_ADC(void)
  115. {
  116. return (S3C2400_ADC * const)S3C24X0_ADC_BASE;
  117. }
  118. static inline S3C24X0_SPI * S3C24X0_GetBase_SPI(void)
  119. {
  120. return (S3C24X0_SPI * const)S3C24X0_SPI_BASE;
  121. }
  122. static inline S3C2400_MMC * S3C2400_GetBase_MMC(void)
  123. {
  124. return (S3C2400_MMC * const)S3C2400_MMC_BASE;
  125. }
  126. #if 0
  127. /* Memory control */
  128. #define rBWSCON (*(volatile unsigned *)0x14000000)
  129. #define rBANKCON0 (*(volatile unsigned *)0x14000004)
  130. #define rBANKCON1 (*(volatile unsigned *)0x14000008)
  131. #define rBANKCON2 (*(volatile unsigned *)0x1400000C)
  132. #define rBANKCON3 (*(volatile unsigned *)0x14000010)
  133. #define rBANKCON4 (*(volatile unsigned *)0x14000014)
  134. #define rBANKCON5 (*(volatile unsigned *)0x14000018)
  135. #define rBANKCON6 (*(volatile unsigned *)0x1400001C)
  136. #define rBANKCON7 (*(volatile unsigned *)0x14000020)
  137. #define rREFRESH (*(volatile unsigned *)0x14000024)
  138. #define rBANKSIZE (*(volatile unsigned *)0x14000028)
  139. #define rMRSRB6 (*(volatile unsigned *)0x1400002C)
  140. #define rMRSRB7 (*(volatile unsigned *)0x14000030)
  141. /* INTERRUPT */
  142. #define rSRCPND (*(volatile unsigned *)0x14400000)
  143. #define rINTMOD (*(volatile unsigned *)0x14400004)
  144. #define rINTMSK (*(volatile unsigned *)0x14400008)
  145. #define rPRIORITY (*(volatile unsigned *)0x1440000C)
  146. #define rINTPND (*(volatile unsigned *)0x14400010)
  147. #define rINTOFFSET (*(volatile unsigned *)0x14400014)
  148. /* DMA */
  149. #define rDISRC0 (*(volatile unsigned *)0x14600000)
  150. #define rDIDST0 (*(volatile unsigned *)0x14600004)
  151. #define rDCON0 (*(volatile unsigned *)0x14600008)
  152. #define rDSTAT0 (*(volatile unsigned *)0x1460000C)
  153. #define rDCSRC0 (*(volatile unsigned *)0x14600010)
  154. #define rDCDST0 (*(volatile unsigned *)0x14600014)
  155. #define rDMASKTRIG0 (*(volatile unsigned *)0x14600018)
  156. #define rDISRC1 (*(volatile unsigned *)0x14600020)
  157. #define rDIDST1 (*(volatile unsigned *)0x14600024)
  158. #define rDCON1 (*(volatile unsigned *)0x14600028)
  159. #define rDSTAT1 (*(volatile unsigned *)0x1460002C)
  160. #define rDCSRC1 (*(volatile unsigned *)0x14600030)
  161. #define rDCDST1 (*(volatile unsigned *)0x14600034)
  162. #define rDMASKTRIG1 (*(volatile unsigned *)0x14600038)
  163. #define rDISRC2 (*(volatile unsigned *)0x14600040)
  164. #define rDIDST2 (*(volatile unsigned *)0x14600044)
  165. #define rDCON2 (*(volatile unsigned *)0x14600048)
  166. #define rDSTAT2 (*(volatile unsigned *)0x1460004C)
  167. #define rDCSRC2 (*(volatile unsigned *)0x14600050)
  168. #define rDCDST2 (*(volatile unsigned *)0x14600054)
  169. #define rDMASKTRIG2 (*(volatile unsigned *)0x14600058)
  170. #define rDISRC3 (*(volatile unsigned *)0x14600060)
  171. #define rDIDST3 (*(volatile unsigned *)0x14600064)
  172. #define rDCON3 (*(volatile unsigned *)0x14600068)
  173. #define rDSTAT3 (*(volatile unsigned *)0x1460006C)
  174. #define rDCSRC3 (*(volatile unsigned *)0x14600070)
  175. #define rDCDST3 (*(volatile unsigned *)0x14600074)
  176. #define rDMASKTRIG3 (*(volatile unsigned *)0x14600078)
  177. /* CLOCK & POWER MANAGEMENT */
  178. #define rLOCKTIME (*(volatile unsigned *)0x14800000)
  179. #define rMPLLCON (*(volatile unsigned *)0x14800004)
  180. #define rUPLLCON (*(volatile unsigned *)0x14800008)
  181. #define rCLKCON (*(volatile unsigned *)0x1480000C)
  182. #define rCLKSLOW (*(volatile unsigned *)0x14800010)
  183. #define rCLKDIVN (*(volatile unsigned *)0x14800014)
  184. /* LCD CONTROLLER */
  185. #define rLCDCON1 (*(volatile unsigned *)0x14A00000)
  186. #define rLCDCON2 (*(volatile unsigned *)0x14A00004)
  187. #define rLCDCON3 (*(volatile unsigned *)0x14A00008)
  188. #define rLCDCON4 (*(volatile unsigned *)0x14A0000C)
  189. #define rLCDCON5 (*(volatile unsigned *)0x14A00010)
  190. #define rLCDSADDR1 (*(volatile unsigned *)0x14A00014)
  191. #define rLCDSADDR2 (*(volatile unsigned *)0x14A00018)
  192. #define rLCDSADDR3 (*(volatile unsigned *)0x14A0001C)
  193. #define rREDLUT (*(volatile unsigned *)0x14A00020)
  194. #define rGREENLUT (*(volatile unsigned *)0x14A00024)
  195. #define rBLUELUT (*(volatile unsigned *)0x14A00028)
  196. #define rDP1_2 (*(volatile unsigned *)0x14A0002C)
  197. #define rDP4_7 (*(volatile unsigned *)0x14A00030)
  198. #define rDP3_5 (*(volatile unsigned *)0x14A00034)
  199. #define rDP2_3 (*(volatile unsigned *)0x14A00038)
  200. #define rDP5_7 (*(volatile unsigned *)0x14A0003c)
  201. #define rDP3_4 (*(volatile unsigned *)0x14A00040)
  202. #define rDP4_5 (*(volatile unsigned *)0x14A00044)
  203. #define rDP6_7 (*(volatile unsigned *)0x14A00048)
  204. #define rDITHMODE (*(volatile unsigned *)0x14A0004C)
  205. #define rTPAL (*(volatile unsigned *)0x14A00050)
  206. #define PALETTE (0x14A00400) /* SJS */
  207. /* UART */
  208. #define rULCON0 (*(volatile unsigned char *)0x15000000)
  209. #define rUCON0 (*(volatile unsigned short *)0x15000004)
  210. #define rUFCON0 (*(volatile unsigned char *)0x15000008)
  211. #define rUMCON0 (*(volatile unsigned char *)0x1500000C)
  212. #define rUTRSTAT0 (*(volatile unsigned char *)0x15000010)
  213. #define rUERSTAT0 (*(volatile unsigned char *)0x15000014)
  214. #define rUFSTAT0 (*(volatile unsigned short *)0x15000018)
  215. #define rUMSTAT0 (*(volatile unsigned char *)0x1500001C)
  216. #define rUBRDIV0 (*(volatile unsigned short *)0x15000028)
  217. #define rULCON1 (*(volatile unsigned char *)0x15004000)
  218. #define rUCON1 (*(volatile unsigned short *)0x15004004)
  219. #define rUFCON1 (*(volatile unsigned char *)0x15004008)
  220. #define rUMCON1 (*(volatile unsigned char *)0x1500400C)
  221. #define rUTRSTAT1 (*(volatile unsigned char *)0x15004010)
  222. #define rUERSTAT1 (*(volatile unsigned char *)0x15004014)
  223. #define rUFSTAT1 (*(volatile unsigned short *)0x15004018)
  224. #define rUMSTAT1 (*(volatile unsigned char *)0x1500401C)
  225. #define rUBRDIV1 (*(volatile unsigned short *)0x15004028)
  226. #ifdef __BIG_ENDIAN
  227. #define rUTXH0 (*(volatile unsigned char *)0x15000023)
  228. #define rURXH0 (*(volatile unsigned char *)0x15000027)
  229. #define rUTXH1 (*(volatile unsigned char *)0x15004023)
  230. #define rURXH1 (*(volatile unsigned char *)0x15004027)
  231. #define WrUTXH0(ch) (*(volatile unsigned char *)0x15000023)=(unsigned char)(ch)
  232. #define RdURXH0() (*(volatile unsigned char *)0x15000027)
  233. #define WrUTXH1(ch) (*(volatile unsigned char *)0x15004023)=(unsigned char)(ch)
  234. #define RdURXH1() (*(volatile unsigned char *)0x15004027)
  235. #define UTXH0 (0x15000020+3) /* byte_access address by DMA */
  236. #define URXH0 (0x15000024+3)
  237. #define UTXH1 (0x15004020+3)
  238. #define URXH1 (0x15004024+3)
  239. #else /* Little Endian */
  240. #define rUTXH0 (*(volatile unsigned char *)0x15000020)
  241. #define rURXH0 (*(volatile unsigned char *)0x15000024)
  242. #define rUTXH1 (*(volatile unsigned char *)0x15004020)
  243. #define rURXH1 (*(volatile unsigned char *)0x15004024)
  244. #define WrUTXH0(ch) (*(volatile unsigned char *)0x15000020)=(unsigned char)(ch)
  245. #define RdURXH0() (*(volatile unsigned char *)0x15000024)
  246. #define WrUTXH1(ch) (*(volatile unsigned char *)0x15004020)=(unsigned char)(ch)
  247. #define RdURXH1() (*(volatile unsigned char *)0x15004024)
  248. #define UTXH0 (0x15000020) /* byte_access address by DMA */
  249. #define URXH0 (0x15000024)
  250. #define UTXH1 (0x15004020)
  251. #define URXH1 (0x15004024)
  252. #endif
  253. /* PWM TIMER */
  254. #define rTCFG0 (*(volatile unsigned *)0x15100000)
  255. #define rTCFG1 (*(volatile unsigned *)0x15100004)
  256. #define rTCON (*(volatile unsigned *)0x15100008)
  257. #define rTCNTB0 (*(volatile unsigned *)0x1510000C)
  258. #define rTCMPB0 (*(volatile unsigned *)0x15100010)
  259. #define rTCNTO0 (*(volatile unsigned *)0x15100014)
  260. #define rTCNTB1 (*(volatile unsigned *)0x15100018)
  261. #define rTCMPB1 (*(volatile unsigned *)0x1510001C)
  262. #define rTCNTO1 (*(volatile unsigned *)0x15100020)
  263. #define rTCNTB2 (*(volatile unsigned *)0x15100024)
  264. #define rTCMPB2 (*(volatile unsigned *)0x15100028)
  265. #define rTCNTO2 (*(volatile unsigned *)0x1510002C)
  266. #define rTCNTB3 (*(volatile unsigned *)0x15100030)
  267. #define rTCMPB3 (*(volatile unsigned *)0x15100034)
  268. #define rTCNTO3 (*(volatile unsigned *)0x15100038)
  269. #define rTCNTB4 (*(volatile unsigned *)0x1510003C)
  270. #define rTCNTO4 (*(volatile unsigned *)0x15100040)
  271. /* USB DEVICE */
  272. #define rFUNC_ADDR_REG (*(volatile unsigned *)0x15200140)
  273. #define rPWR_REG (*(volatile unsigned *)0x15200144)
  274. #define rINT_REG (*(volatile unsigned *)0x15200148)
  275. #define rINT_MASK_REG (*(volatile unsigned *)0x1520014C)
  276. #define rFRAME_NUM_REG (*(volatile unsigned *)0x15200150)
  277. #define rRESUME_CON_REG (*(volatile unsigned *)0x15200154)
  278. #define rEP0_CSR (*(volatile unsigned *)0x15200160)
  279. #define rEP0_MAXP (*(volatile unsigned *)0x15200164)
  280. #define rEP0_OUT_CNT (*(volatile unsigned *)0x15200168)
  281. #define rEP0_FIFO (*(volatile unsigned *)0x1520016C)
  282. #define rEP1_IN_CSR (*(volatile unsigned *)0x15200180)
  283. #define rEP1_IN_MAXP (*(volatile unsigned *)0x15200184)
  284. #define rEP1_FIFO (*(volatile unsigned *)0x15200188)
  285. #define rEP2_IN_CSR (*(volatile unsigned *)0x15200190)
  286. #define rEP2_IN_MAXP (*(volatile unsigned *)0x15200194)
  287. #define rEP2_FIFO (*(volatile unsigned *)0x15200198)
  288. #define rEP3_OUT_CSR (*(volatile unsigned *)0x152001A0)
  289. #define rEP3_OUT_MAXP (*(volatile unsigned *)0x152001A4)
  290. #define rEP3_OUT_CNT (*(volatile unsigned *)0x152001A8)
  291. #define rEP3_FIFO (*(volatile unsigned *)0x152001AC)
  292. #define rEP4_OUT_CSR (*(volatile unsigned *)0x152001B0)
  293. #define rEP4_OUT_MAXP (*(volatile unsigned *)0x152001B4)
  294. #define rEP4_OUT_CNT (*(volatile unsigned *)0x152001B8)
  295. #define rEP4_FIFO (*(volatile unsigned *)0x152001BC)
  296. #define rDMA_CON (*(volatile unsigned *)0x152001C0)
  297. #define rDMA_UNIT (*(volatile unsigned *)0x152001C4)
  298. #define rDMA_FIFO (*(volatile unsigned *)0x152001C8)
  299. #define rDMA_TX (*(volatile unsigned *)0x152001CC)
  300. #define rTEST_MODE (*(volatile unsigned *)0x152001F4)
  301. #define rIN_CON_REG (*(volatile unsigned *)0x152001F8)
  302. /* WATCH DOG TIMER */
  303. #define rWTCON (*(volatile unsigned *)0x15300000)
  304. #define rWTDAT (*(volatile unsigned *)0x15300004)
  305. #define rWTCNT (*(volatile unsigned *)0x15300008)
  306. /* IIC */
  307. #define rIICCON (*(volatile unsigned *)0x15400000)
  308. #define rIICSTAT (*(volatile unsigned *)0x15400004)
  309. #define rIICADD (*(volatile unsigned *)0x15400008)
  310. #define rIICDS (*(volatile unsigned *)0x1540000C)
  311. /* IIS */
  312. #define rIISCON (*(volatile unsigned *)0x15508000)
  313. #define rIISMOD (*(volatile unsigned *)0x15508004)
  314. #define rIISPSR (*(volatile unsigned *)0x15508008)
  315. #define rIISFIFCON (*(volatile unsigned *)0x1550800C)
  316. #ifdef __BIG_ENDIAN
  317. #define IISFIF ((volatile unsigned short *)0x15508012)
  318. #else /* Little Endian */
  319. #define IISFIF ((volatile unsigned short *)0x15508010)
  320. #endif
  321. /* I/O PORT */
  322. #define rPACON (*(volatile unsigned *)0x15600000)
  323. #define rPADAT (*(volatile unsigned *)0x15600004)
  324. #define rPBCON (*(volatile unsigned *)0x15600008)
  325. #define rPBDAT (*(volatile unsigned *)0x1560000C)
  326. #define rPBUP (*(volatile unsigned *)0x15600010)
  327. #define rPCCON (*(volatile unsigned *)0x15600014)
  328. #define rPCDAT (*(volatile unsigned *)0x15600018)
  329. #define rPCUP (*(volatile unsigned *)0x1560001C)
  330. #define rPDCON (*(volatile unsigned *)0x15600020)
  331. #define rPDDAT (*(volatile unsigned *)0x15600024)
  332. #define rPDUP (*(volatile unsigned *)0x15600028)
  333. #define rPECON (*(volatile unsigned *)0x1560002C)
  334. #define rPEDAT (*(volatile unsigned *)0x15600030)
  335. #define rPEUP (*(volatile unsigned *)0x15600034)
  336. #define rPFCON (*(volatile unsigned *)0x15600038)
  337. #define rPFDAT (*(volatile unsigned *)0x1560003C)
  338. #define rPFUP (*(volatile unsigned *)0x15600040)
  339. #define rPGCON (*(volatile unsigned *)0x15600044)
  340. #define rPGDAT (*(volatile unsigned *)0x15600048)
  341. #define rPGUP (*(volatile unsigned *)0x1560004C)
  342. #define rOPENCR (*(volatile unsigned *)0x15600050)
  343. #define rMISCCR (*(volatile unsigned *)0x15600054)
  344. #define rEXTINT (*(volatile unsigned *)0x15600058)
  345. /* RTC */
  346. #ifdef __BIG_ENDIAN
  347. #define rRTCCON (*(volatile unsigned char *)0x15700043)
  348. #define rRTCALM (*(volatile unsigned char *)0x15700053)
  349. #define rALMSEC (*(volatile unsigned char *)0x15700057)
  350. #define rALMMIN (*(volatile unsigned char *)0x1570005B)
  351. #define rALMHOUR (*(volatile unsigned char *)0x1570005F)
  352. #define rALMDAY (*(volatile unsigned char *)0x15700063)
  353. #define rALMMON (*(volatile unsigned char *)0x15700067)
  354. #define rALMYEAR (*(volatile unsigned char *)0x1570006B)
  355. #define rRTCRST (*(volatile unsigned char *)0x1570006F)
  356. #define rBCDSEC (*(volatile unsigned char *)0x15700073)
  357. #define rBCDMIN (*(volatile unsigned char *)0x15700077)
  358. #define rBCDHOUR (*(volatile unsigned char *)0x1570007B)
  359. #define rBCDDAY (*(volatile unsigned char *)0x1570007F)
  360. #define rBCDDATE (*(volatile unsigned char *)0x15700083)
  361. #define rBCDMON (*(volatile unsigned char *)0x15700087)
  362. #define rBCDYEAR (*(volatile unsigned char *)0x1570008B)
  363. #define rTICINT (*(volatile unsigned char *)0x15700047)
  364. #else /* Little Endian */
  365. #define rRTCCON (*(volatile unsigned char *)0x15700040)
  366. #define rRTCALM (*(volatile unsigned char *)0x15700050)
  367. #define rALMSEC (*(volatile unsigned char *)0x15700054)
  368. #define rALMMIN (*(volatile unsigned char *)0x15700058)
  369. #define rALMHOUR (*(volatile unsigned char *)0x1570005C)
  370. #define rALMDAY (*(volatile unsigned char *)0x15700060)
  371. #define rALMMON (*(volatile unsigned char *)0x15700064)
  372. #define rALMYEAR (*(volatile unsigned char *)0x15700068)
  373. #define rRTCRST (*(volatile unsigned char *)0x1570006C)
  374. #define rBCDSEC (*(volatile unsigned char *)0x15700070)
  375. #define rBCDMIN (*(volatile unsigned char *)0x15700074)
  376. #define rBCDHOUR (*(volatile unsigned char *)0x15700078)
  377. #define rBCDDAY (*(volatile unsigned char *)0x1570007C)
  378. #define rBCDDATE (*(volatile unsigned char *)0x15700080)
  379. #define rBCDMON (*(volatile unsigned char *)0x15700084)
  380. #define rBCDYEAR (*(volatile unsigned char *)0x15700088)
  381. #define rTICINT (*(volatile unsigned char *)0x15700044)
  382. #endif
  383. /* ADC */
  384. #define rADCCON (*(volatile unsigned *)0x15800000)
  385. #define rADCDAT (*(volatile unsigned *)0x15800004)
  386. /* SPI */
  387. #define rSPCON (*(volatile unsigned *)0x15900000)
  388. #define rSPSTA (*(volatile unsigned *)0x15900004)
  389. #define rSPPIN (*(volatile unsigned *)0x15900008)
  390. #define rSPPRE (*(volatile unsigned *)0x1590000C)
  391. #define rSPTDAT (*(volatile unsigned *)0x15900010)
  392. #define rSPRDAT (*(volatile unsigned *)0x15900014)
  393. /* MMC INTERFACE */
  394. #define rMMCON (*(volatile unsigned *)0x15a00000)
  395. #define rMMCRR (*(volatile unsigned *)0x15a00004)
  396. #define rMMFCON (*(volatile unsigned *)0x15a00008)
  397. #define rMMSTA (*(volatile unsigned *)0x15a0000C)
  398. #define rMMFSTA (*(volatile unsigned *)0x15a00010)
  399. #define rMMPRE (*(volatile unsigned *)0x15a00014)
  400. #define rMMLEN (*(volatile unsigned *)0x15a00018)
  401. #define rMMCR7 (*(volatile unsigned *)0x15a0001C)
  402. #define rMMRSP0 (*(volatile unsigned *)0x15a00020)
  403. #define rMMRSP1 (*(volatile unsigned *)0x15a00024)
  404. #define rMMRSP2 (*(volatile unsigned *)0x15a00028)
  405. #define rMMRSP3 (*(volatile unsigned *)0x15a0002C)
  406. #define rMMCMD0 (*(volatile unsigned *)0x15a00030)
  407. #define rMMCMD1 (*(volatile unsigned *)0x15a00034)
  408. #define rMMCR16 (*(volatile unsigned *)0x15a00038)
  409. #define rMMDAT (*(volatile unsigned *)0x15a0003C)
  410. /* ISR */
  411. #define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
  412. #define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
  413. #define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
  414. #define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xC))
  415. #define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
  416. #define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
  417. #define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
  418. #define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1C))
  419. #define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x20))
  420. #define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x24))
  421. #define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
  422. #define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x2C))
  423. #define pISR_EINT4 (*(unsigned *)(_ISR_STARTADDRESS+0x30))
  424. #define pISR_EINT5 (*(unsigned *)(_ISR_STARTADDRESS+0x34))
  425. #define pISR_EINT6 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
  426. #define pISR_EINT7 (*(unsigned *)(_ISR_STARTADDRESS+0x3C))
  427. #define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x40))
  428. #define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x44))
  429. #define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
  430. #define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x4C))
  431. #define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
  432. #define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
  433. #define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
  434. #define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x5C))
  435. #define pISR_NOTUSED (*(unsigned *)(_ISR_STARTADDRESS+0x60))
  436. #define pISR_DMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
  437. #define pISR_DMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
  438. #define pISR_DMA2 (*(unsigned *)(_ISR_STARTADDRESS+0x6C))
  439. #define pISR_DMA3 (*(unsigned *)(_ISR_STARTADDRESS+0x70))
  440. #define pISR_MMC (*(unsigned *)(_ISR_STARTADDRESS+0x74))
  441. #define pISR_SPI (*(unsigned *)(_ISR_STARTADDRESS+0x78))
  442. #define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x7C))
  443. #define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
  444. #define pISR_USBD (*(unsigned *)(_ISR_STARTADDRESS+0x84))
  445. #define pISR_USBH (*(unsigned *)(_ISR_STARTADDRESS+0x88))
  446. #define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x8C))
  447. #define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x90))
  448. #define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x94))
  449. #define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x98))
  450. #define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0xA0))
  451. /* PENDING BIT */
  452. #define BIT_EINT0 (0x1)
  453. #define BIT_EINT1 (0x1<<1)
  454. #define BIT_EINT2 (0x1<<2)
  455. #define BIT_EINT3 (0x1<<3)
  456. #define BIT_EINT4 (0x1<<4)
  457. #define BIT_EINT5 (0x1<<5)
  458. #define BIT_EINT6 (0x1<<6)
  459. #define BIT_EINT7 (0x1<<7)
  460. #define BIT_TICK (0x1<<8)
  461. #define BIT_WDT (0x1<<9)
  462. #define BIT_TIMER0 (0x1<<10)
  463. #define BIT_TIMER1 (0x1<<11)
  464. #define BIT_TIMER2 (0x1<<12)
  465. #define BIT_TIMER3 (0x1<<13)
  466. #define BIT_TIMER4 (0x1<<14)
  467. #define BIT_UERR01 (0x1<<15)
  468. #define BIT_NOTUSED (0x1<<16)
  469. #define BIT_DMA0 (0x1<<17)
  470. #define BIT_DMA1 (0x1<<18)
  471. #define BIT_DMA2 (0x1<<19)
  472. #define BIT_DMA3 (0x1<<20)
  473. #define BIT_MMC (0x1<<21)
  474. #define BIT_SPI (0x1<<22)
  475. #define BIT_URXD0 (0x1<<23)
  476. #define BIT_URXD1 (0x1<<24)
  477. #define BIT_USBD (0x1<<25)
  478. #define BIT_USBH (0x1<<26)
  479. #define BIT_IIC (0x1<<27)
  480. #define BIT_UTXD0 (0x1<<28)
  481. #define BIT_UTXD1 (0x1<<29)
  482. #define BIT_RTC (0x1<<30)
  483. #define BIT_ADC (0x1<<31)
  484. #define BIT_ALLMSK (0xFFFFFFFF)
  485. #define ClearPending(bit) {\
  486. rSRCPND = bit;\
  487. rINTPND = bit;\
  488. rINTPND;\
  489. }
  490. /* Wait until rINTPND is changed for the case that the ISR is very short. */
  491. #endif
  492. #endif /*__S3C2400_H__*/