crm_regs.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. * Copyright 2013 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  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., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. */
  19. #ifndef __ARCH_ARM_MACH_VF610_CCM_REGS_H__
  20. #define __ARCH_ARM_MACH_VF610_CCM_REGS_H__
  21. #ifndef __ASSEMBLY__
  22. /* Clock Controller Module (CCM) */
  23. struct ccm_reg {
  24. u32 ccr;
  25. u32 csr;
  26. u32 ccsr;
  27. u32 cacrr;
  28. u32 cscmr1;
  29. u32 cscdr1;
  30. u32 cscdr2;
  31. u32 cscdr3;
  32. u32 cscmr2;
  33. u32 cscdr4;
  34. u32 ctor;
  35. u32 clpcr;
  36. u32 cisr;
  37. u32 cimr;
  38. u32 ccosr;
  39. u32 cgpr;
  40. u32 ccgr0;
  41. u32 ccgr1;
  42. u32 ccgr2;
  43. u32 ccgr3;
  44. u32 ccgr4;
  45. u32 ccgr5;
  46. u32 ccgr6;
  47. u32 ccgr7;
  48. u32 ccgr8;
  49. u32 ccgr9;
  50. u32 ccgr10;
  51. u32 ccgr11;
  52. u32 cmeor0;
  53. u32 cmeor1;
  54. u32 cmeor2;
  55. u32 cmeor3;
  56. u32 cmeor4;
  57. u32 cmeor5;
  58. u32 cppdsr;
  59. u32 ccowr;
  60. u32 ccpgr0;
  61. u32 ccpgr1;
  62. u32 ccpgr2;
  63. u32 ccpgr3;
  64. };
  65. /* Analog components control digital interface (ANADIG) */
  66. struct anadig_reg {
  67. u32 spare[4];
  68. u32 pll3_ctrl;
  69. u32 resv0[3];
  70. u32 pll7_ctrl;
  71. u32 resv1[3];
  72. u32 pll2_ctrl;
  73. u32 resv2[3];
  74. u32 pll2_ss;
  75. u32 resv3[3];
  76. u32 pll2_num;
  77. u32 resv4[3];
  78. u32 pll2_denom;
  79. u32 resv5[3];
  80. u32 pll4_ctrl;
  81. u32 resv6[3];
  82. u32 pll4_num;
  83. u32 resv7[3];
  84. u32 pll4_denom;
  85. u32 resv[3];
  86. u32 pll6_ctrl;
  87. u32 resv8[3];
  88. u32 pll6_num;
  89. u32 resv9[3];
  90. u32 pll6_denom;
  91. u32 resv10[7];
  92. u32 pll5_ctrl;
  93. u32 resv11[3];
  94. u32 pll3_pfd;
  95. u32 resv12[3];
  96. u32 pll2_pfd;
  97. u32 resv13[3];
  98. u32 reg_1p1;
  99. u32 resv14[3];
  100. u32 reg_3p0;
  101. u32 resv15[3];
  102. u32 reg_2p5;
  103. u32 resv16[7];
  104. u32 ana_misc0;
  105. u32 resv17[3];
  106. u32 ana_misc1;
  107. u32 resv18[63];
  108. u32 anadig_digprog;
  109. u32 resv19[3];
  110. u32 pll1_ctrl;
  111. u32 resv20[3];
  112. u32 pll1_ss;
  113. u32 resv21[3];
  114. u32 pll1_num;
  115. u32 resv22[3];
  116. u32 pll1_denom;
  117. u32 resv23[3];
  118. u32 pll1_pdf;
  119. u32 resv24[3];
  120. u32 pll_lock;
  121. };
  122. #endif
  123. #define CCM_CCR_FIRC_EN (1 << 16)
  124. #define CCM_CCR_OSCNT_MASK 0xff
  125. #define CCM_CCR_OSCNT(v) ((v) & 0xff)
  126. #define CCM_CCSR_PLL2_PFD_CLK_SEL_OFFSET 19
  127. #define CCM_CCSR_PLL2_PFD_CLK_SEL_MASK (0x7 << 19)
  128. #define CCM_CCSR_PLL2_PFD_CLK_SEL(v) (((v) & 0x7) << 19)
  129. #define CCM_CCSR_PLL1_PFD_CLK_SEL_OFFSET 16
  130. #define CCM_CCSR_PLL1_PFD_CLK_SEL_MASK (0x7 << 16)
  131. #define CCM_CCSR_PLL1_PFD_CLK_SEL(v) (((v) & 0x7) << 16)
  132. #define CCM_CCSR_PLL2_PFD4_EN (1 << 15)
  133. #define CCM_CCSR_PLL2_PFD3_EN (1 << 14)
  134. #define CCM_CCSR_PLL2_PFD2_EN (1 << 13)
  135. #define CCM_CCSR_PLL2_PFD1_EN (1 << 12)
  136. #define CCM_CCSR_PLL1_PFD4_EN (1 << 11)
  137. #define CCM_CCSR_PLL1_PFD3_EN (1 << 10)
  138. #define CCM_CCSR_PLL1_PFD2_EN (1 << 9)
  139. #define CCM_CCSR_PLL1_PFD1_EN (1 << 8)
  140. #define CCM_CCSR_DDRC_CLK_SEL(v) ((v) << 6)
  141. #define CCM_CCSR_FAST_CLK_SEL(v) ((v) << 5)
  142. #define CCM_CCSR_SYS_CLK_SEL_OFFSET 0
  143. #define CCM_CCSR_SYS_CLK_SEL_MASK 0x7
  144. #define CCM_CCSR_SYS_CLK_SEL(v) ((v) & 0x7)
  145. #define CCM_CACRR_IPG_CLK_DIV_OFFSET 11
  146. #define CCM_CACRR_IPG_CLK_DIV_MASK (0x3 << 11)
  147. #define CCM_CACRR_IPG_CLK_DIV(v) (((v) & 0x3) << 11)
  148. #define CCM_CACRR_BUS_CLK_DIV_OFFSET 3
  149. #define CCM_CACRR_BUS_CLK_DIV_MASK (0x7 << 3)
  150. #define CCM_CACRR_BUS_CLK_DIV(v) (((v) & 0x7) << 3)
  151. #define CCM_CACRR_ARM_CLK_DIV_OFFSET 0
  152. #define CCM_CACRR_ARM_CLK_DIV_MASK 0x7
  153. #define CCM_CACRR_ARM_CLK_DIV(v) ((v) & 0x7)
  154. #define CCM_CSCMR1_ESDHC1_CLK_SEL_OFFSET 18
  155. #define CCM_CSCMR1_ESDHC1_CLK_SEL_MASK (0x3 << 18)
  156. #define CCM_CSCMR1_ESDHC1_CLK_SEL(v) (((v) & 0x3) << 18)
  157. #define CCM_CSCDR1_RMII_CLK_EN (1 << 24)
  158. #define CCM_CSCDR2_ESDHC1_EN (1 << 29)
  159. #define CCM_CSCDR2_ESDHC1_CLK_DIV_OFFSET 20
  160. #define CCM_CSCDR2_ESDHC1_CLK_DIV_MASK (0xf << 20)
  161. #define CCM_CSCDR2_ESDHC1_CLK_DIV(v) (((v) & 0xf) << 20)
  162. #define CCM_CSCMR2_RMII_CLK_SEL_OFFSET 4
  163. #define CCM_CSCMR2_RMII_CLK_SEL_MASK (0x3 << 4)
  164. #define CCM_CSCMR2_RMII_CLK_SEL(v) (((v) & 0x3) << 4)
  165. #define CCM_CLPCR_SBYOS_MASK (0x1 << 6)
  166. #define CCM_REG_CTRL_MASK 0xffffffff
  167. #define CCM_CCGR0_UART1_CTRL_MASK (0x3 << 16)
  168. #define CCM_CCGR1_USBC0_CTRL_MASK (0x3 << 8)
  169. #define CCM_CCGR1_PIT_CTRL_MASK (0x3 << 14)
  170. #define CCM_CCGR1_WDOGA5_CTRL_MASK (0x3 << 28)
  171. #define CCM_CCGR2_IOMUXC_CTRL_MASK (0x3 << 16)
  172. #define CCM_CCGR2_PORTA_CTRL_MASK (0x3 << 18)
  173. #define CCM_CCGR2_PORTB_CTRL_MASK (0x3 << 20)
  174. #define CCM_CCGR2_PORTC_CTRL_MASK (0x3 << 22)
  175. #define CCM_CCGR2_PORTD_CTRL_MASK (0x3 << 24)
  176. #define CCM_CCGR2_PORTE_CTRL_MASK (0x3 << 26)
  177. #define CCM_CCGR3_ANADIG_CTRL_MASK 0x3
  178. #define CCM_CCGR4_WKUP_CTRL_MASK (0x3 << 20)
  179. #define CCM_CCGR4_CCM_CTRL_MASK (0x3 << 22)
  180. #define CCM_CCGR4_GPC_CTRL_MASK (0x3 << 24)
  181. #define CCM_CCGR6_OCOTP_CTRL_MASK (0x3 << 10)
  182. #define CCM_CCGR6_DDRMC_CTRL_MASK (0x3 << 28)
  183. #define CCM_CCGR7_SDHC1_CTRL_MASK (0x3 << 4)
  184. #define CCM_CCGR9_FEC0_CTRL_MASK 0x3
  185. #define CCM_CCGR9_FEC1_CTRL_MASK (0x3 << 2)
  186. #define ANADIG_PLL3_CTRL_POWERDOWN (1 << 12)
  187. #define ANADIG_PLL3_CTRL_ENABLE (1 << 13)
  188. #define ANADIG_PLL3_CTRL_BYPASS_CLK_SRC (1 << 14)
  189. #define ANADIG_PLL3_CTRL_BYPASS (1 << 16)
  190. #define ANADIG_PLL3_CTRL_ENUSBCLK (1 << 6)
  191. #define ANADIG_PLL2_CTRL_ENABLE (1 << 13)
  192. #define ANADIG_PLL2_CTRL_POWERDOWN (1 << 12)
  193. #define ANADIG_PLL2_CTRL_DIV_SELECT 1
  194. #define ANADIG_PLL1_CTRL_ENABLE (1 << 13)
  195. #define ANADIG_PLL1_CTRL_POWERDOWN (1 << 12)
  196. #define ANADIG_PLL1_CTRL_DIV_SELECT 1
  197. #define ANADIG_3P0_EN_LINREG_MASK 1
  198. #define ANADIG_3P0_EN_BO_MASK (1 << 1)
  199. #define ANADIG_3P0_OK_VDD3P0_MASK (1 << 17)
  200. #define FASE_CLK_FREQ 24000000
  201. #define SLOW_CLK_FREQ 32000
  202. #define PLL1_PFD1_FREQ 500000000
  203. #define PLL1_PFD2_FREQ 452000000
  204. #define PLL1_PFD3_FREQ 396000000
  205. #define PLL1_PFD4_FREQ 528000000
  206. #define PLL1_MAIN_FREQ 528000000
  207. #define PLL2_PFD1_FREQ 500000000
  208. #define PLL2_PFD2_FREQ 396000000
  209. #define PLL2_PFD3_FREQ 339000000
  210. #define PLL2_PFD4_FREQ 413000000
  211. #define PLL2_MAIN_FREQ 528000000
  212. #define PLL3_MAIN_FREQ 480000000
  213. #define PLL3_PFD3_FREQ 298000000
  214. #define PLL5_MAIN_FREQ 500000000
  215. #define ENET_EXTERNAL_CLK 50000000
  216. #define AUDIO_EXTERNAL_CLK 24576000
  217. #endif /*__ARCH_ARM_MACH_VF610_CCM_REGS_H__ */