crm_regs.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*
  2. * (C) Copyright 2009 Freescale Semiconductor, Inc.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __ARCH_ARM_MACH_MX51_CRM_REGS_H__
  23. #define __ARCH_ARM_MACH_MX51_CRM_REGS_H__
  24. #define MXC_CCM_BASE CCM_BASE_ADDR
  25. /* DPLL register mapping structure */
  26. struct mxc_pll_reg {
  27. u32 ctrl;
  28. u32 config;
  29. u32 op;
  30. u32 mfd;
  31. u32 mfn;
  32. u32 mfn_minus;
  33. u32 mfn_plus;
  34. u32 hfs_op;
  35. u32 hfs_mfd;
  36. u32 hfs_mfn;
  37. u32 mfn_togc;
  38. u32 destat;
  39. };
  40. /* Register maping of CCM*/
  41. struct mxc_ccm_reg {
  42. u32 ccr; /* 0x0000 */
  43. u32 ccdr;
  44. u32 csr;
  45. u32 ccsr;
  46. u32 cacrr; /* 0x0010*/
  47. u32 cbcdr;
  48. u32 cbcmr;
  49. u32 cscmr1;
  50. u32 cscmr2; /* 0x0020 */
  51. u32 cscdr1;
  52. u32 cs1cdr;
  53. u32 cs2cdr;
  54. u32 cdcdr; /* 0x0030 */
  55. u32 chscdr;
  56. u32 cscdr2;
  57. u32 cscdr3;
  58. u32 cscdr4; /* 0x0040 */
  59. u32 cwdr;
  60. u32 cdhipr;
  61. u32 cdcr;
  62. u32 ctor; /* 0x0050 */
  63. u32 clpcr;
  64. u32 cisr;
  65. u32 cimr;
  66. u32 ccosr; /* 0x0060 */
  67. u32 cgpr;
  68. u32 CCGR0;
  69. u32 CCGR1;
  70. u32 CCGR2; /* 0x0070 */
  71. u32 CCGR3;
  72. u32 CCGR4;
  73. u32 CCGR5;
  74. u32 CCGR6; /* 0x0080 */
  75. u32 cmeor;
  76. };
  77. /* Define the bits in register CACRR */
  78. #define MXC_CCM_CACRR_ARM_PODF_OFFSET 0
  79. #define MXC_CCM_CACRR_ARM_PODF_MASK 0x7
  80. /* Define the bits in register CBCDR */
  81. #define MXC_CCM_CBCDR_EMI_CLK_SEL (0x1 << 26)
  82. #define MXC_CCM_CBCDR_PERIPH_CLK_SEL (0x1 << 25)
  83. #define MXC_CCM_CBCDR_EMI_PODF_OFFSET 22
  84. #define MXC_CCM_CBCDR_EMI_PODF_MASK (0x7 << 22)
  85. #define MXC_CCM_CBCDR_AXI_B_PODF_OFFSET 19
  86. #define MXC_CCM_CBCDR_AXI_B_PODF_MASK (0x7 << 19)
  87. #define MXC_CCM_CBCDR_AXI_A_PODF_OFFSET 16
  88. #define MXC_CCM_CBCDR_AXI_A_PODF_MASK (0x7 << 16)
  89. #define MXC_CCM_CBCDR_NFC_PODF_OFFSET 13
  90. #define MXC_CCM_CBCDR_NFC_PODF_MASK (0x7 << 13)
  91. #define MXC_CCM_CBCDR_AHB_PODF_OFFSET 10
  92. #define MXC_CCM_CBCDR_AHB_PODF_MASK (0x7 << 10)
  93. #define MXC_CCM_CBCDR_IPG_PODF_OFFSET 8
  94. #define MXC_CCM_CBCDR_IPG_PODF_MASK (0x3 << 8)
  95. #define MXC_CCM_CBCDR_PERCLK_PRED1_OFFSET 6
  96. #define MXC_CCM_CBCDR_PERCLK_PRED1_MASK (0x3 << 6)
  97. #define MXC_CCM_CBCDR_PERCLK_PRED2_OFFSET 3
  98. #define MXC_CCM_CBCDR_PERCLK_PRED2_MASK (0x7 << 3)
  99. #define MXC_CCM_CBCDR_PERCLK_PODF_OFFSET 0
  100. #define MXC_CCM_CBCDR_PERCLK_PODF_MASK 0x7
  101. /* Define the bits in register CSCMR1 */
  102. #define MXC_CCM_CSCMR1_SSI_EXT2_CLK_SEL_OFFSET 30
  103. #define MXC_CCM_CSCMR1_SSI_EXT2_CLK_SEL_MASK (0x3 << 30)
  104. #define MXC_CCM_CSCMR1_SSI_EXT1_CLK_SEL_OFFSET 28
  105. #define MXC_CCM_CSCMR1_SSI_EXT1_CLK_SEL_MASK (0x3 << 28)
  106. #define MXC_CCM_CSCMR1_USB_PHY_CLK_SEL_OFFSET 26
  107. #define MXC_CCM_CSCMR1_USB_PHY_CLK_SEL (0x1 << 26)
  108. #define MXC_CCM_CSCMR1_UART_CLK_SEL_OFFSET 24
  109. #define MXC_CCM_CSCMR1_UART_CLK_SEL_MASK (0x3 << 24)
  110. #define MXC_CCM_CSCMR1_USBOH3_CLK_SEL_OFFSET 22
  111. #define MXC_CCM_CSCMR1_USBOH3_CLK_SEL_MASK (0x3 << 22)
  112. #define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_OFFSET 20
  113. #define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_MASK (0x3 << 20)
  114. #define MXC_CCM_CSCMR1_ESDHC3_CLK_SEL (0x1 << 19)
  115. #define MXC_CCM_CSCMR1_ESDHC4_CLK_SEL (0x1 << 18)
  116. #define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_OFFSET 16
  117. #define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_MASK (0x3 << 16)
  118. #define MXC_CCM_CSCMR1_SSI1_CLK_SEL_OFFSET 14
  119. #define MXC_CCM_CSCMR1_SSI1_CLK_SEL_MASK (0x3 << 14)
  120. #define MXC_CCM_CSCMR1_SSI2_CLK_SEL_OFFSET 12
  121. #define MXC_CCM_CSCMR1_SSI2_CLK_SEL_MASK (0x3 << 12)
  122. #define MXC_CCM_CSCMR1_SSI3_CLK_SEL (0x1 << 11)
  123. #define MXC_CCM_CSCMR1_VPU_RCLK_SEL (0x1 << 10)
  124. #define MXC_CCM_CSCMR1_SSI_APM_CLK_SEL_OFFSET 8
  125. #define MXC_CCM_CSCMR1_SSI_APM_CLK_SEL_MASK (0x3 << 8)
  126. #define MXC_CCM_CSCMR1_TVE_CLK_SEL (0x1 << 7)
  127. #define MXC_CCM_CSCMR1_TVE_EXT_CLK_SEL (0x1 << 6)
  128. #define MXC_CCM_CSCMR1_CSPI_CLK_SEL_OFFSET 4
  129. #define MXC_CCM_CSCMR1_CSPI_CLK_SEL_MASK (0x3 << 4)
  130. #define MXC_CCM_CSCMR1_SPDIF_CLK_SEL_OFFSET 2
  131. #define MXC_CCM_CSCMR1_SPDIF_CLK_SEL_MASK (0x3 << 2)
  132. #define MXC_CCM_CSCMR1_SSI_EXT2_COM_CLK_SEL (0x1 << 1)
  133. #define MXC_CCM_CSCMR1_SSI_EXT1_COM_CLK_SEL 0x1
  134. /* Define the bits in register CSCDR2 */
  135. #define MXC_CCM_CSCDR2_CSPI_CLK_PRED_OFFSET 25
  136. #define MXC_CCM_CSCDR2_CSPI_CLK_PRED_MASK (0x7 << 25)
  137. #define MXC_CCM_CSCDR2_CSPI_CLK_PODF_OFFSET 19
  138. #define MXC_CCM_CSCDR2_CSPI_CLK_PODF_MASK (0x3F << 19)
  139. #define MXC_CCM_CSCDR2_SIM_CLK_PRED_OFFSET 16
  140. #define MXC_CCM_CSCDR2_SIM_CLK_PRED_MASK (0x7 << 16)
  141. #define MXC_CCM_CSCDR2_SIM_CLK_PODF_OFFSET 9
  142. #define MXC_CCM_CSCDR2_SIM_CLK_PODF_MASK (0x3F << 9)
  143. #define MXC_CCM_CSCDR2_SLIMBUS_CLK_PRED_OFFSET 6
  144. #define MXC_CCM_CSCDR2_SLIMBUS_PRED_MASK (0x7 << 6)
  145. #define MXC_CCM_CSCDR2_SLIMBUS_PODF_OFFSET 0
  146. #define MXC_CCM_CSCDR2_SLIMBUS_PODF_MASK 0x3F
  147. /* Define the bits in register CBCMR */
  148. #define MXC_CCM_CBCMR_VPU_AXI_CLK_SEL_OFFSET 14
  149. #define MXC_CCM_CBCMR_VPU_AXI_CLK_SEL_MASK (0x3 << 14)
  150. #define MXC_CCM_CBCMR_PERIPH_CLK_SEL_OFFSET 12
  151. #define MXC_CCM_CBCMR_PERIPH_CLK_SEL_MASK (0x3 << 12)
  152. #define MXC_CCM_CBCMR_DDR_CLK_SEL_OFFSET 10
  153. #define MXC_CCM_CBCMR_DDR_CLK_SEL_MASK (0x3 << 10)
  154. #define MXC_CCM_CBCMR_ARM_AXI_CLK_SEL_OFFSET 8
  155. #define MXC_CCM_CBCMR_ARM_AXI_CLK_SEL_MASK (0x3 << 8)
  156. #define MXC_CCM_CBCMR_IPU_HSP_CLK_SEL_OFFSET 6
  157. #define MXC_CCM_CBCMR_IPU_HSP_CLK_SEL_MASK (0x3 << 6)
  158. #define MXC_CCM_CBCMR_GPU_CLK_SEL_OFFSET 4
  159. #define MXC_CCM_CBCMR_GPU_CLK_SEL_MASK (0x3 << 4)
  160. #define MXC_CCM_CBCMR_PERCLK_LP_APM_CLK_SEL (0x1 << 1)
  161. #define MXC_CCM_CBCMR_PERCLK_IPG_CLK_SEL (0x1 << 0)
  162. /* Define the bits in register CSCDR1 */
  163. #define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_OFFSET 22
  164. #define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_MASK (0x7 << 22)
  165. #define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_OFFSET 19
  166. #define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_MASK (0x7 << 19)
  167. #define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_OFFSET 16
  168. #define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_MASK (0x7 << 16)
  169. #define MXC_CCM_CSCDR1_PGC_CLK_PODF_OFFSET 14
  170. #define MXC_CCM_CSCDR1_PGC_CLK_PODF_MASK (0x3 << 14)
  171. #define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PODF_OFFSET 11
  172. #define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PODF_MASK (0x7 << 11)
  173. #define MXC_CCM_CSCDR1_USBOH3_CLK_PRED_OFFSET 8
  174. #define MXC_CCM_CSCDR1_USBOH3_CLK_PRED_MASK (0x7 << 8)
  175. #define MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET 6
  176. #define MXC_CCM_CSCDR1_USBOH3_CLK_PODF_MASK (0x3 << 6)
  177. #define MXC_CCM_CSCDR1_UART_CLK_PRED_OFFSET 3
  178. #define MXC_CCM_CSCDR1_UART_CLK_PRED_MASK (0x7 << 3)
  179. #define MXC_CCM_CSCDR1_UART_CLK_PODF_OFFSET 0
  180. #define MXC_CCM_CSCDR1_UART_CLK_PODF_MASK 0x7
  181. #endif /* __ARCH_ARM_MACH_MX51_CRM_REGS_H__ */