s3c2410.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /************************************************
  2. * NAME : s3c2410.h
  3. * Version : 3.7.2002
  4. *
  5. * Based on S3C2410X User's manual Rev 0.1
  6. ************************************************/
  7. #ifndef __S3C2410_H__
  8. #define __S3C2410_H__
  9. /* Memory control */
  10. #define rBWSCON (*(volatile unsigned *)0x48000000)
  11. #define rBANKCON0 (*(volatile unsigned *)0x48000004)
  12. #define rBANKCON1 (*(volatile unsigned *)0x48000008)
  13. #define rBANKCON2 (*(volatile unsigned *)0x4800000C)
  14. #define rBANKCON3 (*(volatile unsigned *)0x48000010)
  15. #define rBANKCON4 (*(volatile unsigned *)0x48000014)
  16. #define rBANKCON5 (*(volatile unsigned *)0x48000018)
  17. #define rBANKCON6 (*(volatile unsigned *)0x4800001C)
  18. #define rBANKCON7 (*(volatile unsigned *)0x48000020)
  19. #define rREFRESH (*(volatile unsigned *)0x48000024)
  20. #define rBANKSIZE (*(volatile unsigned *)0x48000028)
  21. #define rMRSRB6 (*(volatile unsigned *)0x4800002C)
  22. #define rMRSRB7 (*(volatile unsigned *)0x48000030)
  23. /* USB HOST */
  24. #define rHcRevision (*(volatile unsigned *)0x49000000)
  25. #define rHcControl (*(volatile unsigned *)0x49000004)
  26. #define rHcCommonStatus (*(volatile unsigned *)0x49000008)
  27. #define rHcInterruptStatus (*(volatile unsigned *)0x4900000C)
  28. #define rHcInterruptEnable (*(volatile unsigned *)0x49000010)
  29. #define rHcInterruptDisable (*(volatile unsigned *)0x49000014)
  30. #define rHcHCCA (*(volatile unsigned *)0x49000018)
  31. #define rHcPeriodCuttendED (*(volatile unsigned *)0x4900001C)
  32. #define rHcControlHeadED (*(volatile unsigned *)0x49000020)
  33. #define rHcControlCurrentED (*(volatile unsigned *)0x49000024)
  34. #define rHcBulkHeadED (*(volatile unsigned *)0x49000028)
  35. #define rHcBuldCurrentED (*(volatile unsigned *)0x4900002C)
  36. #define rHcDoneHead (*(volatile unsigned *)0x49000030)
  37. #define rHcRmInterval (*(volatile unsigned *)0x49000034)
  38. #define rHcFmRemaining (*(volatile unsigned *)0x49000038)
  39. #define rHcFmNumber (*(volatile unsigned *)0x4900003C)
  40. #define rHcPeriodicStart (*(volatile unsigned *)0x49000040)
  41. #define rHcLSThreshold (*(volatile unsigned *)0x49000044)
  42. #define rHcRhDescriptorA (*(volatile unsigned *)0x49000048)
  43. #define rHcRhDescriptorB (*(volatile unsigned *)0x4900004C)
  44. #define rHcRhStatus (*(volatile unsigned *)0x49000050)
  45. #define rHcRhPortStatus1 (*(volatile unsigned *)0x49000054)
  46. #define rHcRhPortStatus2 (*(volatile unsigned *)0x49000058)
  47. /* INTERRUPT */
  48. #define rSRCPND (*(volatile unsigned *)0x4A000000)
  49. #define rINTMOD (*(volatile unsigned *)0x4A000004)
  50. #define rINTMSK (*(volatile unsigned *)0x4A000008)
  51. #define rPRIORITY (*(volatile unsigned *)0x4A00000C)
  52. #define rINTPND (*(volatile unsigned *)0x4A000010)
  53. #define rINTOFFSET (*(volatile unsigned *)0x4A000014)
  54. #define rSUBSRCPND (*(volatile unsigned *)0x4A000018)
  55. #define rINTSUBMSK (*(volatile unsigned *)0x4A00001C)
  56. /* DMA */
  57. #define rDISRC0 (*(volatile unsigned *)0x4B000000)
  58. #define rDISRCC0 (*(volatile unsigned *)0x4B000004)
  59. #define rDIDST0 (*(volatile unsigned *)0x4B000008)
  60. #define rDIDSTC0 (*(volatile unsigned *)0x4B00000C)
  61. #define rDCON0 (*(volatile unsigned *)0x4B000010)
  62. #define rDSTAT0 (*(volatile unsigned *)0x4B000014)
  63. #define rDCSRC0 (*(volatile unsigned *)0x4B000018)
  64. #define rDCDST0 (*(volatile unsigned *)0x4B00001C)
  65. #define rDMASKTRIG0 (*(volatile unsigned *)0x4B000020)
  66. #define rDISRC1 (*(volatile unsigned *)0x4B000040)
  67. #define rDISRCC1 (*(volatile unsigned *)0x4B000044)
  68. #define rDIDST1 (*(volatile unsigned *)0x4B000048)
  69. #define rDIDSTC1 (*(volatile unsigned *)0x4B00004C)
  70. #define rDCON1 (*(volatile unsigned *)0x4B000050)
  71. #define rDSTAT1 (*(volatile unsigned *)0x4B000054)
  72. #define rDCSRC1 (*(volatile unsigned *)0x4B000058)
  73. #define rDCDST1 (*(volatile unsigned *)0x4B00005C)
  74. #define rDMASKTRIG1 (*(volatile unsigned *)0x4B000060)
  75. #define rDISRC2 (*(volatile unsigned *)0x4B000080)
  76. #define rDISRCC2 (*(volatile unsigned *)0x4B000084)
  77. #define rDIDST2 (*(volatile unsigned *)0x4B000088)
  78. #define rDIDSTC2 (*(volatile unsigned *)0x4B00008C)
  79. #define rDCON2 (*(volatile unsigned *)0x4B000090)
  80. #define rDSTAT2 (*(volatile unsigned *)0x4B000094)
  81. #define rDCSRC2 (*(volatile unsigned *)0x4B000098)
  82. #define rDCDST2 (*(volatile unsigned *)0x4B00009C)
  83. #define rDMASKTRIG2 (*(volatile unsigned *)0x4B0000A0)
  84. #define rDISRC3 (*(volatile unsigned *)0x4B0000C0)
  85. #define rDISRCC3 (*(volatile unsigned *)0x4B0000C4)
  86. #define rDIDST3 (*(volatile unsigned *)0x4B0000C8)
  87. #define rDIDSTC3 (*(volatile unsigned *)0x4B0000CC)
  88. #define rDCON3 (*(volatile unsigned *)0x4B0000D0)
  89. #define rDSTAT3 (*(volatile unsigned *)0x4B0000D4)
  90. #define rDCSRC3 (*(volatile unsigned *)0x4B0000D8)
  91. #define rDCDST3 (*(volatile unsigned *)0x4B0000DC)
  92. #define rDMASKTRIG3 (*(volatile unsigned *)0x4B0000E0)
  93. /* CLOCK & POWER MANAGEMENT */
  94. #define rLOCKTIME (*(volatile unsigned *)0x4C000000)
  95. #define rMPLLCON (*(volatile unsigned *)0x4C000004)
  96. #define rUPLLCON (*(volatile unsigned *)0x4C000008)
  97. #define rCLKCON (*(volatile unsigned *)0x4C00000C)
  98. #define rCLKSLOW (*(volatile unsigned *)0x4C000010)
  99. #define rCLKDIVN (*(volatile unsigned *)0x4C000014)
  100. /* LCD CONTROLLER */
  101. #define rLCDCON1 (*(volatile unsigned *)0x4D000000)
  102. #define rLCDCON2 (*(volatile unsigned *)0x4D000004)
  103. #define rLCDCON3 (*(volatile unsigned *)0x4D000008)
  104. #define rLCDCON4 (*(volatile unsigned *)0x4D00000C)
  105. #define rLCDCON5 (*(volatile unsigned *)0x4D000010)
  106. #define rLCDSADDR1 (*(volatile unsigned *)0x4D000014)
  107. #define rLCDSADDR2 (*(volatile unsigned *)0x4D000018)
  108. #define rLCDSADDR3 (*(volatile unsigned *)0x4D00001C)
  109. #define rREDLUT (*(volatile unsigned *)0x4D000020)
  110. #define rGREENLUT (*(volatile unsigned *)0x4D000024)
  111. #define rBLUELUT (*(volatile unsigned *)0x4D000028)
  112. #define rDITHMODE (*(volatile unsigned *)0x4D00004C)
  113. #define rTPAL (*(volatile unsigned *)0x4D000050)
  114. #define rLCDINTPND (*(volatile unsigned *)0x4D000054)
  115. #define rLCDSRCPND (*(volatile unsigned *)0x4D000058)
  116. #define rLCDINTMSK (*(volatile unsigned *)0x4D00005C)
  117. /* NAND FLASH */
  118. #define rNFCONF (*(volatile unsigned *)0x4E000000)
  119. #define rNFCMD (*(volatile unsigned *)0x4E000004)
  120. #define rNFADDR (*(volatile unsigned *)0x4E000008)
  121. #define rNFDATA (*(volatile unsigned *)0x4E00000C)
  122. #define rNFSTAT (*(volatile unsigned *)0x4E000010)
  123. #define rNFECC (*(volatile unsigned *)0x4E000014)
  124. /* UART */
  125. #define rULCON0 (*(volatile unsigned *)0x50000000)
  126. #define rUCON0 (*(volatile unsigned *)0x50000004)
  127. #define rUFCON0 (*(volatile unsigned *)0x50000008)
  128. #define rUMCON0 (*(volatile unsigned *)0x5000000C)
  129. #define rUTRSTAT0 (*(volatile unsigned *)0x50000010)
  130. #define rUERSTAT0 (*(volatile unsigned *)0x50000014)
  131. #define rUFSTAT0 (*(volatile unsigned *)0x50000018)
  132. #define rUMSTAT0 (*(volatile unsigned *)0x5000001C)
  133. #define rUBRDIV0 (*(volatile unsigned *)0x50000028)
  134. #define rULCON1 (*(volatile unsigned *)0x50004000)
  135. #define rUCON1 (*(volatile unsigned *)0x50004004)
  136. #define rUFCON1 (*(volatile unsigned *)0x50004008)
  137. #define rUMCON1 (*(volatile unsigned *)0x5000400C)
  138. #define rUTRSTAT1 (*(volatile unsigned *)0x50004010)
  139. #define rUERSTAT1 (*(volatile unsigned *)0x50004014)
  140. #define rUFSTAT1 (*(volatile unsigned *)0x50004018)
  141. #define rUMSTAT1 (*(volatile unsigned *)0x5000401C)
  142. #define rUBRDIV1 (*(volatile unsigned *)0x50004028)
  143. #define rULCON2 (*(volatile unsigned *)0x50008000)
  144. #define rUCON2 (*(volatile unsigned *)0x50008004)
  145. #define rUFCON2 (*(volatile unsigned *)0x50008008)
  146. #define rUTRSTAT2 (*(volatile unsigned *)0x50008010)
  147. #define rUERSTAT2 (*(volatile unsigned *)0x50008014)
  148. #define rUFSTAT2 (*(volatile unsigned *)0x50008018)
  149. #define rUBRDIV2 (*(volatile unsigned *)0x50008028)
  150. #ifdef __BIG_ENDIAN
  151. #define rUTXH0 (*(volatile unsigned char *)0x50000023)
  152. #define rURXH0 (*(volatile unsigned char *)0x50000027)
  153. #define rUTXH1 (*(volatile unsigned char *)0x50004023)
  154. #define rURXH1 (*(volatile unsigned char *)0x50004027)
  155. #define rUTXH2 (*(volatile unsigned char *)0x50008023)
  156. #define rURXH2 (*(volatile unsigned char *)0x50008027)
  157. #define WrUTXH0(ch) (*(volatile unsigned char *)0x50000023)=(unsigned char)(ch)
  158. #define RdURXH0() (*(volatile unsigned char *)0x50000027)
  159. #define WrUTXH1(ch) (*(volatile unsigned char *)0x50004023)=(unsigned char)(ch)
  160. #define RdURXH1() (*(volatile unsigned char *)0x50004027)
  161. #define WrUTXH2(ch) (*(volatile unsigned char *)0x50008023)=(unsigned char)(ch)
  162. #define RdURXH2() (*(volatile unsigned char *)0x50008027)
  163. #define UTXH0 (0x50000020+3) /* byte_access address by DMA */
  164. #define URXH0 (0x50000024+3)
  165. #define UTXH1 (0x50004020+3)
  166. #define URXH1 (0x50004024+3)
  167. #define UTXH2 (0x50008020+3)
  168. #define URXH2 (0x50008024+3)
  169. #else /* Little Endian */
  170. #define rUTXH0 (*(volatile unsigned char *)0x50000020)
  171. #define rURXH0 (*(volatile unsigned char *)0x50000024)
  172. #define rUTXH1 (*(volatile unsigned char *)0x50004020)
  173. #define rURXH1 (*(volatile unsigned char *)0x50004024)
  174. #define rUTXH2 (*(volatile unsigned char *)0x50008020)
  175. #define rURXH2 (*(volatile unsigned char *)0x50008024)
  176. #define WrUTXH0(ch) (*(volatile unsigned char *)0x50000020)=(unsigned char)(ch)
  177. #define RdURXH0() (*(volatile unsigned char *)0x50000024)
  178. #define WrUTXH1(ch) (*(volatile unsigned char *)0x50004020)=(unsigned char)(ch)
  179. #define RdURXH1() (*(volatile unsigned char *)0x50004024)
  180. #define WrUTXH2(ch) (*(volatile unsigned char *)0x50008020)=(unsigned char)(ch)
  181. #define RdURXH2() (*(volatile unsigned char *)0x50008024)
  182. #define UTXH0 (0x50000020) /* byte_access address by DMA */
  183. #define URXH0 (0x50000024)
  184. #define UTXH1 (0x50004020)
  185. #define URXH1 (0x50004024)
  186. #define UTXH2 (0x50008020)
  187. #define URXH2 (0x50008024)
  188. #endif
  189. /* PWM TIMER */
  190. #define rTCFG0 (*(volatile unsigned *)0x51000000)
  191. #define rTCFG1 (*(volatile unsigned *)0x51000004)
  192. #define rTCON (*(volatile unsigned *)0x51000008)
  193. #define rTCNTB0 (*(volatile unsigned *)0x5100000C)
  194. #define rTCMPB0 (*(volatile unsigned *)0x51000010)
  195. #define rTCNTO0 (*(volatile unsigned *)0x51000014)
  196. #define rTCNTB1 (*(volatile unsigned *)0x51000018)
  197. #define rTCMPB1 (*(volatile unsigned *)0x5100001C)
  198. #define rTCNTO1 (*(volatile unsigned *)0x51000020)
  199. #define rTCNTB2 (*(volatile unsigned *)0x51000024)
  200. #define rTCMPB2 (*(volatile unsigned *)0x51000028)
  201. #define rTCNTO2 (*(volatile unsigned *)0x5100002C)
  202. #define rTCNTB3 (*(volatile unsigned *)0x51000030)
  203. #define rTCMPB3 (*(volatile unsigned *)0x51000034)
  204. #define rTCNTO3 (*(volatile unsigned *)0x51000038)
  205. #define rTCNTB4 (*(volatile unsigned *)0x5100003C)
  206. #define rTCNTO4 (*(volatile unsigned *)0x51000040)
  207. /* USB DEVICE */
  208. #ifdef __BIG_ENDIAN
  209. #define rFUNC_ADDR_REG (*(volatile unsigned char *)0x52000143)
  210. #define rPWR_REG (*(volatile unsigned char *)0x52000147)
  211. #define rEP_INT_REG (*(volatile unsigned char *)0x5200014B)
  212. #define rUSB_INT_REG (*(volatile unsigned char *)0x5200015B)
  213. #define rEP_INT_EN_REG (*(volatile unsigned char *)0x5200015F)
  214. #define rUSB_INT_EN_REG (*(volatile unsigned char *)0x5200016F)
  215. #define rFRAME_NUM1_REG (*(volatile unsigned char *)0x52000173)
  216. #define rFRAME_NUM2_REG (*(volatile unsigned char *)0x52000177)
  217. #define rINDEX_REG (*(volatile unsigned char *)0x5200017B)
  218. #define rMAXP_REG (*(volatile unsigned char *)0x52000183)
  219. #define rEP0_CSR (*(volatile unsigned char *)0x52000187)
  220. #define rIN_CSR1_REG (*(volatile unsigned char *)0x52000187)
  221. #define rIN_CSR2_REG (*(volatile unsigned char *)0x5200018B)
  222. #define rOUT_CSR1_REG (*(volatile unsigned char *)0x52000193)
  223. #define rOUT_CSR2_REG (*(volatile unsigned char *)0x52000197)
  224. #define rOUT_FIFO_CNT1_REG (*(volatile unsigned char *)0x5200019B)
  225. #define rOUT_FIFO_CNT2_REG (*(volatile unsigned char *)0x5200019F)
  226. #define rEP0_FIFO (*(volatile unsigned char *)0x520001C3)
  227. #define rEP1_FIFO (*(volatile unsigned char *)0x520001C7)
  228. #define rEP2_FIFO (*(volatile unsigned char *)0x520001CB)
  229. #define rEP3_FIFO (*(volatile unsigned char *)0x520001CF)
  230. #define rEP4_FIFO (*(volatile unsigned char *)0x520001D3)
  231. #define rEP1_DMA_CON (*(volatile unsigned char *)0x52000203)
  232. #define rEP1_DMA_UNIT (*(volatile unsigned char *)0x52000207)
  233. #define rEP1_DMA_FIFO (*(volatile unsigned char *)0x5200020B)
  234. #define rEP1_DMA_TX_LO (*(volatile unsigned char *)0x5200020F)
  235. #define rEP1_DMA_TX_MD (*(volatile unsigned char *)0x52000213)
  236. #define rEP1_DMA_TX_HI (*(volatile unsigned char *)0x52000217)
  237. #define rEP2_DMA_CON (*(volatile unsigned char *)0x5200021B)
  238. #define rEP2_DMA_UNIT (*(volatile unsigned char *)0x5200021F)
  239. #define rEP2_DMA_FIFO (*(volatile unsigned char *)0x52000223)
  240. #define rEP2_DMA_TX_LO (*(volatile unsigned char *)0x52000227)
  241. #define rEP2_DMA_TX_MD (*(volatile unsigned char *)0x5200022B)
  242. #define rEP2_DMA_TX_HI (*(volatile unsigned char *)0x5200022F)
  243. #define rEP3_DMA_CON (*(volatile unsigned char *)0x52000243)
  244. #define rEP3_DMA_UNIT (*(volatile unsigned char *)0x52000247)
  245. #define rEP3_DMA_FIFO (*(volatile unsigned char *)0x5200024B)
  246. #define rEP3_DMA_TX_LO (*(volatile unsigned char *)0x5200024F)
  247. #define rEP3_DMA_TX_MD (*(volatile unsigned char *)0x52000253)
  248. #define rEP3_DMA_TX_HI (*(volatile unsigned char *)0x52000257)
  249. #define rEP4_DMA_CON (*(volatile unsigned char *)0x5200025B)
  250. #define rEP4_DMA_UNIT (*(volatile unsigned char *)0x5200025F)
  251. #define rEP4_DMA_FIFO (*(volatile unsigned char *)0x52000263)
  252. #define rEP4_DMA_TX_LO (*(volatile unsigned char *)0x52000267)
  253. #define rEP4_DMA_TX_MD (*(volatile unsigned char *)0x5200026B)
  254. #define rEP4_DMA_TX_HI (*(volatile unsigned char *)0x5200026F)
  255. #else /* little endian */
  256. #define rFUNC_ADDR_REG (*(volatile unsigned char *)0x52000140)
  257. #define rPWR_REG (*(volatile unsigned char *)0x52000144)
  258. #define rEP_INT_REG (*(volatile unsigned char *)0x52000148)
  259. #define rUSB_INT_REG (*(volatile unsigned char *)0x52000158)
  260. #define rEP_INT_EN_REG (*(volatile unsigned char *)0x5200015C)
  261. #define rUSB_INT_EN_REG (*(volatile unsigned char *)0x5200016C)
  262. #define rFRAME_NUM1_REG (*(volatile unsigned char *)0x52000170)
  263. #define rFRAME_NUM2_REG (*(volatile unsigned char *)0x52000174)
  264. #define rINDEX_REG (*(volatile unsigned char *)0x52000178)
  265. #define rMAXP_REG (*(volatile unsigned char *)0x52000180)
  266. #define rEP0_CSR (*(volatile unsigned char *)0x52000184)
  267. #define rIN_CSR1_REG (*(volatile unsigned char *)0x52000184)
  268. #define rIN_CSR2_REG (*(volatile unsigned char *)0x52000188)
  269. #define rOUT_CSR1_REG (*(volatile unsigned char *)0x52000190)
  270. #define rOUT_CSR2_REG (*(volatile unsigned char *)0x52000194)
  271. #define rOUT_FIFO_CNT1_REG (*(volatile unsigned char *)0x52000198)
  272. #define rOUT_FIFO_CNT2_REG (*(volatile unsigned char *)0x5200019C)
  273. #define rEP0_FIFO (*(volatile unsigned char *)0x520001C0)
  274. #define rEP1_FIFO (*(volatile unsigned char *)0x520001C4)
  275. #define rEP2_FIFO (*(volatile unsigned char *)0x520001C8)
  276. #define rEP3_FIFO (*(volatile unsigned char *)0x520001CC)
  277. #define rEP4_FIFO (*(volatile unsigned char *)0x520001D0)
  278. #define rEP1_DMA_CON (*(volatile unsigned char *)0x52000200)
  279. #define rEP1_DMA_UNIT (*(volatile unsigned char *)0x52000204)
  280. #define rEP1_DMA_FIFO (*(volatile unsigned char *)0x52000208)
  281. #define rEP1_DMA_TX_LO (*(volatile unsigned char *)0x5200020C)
  282. #define rEP1_DMA_TX_MD (*(volatile unsigned char *)0x52000210)
  283. #define rEP1_DMA_TX_HI (*(volatile unsigned char *)0x52000214)
  284. #define rEP2_DMA_CON (*(volatile unsigned char *)0x52000218)
  285. #define rEP2_DMA_UNIT (*(volatile unsigned char *)0x5200021C)
  286. #define rEP2_DMA_FIFO (*(volatile unsigned char *)0x52000220)
  287. #define rEP2_DMA_TX_LO (*(volatile unsigned char *)0x52000224)
  288. #define rEP2_DMA_TX_MD (*(volatile unsigned char *)0x52000228)
  289. #define rEP2_DMA_TX_HI (*(volatile unsigned char *)0x5200022C)
  290. #define rEP3_DMA_CON (*(volatile unsigned char *)0x52000240)
  291. #define rEP3_DMA_UNIT (*(volatile unsigned char *)0x52000244)
  292. #define rEP3_DMA_FIFO (*(volatile unsigned char *)0x52000248)
  293. #define rEP3_DMA_TX_LO (*(volatile unsigned char *)0x5200024C)
  294. #define rEP3_DMA_TX_MD (*(volatile unsigned char *)0x52000250)
  295. #define rEP3_DMA_TX_HI (*(volatile unsigned char *)0x52000254)
  296. #define rEP4_DMA_CON (*(volatile unsigned char *)0x52000258)
  297. #define rEP4_DMA_UNIT (*(volatile unsigned char *)0x5200025C)
  298. #define rEP4_DMA_FIFO (*(volatile unsigned char *)0x52000260)
  299. #define rEP4_DMA_TX_LO (*(volatile unsigned char *)0x52000264)
  300. #define rEP4_DMA_TX_MD (*(volatile unsigned char *)0x52000268)
  301. #define rEP4_DMA_TX_HI (*(volatile unsigned char *)0x5200026C)
  302. #endif /* __BIG_ENDIAN */
  303. /* WATCH DOG TIMER */
  304. #define rWTCON (*(volatile unsigned *)0x53000000)
  305. #define rWTDAT (*(volatile unsigned *)0x53000004)
  306. #define rWTCNT (*(volatile unsigned *)0x53000008)
  307. /* IIC */
  308. #define rIICCON (*(volatile unsigned *)0x54000000)
  309. #define rIICSTAT (*(volatile unsigned *)0x54000004)
  310. #define rIICADD (*(volatile unsigned *)0x54000008)
  311. #define rIICDS (*(volatile unsigned *)0x5400000C)
  312. /* IIS */
  313. #define rIISCON (*(volatile unsigned *)0x55000000)
  314. #define rIISMOD (*(volatile unsigned *)0x55000004)
  315. #define rIISPSR (*(volatile unsigned *)0x55000008)
  316. #define rIISFCON (*(volatile unsigned *)0x5500000C)
  317. #ifdef __BIG_ENDIAN
  318. #define IISFIF ((volatile unsigned short *)0x55000012)
  319. #else /* little endian */
  320. #define IISFIF ((volatile unsigned short *)0x55000010)
  321. #endif
  322. /* I/O PORT */
  323. #define rGPACON (*(volatile unsigned *)0x56000000)
  324. #define rGPADAT (*(volatile unsigned *)0x56000004)
  325. #define rGPBCON (*(volatile unsigned *)0x56000010)
  326. #define rGPBDAT (*(volatile unsigned *)0x56000014)
  327. #define rGPBUP (*(volatile unsigned *)0x56000018)
  328. #define rGPCCON (*(volatile unsigned *)0x56000020)
  329. #define rGPCDAT (*(volatile unsigned *)0x56000024)
  330. #define rGPCUP (*(volatile unsigned *)0x56000028)
  331. #define rGPDCON (*(volatile unsigned *)0x56000030)
  332. #define rGPDDAT (*(volatile unsigned *)0x56000034)
  333. #define rGPDUP (*(volatile unsigned *)0x56000038)
  334. #define rGPECON (*(volatile unsigned *)0x56000040)
  335. #define rGPEDAT (*(volatile unsigned *)0x56000044)
  336. #define rGPEUP (*(volatile unsigned *)0x56000048)
  337. #define rGPFCON (*(volatile unsigned *)0x56000050)
  338. #define rGPFDAT (*(volatile unsigned *)0x56000054)
  339. #define rGPFUP (*(volatile unsigned *)0x56000058)
  340. #define rGPGCON (*(volatile unsigned *)0x56000060)
  341. #define rGPGDAT (*(volatile unsigned *)0x56000064)
  342. #define rGPGUP (*(volatile unsigned *)0x56000068)
  343. #define rGPHCON (*(volatile unsigned *)0x56000070)
  344. #define rGPHDAT (*(volatile unsigned *)0x56000074)
  345. #define rGPHUP (*(volatile unsigned *)0x56000078)
  346. #define rMISCCR (*(volatile unsigned *)0x56000080)
  347. #define rDCLKCON (*(volatile unsigned *)0x56000084)
  348. #define rEXTINT0 (*(volatile unsigned *)0x56000088)
  349. #define rEXTINT1 (*(volatile unsigned *)0x5600008C)
  350. #define rEXTINT2 (*(volatile unsigned *)0x56000090)
  351. #define rEINTFLT0 (*(volatile unsigned *)0x56000094)
  352. #define rEINTFLT1 (*(volatile unsigned *)0x56000098)
  353. #define rEINTFLT2 (*(volatile unsigned *)0x5600009C)
  354. #define rEINTFLT3 (*(volatile unsigned *)0x560000A0)
  355. #define rEINTMASK (*(volatile unsigned *)0x560000A4)
  356. #define rEINTPEND (*(volatile unsigned *)0x560000A8)
  357. #define rGSTATUS0 (*(volatile unsigned *)0x560000AC)
  358. #define rGSTATUS1 (*(volatile unsigned *)0x560000B0)
  359. /* RTC */
  360. #ifdef __BIG_ENDIAN
  361. #define rRTCCON (*(volatile unsigned char *)0x57000043)
  362. #define rTICNT (*(volatile unsigned char *)0x57000047)
  363. #define rRTCALM (*(volatile unsigned char *)0x57000053)
  364. #define rALMSEC (*(volatile unsigned char *)0x57000057)
  365. #define rALMMIN (*(volatile unsigned char *)0x5700005B)
  366. #define rALMHOUR (*(volatile unsigned char *)0x5700005F)
  367. #define rALMDATE (*(volatile unsigned char *)0x57000063)
  368. #define rALMMON (*(volatile unsigned char *)0x57000067)
  369. #define rALMYEAR (*(volatile unsigned char *)0x5700006B)
  370. #define rRTCRST (*(volatile unsigned char *)0x5700006F)
  371. #define rBCDSEC (*(volatile unsigned char *)0x57000073)
  372. #define rBCDMIN (*(volatile unsigned char *)0x57000077)
  373. #define rBCDHOUR (*(volatile unsigned char *)0x5700007B)
  374. #define rBCDDATE (*(volatile unsigned char *)0x5700007F)
  375. #define rBCDDAY (*(volatile unsigned char *)0x57000083)
  376. #define rBCDMON (*(volatile unsigned char *)0x57000087)
  377. #define rBCDYEAR (*(volatile unsigned char *)0x5700008B)
  378. #else /* little endian */
  379. #define rRTCCON (*(volatile unsigned char *)0x57000040)
  380. #define rTICNT (*(volatile unsigned char *)0x57000044)
  381. #define rRTCALM (*(volatile unsigned char *)0x57000050)
  382. #define rALMSEC (*(volatile unsigned char *)0x57000054)
  383. #define rALMMIN (*(volatile unsigned char *)0x57000058)
  384. #define rALMHOUR (*(volatile unsigned char *)0x5700005C)
  385. #define rALMDATE (*(volatile unsigned char *)0x57000060)
  386. #define rALMMON (*(volatile unsigned char *)0x57000064)
  387. #define rALMYEAR (*(volatile unsigned char *)0x57000068)
  388. #define rRTCRST (*(volatile unsigned char *)0x5700006C)
  389. #define rBCDSEC (*(volatile unsigned char *)0x57000070)
  390. #define rBCDMIN (*(volatile unsigned char *)0x57000074)
  391. #define rBCDHOUR (*(volatile unsigned char *)0x57000078)
  392. #define rBCDDATE (*(volatile unsigned char *)0x5700007C)
  393. #define rBCDDAY (*(volatile unsigned char *)0x57000080)
  394. #define rBCDMON (*(volatile unsigned char *)0x57000084)
  395. #define rBCDYEAR (*(volatile unsigned char *)0x57000088)
  396. #endif
  397. /* ADC */
  398. #define rADCCON (*(volatile unsigned *)0x58000000)
  399. #define rADCTSC (*(volatile unsigned *)0x58000004)
  400. #define rADCDLY (*(volatile unsigned *)0x58000008)
  401. #define rADCDAT0 (*(volatile unsigned *)0x5800000C)
  402. #define rADCDAT1 (*(volatile unsigned *)0x58000010)
  403. /* SPI */
  404. #define rSPCON0 (*(volatile unsigned *)0x59000000)
  405. #define rSPSTA0 (*(volatile unsigned *)0x59000004)
  406. #define rSPPIN0 (*(volatile unsigned *)0x59000008)
  407. #define rSPPRE0 (*(volatile unsigned *)0x5900000C)
  408. #define rSPTDAT0 (*(volatile unsigned *)0x59000010)
  409. #define rSPRDAT0 (*(volatile unsigned *)0x59000014)
  410. #define rSPCON1 (*(volatile unsigned *)0x59000020)
  411. #define rSPSTA1 (*(volatile unsigned *)0x59000024)
  412. #define rSPPIN1 (*(volatile unsigned *)0x59000028)
  413. #define rSPPRE1 (*(volatile unsigned *)0x5900002C)
  414. #define rSPTDAT1 (*(volatile unsigned *)0x59000030)
  415. #define rSPRDAT1 (*(volatile unsigned *)0x59000034)
  416. /* SD INTERFACE */
  417. #define rSDICON (*(volatile unsigned *)0x5A000000)
  418. #define rSDIPRE (*(volatile unsigned *)0x5A000004)
  419. #define rSDICmdArg (*(volatile unsigned *)0x5A000008)
  420. #define rSDICmdCon (*(volatile unsigned *)0x5A00000C)
  421. #define rSDICmdSta (*(volatile unsigned *)0x5A000010)
  422. #define rSDIRSP0 (*(volatile unsigned *)0x5A000014)
  423. #define rSDIRSP1 (*(volatile unsigned *)0x5A000018)
  424. #define rSDIRSP2 (*(volatile unsigned *)0x5A00001C)
  425. #define rSDIRSP3 (*(volatile unsigned *)0x5A000020)
  426. #define rSDIDTimer (*(volatile unsigned *)0x5A000024)
  427. #define rSDIBSize (*(volatile unsigned *)0x5A000028)
  428. #define rSDIDatCon (*(volatile unsigned *)0x5A00002C)
  429. #define rSDIDatCnt (*(volatile unsigned *)0x5A000030)
  430. #define rSDIDatSta (*(volatile unsigned *)0x5A000034)
  431. #define rSDIFSTA (*(volatile unsigned *)0x5A000038)
  432. #ifdef __BIG_ENDIAN
  433. #define rSDIDAT (*(volatile unsigned char *)0x5A00003F)
  434. #else
  435. #define rSDIDAT (*(volatile unsigned char *)0x5A00003C)
  436. #endif
  437. #define rSDIIntMsk (*(volatile unsigned *)0x5A000040)
  438. /* ISR */
  439. #define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
  440. #define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
  441. #define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
  442. #define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xC))
  443. #define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
  444. #define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
  445. #define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
  446. #define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1C))
  447. #define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x20))
  448. #define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x24))
  449. #define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
  450. #define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x2C))
  451. #define pISR_EINT4_7 (*(unsigned *)(_ISR_STARTADDRESS+0x30))
  452. #define pISR_EINT8_23 (*(unsigned *)(_ISR_STARTADDRESS+0x34))
  453. #define pISR_BAT_FLT (*(unsigned *)(_ISR_STARTADDRESS+0x3C))
  454. #define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x40))
  455. #define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x44))
  456. #define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
  457. #define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x4C))
  458. #define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
  459. #define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
  460. #define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
  461. #define pISR_UART2 (*(unsigned *)(_ISR_STARTADDRESS+0x5C))
  462. #define pISR_NOTUSED (*(unsigned *)(_ISR_STARTADDRESS+0x60))
  463. #define pISR_DMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
  464. #define pISR_DMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
  465. #define pISR_DMA2 (*(unsigned *)(_ISR_STARTADDRESS+0x6C))
  466. #define pISR_DMA3 (*(unsigned *)(_ISR_STARTADDRESS+0x70))
  467. #define pISR_SDI (*(unsigned *)(_ISR_STARTADDRESS+0x74))
  468. #define pISR_SPI0 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
  469. #define pISR_UART1 (*(unsigned *)(_ISR_STARTADDRESS+0x7C))
  470. #define pISR_USBD (*(unsigned *)(_ISR_STARTADDRESS+0x84))
  471. #define pISR_USBH (*(unsigned *)(_ISR_STARTADDRESS+0x88))
  472. #define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x8C))
  473. #define pISR_UART0 (*(unsigned *)(_ISR_STARTADDRESS+0x90))
  474. #define pISR_SPI1 (*(unsigned *)(_ISR_STARTADDRESS+0x94))
  475. #define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x98))
  476. #define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0xA0))
  477. /* PENDING BIT */
  478. #define BIT_EINT0 (0x1)
  479. #define BIT_EINT1 (0x1<<1)
  480. #define BIT_EINT2 (0x1<<2)
  481. #define BIT_EINT3 (0x1<<3)
  482. #define BIT_EINT4_7 (0x1<<4)
  483. #define BIT_EINT8_23 (0x1<<5)
  484. #define BIT_BAT_FLT (0x1<<7)
  485. #define BIT_TICK (0x1<<8)
  486. #define BIT_WDT (0x1<<9)
  487. #define BIT_TIMER0 (0x1<<10)
  488. #define BIT_TIMER1 (0x1<<11)
  489. #define BIT_TIMER2 (0x1<<12)
  490. #define BIT_TIMER3 (0x1<<13)
  491. #define BIT_TIMER4 (0x1<<14)
  492. #define BIT_UART2 (0x1<<15)
  493. #define BIT_LCD (0x1<<16)
  494. #define BIT_DMA0 (0x1<<17)
  495. #define BIT_DMA1 (0x1<<18)
  496. #define BIT_DMA2 (0x1<<19)
  497. #define BIT_DMA3 (0x1<<20)
  498. #define BIT_SDI (0x1<<21)
  499. #define BIT_SPI0 (0x1<<22)
  500. #define BIT_UART1 (0x1<<23)
  501. #define BIT_USBD (0x1<<25)
  502. #define BIT_USBH (0x1<<26)
  503. #define BIT_IIC (0x1<<27)
  504. #define BIT_UART0 (0x1<<28)
  505. #define BIT_SPI1 (0x1<<29)
  506. #define BIT_RTC (0x1<<30)
  507. #define BIT_ADC (0x1<<31)
  508. #define BIT_ALLMSK (0xFFFFFFFF)
  509. #define ClearPending(bit) {\
  510. rSRCPND = bit;\
  511. rINTPND = bit;\
  512. rINTPND;\
  513. }
  514. /* Wait until rINTPND is changed for the case that the ISR is very short. */
  515. #endif /*__S3C2410_H__*/