regs-clkctrl-mx28.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /*
  2. * Freescale i.MX28 CLKCTRL Register Definitions
  3. *
  4. * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
  5. * on behalf of DENX Software Engineering GmbH
  6. *
  7. * Based on code from LTIB:
  8. * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #ifndef __MX28_REGS_CLKCTRL_H__
  13. #define __MX28_REGS_CLKCTRL_H__
  14. #include <asm/imx-common/regs-common.h>
  15. #ifndef __ASSEMBLY__
  16. struct mxs_clkctrl_regs {
  17. mxs_reg_32(hw_clkctrl_pll0ctrl0) /* 0x00 */
  18. uint32_t hw_clkctrl_pll0ctrl1; /* 0x10 */
  19. uint32_t reserved_pll0ctrl1[3]; /* 0x14-0x1c */
  20. mxs_reg_32(hw_clkctrl_pll1ctrl0) /* 0x20 */
  21. uint32_t hw_clkctrl_pll1ctrl1; /* 0x30 */
  22. uint32_t reserved_pll1ctrl1[3]; /* 0x34-0x3c */
  23. mxs_reg_32(hw_clkctrl_pll2ctrl0) /* 0x40 */
  24. mxs_reg_32(hw_clkctrl_cpu) /* 0x50 */
  25. mxs_reg_32(hw_clkctrl_hbus) /* 0x60 */
  26. mxs_reg_32(hw_clkctrl_xbus) /* 0x70 */
  27. mxs_reg_32(hw_clkctrl_xtal) /* 0x80 */
  28. mxs_reg_32(hw_clkctrl_ssp0) /* 0x90 */
  29. mxs_reg_32(hw_clkctrl_ssp1) /* 0xa0 */
  30. mxs_reg_32(hw_clkctrl_ssp2) /* 0xb0 */
  31. mxs_reg_32(hw_clkctrl_ssp3) /* 0xc0 */
  32. mxs_reg_32(hw_clkctrl_gpmi) /* 0xd0 */
  33. mxs_reg_32(hw_clkctrl_spdif) /* 0xe0 */
  34. mxs_reg_32(hw_clkctrl_emi) /* 0xf0 */
  35. mxs_reg_32(hw_clkctrl_saif0) /* 0x100 */
  36. mxs_reg_32(hw_clkctrl_saif1) /* 0x110 */
  37. mxs_reg_32(hw_clkctrl_lcdif) /* 0x120 */
  38. mxs_reg_32(hw_clkctrl_etm) /* 0x130 */
  39. mxs_reg_32(hw_clkctrl_enet) /* 0x140 */
  40. mxs_reg_32(hw_clkctrl_hsadc) /* 0x150 */
  41. mxs_reg_32(hw_clkctrl_flexcan) /* 0x160 */
  42. uint32_t reserved[16];
  43. mxs_reg_8(hw_clkctrl_frac0) /* 0x1b0 */
  44. mxs_reg_8(hw_clkctrl_frac1) /* 0x1c0 */
  45. mxs_reg_32(hw_clkctrl_clkseq) /* 0x1d0 */
  46. mxs_reg_32(hw_clkctrl_reset) /* 0x1e0 */
  47. mxs_reg_32(hw_clkctrl_status) /* 0x1f0 */
  48. mxs_reg_32(hw_clkctrl_version) /* 0x200 */
  49. };
  50. #endif
  51. #define CLKCTRL_PLL0CTRL0_LFR_SEL_MASK (0x3 << 28)
  52. #define CLKCTRL_PLL0CTRL0_LFR_SEL_OFFSET 28
  53. #define CLKCTRL_PLL0CTRL0_LFR_SEL_DEFAULT (0x0 << 28)
  54. #define CLKCTRL_PLL0CTRL0_LFR_SEL_TIMES_2 (0x1 << 28)
  55. #define CLKCTRL_PLL0CTRL0_LFR_SEL_TIMES_05 (0x2 << 28)
  56. #define CLKCTRL_PLL0CTRL0_LFR_SEL_UNDEFINED (0x3 << 28)
  57. #define CLKCTRL_PLL0CTRL0_CP_SEL_MASK (0x3 << 24)
  58. #define CLKCTRL_PLL0CTRL0_CP_SEL_OFFSET 24
  59. #define CLKCTRL_PLL0CTRL0_CP_SEL_DEFAULT (0x0 << 24)
  60. #define CLKCTRL_PLL0CTRL0_CP_SEL_TIMES_2 (0x1 << 24)
  61. #define CLKCTRL_PLL0CTRL0_CP_SEL_TIMES_05 (0x2 << 24)
  62. #define CLKCTRL_PLL0CTRL0_CP_SEL_UNDEFINED (0x3 << 24)
  63. #define CLKCTRL_PLL0CTRL0_DIV_SEL_MASK (0x3 << 20)
  64. #define CLKCTRL_PLL0CTRL0_DIV_SEL_OFFSET 20
  65. #define CLKCTRL_PLL0CTRL0_DIV_SEL_DEFAULT (0x0 << 20)
  66. #define CLKCTRL_PLL0CTRL0_DIV_SEL_LOWER (0x1 << 20)
  67. #define CLKCTRL_PLL0CTRL0_DIV_SEL_LOWEST (0x2 << 20)
  68. #define CLKCTRL_PLL0CTRL0_DIV_SEL_UNDEFINED (0x3 << 20)
  69. #define CLKCTRL_PLL0CTRL0_EN_USB_CLKS (1 << 18)
  70. #define CLKCTRL_PLL0CTRL0_POWER (1 << 17)
  71. #define CLKCTRL_PLL0CTRL1_LOCK (1 << 31)
  72. #define CLKCTRL_PLL0CTRL1_FORCE_LOCK (1 << 30)
  73. #define CLKCTRL_PLL0CTRL1_LOCK_COUNT_MASK 0xffff
  74. #define CLKCTRL_PLL0CTRL1_LOCK_COUNT_OFFSET 0
  75. #define CLKCTRL_PLL1CTRL0_CLKGATEEMI (1 << 31)
  76. #define CLKCTRL_PLL1CTRL0_LFR_SEL_MASK (0x3 << 28)
  77. #define CLKCTRL_PLL1CTRL0_LFR_SEL_OFFSET 28
  78. #define CLKCTRL_PLL1CTRL0_LFR_SEL_DEFAULT (0x0 << 28)
  79. #define CLKCTRL_PLL1CTRL0_LFR_SEL_TIMES_2 (0x1 << 28)
  80. #define CLKCTRL_PLL1CTRL0_LFR_SEL_TIMES_05 (0x2 << 28)
  81. #define CLKCTRL_PLL1CTRL0_LFR_SEL_UNDEFINED (0x3 << 28)
  82. #define CLKCTRL_PLL1CTRL0_CP_SEL_MASK (0x3 << 24)
  83. #define CLKCTRL_PLL1CTRL0_CP_SEL_OFFSET 24
  84. #define CLKCTRL_PLL1CTRL0_CP_SEL_DEFAULT (0x0 << 24)
  85. #define CLKCTRL_PLL1CTRL0_CP_SEL_TIMES_2 (0x1 << 24)
  86. #define CLKCTRL_PLL1CTRL0_CP_SEL_TIMES_05 (0x2 << 24)
  87. #define CLKCTRL_PLL1CTRL0_CP_SEL_UNDEFINED (0x3 << 24)
  88. #define CLKCTRL_PLL1CTRL0_DIV_SEL_MASK (0x3 << 20)
  89. #define CLKCTRL_PLL1CTRL0_DIV_SEL_OFFSET 20
  90. #define CLKCTRL_PLL1CTRL0_DIV_SEL_DEFAULT (0x0 << 20)
  91. #define CLKCTRL_PLL1CTRL0_DIV_SEL_LOWER (0x1 << 20)
  92. #define CLKCTRL_PLL1CTRL0_DIV_SEL_LOWEST (0x2 << 20)
  93. #define CLKCTRL_PLL1CTRL0_DIV_SEL_UNDEFINED (0x3 << 20)
  94. #define CLKCTRL_PLL1CTRL0_EN_USB_CLKS (1 << 18)
  95. #define CLKCTRL_PLL1CTRL0_POWER (1 << 17)
  96. #define CLKCTRL_PLL1CTRL1_LOCK (1 << 31)
  97. #define CLKCTRL_PLL1CTRL1_FORCE_LOCK (1 << 30)
  98. #define CLKCTRL_PLL1CTRL1_LOCK_COUNT_MASK 0xffff
  99. #define CLKCTRL_PLL1CTRL1_LOCK_COUNT_OFFSET 0
  100. #define CLKCTRL_PLL2CTRL0_CLKGATE (1 << 31)
  101. #define CLKCTRL_PLL2CTRL0_LFR_SEL_MASK (0x3 << 28)
  102. #define CLKCTRL_PLL2CTRL0_LFR_SEL_OFFSET 28
  103. #define CLKCTRL_PLL2CTRL0_HOLD_RING_OFF_B (1 << 26)
  104. #define CLKCTRL_PLL2CTRL0_CP_SEL_MASK (0x3 << 24)
  105. #define CLKCTRL_PLL2CTRL0_CP_SEL_OFFSET 24
  106. #define CLKCTRL_PLL2CTRL0_POWER (1 << 23)
  107. #define CLKCTRL_CPU_BUSY_REF_XTAL (1 << 29)
  108. #define CLKCTRL_CPU_BUSY_REF_CPU (1 << 28)
  109. #define CLKCTRL_CPU_DIV_XTAL_FRAC_EN (1 << 26)
  110. #define CLKCTRL_CPU_DIV_XTAL_MASK (0x3ff << 16)
  111. #define CLKCTRL_CPU_DIV_XTAL_OFFSET 16
  112. #define CLKCTRL_CPU_INTERRUPT_WAIT (1 << 12)
  113. #define CLKCTRL_CPU_DIV_CPU_FRAC_EN (1 << 10)
  114. #define CLKCTRL_CPU_DIV_CPU_MASK 0x3f
  115. #define CLKCTRL_CPU_DIV_CPU_OFFSET 0
  116. #define CLKCTRL_HBUS_ASM_BUSY (1 << 31)
  117. #define CLKCTRL_HBUS_DCP_AS_ENABLE (1 << 30)
  118. #define CLKCTRL_HBUS_PXP_AS_ENABLE (1 << 29)
  119. #define CLKCTRL_HBUS_ASM_EMIPORT_AS_ENABLE (1 << 27)
  120. #define CLKCTRL_HBUS_APBHDMA_AS_ENABLE (1 << 26)
  121. #define CLKCTRL_HBUS_APBXDMA_AS_ENABLE (1 << 25)
  122. #define CLKCTRL_HBUS_TRAFFIC_JAM_AS_ENABLE (1 << 24)
  123. #define CLKCTRL_HBUS_TRAFFIC_AS_ENABLE (1 << 23)
  124. #define CLKCTRL_HBUS_CPU_DATA_AS_ENABLE (1 << 22)
  125. #define CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE (1 << 21)
  126. #define CLKCTRL_HBUS_ASM_ENABLE (1 << 20)
  127. #define CLKCTRL_HBUS_AUTO_CLEAR_DIV_ENABLE (1 << 19)
  128. #define CLKCTRL_HBUS_SLOW_DIV_MASK (0x7 << 16)
  129. #define CLKCTRL_HBUS_SLOW_DIV_OFFSET 16
  130. #define CLKCTRL_HBUS_SLOW_DIV_BY1 (0x0 << 16)
  131. #define CLKCTRL_HBUS_SLOW_DIV_BY2 (0x1 << 16)
  132. #define CLKCTRL_HBUS_SLOW_DIV_BY4 (0x2 << 16)
  133. #define CLKCTRL_HBUS_SLOW_DIV_BY8 (0x3 << 16)
  134. #define CLKCTRL_HBUS_SLOW_DIV_BY16 (0x4 << 16)
  135. #define CLKCTRL_HBUS_SLOW_DIV_BY32 (0x5 << 16)
  136. #define CLKCTRL_HBUS_DIV_FRAC_EN (1 << 5)
  137. #define CLKCTRL_HBUS_DIV_MASK 0x1f
  138. #define CLKCTRL_HBUS_DIV_OFFSET 0
  139. #define CLKCTRL_XBUS_BUSY (1 << 31)
  140. #define CLKCTRL_XBUS_AUTO_CLEAR_DIV_ENABLE (1 << 11)
  141. #define CLKCTRL_XBUS_DIV_FRAC_EN (1 << 10)
  142. #define CLKCTRL_XBUS_DIV_MASK 0x3ff
  143. #define CLKCTRL_XBUS_DIV_OFFSET 0
  144. #define CLKCTRL_XTAL_UART_CLK_GATE (1 << 31)
  145. #define CLKCTRL_XTAL_PWM_CLK24M_GATE (1 << 29)
  146. #define CLKCTRL_XTAL_TIMROT_CLK32K_GATE (1 << 26)
  147. #define CLKCTRL_XTAL_DIV_UART_MASK 0x3
  148. #define CLKCTRL_XTAL_DIV_UART_OFFSET 0
  149. #define CLKCTRL_SSP_CLKGATE (1 << 31)
  150. #define CLKCTRL_SSP_BUSY (1 << 29)
  151. #define CLKCTRL_SSP_DIV_FRAC_EN (1 << 9)
  152. #define CLKCTRL_SSP_DIV_MASK 0x1ff
  153. #define CLKCTRL_SSP_DIV_OFFSET 0
  154. #define CLKCTRL_GPMI_CLKGATE (1 << 31)
  155. #define CLKCTRL_GPMI_BUSY (1 << 29)
  156. #define CLKCTRL_GPMI_DIV_FRAC_EN (1 << 10)
  157. #define CLKCTRL_GPMI_DIV_MASK 0x3ff
  158. #define CLKCTRL_GPMI_DIV_OFFSET 0
  159. #define CLKCTRL_SPDIF_CLKGATE (1 << 31)
  160. #define CLKCTRL_EMI_CLKGATE (1 << 31)
  161. #define CLKCTRL_EMI_SYNC_MODE_EN (1 << 30)
  162. #define CLKCTRL_EMI_BUSY_REF_XTAL (1 << 29)
  163. #define CLKCTRL_EMI_BUSY_REF_EMI (1 << 28)
  164. #define CLKCTRL_EMI_BUSY_REF_CPU (1 << 27)
  165. #define CLKCTRL_EMI_BUSY_SYNC_MODE (1 << 26)
  166. #define CLKCTRL_EMI_BUSY_DCC_RESYNC (1 << 17)
  167. #define CLKCTRL_EMI_DCC_RESYNC_ENABLE (1 << 16)
  168. #define CLKCTRL_EMI_DIV_XTAL_MASK (0xf << 8)
  169. #define CLKCTRL_EMI_DIV_XTAL_OFFSET 8
  170. #define CLKCTRL_EMI_DIV_EMI_MASK 0x3f
  171. #define CLKCTRL_EMI_DIV_EMI_OFFSET 0
  172. #define CLKCTRL_SAIF0_CLKGATE (1 << 31)
  173. #define CLKCTRL_SAIF0_BUSY (1 << 29)
  174. #define CLKCTRL_SAIF0_DIV_FRAC_EN (1 << 16)
  175. #define CLKCTRL_SAIF0_DIV_MASK 0xffff
  176. #define CLKCTRL_SAIF0_DIV_OFFSET 0
  177. #define CLKCTRL_SAIF1_CLKGATE (1 << 31)
  178. #define CLKCTRL_SAIF1_BUSY (1 << 29)
  179. #define CLKCTRL_SAIF1_DIV_FRAC_EN (1 << 16)
  180. #define CLKCTRL_SAIF1_DIV_MASK 0xffff
  181. #define CLKCTRL_SAIF1_DIV_OFFSET 0
  182. #define CLKCTRL_DIS_LCDIF_CLKGATE (1 << 31)
  183. #define CLKCTRL_DIS_LCDIF_BUSY (1 << 29)
  184. #define CLKCTRL_DIS_LCDIF_DIV_FRAC_EN (1 << 13)
  185. #define CLKCTRL_DIS_LCDIF_DIV_MASK 0x1fff
  186. #define CLKCTRL_DIS_LCDIF_DIV_OFFSET 0
  187. #define CLKCTRL_ETM_CLKGATE (1 << 31)
  188. #define CLKCTRL_ETM_BUSY (1 << 29)
  189. #define CLKCTRL_ETM_DIV_FRAC_EN (1 << 7)
  190. #define CLKCTRL_ETM_DIV_MASK 0x7f
  191. #define CLKCTRL_ETM_DIV_OFFSET 0
  192. #define CLKCTRL_ENET_SLEEP (1 << 31)
  193. #define CLKCTRL_ENET_DISABLE (1 << 30)
  194. #define CLKCTRL_ENET_STATUS (1 << 29)
  195. #define CLKCTRL_ENET_BUSY_TIME (1 << 27)
  196. #define CLKCTRL_ENET_DIV_TIME_MASK (0x3f << 21)
  197. #define CLKCTRL_ENET_DIV_TIME_OFFSET 21
  198. #define CLKCTRL_ENET_TIME_SEL_MASK (0x3 << 19)
  199. #define CLKCTRL_ENET_TIME_SEL_OFFSET 19
  200. #define CLKCTRL_ENET_TIME_SEL_XTAL (0x0 << 19)
  201. #define CLKCTRL_ENET_TIME_SEL_PLL (0x1 << 19)
  202. #define CLKCTRL_ENET_TIME_SEL_RMII_CLK (0x2 << 19)
  203. #define CLKCTRL_ENET_TIME_SEL_UNDEFINED (0x3 << 19)
  204. #define CLKCTRL_ENET_CLK_OUT_EN (1 << 18)
  205. #define CLKCTRL_ENET_RESET_BY_SW_CHIP (1 << 17)
  206. #define CLKCTRL_ENET_RESET_BY_SW (1 << 16)
  207. #define CLKCTRL_HSADC_RESETB (1 << 30)
  208. #define CLKCTRL_HSADC_FREQDIV_MASK (0x3 << 28)
  209. #define CLKCTRL_HSADC_FREQDIV_OFFSET 28
  210. #define CLKCTRL_FLEXCAN_STOP_CAN0 (1 << 30)
  211. #define CLKCTRL_FLEXCAN_CAN0_STATUS (1 << 29)
  212. #define CLKCTRL_FLEXCAN_STOP_CAN1 (1 << 28)
  213. #define CLKCTRL_FLEXCAN_CAN1_STATUS (1 << 27)
  214. #define CLKCTRL_FRAC_CLKGATE (1 << 7)
  215. #define CLKCTRL_FRAC_STABLE (1 << 6)
  216. #define CLKCTRL_FRAC_FRAC_MASK 0x3f
  217. #define CLKCTRL_FRAC_FRAC_OFFSET 0
  218. #define CLKCTRL_FRAC0_CPU 0
  219. #define CLKCTRL_FRAC0_EMI 1
  220. #define CLKCTRL_FRAC0_IO1 2
  221. #define CLKCTRL_FRAC0_IO0 3
  222. #define CLKCTRL_FRAC1_PIX 0
  223. #define CLKCTRL_FRAC1_HSADC 1
  224. #define CLKCTRL_FRAC1_GPMI 2
  225. #define CLKCTRL_CLKSEQ_BYPASS_CPU (1 << 18)
  226. #define CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF (1 << 14)
  227. #define CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF_BYPASS (0x1 << 14)
  228. #define CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF_PFD (0x0 << 14)
  229. #define CLKCTRL_CLKSEQ_BYPASS_ETM (1 << 8)
  230. #define CLKCTRL_CLKSEQ_BYPASS_EMI (1 << 7)
  231. #define CLKCTRL_CLKSEQ_BYPASS_SSP3 (1 << 6)
  232. #define CLKCTRL_CLKSEQ_BYPASS_SSP2 (1 << 5)
  233. #define CLKCTRL_CLKSEQ_BYPASS_SSP1 (1 << 4)
  234. #define CLKCTRL_CLKSEQ_BYPASS_SSP0 (1 << 3)
  235. #define CLKCTRL_CLKSEQ_BYPASS_GPMI (1 << 2)
  236. #define CLKCTRL_CLKSEQ_BYPASS_SAIF1 (1 << 1)
  237. #define CLKCTRL_CLKSEQ_BYPASS_SAIF0 (1 << 0)
  238. #define CLKCTRL_RESET_WDOG_POR_DISABLE (1 << 5)
  239. #define CLKCTRL_RESET_EXTERNAL_RESET_ENABLE (1 << 4)
  240. #define CLKCTRL_RESET_THERMAL_RESET_ENABLE (1 << 3)
  241. #define CLKCTRL_RESET_THERMAL_RESET_DEFAULT (1 << 2)
  242. #define CLKCTRL_RESET_CHIP (1 << 1)
  243. #define CLKCTRL_RESET_DIG (1 << 0)
  244. #define CLKCTRL_STATUS_CPU_LIMIT_MASK (0x3 << 30)
  245. #define CLKCTRL_STATUS_CPU_LIMIT_OFFSET 30
  246. #define CLKCTRL_VERSION_MAJOR_MASK (0xff << 24)
  247. #define CLKCTRL_VERSION_MAJOR_OFFSET 24
  248. #define CLKCTRL_VERSION_MINOR_MASK (0xff << 16)
  249. #define CLKCTRL_VERSION_MINOR_OFFSET 16
  250. #define CLKCTRL_VERSION_STEP_MASK 0xffff
  251. #define CLKCTRL_VERSION_STEP_OFFSET 0
  252. #endif /* __MX28_REGS_CLKCTRL_H__ */