x1000_cpm.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. /*
  2. * File : x1000_cpm.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2008 - 2012, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2017-02-03 Urey the first version
  23. */
  24. #ifndef _X1000_CPM_H_
  25. #define _X1000_CPM_H_
  26. #define CPM_CPCCR (0x00)
  27. #define CPM_CPCSR (0xd4)
  28. #define CPM_DDRCDR (0x2c)
  29. #define CPM_I2SCDR (0x60)
  30. #define CPM_I2SCDR1 (0x70)
  31. #define CPM_LPCDR (0x64)
  32. #define CPM_MSC0CDR (0x68)
  33. #define CPM_MSC1CDR (0xa4)
  34. #define CPM_USBCDR (0x50)
  35. #define CPM_MACCDR (0x54)
  36. #define CPM_UHCCDR (0x6c)
  37. #define CPM_SFCCDR (0x74)
  38. #define CPM_CIMCDR (0x7c)
  39. #define CPM_PCMCDR (0x84)
  40. #define CPM_PCMCDR1 (0xe0)
  41. #define CPM_MPHYC (0xe8)
  42. #define CPM_INTR (0xb0)
  43. #define CPM_INTRE (0xb4)
  44. #define CPM_DRCG (0xd0)
  45. #define CPM_CPSPPR (0x38)
  46. #define CPM_CPPSR (0x34)
  47. #define CPM_USBPCR (0x3c)
  48. #define CPM_USBRDT (0x40)
  49. #define CPM_USBVBFIL (0x44)
  50. #define CPM_USBPCR1 (0x48)
  51. #define CPM_CPAPCR (0x10)
  52. #define CPM_CPMPCR (0x14)
  53. #define CPM_LCR (0x04)
  54. #define CPM_PSWC0ST (0x90)
  55. #define CPM_PSWC1ST (0x94)
  56. #define CPM_PSWC2ST (0x98)
  57. #define CPM_PSWC3ST (0x9c)
  58. #define CPM_CLKGR (0x20)
  59. #define CPM_CLKGR0 (0x20)
  60. #define CPM_MESTSEL (0xec)
  61. #define CPM_SRBC (0xc4)
  62. #define CPM_ERNG (0xd8)
  63. #define CPM_RNG (0xdc)
  64. #define CPM_SLBC (0xc8)
  65. #define CPM_SLPC (0xcc)
  66. #define CPM_OPCR (0x24)
  67. #define CPM_RSR (0x08)
  68. /*
  69. * CPM registers common define
  70. */
  71. /* Clock control register(CPCCR) */
  72. #define CPCCR_SEL_SRC_LSB 30
  73. #define CPCCR_SEL_SRC_MASK BITS_H2L(31, CPCCR_SEL_SRC_LSB)
  74. #define CPCCR_SEL_CPLL_LSB 28
  75. #define CPCCR_SEL_CPLL_MASK BITS_H2L(29, CPCCR_SEL_CPLL_LSB)
  76. #define CPCCR_SEL_H0PLL_LSB 26
  77. #define CPCCR_SEL_H0PLL_MASK BITS_H2L(27, CPCCR_SEL_H0PLL_LSB)
  78. #define CPCCR_SEL_H2PLL_LSB 24
  79. #define CPCCR_SEL_H2PLL_MASK BITS_H2L(25, CPCCR_SEL_H2PLL_LSB)
  80. #define CPCCR_CE_CPU BIT22
  81. #define CPCCR_CE_AHB0 BIT21
  82. #define CPCCR_CE_AHB2 BIT20
  83. #define CPCCR_CE (CPCCR_CE_CPU | CPCCR_CE_AHB0 | CPCCR_CE_AHB2)
  84. #define CPCCR_PDIV_LSB 16
  85. #define CPCCR_PDIV_MASK BITS_H2L(19, CPCCR_PDIV_LSB)
  86. #define CPCCR_H2DIV_LSB 12
  87. #define CPCCR_H2DIV_MASK BITS_H2L(15, CPCCR_H2DIV_LSB)
  88. #define CPCCR_H0DIV_LSB 8
  89. #define CPCCR_H0DIV_MASK BITS_H2L(11, CPCCR_H0DIV_LSB)
  90. #define CPCCR_L2DIV_LSB 4
  91. #define CPCCR_L2DIV_MASK BITS_H2L(7, CPCCR_L2DIV_LSB)
  92. #define CPCCR_CDIV_LSB 0
  93. #define CPCCR_CDIV_MASK BITS_H2L(3, CPCCR_CDIV_LSB)
  94. #define CPM_SRC_SEL_APLL 1
  95. #define CPM_PLL_SEL_SRC 1
  96. #define CPM_PLL_SEL_MPLL 2
  97. /* Clock Status register(CPCSR) */
  98. #define CPCSR_SRC_MUX BIT31
  99. #define CPCSR_CPU_MUX BIT30
  100. #define CPCSR_AHB0_MUX BIT29
  101. #define CPCSR_AHB2_MUX BIT28
  102. #define CPCSR_DDR_MUX BIT27
  103. #define CPCSR_H2DIV_BUSY BIT2
  104. #define CPCSR_H0DIV_BUSY BIT1
  105. #define CPCSR_CDIV_BUSY BIT0
  106. #define CPCSR_DIV_BUSY (CPCSR_H2DIV_BUSY | CPCSR_H0DIV_BUSY | CPCSR_CDIV_BUSY)
  107. /* DDR clock divider register(DDCDR) */
  108. #define DDCDR_DCS_LSB 30
  109. #define DDCDR_DCS_MASK BITS_H2L(31, DDCDR_DCS_LSB)
  110. #define DDCDR_DCS_STOP (0 << DDCDR_DCS_LSB)
  111. #define DDCDR_DCS_APLL (1 << DDCDR_DCS_LSB)
  112. #define DDCDR_DCS_MPLL (2 << DDCDR_DCS_LSB)
  113. #define DDCDR_CE_DDR BIT29
  114. #define DDCDR_DDR_BUSY BIT28
  115. #define DDCDR_DDR_STOP BIT27
  116. #define DDCDR_GATE_EN BIT26
  117. #define DDCDR_DDR_CHANGE_EN BIT25
  118. #define DDCDR_DDR BIT24
  119. #define DDCDR_DDRDIV_LSB 0
  120. #define DDCDR_DDRDIV_MASK BITS_H2L(3, DDCDR_DDRDIV_LSB)
  121. /*MACPHY clock divider Register (MACCDR)*/
  122. #define MACCDR_MACPCS BIT31
  123. #define MACCDR_CE_MAC BIT29
  124. #define MACCDR_MAC_BUSY BIT28
  125. #define MACCDR_MAC_STOP BIT27
  126. #define MACCDR_MACCDR_LSB BIT0
  127. #define MACCDR_MACCDR_MASK BITS_H2L(7,MACCDR_MACCDR_LSB)
  128. /* I2S device clock divider register(I2SCDR) */
  129. #define I2SCDR_I2PCS BIT31
  130. #define I2SCDR_I2CS BIT30
  131. #define I2SCDR_I2SDIV_M_LSB 13
  132. #define I2SCDR_I2SDIV_M_MASK BITS_H2L(21,I2SCDR_I2SDIV_M_LSB)
  133. #define I2SCDR_I2SDIV_N_LSB 0 /* I2SCDR bit */
  134. #define I2SCDR_I2SDIV_N_MASK BITS_H2L(7, I2SCDR_I2SDIV_N_LSB)
  135. /* I2S device clock divider register(I2SCDR1) */
  136. #define I2SCDR1_NEN BIT31
  137. #define I2SCDR1_DEN BIT30
  138. #define I2SCDR1_I2SDIV_D_LSB 0
  139. #define I2SCDR1_I2SDIV_D_MASK BITS_H2L(12,I2SCDR1_I2SDIV_D_LSB)
  140. /* LCD pix clock divider register(LPCDR) */
  141. #define LPCDR_LPCS_LSB 31
  142. #define LPCDR_LPCS_APLL (0 << LPCDR_LPCS_LSB)
  143. #define LPCDR_LPCS_MPLL (1 << LPCDR_LPCS_LSB)
  144. #define LPCDR_CE_LCD BIT28
  145. #define LPCDR_LCD_BUSY BIT27
  146. #define LPCDR_LCD_STOP BIT26
  147. #define LPCDR_PIXDIV_LSB 0 /* LPCDR bit */
  148. #define LPCDR_PIXDIV_MASK BITS_H2L(7, LPCDR_PIXDIV_LSB)
  149. /* MSC clock divider register(MSCCDR) */
  150. #define MSCCDR_MPCS_LSB 31 /* MPCS bit */
  151. #define MSCCDR_MPCS_APLL (0 << MSCCDR_MPCS_LSB)
  152. #define MSCCDR_MPCS_MPLL (1 << MSCCDR_MPCS_LSB)
  153. #define MSCCDR_CE_MSC BIT29
  154. #define MSCCDR_MSC_BUSY BIT28
  155. #define MSCCDR_MSC_STOP BIT27
  156. #define MSCCDR_S_CLK0_SEL BIT15
  157. #define MSCCDR_MSCDIV_LSB 0 /* MSCCDR bit */
  158. #define MSCCDR_MSCDIV_MASK BITS_H2L(7, MSCCDR_MSCDIV_LSB)
  159. /* OTG PHY clock divider register(USBCDR) */
  160. #define USBCDR_UCS BIT31
  161. #define USBCDR_UPCS BIT30
  162. #define USBCDR_CE_USB BIT29
  163. #define USBCDR_USB_BUSY BIT28
  164. #define USBCDR_USB_STOP BIT27
  165. #define USBCDR_OTGDIV_LSB 0 /* USBCDR bit */
  166. #define USBCDR_OTGDIV_MASK BITS_H2L(7, USBCDR_OTGDIV_LSB)
  167. /* SSI clock divider register(SSICDR) */
  168. #define SSICDR_SPCS BIT31
  169. #define SSICDR_SCS BIT30
  170. #define SSICDR_CE_SSI BIT29
  171. #define SSICDR_SSI_BUSY BIT28
  172. #define SSICDR_SSI_STOP BIT27
  173. #define SSICDR_SSIDIV_LSB 0 /* SSICDR bit */
  174. #define SSICDR_SSIDIV_MASK BITS_H2L(7, SSICDR_SSIDIV_LSB)
  175. /* CIM mclk clock divider register(CIMCDR) */
  176. #define CIMCDR_CIMPCS_APLL (0 << 31)
  177. #define CIMCDR_CIMPCS_MPLL BIT31
  178. #define CIMCDR_CE_CIM BIT29
  179. #define CIMCDR_CIM_BUSY BIT28
  180. #define CIMCDR_CIM_STOP BIT27
  181. #define CIMCDR_CIMDIV_LSB 0 /* CIMCDR bit */
  182. #define CIMCDR_CIMDIV_MASK BITS_H2L(7, CIMCDR_CIMDIV_LSB)
  183. /* PCM device clock divider register(PCMCDR) */
  184. #define PCMCDR_PCMPCS_LSB 30
  185. #define PCMCDR_PCMPCS_MASK BITS_H2L(31,PCMCDR_PCMPCS_LSB)
  186. #define PCMCDR_PCMPCS_SCLK_A 0 << PCMCDR_PCMPCS_LSB
  187. #define PCMCDR_PCMPCS_EXTCLK 1 << PCMCDR_PCMPCS_LSB
  188. #define PCMCDR_PCMPCS_MPLL 2 << PCMCDR_PCMPCS_LSB
  189. #define PCMCDR_CE_PCM BIT29
  190. #define PCMCDR_PCMDIV_M_LSB 13
  191. #define PCMCDR_PCMDIV_M_MASK BITS_H2L(21,PCMCDR_PCMDIV_M_LSB)
  192. #define PCMCDR_PCMDIV_N_LSB 0
  193. #define PCMCDR_PCMDIV_N_MASK BITS_H2L(12,PCMCDR_PCMDIV_N_LSB)
  194. /* PCM device clock divider register(PCMCDR1) */
  195. #define PCMCDR1_PCM_NEN BIT31
  196. #define PCMCDR1_PCM_DEN BIT30
  197. #define PCMCDR1_PCMDIV_D_LSB 0
  198. #define PCMCDR1_PCMDIV_D_MASK BITS_H2L(12,PCMCDR1_PCMDIV_D_LSB)
  199. /* MAC PHY Control Register (MPHYC) */
  200. #define MPHYC_MODE_SEL BIT31 //useless now
  201. #define MPHYC_MAC_SPEED_LSB 29
  202. #define MPHYC_MAC_SPEED_MASK BITS_H2L(30,MPHYC_MAC_SPEED_LSB)
  203. #define MPHYC_SOFT_RST BIT3
  204. #define MPHYC_PHY_INTF_LSB 0
  205. #define MPHYC_PHY_INTF_MASK BITS_H2L(2,MPHYC_PHY_INTF_MASK) //useless now
  206. /* CPM Interrupt Register (CPM_INTR)*/
  207. #define CPM_INTR_VBUS_INTR BIT1
  208. #define CPM_INTR_ADEV_INTR BIT0
  209. /* CPM Interrupt Enable Register (CPM_INTRE)*/
  210. #define CPM_INTRE_VBUS_INTRE BIT1
  211. #define CPM_INTRE_ADEV_INTRE BIT0
  212. /* CPM scratch pad protected register(CPSPPR) */
  213. #define CPSPPR_CPSPR_WRITABLE (0x00005a5a)
  214. /* OTG parameter control register(USBPCR) */
  215. #define USBPCR_USB_MODE BIT31
  216. #define USBPCR_AVLD_REG BIT30
  217. #define USBPCR_INCRM BIT27 /* INCR_MASK bit */
  218. #define USBPCR_TXRISE_TUNE BIT26
  219. #define USBPCR_COMMONONN BIT25
  220. #define USBPCR_VBUSVLDEXT BIT24
  221. #define USBPCR_VBUSVLDEXTSEL BIT23
  222. #define USBPCR_POR BIT22
  223. #define USBPCR_SIDDQ BIT21
  224. #define USBPCR_OTG_DISABLE BIT20
  225. #define USBPCR_TXPREEMPHTUNE BIT6
  226. #define USBPCR_IDPULLUP_LSB 28 /* IDPULLUP_MASK bit */
  227. #define USBPCR_IDPULLUP_MASK BITS_H2L(29, USBPCR_IDPULLUP_LSB)
  228. #define USBPCR_COMPDISTUNE_LSB 17
  229. #define USBPCR_COMPDISTUNE_MASK BITS_H2L(19, USBPCR_COMPDISTUNE_LSB)
  230. #define USBPCR_OTGTUNE_LSB 14
  231. #define USBPCR_OTGTUNE_MASK BITS_H2L(16, USBPCR_OTGTUNE_LSB)
  232. #define USBPCR_SQRXTUNE_LSB 11
  233. #define USBPCR_SQRXTUNE_MASK BITS_H2L(13, USBPCR_SQRXTUNE_LSB)
  234. #define USBPCR_TXFSLSTUNE_LSB 7
  235. #define USBPCR_TXFSLSTUNE_MASK BITS_H2L(10, USBPCR_TXFSLSTUNE_LSB)
  236. #define USBPCR_TXRISETUNE_LSB 4
  237. #define USBPCR_TXRISETUNE_MASK BITS_H2L(5, USBPCR_TXRISETUNE_LSB)
  238. #define USBPCR_TXVREFTUNE_LSB 0
  239. #define USBPCR_TXVREFTUNE_MASK BITS_H2L(3, USBPCR_TXVREFTUNE_LSB)
  240. /* OTG reset detect timer register(USBRDT) */
  241. #define USBRDT_HB_MASK BIT26
  242. #define USBRDT_VBFIL_LD_EN BIT25
  243. #define USBRDT_IDDIG_EN BIT24
  244. #define USBRDT_IDDIG_REG BIT23
  245. #define USBRDT_USBRDT_LSB 0
  246. #define USBRDT_USBRDT_MASK BITS_H2L(22, USBRDT_USBRDT_LSB)
  247. /* OTG parameter control register(USBPCR1) */
  248. #define USBPCR1_REG BIT31
  249. #define USBPCR1_USB_SEL BIT28
  250. #define USBPCR1_REFCLKSEL_LSB 26
  251. #define USBPCR1_REFCLKSEL_MASK BITS_H2L(27, USBPCR1_REFCLKSEL_LSB)
  252. #define USBPCR1_REFCLKDIV_LSB 24
  253. #define USBPCR1_REFCLKDIV_MASK BITS_H2L(25, USBPCR1_REFCLKDIV_LSB)
  254. #define USBPCR1_PORT_RST BIT21
  255. #define USBPCR1_WORD_IF0 BIT19
  256. #define USBPCR1_WORD_IF1 BIT18
  257. /* APLL control register (CPXPCR) */
  258. #define CPAPCR_BS BIT31
  259. #define CPAPCR_M_LSB 24
  260. #define CPAPCR_M_MASK BITS_H2L(30, CPAPCR_M_LSB)
  261. #define CPAPCR_N_LSB 18
  262. #define CPAPCR_N_MASK BITS_H2L(22, CPAPCR_N_LSB)
  263. #define CPAPCR_OD_LSB 16
  264. #define CPAPCR_OD_MASK BITS_H2L(17, CPAPCR_OD_LSB)
  265. #define CPAPCR_LOCK BIT15 /* LOCK bit */
  266. #define CPAPCR_ON BIT10
  267. #define CPAPCR_BP BIT9
  268. #define CPAPCR_EN BIT8
  269. #define CPAPCR_PLLST_LSB 0
  270. #define CPAPCR_PLLST_MASK BITS_H2L(7,CPAPCR_PLLST_LSB)
  271. #define CPM_CPAPCR_EN CPAPCR_EN
  272. #define CPM_CPAPCR_ON CPAPCR_ON
  273. /* MPLL control register (CPXPCR) */
  274. #define CPMPCR_BS BIT31
  275. #define CPMPCR_M_LSB 24
  276. #define CPMPCR_M_MASK BITS_H2L(30, CPAPCR_M_LSB)
  277. #define CPMPCR_N_LSB 18
  278. #define CPMPCR_N_MASK BITS_H2L(22, CPAPCR_N_LSB)
  279. #define CPMPCR_OD_LSB 16
  280. #define CPMPCR_OD_MASK BITS_H2L(17, CPAPCR_OD_LSB)
  281. #define CPMPCR_EN BIT7
  282. #define CPMPCR_BP BIT6
  283. #define CPMPCR_LOCK BIT1 /* LOCK bit */
  284. #define CPMPCR_ON BIT0
  285. #define CPM_CPMPCR_EN CPMPCR_EN
  286. #define CPM_CPMPCR_ON CPMPCR_ON
  287. /* Low power control register(LCR) */
  288. #define LCR_PST_LSB 8
  289. #define LCD_PST_MASK BITS_H2L(19,LCR_PST_LSB)
  290. #define LCR_LPM_LSB 0
  291. #define LCR_LPM_MASK BITS_H2L(1,LCR_LPM_LSB)
  292. /* Clock gate register 0(CGR0) */
  293. #define CLKGR0_DDR BIT31
  294. #define CLKGR0_CPU BIT30
  295. #define CLKGR0_AHB0 BIT29
  296. #define CLKGR0_APB0 BIT28
  297. #define CLKGR0_RTC BIT27
  298. #define CLKGR0_PCM BIT26
  299. #define CLKGR0_MAC BIT25
  300. #define CLKGR0_AES BIT24
  301. #define CLKGR0_LCD BIT23
  302. #define CLKGR0_CIM BIT22
  303. #define CLKGR0_PDMA BIT21
  304. #define CLKGR0_OST BIT20
  305. #define CLKGR0_SSI BIT19
  306. #define CLKGR0_TCU BIT18
  307. #define CLKGR0_DMIC BIT17
  308. #define CLKGR0_UART2 BIT16
  309. #define CLKGR0_UART1 BIT15
  310. #define CLKGR0_UART0 BIT14
  311. #define CLKGR0_SADC BIT13
  312. #define CLKGR0_JPEG BIT12
  313. #define CLKGR0_AIC BIT11
  314. #define CLKGR0_I2C3 BIT10
  315. #define CLKGR0_I2C2 BIT9
  316. #define CLKGR0_I2C1 BIT8
  317. #define CLKGR0_I2C0 BIT7
  318. #define CLKGR0_SCC BIT6
  319. #define CLKGR0_MSC1 BIT5
  320. #define CLKGR0_MSC0 BIT4
  321. #define CLKGR0_OTG BIT3
  322. #define CLKGR0_SFC BIT2
  323. #define CLKGR0_EFUSE BIT1
  324. #define CLKGR0_NEMC BIT0
  325. /* CPM MEST SEL Register */
  326. #define MEST_SEL_TST8 BIT8
  327. #define MEST_SEL_TST7 BIT7
  328. #define MEST_SEL_TST4 BIT4
  329. #define MEST_SEL_TST3 BIT3
  330. #define MEST_SEL_TST1 BIT1
  331. #define MEST_SEL_TST0 BIT0
  332. /*Soft Reset and Bus Control Register (SRBC)*/
  333. #define SRBC_JPEG_SR BIT31
  334. #define SRBC_JPEG_STP BIT30
  335. #define SRBC_JPEG_ACK BIT29
  336. #define SRBC_LCD_SR BIT25
  337. #define SRBC_LCD_STP BIT24
  338. #define SRBC_LCD_ACK BIT23
  339. #define SRBC_CIM_STP BIT21
  340. #define SRBC_CIM_ACK BIT20
  341. #define SRBC_CPU_STP BIT15
  342. #define SRBC_CPU_ACK BIT14
  343. #define SRBC_OTG_SR BIT12
  344. #define SRBC_AHB2_STP BIT8
  345. #define SRBC_AHB2_ACK BIT7
  346. #define SRBC_DDR_STP BIT6
  347. #define SRBC_DDR_ACK BIT5
  348. /* Oscillator and power control register(OPCR) */
  349. #define OPCR_IDLE_DIS BIT31
  350. #define OPCR_MASK_INT BIT30
  351. #define OPCR_MASK_VPU BIT29 //ONLY FOR DEBUG
  352. #define OPCR_GATE_SCLK_ABUS BIT28
  353. #define OPCR_L2C_PD BIT25
  354. #define OPCR_REQ_MODE BIT24
  355. #define OPCR_GATE_USBPHY_CLK BIT23
  356. #define OPCR_DIS_STOP_MUX BIT22
  357. #define OPCR_O1ST_LSB 8
  358. #define OPCR_O1ST_MASK BITS_H2L(19, OPCR_O1ST_LSB)
  359. #define OPCR_OTGPHY0_ENABLE BIT7 /* otg */
  360. #define OPCR_OTGPHY1_ENABLE BIT6 /* uhc */
  361. #define OPCR_USBPHY_ENABLE (OPCR_OTGPHY0_ENABLE | OPCR_OTGPHY1_ENABLE)
  362. #define OPCR_O1SE BIT4
  363. #define OPCR_PD BIT3
  364. #define OPCR_ERCS BIT2
  365. #define OPCR_BUSMODE BIT1
  366. /* Reset status register(RSR) */
  367. #define RSR_HR BIT3
  368. #define RSR_P0R BIT2
  369. #define RSR_WR BIT1
  370. #define RSR_PR BIT0
  371. #ifndef __ASSEMBLY__
  372. #define REG_CPM_CPCCR REG32(CPM_BASE + CPM_CPCCR)
  373. #define REG_CPM_CPCSR REG32(CPM_BASE + CPM_CPCSR)
  374. #define REG_CPM_DDCDR REG32(CPM_BASE + CPM_DDCDR)
  375. #define REG_CPM_MACCDR REG32(CPM_BASE + CPM_MACCDR)
  376. #define REG_CPM_I2SCDR REG32(CPM_BASE + CPM_I2SCDR)
  377. #define REG_CPM_I2SCDR1 REG32(CPM_BASE + CPM_I2SCDR1)
  378. #define REG_CPM_LPCDR REG32(CPM_BASE + CPM_LPCDR)
  379. #define REG_CPM_MSC0CDR REG32(CPM_BASE + CPM_MSC0CDR)
  380. #define REG_CPM_MSC1CDR REG32(CPM_BASE + CPM_MSC1CDR)
  381. #define REG_CPM_USBCDR REG32(CPM_BASE + CPM_USBCDR)
  382. #define REG_CPM_SSICDR REG32(CPM_BASE + CPM_SSICDR)
  383. #define REG_CPM_CIMCDR REG32(CPM_BASE + CPM_CIMCDR)
  384. #define REG_CPM_PCMCDR REG32(CPM_BASE + CPM_PCMCDR)
  385. #define REG_CPM_PCMCDR1 REG32(CPM_BASE + CPM_PCMCDR1)
  386. #define REG_CPM_MPHYC REG32(CPM_BASE + CPM_MPHYC)
  387. #define REG_CPM_INTRCDR REG32(CPM_BASE + CPM_INTRCDR)
  388. #define REG_CPM_INTRECDR REG32(CPM_BASE + CPM_INTRECDR)
  389. #define REG_CPM_CPSPR REG32(CPM_BASE + CPM_CPSPR)
  390. #define REG_CPM_CPSPPR REG32(CPM_BASE + CPM_CPSPPR)
  391. #define REG_CPM_USBPCR REG32(CPM_BASE + CPM_USBPCR)
  392. #define REG_CPM_USBRDT REG32(CPM_BASE + CPM_USBRDT)
  393. #define REG_CPM_USBVBFIL REG32(CPM_BASE + CPM_USBVBFIL)
  394. #define REG_CPM_USBPCR1 REG32(CPM_BASE + CPM_USBPCR1)
  395. #define REG_CPM_CPAPCR REG32(CPM_BASE + CPM_CPAPCR)
  396. #define REG_CPM_CPMPCR REG32(CPM_BASE + CPM_CPMPCR)
  397. #define REG_CPM_LCR REG32(CPM_BASE + CPM_LCR)
  398. #define REG_CPM_PSWC0ST REG32(CPM_BASE + CPM_PSWC0ST)
  399. #define REG_CPM_PSWC1ST REG32(CPM_BASE + CPM_PSWC1ST)
  400. #define REG_CPM_PSWC2ST REG32(CPM_BASE + CPM_PSWC2ST)
  401. #define REG_CPM_PSWC3ST REG32(CPM_BASE + CPM_PSWC3ST)
  402. #define REG_CPM_CLKGR0 REG32(CPM_BASE + CPM_CLKGR0)
  403. #define REG_CPM_SRBC REG32(CPM_BASE + CPM_SRBC)
  404. #define REG_CPM_SLBC REG32(CPM_BASE + CPM_SLBC)
  405. #define REG_CPM_SLPC REG32(CPM_BASE + CPM_SLPC)
  406. #define REG_CPM_OPCR REG32(CPM_BASE + CPM_OPCR)
  407. #define REG_CPM_RSR REG32(CPM_BASE + CPM_RSR)
  408. #define _REG_CPM_MSCCDR(n) REG_CPM_MSC##n##CDR
  409. #define REG_CPM_MSCCDR(n) _REG_CPM_MSCCDR(n)
  410. /* CPM read write */
  411. #define cpm_inl(off) readl(CPM_BASE + off)
  412. #define cpm_outl(val,off) writel(val, CPM_BASE + off)
  413. #define cpm_test_bit(bit,off) (cpm_inl(off) & 0x1<<(bit))
  414. #define cpm_set_bit(bit,off) (cpm_outl((cpm_inl(off) | 0x1<<(bit)),off))
  415. #define cpm_clear_bit(bit,off) (cpm_outl(cpm_inl(off) & ~(0x1 << bit), off))
  416. #endif /* __ASSEMBLY__ */
  417. #endif /* _X1000_CPM_H_ */