regs.h 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  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_MASK (0x3f << 24)
  539. #define CMU_CLK_SEL_OSC3_DIV_32 (10 << 24)
  540. #define CMU_CLK_SEL_OSC3_DIV_16 (9 << 24)
  541. #define CMU_CLK_SEL_OSC3_DIV_8 (8 << 24)
  542. #define CMU_CLK_SEL_OSC3_DIV_4 (7 << 24)
  543. #define CMU_CLK_SEL_OSC3_DIV_2 (6 << 24)
  544. #define CMU_CLK_SEL_OSC3_DIV_1 (5 << 24)
  545. #define CMU_CLK_SEL_LCDC_CLK (4 << 24)
  546. #define CMU_CLK_SEL_MCLK (3 << 24)
  547. #define CMU_CLK_SEL_PLL (2 << 24)
  548. #define CMU_CLK_SEL_OSC1 (1 << 24)
  549. #define CMU_CLK_SEL_OSC3 (0 << 24)
  550. #define PLLINDIV_MASK (15 << 20)
  551. #define PLLINDIV_10 (9 << 20)
  552. #define PLLINDIV_9 (8 << 20)
  553. #define PLLINDIV_8 (7 << 20)
  554. #define PLLINDIV_7 (6 << 20)
  555. #define PLLINDIV_6 (5 << 20)
  556. #define PLLINDIV_5 (4 << 20)
  557. #define PLLINDIV_4 (3 << 20)
  558. #define PLLINDIV_3 (2 << 20)
  559. #define PLLINDIV_2 (1 << 20)
  560. #define PLLINDIV_1 (0 << 20)
  561. #define LCDCDIV_MASK (15 << 16)
  562. #define LCDCDIV_16 (15 << 16)
  563. #define LCDCDIV_15 (14 << 16)
  564. #define LCDCDIV_14 (13 << 16)
  565. #define LCDCDIV_13 (12 << 16)
  566. #define LCDCDIV_12 (11 << 16)
  567. #define LCDCDIV_11 (10 << 16)
  568. #define LCDCDIV_10 (9 << 16)
  569. #define LCDCDIV_9 (8 << 16)
  570. #define LCDCDIV_8 (7 << 16)
  571. #define LCDCDIV_7 (6 << 16)
  572. #define LCDCDIV_6 (5 << 16)
  573. #define LCDCDIV_5 (4 << 16)
  574. #define LCDCDIV_4 (3 << 16)
  575. #define LCDCDIV_3 (2 << 16)
  576. #define LCDCDIV_2 (1 << 16)
  577. #define LCDCDIV_1 (0 << 16)
  578. #define MCLKDIV (1 << 12)
  579. #define OSC3DIV_MASK (7 << 8)
  580. #define OSC3DIV_32 (5 << 8)
  581. #define OSC3DIV_16 (4 << 8)
  582. #define OSC3DIV_8 (3 << 8)
  583. #define OSC3DIV_4 (2 << 8)
  584. #define OSC3DIV_2 (1 << 8)
  585. #define OSC3DIV_1 (0 << 8)
  586. #define OSCSEL_MASK (3 << 2)
  587. #define OSCSEL_PLL (3 << 2)
  588. #define OSCSEL_OSC3x (2 << 2)
  589. #define OSCSEL_OSC1 (1 << 2)
  590. #define OSCSEL_OSC3 (0 << 2)
  591. #define SOSC3 (1 << 1)
  592. #define SOSC1 (1 << 0)
  593. // Bits for: REG_CMU_GATEDCLK0
  594. #define USBSAPB_CKE (1 << 9)
  595. #define USB_CKE (1 << 8)
  596. #define SDAPCPU_HCKE (1 << 7)
  597. #define SDAPCPU_CKE (1 << 6)
  598. #define SDAPLCDC_CKE (1 << 5)
  599. #define SDSAPB_CKE (1 << 4)
  600. #define DSTRAM_CKE (1 << 3)
  601. #define LCDCAHBIF_CKE (1 << 2)
  602. #define LCDCSAPB_CKE (1 << 1)
  603. #define LCDC_CKE (1 << 0)
  604. // Bits for: REG_CMU_GATEDCLK1
  605. #define CPUAHB_HCKE (1 << 29)
  606. #define LCDCAHB_HCKE (1 << 28)
  607. #define GPIONSTP_HCKE (1 << 27)
  608. #define SRAMC_HCKE (1 << 26)
  609. #define EFSIOBR_HCKE (1 << 25)
  610. #define MISC_HCKE (1 << 24)
  611. #define IVRAMARB_CKE (1 << 19)
  612. #define TM5_CKE (1 << 18)
  613. #define TM4_CKE (1 << 17)
  614. #define TM3_CKE (1 << 16)
  615. #define TM2_CKE (1 << 15)
  616. #define TM1_CKE (1 << 14)
  617. #define TM0_CKE (1 << 13)
  618. #define EGPIO_MISC_CK (1 << 12)
  619. #define I2S_CKE (1 << 11)
  620. #define DCSIO_CKE (1 << 10)
  621. #define WDT_CKE (1 << 9)
  622. #define GPIO_CKE (1 << 8)
  623. #define SRAMSAPB_CKE (1 << 7)
  624. #define SPI_CKE (1 << 6)
  625. #define EFSIOSAPB_CKE (1 << 5)
  626. #define CARD_CKE (1 << 4)
  627. #define ADC_CKE (1 << 3)
  628. #define ITC_CKE (1 << 2)
  629. #define DMA_CKE (1 << 1)
  630. #define RTCSAPB_CKE (1 << 0)
  631. // Bits for: REG_CMU_OPT
  632. #define OSCTM_SHIFT 8
  633. #define OSC3OFF (1 << 3)
  634. #define TMHSP (1 << 2)
  635. #define WAKEUPWT (1 << 0)
  636. // Bits for: REG_CMU_PLL
  637. #define PLLCS (0 << 22)
  638. #define PLLBYP (0 << 21)
  639. #define PLLCP (0x10 << 16)
  640. #define PLLVC_360MHz_400MHz (8 << 12)
  641. #define PLLVC_320MHz_360MHz (7 << 12)
  642. #define PLLVC_280MHz_320MHz (6 << 12)
  643. #define PLLVC_240MHz_280MHz (5 << 12)
  644. #define PLLVC_200MHz_240MHz (4 << 12)
  645. #define PLLVC_160MHz_200MHz (3 << 12)
  646. #define PLLVC_120MHz_160MHz (2 << 12)
  647. #define PLLVC_100MHz_120MHz (1 << 12)
  648. #define PLLRS_5MHz_20MHz (10 << 8)
  649. #define PLLRS_20MHz_150MHz ( 8 << 8)
  650. #define PLLN_X16 (15 << 4)
  651. #define PLLN_X15 (14 << 4)
  652. #define PLLN_X14 (13 << 4)
  653. #define PLLN_X13 (12 << 4)
  654. #define PLLN_X12 (11 << 4)
  655. #define PLLN_X11 (10 << 4)
  656. #define PLLN_X10 ( 9 << 4)
  657. #define PLLN_X9 ( 8 << 4)
  658. #define PLLN_X8 ( 7 << 4)
  659. #define PLLN_X7 ( 6 << 4)
  660. #define PLLN_X6 ( 5 << 4)
  661. #define PLLN_X5 ( 4 << 4)
  662. #define PLLN_X4 ( 3 << 4)
  663. #define PLLN_X3 ( 2 << 4)
  664. #define PLLN_X2 ( 1 << 4)
  665. #define PLLN_X1 ( 0 << 4)
  666. #define PLLV_DIV_8 (3 << 2)
  667. #define PLLV_DIV_4 (2 << 2)
  668. #define PLLV_DIV_2 (1 << 2)
  669. #define PLLPOWR (1 << 0)
  670. /*
  671. * Serial Controller
  672. */
  673. // Bits for: REG_EFSIFx_STATUS
  674. #define RXDxNUM1 (1 << 7)
  675. #define RXDxNUM0 (1 << 6)
  676. #define TENDx (1 << 5)
  677. #define FERx (1 << 4)
  678. #define PERx (1 << 3)
  679. #define OERx (1 << 2)
  680. #define TDBEx (1 << 1)
  681. #define RDBFx (1 << 0)
  682. // Bits for: REG_EFSIFx_CTL
  683. #define TXENx (0x1 << 7)
  684. #define TX_DISENx (0x0 << 7)
  685. #define RXENx (0x1 << 6)
  686. #define RX_DISENx (0x0 << 6)
  687. #define PARx (0x1 << 5)
  688. #define NO_PARx (0x0 << 5)
  689. #define ODDx (0x1 << 4)
  690. #define EVENx (0x0 << 4)
  691. #define ONE_STPBx (0x1 << 3)
  692. #define TWO_STPBx (0x0 << 3)
  693. #define SCLKx (0x1 << 2)
  694. #define INT_CLKx (0x0 << 2)
  695. #define EIGHT_BIT_ASYNx 0x3
  696. #define SEVEN_BIT_ASYNx 0x2
  697. #define CLK_SLAVEx 0x1
  698. #define CLK_MASTERx 0x0
  699. // Bits for: REG_EFSIFx_IrDA
  700. #define DIVMD_8x (0x1 << 4)
  701. #define DIVMD_16x (0x0 << 4)
  702. #define IRMD_IRDAx (0x2 << 0)
  703. #define IRMD_GEN_IFx (0x0 << 0)
  704. // Bits for: REG_EFSIFx_BRTCTL
  705. #define BRTRUNx 0x1
  706. /*
  707. * Interrupt Controller
  708. */
  709. // Bits for: REG_INT_ESIF01
  710. #define ESTX1 (1 << 5)
  711. #define ESRX1 (1 << 4)
  712. #define ESERR1 (1 << 3)
  713. #define ESTX0 (1 << 2)
  714. #define ESRX0 (1 << 1)
  715. #define ESERR0 (1 << 0)
  716. // Bits for: REG_INT_FSIF01
  717. #define FSTX1 (1 << 5)
  718. #define FSRX1 (1 << 4)
  719. #define FSERR1 (1 << 3)
  720. #define FSTX0 (1 << 2)
  721. #define FSRX0 (1 << 1)
  722. #define FSERR0 (1 << 0)
  723. // Bits for: REG_RST_RESET
  724. #define DENONLY (1 << 2)
  725. #define IDMAONLY (1 << 1)
  726. #define RSTONLY (1 << 0)
  727. // Bits for: REG_INT_EK01_EP03
  728. #define EK1 (1 << 5)
  729. #define EK0 (1 << 4)
  730. #define EP3 (1 << 3)
  731. #define EP2 (1 << 2)
  732. #define EP1 (1 << 1)
  733. #define EP0 (1 << 0)
  734. // Bits for: INT_FK01_FP03
  735. #define FK1 (1 << 5)
  736. #define FK0 (1 << 4)
  737. #define FP3 (1 << 3)
  738. #define FP2 (1 << 2)
  739. #define FP1 (1 << 1)
  740. #define FP0 (1 << 0)
  741. /*
  742. * GPIO
  743. */
  744. // Bits for REG_PINTPOL_SPP07
  745. #define SPPT7 (1 << 7)
  746. #define SPPT6 (1 << 6)
  747. #define SPPT5 (1 << 5)
  748. #define SPPT4 (1 << 4)
  749. #define SPPT3 (1 << 3)
  750. #define SPPT2 (1 << 2)
  751. #define SPPT1 (1 << 1)
  752. #define SPPT0 (1 << 0)
  753. // Bits for REG_PINTPOL_SPP815
  754. #define SPPTF (1 << 7)
  755. #define SPPTE (1 << 6)
  756. #define SPPTD (1 << 5)
  757. #define SPPTC (1 << 4)
  758. #define SPPTB (1 << 3)
  759. #define SPPTA (1 << 2)
  760. #define SPPT9 (1 << 1)
  761. #define SPPT8 (1 << 0)
  762. // Bits for REG_PINTEL_SEPT07
  763. #define SEPT7 (1 << 7)
  764. #define SEPT6 (1 << 6)
  765. #define SEPT5 (1 << 5)
  766. #define SEPT4 (1 << 4)
  767. #define SEPT3 (1 << 3)
  768. #define SEPT2 (1 << 2)
  769. #define SEPT1 (1 << 1)
  770. #define SEPT0 (1 << 0)
  771. // Bits for REG_PINTEL_SEPT815
  772. #define SEPTF (1 << 7)
  773. #define SEPTE (1 << 6)
  774. #define SEPTD (1 << 5)
  775. #define SEPTC (1 << 4)
  776. #define SEPTB (1 << 3)
  777. #define SEPTA (1 << 2)
  778. #define SEPT9 (1 << 1)
  779. #define SEPT8 (1 << 0)
  780. /*
  781. * SDRAM Controller
  782. */
  783. // bits for: REG_SDRAMC_CTL
  784. #define T24NS_SHIFT 12
  785. #define T60NS_SHIFT 8
  786. #define T80NS_SHIFT 4
  787. #define ADDRC_32M_x_16_bits_x_1 0x7
  788. #define ADDRC_16M_x__8_bits_x_2 0x6
  789. #define ADDRC__8M_x__8_bits_x_2 0x5
  790. #define ADDRC__2M_x__8_bits_x_2 0x4
  791. #define ADDRC_16M_x_16_bits_x_1 0x3
  792. #define ADDRC__8M_x_16_bits_x_1 0x2
  793. #define ADDRC__4M_x_16_bits_x_1 0x1
  794. #define ADDRC__1M_x_16_bits_x_1 0x0
  795. #define ADDRC_MASK 0x07
  796. // Bits for: REG_SDRAMC_REF
  797. #define SELDO (1 << 25)
  798. #define SCKON (1 << 24)
  799. #define SELEN (1 << 23)
  800. #define SELCO_SHIFT 16
  801. #define AURCO_SHIFT 0
  802. // Bits for: REG_SDRAMC_INI
  803. #define SDON (1 << 4)
  804. #define SDEN (1 << 3)
  805. #define INIMRS (1 << 2)
  806. #define INIPRE (1 << 1)
  807. #define INIREF (1 << 0)
  808. // SDRAM controller commands for REG_SDRAMC_INI
  809. #define SDRAM_CMD_FIRST (SDON)
  810. #define SDRAM_CMD_FINAL (SDON)
  811. #define SDRAM_CMD_REF (SDON | INIREF)
  812. #define SDRAM_CMD_PALL (SDON | INIPRE)
  813. #define SDRAM_CMD_MRS (SDON | INIMRS)
  814. // Bits for: REG_SDRAMC_APP
  815. #define ARBON (1 << 31)
  816. #define DBF (1 << 5)
  817. #define INCR (1 << 4)
  818. #define CAS1 (1 << 3)
  819. #define CAS0 (1 << 2)
  820. #define APPON (1 << 1)
  821. #define IQB (1 << 0)
  822. // Bits for: REG_CH1_INT_PRIORITY
  823. #define SERIAL_CH1_INT_PRI_7 0x7
  824. #define SERIAL_CH1_INT_PRI_6 0x6
  825. #define SERIAL_CH1_INT_PRI_5 0x5
  826. #define SERIAL_CH1_INT_PRI_4 0x4
  827. #define SERIAL_CH1_INT_PRI_3 0x3
  828. #define SERIAL_CH1_INT_PRI_2 0x2
  829. #define SERIAL_CH1_INT_PRI_1 0x1
  830. #define SERIAL_CH1_INT_PRI_0 0x0
  831. /*
  832. * LCD controller
  833. */
  834. // Bits for: REG_LCDC_PS
  835. #define INTF (1 << 31)
  836. #define VNDPF (1 << 7)
  837. #define PSAVE_NORMAL (3 << 0)
  838. #define PSAVE_DOZE (2 << 0)
  839. #define PSAVE_POWER_SAVE (0 << 0)
  840. // Bits for: REG_LCDC_HD
  841. #define HTCNT_SHIFT 16
  842. #define HDPCNT_SHIFT 0
  843. // Bits for: REG_LCDC_VD
  844. #define VTCNT_SHIFT 16
  845. #define VDPCNT_SHIFT 0
  846. // Bits for: REG_LCDC_DMD
  847. #define TFTSEL (1 << 31)
  848. #define COLOR (1 << 30)
  849. #define FPSMASK (1 << 29)
  850. #define DWD_8_BIT_2 (3 << 26)
  851. #define DWD_8_BIT_1 (1 << 26)
  852. #define DWD_4_BIT (0 << 26)
  853. #define SWINV (1 << 25)
  854. #define BLANK (1 << 24)
  855. #define FRMRPT (1 << 7)
  856. #define DITHEN (1 << 6)
  857. #define LUTPASS (1 << 4)
  858. #define BPP_16 (5 << 0)
  859. #define BPP_12 (4 << 0)
  860. #define BPP_8 (3 << 0)
  861. #define BPP_4 (2 << 0)
  862. #define BPP_2 (1 << 0)
  863. #define BPP_1 (0 << 0)
  864. // Bits for: REG_LCDC_SSP
  865. #define PIPEN (1 << 31)
  866. #define PIPYST_SHIFT 16
  867. #define PIPYST_MASK (0x3ff << 16)
  868. #define PIPXST_SHIFT 0
  869. #define PIPXST_MASK (0x3ff << 0)
  870. // Bits for: REG_LCDC_SEP
  871. #define PIPYEND_SHIFT 16
  872. #define PIPYEND_MASK (0x3ff << 16)
  873. #define PIPXEND_SHIFT 0
  874. #define PIPXEND_MASK (0x3ff << 0)
  875. /*
  876. * Timers
  877. */
  878. // Bits for: REG_T16_ADVMODE
  879. #define T16ADV (1 << 0)
  880. // Bits for: REG_T16_CNT_PAUSE
  881. #define PAUSE5 (1 << 5)
  882. #define PAUSE4 (1 << 4)
  883. #define PAUSE3 (1 << 3)
  884. #define PAUSE2 (1 << 2)
  885. #define PAUSE1 (1 << 1)
  886. #define PAUSE0 (1 << 0)
  887. // Bits for: REG_T16_CTLx
  888. #define INITOLx (1 << 8)
  889. //#define (TMODEx) (1 << 7) - reserved, do not set to 1
  890. #define SELFMx (1 << 6)
  891. #define SELCRBx (1 << 5)
  892. #define OUTINVx (1 << 4)
  893. #define CKSLx (1 << 3)
  894. #define PTMx (1 << 2)
  895. #define PRESETx (1 << 1)
  896. #define PRUNx (1 << 0)
  897. // Bits for: REG_T16_CLKCTL_x
  898. #define P16TONx (1 << 3)
  899. #define P16TSx_MCLK_DIV_4096 (7 << 0)
  900. #define P16TSx_MCLK_DIV_1024 (6 << 0)
  901. #define P16TSx_MCLK_DIV_256 (5 << 0)
  902. #define P16TSx_MCLK_DIV_64 (4 << 0)
  903. #define P16TSx_MCLK_DIV_16 (3 << 0)
  904. #define P16TSx_MCLK_DIV_4 (2 << 0)
  905. #define P16TSx_MCLK_DIV_2 (1 << 0)
  906. #define P16TSx_MCLK_DIV_1 (0 << 0)
  907. // Bits for: REG_INT_E16T01
  908. #define E16TC1 (1 << 7)
  909. #define E16TU1 (1 << 6)
  910. #define E16TC0 (1 << 3)
  911. #define E16TU0 (1 << 2)
  912. // Bits for: REG_INT_E16T23
  913. #define E16TC3 (1 << 7)
  914. #define E16TU3 (1 << 6)
  915. #define E16TC2 (1 << 3)
  916. #define E16TU2 (1 << 2)
  917. // Bits for: REG_INT_E16T45
  918. #define E16TC5 (1 << 7)
  919. #define E16TU5 (1 << 6)
  920. #define E16TC4 (1 << 3)
  921. #define E16TU4 (1 << 2)
  922. // Bits for: REG_INT_F16T01
  923. #define F16TC1 (1 << 7)
  924. #define F16TU1 (1 << 6)
  925. #define F16TC0 (1 << 3)
  926. #define F16TU0 (1 << 2)
  927. // Bits for: REG_INT_F16T23
  928. #define F16TC3 (1 << 7)
  929. #define F16TU3 (1 << 6)
  930. #define F16TC2 (1 << 3)
  931. #define F16TU2 (1 << 2)
  932. // Bits for: REG_INT_F16T45
  933. #define F16TC5 (1 << 7)
  934. #define F16TU5 (1 << 6)
  935. #define F16TC4 (1 << 3)
  936. #define F16TU4 (1 << 2)
  937. /*
  938. * watchdog
  939. */
  940. // Bits for: REG_WD_WP
  941. #define WD_WP_OFF 0x96
  942. #define WD_WP_ON 0x00
  943. // Bits for: REG_WD_EN
  944. #define CLKSEL (1 << 6)
  945. #define CLKEN (1 << 5)
  946. #define RUNSTP (1 << 4)
  947. #define NMIEN (1 << 1)
  948. #define RESEN (1 << 0)
  949. // Bits for: REG_WD_CNTL
  950. #define WDRESEN (1 << 0)
  951. /*
  952. * SPI module
  953. */
  954. // Bits for: REG_SPI_CTL1
  955. #define BPT_32_BITS (31 << 10)
  956. #define BPT_16_BITS (15 << 10)
  957. #define BPT_8_BITS ( 7 << 10)
  958. #define BPT_1_BITS ( 0 << 10)
  959. #define CPHA (1 << 9)
  960. #define CPOL (1 << 8)
  961. #define MCBR_MCLK_DIV_512 (7 << 4)
  962. #define MCBR_MCLK_DIV_256 (6 << 4)
  963. #define MCBR_MCLK_DIV_128 (5 << 4)
  964. #define MCBR_MCLK_DIV_64 (4 << 4)
  965. #define MCBR_MCLK_DIV_32 (3 << 4)
  966. #define MCBR_MCLK_DIV_16 (2 << 4)
  967. #define MCBR_MCLK_DIV_8 (1 << 4)
  968. #define MCBR_MCLK_DIV_4 (0 << 4)
  969. #define TXDE (1 << 3)
  970. #define RXDE (1 << 2)
  971. #define MODE_MASTER (1 << 1)
  972. #define MODE_SLAVE (0 << 1)
  973. #define ENA (1 << 0)
  974. // Bits for: REG_SPI_STAT
  975. #define BSYF (1 << 6)
  976. #define MFEF (1 << 5)
  977. #define TDEF (1 << 4)
  978. #define RDOF (1 << 3)
  979. #define RDFF (1 << 2)
  980. // Bits for REG_HS_CNTLMODE
  981. #define HSDMAADV (1 << 0)
  982. // Bits for DMA advanced channels
  983. #define DMA_ENABLED (1 << 0)
  984. #define DMA_DISABLED (0 << 0)
  985. #endif /* REGS_H */