imx_clock.h 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. /*
  2. * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
  3. * SPDX-License-Identifier: BSD-3-Clause
  4. */
  5. #ifndef IMX_CLOCK_H
  6. #define IMX_CLOCK_H
  7. #include <stdint.h>
  8. #include <stdbool.h>
  9. struct ccm_pll_ctrl {
  10. uint32_t ccm_pll_ctrl;
  11. uint32_t ccm_pll_ctrl_set;
  12. uint32_t ccm_pll_ctrl_clr;
  13. uint32_t ccm_pll_ctrl_tog;
  14. };
  15. /* Clock gate control */
  16. struct ccm_clk_gate_ctrl {
  17. uint32_t ccm_ccgr;
  18. uint32_t ccm_ccgr_set;
  19. uint32_t ccm_ccgr_clr;
  20. uint32_t ccm_ccgr_tog;
  21. };
  22. #define CCM_CCGR_SETTING0_DOM_CLK_NONE 0
  23. #define CCM_CCGR_SETTING0_DOM_CLK_RUN BIT(0)
  24. #define CCM_CCGR_SETTING0_DOM_CLK_RUN_WAIT BIT(1)
  25. #define CCM_CCGR_SETTING0_DOM_CLK_ALWAYS (BIT(1) | BIT(0))
  26. #define CCM_CCGR_SETTING1_DOM_CLK_NONE 0
  27. #define CCM_CCGR_SETTING1_DOM_CLK_RUN BIT(4)
  28. #define CCM_CCGR_SETTING1_DOM_CLK_RUN_WAIT BIT(5)
  29. #define CCM_CCGR_SETTING1_DOM_CLK_ALWAYS (BIT(5) | BIT(4))
  30. #define CCM_CCGR_SETTING2_DOM_CLK_NONE 0
  31. #define CCM_CCGR_SETTING2_DOM_CLK_RUN BIT(8)
  32. #define CCM_CCGR_SETTING2_DOM_CLK_RUN_WAIT BIT(9)
  33. #define CCM_CCGR_SETTING2_DOM_CLK_ALWAYS (BIT(9) | BIT(8))
  34. #define CCM_CCGR_SETTING3_DOM_CLK_NONE 0
  35. #define CCM_CCGR_SETTING3_DOM_CLK_RUN BIT(12)
  36. #define CCM_CCGR_SETTING3_DOM_CLK_RUN_WAIT BIT(13)
  37. #define CCM_CCGR_SETTING3_DOM_CLK_ALWAYS (BIT(13) | BIT(12))
  38. enum {
  39. CCM_CCGR_ID_ADC = 32,
  40. CCM_CCGR_ID_AIPS1TZ = 10,
  41. CCM_CCGR_ID_AIPS2TZ = 11,
  42. CCM_CCGR_ID_AIPS3TZ = 12,
  43. CCM_CCGR_ID_APBHDMA = 20,
  44. CCM_CCGR_ID_CAAM = 36,
  45. CCM_CCGR_ID_CM4 = 1,
  46. CCM_CCGR_ID_CSI = 73,
  47. CCM_CCGR_ID_CSU = 45,
  48. CCM_CCGR_ID_DAP = 47,
  49. CCM_CCGR_ID_DBGMON = 46,
  50. CCM_CCGR_ID_DDRC = 19,
  51. CCM_CCGR_ID_ECSPI1 = 120,
  52. CCM_CCGR_ID_ECSPI2 = 121,
  53. CCM_CCGR_ID_ECSPI3 = 122,
  54. CCM_CCGR_ID_ECSPI4 = 123,
  55. CCM_CCGR_ID_EIM = 22,
  56. CCM_CCGR_ID_ENET1 = 112,
  57. CCM_CCGR_ID_ENET2 = 113,
  58. CCM_CCGR_ID_EPDC = 74,
  59. CCM_CCGR_ID_FLEXCAN1 = 116,
  60. CCM_CCGR_ID_FLEXCAN2 = 117,
  61. CCM_CCGR_ID_FLEXTIMER1 = 128,
  62. CCM_CCGR_ID_FLEXTIMER2 = 129,
  63. CCM_CCGR_ID_GPIO1 = 160,
  64. CCM_CCGR_ID_GPIO2 = 161,
  65. CCM_CCGR_ID_GPIO3 = 162,
  66. CCM_CCGR_ID_GPIO4 = 163,
  67. CCM_CCGR_ID_GPIO5 = 164,
  68. CCM_CCGR_ID_GPIO6 = 165,
  69. CCM_CCGR_ID_GPIO7 = 166,
  70. CCM_CCGR_ID_GPT1 = 124,
  71. CCM_CCGR_ID_GPT2 = 125,
  72. CCM_CCGR_ID_GPT3 = 126,
  73. CCM_CCGR_ID_GPT4 = 127,
  74. CCM_CCGR_ID_I2C1 = 136,
  75. CCM_CCGR_ID_I2C2 = 137,
  76. CCM_CCGR_ID_I2C3 = 138,
  77. CCM_CCGR_ID_I2C4 = 139,
  78. CCM_CCGR_ID_IOMUXC1 = 168,
  79. CCM_CCGR_ID_IOMUXC2 = 169,
  80. CCM_CCGR_ID_KPP = 120,
  81. CCM_CCGR_ID_LCDIF = 75,
  82. CCM_CCGR_ID_MIPI_CSI = 100,
  83. CCM_CCGR_ID_MIPI_DSI = 101,
  84. CCM_CCGR_ID_MIPI_PHY = 102,
  85. CCM_CCGR_ID_MU = 39,
  86. CCM_CCGR_ID_OCOTP = 35,
  87. CCM_CCGR_ID_OCRAM = 17,
  88. CCM_CCGR_ID_OCRAM_S = 18,
  89. CCM_CCGR_ID_PCIE = 96,
  90. CCM_CCGR_ID_PCIE_PHY = 96,
  91. CCM_CCGR_ID_PERFMON1 = 68,
  92. CCM_CCGR_ID_PERFMON2 = 69,
  93. CCM_CCGR_ID_PWM1 = 132,
  94. CCM_CCGR_ID_PWM2 = 133,
  95. CCM_CCGR_ID_PWM3 = 134,
  96. CCM_CCGR_ID_PMM4 = 135,
  97. CCM_CCGR_ID_PXP = 76,
  98. CCM_CCGR_ID_QOS1 = 42,
  99. CCM_CCGR_ID_QOS2 = 43,
  100. CCM_CCGR_ID_QOS3 = 44,
  101. CCM_CCGR_ID_QUADSPI = 21,
  102. CCM_CCGR_ID_RDC = 38,
  103. CCM_CCGR_ID_ROMCP = 16,
  104. CCM_CCGR_ID_SAI1 = 140,
  105. CCM_CCGR_ID_SAI2 = 141,
  106. CCM_CCGR_ID_SAI3 = 142,
  107. CCM_CCGR_ID_SCTR = 34,
  108. CCM_CCGR_ID_SDMA = 72,
  109. CCM_CCGR_ID_SEC = 49,
  110. CCM_CCGR_ID_SEMA42_1 = 64,
  111. CCM_CCGR_ID_SEMA42_2 = 65,
  112. CCM_CCGR_ID_SIM_DISPLAY = 5,
  113. CCM_CCGR_ID_SIM_ENET = 6,
  114. CCM_CCGR_ID_SIM_M = 7,
  115. CCM_CCGR_ID_SIM_MAIN = 4,
  116. CCM_CCGR_ID_SIM_S = 8,
  117. CCM_CCGR_ID_SIM_WAKEUP = 9,
  118. CCM_CCGR_ID_SIM1 = 144,
  119. CCM_CCGR_ID_SIM2 = 145,
  120. CCM_CCGR_ID_SIM_NAND = 20,
  121. CCM_CCGR_ID_DISPLAY_CM4 = 1,
  122. CCM_CCGR_ID_DRAM = 19,
  123. CCM_CCGR_ID_SNVS = 37,
  124. CCM_CCGR_ID_SPBA = 12,
  125. CCM_CCGR_ID_TRACE = 48,
  126. CCM_CCGR_ID_TZASC = 19,
  127. CCM_CCGR_ID_UART1 = 148,
  128. CCM_CCGR_ID_UART2 = 149,
  129. CCM_CCGR_ID_UART3 = 150,
  130. CCM_CCGR_ID_UART4 = 151,
  131. CCM_CCGR_ID_UART5 = 152,
  132. CCM_CCGR_ID_UART6 = 153,
  133. CCM_CCGR_ID_UART7 = 154,
  134. CCM_CCGR_ID_USB_HS = 40,
  135. CCM_CCGR_ID_USB_IPG = 104,
  136. CCM_CCGR_ID_USB_PHY_480MCLK = 105,
  137. CCM_CCGR_ID_USB_OTG1_PHY = 106,
  138. CCM_CCGR_ID_USB_OTG2_PHY = 107,
  139. CCM_CCGR_ID_USBHDC1 = 108,
  140. CCM_CCGR_ID_USBHDC2 = 109,
  141. CCM_CCGR_ID_USBHDC3 = 110,
  142. CCM_CCGR_ID_WDOG1 = 156,
  143. CCM_CCGR_ID_WDOG2 = 157,
  144. CCM_CCGR_ID_WDOG3 = 158,
  145. CCM_CCGR_ID_WDOG4 = 159,
  146. };
  147. /* Clock target block */
  148. struct ccm_target_root_ctrl {
  149. uint32_t ccm_target_root;
  150. uint32_t ccm_target_root_set;
  151. uint32_t ccm_target_root_clr;
  152. uint32_t ccm_target_root_tog;
  153. uint32_t ccm_misc;
  154. uint32_t ccm_misc_set;
  155. uint32_t ccm_misc_clr;
  156. uint32_t ccm_misc_tog;
  157. uint32_t ccm_post;
  158. uint32_t ccm_post_set;
  159. uint32_t ccm_post_clr;
  160. uint32_t ccm_post_tog;
  161. uint32_t ccm_pre;
  162. uint32_t ccm_pre_set;
  163. uint32_t ccm_pre_clr;
  164. uint32_t ccm_pre_tog;
  165. uint32_t reserved[0x0c];
  166. uint32_t ccm_access_ctrl;
  167. uint32_t ccm_access_ctrl_set;
  168. uint32_t ccm_access_ctrl_clr;
  169. uint32_t ccm_access_ctrl_tog;
  170. };
  171. #define CCM_TARGET_ROOT_ENABLE BIT(28)
  172. #define CCM_TARGET_MUX(x) (((x) - 1) << 24)
  173. #define CCM_TARGET_PRE_PODF(x) (((x) - 1) << 16)
  174. #define CCM_TARGET_POST_PODF(x) ((x) - 1)
  175. /* Target root MUX values - selects the clock source for a block */
  176. /* ARM_A7_CLK_ROOT */
  177. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_OSC_24M 0
  178. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_ARM_PLL BIT(24)
  179. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_ENET_PLL_DIV2 BIT(25)
  180. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_DDR_PLL (BIT(25) | BIT(24))
  181. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_SYS_PLL BIT(26)
  182. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_SYS_PLL_PFD0 (BIT(26) | BIT(24))
  183. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  184. #define CCM_TRGT_MUX_ARM_A7_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  185. /* ARM_M4_CLK_ROOT */
  186. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOT_OSC_24M 0
  187. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  188. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOT_ENET_PLL_DIV4 BIT(25)
  189. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOT_SYS_PLL_PFD2 (BIT(25) | BIT(24))
  190. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOT_DDR_PLL_DIV2 BIT(26)
  191. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  192. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOTV_IDEO_PLL (BIT(26) | BIT(25))
  193. #define CCM_TRGT_MUX_ARM_M4_CLK_ROOTUSB_PLL ((BIT(26) | BIT(25) | BIT(24))
  194. /* MAIN_AXI_CLK_ROOT */
  195. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_OSC_24M 0
  196. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_SYS_PLL_PFD1 BIT(24)
  197. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  198. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_ENET_PLL_DIV4 (BIT(25) | BIT(24))
  199. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_SYS_PLL_PFD5 BIT(26)
  200. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  201. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  202. #define CCM_TRGT_MUX_MAIN_AXI_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  203. /* DISP_AXI_CLK_ROOT */
  204. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_OSC_24M 0
  205. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_SYS_PLL_PFD1 BIT(24)
  206. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  207. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_ENET_PLL_DIV4 (BIT(25) | BIT(24))
  208. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_SYS_PLL_PFD6 BIT(26)
  209. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_SYS_PLL_PFD7 (BIT(26) | BIT(24))
  210. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  211. #define CCM_TRGT_MUX_DISP_AXI_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  212. /* ENET_AXI_CLK_ROOT */
  213. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_OSC_24M 0
  214. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_SYS_PLL_PFD2 BIT(24)
  215. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  216. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_ENET_PLL_DIV4 (BIT(25) | BIT(24))
  217. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_SYS_PLL_DIV2 BIT(26)
  218. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  219. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  220. #define CCM_TRGT_MUX_ENET_AXI_CLK_ROOT_SYS_PLL_PFD4 ((BIT(26) | BIT(25) | BIT(24))
  221. /* NAND_USDHC_BUS_CLK_ROOT */
  222. #define CM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_OSC_24M 0
  223. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_AHB BIT(24)
  224. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  225. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_SYS_PLL_DIV2 (BIT(25) | BIT(24))
  226. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(26)
  227. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_SYS_PLL_PFD6 (BIT(26) | BIT(24))
  228. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_ENET_PLL_DIV4 (BIT(26) | BIT(25))
  229. #define CCM_TRGT_MUX_NAND_USDHC_BUS_CLK_ROOT_AUDIO_PLL ((BIT(26) | BIT(25) | BIT(24))
  230. /* AHB_CLK_ROOT */
  231. #define CCM_TRGT_MUX_AHB_CLK_ROOT_OSC_24M 0
  232. #define CCM_TRGT_MUX_AHB_CLK_ROOT_SYS_PLL_PFD2 BIT(24)
  233. #define CCM_TRGT_MUX_AHB_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  234. #define CCM_TRGT_MUX_AHB_CLK_ROOT_SYS_PLL_PFD0 (BIT(25) | BIT(24))
  235. #define CCM_TRGT_MUX_AHB_CLK_ROOT_ENET_PLL_DIV8 BIT(26)
  236. #define CCM_TRGT_MUX_AHB_CLK_ROOT_USB_PLL (BIT(26) | BIT(24))
  237. #define CCM_TRGT_MUX_AHB_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  238. #define CCM_TRGT_MUX_AHB_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  239. /* IPG_CLK_ROOT */
  240. #define CCM_TRGT_MUX_IPG_CLK_ROOT_AHB_CLK_ROOT 0
  241. /* DRAM_PHYM_CLK_ROOT */
  242. #define CCM_TRGT_MUX_DRAM_PHYM_CLK_ROOT_DDR_PLL 0
  243. #define CCM_TRGT_MUX_DRAM_PHYM_CLK_ROOT_DRAM_PHYM_ALT_CLK_ROOT BIT(24)
  244. /* DRAM_CLK_ROOT */
  245. #define CCM_TRGT_MUX_DRAM_CLK_ROOT_DDR_PLL 0
  246. #define CCM_TRGT_MUX_DRAM_CLK_ROOT_DRAM_ALT_CLK_ROOT BIT(24)
  247. /* DRAM_PHYM_ALT_CLK_ROOT */
  248. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_OSC_24M 0
  249. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_DDR_PLL_DIV2 BIT(24)
  250. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_SYS_PLL BIT(25)
  251. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_ENET_PLL_DIV2 (BIT(25) | BIT(24))
  252. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_USB_PLL BIT(26)
  253. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_SYS_PLL_PFD7 (BIT(26) | BIT(24))
  254. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  255. #define CCM_TRGT_MUX_DRAM_PHYM_ALT_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  256. /* DRAM_ALT_CLK_ROOT */
  257. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_OSC_24M 0
  258. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_DDR_PLL_DIV2 BIT(24)
  259. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_SYS_PLL BIT(25)
  260. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_ENET_PLL_DIV4 (BIT(25) | BIT(24))
  261. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_USB_PLL BIT(26)
  262. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_SYS_PLL_PFD0 (BIT(26) | BIT(24))
  263. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  264. #define CCM_TRGT_MUX_DRAM_ALT_CLK_ROOT_SYS_PLL_PFD2 ((BIT(26) | BIT(25) | BIT(24))
  265. /* USB_HSIC_CLK_ROOT */
  266. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_OSC_24M 0
  267. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL BIT(24)
  268. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_USB_PLL BIT(25)
  269. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL_PFD3 (BIT(25) | BIT(24))
  270. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL_PFD4 BIT(26)
  271. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL_PFD5 (BIT(26) | BIT(24))
  272. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL_PFD6 (BIT(26) | BIT(25))
  273. #define CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  274. /* LCDIF_PIXEL_CLK_ROOT */
  275. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_OSC_24M 0
  276. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_SYS_PLL_PFD5 BIT(24)
  277. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  278. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_EXT_CLK3 (BIT(25) | BIT(24))
  279. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_SYS_PLL_PFD4 BIT(26)
  280. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_SYS_PLL_PFD2 (BIT(26) | BIT(24))
  281. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  282. #define CCM_TRGT_MUX_LCDIF_PIXEL_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  283. /* MIPI_DSI_CLK_ROOT */
  284. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_OSC_24M 0
  285. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_SYS_PLL_PFD5 BIT(24)
  286. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_SYS_PLL_PFD3 BIT(25)
  287. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_SYS_PLL (BIT(25) | BIT(24))
  288. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_SYS_PLL_PFD0_DIV2 BIT(26)
  289. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_DDR_PLL_DIV2 (BIT(26) | BIT(24))
  290. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  291. #define CCM_TRGT_MUX_MIPI_DSI_CLK_ROOT_AUDIO_PLL ((BIT(26) | BIT(25) | BIT(24))
  292. /* MIPI_CSI_CLK_ROOT */
  293. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_OSC_24M 0
  294. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_SYS_PLL_PFD4 BIT(24)
  295. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_SYS_PLL_PFD3 BIT(25)
  296. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_SYS_PLL (BIT(25) | BIT(24))
  297. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_SYS_PLL_PFD0_DIV2 BIT(26)
  298. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_DDR_PLL_DIV2 (BIT(26) | BIT(24))
  299. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  300. #define CCM_TRGT_MUX_MIPI_CSI_CLK_ROOT_AUDIO_PLL ((BIT(26) | BIT(25) | BIT(24))
  301. /* MIPI_DPHY_REF_CLK_ROOT */
  302. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_OSC_24M 0
  303. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  304. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  305. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_SYS_PLL_PFD5 (BIT(25) | BIT(24))
  306. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_REF_1M BIT(26)
  307. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  308. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  309. #define CCM_TRGT_MUX_MIPI_DPHY_REF_CLK_ROOT_EXT_CLK3 ((BIT(26) | BIT(25) | BIT(24))
  310. /* SAI1_CLK_ROOT */
  311. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_OSC_24M 0
  312. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  313. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_AUDIO_PLL BIT(25)
  314. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  315. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_VIDEO_PLL BIT(26)
  316. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  317. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_ENET_PLL_DIV8 (BIT(26) | BIT(25))
  318. #define CCM_TRGT_MUX_SAI1_CLK_ROOT_EXT_CLK2 ((BIT(26) | BIT(25) | BIT(24))
  319. /* SAI2_CLK_ROOT */
  320. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_OSC_24M 0
  321. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  322. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_AUDIO_PLL BIT(25)
  323. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  324. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_VIDEO_PLL BIT(26)
  325. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  326. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_ENET_PLL_DIV8 (BIT(26) | BIT(25))
  327. #define CCM_TRGT_MUX_SAI2_CLK_ROOT_EXT_CLK2 ((BIT(26) | BIT(25) | BIT(24))
  328. /* SAI3_CLK_ROOT */
  329. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_OSC_24M 0
  330. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  331. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_AUDIO_PLL BIT(25)
  332. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  333. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_VIDEO_PLL BIT(26)
  334. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  335. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_ENET_PLL_DIV8 (BIT(26) | BIT(25))
  336. #define CCM_TRGT_MUX_SAI3_CLK_ROOT_EXT_CLK3 ((BIT(26) | BIT(25) | BIT(24))
  337. /* ENET1_REF_CLK_ROOT */
  338. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_OSC_24M 0
  339. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_ENET_PLL_DIV8 BIT(24)
  340. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_ENET_PLL_DIV20 BIT(25)
  341. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_ENET_PLL_DIV40 (BIT(25) | BIT(24))
  342. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_SYS_PLL_DIV4 BIT(26)
  343. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  344. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  345. #define CCM_TRGT_MUX_ENET1_REF_CLK_ROOT_EXT_CLK4 ((BIT(26) | BIT(25) | BIT(24))
  346. /* ENET1_TIME_CLK_ROOT */
  347. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_OSC_24M 0
  348. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  349. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_AUDIO_PLL BIT(25)
  350. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_EXT_CLK1 (BIT(25) | BIT(24))
  351. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_EXT_CLK2 BIT(26)
  352. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_EXT_CLK3 (BIT(26) | BIT(24))
  353. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_EXT_CLK4 (BIT(26) | BIT(25))
  354. #define CCM_TRGT_MUX_ENET1_TIME_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  355. /* ENET_PHY_REF_CLK_ROOT */
  356. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_OSC_24M 0
  357. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_ENET_PLL_DIV40 BIT(24)
  358. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_ENET_PLL_DIV20 BIT(25)
  359. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_ENET_PLL_DIV8 (BIT(25) | BIT(24))
  360. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_DDR_PLL_DIV2 BIT(26)
  361. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  362. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  363. #define CCM_TRGT_MUX_ENET_PHY_REF_CLK_ROOT_SYS_PLL_PFD3 ((BIT(26) | BIT(25) | BIT(24))
  364. /* EIM_CLK_ROOT */
  365. #define CCM_TRGT_MUX_EIM_CLK_ROOT_OSC_24M 0
  366. #define CCM_TRGT_MUX_EIM_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  367. #define CCM_TRGT_MUX_EIM_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  368. #define CCM_TRGT_MUX_EIM_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  369. #define CCM_TRGT_MUX_EIM_CLK_ROOT_SYS_PLL_PFD2 BIT(26)
  370. #define CCM_TRGT_MUX_EIM_CLK_ROOT_SYS_PLL_PFD3 (BIT(26) | BIT(24))
  371. #define CCM_TRGT_MUX_EIM_CLK_ROOT_ENET_PLL_DIV8 (BIT(26) | BIT(25))
  372. #define CCM_TRGT_MUX_EIM_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  373. /* NAND_CLK_ROOT */
  374. #define CCM_TRGT_MUX_NAND_CLK_ROOT_OSC_24M 0
  375. #define CCM_TRGT_MUX_NAND_CLK_ROOT_SYS_PLL BIT(24)
  376. #define CCM_TRGT_MUX_NAND_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  377. #define CCM_TRGT_MUX_NAND_CLK_ROOT_SYS_PLL_PFD0 (BIT(25) | BIT(24))
  378. #define CCM_TRGT_MUX_NAND_CLK_ROOT_SYS_PLL_PFD3 BIT(26)
  379. #define CCM_TRGT_MUX_NAND_CLK_ROOT_ENET_PLL_DIV2 (BIT(26) | BIT(24))
  380. #define CCM_TRGT_MUX_NAND_CLK_ROOT_ENET_PLL_DIV4 (BIT(26) | BIT(25))
  381. #define CCM_TRGT_MUX_NAND_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  382. /* QSPI_CLK_ROOT */
  383. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_OSC_24M 0
  384. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_SYS_PLL_PFD4 BIT(24)
  385. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  386. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_ENET_PLL_DIV2 (BIT(25) | BIT(24))
  387. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_SYS_PLL_PFD3 BIT(26)
  388. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_SYS_PLL_PFD2 (BIT(26) | BIT(24))
  389. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_SYS_PLL_PFD6 (BIT(26) | BIT(25))
  390. #define CCM_TRGT_MUX_QSPI_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  391. /* USDHC1_CLK_ROOT */
  392. #define CM_TRGT_MUX_USDHC1_CLK_ROOT_OSC_24M 0
  393. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_SYS_PLL_PFD0 BIT(24)
  394. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  395. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_ENET_PLL_DIV2 (BIT(25) | BIT(24))
  396. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_SYS_PLL_PFD4 BIT(26)
  397. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_SYS_PLL_PFD2 (BIT(26) | BIT(24))
  398. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_SYS_PLL_PFD6 (BIT(26) | BIT(25))
  399. #define CCM_TRGT_MUX_USDHC1_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  400. /* USDHC2_CLK_ROOT */
  401. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_OSC_24M 0
  402. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_SYS_PLL_PFD0 BIT(24)
  403. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  404. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_ENET_PLL_DIV2 (BIT(25) | BIT(24))
  405. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_SYS_PLL_PFD4 BIT(26)
  406. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_SYS_PLL_PFD2 (BIT(26) | BIT(24))
  407. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_SYS_PLL_PFD6 (BIT(26) | BIT(25))
  408. #define CCM_TRGT_MUX_USDHC2_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  409. /* USDHC3_CLK_ROOT */
  410. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_OSC_24M 0
  411. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_SYS_PLL_PFD0 BIT(24)
  412. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  413. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_ENET_PLL_DIV2 (BIT(25) | BIT(24))
  414. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_SYS_PLL_PFD4 BIT(26)
  415. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_SYS_PLL_PFD2 (BIT(26) | BIT(24))
  416. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_SYS_PLL_PFD6 (BIT(26) | BIT(25))
  417. #define CCM_TRGT_MUX_USDHC3_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  418. /* CAN1_CLK_ROOT */
  419. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_OSC_24M 0
  420. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  421. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  422. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_SYS_PLL (BIT(25) | BIT(24))
  423. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_ENET_PLL_DIV25 BIT(26)
  424. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_USB_PLL (BIT(26) | BIT(24))
  425. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_EXT_CLK1 (BIT(26) | BIT(25))
  426. #define CCM_TRGT_MUX_CAN1_CLK_ROOT_EXT_CLK4 ((BIT(26) | BIT(25) | BIT(24))
  427. /* CAN2_CLK_ROOT */
  428. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_OSC_24M 0
  429. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  430. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_DDR_PLL_DIV2 BIT(25)
  431. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_SYS_PLL (BIT(25) | BIT(24))
  432. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_ENET_PLL_DIV25 BIT(26)
  433. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_USB_PLL (BIT(26) | BIT(24))
  434. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_EXT_CLK1 (BIT(26) | BIT(25))
  435. #define CCM_TRGT_MUX_CAN2_CLK_ROOT_EXT_CLK3 ((BIT(26) | BIT(25) | BIT(24))
  436. /* I2C1_CLK_ROOT */
  437. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_OSC_24M 0
  438. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  439. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_ENET_PLL_DIV20 BIT(25)
  440. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  441. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_AUDIO_PLL BIT(26)
  442. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(24))
  443. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_USB_PLL (BIT(26) | BIT(25))
  444. #define CCM_TRGT_MUX_I2C1_CLK_ROOT_SYS_PLL_PFD2_DIV2 ((BIT(26) | BIT(25) | BIT(24))
  445. /* I2C2_CLK_ROOT */
  446. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_OSC_24M 0
  447. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  448. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_ENET_PLL_DIV20 BIT(25)
  449. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  450. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_AUDIO_PLL BIT(26)
  451. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(24))
  452. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_USB_PLL (BIT(26) | BIT(25))
  453. #define CCM_TRGT_MUX_I2C2_CLK_ROOT_SYS_PLL_PFD2_DIV2 ((BIT(26) | BIT(25) | BIT(24))
  454. /* I2C3_CLK_ROOT */
  455. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_OSC_24M 0
  456. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  457. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_ENET_PLL_DIV20 BIT(25)
  458. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  459. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_AUDIO_PLL BIT(26)
  460. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(24))
  461. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_USB_PLL (BIT(26) | BIT(25))
  462. #define CCM_TRGT_MUX_I2C3_CLK_ROOT_SYS_PLL_PFD2_DIV2 ((BIT(26) | BIT(25) | BIT(24))
  463. /* I2C4_CLK_ROOT */
  464. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_OSC_24M 0
  465. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_SYS_PLL_DIV4 BIT(24)
  466. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_ENET_PLL_DIV20 BIT(25)
  467. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  468. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_AUDIO_PLL BIT(26)
  469. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(24))
  470. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_USB_PLL (BIT(26) | BIT(25))
  471. #define CCM_TRGT_MUX_I2C4_CLK_ROOT_SYS_PLL_PFD2_DIV2 ((BIT(26) | BIT(25) | BIT(24))
  472. /* UART1_CLK_ROOT */
  473. #define CCM_TRGT_MUX_UART1_CLK_ROOT_OSC_24M 0
  474. #define CCM_TRGT_MUX_UART1_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  475. #define CCM_TRGT_MUX_UART1_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  476. #define CCM_TRGT_MUX_UART1_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  477. #define CCM_TRGT_MUX_UART1_CLK_ROOT_SYS_PLL BIT(26)
  478. #define CCM_TRGT_MUX_UART1_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  479. #define CCM_TRGT_MUX_UART1_CLK_ROOT_EXT_CLK4 (BIT(26) | BIT(25))
  480. #define CCM_TRGT_MUX_UART1_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  481. /* UART2_CLK_ROOT */
  482. #define CCM_TRGT_MUX_UART2_CLK_ROOT_OSC_24M 0
  483. #define CCM_TRGT_MUX_UART2_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  484. #define CCM_TRGT_MUX_UART2_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  485. #define CCM_TRGT_MUX_UART2_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  486. #define CCM_TRGT_MUX_UART2_CLK_ROOT_SYS_PLL BIT(26)
  487. #define CCM_TRGT_MUX_UART2_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  488. #define CCM_TRGT_MUX_UART2_CLK_ROOT_EXT_CLK3 (BIT(26) | BIT(25))
  489. #define CCM_TRGT_MUX_UART2_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  490. /* UART3_CLK_ROOT */
  491. #define CCM_TRGT_MUX_UART3_CLK_ROOT_OSC_24M 0
  492. #define CCM_TRGT_MUX_UART3_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  493. #define CCM_TRGT_MUX_UART3_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  494. #define CCM_TRGT_MUX_UART3_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  495. #define CCM_TRGT_MUX_UART3_CLK_ROOT_SYS_PLL BIT(26)
  496. #define CCM_TRGT_MUX_UART3_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  497. #define CCM_TRGT_MUX_UART3_CLK_ROOT_EXT_CLK4 (BIT(26) | BIT(25))
  498. #define CCM_TRGT_MUX_UART3_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  499. /* UART4_CLK_ROOT */
  500. #define CCM_TRGT_MUX_UART4_CLK_ROOT_OSC_24M 0
  501. #define CCM_TRGT_MUX_UART4_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  502. #define CCM_TRGT_MUX_UART4_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  503. #define CCM_TRGT_MUX_UART4_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  504. #define CCM_TRGT_MUX_UART4_CLK_ROOT_SYS_PLL BIT(26)
  505. #define CCM_TRGT_MUX_UART4_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  506. #define CCM_TRGT_MUX_UART4_CLK_ROOT_EXT_CLK3 (BIT(26) | BIT(25))
  507. #define CCM_TRGT_MUX_UART4_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  508. /* UART5_CLK_ROOT */
  509. #define CCM_TRGT_MUX_UART5_CLK_ROOT_OSC_24M 0
  510. #define CCM_TRGT_MUX_UART5_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  511. #define CCM_TRGT_MUX_UART5_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  512. #define CCM_TRGT_MUX_UART5_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  513. #define CCM_TRGT_MUX_UART5_CLK_ROOT_SYS_PLL BIT(26)
  514. #define CCM_TRGT_MUX_UART5_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  515. #define CCM_TRGT_MUX_UART5_CLK_ROOT_EXT_CLK4 (BIT(26) | BIT(25))
  516. #define CCM_TRGT_MUX_UART5_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  517. /* UART6_CLK_ROOT */
  518. #define CCM_TRGT_MUX_UART6_CLK_ROOT_OSC_24M 0
  519. #define CCM_TRGT_MUX_UART6_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  520. #define CCM_TRGT_MUX_UART6_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  521. #define CCM_TRGT_MUX_UART6_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  522. #define CCM_TRGT_MUX_UART6_CLK_ROOT_SYS_PLL BIT(26)
  523. #define CCM_TRGT_MUX_UART6_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  524. #define CCM_TRGT_MUX_UART6_CLK_ROOT_EXT_CLK3 (BIT(26) | BIT(25))
  525. #define CCM_TRGT_MUX_UART6_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  526. /* UART7_CLK_ROOT */
  527. #define CCM_TRGT_MUX_UART7_CLK_ROOT_OSC_24M 0
  528. #define CCM_TRGT_MUX_UART7_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  529. #define CCM_TRGT_MUX_UART7_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  530. #define CCM_TRGT_MUX_UART7_CLK_ROOT_ENET_PLL_DIV10 (BIT(25) | BIT(24))
  531. #define CCM_TRGT_MUX_UART7_CLK_ROOT_SYS_PLL BIT(26)
  532. #define CCM_TRGT_MUX_UART7_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  533. #define CCM_TRGT_MUX_UART7_CLK_ROOT_EXT_CLK4 (BIT(26) | BIT(25))
  534. #define CCM_TRGT_MUX_UART7_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  535. /* ECSPI1_CLK_ROOT */
  536. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_OSC_24M 0
  537. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  538. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  539. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_SYS_PLL_DIV4 (BIT(25) | BIT(24))
  540. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_SYS_PLL BIT(26)
  541. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  542. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_ENET_PLL_DIV4 (BIT(26) | BIT(25))
  543. #define CCM_TRGT_MUX_ECSPI1_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  544. /* ECSPI2_CLK_ROOT */
  545. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_OSC_24M 0
  546. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  547. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  548. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_SYS_PLL_DIV4 (BIT(25) | BIT(24))
  549. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_SYS_PLL BIT(26)
  550. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  551. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_ENET_PLL_DIV4 (BIT(26) | BIT(25))
  552. #define CCM_TRGT_MUX_ECSPI2_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  553. /* ECSPI3_CLK_ROOT */
  554. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_OSC_24M 0
  555. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  556. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  557. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_SYS_PLL_DIV4 (BIT(25) | BIT(24))
  558. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_SYS_PLL BIT(26)
  559. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  560. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_ENET_PLL_DIV4 (BIT(26) | BIT(25))
  561. #define CCM_TRGT_MUX_ECSPI3_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  562. /* ECSPI4_CLK_ROOT */
  563. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_OSC_24M 0
  564. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_SYS_PLL_DIV2 BIT(24)
  565. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_ENET_PLL_DIV25 BIT(25)
  566. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_SYS_PLL_DIV4 (BIT(25) | BIT(24))
  567. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_SYS_PLL BIT(26)
  568. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_SYS_PLL_PFD4 (BIT(26) | BIT(24))
  569. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_ENET_PLL_DIV4 (BIT(26) | BIT(25))
  570. #define CCM_TRGT_MUX_ECSPI4_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  571. /* PWM1_CLK_ROOT */
  572. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_OSC_24M 0
  573. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  574. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  575. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  576. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_AUDIO_PLL BIT(26)
  577. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_EXT_CLK1 (BIT(26) | BIT(24))
  578. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  579. #define CCM_TRGT_MUX_PWM1_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  580. /* PWM2_CLK_ROOT */
  581. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_OSC_24M 0
  582. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  583. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  584. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  585. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_AUDIO_PLL BIT(26)
  586. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_EXT_CLK1 (BIT(26) | BIT(24))
  587. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  588. #define CCM_TRGT_MUX_PWM2_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  589. /* PWM3_CLK_ROOT */
  590. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_OSC_24M 0
  591. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  592. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  593. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  594. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_AUDIO_PLL BIT(26)
  595. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  596. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  597. #define CCM_TRGT_MUX_PWM3_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  598. /* PWM4_CLK_ROOT */
  599. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_OSC_24M 0
  600. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  601. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  602. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  603. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_AUDIO_PLL BIT(26)
  604. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(24))
  605. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  606. #define CCM_TRGT_MUX_PWM4_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  607. /* FLEXTIMER1_CLK_ROOT */
  608. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_OSC_24M 0
  609. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  610. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  611. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  612. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_AUDIO_PLL BIT(26)
  613. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_EXT_CLK3 (BIT(26) | BIT(24))
  614. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  615. #define CCM_TRGT_MUX_FLEXTIMER1_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  616. /* FLEXTIMER2_CLK_ROOT */
  617. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_OSC_24M 0
  618. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  619. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  620. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  621. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_AUDIO_PLL BIT(26)
  622. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_EXT_CLK3 (BIT(26) | BIT(24))
  623. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  624. #define CCM_TRGT_MUX_FLEXTIMER2_CLK_ROOT_VIDEO_PLL ((BIT(26) | BIT(25) | BIT(24))
  625. /* Target SIM1_CLK_ROOT */
  626. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_OSC_24M 0
  627. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  628. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  629. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  630. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_USB_PLL BIT(26)
  631. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  632. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_ENET_PLL_DIV8 (BIT(26) | BIT(25))
  633. #define CCM_TRGT_MUX_SIM1_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  634. /* Target SIM2_CLK_ROOT */
  635. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_OSC_24M 0
  636. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  637. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  638. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  639. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_USB_PLL BIT(26)
  640. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(24))
  641. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_ENET_PLL_DIV8 (BIT(26) | BIT(25))
  642. #define CCM_TRGT_MUX_SIM2_CLK_ROOT_SYS_PLL_PFD7 ((BIT(26) | BIT(25) | BIT(24))
  643. /* Target GPT1_CLK_ROOT */
  644. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_OSC_24M 0
  645. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  646. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_SYS_PLL_PFD0 BIT(25)
  647. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  648. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_VIDEO_PLL BIT(26)
  649. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_REF_1M (BIT(26) | BIT(24))
  650. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  651. #define CCM_TRGT_MUX_GPT1_CLK_ROOT_EXT_CLK1 ((BIT(26) | BIT(25) | BIT(24))
  652. /* Target GPT2_CLK_ROOT */
  653. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_OSC_24M 0
  654. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  655. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_SYS_PLL_PFD0 BIT(25)
  656. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  657. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_VIDEO_PLL BIT(26)
  658. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_REF_1M (BIT(26) | BIT(24))
  659. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  660. #define CCM_TRGT_MUX_GPT2_CLK_ROOT_EXT_CLK2 ((BIT(26) | BIT(25) | BIT(24))
  661. /* Target GPT3_CLK_ROOT */
  662. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_OSC_24M 0
  663. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  664. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_SYS_PLL_PFD0 BIT(25)
  665. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  666. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_VIDEO_PLL BIT(26)
  667. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_REF_1M (BIT(26) | BIT(24))
  668. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  669. #define CCM_TRGT_MUX_GPT3_CLK_ROOT_EXT_CLK3 ((BIT(26) | BIT(25) | BIT(24))
  670. /*Target GPT4_CLK_ROOT */
  671. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_OSC_24M 0
  672. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_ENET_PLL_DIV10 BIT(24)
  673. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_SYS_PLL_PFD0 BIT(25)
  674. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_ENET_PLL_DIV25 (BIT(25) | BIT(24))
  675. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_VIDEO_PLL BIT(26)
  676. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_REF_1M (BIT(26) | BIT(24))
  677. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(25))
  678. #define CCM_TRGT_MUX_GPT4_CLK_ROOT_EXT_CLK4 ((BIT(26) | BIT(25) | BIT(24))
  679. /* Target TRACE_CLK_ROOT */
  680. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_OSC_24M 0
  681. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  682. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  683. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  684. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_ENET_PLL_DIV8 BIT(26)
  685. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_USB_PLL (BIT(26) | BIT(24))
  686. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_EXT_CLK2 (BIT(26) | BIT(25))
  687. #define CCM_TRGT_MUX_TRACE_CLK_ROOT_EXT_CLK3 ((BIT(26) | BIT(25) | BIT(24))
  688. /* Target WDOG_CLK_ROOT */
  689. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_OSC_24M 0
  690. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  691. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  692. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  693. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_ENET_PLL_DIV8 BIT(26)
  694. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_USB_PLL (BIT(26) | BIT(24))
  695. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_REF_1M (BIT(26) | BIT(25))
  696. #define CCM_TRGT_MUX_WDOG_CLK_ROOT_SYS_PLL_PFD1_DIV2 ((BIT(26) | BIT(25) | BIT(24))
  697. #define WDOG_DEFAULT_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\
  698. CCM_TRGT_MUX_WDOG_CLK_ROOT_OSC_24M)
  699. /* Target CSI_MCLK_CLK_ROOT */
  700. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_OSC_24M 0
  701. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  702. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  703. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  704. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_ENET_PLL_DIV8 BIT(26)
  705. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  706. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  707. #define CCM_TRGT_MUX_CSI_MCLK_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  708. /* Target AUDIO_MCLK_CLK_ROOT */
  709. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_OSC_24M 0
  710. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_SYS_PLL_PFD2_DIV2 BIT(24)
  711. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_SYS_PLL_DIV4 BIT(25)
  712. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_DDR_PLL_DIV2 (BIT(25) | BIT(24))
  713. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_ENET_PLL_DIV8 BIT(26)
  714. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_AUDIO_PLL (BIT(26) | BIT(24))
  715. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_VIDEO_PLL (BIT(26) | BIT(25))
  716. #define CCM_TRGT_MUX_AUDIO_MCLK_CLK_ROOT_USB_PLL ((BIT(26) | BIT(25) | BIT(24))
  717. /* Target CCM_CLKO1 */
  718. #define CCM_TRGT_MUX_CCM_CLKO1_OSC_24M 0
  719. #define CCM_TRGT_MUX_CCM_CLKO1_SYS_PLL BIT(24)
  720. #define CCM_TRGT_MUX_CCM_CLKO1_SYS_PLL_DIV2 BIT(25)
  721. #define CCM_TRGT_MUX_CCM_CLKO1_SYS_PLL_PFD0_DIV2 (BIT(25) | BIT(24))
  722. #define CCM_TRGT_MUX_CCM_CLKO1_SYS_PLL_PFD3 BIT(26)
  723. #define CCM_TRGT_MUX_CCM_CLKO1_ENET_PLL_DIV2 (BIT(26) | BIT(24))
  724. #define CCM_TRGT_MUX_CCM_CLKO1_DDR_PLL_DIV2 (BIT(26) | BIT(25))
  725. #define CCM_TRGT_MUX_CCM_CLKO1_REF_1M ((BIT(26) | BIT(25) | BIT(24))
  726. /* Target CCM_CLKO2 */
  727. #define CCM_TRGT_MUX_CCM_CLKO2_OSC_24M 0
  728. #define CCM_TRGT_MUX_CCM_CLKO2_SYS_PLL_DIV2 BIT(24)
  729. #define CCM_TRGT_MUX_CCM_CLKO2_SYS_PLL_PFD0 BIT(25)
  730. #define CCM_TRGT_MUX_CCM_CLKO2_SYS_PLL_PFD1_DIV2 (BIT(25) | BIT(24))
  731. #define CCM_TRGT_MUX_CCM_CLKO2_SYS_PLL_PFD4 BIT(26)
  732. #define CCM_TRGT_MUX_CCM_CLKO2_AUDIO_PLL (BIT(26) | BIT(24))
  733. #define CCM_TRGT_MUX_CCM_CLKO2_VIDEO_PLL (BIT(26) | BIT(25))
  734. #define CCM_TRGT_MUX_CCM_CLKO2_OSC_32K ((BIT(26) | BIT(25) | BIT(24))
  735. /*
  736. * See Table 5-11 in i.MX7 Solo Reference manual rev 0.1
  737. * The indices must be calculated by dividing the offset by
  738. * sizeof (struct ccm_target_root_ctrl) => 0x80 bytes for each index
  739. */
  740. enum {
  741. CCM_TRT_ID_ARM_A7_CLK_ROOT = 0,
  742. CCM_TRT_ID_ARM_M4_CLK_ROOT = 1,
  743. CCM_TRT_ID_MAIN_AXI_CLK_ROOT = 16,
  744. CCM_TRT_ID_DISP_AXI_CLK_ROOT = 17,
  745. CCM_TRT_ID_ENET_AXI_CLK_ROOT = 18,
  746. CCM_TRT_ID_NAND_USDHC_BUS_CLK_ROOT = 19,
  747. CCM_TRT_ID_AHB_CLK_ROOT = 32,
  748. CCM_TRT_ID_IPG_CLK_ROOT = 33,
  749. CCM_TRT_ID_DRAM_PHYM_CLK_ROOT = 48,
  750. CCM_TRT_ID_DRAM_CLK_ROOT = 49,
  751. CCM_TRT_ID_DRAM_PHYM_ALT_CLK_ROOT = 64,
  752. CCM_TRT_ID_DRAM_ALT_CLK_ROOT = 65,
  753. CCM_TRT_ID_USB_HSIC_CLK_ROOT = 66,
  754. CCM_TRT_ID_LCDIF_PIXEL_CLK_ROOT = 70,
  755. CCM_TRT_ID_MIPI_DSI_CLK_ROOT = 71,
  756. CCM_TRT_ID_MIPI_CSI_CLK_ROOT = 72,
  757. CCM_TRT_ID_MIPI_DPHY_REF_CLK_ROOT = 73,
  758. CCM_TRT_ID_SAI1_CLK_ROOT = 74,
  759. CCM_TRT_ID_SAI2_CLK_ROOT = 75,
  760. CCM_TRT_ID_SAI3_CLK_ROOT = 76,
  761. CCM_TRT_ID_ENET1_REF_CLK_ROOT = 78,
  762. CCM_TRT_ID_ENET1_TIME_CLK_ROOT = 79,
  763. CCM_TRT_ID_ENET_PHY_REF_CLK_ROOT = 82,
  764. CCM_TRT_ID_EIM_CLK_ROOT = 83,
  765. CCM_TRT_ID_NAND_CLK_ROOT = 84,
  766. CCM_TRT_ID_QSPI_CLK_ROOT = 85,
  767. CCM_TRT_ID_USDHC1_CLK_ROOT = 86,
  768. CCM_TRT_ID_USDHC2_CLK_ROOT = 87,
  769. CCM_TRT_ID_USDHC3_CLK_ROOT = 88,
  770. CCM_TRT_ID_CAN1_CLK_ROOT = 89,
  771. CCM_TRT_ID_CAN2_CLK_ROOT = 90,
  772. CCM_TRT_ID_I2C1_CLK_ROOT = 91,
  773. CCM_TRT_ID_I2C2_CLK_ROOT = 92,
  774. CCM_TRT_ID_I2C3_CLK_ROOT = 93,
  775. CCM_TRT_ID_I2C4_CLK_ROOT = 94,
  776. CCM_TRT_ID_UART1_CLK_ROOT = 95,
  777. CCM_TRT_ID_UART2_CLK_ROOT = 96,
  778. CCM_TRT_ID_UART3_CLK_ROOT = 97,
  779. CCM_TRT_ID_UART4_CLK_ROOT = 98,
  780. CCM_TRT_ID_UART5_CLK_ROOT = 99,
  781. CCM_TRT_ID_UART6_CLK_ROOT = 100,
  782. CCM_TRT_ID_UART7_CLK_ROOT = 101,
  783. CCM_TRT_ID_ECSPI1_CLK_ROOT = 102,
  784. CCM_TRT_ID_ECSPI2_CLK_ROOT = 103,
  785. CCM_TRT_ID_ECSPI3_CLK_ROOT = 104,
  786. CCM_TRT_ID_ECSPI4_CLK_ROOT = 105,
  787. CCM_TRT_ID_PWM1_CLK_ROOT = 106,
  788. CCM_TRT_ID_PWM2_CLK_ROOT = 107,
  789. CCM_TRT_ID_PWM3_CLK_ROOT = 108,
  790. CCM_TRT_ID_PWM4_CLK_ROOT = 109,
  791. CCM_TRT_ID_FLEXTIMER1_CLK_ROOT = 110,
  792. CCM_TRT_ID_FLEXTIMER2_CLK_ROOT = 111,
  793. CCM_TRT_ID_SIM1_CLK_ROOT = 112,
  794. CCM_TRT_ID_SIM2_CLK_ROOT = 113,
  795. CCM_TRT_ID_GPT1_CLK_ROOT = 114,
  796. CCM_TRT_ID_GPT2_CLK_ROOT = 115,
  797. CCM_TRT_ID_GPT3_CLK_ROOT = 116,
  798. CCM_TRT_ID_GPT4_CLK_ROOT = 117,
  799. CCM_TRT_ID_TRACE_CLK_ROOT = 118,
  800. CCM_TRT_ID_WDOG_CLK_ROOT = 119,
  801. CCM_TRT_ID_CSI_MCLK_CLK_ROOT = 120,
  802. CCM_TRT_ID_AUDIO_MCLK_CLK_ROOT = 121,
  803. CCM_TRT_ID_CCM_CLKO1 = 123,
  804. CCM_TRT_ID_CCM_CLKO2 = 124,
  805. };
  806. #define CCM_MISC_VIOLATE BIT(8)
  807. #define CCM_MISC_TIMEOUT BIT(4)
  808. #define CCM_MISC_AUTHEN_FAIL BIT(0)
  809. #define CCM_POST_BUSY2 BIT(31)
  810. #define CCM_POST_SELECT_BRANCH_A BIT(28)
  811. #define CCM_POST_BUSY1 BIT(7)
  812. #define CCM_POST_POST_PODF(x) ((x) - 1)
  813. #define CCM_PRE_BUSY4 BIT(31)
  814. #define CCM_PRE_ENABLE_A BIT(28)
  815. #define CCM_PRE_MUX_A(x) (((x) - 1) << 24)
  816. #define CCM_PRE_BUSY3 BIT(19)
  817. #define CCM_PRE_PODF_A(x) (((x) - 1) << 16)
  818. #define CCM_PRE_BUSY1 BIT(15)
  819. #define CCM_PRE_ENABLE_B BIT(12)
  820. #define CCM_PRE_MUX_B(x) (((x) - 1) << 8)
  821. #define CCM_PRE_BUSY0 BIT(3)
  822. #define CCM_PRE_POST_PODF(x) ((x) - 1)
  823. #define CCM_ACCESS_CTRL_LOCK BIT(31)
  824. #define CCM_ACCESS_SEMA_ENABLE BIT(28)
  825. #define CCM_ACCESS_DOM3_WHITELIST BIT(27)
  826. #define CCM_ACCESS_DOM2_WHITELIST BIT(26)
  827. #define CCM_ACCESS_DOM1_WHITELIST BIT(25)
  828. #define CCM_ACCESS_DOM0_WHITELIST BIT(24)
  829. #define CCM_ACCESS_MUTEX BIT(20)
  830. #define CCM_ACCESS_OWNER_ID(x) ((x) << 16)
  831. #define CCM_ACCESS_DOM3_INFO(x) ((x) << 12)
  832. #define CCM_ACCESS_DOM2_INFO(x) ((x) << 8)
  833. #define CCM_ACCESS_DOM1_INFO(x) ((x) << 4)
  834. #define CCM_ACCESS_DOM0_INFO(x) (x)
  835. #define CCM_PLL_CTRL_NUM 0x21
  836. #define CCM_CLK_GATE_CTRL_NUM 0xbf
  837. #define CCM_ROOT_CTRL_NUM 0x79
  838. struct ccm {
  839. uint32_t ccm_gpr0;
  840. uint32_t ccm_gpr0_set;
  841. uint32_t ccm_gpr0_clr;
  842. uint32_t ccm_grp0_tog;
  843. uint32_t reserved[0x1fc];
  844. struct ccm_pll_ctrl ccm_pll_ctrl[CCM_PLL_CTRL_NUM];
  845. uint32_t reserved1[0xd7c];
  846. struct ccm_clk_gate_ctrl ccm_clk_gate_ctrl[CCM_CLK_GATE_CTRL_NUM];
  847. uint32_t reserved2[0xd04];
  848. struct ccm_target_root_ctrl ccm_root_ctrl[CCM_ROOT_CTRL_NUM];
  849. };
  850. void imx_clock_target_set(unsigned int id, uint32_t val);
  851. void imx_clock_target_clr(unsigned int id, uint32_t val);
  852. void imx_clock_gate_enable(unsigned int id, bool enable);
  853. void imx_clock_init(void);
  854. void imx_clock_enable_uart(unsigned int uart_id, uint32_t uart_clk_en_bits);
  855. void imx_clock_disable_uart(unsigned int uart_id);
  856. void imx_clock_enable_usdhc(unsigned int usdhc_id, uint32_t usdhc_clk_en_bits);
  857. void imx_clock_set_wdog_clk_root_bits(uint32_t wdog_clk_root_en_bits);
  858. void imx_clock_enable_wdog(unsigned int wdog_id);
  859. void imx_clock_disable_wdog(unsigned int wdog_id);
  860. void imx_clock_enable_usb(unsigned int usb_id);
  861. void imx_clock_disable_usb(unsigned int usb_id);
  862. void imx_clock_set_usb_clk_root_bits(uint32_t usb_clk_root_en_bits);
  863. #endif /* IMX_CLOCK_H */