crmregs-imx3.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /*
  2. * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. * MA 02110-1301, USA.
  18. */
  19. #ifndef __ARCH_ARM_MACH_MX3_CRM_REGS_H__
  20. #define __ARCH_ARM_MACH_MX3_CRM_REGS_H__
  21. #define CKIH_CLK_FREQ 26000000
  22. #define CKIH_CLK_FREQ_27MHZ 27000000
  23. #define CKIL_CLK_FREQ 32768
  24. extern void __iomem *mx3_ccm_base;
  25. /* Register addresses */
  26. #define MXC_CCM_CCMR 0x00
  27. #define MXC_CCM_PDR0 0x04
  28. #define MXC_CCM_PDR1 0x08
  29. #define MX35_CCM_PDR2 0x0C
  30. #define MXC_CCM_RCSR 0x0C
  31. #define MX35_CCM_PDR3 0x10
  32. #define MXC_CCM_MPCTL 0x10
  33. #define MX35_CCM_PDR4 0x14
  34. #define MXC_CCM_UPCTL 0x14
  35. #define MX35_CCM_RCSR 0x18
  36. #define MXC_CCM_SRPCTL 0x18
  37. #define MX35_CCM_MPCTL 0x1C
  38. #define MXC_CCM_COSR 0x1C
  39. #define MX35_CCM_PPCTL 0x20
  40. #define MXC_CCM_CGR0 0x20
  41. #define MX35_CCM_ACMR 0x24
  42. #define MXC_CCM_CGR1 0x24
  43. #define MX35_CCM_COSR 0x28
  44. #define MXC_CCM_CGR2 0x28
  45. #define MX35_CCM_CGR0 0x2C
  46. #define MXC_CCM_WIMR 0x2C
  47. #define MX35_CCM_CGR1 0x30
  48. #define MXC_CCM_LDC 0x30
  49. #define MX35_CCM_CGR2 0x34
  50. #define MXC_CCM_DCVR0 0x34
  51. #define MX35_CCM_CGR3 0x38
  52. #define MXC_CCM_DCVR1 0x38
  53. #define MXC_CCM_DCVR2 0x3C
  54. #define MXC_CCM_DCVR3 0x40
  55. #define MXC_CCM_LTR0 0x44
  56. #define MXC_CCM_LTR1 0x48
  57. #define MXC_CCM_LTR2 0x4C
  58. #define MXC_CCM_LTR3 0x50
  59. #define MXC_CCM_LTBR0 0x54
  60. #define MXC_CCM_LTBR1 0x58
  61. #define MXC_CCM_PMCR0 0x5C
  62. #define MXC_CCM_PMCR1 0x60
  63. #define MXC_CCM_PDR2 0x64
  64. /* Register bit definitions */
  65. #define MXC_CCM_CCMR_WBEN (1 << 27)
  66. #define MXC_CCM_CCMR_CSCS (1 << 25)
  67. #define MXC_CCM_CCMR_PERCS (1 << 24)
  68. #define MXC_CCM_CCMR_SSI1S_OFFSET 18
  69. #define MXC_CCM_CCMR_SSI1S_MASK (0x3 << 18)
  70. #define MXC_CCM_CCMR_SSI2S_OFFSET 21
  71. #define MXC_CCM_CCMR_SSI2S_MASK (0x3 << 21)
  72. #define MXC_CCM_CCMR_LPM_OFFSET 14
  73. #define MXC_CCM_CCMR_LPM_MASK (0x3 << 14)
  74. #define MXC_CCM_CCMR_LPM_WAIT_MX35 (0x1 << 14)
  75. #define MXC_CCM_CCMR_FIRS_OFFSET 11
  76. #define MXC_CCM_CCMR_FIRS_MASK (0x3 << 11)
  77. #define MXC_CCM_CCMR_UPE (1 << 9)
  78. #define MXC_CCM_CCMR_SPE (1 << 8)
  79. #define MXC_CCM_CCMR_MDS (1 << 7)
  80. #define MXC_CCM_CCMR_SBYCS (1 << 4)
  81. #define MXC_CCM_CCMR_MPE (1 << 3)
  82. #define MXC_CCM_CCMR_PRCS_OFFSET 1
  83. #define MXC_CCM_CCMR_PRCS_MASK (0x3 << 1)
  84. #define MXC_CCM_PDR0_CSI_PODF_OFFSET 26
  85. #define MXC_CCM_PDR0_CSI_PODF_MASK (0x3F << 26)
  86. #define MXC_CCM_PDR0_CSI_PRDF_OFFSET 23
  87. #define MXC_CCM_PDR0_CSI_PRDF_MASK (0x7 << 23)
  88. #define MXC_CCM_PDR0_PER_PODF_OFFSET 16
  89. #define MXC_CCM_PDR0_PER_PODF_MASK (0x1F << 16)
  90. #define MXC_CCM_PDR0_HSP_PODF_OFFSET 11
  91. #define MXC_CCM_PDR0_HSP_PODF_MASK (0x7 << 11)
  92. #define MXC_CCM_PDR0_NFC_PODF_OFFSET 8
  93. #define MXC_CCM_PDR0_NFC_PODF_MASK (0x7 << 8)
  94. #define MXC_CCM_PDR0_IPG_PODF_OFFSET 6
  95. #define MXC_CCM_PDR0_IPG_PODF_MASK (0x3 << 6)
  96. #define MXC_CCM_PDR0_MAX_PODF_OFFSET 3
  97. #define MXC_CCM_PDR0_MAX_PODF_MASK (0x7 << 3)
  98. #define MXC_CCM_PDR0_MCU_PODF_OFFSET 0
  99. #define MXC_CCM_PDR0_MCU_PODF_MASK 0x7
  100. #define MXC_CCM_PDR1_USB_PRDF_OFFSET 30
  101. #define MXC_CCM_PDR1_USB_PRDF_MASK (0x3 << 30)
  102. #define MXC_CCM_PDR1_USB_PODF_OFFSET 27
  103. #define MXC_CCM_PDR1_USB_PODF_MASK (0x7 << 27)
  104. #define MXC_CCM_PDR1_FIRI_PRE_PODF_OFFSET 24
  105. #define MXC_CCM_PDR1_FIRI_PRE_PODF_MASK (0x7 << 24)
  106. #define MXC_CCM_PDR1_FIRI_PODF_OFFSET 18
  107. #define MXC_CCM_PDR1_FIRI_PODF_MASK (0x3F << 18)
  108. #define MXC_CCM_PDR1_SSI2_PRE_PODF_OFFSET 15
  109. #define MXC_CCM_PDR1_SSI2_PRE_PODF_MASK (0x7 << 15)
  110. #define MXC_CCM_PDR1_SSI2_PODF_OFFSET 9
  111. #define MXC_CCM_PDR1_SSI2_PODF_MASK (0x3F << 9)
  112. #define MXC_CCM_PDR1_SSI1_PRE_PODF_OFFSET 6
  113. #define MXC_CCM_PDR1_SSI1_PRE_PODF_MASK (0x7 << 6)
  114. #define MXC_CCM_PDR1_SSI1_PODF_OFFSET 0
  115. #define MXC_CCM_PDR1_SSI1_PODF_MASK 0x3F
  116. /* Bit definitions for RCSR */
  117. #define MXC_CCM_RCSR_NF16B 0x80000000
  118. /*
  119. * LTR0 register offsets
  120. */
  121. #define MXC_CCM_LTR0_DIV3CK_OFFSET 1
  122. #define MXC_CCM_LTR0_DIV3CK_MASK (0x3 << 1)
  123. #define MXC_CCM_LTR0_DNTHR_OFFSET 16
  124. #define MXC_CCM_LTR0_DNTHR_MASK (0x3F << 16)
  125. #define MXC_CCM_LTR0_UPTHR_OFFSET 22
  126. #define MXC_CCM_LTR0_UPTHR_MASK (0x3F << 22)
  127. /*
  128. * LTR1 register offsets
  129. */
  130. #define MXC_CCM_LTR1_PNCTHR_OFFSET 0
  131. #define MXC_CCM_LTR1_PNCTHR_MASK 0x3F
  132. #define MXC_CCM_LTR1_UPCNT_OFFSET 6
  133. #define MXC_CCM_LTR1_UPCNT_MASK (0xFF << 6)
  134. #define MXC_CCM_LTR1_DNCNT_OFFSET 14
  135. #define MXC_CCM_LTR1_DNCNT_MASK (0xFF << 14)
  136. #define MXC_CCM_LTR1_LTBRSR_MASK 0x400000
  137. #define MXC_CCM_LTR1_LTBRSR_OFFSET 22
  138. #define MXC_CCM_LTR1_LTBRSR 0x400000
  139. #define MXC_CCM_LTR1_LTBRSH 0x800000
  140. /*
  141. * LTR2 bit definitions. x ranges from 0 for WSW9 to 6 for WSW15
  142. */
  143. #define MXC_CCM_LTR2_WSW_OFFSET(x) (11 + (x) * 3)
  144. #define MXC_CCM_LTR2_WSW_MASK(x) (0x7 << \
  145. MXC_CCM_LTR2_WSW_OFFSET((x)))
  146. #define MXC_CCM_LTR2_EMAC_OFFSET 0
  147. #define MXC_CCM_LTR2_EMAC_MASK 0x1FF
  148. /*
  149. * LTR3 bit definitions. x ranges from 0 for WSW0 to 8 for WSW8
  150. */
  151. #define MXC_CCM_LTR3_WSW_OFFSET(x) (5 + (x) * 3)
  152. #define MXC_CCM_LTR3_WSW_MASK(x) (0x7 << \
  153. MXC_CCM_LTR3_WSW_OFFSET((x)))
  154. #define MXC_CCM_PMCR0_DFSUP1 0x80000000
  155. #define MXC_CCM_PMCR0_DFSUP1_SPLL (0 << 31)
  156. #define MXC_CCM_PMCR0_DFSUP1_MPLL (1 << 31)
  157. #define MXC_CCM_PMCR0_DFSUP0 0x40000000
  158. #define MXC_CCM_PMCR0_DFSUP0_PLL (0 << 30)
  159. #define MXC_CCM_PMCR0_DFSUP0_PDR (1 << 30)
  160. #define MXC_CCM_PMCR0_DFSUP_MASK (0x3 << 30)
  161. #define DVSUP_TURBO 0
  162. #define DVSUP_HIGH 1
  163. #define DVSUP_MEDIUM 2
  164. #define DVSUP_LOW 3
  165. #define MXC_CCM_PMCR0_DVSUP_TURBO (DVSUP_TURBO << 28)
  166. #define MXC_CCM_PMCR0_DVSUP_HIGH (DVSUP_HIGH << 28)
  167. #define MXC_CCM_PMCR0_DVSUP_MEDIUM (DVSUP_MEDIUM << 28)
  168. #define MXC_CCM_PMCR0_DVSUP_LOW (DVSUP_LOW << 28)
  169. #define MXC_CCM_PMCR0_DVSUP_OFFSET 28
  170. #define MXC_CCM_PMCR0_DVSUP_MASK (0x3 << 28)
  171. #define MXC_CCM_PMCR0_UDSC 0x08000000
  172. #define MXC_CCM_PMCR0_UDSC_MASK (1 << 27)
  173. #define MXC_CCM_PMCR0_UDSC_UP (1 << 27)
  174. #define MXC_CCM_PMCR0_UDSC_DOWN (0 << 27)
  175. #define MXC_CCM_PMCR0_VSCNT_1 (0x0 << 24)
  176. #define MXC_CCM_PMCR0_VSCNT_2 (0x1 << 24)
  177. #define MXC_CCM_PMCR0_VSCNT_3 (0x2 << 24)
  178. #define MXC_CCM_PMCR0_VSCNT_4 (0x3 << 24)
  179. #define MXC_CCM_PMCR0_VSCNT_5 (0x4 << 24)
  180. #define MXC_CCM_PMCR0_VSCNT_6 (0x5 << 24)
  181. #define MXC_CCM_PMCR0_VSCNT_7 (0x6 << 24)
  182. #define MXC_CCM_PMCR0_VSCNT_8 (0x7 << 24)
  183. #define MXC_CCM_PMCR0_VSCNT_OFFSET 24
  184. #define MXC_CCM_PMCR0_VSCNT_MASK (0x7 << 24)
  185. #define MXC_CCM_PMCR0_DVFEV 0x00800000
  186. #define MXC_CCM_PMCR0_DVFIS 0x00400000
  187. #define MXC_CCM_PMCR0_LBMI 0x00200000
  188. #define MXC_CCM_PMCR0_LBFL 0x00100000
  189. #define MXC_CCM_PMCR0_LBCF_4 (0x0 << 18)
  190. #define MXC_CCM_PMCR0_LBCF_8 (0x1 << 18)
  191. #define MXC_CCM_PMCR0_LBCF_12 (0x2 << 18)
  192. #define MXC_CCM_PMCR0_LBCF_16 (0x3 << 18)
  193. #define MXC_CCM_PMCR0_LBCF_OFFSET 18
  194. #define MXC_CCM_PMCR0_LBCF_MASK (0x3 << 18)
  195. #define MXC_CCM_PMCR0_PTVIS 0x00020000
  196. #define MXC_CCM_PMCR0_UPDTEN 0x00010000
  197. #define MXC_CCM_PMCR0_UPDTEN_MASK (0x1 << 16)
  198. #define MXC_CCM_PMCR0_FSVAIM 0x00008000
  199. #define MXC_CCM_PMCR0_FSVAI_OFFSET 13
  200. #define MXC_CCM_PMCR0_FSVAI_MASK (0x3 << 13)
  201. #define MXC_CCM_PMCR0_DPVCR 0x00001000
  202. #define MXC_CCM_PMCR0_DPVV 0x00000800
  203. #define MXC_CCM_PMCR0_WFIM 0x00000400
  204. #define MXC_CCM_PMCR0_DRCE3 0x00000200
  205. #define MXC_CCM_PMCR0_DRCE2 0x00000100
  206. #define MXC_CCM_PMCR0_DRCE1 0x00000080
  207. #define MXC_CCM_PMCR0_DRCE0 0x00000040
  208. #define MXC_CCM_PMCR0_DCR 0x00000020
  209. #define MXC_CCM_PMCR0_DVFEN 0x00000010
  210. #define MXC_CCM_PMCR0_PTVAIM 0x00000008
  211. #define MXC_CCM_PMCR0_PTVAI_OFFSET 1
  212. #define MXC_CCM_PMCR0_PTVAI_MASK (0x3 << 1)
  213. #define MXC_CCM_PMCR0_DPTEN 0x00000001
  214. #define MXC_CCM_PMCR1_DVGP_OFFSET 0
  215. #define MXC_CCM_PMCR1_DVGP_MASK (0xF)
  216. #define MXC_CCM_PMCR1_PLLRDIS (0x1 << 7)
  217. #define MXC_CCM_PMCR1_EMIRQ_EN (0x1 << 8)
  218. #define MXC_CCM_DCVR_ULV_MASK (0x3FF << 22)
  219. #define MXC_CCM_DCVR_ULV_OFFSET 22
  220. #define MXC_CCM_DCVR_LLV_MASK (0x3FF << 12)
  221. #define MXC_CCM_DCVR_LLV_OFFSET 12
  222. #define MXC_CCM_DCVR_ELV_MASK (0x3FF << 2)
  223. #define MXC_CCM_DCVR_ELV_OFFSET 2
  224. #define MXC_CCM_PDR2_MST2_PDF_MASK (0x3F << 7)
  225. #define MXC_CCM_PDR2_MST2_PDF_OFFSET 7
  226. #define MXC_CCM_PDR2_MST1_PDF_MASK 0x3F
  227. #define MXC_CCM_PDR2_MST1_PDF_OFFSET 0
  228. #define MXC_CCM_COSR_CLKOSEL_MASK 0x0F
  229. #define MXC_CCM_COSR_CLKOSEL_OFFSET 0
  230. #define MXC_CCM_COSR_CLKOUTDIV_MASK (0x07 << 6)
  231. #define MXC_CCM_COSR_CLKOUTDIV_OFFSET 6
  232. #define MXC_CCM_COSR_CLKOEN (1 << 9)
  233. /*
  234. * PMCR0 register offsets
  235. */
  236. #define MXC_CCM_PMCR0_LBFL_OFFSET 20
  237. #define MXC_CCM_PMCR0_DFSUP0_OFFSET 30
  238. #define MXC_CCM_PMCR0_DFSUP1_OFFSET 31
  239. #endif /* __ARCH_ARM_MACH_MX3_CRM_REGS_H__ */