syscon.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. /*
  2. *
  3. * arch/arm/mach-u300/include/mach/syscon.h
  4. *
  5. *
  6. * Copyright (C) 2008 ST-Ericsson AB
  7. *
  8. * Author: Rickard Andersson <rickard.andersson@stericsson.com>
  9. */
  10. #ifndef __MACH_SYSCON_H
  11. #define __MACH_SYSCON_H
  12. /*
  13. * All register defines for SYSCON registers that concerns individual
  14. * block clocks and reset lines are registered here. This is because
  15. * we don't want any other file to try to fool around with this stuff.
  16. */
  17. /* APP side SYSCON registers */
  18. /* TODO: this is incomplete. Add all from asic_syscon_map.h eventually. */
  19. /* CLK Control Register 16bit (R/W) */
  20. #define U300_SYSCON_CCR (0x0000)
  21. #define U300_SYSCON_CCR_I2S1_USE_VCXO (0x0040)
  22. #define U300_SYSCON_CCR_I2S0_USE_VCXO (0x0020)
  23. #define U300_SYSCON_CCR_TURN_VCXO_ON (0x0008)
  24. #define U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK (0x0007)
  25. #define U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW_POWER (0x04)
  26. #define U300_SYSCON_CCR_CLKING_PERFORMANCE_LOW (0x03)
  27. #define U300_SYSCON_CCR_CLKING_PERFORMANCE_INTERMEDIATE (0x02)
  28. #define U300_SYSCON_CCR_CLKING_PERFORMANCE_HIGH (0x01)
  29. #define U300_SYSCON_CCR_CLKING_PERFORMANCE_BEST (0x00)
  30. /* CLK Status Register 16bit (R/W) */
  31. #define U300_SYSCON_CSR (0x0004)
  32. #define U300_SYSCON_CSR_PLL208_LOCK_IND (0x0002)
  33. #define U300_SYSCON_CSR_PLL13_LOCK_IND (0x0001)
  34. /* Reset lines for SLOW devices 16bit (R/W) */
  35. #define U300_SYSCON_RSR (0x0014)
  36. #ifdef CONFIG_MACH_U300_BS335
  37. #define U300_SYSCON_RSR_PPM_RESET_EN (0x0200)
  38. #endif
  39. #define U300_SYSCON_RSR_ACC_TMR_RESET_EN (0x0100)
  40. #define U300_SYSCON_RSR_APP_TMR_RESET_EN (0x0080)
  41. #define U300_SYSCON_RSR_RTC_RESET_EN (0x0040)
  42. #define U300_SYSCON_RSR_KEYPAD_RESET_EN (0x0020)
  43. #define U300_SYSCON_RSR_GPIO_RESET_EN (0x0010)
  44. #define U300_SYSCON_RSR_EH_RESET_EN (0x0008)
  45. #define U300_SYSCON_RSR_BTR_RESET_EN (0x0004)
  46. #define U300_SYSCON_RSR_UART_RESET_EN (0x0002)
  47. #define U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN (0x0001)
  48. /* Reset lines for FAST devices 16bit (R/W) */
  49. #define U300_SYSCON_RFR (0x0018)
  50. #ifdef CONFIG_MACH_U300_BS335
  51. #define U300_SYSCON_RFR_UART1_RESET_ENABLE (0x0080)
  52. #endif
  53. #define U300_SYSCON_RFR_SPI_RESET_ENABLE (0x0040)
  54. #define U300_SYSCON_RFR_MMC_RESET_ENABLE (0x0020)
  55. #define U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE (0x0010)
  56. #define U300_SYSCON_RFR_PCM_I2S0_RESET_ENABLE (0x0008)
  57. #define U300_SYSCON_RFR_I2C1_RESET_ENABLE (0x0004)
  58. #define U300_SYSCON_RFR_I2C0_RESET_ENABLE (0x0002)
  59. #define U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE (0x0001)
  60. /* Reset lines for the rest of the peripherals 16bit (R/W) */
  61. #define U300_SYSCON_RRR (0x001c)
  62. #ifdef CONFIG_MACH_U300_BS335
  63. #define U300_SYSCON_RRR_CDS_RESET_EN (0x4000)
  64. #define U300_SYSCON_RRR_ISP_RESET_EN (0x2000)
  65. #endif
  66. #define U300_SYSCON_RRR_INTCON_RESET_EN (0x1000)
  67. #define U300_SYSCON_RRR_MSPRO_RESET_EN (0x0800)
  68. #define U300_SYSCON_RRR_XGAM_RESET_EN (0x0100)
  69. #define U300_SYSCON_RRR_XGAM_VC_SYNC_RESET_EN (0x0080)
  70. #define U300_SYSCON_RRR_NANDIF_RESET_EN (0x0040)
  71. #define U300_SYSCON_RRR_EMIF_RESET_EN (0x0020)
  72. #define U300_SYSCON_RRR_DMAC_RESET_EN (0x0010)
  73. #define U300_SYSCON_RRR_CPU_RESET_EN (0x0008)
  74. #define U300_SYSCON_RRR_APEX_RESET_EN (0x0004)
  75. #define U300_SYSCON_RRR_AHB_RESET_EN (0x0002)
  76. #define U300_SYSCON_RRR_AAIF_RESET_EN (0x0001)
  77. /* Clock enable for SLOW peripherals 16bit (R/W) */
  78. #define U300_SYSCON_CESR (0x0020)
  79. #ifdef CONFIG_MACH_U300_BS335
  80. #define U300_SYSCON_CESR_PPM_CLK_EN (0x0200)
  81. #endif
  82. #define U300_SYSCON_CESR_ACC_TMR_CLK_EN (0x0100)
  83. #define U300_SYSCON_CESR_APP_TMR_CLK_EN (0x0080)
  84. #define U300_SYSCON_CESR_KEYPAD_CLK_EN (0x0040)
  85. #define U300_SYSCON_CESR_GPIO_CLK_EN (0x0010)
  86. #define U300_SYSCON_CESR_EH_CLK_EN (0x0008)
  87. #define U300_SYSCON_CESR_BTR_CLK_EN (0x0004)
  88. #define U300_SYSCON_CESR_UART_CLK_EN (0x0002)
  89. #define U300_SYSCON_CESR_SLOW_BRIDGE_CLK_EN (0x0001)
  90. /* Clock enable for FAST peripherals 16bit (R/W) */
  91. #define U300_SYSCON_CEFR (0x0024)
  92. #ifdef CONFIG_MACH_U300_BS335
  93. #define U300_SYSCON_CEFR_UART1_CLK_EN (0x0200)
  94. #endif
  95. #define U300_SYSCON_CEFR_I2S1_CORE_CLK_EN (0x0100)
  96. #define U300_SYSCON_CEFR_I2S0_CORE_CLK_EN (0x0080)
  97. #define U300_SYSCON_CEFR_SPI_CLK_EN (0x0040)
  98. #define U300_SYSCON_CEFR_MMC_CLK_EN (0x0020)
  99. #define U300_SYSCON_CEFR_I2S1_CLK_EN (0x0010)
  100. #define U300_SYSCON_CEFR_I2S0_CLK_EN (0x0008)
  101. #define U300_SYSCON_CEFR_I2C1_CLK_EN (0x0004)
  102. #define U300_SYSCON_CEFR_I2C0_CLK_EN (0x0002)
  103. #define U300_SYSCON_CEFR_FAST_BRIDGE_CLK_EN (0x0001)
  104. /* Clock enable for the rest of the peripherals 16bit (R/W) */
  105. #define U300_SYSCON_CERR (0x0028)
  106. #ifdef CONFIG_MACH_U300_BS335
  107. #define U300_SYSCON_CERR_CDS_CLK_EN (0x2000)
  108. #define U300_SYSCON_CERR_ISP_CLK_EN (0x1000)
  109. #endif
  110. #define U300_SYSCON_CERR_MSPRO_CLK_EN (0x0800)
  111. #define U300_SYSCON_CERR_AHB_SUBSYS_BRIDGE_CLK_EN (0x0400)
  112. #define U300_SYSCON_CERR_SEMI_CLK_EN (0x0200)
  113. #define U300_SYSCON_CERR_XGAM_CLK_EN (0x0100)
  114. #define U300_SYSCON_CERR_VIDEO_ENC_CLK_EN (0x0080)
  115. #define U300_SYSCON_CERR_NANDIF_CLK_EN (0x0040)
  116. #define U300_SYSCON_CERR_EMIF_CLK_EN (0x0020)
  117. #define U300_SYSCON_CERR_DMAC_CLK_EN (0x0010)
  118. #define U300_SYSCON_CERR_CPU_CLK_EN (0x0008)
  119. #define U300_SYSCON_CERR_APEX_CLK_EN (0x0004)
  120. #define U300_SYSCON_CERR_AHB_CLK_EN (0x0002)
  121. #define U300_SYSCON_CERR_AAIF_CLK_EN (0x0001)
  122. /* Single block clock enable 16bit (-/W) */
  123. #define U300_SYSCON_SBCER (0x002c)
  124. #ifdef CONFIG_MACH_U300_BS335
  125. #define U300_SYSCON_SBCER_PPM_CLK_EN (0x0009)
  126. #endif
  127. #define U300_SYSCON_SBCER_ACC_TMR_CLK_EN (0x0008)
  128. #define U300_SYSCON_SBCER_APP_TMR_CLK_EN (0x0007)
  129. #define U300_SYSCON_SBCER_KEYPAD_CLK_EN (0x0006)
  130. #define U300_SYSCON_SBCER_GPIO_CLK_EN (0x0004)
  131. #define U300_SYSCON_SBCER_EH_CLK_EN (0x0003)
  132. #define U300_SYSCON_SBCER_BTR_CLK_EN (0x0002)
  133. #define U300_SYSCON_SBCER_UART_CLK_EN (0x0001)
  134. #define U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN (0x0000)
  135. #ifdef CONFIG_MACH_U300_BS335
  136. #define U300_SYSCON_SBCER_UART1_CLK_EN (0x0019)
  137. #endif
  138. #define U300_SYSCON_SBCER_I2S1_CORE_CLK_EN (0x0018)
  139. #define U300_SYSCON_SBCER_I2S0_CORE_CLK_EN (0x0017)
  140. #define U300_SYSCON_SBCER_SPI_CLK_EN (0x0016)
  141. #define U300_SYSCON_SBCER_MMC_CLK_EN (0x0015)
  142. #define U300_SYSCON_SBCER_I2S1_CLK_EN (0x0014)
  143. #define U300_SYSCON_SBCER_I2S0_CLK_EN (0x0013)
  144. #define U300_SYSCON_SBCER_I2C1_CLK_EN (0x0012)
  145. #define U300_SYSCON_SBCER_I2C0_CLK_EN (0x0011)
  146. #define U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN (0x0010)
  147. #ifdef CONFIG_MACH_U300_BS335
  148. #define U300_SYSCON_SBCER_CDS_CLK_EN (0x002D)
  149. #define U300_SYSCON_SBCER_ISP_CLK_EN (0x002C)
  150. #endif
  151. #define U300_SYSCON_SBCER_MSPRO_CLK_EN (0x002B)
  152. #define U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN (0x002A)
  153. #define U300_SYSCON_SBCER_SEMI_CLK_EN (0x0029)
  154. #define U300_SYSCON_SBCER_XGAM_CLK_EN (0x0028)
  155. #define U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN (0x0027)
  156. #define U300_SYSCON_SBCER_NANDIF_CLK_EN (0x0026)
  157. #define U300_SYSCON_SBCER_EMIF_CLK_EN (0x0025)
  158. #define U300_SYSCON_SBCER_DMAC_CLK_EN (0x0024)
  159. #define U300_SYSCON_SBCER_CPU_CLK_EN (0x0023)
  160. #define U300_SYSCON_SBCER_APEX_CLK_EN (0x0022)
  161. #define U300_SYSCON_SBCER_AHB_CLK_EN (0x0021)
  162. #define U300_SYSCON_SBCER_AAIF_CLK_EN (0x0020)
  163. /* Single block clock disable 16bit (-/W) */
  164. #define U300_SYSCON_SBCDR (0x0030)
  165. /* Same values as above for SBCER */
  166. /* Clock force SLOW peripherals 16bit (R/W) */
  167. #define U300_SYSCON_CFSR (0x003c)
  168. #ifdef CONFIG_MACH_U300_BS335
  169. #define U300_SYSCON_CFSR_PPM_CLK_FORCE_EN (0x0200)
  170. #endif
  171. #define U300_SYSCON_CFSR_ACC_TMR_CLK_FORCE_EN (0x0100)
  172. #define U300_SYSCON_CFSR_APP_TMR_CLK_FORCE_EN (0x0080)
  173. #define U300_SYSCON_CFSR_KEYPAD_CLK_FORCE_EN (0x0020)
  174. #define U300_SYSCON_CFSR_GPIO_CLK_FORCE_EN (0x0010)
  175. #define U300_SYSCON_CFSR_EH_CLK_FORCE_EN (0x0008)
  176. #define U300_SYSCON_CFSR_BTR_CLK_FORCE_EN (0x0004)
  177. #define U300_SYSCON_CFSR_UART_CLK_FORCE_EN (0x0002)
  178. #define U300_SYSCON_CFSR_SLOW_BRIDGE_CLK_FORCE_EN (0x0001)
  179. /* Clock force FAST peripherals 16bit (R/W) */
  180. #define U300_SYSCON_CFFR (0x40)
  181. /* Values not defined. Define if you want to use them. */
  182. /* Clock force the rest of the peripherals 16bit (R/W) */
  183. #define U300_SYSCON_CFRR (0x44)
  184. #ifdef CONFIG_MACH_U300_BS335
  185. #define U300_SYSCON_CFRR_CDS_CLK_FORCE_EN (0x2000)
  186. #define U300_SYSCON_CFRR_ISP_CLK_FORCE_EN (0x1000)
  187. #endif
  188. #define U300_SYSCON_CFRR_MSPRO_CLK_FORCE_EN (0x0800)
  189. #define U300_SYSCON_CFRR_AHB_SUBSYS_BRIDGE_CLK_FORCE_EN (0x0400)
  190. #define U300_SYSCON_CFRR_SEMI_CLK_FORCE_EN (0x0200)
  191. #define U300_SYSCON_CFRR_XGAM_CLK_FORCE_EN (0x0100)
  192. #define U300_SYSCON_CFRR_VIDEO_ENC_CLK_FORCE_EN (0x0080)
  193. #define U300_SYSCON_CFRR_NANDIF_CLK_FORCE_EN (0x0040)
  194. #define U300_SYSCON_CFRR_EMIF_CLK_FORCE_EN (0x0020)
  195. #define U300_SYSCON_CFRR_DMAC_CLK_FORCE_EN (0x0010)
  196. #define U300_SYSCON_CFRR_CPU_CLK_FORCE_EN (0x0008)
  197. #define U300_SYSCON_CFRR_APEX_CLK_FORCE_EN (0x0004)
  198. #define U300_SYSCON_CFRR_AHB_CLK_FORCE_EN (0x0002)
  199. #define U300_SYSCON_CFRR_AAIF_CLK_FORCE_EN (0x0001)
  200. /* PLL208 Frequency Control 16bit (R/W) */
  201. #define U300_SYSCON_PFCR (0x48)
  202. #define U300_SYSCON_PFCR_DPLL_MULT_NUM (0x000F)
  203. /* Power Management Control 16bit (R/W) */
  204. #define U300_SYSCON_PMCR (0x50)
  205. #define U300_SYSCON_PMCR_DCON_ENABLE (0x0002)
  206. #define U300_SYSCON_PMCR_PWR_MGNT_ENABLE (0x0001)
  207. /*
  208. * All other clocking registers moved to clock.c!
  209. */
  210. /* Reset Out 16bit (R/W) */
  211. #define U300_SYSCON_RCR (0x6c)
  212. #define U300_SYSCON_RCR_RESOUT0_RST_N_DISABLE (0x0001)
  213. /* EMIF Slew Rate Control 16bit (R/W) */
  214. #define U300_SYSCON_SRCLR (0x70)
  215. #define U300_SYSCON_SRCLR_MASK (0x03FF)
  216. #define U300_SYSCON_SRCLR_VALUE (0x03FF)
  217. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_5_B (0x0200)
  218. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_5_A (0x0100)
  219. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_4_B (0x0080)
  220. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_4_A (0x0040)
  221. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_3_B (0x0020)
  222. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_3_A (0x0010)
  223. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_2_B (0x0008)
  224. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_2_A (0x0004)
  225. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_1_B (0x0002)
  226. #define U300_SYSCON_SRCLR_EMIF_1_SLRC_1_A (0x0001)
  227. /* EMIF Clock Control Register 16bit (R/W) */
  228. #define U300_SYSCON_ECCR (0x0078)
  229. #define U300_SYSCON_ECCR_MASK (0x000F)
  230. #define U300_SYSCON_ECCR_EMIF_1_STATIC_CLK_EN_N_DISABLE (0x0008)
  231. #define U300_SYSCON_ECCR_EMIF_1_RET_OUT_CLK_EN_N_DISABLE (0x0004)
  232. #define U300_SYSCON_ECCR_EMIF_MEMCLK_RET_EN_N_DISABLE (0x0002)
  233. #define U300_SYSCON_ECCR_EMIF_SDRCLK_RET_EN_N_DISABLE (0x0001)
  234. /* Step one for killing the applications system 16bit (-/W) */
  235. #define U300_SYSCON_KA1R (0x0080)
  236. #define U300_SYSCON_KA1R_MASK (0xFFFF)
  237. #define U300_SYSCON_KA1R_VALUE (0xFFFF)
  238. /* Step two for killing the application system 16bit (-/W) */
  239. #define U300_SYSCON_KA2R (0x0084)
  240. #define U300_SYSCON_KA2R_MASK (0xFFFF)
  241. #define U300_SYSCON_KA2R_VALUE (0xFFFF)
  242. /* MMC/MSPRO frequency divider register 0 16bit (R/W) */
  243. #define U300_SYSCON_MMF0R (0x90)
  244. #define U300_SYSCON_MMF0R_MASK (0x00FF)
  245. #define U300_SYSCON_MMF0R_FREQ_0_HIGH_MASK (0x00F0)
  246. #define U300_SYSCON_MMF0R_FREQ_0_LOW_MASK (0x000F)
  247. /* MMC/MSPRO frequency divider register 1 16bit (R/W) */
  248. #define U300_SYSCON_MMF1R (0x94)
  249. #define U300_SYSCON_MMF1R_MASK (0x00FF)
  250. #define U300_SYSCON_MMF1R_FREQ_1_HIGH_MASK (0x00F0)
  251. #define U300_SYSCON_MMF1R_FREQ_1_LOW_MASK (0x000F)
  252. /* AAIF control register 16 bit (R/W) */
  253. #define U300_SYSCON_AAIFCR (0x98)
  254. #define U300_SYSCON_AAIFCR_MASK (0x0003)
  255. #define U300_SYSCON_AAIFCR_AASW_CTRL_MASK (0x0003)
  256. #define U300_SYSCON_AAIFCR_AASW_CTRL_FUNCTIONAL (0x0000)
  257. #define U300_SYSCON_AAIFCR_AASW_CTRL_MONITORING (0x0001)
  258. #define U300_SYSCON_AAIFCR_AASW_CTRL_ACC_TO_EXT (0x0002)
  259. #define U300_SYSCON_AAIFCR_AASW_CTRL_APP_TO_EXT (0x0003)
  260. /* Clock control for the MMC and MSPRO blocks 16bit (R/W) */
  261. #define U300_SYSCON_MMCR (0x9C)
  262. #define U300_SYSCON_MMCR_MASK (0x0003)
  263. #define U300_SYSCON_MMCR_MMC_FB_CLK_SEL_ENABLE (0x0002)
  264. #define U300_SYSCON_MMCR_MSPRO_FREQSEL_ENABLE (0x0001)
  265. /* Pull up/down control (R/W) */
  266. #define U300_SYSCON_PUCR (0x104)
  267. #define U300_SYSCON_PUCR_EMIF_1_WAIT_N_PU_ENABLE (0x0200)
  268. #define U300_SYSCON_PUCR_EMIF_1_NFIF_READY_PU_ENABLE (0x0100)
  269. #define U300_SYSCON_PUCR_EMIF_1_16BIT_PU_ENABLE (0x0080)
  270. #define U300_SYSCON_PUCR_EMIF_1_8BIT_PU_ENABLE (0x0040)
  271. #define U300_SYSCON_PUCR_KEY_IN_PU_EN_MASK (0x003F)
  272. /* SYS_0_CLK_CONTROL first clock control 16bit (R/W) */
  273. #define U300_SYSCON_S0CCR (0x120)
  274. #define U300_SYSCON_S0CCR_FIELD_MASK (0x43FF)
  275. #define U300_SYSCON_S0CCR_CLOCK_REQ (0x4000)
  276. #define U300_SYSCON_S0CCR_CLOCK_REQ_MONITOR (0x2000)
  277. #define U300_SYSCON_S0CCR_CLOCK_INV (0x0200)
  278. #define U300_SYSCON_S0CCR_CLOCK_FREQ_MASK (0x01E0)
  279. #define U300_SYSCON_S0CCR_CLOCK_SELECT_MASK (0x001E)
  280. #define U300_SYSCON_S0CCR_CLOCK_ENABLE (0x0001)
  281. #define U300_SYSCON_S0CCR_SEL_MCLK (0x8<<1)
  282. #define U300_SYSCON_S0CCR_SEL_ACC_FSM_CLK (0xA<<1)
  283. #define U300_SYSCON_S0CCR_SEL_PLL60_48_CLK (0xC<<1)
  284. #define U300_SYSCON_S0CCR_SEL_PLL60_60_CLK (0xD<<1)
  285. #define U300_SYSCON_S0CCR_SEL_ACC_PLL208_CLK (0xE<<1)
  286. #define U300_SYSCON_S0CCR_SEL_APP_PLL13_CLK (0x0<<1)
  287. #define U300_SYSCON_S0CCR_SEL_APP_FSM_CLK (0x2<<1)
  288. #define U300_SYSCON_S0CCR_SEL_RTC_CLK (0x4<<1)
  289. #define U300_SYSCON_S0CCR_SEL_APP_PLL208_CLK (0x6<<1)
  290. /* SYS_1_CLK_CONTROL second clock control 16 bit (R/W) */
  291. #define U300_SYSCON_S1CCR (0x124)
  292. #define U300_SYSCON_S1CCR_FIELD_MASK (0x43FF)
  293. #define U300_SYSCON_S1CCR_CLOCK_REQ (0x4000)
  294. #define U300_SYSCON_S1CCR_CLOCK_REQ_MONITOR (0x2000)
  295. #define U300_SYSCON_S1CCR_CLOCK_INV (0x0200)
  296. #define U300_SYSCON_S1CCR_CLOCK_FREQ_MASK (0x01E0)
  297. #define U300_SYSCON_S1CCR_CLOCK_SELECT_MASK (0x001E)
  298. #define U300_SYSCON_S1CCR_CLOCK_ENABLE (0x0001)
  299. #define U300_SYSCON_S1CCR_SEL_MCLK (0x8<<1)
  300. #define U300_SYSCON_S1CCR_SEL_ACC_FSM_CLK (0xA<<1)
  301. #define U300_SYSCON_S1CCR_SEL_PLL60_48_CLK (0xC<<1)
  302. #define U300_SYSCON_S1CCR_SEL_PLL60_60_CLK (0xD<<1)
  303. #define U300_SYSCON_S1CCR_SEL_ACC_PLL208_CLK (0xE<<1)
  304. #define U300_SYSCON_S1CCR_SEL_ACC_PLL13_CLK (0x0<<1)
  305. #define U300_SYSCON_S1CCR_SEL_APP_FSM_CLK (0x2<<1)
  306. #define U300_SYSCON_S1CCR_SEL_RTC_CLK (0x4<<1)
  307. #define U300_SYSCON_S1CCR_SEL_APP_PLL208_CLK (0x6<<1)
  308. /* SYS_2_CLK_CONTROL third clock contol 16 bit (R/W) */
  309. #define U300_SYSCON_S2CCR (0x128)
  310. #define U300_SYSCON_S2CCR_FIELD_MASK (0xC3FF)
  311. #define U300_SYSCON_S2CCR_CLK_STEAL (0x8000)
  312. #define U300_SYSCON_S2CCR_CLOCK_REQ (0x4000)
  313. #define U300_SYSCON_S2CCR_CLOCK_REQ_MONITOR (0x2000)
  314. #define U300_SYSCON_S2CCR_CLOCK_INV (0x0200)
  315. #define U300_SYSCON_S2CCR_CLOCK_FREQ_MASK (0x01E0)
  316. #define U300_SYSCON_S2CCR_CLOCK_SELECT_MASK (0x001E)
  317. #define U300_SYSCON_S2CCR_CLOCK_ENABLE (0x0001)
  318. #define U300_SYSCON_S2CCR_SEL_MCLK (0x8<<1)
  319. #define U300_SYSCON_S2CCR_SEL_ACC_FSM_CLK (0xA<<1)
  320. #define U300_SYSCON_S2CCR_SEL_PLL60_48_CLK (0xC<<1)
  321. #define U300_SYSCON_S2CCR_SEL_PLL60_60_CLK (0xD<<1)
  322. #define U300_SYSCON_S2CCR_SEL_ACC_PLL208_CLK (0xE<<1)
  323. #define U300_SYSCON_S2CCR_SEL_ACC_PLL13_CLK (0x0<<1)
  324. #define U300_SYSCON_S2CCR_SEL_APP_FSM_CLK (0x2<<1)
  325. #define U300_SYSCON_S2CCR_SEL_RTC_CLK (0x4<<1)
  326. #define U300_SYSCON_S2CCR_SEL_APP_PLL208_CLK (0x6<<1)
  327. /* SYS_MISC_CONTROL, miscellaneous 16bit (R/W) */
  328. #define U300_SYSCON_MCR (0x12c)
  329. #define U300_SYSCON_MCR_FIELD_MASK (0x00FF)
  330. #define U300_SYSCON_MCR_PMGEN_CR_4_MASK (0x00C0)
  331. #define U300_SYSCON_MCR_PMGEN_CR_4_GPIO (0x0000)
  332. #define U300_SYSCON_MCR_PMGEN_CR_4_SPI (0x0040)
  333. #define U300_SYSCON_MCR_PMGEN_CR_4_AAIF (0x00C0)
  334. #define U300_SYSCON_MCR_PMGEN_CR_2_MASK (0x0030)
  335. #define U300_SYSCON_MCR_PMGEN_CR_2_GPIO (0x0000)
  336. #define U300_SYSCON_MCR_PMGEN_CR_2_EMIF_1_STATIC (0x0010)
  337. #define U300_SYSCON_MCR_PMGEN_CR_2_DSP (0x0020)
  338. #define U300_SYSCON_MCR_PMGEN_CR_2_AAIF (0x0030)
  339. #define U300_SYSCON_MCR_PMGEN_CR_0_MASK (0x000C)
  340. #define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_1_SDRAM_M1 (0x0000)
  341. #define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_1_SDRAM_M2 (0x0004)
  342. #define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_1_SDRAM_M3 (0x0008)
  343. #define U300_SYSCON_MCR_PMGEN_CR_0_EMIF_0_SDRAM (0x000C)
  344. #define U300_SYSCON_MCR_PM1G_MODE_ENABLE (0x0002)
  345. #define U300_SYSCON_MCR_PMTG5_MODE_ENABLE (0x0001)
  346. /* SC_PLL_IRQ_CONTROL 16bit (R/W) */
  347. #define U300_SYSCON_PICR (0x0130)
  348. #define U300_SYSCON_PICR_MASK (0x00FF)
  349. #define U300_SYSCON_PICR_FORCE_PLL208_LOCK_LOW_ENABLE (0x0080)
  350. #define U300_SYSCON_PICR_FORCE_PLL208_LOCK_HIGH_ENABLE (0x0040)
  351. #define U300_SYSCON_PICR_FORCE_PLL13_LOCK_LOW_ENABLE (0x0020)
  352. #define U300_SYSCON_PICR_FORCE_PLL13_LOCK_HIGH_ENABLE (0x0010)
  353. #define U300_SYSCON_PICR_IRQMASK_PLL13_UNLOCK_ENABLE (0x0008)
  354. #define U300_SYSCON_PICR_IRQMASK_PLL13_LOCK_ENABLE (0x0004)
  355. #define U300_SYSCON_PICR_IRQMASK_PLL208_UNLOCK_ENABLE (0x0002)
  356. #define U300_SYSCON_PICR_IRQMASK_PLL208_LOCK_ENABLE (0x0001)
  357. /* SC_PLL_IRQ_STATUS 16 bit (R/-) */
  358. #define U300_SYSCON_PISR (0x0134)
  359. #define U300_SYSCON_PISR_MASK (0x000F)
  360. #define U300_SYSCON_PISR_PLL13_UNLOCK_IND (0x0008)
  361. #define U300_SYSCON_PISR_PLL13_LOCK_IND (0x0004)
  362. #define U300_SYSCON_PISR_PLL208_UNLOCK_IND (0x0002)
  363. #define U300_SYSCON_PISR_PLL208_LOCK_IND (0x0001)
  364. /* SC_PLL_IRQ_CLEAR 16 bit (-/W) */
  365. #define U300_SYSCON_PICLR (0x0138)
  366. #define U300_SYSCON_PICLR_MASK (0x000F)
  367. #define U300_SYSCON_PICLR_RWMASK (0x0000)
  368. #define U300_SYSCON_PICLR_PLL13_UNLOCK_SC (0x0008)
  369. #define U300_SYSCON_PICLR_PLL13_LOCK_SC (0x0004)
  370. #define U300_SYSCON_PICLR_PLL208_UNLOCK_SC (0x0002)
  371. #define U300_SYSCON_PICLR_PLL208_LOCK_SC (0x0001)
  372. /* CAMIF_CONTROL 16 bit (-/W) */
  373. #define U300_SYSCON_CICR (0x013C)
  374. #define U300_SYSCON_CICR_MASK (0x0FFF)
  375. #define U300_SYSCON_CICR_APP_SUBLVDS_TESTMODE_MASK (0x0F00)
  376. #define U300_SYSCON_CICR_APP_SUBLVDS_TESTMODE_PORT1 (0x0C00)
  377. #define U300_SYSCON_CICR_APP_SUBLVDS_TESTMODE_PORT0 (0x0300)
  378. #define U300_SYSCON_CICR_APP_SUBLVDS_RESCON_MASK (0x00F0)
  379. #define U300_SYSCON_CICR_APP_SUBLVDS_RESCON_PORT1 (0x00C0)
  380. #define U300_SYSCON_CICR_APP_SUBLVDS_RESCON_PORT0 (0x0030)
  381. #define U300_SYSCON_CICR_APP_SUBLVDS_PWR_DWN_N_MASK (0x000F)
  382. #define U300_SYSCON_CICR_APP_SUBLVDS_PWR_DWN_N_PORT1 (0x000C)
  383. #define U300_SYSCON_CICR_APP_SUBLVDS_PWR_DWN_N_PORT0 (0x0003)
  384. /* Clock activity observability register 0 */
  385. #define U300_SYSCON_C0OAR (0x140)
  386. #define U300_SYSCON_C0OAR_MASK (0xFFFF)
  387. #define U300_SYSCON_C0OAR_VALUE (0xFFFF)
  388. #define U300_SYSCON_C0OAR_BT_H_CLK (0x8000)
  389. #define U300_SYSCON_C0OAR_ASPB_P_CLK (0x4000)
  390. #define U300_SYSCON_C0OAR_APP_SEMI_H_CLK (0x2000)
  391. #define U300_SYSCON_C0OAR_APP_SEMI_CLK (0x1000)
  392. #define U300_SYSCON_C0OAR_APP_MMC_MSPRO_CLK (0x0800)
  393. #define U300_SYSCON_C0OAR_APP_I2S1_CLK (0x0400)
  394. #define U300_SYSCON_C0OAR_APP_I2S0_CLK (0x0200)
  395. #define U300_SYSCON_C0OAR_APP_CPU_CLK (0x0100)
  396. #define U300_SYSCON_C0OAR_APP_52_CLK (0x0080)
  397. #define U300_SYSCON_C0OAR_APP_208_CLK (0x0040)
  398. #define U300_SYSCON_C0OAR_APP_104_CLK (0x0020)
  399. #define U300_SYSCON_C0OAR_APEX_CLK (0x0010)
  400. #define U300_SYSCON_C0OAR_AHPB_M_H_CLK (0x0008)
  401. #define U300_SYSCON_C0OAR_AHB_CLK (0x0004)
  402. #define U300_SYSCON_C0OAR_AFPB_P_CLK (0x0002)
  403. #define U300_SYSCON_C0OAR_AAIF_CLK (0x0001)
  404. /* Clock activity observability register 1 */
  405. #define U300_SYSCON_C1OAR (0x144)
  406. #define U300_SYSCON_C1OAR_MASK (0x3FFE)
  407. #define U300_SYSCON_C1OAR_VALUE (0x3FFE)
  408. #define U300_SYSCON_C1OAR_NFIF_F_CLK (0x2000)
  409. #define U300_SYSCON_C1OAR_MSPRO_CLK (0x1000)
  410. #define U300_SYSCON_C1OAR_MMC_P_CLK (0x0800)
  411. #define U300_SYSCON_C1OAR_MMC_CLK (0x0400)
  412. #define U300_SYSCON_C1OAR_KP_P_CLK (0x0200)
  413. #define U300_SYSCON_C1OAR_I2C1_P_CLK (0x0100)
  414. #define U300_SYSCON_C1OAR_I2C0_P_CLK (0x0080)
  415. #define U300_SYSCON_C1OAR_GPIO_CLK (0x0040)
  416. #define U300_SYSCON_C1OAR_EMIF_MPMC_CLK (0x0020)
  417. #define U300_SYSCON_C1OAR_EMIF_H_CLK (0x0010)
  418. #define U300_SYSCON_C1OAR_EVHIST_CLK (0x0008)
  419. #define U300_SYSCON_C1OAR_PPM_CLK (0x0004)
  420. #define U300_SYSCON_C1OAR_DMA_CLK (0x0002)
  421. /* Clock activity observability register 2 */
  422. #define U300_SYSCON_C2OAR (0x148)
  423. #define U300_SYSCON_C2OAR_MASK (0x0FFF)
  424. #define U300_SYSCON_C2OAR_VALUE (0x0FFF)
  425. #define U300_SYSCON_C2OAR_XGAM_CDI_CLK (0x0800)
  426. #define U300_SYSCON_C2OAR_XGAM_CLK (0x0400)
  427. #define U300_SYSCON_C2OAR_VC_H_CLK (0x0200)
  428. #define U300_SYSCON_C2OAR_VC_CLK (0x0100)
  429. #define U300_SYSCON_C2OAR_UA_P_CLK (0x0080)
  430. #define U300_SYSCON_C2OAR_TMR1_CLK (0x0040)
  431. #define U300_SYSCON_C2OAR_TMR0_CLK (0x0020)
  432. #define U300_SYSCON_C2OAR_SPI_P_CLK (0x0010)
  433. #define U300_SYSCON_C2OAR_PCM_I2S1_CORE_CLK (0x0008)
  434. #define U300_SYSCON_C2OAR_PCM_I2S1_CLK (0x0004)
  435. #define U300_SYSCON_C2OAR_PCM_I2S0_CORE_CLK (0x0002)
  436. #define U300_SYSCON_C2OAR_PCM_I2S0_CLK (0x0001)
  437. /* Chip ID register 16bit (R/-) */
  438. #define U300_SYSCON_CIDR (0x400)
  439. /* Video IRQ clear 16bit (R/W) */
  440. #define U300_SYSCON_VICR (0x404)
  441. #define U300_SYSCON_VICR_VIDEO1_IRQ_CLEAR_ENABLE (0x0002)
  442. #define U300_SYSCON_VICR_VIDEO0_IRQ_CLEAR_ENABLE (0x0001)
  443. /* SMCR */
  444. #define U300_SYSCON_SMCR (0x4d0)
  445. #define U300_SYSCON_SMCR_FIELD_MASK (0x000e)
  446. #define U300_SYSCON_SMCR_SEMI_SREFACK_IND (0x0008)
  447. #define U300_SYSCON_SMCR_SEMI_SREFREQ_ENABLE (0x0004)
  448. #define U300_SYSCON_SMCR_SEMI_EXT_BOOT_MODE_ENABLE (0x0002)
  449. /* CPU_SW_DBGEN Software Debug Enable 16bit (R/W) */
  450. #define U300_SYSCON_CSDR (0x4f0)
  451. #define U300_SYSCON_CSDR_SW_DEBUG_ENABLE (0x0001)
  452. /* PRINT_CONTROL Print Control 16bit (R/-) */
  453. #define U300_SYSCON_PCR (0x4f8)
  454. #define U300_SYSCON_PCR_SERV_IND (0x0001)
  455. /* BOOT_CONTROL 16bit (R/-) */
  456. #define U300_SYSCON_BCR (0x4fc)
  457. #define U300_SYSCON_BCR_ACC_CPU_SUBSYS_VINITHI_IND (0x0400)
  458. #define U300_SYSCON_BCR_APP_CPU_SUBSYS_VINITHI_IND (0x0200)
  459. #define U300_SYSCON_BCR_EXTRA_BOOT_OPTION_MASK (0x01FC)
  460. #define U300_SYSCON_BCR_APP_BOOT_SERV_MASK (0x0003)
  461. /* CPU clock defines */
  462. /**
  463. * CPU high frequency in MHz
  464. */
  465. #define SYSCON_CPU_CLOCK_HIGH 208
  466. /**
  467. * CPU medium frequency in MHz
  468. */
  469. #define SYSCON_CPU_CLOCK_MEDIUM 52
  470. /**
  471. * CPU low frequency in MHz
  472. */
  473. #define SYSCON_CPU_CLOCK_LOW 13
  474. /* EMIF clock defines */
  475. /**
  476. * EMIF high frequency in MHz
  477. */
  478. #define SYSCON_EMIF_CLOCK_HIGH 104
  479. /**
  480. * EMIF medium frequency in MHz
  481. */
  482. #define SYSCON_EMIF_CLOCK_MEDIUM 52
  483. /**
  484. * EMIF low frequency in MHz
  485. */
  486. #define SYSCON_EMIF_CLOCK_LOW 13
  487. /* AHB clock defines */
  488. /**
  489. * AHB high frequency in MHz
  490. */
  491. #define SYSCON_AHB_CLOCK_HIGH 52
  492. /**
  493. * AHB medium frequency in MHz
  494. */
  495. #define SYSCON_AHB_CLOCK_MEDIUM 26
  496. /**
  497. * AHB low frequency in MHz
  498. */
  499. #define SYSCON_AHB_CLOCK_LOW 7 /* i.e 13/2=6.5MHz */
  500. enum syscon_busmaster {
  501. SYSCON_BM_DMAC,
  502. SYSCON_BM_XGAM,
  503. SYSCON_BM_VIDEO_ENC
  504. };
  505. /* Selectr a resistor or a set of resistors */
  506. enum syscon_pull_up_down {
  507. SYSCON_PU_KEY_IN_EN,
  508. SYSCON_PU_EMIF_1_8_BIT_EN,
  509. SYSCON_PU_EMIF_1_16_BIT_EN,
  510. SYSCON_PU_EMIF_1_NFIF_READY_EN,
  511. SYSCON_PU_EMIF_1_NFIF_WAIT_N_EN,
  512. };
  513. /*
  514. * Note that this array must match the order of the array "clk_reg"
  515. * in syscon.c
  516. */
  517. enum syscon_clk {
  518. SYSCON_CLKCONTROL_SLOW_BRIDGE,
  519. SYSCON_CLKCONTROL_UART,
  520. SYSCON_CLKCONTROL_BTR,
  521. SYSCON_CLKCONTROL_EH,
  522. SYSCON_CLKCONTROL_GPIO,
  523. SYSCON_CLKCONTROL_KEYPAD,
  524. SYSCON_CLKCONTROL_APP_TIMER,
  525. SYSCON_CLKCONTROL_ACC_TIMER,
  526. SYSCON_CLKCONTROL_FAST_BRIDGE,
  527. SYSCON_CLKCONTROL_I2C0,
  528. SYSCON_CLKCONTROL_I2C1,
  529. SYSCON_CLKCONTROL_I2S0,
  530. SYSCON_CLKCONTROL_I2S1,
  531. SYSCON_CLKCONTROL_MMC,
  532. SYSCON_CLKCONTROL_SPI,
  533. SYSCON_CLKCONTROL_I2S0_CORE,
  534. SYSCON_CLKCONTROL_I2S1_CORE,
  535. SYSCON_CLKCONTROL_UART1,
  536. SYSCON_CLKCONTROL_AAIF,
  537. SYSCON_CLKCONTROL_AHB,
  538. SYSCON_CLKCONTROL_APEX,
  539. SYSCON_CLKCONTROL_CPU,
  540. SYSCON_CLKCONTROL_DMA,
  541. SYSCON_CLKCONTROL_EMIF,
  542. SYSCON_CLKCONTROL_NAND_IF,
  543. SYSCON_CLKCONTROL_VIDEO_ENC,
  544. SYSCON_CLKCONTROL_XGAM,
  545. SYSCON_CLKCONTROL_SEMI,
  546. SYSCON_CLKCONTROL_AHB_SUBSYS,
  547. SYSCON_CLKCONTROL_MSPRO
  548. };
  549. enum syscon_sysclk_mode {
  550. SYSCON_SYSCLK_DISABLED,
  551. SYSCON_SYSCLK_M_CLK,
  552. SYSCON_SYSCLK_ACC_FSM,
  553. SYSCON_SYSCLK_PLL60_48,
  554. SYSCON_SYSCLK_PLL60_60,
  555. SYSCON_SYSCLK_ACC_PLL208,
  556. SYSCON_SYSCLK_APP_PLL13,
  557. SYSCON_SYSCLK_APP_FSM,
  558. SYSCON_SYSCLK_RTC,
  559. SYSCON_SYSCLK_APP_PLL208
  560. };
  561. enum syscon_sysclk_req {
  562. SYSCON_SYSCLKREQ_DISABLED,
  563. SYSCON_SYSCLKREQ_ACTIVE_LOW,
  564. SYSCON_SYSCLKREQ_MONITOR
  565. };
  566. enum syscon_clk_mode {
  567. SYSCON_CLKMODE_OFF,
  568. SYSCON_CLKMODE_DEFAULT,
  569. SYSCON_CLKMODE_LOW,
  570. SYSCON_CLKMODE_MEDIUM,
  571. SYSCON_CLKMODE_HIGH,
  572. SYSCON_CLKMODE_PERMANENT,
  573. SYSCON_CLKMODE_ON,
  574. };
  575. enum syscon_call_mode {
  576. SYSCON_CLKCALL_NOWAIT,
  577. SYSCON_CLKCALL_WAIT,
  578. };
  579. int syscon_dc_on(bool keep_power_on);
  580. int syscon_set_busmaster_active_state(enum syscon_busmaster busmaster,
  581. bool active);
  582. bool syscon_get_busmaster_active_state(void);
  583. int syscon_set_sleep_mask(enum syscon_clk,
  584. bool sleep_ctrl);
  585. int syscon_config_sysclk(u32 sysclk,
  586. enum syscon_sysclk_mode sysclkmode,
  587. bool inverse,
  588. u32 divisor,
  589. enum syscon_sysclk_req sysclkreq);
  590. bool syscon_can_turn_off_semi_clock(void);
  591. /* This function is restricted to core.c */
  592. int syscon_request_normal_power(bool req);
  593. /* This function is restricted to be used by platform_speed.c */
  594. int syscon_speed_request(enum syscon_call_mode wait_mode,
  595. enum syscon_clk_mode req_clk_mode);
  596. #endif /* __MACH_SYSCON_H */