regs.h 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. #ifndef REGS_H
  2. #define REGS_H
  3. #define REG_BASE 0x00300000
  4. #define REG_BASE_ID 0x00020000
  5. #define REG_TYPE_8 volatile unsigned char
  6. #define REG_TYPE_16 volatile unsigned short
  7. #define REG_TYPE_32 volatile unsigned long
  8. // CPU identification
  9. #define CORE_ID *((REG_TYPE_8 *)REG_BASE_ID + 0)
  10. #define CORE_ID_STANDARD 0x02
  11. #define CORE_ID_STANDARD_DESC "C33 standard macro core"
  12. #define CORE_ID_MINI 0x03
  13. #define CORE_ID_MINI_DESC "C33 mini-macro core"
  14. #define CORE_ID_ADVANCED 0x04
  15. #define CORE_ID_ADVANCED_DESC "C33 advanced macro core"
  16. #define CORE_ID_PE 0x05
  17. #define CORE_ID_PE_DESC "C33 PE Core"
  18. #define CORE_ID_PE_LE 0x06
  19. #define CORE_ID_PE_LE_DESC "C33 PE little endian core"
  20. #define PRODUCT_ID *((REG_TYPE_8 *)REG_BASE_ID + 1)
  21. #define PRODUCT_ID_3 0x03
  22. #define PRODUCT_ID_3_DESC "S1C333"
  23. #define PRODUCT_ID_4 0x04
  24. #define PRODUCT_ID_4_DESC "S1C334"
  25. #define PRODUCT_ID_3E 0x0E
  26. #define PRODUCT_ID_3E_DESC "S1C33E"
  27. #define PRODUCT_ID_3L 0x15
  28. #define PRODUCT_ID_3L_DESC "S1C33L"
  29. #define MODEL_ID *((REG_TYPE_8 *)REG_BASE_ID + 2)
  30. #define VERSION_ID *((REG_TYPE_8 *)REG_BASE_ID + 3)
  31. /* Misc Register #1 */
  32. #define REG_MISC_RTCWT *((REG_TYPE_8 *) (REG_BASE + 0x10))
  33. #define REG_MISC_USBWT *((REG_TYPE_8 *) (REG_BASE + 0x12))
  34. #define REG_MISC_PMUX *((REG_TYPE_8 *) (REG_BASE + 0x14))
  35. #define REG_MISC_PAC *((REG_TYPE_8 *) (REG_BASE + 0x16))
  36. #define REG_MISC_BOOT *((REG_TYPE_8 *) (REG_BASE + 0x18))
  37. #define REG_MISC_COROM *((REG_TYPE_8 *) (REG_BASE + 0x1a))
  38. #define REG_MISC_PROT *((REG_TYPE_8 *) (REG_BASE + 0x20))
  39. /* Interrupt Controller */
  40. #define REG_INT_PP01L *((REG_TYPE_8 *) (REG_BASE + 0x260))
  41. #define REG_INT_PP23L *((REG_TYPE_8 *) (REG_BASE + 0x261))
  42. #define REG_INT_PK01L *((REG_TYPE_8 *) (REG_BASE + 0x262))
  43. #define REG_INT_PHSD01L *((REG_TYPE_8 *) (REG_BASE + 0x263))
  44. #define REG_INT_PHSD23L *((REG_TYPE_8 *) (REG_BASE + 0x264))
  45. #define REG_INT_PDM *((REG_TYPE_8 *) (REG_BASE + 0x265))
  46. #define REG_INT_P16T01 *((REG_TYPE_8 *) (REG_BASE + 0x266))
  47. #define REG_INT_P16T23 *((REG_TYPE_8 *) (REG_BASE + 0x267))
  48. #define REG_INT_P16T45 *((REG_TYPE_8 *) (REG_BASE + 0x268))
  49. #define REG_INT_PLCDC_PSIO0 *((REG_TYPE_8 *) (REG_BASE + 0x269))
  50. #define REG_INT_PSI01_PAD *((REG_TYPE_8 *) (REG_BASE + 0x26a))
  51. #define REG_INT_PRTC *((REG_TYPE_8 *) (REG_BASE + 0x26b))
  52. #define REG_INT_PP45L *((REG_TYPE_8 *) (REG_BASE + 0x26c))
  53. #define REG_INT_PP67L *((REG_TYPE_8 *) (REG_BASE + 0x26d))
  54. #define REG_INT_PSI02_PSPI *((REG_TYPE_8 *) (REG_BASE + 0x26e))
  55. #define REG_INT_EK01_EP03 *((REG_TYPE_8 *) (REG_BASE + 0x270))
  56. #define REG_INT_EDMA *((REG_TYPE_8 *) (REG_BASE + 0x271))
  57. #define REG_INT_E16T01 *((REG_TYPE_8 *) (REG_BASE + 0x272))
  58. #define REG_INT_E16T23 *((REG_TYPE_8 *) (REG_BASE + 0x273))
  59. #define REG_INT_E16T45 *((REG_TYPE_8 *) (REG_BASE + 0x274))
  60. #define REG_INT_ESIF01 *((REG_TYPE_8 *) (REG_BASE + 0x276))
  61. #define REG_INT_EP47_ERTC_EAD *((REG_TYPE_8 *) (REG_BASE + 0x277))
  62. #define REG_INT_ELCDC *((REG_TYPE_8 *) (REG_BASE + 0x278))
  63. #define REG_INT_ESIF2_ESPI *((REG_TYPE_8 *) (REG_BASE + 0x279))
  64. #define REG_INT_FK01_FP03 *((REG_TYPE_8 *) (REG_BASE + 0x280))
  65. #define REG_INT_FDMA *((REG_TYPE_8 *) (REG_BASE + 0x281))
  66. #define REG_INT_F16T01 *((REG_TYPE_8 *) (REG_BASE + 0x282))
  67. #define REG_INT_F16T23 *((REG_TYPE_8 *) (REG_BASE + 0x283))
  68. #define REG_INT_F16T45 *((REG_TYPE_8 *) (REG_BASE + 0x284))
  69. #define REG_INT_FSIF01 *((REG_TYPE_8 *) (REG_BASE + 0x286))
  70. #define REG_INT_FP47_FRTC_FAD *((REG_TYPE_8 *) (REG_BASE + 0x287))
  71. #define REG_INT_FLCDC *((REG_TYPE_8 *) (REG_BASE + 0x288))
  72. #define REG_INT_FSIF2_FSPI *((REG_TYPE_8 *) (REG_BASE + 0x289))
  73. #define REG_IDMAREQ_RP03_RHS_R16T0 *((REG_TYPE_8 *) (REG_BASE + 0x290))
  74. #define REG_IDMAREQ_R16T14 *((REG_TYPE_8 *) (REG_BASE + 0x291))
  75. #define REG_IDMAREQ_R16T5_RSIF0 *((REG_TYPE_8 *) (REG_BASE + 0x292))
  76. #define REG_IDMAREQ_RSIF1_RAD_RP47 *((REG_TYPE_8 *) (REG_BASE + 0x293))
  77. #define REG_IDMAEN_DEP03_DEHS_DE16T0 *((REG_TYPE_8 *) (REG_BASE + 0x294))
  78. #define REG_IDMAEN_DE16T14 *((REG_TYPE_8 *) (REG_BASE + 0x295))
  79. #define REG_IDMAEN_DE16T5_DESIF0 *((REG_TYPE_8 *) (REG_BASE + 0x296))
  80. #define REG_IDMAEN_DESIF1_DEAD_DEP47 *((REG_TYPE_8 *) (REG_BASE + 0x297))
  81. #define REG_HSDMA_HTGR1 *((REG_TYPE_8 *) (REG_BASE + 0x298))
  82. #define REG_HSDMA_HTGR2 *((REG_TYPE_8 *) (REG_BASE + 0x299))
  83. #define REG_HSDMA_HSOFTTGR *((REG_TYPE_8 *) (REG_BASE + 0x29a))
  84. #define REG_IDMAREQ_RLCDC_RSIF2_RSPI *((REG_TYPE_8 *) (REG_BASE + 0x29b))
  85. #define REG_IDMAEN_DELCDC_DESIF2_DESPI *((REG_TYPE_8 *) (REG_BASE + 0x29c))
  86. #define REG_RST_RESET *((REG_TYPE_8 *) (REG_BASE + 0x29f))
  87. #define REG_INT_PP89L *((REG_TYPE_8 *) (REG_BASE + 0x2a0))
  88. #define REG_INT_PP1011L *((REG_TYPE_8 *) (REG_BASE + 0x2a1))
  89. #define REG_INT_PP1213L *((REG_TYPE_8 *) (REG_BASE + 0x2a2))
  90. #define REG_INT_PP1415L *((REG_TYPE_8 *) (REG_BASE + 0x2a3))
  91. #define REG_INT_PI2S *((REG_TYPE_8 *) (REG_BASE + 0x2a4))
  92. #define REG_INT_EP815 *((REG_TYPE_8 *) (REG_BASE + 0x2a6))
  93. #define REG_INT_EI2S *((REG_TYPE_8 *) (REG_BASE + 0x2a7))
  94. #define REG_INT_FP815 *((REG_TYPE_8 *) (REG_BASE + 0x2a9))
  95. #define REG_INT_FI2S *((REG_TYPE_8 *) (REG_BASE + 0x2aa))
  96. #define REG_IDMAREQ_RP815 *((REG_TYPE_8 *) (REG_BASE + 0x2ac))
  97. #define REG_IDMAREQ_RI2S *((REG_TYPE_8 *) (REG_BASE + 0x2ad))
  98. #define REG_IDMAEN_DEP815 *((REG_TYPE_8 *) (REG_BASE + 0x2ae))
  99. #define REG_IDMAEN_DEI2S *((REG_TYPE_8 *) (REG_BASE + 0x2af))
  100. /* Card Interface */
  101. #define REG_CARDSETUP *((REG_TYPE_8 *) (REG_BASE + 0x300))
  102. #define REG_CARDFUNCSEL05 *((REG_TYPE_8 *) (REG_BASE + 0x302))
  103. #define REG_ECCTRIGSEL *((REG_TYPE_8 *) (REG_BASE + 0x310))
  104. #define REG_ECCRSTRDY *((REG_TYPE_8 *) (REG_BASE + 0x311))
  105. #define REG_ECCENA *((REG_TYPE_8 *) (REG_BASE + 0x312))
  106. #define REG_ECCMD *((REG_TYPE_8 *) (REG_BASE + 0x313))
  107. #define REG_ECC0CP *((REG_TYPE_8 *) (REG_BASE + 0x314))
  108. #define REG_ECC0LPL *((REG_TYPE_8 *) (REG_BASE + 0x316))
  109. #define REG_ECC0LPH *((REG_TYPE_8 *) (REG_BASE + 0x317))
  110. #define REG_ECC1CP *((REG_TYPE_8 *) (REG_BASE + 0x318))
  111. #define REG_ECC1LPL *((REG_TYPE_8 *) (REG_BASE + 0x31a))
  112. #define REG_ECC1LPH *((REG_TYPE_8 *) (REG_BASE + 0x31b))
  113. /* I/O Ports */
  114. #define REG_P0_P0D *((REG_TYPE_8 *) (REG_BASE + 0x380))
  115. #define REG_P0_IOC0 *((REG_TYPE_8 *) (REG_BASE + 0x381))
  116. #define REG_P1_P1D *((REG_TYPE_8 *) (REG_BASE + 0x382))
  117. #define REG_P1_IOC1 *((REG_TYPE_8 *) (REG_BASE + 0x383))
  118. #define REG_P2_P2D *((REG_TYPE_8 *) (REG_BASE + 0x384))
  119. #define REG_P2_IOC2 *((REG_TYPE_8 *) (REG_BASE + 0x385))
  120. #define REG_P3_P3D *((REG_TYPE_8 *) (REG_BASE + 0x386))
  121. #define REG_P3_IOC3 *((REG_TYPE_8 *) (REG_BASE + 0x387))
  122. #define REG_P4_P4D *((REG_TYPE_8 *) (REG_BASE + 0x388))
  123. #define REG_P4_IOC4 *((REG_TYPE_8 *) (REG_BASE + 0x389))
  124. #define REG_P5_P5D *((REG_TYPE_8 *) (REG_BASE + 0x38a))
  125. #define REG_P5_IOC5 *((REG_TYPE_8 *) (REG_BASE + 0x38b))
  126. #define REG_P6_P6D *((REG_TYPE_8 *) (REG_BASE + 0x38c))
  127. #define REG_P6_IOC6 *((REG_TYPE_8 *) (REG_BASE + 0x38d))
  128. #define REG_P7_P7D *((REG_TYPE_8 *) (REG_BASE + 0x38e))
  129. #define REG_P8_P8D *((REG_TYPE_8 *) (REG_BASE + 0x390))
  130. #define REG_P8_IOC8 *((REG_TYPE_8 *) (REG_BASE + 0x391))
  131. #define REG_P9_P9D *((REG_TYPE_8 *) (REG_BASE + 0x392))
  132. #define REG_P9_IOC9 *((REG_TYPE_8 *) (REG_BASE + 0x393))
  133. #define REG_P0_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a0))
  134. #define REG_P0_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a1))
  135. #define REG_P1_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a2))
  136. #define REG_P1_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a3))
  137. #define REG_P2_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a4))
  138. #define REG_P2_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a5))
  139. #define REG_P3_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a6))
  140. #define REG_P3_46_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a7))
  141. #define REG_P4_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a8))
  142. #define REG_P4_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3a9))
  143. #define REG_P5_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3aa))
  144. #define REG_P5_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3ab))
  145. #define REG_P6_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3ac))
  146. #define REG_P6_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3ad))
  147. #define REG_P7_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3ae))
  148. #define REG_P7_4_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3af))
  149. #define REG_P8_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3b0))
  150. #define REG_P8_45_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3b1))
  151. #define REG_P9_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3b2))
  152. #define REG_P9_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0x3b3))
  153. #define REG_PINTSEL_SPT03 *((REG_TYPE_8 *) (REG_BASE + 0x3c0))
  154. #define REG_PINTSEL_SPT47 *((REG_TYPE_8 *) (REG_BASE + 0x3c1))
  155. #define REG_PINTPOL_SPP07 *((REG_TYPE_8 *) (REG_BASE + 0x3c2))
  156. #define REG_PINTEL_SEPT07 *((REG_TYPE_8 *) (REG_BASE + 0x3c3))
  157. #define REG_PINTSEL_SPT811 *((REG_TYPE_8 *) (REG_BASE + 0x3c4))
  158. #define REG_PINTSEL_SPT1215 *((REG_TYPE_8 *) (REG_BASE + 0x3c5))
  159. #define REG_PINTPOL_SPP815 *((REG_TYPE_8 *) (REG_BASE + 0x3c6))
  160. #define REG_PINTEL_SEPT815 *((REG_TYPE_8 *) (REG_BASE + 0x3c7))
  161. #define REG_KINTSEL_SPPK01 *((REG_TYPE_8 *) (REG_BASE + 0x3d0))
  162. #define REG_KINTCOMP_SCPK0 *((REG_TYPE_8 *) (REG_BASE + 0x3d2))
  163. #define REG_KINTCOMP_SCPK1 *((REG_TYPE_8 *) (REG_BASE + 0x3d3))
  164. #define REG_KINTCOMP_SMPK0 *((REG_TYPE_8 *) (REG_BASE + 0x3d4))
  165. #define REG_KINTCOMP_SMPK1 *((REG_TYPE_8 *) (REG_BASE + 0x3d5))
  166. /* A/D Converter */
  167. #define REG_AD_CLKCTL *((REG_TYPE_16 *) (REG_BASE + 0x520))
  168. #define REG_AD_ADD *((REG_TYPE_16 *) (REG_BASE + 0x540))
  169. #define REG_AD_TRIG_CHNL *((REG_TYPE_16 *) (REG_BASE + 0x542))
  170. #define REG_AD_EN_SMPL_STAT *((REG_TYPE_16 *) (REG_BASE + 0x544))
  171. #define REG_AD_END *((REG_TYPE_16 *) (REG_BASE + 0x546))
  172. #define REG_AD_CH0_BUF *((REG_TYPE_16 *) (REG_BASE + 0x548))
  173. #define REG_AD_CH1_BUF *((REG_TYPE_16 *) (REG_BASE + 0x54a))
  174. #define REG_AD_CH2_BUF *((REG_TYPE_16 *) (REG_BASE + 0x54c))
  175. #define REG_AD_CH3_BUF *((REG_TYPE_16 *) (REG_BASE + 0x54e))
  176. #define REG_AD_CH4_BUF *((REG_TYPE_16 *) (REG_BASE + 0x550))
  177. #define REG_AD_UPPER *((REG_TYPE_16 *) (REG_BASE + 0x558))
  178. #define REG_AD_LOWER *((REG_TYPE_16 *) (REG_BASE + 0x55a))
  179. #define REG_AD_CH04_INTMASK *((REG_TYPE_16 *) (REG_BASE + 0x55c))
  180. #define REG_AD_ADVMODE *((REG_TYPE_16 *) (REG_BASE + 0x55e))
  181. /* Watchdog Timer */
  182. #define REG_WD_WP *((REG_TYPE_16 *) (REG_BASE + 0x660))
  183. #define REG_WD_EN *((REG_TYPE_16 *) (REG_BASE + 0x662))
  184. #define REG_WD_COMP *((REG_TYPE_32 *) (REG_BASE + 0x664))
  185. #define REG_WD_COMP_LOW *((REG_TYPE_16 *) (REG_BASE + 0x664))
  186. #define REG_WD_COMP_HIGH *((REG_TYPE_16 *) (REG_BASE + 0x666))
  187. #define REG_WD_CNT *((REG_TYPE_32 *) (REG_BASE + 0x668))
  188. #define REG_WD_CNT_LOW *((REG_TYPE_16 *) (REG_BASE + 0x668))
  189. #define REG_WD_CNT_HIGH *((REG_TYPE_16 *) (REG_BASE + 0x66a))
  190. #define REG_WD_CNTL *((REG_TYPE_16 *) (REG_BASE + 0x66c))
  191. /* 16-bit Timer */
  192. #define REG_T16_CR0A *((REG_TYPE_16 *) (REG_BASE + 0x780))
  193. #define REG_T16_CR0B *((REG_TYPE_16 *) (REG_BASE + 0x782))
  194. #define REG_T16_TC0 *((REG_TYPE_16 *) (REG_BASE + 0x784))
  195. #define REG_T16_CTL0 *((REG_TYPE_16 *) (REG_BASE + 0x786))
  196. #define REG_T16_CR1A *((REG_TYPE_16 *) (REG_BASE + 0x788))
  197. #define REG_T16_CR1B *((REG_TYPE_16 *) (REG_BASE + 0x78a))
  198. #define REG_T16_TC1 *((REG_TYPE_16 *) (REG_BASE + 0x78c))
  199. #define REG_T16_CTL1 *((REG_TYPE_16 *) (REG_BASE + 0x78e))
  200. #define REG_T16_CR2A *((REG_TYPE_16 *) (REG_BASE + 0x790))
  201. #define REG_T16_CR2B *((REG_TYPE_16 *) (REG_BASE + 0x792))
  202. #define REG_T16_TC2 *((REG_TYPE_16 *) (REG_BASE + 0x794))
  203. #define REG_T16_CTL2 *((REG_TYPE_16 *) (REG_BASE + 0x796))
  204. #define REG_T16_CR3A *((REG_TYPE_16 *) (REG_BASE + 0x798))
  205. #define REG_T16_CR3B *((REG_TYPE_16 *) (REG_BASE + 0x79a))
  206. #define REG_T16_TC3 *((REG_TYPE_16 *) (REG_BASE + 0x79c))
  207. #define REG_T16_CTL3 *((REG_TYPE_16 *) (REG_BASE + 0x79e))
  208. #define REG_T16_CR4A *((REG_TYPE_16 *) (REG_BASE + 0x7a0))
  209. #define REG_T16_CR4B *((REG_TYPE_16 *) (REG_BASE + 0x7a2))
  210. #define REG_T16_TC4 *((REG_TYPE_16 *) (REG_BASE + 0x7a4))
  211. #define REG_T16_CTL4 *((REG_TYPE_16 *) (REG_BASE + 0x7a6))
  212. #define REG_T16_CR5A *((REG_TYPE_16 *) (REG_BASE + 0x7a8))
  213. #define REG_T16_CR5B *((REG_TYPE_16 *) (REG_BASE + 0x7aa))
  214. #define REG_T16_TC5 *((REG_TYPE_16 *) (REG_BASE + 0x7ac))
  215. #define REG_T16_CTL5 *((REG_TYPE_16 *) (REG_BASE + 0x7ae))
  216. #define REG_DA16_CR0A *((REG_TYPE_16 *) (REG_BASE + 0x7d0))
  217. #define REG_DA16_CR1A *((REG_TYPE_16 *) (REG_BASE + 0x7d2))
  218. #define REG_DA16_CR2A *((REG_TYPE_16 *) (REG_BASE + 0x7d4))
  219. #define REG_T16_CNT_PAUSE *((REG_TYPE_16 *) (REG_BASE + 0x7dc))
  220. #define REG_T16_ADVMODE *((REG_TYPE_16 *) (REG_BASE + 0x7de))
  221. #define REG_T16_CLKCTL_0 *((REG_TYPE_16 *) (REG_BASE + 0x7e0))
  222. #define REG_T16_CLKCTL_1 *((REG_TYPE_16 *) (REG_BASE + 0x7e2))
  223. #define REG_T16_CLKCTL_2 *((REG_TYPE_16 *) (REG_BASE + 0x7e4))
  224. #define REG_T16_CLKCTL_3 *((REG_TYPE_16 *) (REG_BASE + 0x7e6))
  225. #define REG_T16_CLKCTL_4 *((REG_TYPE_16 *) (REG_BASE + 0x7e8))
  226. #define REG_T16_CLKCTL_5 *((REG_TYPE_16 *) (REG_BASE + 0x7ea))
  227. /* USB Function Controller */
  228. #define REG_USB_MAIN_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x900))
  229. #define REG_USB_SIE_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x901))
  230. #define REG_USB_EPR_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x902))
  231. #define REG_USB_DMA_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x903))
  232. #define REG_USB_FIFO_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x904))
  233. #define REG_USB_EP0_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x907))
  234. #define REG_USB_EPA_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x908))
  235. #define REG_USB_EPB_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x909))
  236. #define REG_USB_EPC_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x90a))
  237. #define REG_USB_EPD_INT_STAT *((REG_TYPE_8 *) (REG_BASE + 0x90b))
  238. #define REG_USB_MAIN_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x910))
  239. #define REG_USB_SIE_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x911))
  240. #define REG_USB_EPR_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x912))
  241. #define REG_USB_DMA_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x913))
  242. #define REG_USB_FIFO_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x914))
  243. #define REG_USB_EP0_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x917))
  244. #define REG_USB_EPA_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x918))
  245. #define REG_USB_EPB_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x919))
  246. #define REG_USB_EPC_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x91a))
  247. #define REG_USB_EPD_INT_EN *((REG_TYPE_8 *) (REG_BASE + 0x91b))
  248. #define REG_USB_REVNUM *((REG_TYPE_8 *) (REG_BASE + 0x920))
  249. #define REG_USB_USB_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x921))
  250. #define REG_USB_STATUS *((REG_TYPE_8 *) (REG_BASE + 0x922))
  251. #define REG_USB_XCVR_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x923))
  252. #define REG_USB_TEST *((REG_TYPE_8 *) (REG_BASE + 0x924))
  253. #define REG_USB_EPn_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x925))
  254. #define REG_USB_EPrFIFO_Clr *((REG_TYPE_8 *) (REG_BASE + 0x926))
  255. #define REG_USB_FRAME_NUM_H *((REG_TYPE_8 *) (REG_BASE + 0x92e))
  256. #define REG_USB_FRAME_NUM_L *((REG_TYPE_8 *) (REG_BASE + 0x92f))
  257. #define REG_USB_EP0_SETUP_0 *((REG_TYPE_8 *) (REG_BASE + 0x930))
  258. #define REG_USB_EP0_SETUP_1 *((REG_TYPE_8 *) (REG_BASE + 0x931))
  259. #define REG_USB_EP0_SETUP_2 *((REG_TYPE_8 *) (REG_BASE + 0x932))
  260. #define REG_USB_EP0_SETUP_3 *((REG_TYPE_8 *) (REG_BASE + 0x933))
  261. #define REG_USB_EP0_SETUP_4 *((REG_TYPE_8 *) (REG_BASE + 0x934))
  262. #define REG_USB_EP0_SETUP_5 *((REG_TYPE_8 *) (REG_BASE + 0x935))
  263. #define REG_USB_EP0_SETUP_6 *((REG_TYPE_8 *) (REG_BASE + 0x936))
  264. #define REG_USB_EP0_SETUP_7 *((REG_TYPE_8 *) (REG_BASE + 0x937))
  265. #define REG_USB_ADDRESS *((REG_TYPE_8 *) (REG_BASE + 0x938))
  266. #define REG_USB_EP0_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x939))
  267. #define REG_USB_EP0_CTRL_IN *((REG_TYPE_8 *) (REG_BASE + 0x93a))
  268. #define REG_USB_EP0_CTRL_OUT *((REG_TYPE_8 *) (REG_BASE + 0x93b))
  269. #define REG_USB_EP0_MAXSIZE *((REG_TYPE_8 *) (REG_BASE + 0x93f))
  270. #define REG_USB_EPA_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x940))
  271. #define REG_USB_EPB_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x941))
  272. #define REG_USB_EPC_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x942))
  273. #define REG_USB_EPD_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x943))
  274. #define REG_USB_EPA_MAXSIZE_H *((REG_TYPE_8 *) (REG_BASE + 0x950))
  275. #define REG_USB_EPA_MAXSIZE_L *((REG_TYPE_8 *) (REG_BASE + 0x951))
  276. #define REG_USB_EPA_CONFIG_0 *((REG_TYPE_8 *) (REG_BASE + 0x952))
  277. #define REG_USB_EPA_CONFIG_1 *((REG_TYPE_8 *) (REG_BASE + 0x953))
  278. #define REG_USB_EPB_MAXSIZE_H *((REG_TYPE_8 *) (REG_BASE + 0x954))
  279. #define REG_USB_EPB_MAXSIZE_L *((REG_TYPE_8 *) (REG_BASE + 0x955))
  280. #define REG_USB_EPB_CONFIG_0 *((REG_TYPE_8 *) (REG_BASE + 0x956))
  281. #define REG_USB_EPB_CONFIG_1 *((REG_TYPE_8 *) (REG_BASE + 0x957))
  282. #define REG_USB_EPC_MAXSIZE_H *((REG_TYPE_8 *) (REG_BASE + 0x958))
  283. #define REG_USB_EPC_MAXSIZE_L *((REG_TYPE_8 *) (REG_BASE + 0x959))
  284. #define REG_USB_EPC_CONFIG_0 *((REG_TYPE_8 *) (REG_BASE + 0x95a))
  285. #define REG_USB_EPC_CONFIG_1 *((REG_TYPE_8 *) (REG_BASE + 0x95b))
  286. #define REG_USB_EPD_MAXSIZE_H *((REG_TYPE_8 *) (REG_BASE + 0x95c))
  287. #define REG_USB_EPD_MAXSIZE_L *((REG_TYPE_8 *) (REG_BASE + 0x95d))
  288. #define REG_USB_EPD_CONFIG_0 *((REG_TYPE_8 *) (REG_BASE + 0x95e))
  289. #define REG_USB_EPD_CONFIG_1 *((REG_TYPE_8 *) (REG_BASE + 0x95f))
  290. #define REG_USB_EPA_START_ADDR_H *((REG_TYPE_8 *) (REG_BASE + 0x970))
  291. #define REG_USB_EPA_START_ADDR_L *((REG_TYPE_8 *) (REG_BASE + 0x971))
  292. #define REG_USB_EPB_START_ADDR_H *((REG_TYPE_8 *) (REG_BASE + 0x972))
  293. #define REG_USB_EPB_START_ADDR_L *((REG_TYPE_8 *) (REG_BASE + 0x973))
  294. #define REG_USB_EPC_START_ADDR_H *((REG_TYPE_8 *) (REG_BASE + 0x974))
  295. #define REG_USB_EPC_START_ADDR_L *((REG_TYPE_8 *) (REG_BASE + 0x975))
  296. #define REG_USB_EPD_START_ADDR_H *((REG_TYPE_8 *) (REG_BASE + 0x976))
  297. #define REG_USB_EPD_START_ADDR_L *((REG_TYPE_8 *) (REG_BASE + 0x977))
  298. #define REG_USB_CPU_JOIN_RD *((REG_TYPE_8 *) (REG_BASE + 0x980))
  299. #define REG_USB_CPU_JOIN_WR *((REG_TYPE_8 *) (REG_BASE + 0x981))
  300. #define REG_USB_EN_EPN_FIFO *((REG_TYPE_8 *) (REG_BASE + 0x982))
  301. #define REG_USB_EPN_FIFO_FOR_CPU *((REG_TYPE_8 *) (REG_BASE + 0x983))
  302. #define REG_USB_EPN_RD_REMAIN_H *((REG_TYPE_8 *) (REG_BASE + 0x984))
  303. #define REG_USB_EPN_RD_REMAIN_L *((REG_TYPE_8 *) (REG_BASE + 0x985))
  304. #define REG_USB_EPN_WR_REMAIN_H *((REG_TYPE_8 *) (REG_BASE + 0x986))
  305. #define REG_USB_EPN_WR_REMAIN_L *((REG_TYPE_8 *) (REG_BASE + 0x987))
  306. #define REG_USB_DESC_ADDR_H *((REG_TYPE_8 *) (REG_BASE + 0x988))
  307. #define REG_USB_DESC_ADDR_L *((REG_TYPE_8 *) (REG_BASE + 0x989))
  308. #define REG_USB_DESC_SIZE_H *((REG_TYPE_8 *) (REG_BASE + 0x98a))
  309. #define REG_USB_DESC_SIZE_L *((REG_TYPE_8 *) (REG_BASE + 0x98b))
  310. #define REG_USB_DESC_DOOR *((REG_TYPE_8 *) (REG_BASE + 0x98f))
  311. #define REG_USB_DMA_FIFO_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x990))
  312. #define REG_USB_DMA_JOIN *((REG_TYPE_8 *) (REG_BASE + 0x991))
  313. #define REG_USB_DMA_CTRL *((REG_TYPE_8 *) (REG_BASE + 0x992))
  314. #define REG_USB_DMA_CONFIG_0 *((REG_TYPE_8 *) (REG_BASE + 0x994))
  315. #define REG_USB_DMA_CONFIG_1 *((REG_TYPE_8 *) (REG_BASE + 0x995))
  316. #define REG_USB_DMA_Latency *((REG_TYPE_8 *) (REG_BASE + 0x997))
  317. #define REG_USB_DMA_REMAIN_H *((REG_TYPE_8 *) (REG_BASE + 0x998))
  318. #define REG_USB_DMA_REMAIN_L *((REG_TYPE_8 *) (REG_BASE + 0x999))
  319. #define REG_USB_DMA_Count_HH *((REG_TYPE_8 *) (REG_BASE + 0x99c))
  320. #define REG_USB_DMA_Count_HL *((REG_TYPE_8 *) (REG_BASE + 0x99d))
  321. #define REG_USB_DMA_Count_LH *((REG_TYPE_8 *) (REG_BASE + 0x99e))
  322. #define REG_USB_DMA_Count_LL *((REG_TYPE_8 *) (REG_BASE + 0x99f))
  323. /* Serial Interface */
  324. #define REG_EFSIF0_TXD *((REG_TYPE_8 *) (REG_BASE + 0xb00))
  325. #define REG_EFSIF0_RXD *((REG_TYPE_8 *) (REG_BASE + 0xb01))
  326. #define REG_EFSIF0_STATUS *((REG_TYPE_8 *) (REG_BASE + 0xb02))
  327. #define REG_EFSIF0_CTL *((REG_TYPE_8 *) (REG_BASE + 0xb03))
  328. #define REG_EFSIF0_IRDA *((REG_TYPE_8 *) (REG_BASE + 0xb04))
  329. #define REG_EFSIF0_BRTRUN *((REG_TYPE_8 *) (REG_BASE + 0xb05))
  330. #define REG_EFSIF0_BRTRDL *((REG_TYPE_8 *) (REG_BASE + 0xb06))
  331. #define REG_EFSIF0_BRTRDM *((REG_TYPE_8 *) (REG_BASE + 0xb07))
  332. #define REG_EFSIF0_BRTCDL *((REG_TYPE_8 *) (REG_BASE + 0xb08))
  333. #define REG_EFSIF0_BRTCDM *((REG_TYPE_8 *) (REG_BASE + 0xb09))
  334. #define REG_EFSIF1_TXD *((REG_TYPE_8 *) (REG_BASE + 0xb10))
  335. #define REG_EFSIF1_RXD *((REG_TYPE_8 *) (REG_BASE + 0xb11))
  336. #define REG_EFSIF1_STATUS *((REG_TYPE_8 *) (REG_BASE + 0xb12))
  337. #define REG_EFSIF1_CTL *((REG_TYPE_8 *) (REG_BASE + 0xb13))
  338. #define REG_EFSIF1_IRDA *((REG_TYPE_8 *) (REG_BASE + 0xb14))
  339. #define REG_EFSIF1_BRTRUN *((REG_TYPE_8 *) (REG_BASE + 0xb15))
  340. #define REG_EFSIF1_BRTRDL *((REG_TYPE_8 *) (REG_BASE + 0xb16))
  341. #define REG_EFSIF1_BRTRDM *((REG_TYPE_8 *) (REG_BASE + 0xb17))
  342. #define REG_EFSIF1_BRTCDL *((REG_TYPE_8 *) (REG_BASE + 0xb18))
  343. #define REG_EFSIF1_BRTCDM *((REG_TYPE_8 *) (REG_BASE + 0xb19))
  344. #define REG_EFSIF1_7816CTL *((REG_TYPE_8 *) (REG_BASE + 0xb1a))
  345. #define REG_EFSIF1_7816STA *((REG_TYPE_8 *) (REG_BASE + 0xb1b))
  346. #define REG_EFSIF1_FIDIL *((REG_TYPE_8 *) (REG_BASE + 0xb1c))
  347. #define REG_EFSIF1_FIDIM *((REG_TYPE_8 *) (REG_BASE + 0xb1d))
  348. #define REG_EFSIF1_TTGR *((REG_TYPE_8 *) (REG_BASE + 0xb1e))
  349. #define REG_EFSIF1_CLKNUM *((REG_TYPE_8 *) (REG_BASE + 0xb1f))
  350. #define REG_EFSIF2_TXD *((REG_TYPE_8 *) (REG_BASE + 0xb20))
  351. #define REG_EFSIF2_RXD *((REG_TYPE_8 *) (REG_BASE + 0xb21))
  352. #define REG_EFSIF2_STATUS *((REG_TYPE_8 *) (REG_BASE + 0xb22))
  353. #define REG_EFSIF2_CTL *((REG_TYPE_8 *) (REG_BASE + 0xb23))
  354. #define REG_EFSIF2_IRDA *((REG_TYPE_8 *) (REG_BASE + 0xb24))
  355. #define REG_EFSIF2_BRTRUN *((REG_TYPE_8 *) (REG_BASE + 0xb25))
  356. #define REG_EFSIF2_BRTRDL *((REG_TYPE_8 *) (REG_BASE + 0xb26))
  357. #define REG_EFSIF2_BRTRDM *((REG_TYPE_8 *) (REG_BASE + 0xb27))
  358. #define REG_EFSIF2_BRTCDL *((REG_TYPE_8 *) (REG_BASE + 0xb28))
  359. #define REG_EFSIF2_BRTCDM *((REG_TYPE_8 *) (REG_BASE + 0xb29))
  360. #define REG_EFSIF_ADV *((REG_TYPE_8 *) (REG_BASE + 0xb4f))
  361. /* Extended Ports */
  362. #define REG_PA_IOC *((REG_TYPE_8 *) (REG_BASE + 0xc00))
  363. #define REG_PA_DATA *((REG_TYPE_8 *) (REG_BASE + 0xc01))
  364. #define REG_PB_IOC *((REG_TYPE_8 *) (REG_BASE + 0xc02))
  365. #define REG_PB_DATA *((REG_TYPE_8 *) (REG_BASE + 0xc03))
  366. #define REG_PC_IOC *((REG_TYPE_8 *) (REG_BASE + 0xc04))
  367. #define REG_PC_DATA *((REG_TYPE_8 *) (REG_BASE + 0xc05))
  368. #define REG_PA_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0xc20))
  369. #define REG_PA_4_CFP *((REG_TYPE_8 *) (REG_BASE + 0xc21))
  370. #define REG_PB_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0xc22))
  371. #define REG_PC_03_CFP *((REG_TYPE_8 *) (REG_BASE + 0xc24))
  372. #define REG_PC_47_CFP *((REG_TYPE_8 *) (REG_BASE + 0xc25))
  373. /* Misc registers (2 */
  374. #define REG_MISC_BUSPUP *((REG_TYPE_8 *) (REG_BASE + 0xc40))
  375. #define REG_MISC_BUSLOW *((REG_TYPE_8 *) (REG_BASE + 0xc41))
  376. #define REG_MISC_PUP0 *((REG_TYPE_8 *) (REG_BASE + 0xc42))
  377. #define REG_MISC_PUP1 *((REG_TYPE_8 *) (REG_BASE + 0xc43))
  378. #define REG_MISC_PUP2 *((REG_TYPE_8 *) (REG_BASE + 0xc44))
  379. #define REG_MISC_PUP3 *((REG_TYPE_8 *) (REG_BASE + 0xc45))
  380. #define REG_MISC_PUP4 *((REG_TYPE_8 *) (REG_BASE + 0xc46))
  381. #define REG_MISC_PUP5 *((REG_TYPE_8 *) (REG_BASE + 0xc47))
  382. #define REG_MISC_PUP6 *((REG_TYPE_8 *) (REG_BASE + 0xc48))
  383. #define REG_MISC_PUP7 *((REG_TYPE_8 *) (REG_BASE + 0xc49))
  384. #define REG_MISC_PUP8 *((REG_TYPE_8 *) (REG_BASE + 0xc4a))
  385. #define REG_MISC_PUP9 *((REG_TYPE_8 *) (REG_BASE + 0xc4b))
  386. #define REG_MISC_PUPA *((REG_TYPE_8 *) (REG_BASE + 0xc4c))
  387. #define REG_MISC_PUPB *((REG_TYPE_8 *) (REG_BASE + 0xc4d))
  388. /* Intelligent DMA */
  389. #define REG_IDMABASE0 *((REG_TYPE_16 *) (REG_BASE + 0x1100))
  390. #define REG_IDMABASE1 *((REG_TYPE_16 *) (REG_BASE + 0x1102))
  391. #define REG_IDMA_START *((REG_TYPE_16 *) (REG_BASE + 0x1104))
  392. #define REG_IDMA_EN *((REG_TYPE_16 *) (REG_BASE + 0x1105))
  393. #define REG_HS0_CNT *((REG_TYPE_16 *) (REG_BASE + 0x1120))
  394. #define REG_HS0_CTRL *((REG_TYPE_16 *) (REG_BASE + 0x1122))
  395. #define REG_HS0_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1124))
  396. #define REG_HS0_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1126))
  397. #define REG_HS0_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1128))
  398. #define REG_HS0_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x112a))
  399. #define REG_HS0_EN *((REG_TYPE_16 *) (REG_BASE + 0x112c))
  400. #define REG_HS0_TF *((REG_TYPE_16 *) (REG_BASE + 0x112e))
  401. #define REG_HS1_CNT *((REG_TYPE_16 *) (REG_BASE + 0x1130))
  402. #define REG_HS1_CTRL *((REG_TYPE_16 *) (REG_BASE + 0x1132))
  403. #define REG_HS1_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1134))
  404. #define REG_HS1_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1136))
  405. #define REG_HS1_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1138))
  406. #define REG_HS1_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x113a))
  407. #define REG_HS1_EN *((REG_TYPE_16 *) (REG_BASE + 0x113c))
  408. #define REG_HS1_TF *((REG_TYPE_16 *) (REG_BASE + 0x113e))
  409. #define REG_HS2_CNT *((REG_TYPE_16 *) (REG_BASE + 0x1140))
  410. #define REG_HS2_CTRL *((REG_TYPE_16 *) (REG_BASE + 0x1142))
  411. #define REG_HS2_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1144))
  412. #define REG_HS2_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1146))
  413. #define REG_HS2_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1148))
  414. #define REG_HS2_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x114a))
  415. #define REG_HS2_EN *((REG_TYPE_16 *) (REG_BASE + 0x114c))
  416. #define REG_HS2_TF *((REG_TYPE_16 *) (REG_BASE + 0x114e))
  417. #define REG_HS3_CNT *((REG_TYPE_16 *) (REG_BASE + 0x1150))
  418. #define REG_HS3_CTRL *((REG_TYPE_16 *) (REG_BASE + 0x1152))
  419. #define REG_HS3_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1154))
  420. #define REG_HS3_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1156))
  421. #define REG_HS3_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1158))
  422. #define REG_HS3_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x115a))
  423. #define REG_HS3_EN *((REG_TYPE_16 *) (REG_BASE + 0x115c))
  424. #define REG_HS3_TF *((REG_TYPE_16 *) (REG_BASE + 0x115e))
  425. #define REG_HS0_ADVMODE *((REG_TYPE_16 *) (REG_BASE + 0x1162))
  426. #define REG_HS0_ADV_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1164))
  427. #define REG_HS0_ADV_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1166))
  428. #define REG_HS0_ADV_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1168))
  429. #define REG_HS0_ADV_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x116a))
  430. #define REG_HS1_ADVMODE *((REG_TYPE_16 *) (REG_BASE + 0x1172))
  431. #define REG_HS1_ADV_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1174))
  432. #define REG_HS1_ADV_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1176))
  433. #define REG_HS1_ADV_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1178))
  434. #define REG_HS1_ADV_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x117a))
  435. #define REG_HS2_ADVMODE *((REG_TYPE_16 *) (REG_BASE + 0x1182))
  436. #define REG_HS2_ADV_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1184))
  437. #define REG_HS2_ADV_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1186))
  438. #define REG_HS2_ADV_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1188))
  439. #define REG_HS2_ADV_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x118a))
  440. #define REG_HS3_ADVMODE *((REG_TYPE_16 *) (REG_BASE + 0x1192))
  441. #define REG_HS3_ADV_SADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1194))
  442. #define REG_HS3_ADV_SADR_H *((REG_TYPE_16 *) (REG_BASE + 0x1196))
  443. #define REG_HS3_ADV_DADR_L *((REG_TYPE_16 *) (REG_BASE + 0x1198))
  444. #define REG_HS3_ADV_DADR_H *((REG_TYPE_16 *) (REG_BASE + 0x119a))
  445. #define REG_HS_CNTLMODE *((REG_TYPE_16 *) (REG_BASE + 0x119c))
  446. #define REG_HS_ACCTIME *((REG_TYPE_16 *) (REG_BASE + 0x119e))
  447. /* SRAM Controller */
  448. #define REG_SRAMC_BCLK_SETUP *((REG_TYPE_32 *) (REG_BASE + 0x1500))
  449. #define REG_SRAMC_SWAIT *((REG_TYPE_32 *) (REG_BASE + 0x1504))
  450. #define REG_SRAMC_SLV_SIZE *((REG_TYPE_32 *) (REG_BASE + 0x1508))
  451. #define REG_SRAMC_A0_BSL *((REG_TYPE_32 *) (REG_BASE + 0x150c))
  452. #define REG_SRAMC_ALS *((REG_TYPE_32 *) (REG_BASE + 0x1510))
  453. /* SDRAM controller */
  454. #define REG_SDRAMC_INI *((REG_TYPE_32 *) (REG_BASE + 0x1600))
  455. #define REG_SDRAMC_CTL *((REG_TYPE_32 *) (REG_BASE + 0x1604))
  456. #define REG_SDRAMC_REF *((REG_TYPE_32 *) (REG_BASE + 0x1608))
  457. #define REG_SDRAMC_APP *((REG_TYPE_32 *) (REG_BASE + 0x1610))
  458. /* SPI */
  459. #define REG_SPI_RXD *((REG_TYPE_32 *) (REG_BASE + 0x1700))
  460. #define REG_SPI_TXD *((REG_TYPE_32 *) (REG_BASE + 0x1704))
  461. #define REG_SPI_CTL1 *((REG_TYPE_32 *) (REG_BASE + 0x1708))
  462. #define REG_SPI_CTL2 *((REG_TYPE_32 *) (REG_BASE + 0x170c))
  463. #define REG_SPI_WAIT *((REG_TYPE_32 *) (REG_BASE + 0x1710))
  464. #define REG_SPI_STAT *((REG_TYPE_32 *) (REG_BASE + 0x1714))
  465. #define REG_SPI_INT *((REG_TYPE_32 *) (REG_BASE + 0x1718))
  466. #define REG_SPI_RXMK *((REG_TYPE_32 *) (REG_BASE + 0x171c))
  467. /* DCSIO */
  468. #define REG_DCSIO_CTL *((REG_TYPE_32 *) (REG_BASE + 0x1800))
  469. #define REG_DCSIO_LOAD *((REG_TYPE_32 *) (REG_BASE + 0x1804))
  470. #define REG_DCSIO_RCV *((REG_TYPE_32 *) (REG_BASE + 0x1808))
  471. #define REG_DCSIO_INT *((REG_TYPE_32 *) (REG_BASE + 0x1814))
  472. #define REG_DCSIO_STAT *((REG_TYPE_32 *) (REG_BASE + 0x1818))
  473. #define REG_DCSIO_DIR *((REG_TYPE_32 *) (REG_BASE + 0x181c))
  474. /* Real Time Clock */
  475. #define REG_RTCINTSTAT *((REG_TYPE_32 *) (REG_BASE + 0x1900))
  476. #define REG_RTCINTMODE *((REG_TYPE_32 *) (REG_BASE + 0x1904))
  477. #define REG_RTC_CNTL0 *((REG_TYPE_32 *) (REG_BASE + 0x1908))
  478. #define REG_RTC_CNTL1 *((REG_TYPE_32 *) (REG_BASE + 0x190c))
  479. #define REG_RTCSEC *((REG_TYPE_32 *) (REG_BASE + 0x1910))
  480. #define REG_RTCMIN *((REG_TYPE_32 *) (REG_BASE + 0x1914))
  481. #define REG_RTCHOUR *((REG_TYPE_32 *) (REG_BASE + 0x1918))
  482. #define REG_RTCDAY *((REG_TYPE_32 *) (REG_BASE + 0x191c))
  483. #define REG_RTCMONTH *((REG_TYPE_32 *) (REG_BASE + 0x1920))
  484. #define REG_RTCYEAR *((REG_TYPE_32 *) (REG_BASE + 0x1924))
  485. #define REG_RTCDAYWEEK *((REG_TYPE_32 *) (REG_BASE + 0x1928))
  486. /* LCD Controller */
  487. #define REG_LCDC_INT *((REG_TYPE_32 *) (REG_BASE + 0x1a00))
  488. #define REG_LCDC_PS *((REG_TYPE_32 *) (REG_BASE + 0x1a04))
  489. #define REG_LCDC_HD *((REG_TYPE_32 *) (REG_BASE + 0x1a10))
  490. #define REG_LCDC_VD *((REG_TYPE_32 *) (REG_BASE + 0x1a14))
  491. #define REG_LCDC_MR *((REG_TYPE_32 *) (REG_BASE + 0x1a18))
  492. #define REG_LCDC_HDPS *((REG_TYPE_32 *) (REG_BASE + 0x1a20))
  493. #define REG_LCDC_VDPS *((REG_TYPE_32 *) (REG_BASE + 0x1a24))
  494. #define REG_LCDC_L *((REG_TYPE_32 *) (REG_BASE + 0x1a28))
  495. #define REG_LCDC_F *((REG_TYPE_32 *) (REG_BASE + 0x1a2c))
  496. #define REG_LCDC_FO *((REG_TYPE_32 *) (REG_BASE + 0x1a30))
  497. #define REG_LCDC_TSO *((REG_TYPE_32 *) (REG_BASE + 0x1a40))
  498. #define REG_LCDC_TC1 *((REG_TYPE_32 *) (REG_BASE + 0x1a44))
  499. #define REG_LCDC_TC0 *((REG_TYPE_32 *) (REG_BASE + 0x1a48))
  500. #define REG_LCDC_TC2 *((REG_TYPE_32 *) (REG_BASE + 0x1a4c))
  501. #define REG_LCDC_DMD *((REG_TYPE_32 *) (REG_BASE + 0x1a60))
  502. #define REG_LCDC_IRAM *((REG_TYPE_32 *) (REG_BASE + 0x1a64))
  503. #define REG_LCDC_MADD *((REG_TYPE_32 *) (REG_BASE + 0x1a70))
  504. #define REG_LCDC_MLADD *((REG_TYPE_32 *) (REG_BASE + 0x1a74))
  505. #define REG_LCDC_SADD *((REG_TYPE_32 *) (REG_BASE + 0x1a80))
  506. #define REG_LCDC_SSP *((REG_TYPE_32 *) (REG_BASE + 0x1a88))
  507. #define REG_LCDC_SEP *((REG_TYPE_32 *) (REG_BASE + 0x1a8c))
  508. #define REG_LCDC_LUT_03 *((REG_TYPE_32 *) (REG_BASE + 0x1aa0))
  509. #define REG_LCDC_LUT_47 *((REG_TYPE_32 *) (REG_BASE + 0x1aa4))
  510. #define REG_LCDC_LUT_8B *((REG_TYPE_32 *) (REG_BASE + 0x1aa8))
  511. #define REG_LCDC_LUT_CF *((REG_TYPE_32 *) (REG_BASE + 0x1aac))
  512. /* Clock Management Unit */
  513. #define REG_CMU_GATEDCLK0 *((REG_TYPE_32 *) (REG_BASE + 0x1b00))
  514. #define REG_CMU_GATEDCLK1 *((REG_TYPE_32 *) (REG_BASE + 0x1b04))
  515. #define REG_CMU_CLKCNTL *((REG_TYPE_32 *) (REG_BASE + 0x1b08))
  516. #define REG_CMU_PLL *((REG_TYPE_32 *) (REG_BASE + 0x1b0c))
  517. #define REG_CMU_SSCG *((REG_TYPE_32 *) (REG_BASE + 0x1b10))
  518. #define REG_CMU_OPT *((REG_TYPE_32 *) (REG_BASE + 0x1b14))
  519. #define REG_CMU_PROTECT *((REG_TYPE_32 *) (REG_BASE + 0x1b24))
  520. /* I2S interface */
  521. #define REG_I2S_CONTRL *((REG_TYPE_32 *) (REG_BASE + 0x1c00))
  522. #define REG_I2S_DV_MCLK *((REG_TYPE_32 *) (REG_BASE + 0x1c04))
  523. #define REG_I2S_DV_LRCLK *((REG_TYPE_32 *) (REG_BASE + 0x1c08))
  524. #define REG_I2S_START *((REG_TYPE_32 *) (REG_BASE + 0x1c0c))
  525. #define REG_I2S_HSDMAMD *((REG_TYPE_32 *) (REG_BASE + 0x1c10))
  526. #define REG_I2S_FIFO_EMPTY *((REG_TYPE_32 *) (REG_BASE + 0x1c14))
  527. #define REG_I2S_FIFO *((REG_TYPE_32 *) (REG_BASE + 0x1c20))
  528. /**********************************************************/
  529. /***** Below here are bit masks for various registers *****/
  530. /**********************************************************/
  531. /*
  532. * Clock Management Unit
  533. */
  534. // codes for: REG_CMU_PROTECT
  535. #define CMU_PROTECT_OFF 0x96
  536. #define CMU_PROTECT_ON 0x00
  537. // bits for: REG_CMU_CLKCNTL
  538. #define CMU_CLK_SEL_OSC3_DIV_32 (10 << 24)
  539. #define CMU_CLK_SEL_OSC3_DIV_16 (9 << 24)
  540. #define CMU_CLK_SEL_OSC3_DIV_8 (8 << 24)
  541. #define CMU_CLK_SEL_OSC3_DIV_4 (7 << 24)
  542. #define CMU_CLK_SEL_OSC3_DIV_2 (6 << 24)
  543. #define CMU_CLK_SEL_OSC3_DIV_1 (5 << 24)
  544. #define CMU_CLK_SEL_LCDC_CLK (4 << 24)
  545. #define CMU_CLK_SEL_MCLK (3 << 24)
  546. #define CMU_CLK_SEL_PLL (2 << 24)
  547. #define CMU_CLK_SEL_OSC1 (1 << 24)
  548. #define CMU_CLK_SEL_OSC3 (0 << 24)
  549. #define PLLINDIV_MASK (15 << 20)
  550. #define PLLINDIV_10 (9 << 20)
  551. #define PLLINDIV_9 (8 << 20)
  552. #define PLLINDIV_8 (7 << 20)
  553. #define PLLINDIV_7 (6 << 20)
  554. #define PLLINDIV_6 (5 << 20)
  555. #define PLLINDIV_5 (4 << 20)
  556. #define PLLINDIV_4 (3 << 20)
  557. #define PLLINDIV_3 (2 << 20)
  558. #define PLLINDIV_2 (1 << 20)
  559. #define PLLINDIV_1 (0 << 20)
  560. #define LCDCDIV_MASK (15 << 16)
  561. #define LCDCDIV_16 (15 << 16)
  562. #define LCDCDIV_15 (14 << 16)
  563. #define LCDCDIV_14 (13 << 16)
  564. #define LCDCDIV_13 (12 << 16)
  565. #define LCDCDIV_12 (11 << 16)
  566. #define LCDCDIV_11 (10 << 16)
  567. #define LCDCDIV_10 (9 << 16)
  568. #define LCDCDIV_9 (8 << 16)
  569. #define LCDCDIV_8 (7 << 16)
  570. #define LCDCDIV_7 (6 << 16)
  571. #define LCDCDIV_6 (5 << 16)
  572. #define LCDCDIV_5 (4 << 16)
  573. #define LCDCDIV_4 (3 << 16)
  574. #define LCDCDIV_3 (2 << 16)
  575. #define LCDCDIV_2 (1 << 16)
  576. #define LCDCDIV_1 (0 << 16)
  577. #define MCLKDIV (1 << 12)
  578. #define OSC3DIV_MASK (7 << 8)
  579. #define OSC3DIV_32 (5 << 8)
  580. #define OSC3DIV_16 (4 << 8)
  581. #define OSC3DIV_8 (3 << 8)
  582. #define OSC3DIV_4 (2 << 8)
  583. #define OSC3DIV_2 (1 << 8)
  584. #define OSC3DIV_1 (0 << 8)
  585. #define OSCSEL_MASK (3 << 2)
  586. #define OSCSEL_PLL (3 << 2)
  587. #define OSCSEL_OSC3x (2 << 2)
  588. #define OSCSEL_OSC1 (1 << 2)
  589. #define OSCSEL_OSC3 (0 << 2)
  590. #define SOSC3 (1 << 1)
  591. #define SOSC1 (1 << 0)
  592. // Bits for: REG_CMU_GATEDCLK0
  593. #define USBSAPB_CKE (1 << 9)
  594. #define USB_CKE (1 << 8)
  595. #define SDAPCPU_HCKE (1 << 7)
  596. #define SDAPCPU_CKE (1 << 6)
  597. #define SDAPLCDC_CKE (1 << 5)
  598. #define SDSAPB_CKE (1 << 4)
  599. #define DSTRAM_CKE (1 << 3)
  600. #define LCDCAHBIF_CKE (1 << 2)
  601. #define LCDCSAPB_CKE (1 << 1)
  602. #define LCDC_CKE (1 << 0)
  603. // Bits for: REG_CMU_GATEDCLK1
  604. #define CPUAHB_HCKE (1 << 29)
  605. #define LCDCAHB_HCKE (1 << 28)
  606. #define GPIONSTP_HCKE (1 << 27)
  607. #define SRAMC_HCKE (1 << 26)
  608. #define EFSIOBR_HCKE (1 << 25)
  609. #define MISC_HCKE (1 << 24)
  610. #define IVRAMARB_CKE (1 << 19)
  611. #define TM5_CKE (1 << 18)
  612. #define TM4_CKE (1 << 17)
  613. #define TM3_CKE (1 << 16)
  614. #define TM2_CKE (1 << 15)
  615. #define TM1_CKE (1 << 14)
  616. #define TM0_CKE (1 << 13)
  617. #define EGPIO_MISC_CK (1 << 12)
  618. #define I2S_CKE (1 << 11)
  619. #define DCSIO_CKE (1 << 10)
  620. #define WDT_CKE (1 << 9)
  621. #define GPIO_CKE (1 << 8)
  622. #define SRAMSAPB_CKE (1 << 7)
  623. #define SPI_CKE (1 << 6)
  624. #define EFSIOSAPB_CKE (1 << 5)
  625. #define CARD_CKE (1 << 4)
  626. #define ADC_CKE (1 << 3)
  627. #define ITC_CKE (1 << 2)
  628. #define DMA_CKE (1 << 1)
  629. #define RTCSAPB_CKE (1 << 0)
  630. // Bits for: REG_CMU_OPT
  631. #define OSCTM_SHIFT 8
  632. #define OSC3OFF (1 << 3)
  633. #define TMHSP (1 << 2)
  634. #define WAKEUPWT (1 << 0)
  635. /*
  636. * Serial Controller
  637. */
  638. // Bits for: REG_EFSIFx_STATUS
  639. #define RXDxNUM1 (1 << 7)
  640. #define RXDxNUM0 (1 << 6)
  641. #define TENDx (1 << 5)
  642. #define FERx (1 << 4)
  643. #define PERx (1 << 3)
  644. #define OERx (1 << 2)
  645. #define TDBEx (1 << 1)
  646. #define RDBFx (1 << 0)
  647. // Bits for: REG_EFSIFx_CTL
  648. #define TXENx (0x1 << 7)
  649. #define TX_DISENx (0x0 << 7)
  650. #define RXENx (0x1 << 6)
  651. #define RX_DISENx (0x0 << 6)
  652. #define PARx (0x1 << 5)
  653. #define NO_PARx (0x0 << 5)
  654. #define ODDx (0x1 << 4)
  655. #define EVENx (0x0 << 4)
  656. #define ONE_STPBx (0x1 << 3)
  657. #define TWO_STPBx (0x0 << 3)
  658. #define SCLKx (0x1 << 2)
  659. #define INT_CLKx (0x0 << 2)
  660. #define EIGHT_BIT_ASYNx 0x3
  661. #define SEVEN_BIT_ASYNx 0x2
  662. #define CLK_SLAVEx 0x1
  663. #define CLK_MASTERx 0x0
  664. // Bits for: REG_EFSIFx_IrDA
  665. #define DIVMD_8x (0x1 << 4)
  666. #define DIVMD_16x (0x0 << 4)
  667. #define IRMD_IRDAx (0x2 << 0)
  668. #define IRMD_GEN_IFx (0x0 << 0)
  669. // Bits for: REG_EFSIFx_BRTCTL
  670. #define BRTRUNx 0x1
  671. /*
  672. * Interrupt Controller
  673. */
  674. // Bits for: REG_INT_ESIF01
  675. #define ESTX1 (1 << 5)
  676. #define ESRX1 (1 << 4)
  677. #define ESERR1 (1 << 3)
  678. #define ESTX0 (1 << 2)
  679. #define ESRX0 (1 << 1)
  680. #define ESERR0 (1 << 0)
  681. // Bits for: REG_INT_FSIF01
  682. #define FSTX1 (1 << 5)
  683. #define FSRX1 (1 << 4)
  684. #define FSERR1 (1 << 3)
  685. #define FSTX0 (1 << 2)
  686. #define FSRX0 (1 << 1)
  687. #define FSERR0 (1 << 0)
  688. // Bits for: REG_RST_RESET
  689. #define DENONLY (1 << 2)
  690. #define IDMAONLY (1 << 1)
  691. #define RSTONLY (1 << 0)
  692. // Bits for: REG_INT_EK01_EP03
  693. #define EK1 (1 << 5)
  694. #define EK0 (1 << 4)
  695. #define EP3 (1 << 3)
  696. #define EP2 (1 << 2)
  697. #define EP1 (1 << 1)
  698. #define EP0 (1 << 0)
  699. // Bits for: INT_FK01_FP03
  700. #define FK1 (1 << 5)
  701. #define FK0 (1 << 4)
  702. #define FP3 (1 << 3)
  703. #define FP2 (1 << 2)
  704. #define FP1 (1 << 1)
  705. #define FP0 (1 << 0)
  706. /*
  707. * GPIO
  708. */
  709. // Bits for REG_PINTPOL_SPP07
  710. #define SPPT7 (1 << 7)
  711. #define SPPT6 (1 << 6)
  712. #define SPPT5 (1 << 5)
  713. #define SPPT4 (1 << 4)
  714. #define SPPT3 (1 << 3)
  715. #define SPPT2 (1 << 2)
  716. #define SPPT1 (1 << 1)
  717. #define SPPT0 (1 << 0)
  718. // Bits for REG_PINTPOL_SPP815
  719. #define SPPTF (1 << 7)
  720. #define SPPTE (1 << 6)
  721. #define SPPTD (1 << 5)
  722. #define SPPTC (1 << 4)
  723. #define SPPTB (1 << 3)
  724. #define SPPTA (1 << 2)
  725. #define SPPT9 (1 << 1)
  726. #define SPPT8 (1 << 0)
  727. // Bits for REG_PINTEL_SEPT07
  728. #define SEPT7 (1 << 7)
  729. #define SEPT6 (1 << 6)
  730. #define SEPT5 (1 << 5)
  731. #define SEPT4 (1 << 4)
  732. #define SEPT3 (1 << 3)
  733. #define SEPT2 (1 << 2)
  734. #define SEPT1 (1 << 1)
  735. #define SEPT0 (1 << 0)
  736. // Bits for REG_PINTEL_SEPT815
  737. #define SEPTF (1 << 7)
  738. #define SEPTE (1 << 6)
  739. #define SEPTD (1 << 5)
  740. #define SEPTC (1 << 4)
  741. #define SEPTB (1 << 3)
  742. #define SEPTA (1 << 2)
  743. #define SEPT9 (1 << 1)
  744. #define SEPT8 (1 << 0)
  745. /*
  746. * SDRAM Controller
  747. */
  748. // bits for: REG_SDRAMC_CTL
  749. #define T24NS_SHIFT 12
  750. #define T60NS_SHIFT 8
  751. #define T80NS_SHIFT 4
  752. #define ADDRC_32M_x_16_bits_x_1 0x7
  753. #define ADDRC_16M_x__8_bits_x_2 0x6
  754. #define ADDRC__8M_x__8_bits_x_2 0x5
  755. #define ADDRC__2M_x__8_bits_x_2 0x4
  756. #define ADDRC_16M_x_16_bits_x_1 0x3
  757. #define ADDRC__8M_x_16_bits_x_1 0x2
  758. #define ADDRC__4M_x_16_bits_x_1 0x1
  759. #define ADDRC__1M_x_16_bits_x_1 0x0
  760. #define ADDRC_MASK 0x07
  761. // Bits for: REG_SDRAMC_REF
  762. #define SELDO (1 << 25)
  763. #define SCKON (1 << 24)
  764. #define SELEN (1 << 23)
  765. #define SELCO_SHIFT 16
  766. #define AURCO_SHIFT 0
  767. // Bits for: REG_SDRAMC_INI
  768. #define SDON (1 << 4)
  769. #define SDEN (1 << 3)
  770. #define INIMRS (1 << 2)
  771. #define INIPRE (1 << 1)
  772. #define INIREF (1 << 0)
  773. // SDRAM controller commands for REG_SDRAMC_INI
  774. #define SDRAM_CMD_FIRST (SDON)
  775. #define SDRAM_CMD_FINAL (SDON)
  776. #define SDRAM_CMD_REF (SDON | INIREF)
  777. #define SDRAM_CMD_PALL (SDON | INIPRE)
  778. #define SDRAM_CMD_MRS (SDON | INIMRS)
  779. // Bits for: REG_SDRAMC_APP
  780. #define ARBON (1 << 31)
  781. #define DBF (1 << 5)
  782. #define INCR (1 << 4)
  783. #define CAS1 (1 << 3)
  784. #define CAS0 (1 << 2)
  785. #define APPON (1 << 1)
  786. #define IQB (1 << 0)
  787. // Bits for: REG_CH1_INT_PRIORITY
  788. #define SERIAL_CH1_INT_PRI_7 0x7
  789. #define SERIAL_CH1_INT_PRI_6 0x6
  790. #define SERIAL_CH1_INT_PRI_5 0x5
  791. #define SERIAL_CH1_INT_PRI_4 0x4
  792. #define SERIAL_CH1_INT_PRI_3 0x3
  793. #define SERIAL_CH1_INT_PRI_2 0x2
  794. #define SERIAL_CH1_INT_PRI_1 0x1
  795. #define SERIAL_CH1_INT_PRI_0 0x0
  796. /*
  797. * LCD controller
  798. */
  799. // Bits for: REG_LCDC_PS
  800. #define INTF (1 << 31)
  801. #define VNDPF (1 << 7)
  802. #define PSAVE_NORMAL (3 << 0)
  803. #define PSAVE_DOZE (2 << 0)
  804. #define PSAVE_POWER_SAVE (0 << 0)
  805. // Bits for: REG_LCDC_HD
  806. #define HTCNT_SHIFT 16
  807. #define HDPCNT_SHIFT 0
  808. // Bits for: REG_LCDC_VD
  809. #define VTCNT_SHIFT 16
  810. #define VDPCNT_SHIFT 0
  811. // Bits for: REG_LCDC_DMD
  812. #define TFTSEL (1 << 31)
  813. #define COLOR (1 << 30)
  814. #define FPSMASK (1 << 29)
  815. #define DWD_8_BIT_2 (3 << 26)
  816. #define DWD_8_BIT_1 (1 << 26)
  817. #define DWD_4_BIT (0 << 26)
  818. #define SWINV (1 << 25)
  819. #define BLANK (1 << 24)
  820. #define FRMRPT (1 << 7)
  821. #define DITHEN (1 << 6)
  822. #define LUTPASS (1 << 4)
  823. #define BPP_16 (5 << 0)
  824. #define BPP_12 (4 << 0)
  825. #define BPP_8 (3 << 0)
  826. #define BPP_4 (2 << 0)
  827. #define BPP_2 (1 << 0)
  828. #define BPP_1 (0 << 0)
  829. // Bits for: REG_LCDC_SSP
  830. #define PIPEN (1 << 31)
  831. #define PIPYST_SHIFT 16
  832. #define PIPYST_MASK (0x3ff << 16)
  833. #define PIPXST_SHIFT 0
  834. #define PIPXST_MASK (0x3ff << 0)
  835. // Bits for: REG_LCDC_SEP
  836. #define PIPYEND_SHIFT 16
  837. #define PIPYEND_MASK (0x3ff << 16)
  838. #define PIPXEND_SHIFT 0
  839. #define PIPXEND_MASK (0x3ff << 0)
  840. /*
  841. * Timers
  842. */
  843. // Bits for: REG_T16_ADVMODE
  844. #define T16ADV (1 << 0)
  845. // Bits for: REG_T16_CNT_PAUSE
  846. #define PAUSE5 (1 << 5)
  847. #define PAUSE4 (1 << 4)
  848. #define PAUSE3 (1 << 3)
  849. #define PAUSE2 (1 << 2)
  850. #define PAUSE1 (1 << 1)
  851. #define PAUSE0 (1 << 0)
  852. // Bits for: REG_T16_CTLx
  853. #define INITOLx (1 << 8)
  854. //#define (TMODEx) (1 << 7) - reserved, do not set to 1
  855. #define SELFMx (1 << 6)
  856. #define SELCRBx (1 << 5)
  857. #define OUTINVx (1 << 4)
  858. #define CKSLx (1 << 3)
  859. #define PTMx (1 << 2)
  860. #define PRESETx (1 << 1)
  861. #define PRUNx (1 << 0)
  862. // Bits for: REG_T16_CLKCTL_x
  863. #define P16TONx (1 << 3)
  864. #define P16TSx_MCLK_DIV_4096 (7 << 0)
  865. #define P16TSx_MCLK_DIV_1024 (6 << 0)
  866. #define P16TSx_MCLK_DIV_256 (5 << 0)
  867. #define P16TSx_MCLK_DIV_64 (4 << 0)
  868. #define P16TSx_MCLK_DIV_16 (3 << 0)
  869. #define P16TSx_MCLK_DIV_4 (2 << 0)
  870. #define P16TSx_MCLK_DIV_2 (1 << 0)
  871. #define P16TSx_MCLK_DIV_1 (0 << 0)
  872. // Bits for: REG_INT_E16T01
  873. #define E16TC1 (1 << 7)
  874. #define E16TU1 (1 << 6)
  875. #define E16TC0 (1 << 3)
  876. #define E16TU0 (1 << 2)
  877. // Bits for: REG_INT_E16T23
  878. #define E16TC3 (1 << 7)
  879. #define E16TU3 (1 << 6)
  880. #define E16TC2 (1 << 3)
  881. #define E16TU2 (1 << 2)
  882. // Bits for: REG_INT_E16T45
  883. #define E16TC5 (1 << 7)
  884. #define E16TU5 (1 << 6)
  885. #define E16TC4 (1 << 3)
  886. #define E16TU4 (1 << 2)
  887. // Bits for: REG_INT_F16T01
  888. #define F16TC1 (1 << 7)
  889. #define F16TU1 (1 << 6)
  890. #define F16TC0 (1 << 3)
  891. #define F16TU0 (1 << 2)
  892. // Bits for: REG_INT_F16T23
  893. #define F16TC3 (1 << 7)
  894. #define F16TU3 (1 << 6)
  895. #define F16TC2 (1 << 3)
  896. #define F16TU2 (1 << 2)
  897. // Bits for: REG_INT_F16T45
  898. #define F16TC5 (1 << 7)
  899. #define F16TU5 (1 << 6)
  900. #define F16TC4 (1 << 3)
  901. #define F16TU4 (1 << 2)
  902. /*
  903. * watchdog
  904. */
  905. // Bits for: REG_WD_WP
  906. #define WD_WP_OFF 0x96
  907. #define WD_WP_ON 0x00
  908. // Bits for: REG_WD_EN
  909. #define CLKSEL (1 << 6)
  910. #define CLKEN (1 << 5)
  911. #define RUNSTP (1 << 4)
  912. #define NMIEN (1 << 1)
  913. #define RESEN (1 << 0)
  914. // Bits for: REG_WD_CNTL
  915. #define WDRESEN (1 << 0)
  916. /*
  917. * SPI module
  918. */
  919. // Bits for: REG_SPI_CTL1
  920. #define BPT_32_BITS (31 << 10)
  921. #define BPT_16_BITS (15 << 10)
  922. #define BPT_8_BITS ( 7 << 10)
  923. #define BPT_1_BITS ( 0 << 10)
  924. #define CPHA (1 << 9)
  925. #define CPOL (1 << 8)
  926. #define MCBR_MCLK_DIV_512 (7 << 4)
  927. #define MCBR_MCLK_DIV_256 (6 << 4)
  928. #define MCBR_MCLK_DIV_128 (5 << 4)
  929. #define MCBR_MCLK_DIV_64 (4 << 4)
  930. #define MCBR_MCLK_DIV_32 (3 << 4)
  931. #define MCBR_MCLK_DIV_16 (2 << 4)
  932. #define MCBR_MCLK_DIV_8 (1 << 4)
  933. #define MCBR_MCLK_DIV_4 (0 << 4)
  934. #define TXDE (1 << 3)
  935. #define RXDE (1 << 2)
  936. #define MODE_MASTER (1 << 1)
  937. #define MODE_SLAVE (0 << 1)
  938. #define ENA (1 << 0)
  939. // Bits for: REG_SPI_STAT
  940. #define BSYF (1 << 6)
  941. #define MFEF (1 << 5)
  942. #define TDEF (1 << 4)
  943. #define RDOF (1 << 3)
  944. #define RDFF (1 << 2)
  945. // Bits for REG_HS_CNTLMODE
  946. #define HSDMAADV (1 << 0)
  947. // Bits for DMA advanced channels
  948. #define DMA_ENABLED (1 << 0)
  949. #define DMA_DISABLED (0 << 0)
  950. #endif /* REGS_H */