clk-7xx.c 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * DRA7 Clock init
  4. *
  5. * Copyright (C) 2013 Texas Instruments, Inc.
  6. *
  7. * Tero Kristo ([email protected])
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/list.h>
  11. #include <linux/clk.h>
  12. #include <linux/clkdev.h>
  13. #include <linux/clk/ti.h>
  14. #include <dt-bindings/clock/dra7.h>
  15. #include "clock.h"
  16. #define DRA7_DPLL_GMAC_DEFFREQ 1000000000
  17. #define DRA7_DPLL_USB_DEFFREQ 960000000
  18. static const struct omap_clkctrl_reg_data dra7_mpu_clkctrl_regs[] __initconst = {
  19. { DRA7_MPU_MPU_CLKCTRL, NULL, 0, "dpll_mpu_m2_ck" },
  20. { 0 },
  21. };
  22. static const struct omap_clkctrl_reg_data dra7_dsp1_clkctrl_regs[] __initconst = {
  23. { DRA7_DSP1_MMU0_DSP1_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_dsp_m2_ck" },
  24. { 0 },
  25. };
  26. static const char * const dra7_ipu1_gfclk_mux_parents[] __initconst = {
  27. "dpll_abe_m2x2_ck",
  28. "dpll_core_h22x2_ck",
  29. NULL,
  30. };
  31. static const struct omap_clkctrl_bit_data dra7_mmu_ipu1_bit_data[] __initconst = {
  32. { 24, TI_CLK_MUX, dra7_ipu1_gfclk_mux_parents, NULL },
  33. { 0 },
  34. };
  35. static const struct omap_clkctrl_reg_data dra7_ipu1_clkctrl_regs[] __initconst = {
  36. { DRA7_IPU1_MMU_IPU1_CLKCTRL, dra7_mmu_ipu1_bit_data, CLKF_HW_SUP | CLKF_NO_IDLEST, "ipu1-clkctrl:0000:24" },
  37. { 0 },
  38. };
  39. static const char * const dra7_mcasp1_aux_gfclk_mux_parents[] __initconst = {
  40. "per_abe_x1_gfclk2_div",
  41. "video1_clk2_div",
  42. "video2_clk2_div",
  43. "hdmi_clk2_div",
  44. NULL,
  45. };
  46. static const char * const dra7_mcasp1_ahclkx_mux_parents[] __initconst = {
  47. "abe_24m_fclk",
  48. "abe_sys_clk_div",
  49. "func_24m_clk",
  50. "atl_clkin3_ck",
  51. "atl_clkin2_ck",
  52. "atl_clkin1_ck",
  53. "atl_clkin0_ck",
  54. "sys_clkin2",
  55. "ref_clkin0_ck",
  56. "ref_clkin1_ck",
  57. "ref_clkin2_ck",
  58. "ref_clkin3_ck",
  59. "mlb_clk",
  60. "mlbp_clk",
  61. NULL,
  62. };
  63. static const struct omap_clkctrl_bit_data dra7_mcasp1_bit_data[] __initconst = {
  64. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  65. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  66. { 28, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  67. { 0 },
  68. };
  69. static const char * const dra7_timer5_gfclk_mux_parents[] __initconst = {
  70. "timer_sys_clk_div",
  71. "sys_32k_ck",
  72. "sys_clkin2",
  73. "ref_clkin0_ck",
  74. "ref_clkin1_ck",
  75. "ref_clkin2_ck",
  76. "ref_clkin3_ck",
  77. "abe_giclk_div",
  78. "video1_div_clk",
  79. "video2_div_clk",
  80. "hdmi_div_clk",
  81. "clkoutmux0_clk_mux",
  82. NULL,
  83. };
  84. static const struct omap_clkctrl_bit_data dra7_timer5_bit_data[] __initconst = {
  85. { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
  86. { 0 },
  87. };
  88. static const struct omap_clkctrl_bit_data dra7_timer6_bit_data[] __initconst = {
  89. { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
  90. { 0 },
  91. };
  92. static const struct omap_clkctrl_bit_data dra7_timer7_bit_data[] __initconst = {
  93. { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
  94. { 0 },
  95. };
  96. static const struct omap_clkctrl_bit_data dra7_timer8_bit_data[] __initconst = {
  97. { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
  98. { 0 },
  99. };
  100. static const char * const dra7_uart6_gfclk_mux_parents[] __initconst = {
  101. "func_48m_fclk",
  102. "dpll_per_m2x2_ck",
  103. NULL,
  104. };
  105. static const struct omap_clkctrl_bit_data dra7_uart6_bit_data[] __initconst = {
  106. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  107. { 0 },
  108. };
  109. static const struct omap_clkctrl_reg_data dra7_ipu_clkctrl_regs[] __initconst = {
  110. { DRA7_IPU_MCASP1_CLKCTRL, dra7_mcasp1_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0000:22" },
  111. { DRA7_IPU_TIMER5_CLKCTRL, dra7_timer5_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0008:24" },
  112. { DRA7_IPU_TIMER6_CLKCTRL, dra7_timer6_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0010:24" },
  113. { DRA7_IPU_TIMER7_CLKCTRL, dra7_timer7_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0018:24" },
  114. { DRA7_IPU_TIMER8_CLKCTRL, dra7_timer8_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0020:24" },
  115. { DRA7_IPU_I2C5_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
  116. { DRA7_IPU_UART6_CLKCTRL, dra7_uart6_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0030:24" },
  117. { 0 },
  118. };
  119. static const struct omap_clkctrl_reg_data dra7_dsp2_clkctrl_regs[] __initconst = {
  120. { DRA7_DSP2_MMU0_DSP2_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_dsp_m2_ck" },
  121. { 0 },
  122. };
  123. static const struct omap_clkctrl_reg_data dra7_rtc_clkctrl_regs[] __initconst = {
  124. { DRA7_RTC_RTCSS_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" },
  125. { 0 },
  126. };
  127. static const char * const dra7_cam_gfclk_mux_parents[] __initconst = {
  128. "l3_iclk_div",
  129. "core_iss_main_clk",
  130. NULL,
  131. };
  132. static const struct omap_clkctrl_bit_data dra7_cam_bit_data[] __initconst = {
  133. { 24, TI_CLK_MUX, dra7_cam_gfclk_mux_parents, NULL },
  134. { 0 },
  135. };
  136. static const struct omap_clkctrl_reg_data dra7_cam_clkctrl_regs[] __initconst = {
  137. { DRA7_CAM_VIP1_CLKCTRL, dra7_cam_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  138. { DRA7_CAM_VIP2_CLKCTRL, dra7_cam_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  139. { DRA7_CAM_VIP3_CLKCTRL, dra7_cam_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  140. { 0 },
  141. };
  142. static const struct omap_clkctrl_reg_data dra7_vpe_clkctrl_regs[] __initconst = {
  143. { DRA7_VPE_VPE_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_core_h23x2_ck" },
  144. { 0 },
  145. };
  146. static const struct omap_clkctrl_reg_data dra7_coreaon_clkctrl_regs[] __initconst = {
  147. { DRA7_COREAON_SMARTREFLEX_MPU_CLKCTRL, NULL, CLKF_SW_SUP, "wkupaon_iclk_mux" },
  148. { DRA7_COREAON_SMARTREFLEX_CORE_CLKCTRL, NULL, CLKF_SW_SUP, "wkupaon_iclk_mux" },
  149. { 0 },
  150. };
  151. static const struct omap_clkctrl_reg_data dra7_l3main1_clkctrl_regs[] __initconst = {
  152. { DRA7_L3MAIN1_L3_MAIN_1_CLKCTRL, NULL, 0, "l3_iclk_div" },
  153. { DRA7_L3MAIN1_GPMC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  154. { DRA7_L3MAIN1_TPCC_CLKCTRL, NULL, 0, "l3_iclk_div" },
  155. { DRA7_L3MAIN1_TPTC0_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  156. { DRA7_L3MAIN1_TPTC1_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  157. { DRA7_L3MAIN1_VCP1_CLKCTRL, NULL, 0, "l3_iclk_div" },
  158. { DRA7_L3MAIN1_VCP2_CLKCTRL, NULL, 0, "l3_iclk_div" },
  159. { 0 },
  160. };
  161. static const struct omap_clkctrl_reg_data dra7_ipu2_clkctrl_regs[] __initconst = {
  162. { DRA7_IPU2_MMU_IPU2_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_core_h22x2_ck" },
  163. { 0 },
  164. };
  165. static const struct omap_clkctrl_reg_data dra7_dma_clkctrl_regs[] __initconst = {
  166. { DRA7_DMA_DMA_SYSTEM_CLKCTRL, NULL, 0, "l3_iclk_div" },
  167. { 0 },
  168. };
  169. static const struct omap_clkctrl_reg_data dra7_emif_clkctrl_regs[] __initconst = {
  170. { DRA7_EMIF_DMM_CLKCTRL, NULL, 0, "l3_iclk_div" },
  171. { 0 },
  172. };
  173. static const char * const dra7_atl_dpll_clk_mux_parents[] __initconst = {
  174. "sys_32k_ck",
  175. "video1_clkin_ck",
  176. "video2_clkin_ck",
  177. "hdmi_clkin_ck",
  178. NULL,
  179. };
  180. static const char * const dra7_atl_gfclk_mux_parents[] __initconst = {
  181. "l3_iclk_div",
  182. "dpll_abe_m2_ck",
  183. "atl-clkctrl:0000:24",
  184. NULL,
  185. };
  186. static const struct omap_clkctrl_bit_data dra7_atl_bit_data[] __initconst = {
  187. { 24, TI_CLK_MUX, dra7_atl_dpll_clk_mux_parents, NULL },
  188. { 26, TI_CLK_MUX, dra7_atl_gfclk_mux_parents, NULL },
  189. { 0 },
  190. };
  191. static const struct omap_clkctrl_reg_data dra7_atl_clkctrl_regs[] __initconst = {
  192. { DRA7_ATL_ATL_CLKCTRL, dra7_atl_bit_data, CLKF_SW_SUP, "atl-clkctrl:0000:26" },
  193. { 0 },
  194. };
  195. static const struct omap_clkctrl_reg_data dra7_l4cfg_clkctrl_regs[] __initconst = {
  196. { DRA7_L4CFG_L4_CFG_CLKCTRL, NULL, 0, "l3_iclk_div" },
  197. { DRA7_L4CFG_SPINLOCK_CLKCTRL, NULL, 0, "l3_iclk_div" },
  198. { DRA7_L4CFG_MAILBOX1_CLKCTRL, NULL, 0, "l3_iclk_div" },
  199. { DRA7_L4CFG_MAILBOX2_CLKCTRL, NULL, 0, "l3_iclk_div" },
  200. { DRA7_L4CFG_MAILBOX3_CLKCTRL, NULL, 0, "l3_iclk_div" },
  201. { DRA7_L4CFG_MAILBOX4_CLKCTRL, NULL, 0, "l3_iclk_div" },
  202. { DRA7_L4CFG_MAILBOX5_CLKCTRL, NULL, 0, "l3_iclk_div" },
  203. { DRA7_L4CFG_MAILBOX6_CLKCTRL, NULL, 0, "l3_iclk_div" },
  204. { DRA7_L4CFG_MAILBOX7_CLKCTRL, NULL, 0, "l3_iclk_div" },
  205. { DRA7_L4CFG_MAILBOX8_CLKCTRL, NULL, 0, "l3_iclk_div" },
  206. { DRA7_L4CFG_MAILBOX9_CLKCTRL, NULL, 0, "l3_iclk_div" },
  207. { DRA7_L4CFG_MAILBOX10_CLKCTRL, NULL, 0, "l3_iclk_div" },
  208. { DRA7_L4CFG_MAILBOX11_CLKCTRL, NULL, 0, "l3_iclk_div" },
  209. { DRA7_L4CFG_MAILBOX12_CLKCTRL, NULL, 0, "l3_iclk_div" },
  210. { DRA7_L4CFG_MAILBOX13_CLKCTRL, NULL, 0, "l3_iclk_div" },
  211. { 0 },
  212. };
  213. static const struct omap_clkctrl_reg_data dra7_l3instr_clkctrl_regs[] __initconst = {
  214. { DRA7_L3INSTR_L3_MAIN_2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  215. { DRA7_L3INSTR_L3_INSTR_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  216. { 0 },
  217. };
  218. static const struct omap_clkctrl_reg_data dra7_iva_clkctrl_regs[] __initconst = {
  219. { DRA7_IVA_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_iva_h12x2_ck" },
  220. { DRA7_SL2IF_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_h12x2_ck" },
  221. { 0 },
  222. };
  223. static const char * const dra7_dss_dss_clk_parents[] __initconst = {
  224. "dpll_per_h12x2_ck",
  225. NULL,
  226. };
  227. static const char * const dra7_dss_48mhz_clk_parents[] __initconst = {
  228. "func_48m_fclk",
  229. NULL,
  230. };
  231. static const char * const dra7_dss_hdmi_clk_parents[] __initconst = {
  232. "hdmi_dpll_clk_mux",
  233. NULL,
  234. };
  235. static const char * const dra7_dss_32khz_clk_parents[] __initconst = {
  236. "sys_32k_ck",
  237. NULL,
  238. };
  239. static const char * const dra7_dss_video1_clk_parents[] __initconst = {
  240. "video1_dpll_clk_mux",
  241. NULL,
  242. };
  243. static const char * const dra7_dss_video2_clk_parents[] __initconst = {
  244. "video2_dpll_clk_mux",
  245. NULL,
  246. };
  247. static const struct omap_clkctrl_bit_data dra7_dss_core_bit_data[] __initconst = {
  248. { 8, TI_CLK_GATE, dra7_dss_dss_clk_parents, NULL },
  249. { 9, TI_CLK_GATE, dra7_dss_48mhz_clk_parents, NULL },
  250. { 10, TI_CLK_GATE, dra7_dss_hdmi_clk_parents, NULL },
  251. { 11, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  252. { 12, TI_CLK_GATE, dra7_dss_video1_clk_parents, NULL },
  253. { 13, TI_CLK_GATE, dra7_dss_video2_clk_parents, NULL },
  254. { 0 },
  255. };
  256. static const struct omap_clkctrl_reg_data dra7_dss_clkctrl_regs[] __initconst = {
  257. { DRA7_DSS_DSS_CORE_CLKCTRL, dra7_dss_core_bit_data, CLKF_SW_SUP, "dss-clkctrl:0000:8" },
  258. { DRA7_DSS_BB2D_CLKCTRL, NULL, CLKF_SW_SUP, "dpll_core_h24x2_ck" },
  259. { 0 },
  260. };
  261. static const char * const dra7_gpu_core_mux_parents[] __initconst = {
  262. "dpll_core_h14x2_ck",
  263. "dpll_per_h14x2_ck",
  264. "dpll_gpu_m2_ck",
  265. NULL,
  266. };
  267. static const char * const dra7_gpu_hyd_mux_parents[] __initconst = {
  268. "dpll_core_h14x2_ck",
  269. "dpll_per_h14x2_ck",
  270. "dpll_gpu_m2_ck",
  271. NULL,
  272. };
  273. static const struct omap_clkctrl_bit_data dra7_gpu_core_bit_data[] __initconst = {
  274. { 24, TI_CLK_MUX, dra7_gpu_core_mux_parents, NULL, },
  275. { 26, TI_CLK_MUX, dra7_gpu_hyd_mux_parents, NULL, },
  276. { 0 },
  277. };
  278. static const struct omap_clkctrl_reg_data dra7_gpu_clkctrl_regs[] __initconst = {
  279. { DRA7_GPU_CLKCTRL, dra7_gpu_core_bit_data, CLKF_SW_SUP, "gpu-clkctrl:0000:24", },
  280. { 0 },
  281. };
  282. static const char * const dra7_mmc1_fclk_mux_parents[] __initconst = {
  283. "func_128m_clk",
  284. "dpll_per_m2x2_ck",
  285. NULL,
  286. };
  287. static const char * const dra7_mmc1_fclk_div_parents[] __initconst = {
  288. "l3init-clkctrl:0008:24",
  289. NULL,
  290. };
  291. static const struct omap_clkctrl_div_data dra7_mmc1_fclk_div_data __initconst = {
  292. .max_div = 4,
  293. .flags = CLK_DIVIDER_POWER_OF_TWO,
  294. };
  295. static const struct omap_clkctrl_bit_data dra7_mmc1_bit_data[] __initconst = {
  296. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  297. { 24, TI_CLK_MUX, dra7_mmc1_fclk_mux_parents, NULL },
  298. { 25, TI_CLK_DIVIDER, dra7_mmc1_fclk_div_parents, &dra7_mmc1_fclk_div_data },
  299. { 0 },
  300. };
  301. static const char * const dra7_mmc2_fclk_div_parents[] __initconst = {
  302. "l3init-clkctrl:0010:24",
  303. NULL,
  304. };
  305. static const struct omap_clkctrl_div_data dra7_mmc2_fclk_div_data __initconst = {
  306. .max_div = 4,
  307. .flags = CLK_DIVIDER_POWER_OF_TWO,
  308. };
  309. static const struct omap_clkctrl_bit_data dra7_mmc2_bit_data[] __initconst = {
  310. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  311. { 24, TI_CLK_MUX, dra7_mmc1_fclk_mux_parents, NULL },
  312. { 25, TI_CLK_DIVIDER, dra7_mmc2_fclk_div_parents, &dra7_mmc2_fclk_div_data },
  313. { 0 },
  314. };
  315. static const char * const dra7_usb_otg_ss2_refclk960m_parents[] __initconst = {
  316. "l3init_960m_gfclk",
  317. NULL,
  318. };
  319. static const struct omap_clkctrl_bit_data dra7_usb_otg_ss2_bit_data[] __initconst = {
  320. { 8, TI_CLK_GATE, dra7_usb_otg_ss2_refclk960m_parents, NULL },
  321. { 0 },
  322. };
  323. static const char * const dra7_sata_ref_clk_parents[] __initconst = {
  324. "sys_clkin1",
  325. NULL,
  326. };
  327. static const struct omap_clkctrl_bit_data dra7_sata_bit_data[] __initconst = {
  328. { 8, TI_CLK_GATE, dra7_sata_ref_clk_parents, NULL },
  329. { 0 },
  330. };
  331. static const struct omap_clkctrl_bit_data dra7_usb_otg_ss1_bit_data[] __initconst = {
  332. { 8, TI_CLK_GATE, dra7_usb_otg_ss2_refclk960m_parents, NULL },
  333. { 0 },
  334. };
  335. static const struct omap_clkctrl_reg_data dra7_l3init_clkctrl_regs[] __initconst = {
  336. { DRA7_L3INIT_MMC1_CLKCTRL, dra7_mmc1_bit_data, CLKF_SW_SUP, "l3init-clkctrl:0008:25" },
  337. { DRA7_L3INIT_MMC2_CLKCTRL, dra7_mmc2_bit_data, CLKF_SW_SUP, "l3init-clkctrl:0010:25" },
  338. { DRA7_L3INIT_USB_OTG_SS2_CLKCTRL, dra7_usb_otg_ss2_bit_data, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
  339. { DRA7_L3INIT_USB_OTG_SS3_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
  340. { DRA7_L3INIT_USB_OTG_SS4_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_DRA74 | CLKF_SOC_DRA76, "dpll_core_h13x2_ck" },
  341. { DRA7_L3INIT_SATA_CLKCTRL, dra7_sata_bit_data, CLKF_SW_SUP, "func_48m_fclk" },
  342. { DRA7_L3INIT_OCP2SCP1_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
  343. { DRA7_L3INIT_OCP2SCP3_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
  344. { DRA7_L3INIT_USB_OTG_SS1_CLKCTRL, dra7_usb_otg_ss1_bit_data, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
  345. { 0 },
  346. };
  347. static const char * const dra7_optfclk_pciephy1_clk_parents[] __initconst = {
  348. "apll_pcie_ck",
  349. NULL,
  350. };
  351. static const char * const dra7_optfclk_pciephy1_div_clk_parents[] __initconst = {
  352. "optfclk_pciephy_div",
  353. NULL,
  354. };
  355. static const struct omap_clkctrl_bit_data dra7_pcie1_bit_data[] __initconst = {
  356. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  357. { 9, TI_CLK_GATE, dra7_optfclk_pciephy1_clk_parents, NULL },
  358. { 10, TI_CLK_GATE, dra7_optfclk_pciephy1_div_clk_parents, NULL },
  359. { 0 },
  360. };
  361. static const struct omap_clkctrl_bit_data dra7_pcie2_bit_data[] __initconst = {
  362. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  363. { 9, TI_CLK_GATE, dra7_optfclk_pciephy1_clk_parents, NULL },
  364. { 10, TI_CLK_GATE, dra7_optfclk_pciephy1_div_clk_parents, NULL },
  365. { 0 },
  366. };
  367. static const struct omap_clkctrl_reg_data dra7_pcie_clkctrl_regs[] __initconst = {
  368. { DRA7_PCIE_PCIE1_CLKCTRL, dra7_pcie1_bit_data, CLKF_SW_SUP, "l4_root_clk_div" },
  369. { DRA7_PCIE_PCIE2_CLKCTRL, dra7_pcie2_bit_data, CLKF_SW_SUP, "l4_root_clk_div" },
  370. { 0 },
  371. };
  372. static const char * const dra7_rmii_50mhz_clk_mux_parents[] __initconst = {
  373. "dpll_gmac_h11x2_ck",
  374. "rmii_clk_ck",
  375. NULL,
  376. };
  377. static const char * const dra7_gmac_rft_clk_mux_parents[] __initconst = {
  378. "video1_clkin_ck",
  379. "video2_clkin_ck",
  380. "dpll_abe_m2_ck",
  381. "hdmi_clkin_ck",
  382. "l3_iclk_div",
  383. NULL,
  384. };
  385. static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = {
  386. { 24, TI_CLK_MUX, dra7_rmii_50mhz_clk_mux_parents, NULL },
  387. { 25, TI_CLK_MUX, dra7_gmac_rft_clk_mux_parents, NULL },
  388. { 0 },
  389. };
  390. static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
  391. { DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "gmac_main_clk" },
  392. { 0 },
  393. };
  394. static const char * const dra7_timer10_gfclk_mux_parents[] __initconst = {
  395. "timer_sys_clk_div",
  396. "sys_32k_ck",
  397. "sys_clkin2",
  398. "ref_clkin0_ck",
  399. "ref_clkin1_ck",
  400. "ref_clkin2_ck",
  401. "ref_clkin3_ck",
  402. "abe_giclk_div",
  403. "video1_div_clk",
  404. "video2_div_clk",
  405. "hdmi_div_clk",
  406. NULL,
  407. };
  408. static const struct omap_clkctrl_bit_data dra7_timer10_bit_data[] __initconst = {
  409. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  410. { 0 },
  411. };
  412. static const struct omap_clkctrl_bit_data dra7_timer11_bit_data[] __initconst = {
  413. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  414. { 0 },
  415. };
  416. static const struct omap_clkctrl_bit_data dra7_timer2_bit_data[] __initconst = {
  417. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  418. { 0 },
  419. };
  420. static const struct omap_clkctrl_bit_data dra7_timer3_bit_data[] __initconst = {
  421. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  422. { 0 },
  423. };
  424. static const struct omap_clkctrl_bit_data dra7_timer4_bit_data[] __initconst = {
  425. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  426. { 0 },
  427. };
  428. static const struct omap_clkctrl_bit_data dra7_timer9_bit_data[] __initconst = {
  429. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  430. { 0 },
  431. };
  432. static const struct omap_clkctrl_bit_data dra7_gpio2_bit_data[] __initconst = {
  433. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  434. { 0 },
  435. };
  436. static const struct omap_clkctrl_bit_data dra7_gpio3_bit_data[] __initconst = {
  437. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  438. { 0 },
  439. };
  440. static const struct omap_clkctrl_bit_data dra7_gpio4_bit_data[] __initconst = {
  441. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  442. { 0 },
  443. };
  444. static const struct omap_clkctrl_bit_data dra7_gpio5_bit_data[] __initconst = {
  445. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  446. { 0 },
  447. };
  448. static const struct omap_clkctrl_bit_data dra7_gpio6_bit_data[] __initconst = {
  449. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  450. { 0 },
  451. };
  452. static const struct omap_clkctrl_bit_data dra7_gpio7_bit_data[] __initconst = {
  453. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  454. { 0 },
  455. };
  456. static const struct omap_clkctrl_bit_data dra7_gpio8_bit_data[] __initconst = {
  457. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  458. { 0 },
  459. };
  460. static const char * const dra7_mmc3_gfclk_div_parents[] __initconst = {
  461. "l4per-clkctrl:00f8:24",
  462. NULL,
  463. };
  464. static const struct omap_clkctrl_div_data dra7_mmc3_gfclk_div_data __initconst = {
  465. .max_div = 4,
  466. .flags = CLK_DIVIDER_POWER_OF_TWO,
  467. };
  468. static const struct omap_clkctrl_bit_data dra7_mmc3_bit_data[] __initconst = {
  469. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  470. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  471. { 25, TI_CLK_DIVIDER, dra7_mmc3_gfclk_div_parents, &dra7_mmc3_gfclk_div_data },
  472. { 0 },
  473. };
  474. static const char * const dra7_mmc4_gfclk_div_parents[] __initconst = {
  475. "l4per-clkctrl:0100:24",
  476. NULL,
  477. };
  478. static const struct omap_clkctrl_div_data dra7_mmc4_gfclk_div_data __initconst = {
  479. .max_div = 4,
  480. .flags = CLK_DIVIDER_POWER_OF_TWO,
  481. };
  482. static const struct omap_clkctrl_bit_data dra7_mmc4_bit_data[] __initconst = {
  483. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  484. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  485. { 25, TI_CLK_DIVIDER, dra7_mmc4_gfclk_div_parents, &dra7_mmc4_gfclk_div_data },
  486. { 0 },
  487. };
  488. static const struct omap_clkctrl_bit_data dra7_uart1_bit_data[] __initconst = {
  489. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  490. { 0 },
  491. };
  492. static const struct omap_clkctrl_bit_data dra7_uart2_bit_data[] __initconst = {
  493. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  494. { 0 },
  495. };
  496. static const struct omap_clkctrl_bit_data dra7_uart3_bit_data[] __initconst = {
  497. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  498. { 0 },
  499. };
  500. static const struct omap_clkctrl_bit_data dra7_uart4_bit_data[] __initconst = {
  501. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  502. { 0 },
  503. };
  504. static const struct omap_clkctrl_bit_data dra7_uart5_bit_data[] __initconst = {
  505. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  506. { 0 },
  507. };
  508. static const struct omap_clkctrl_reg_data dra7_l4per_clkctrl_regs[] __initconst = {
  509. { DRA7_L4PER_TIMER10_CLKCTRL, dra7_timer10_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0000:24" },
  510. { DRA7_L4PER_TIMER11_CLKCTRL, dra7_timer11_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0008:24" },
  511. { DRA7_L4PER_TIMER2_CLKCTRL, dra7_timer2_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0010:24" },
  512. { DRA7_L4PER_TIMER3_CLKCTRL, dra7_timer3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0018:24" },
  513. { DRA7_L4PER_TIMER4_CLKCTRL, dra7_timer4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0020:24" },
  514. { DRA7_L4PER_TIMER9_CLKCTRL, dra7_timer9_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0028:24" },
  515. { DRA7_L4PER_ELM_CLKCTRL, NULL, 0, "l3_iclk_div" },
  516. { DRA7_L4PER_GPIO2_CLKCTRL, dra7_gpio2_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  517. { DRA7_L4PER_GPIO3_CLKCTRL, dra7_gpio3_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  518. { DRA7_L4PER_GPIO4_CLKCTRL, dra7_gpio4_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  519. { DRA7_L4PER_GPIO5_CLKCTRL, dra7_gpio5_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  520. { DRA7_L4PER_GPIO6_CLKCTRL, dra7_gpio6_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  521. { DRA7_L4PER_HDQ1W_CLKCTRL, NULL, CLKF_SW_SUP, "func_12m_fclk" },
  522. { DRA7_L4PER_I2C1_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
  523. { DRA7_L4PER_I2C2_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
  524. { DRA7_L4PER_I2C3_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
  525. { DRA7_L4PER_I2C4_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
  526. { DRA7_L4PER_L4_PER1_CLKCTRL, NULL, 0, "l3_iclk_div" },
  527. { DRA7_L4PER_MCSPI1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
  528. { DRA7_L4PER_MCSPI2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
  529. { DRA7_L4PER_MCSPI3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
  530. { DRA7_L4PER_MCSPI4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
  531. { DRA7_L4PER_GPIO7_CLKCTRL, dra7_gpio7_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  532. { DRA7_L4PER_GPIO8_CLKCTRL, dra7_gpio8_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
  533. { DRA7_L4PER_MMC3_CLKCTRL, dra7_mmc3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:00f8:25" },
  534. { DRA7_L4PER_MMC4_CLKCTRL, dra7_mmc4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0100:25" },
  535. { DRA7_L4PER_UART1_CLKCTRL, dra7_uart1_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0118:24" },
  536. { DRA7_L4PER_UART2_CLKCTRL, dra7_uart2_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0120:24" },
  537. { DRA7_L4PER_UART3_CLKCTRL, dra7_uart3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0128:24" },
  538. { DRA7_L4PER_UART4_CLKCTRL, dra7_uart4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0130:24" },
  539. { DRA7_L4PER_UART5_CLKCTRL, dra7_uart5_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0148:24" },
  540. { 0 },
  541. };
  542. static const struct omap_clkctrl_reg_data dra7_l4sec_clkctrl_regs[] __initconst = {
  543. { DRA7_L4SEC_AES1_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  544. { DRA7_L4SEC_AES2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  545. { DRA7_L4SEC_DES_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  546. { DRA7_L4SEC_RNG_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_NONSEC, "l4_root_clk_div" },
  547. { DRA7_L4SEC_SHAM_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  548. { DRA7_L4SEC_SHAM2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
  549. { 0 },
  550. };
  551. static const char * const dra7_qspi_gfclk_mux_parents[] __initconst = {
  552. "func_128m_clk",
  553. "dpll_per_h13x2_ck",
  554. NULL,
  555. };
  556. static const char * const dra7_qspi_gfclk_div_parents[] __initconst = {
  557. "l4per2-clkctrl:012c:24",
  558. NULL,
  559. };
  560. static const struct omap_clkctrl_div_data dra7_qspi_gfclk_div_data __initconst = {
  561. .max_div = 4,
  562. .flags = CLK_DIVIDER_POWER_OF_TWO,
  563. };
  564. static const struct omap_clkctrl_bit_data dra7_qspi_bit_data[] __initconst = {
  565. { 24, TI_CLK_MUX, dra7_qspi_gfclk_mux_parents, NULL },
  566. { 25, TI_CLK_DIVIDER, dra7_qspi_gfclk_div_parents, &dra7_qspi_gfclk_div_data },
  567. { 0 },
  568. };
  569. static const struct omap_clkctrl_bit_data dra7_mcasp2_bit_data[] __initconst = {
  570. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  571. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  572. { 28, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  573. { 0 },
  574. };
  575. static const struct omap_clkctrl_bit_data dra7_mcasp3_bit_data[] __initconst = {
  576. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  577. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  578. { 0 },
  579. };
  580. static const struct omap_clkctrl_bit_data dra7_mcasp5_bit_data[] __initconst = {
  581. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  582. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  583. { 0 },
  584. };
  585. static const struct omap_clkctrl_bit_data dra7_mcasp8_bit_data[] __initconst = {
  586. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  587. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  588. { 0 },
  589. };
  590. static const struct omap_clkctrl_bit_data dra7_mcasp4_bit_data[] __initconst = {
  591. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  592. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  593. { 0 },
  594. };
  595. static const struct omap_clkctrl_bit_data dra7_uart7_bit_data[] __initconst = {
  596. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  597. { 0 },
  598. };
  599. static const struct omap_clkctrl_bit_data dra7_uart8_bit_data[] __initconst = {
  600. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  601. { 0 },
  602. };
  603. static const struct omap_clkctrl_bit_data dra7_uart9_bit_data[] __initconst = {
  604. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  605. { 0 },
  606. };
  607. static const struct omap_clkctrl_bit_data dra7_mcasp6_bit_data[] __initconst = {
  608. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  609. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  610. { 0 },
  611. };
  612. static const struct omap_clkctrl_bit_data dra7_mcasp7_bit_data[] __initconst = {
  613. { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
  614. { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
  615. { 0 },
  616. };
  617. static const struct omap_clkctrl_reg_data dra7_l4per2_clkctrl_regs[] __initconst = {
  618. { DRA7_L4PER2_L4_PER2_CLKCTRL, NULL, 0, "l3_iclk_div" },
  619. { DRA7_L4PER2_PRUSS1_CLKCTRL, NULL, CLKF_SW_SUP, "" },
  620. { DRA7_L4PER2_PRUSS2_CLKCTRL, NULL, CLKF_SW_SUP, "" },
  621. { DRA7_L4PER2_EPWMSS1_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
  622. { DRA7_L4PER2_EPWMSS2_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
  623. { DRA7_L4PER2_EPWMSS0_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
  624. { DRA7_L4PER2_QSPI_CLKCTRL, dra7_qspi_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:012c:25" },
  625. { DRA7_L4PER2_MCASP2_CLKCTRL, dra7_mcasp2_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0154:22" },
  626. { DRA7_L4PER2_MCASP3_CLKCTRL, dra7_mcasp3_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:015c:22" },
  627. { DRA7_L4PER2_MCASP5_CLKCTRL, dra7_mcasp5_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:016c:22" },
  628. { DRA7_L4PER2_MCASP8_CLKCTRL, dra7_mcasp8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0184:22" },
  629. { DRA7_L4PER2_MCASP4_CLKCTRL, dra7_mcasp4_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:018c:22" },
  630. { DRA7_L4PER2_UART7_CLKCTRL, dra7_uart7_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01c4:24" },
  631. { DRA7_L4PER2_UART8_CLKCTRL, dra7_uart8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01d4:24" },
  632. { DRA7_L4PER2_UART9_CLKCTRL, dra7_uart9_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01dc:24" },
  633. { DRA7_L4PER2_DCAN2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_clkin1" },
  634. { DRA7_L4PER2_MCASP6_CLKCTRL, dra7_mcasp6_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01f8:22" },
  635. { DRA7_L4PER2_MCASP7_CLKCTRL, dra7_mcasp7_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01fc:22" },
  636. { 0 },
  637. };
  638. static const struct omap_clkctrl_bit_data dra7_timer13_bit_data[] __initconst = {
  639. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  640. { 0 },
  641. };
  642. static const struct omap_clkctrl_bit_data dra7_timer14_bit_data[] __initconst = {
  643. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  644. { 0 },
  645. };
  646. static const struct omap_clkctrl_bit_data dra7_timer15_bit_data[] __initconst = {
  647. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  648. { 0 },
  649. };
  650. static const struct omap_clkctrl_bit_data dra7_timer16_bit_data[] __initconst = {
  651. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  652. { 0 },
  653. };
  654. static const struct omap_clkctrl_reg_data dra7_l4per3_clkctrl_regs[] __initconst = {
  655. { DRA7_L4PER3_L4_PER3_CLKCTRL, NULL, 0, "l3_iclk_div" },
  656. { DRA7_L4PER3_TIMER13_CLKCTRL, dra7_timer13_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:00b4:24" },
  657. { DRA7_L4PER3_TIMER14_CLKCTRL, dra7_timer14_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:00bc:24" },
  658. { DRA7_L4PER3_TIMER15_CLKCTRL, dra7_timer15_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:00c4:24" },
  659. { DRA7_L4PER3_TIMER16_CLKCTRL, dra7_timer16_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:011c:24" },
  660. { 0 },
  661. };
  662. static const struct omap_clkctrl_bit_data dra7_gpio1_bit_data[] __initconst = {
  663. { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
  664. { 0 },
  665. };
  666. static const struct omap_clkctrl_bit_data dra7_timer1_bit_data[] __initconst = {
  667. { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
  668. { 0 },
  669. };
  670. static const struct omap_clkctrl_bit_data dra7_uart10_bit_data[] __initconst = {
  671. { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
  672. { 0 },
  673. };
  674. static const char * const dra7_dcan1_sys_clk_mux_parents[] __initconst = {
  675. "sys_clkin1",
  676. "sys_clkin2",
  677. NULL,
  678. };
  679. static const struct omap_clkctrl_bit_data dra7_dcan1_bit_data[] __initconst = {
  680. { 24, TI_CLK_MUX, dra7_dcan1_sys_clk_mux_parents, NULL },
  681. { 0 },
  682. };
  683. static const struct omap_clkctrl_reg_data dra7_wkupaon_clkctrl_regs[] __initconst = {
  684. { DRA7_WKUPAON_L4_WKUP_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" },
  685. { DRA7_WKUPAON_WD_TIMER2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" },
  686. { DRA7_WKUPAON_GPIO1_CLKCTRL, dra7_gpio1_bit_data, CLKF_HW_SUP, "wkupaon_iclk_mux" },
  687. { DRA7_WKUPAON_TIMER1_CLKCTRL, dra7_timer1_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0020:24" },
  688. { DRA7_WKUPAON_TIMER12_CLKCTRL, NULL, CLKF_SOC_NONSEC, "secure_32k_clk_src_ck" },
  689. { DRA7_WKUPAON_COUNTER_32K_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" },
  690. { DRA7_WKUPAON_UART10_CLKCTRL, dra7_uart10_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0060:24" },
  691. { DRA7_WKUPAON_DCAN1_CLKCTRL, dra7_dcan1_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0068:24" },
  692. { DRA7_WKUPAON_ADC_CLKCTRL, NULL, CLKF_SW_SUP | CLKF_SOC_DRA76, "mcan_clk" },
  693. { 0 },
  694. };
  695. const struct omap_clkctrl_data dra7_clkctrl_data[] __initconst = {
  696. { 0x4a005320, dra7_mpu_clkctrl_regs },
  697. { 0x4a005420, dra7_dsp1_clkctrl_regs },
  698. { 0x4a005520, dra7_ipu1_clkctrl_regs },
  699. { 0x4a005550, dra7_ipu_clkctrl_regs },
  700. { 0x4a005620, dra7_dsp2_clkctrl_regs },
  701. { 0x4a005720, dra7_rtc_clkctrl_regs },
  702. { 0x4a005760, dra7_vpe_clkctrl_regs },
  703. { 0x4a008620, dra7_coreaon_clkctrl_regs },
  704. { 0x4a008720, dra7_l3main1_clkctrl_regs },
  705. { 0x4a008920, dra7_ipu2_clkctrl_regs },
  706. { 0x4a008a20, dra7_dma_clkctrl_regs },
  707. { 0x4a008b20, dra7_emif_clkctrl_regs },
  708. { 0x4a008c00, dra7_atl_clkctrl_regs },
  709. { 0x4a008d20, dra7_l4cfg_clkctrl_regs },
  710. { 0x4a008e20, dra7_l3instr_clkctrl_regs },
  711. { 0x4a008f20, dra7_iva_clkctrl_regs },
  712. { 0x4a009020, dra7_cam_clkctrl_regs },
  713. { 0x4a009120, dra7_dss_clkctrl_regs },
  714. { 0x4a009220, dra7_gpu_clkctrl_regs },
  715. { 0x4a009320, dra7_l3init_clkctrl_regs },
  716. { 0x4a0093b0, dra7_pcie_clkctrl_regs },
  717. { 0x4a0093d0, dra7_gmac_clkctrl_regs },
  718. { 0x4a009728, dra7_l4per_clkctrl_regs },
  719. { 0x4a0098a0, dra7_l4sec_clkctrl_regs },
  720. { 0x4a00970c, dra7_l4per2_clkctrl_regs },
  721. { 0x4a009714, dra7_l4per3_clkctrl_regs },
  722. { 0x4ae07820, dra7_wkupaon_clkctrl_regs },
  723. { 0 },
  724. };
  725. static struct ti_dt_clk dra7xx_clks[] = {
  726. DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"),
  727. DT_CLK(NULL, "sys_clkin_ck", "timer_sys_clk_div"),
  728. DT_CLK(NULL, "sys_clkin", "sys_clkin1"),
  729. DT_CLK(NULL, "atl_dpll_clk_mux", "atl-clkctrl:0000:24"),
  730. DT_CLK(NULL, "atl_gfclk_mux", "atl-clkctrl:0000:26"),
  731. DT_CLK(NULL, "dcan1_sys_clk_mux", "wkupaon-clkctrl:0068:24"),
  732. DT_CLK(NULL, "dss_32khz_clk", "dss-clkctrl:0000:11"),
  733. DT_CLK(NULL, "dss_48mhz_clk", "dss-clkctrl:0000:9"),
  734. DT_CLK(NULL, "dss_dss_clk", "dss-clkctrl:0000:8"),
  735. DT_CLK(NULL, "dss_hdmi_clk", "dss-clkctrl:0000:10"),
  736. DT_CLK(NULL, "dss_video1_clk", "dss-clkctrl:0000:12"),
  737. DT_CLK(NULL, "dss_video2_clk", "dss-clkctrl:0000:13"),
  738. DT_CLK(NULL, "gmac_rft_clk_mux", "gmac-clkctrl:0000:25"),
  739. DT_CLK(NULL, "gpio1_dbclk", "wkupaon-clkctrl:0018:8"),
  740. DT_CLK(NULL, "gpio2_dbclk", "l4per-clkctrl:0038:8"),
  741. DT_CLK(NULL, "gpio3_dbclk", "l4per-clkctrl:0040:8"),
  742. DT_CLK(NULL, "gpio4_dbclk", "l4per-clkctrl:0048:8"),
  743. DT_CLK(NULL, "gpio5_dbclk", "l4per-clkctrl:0050:8"),
  744. DT_CLK(NULL, "gpio6_dbclk", "l4per-clkctrl:0058:8"),
  745. DT_CLK(NULL, "gpio7_dbclk", "l4per-clkctrl:00e8:8"),
  746. DT_CLK(NULL, "gpio8_dbclk", "l4per-clkctrl:00f0:8"),
  747. DT_CLK(NULL, "ipu1_gfclk_mux", "ipu1-clkctrl:0000:24"),
  748. DT_CLK(NULL, "mcasp1_ahclkr_mux", "ipu-clkctrl:0000:28"),
  749. DT_CLK(NULL, "mcasp1_ahclkx_mux", "ipu-clkctrl:0000:24"),
  750. DT_CLK(NULL, "mcasp1_aux_gfclk_mux", "ipu-clkctrl:0000:22"),
  751. DT_CLK(NULL, "mcasp2_ahclkr_mux", "l4per2-clkctrl:0154:28"),
  752. DT_CLK(NULL, "mcasp2_ahclkx_mux", "l4per2-clkctrl:0154:24"),
  753. DT_CLK(NULL, "mcasp2_aux_gfclk_mux", "l4per2-clkctrl:0154:22"),
  754. DT_CLK(NULL, "mcasp3_ahclkx_mux", "l4per2-clkctrl:015c:24"),
  755. DT_CLK(NULL, "mcasp3_aux_gfclk_mux", "l4per2-clkctrl:015c:22"),
  756. DT_CLK(NULL, "mcasp4_ahclkx_mux", "l4per2-clkctrl:018c:24"),
  757. DT_CLK(NULL, "mcasp4_aux_gfclk_mux", "l4per2-clkctrl:018c:22"),
  758. DT_CLK(NULL, "mcasp5_ahclkx_mux", "l4per2-clkctrl:016c:24"),
  759. DT_CLK(NULL, "mcasp5_aux_gfclk_mux", "l4per2-clkctrl:016c:22"),
  760. DT_CLK(NULL, "mcasp6_ahclkx_mux", "l4per2-clkctrl:01f8:24"),
  761. DT_CLK(NULL, "mcasp6_aux_gfclk_mux", "l4per2-clkctrl:01f8:22"),
  762. DT_CLK(NULL, "mcasp7_ahclkx_mux", "l4per2-clkctrl:01fc:24"),
  763. DT_CLK(NULL, "mcasp7_aux_gfclk_mux", "l4per2-clkctrl:01fc:22"),
  764. DT_CLK(NULL, "mcasp8_ahclkx_mux", "l4per2-clkctrl:0184:24"),
  765. DT_CLK(NULL, "mcasp8_aux_gfclk_mux", "l4per2-clkctrl:0184:22"),
  766. DT_CLK(NULL, "mmc1_clk32k", "l3init-clkctrl:0008:8"),
  767. DT_CLK(NULL, "mmc1_fclk_div", "l3init-clkctrl:0008:25"),
  768. DT_CLK(NULL, "mmc1_fclk_mux", "l3init-clkctrl:0008:24"),
  769. DT_CLK(NULL, "mmc2_clk32k", "l3init-clkctrl:0010:8"),
  770. DT_CLK(NULL, "mmc2_fclk_div", "l3init-clkctrl:0010:25"),
  771. DT_CLK(NULL, "mmc2_fclk_mux", "l3init-clkctrl:0010:24"),
  772. DT_CLK(NULL, "mmc3_clk32k", "l4per-clkctrl:00f8:8"),
  773. DT_CLK(NULL, "mmc3_gfclk_div", "l4per-clkctrl:00f8:25"),
  774. DT_CLK(NULL, "mmc3_gfclk_mux", "l4per-clkctrl:00f8:24"),
  775. DT_CLK(NULL, "mmc4_clk32k", "l4per-clkctrl:0100:8"),
  776. DT_CLK(NULL, "mmc4_gfclk_div", "l4per-clkctrl:0100:25"),
  777. DT_CLK(NULL, "mmc4_gfclk_mux", "l4per-clkctrl:0100:24"),
  778. DT_CLK(NULL, "optfclk_pciephy1_32khz", "pcie-clkctrl:0000:8"),
  779. DT_CLK(NULL, "optfclk_pciephy1_clk", "pcie-clkctrl:0000:9"),
  780. DT_CLK(NULL, "optfclk_pciephy1_div_clk", "pcie-clkctrl:0000:10"),
  781. DT_CLK(NULL, "optfclk_pciephy2_32khz", "pcie-clkctrl:0008:8"),
  782. DT_CLK(NULL, "optfclk_pciephy2_clk", "pcie-clkctrl:0008:9"),
  783. DT_CLK(NULL, "optfclk_pciephy2_div_clk", "pcie-clkctrl:0008:10"),
  784. DT_CLK(NULL, "qspi_gfclk_div", "l4per2-clkctrl:012c:25"),
  785. DT_CLK(NULL, "qspi_gfclk_mux", "l4per2-clkctrl:012c:24"),
  786. DT_CLK(NULL, "rmii_50mhz_clk_mux", "gmac-clkctrl:0000:24"),
  787. DT_CLK(NULL, "sata_ref_clk", "l3init-clkctrl:0068:8"),
  788. DT_CLK(NULL, "timer10_gfclk_mux", "l4per-clkctrl:0000:24"),
  789. DT_CLK(NULL, "timer11_gfclk_mux", "l4per-clkctrl:0008:24"),
  790. DT_CLK(NULL, "timer13_gfclk_mux", "l4per3-clkctrl:00b4:24"),
  791. DT_CLK(NULL, "timer14_gfclk_mux", "l4per3-clkctrl:00bc:24"),
  792. DT_CLK(NULL, "timer15_gfclk_mux", "l4per3-clkctrl:00c4:24"),
  793. DT_CLK(NULL, "timer16_gfclk_mux", "l4per3-clkctrl:011c:24"),
  794. DT_CLK(NULL, "timer1_gfclk_mux", "wkupaon-clkctrl:0020:24"),
  795. DT_CLK(NULL, "timer2_gfclk_mux", "l4per-clkctrl:0010:24"),
  796. DT_CLK(NULL, "timer3_gfclk_mux", "l4per-clkctrl:0018:24"),
  797. DT_CLK(NULL, "timer4_gfclk_mux", "l4per-clkctrl:0020:24"),
  798. DT_CLK(NULL, "timer5_gfclk_mux", "ipu-clkctrl:0008:24"),
  799. DT_CLK(NULL, "timer6_gfclk_mux", "ipu-clkctrl:0010:24"),
  800. DT_CLK(NULL, "timer7_gfclk_mux", "ipu-clkctrl:0018:24"),
  801. DT_CLK(NULL, "timer8_gfclk_mux", "ipu-clkctrl:0020:24"),
  802. DT_CLK(NULL, "timer9_gfclk_mux", "l4per-clkctrl:0028:24"),
  803. DT_CLK(NULL, "uart10_gfclk_mux", "wkupaon-clkctrl:0060:24"),
  804. DT_CLK(NULL, "uart1_gfclk_mux", "l4per-clkctrl:0118:24"),
  805. DT_CLK(NULL, "uart2_gfclk_mux", "l4per-clkctrl:0120:24"),
  806. DT_CLK(NULL, "uart3_gfclk_mux", "l4per-clkctrl:0128:24"),
  807. DT_CLK(NULL, "uart4_gfclk_mux", "l4per-clkctrl:0130:24"),
  808. DT_CLK(NULL, "uart5_gfclk_mux", "l4per-clkctrl:0148:24"),
  809. DT_CLK(NULL, "uart6_gfclk_mux", "ipu-clkctrl:0030:24"),
  810. DT_CLK(NULL, "uart7_gfclk_mux", "l4per2-clkctrl:01c4:24"),
  811. DT_CLK(NULL, "uart8_gfclk_mux", "l4per2-clkctrl:01d4:24"),
  812. DT_CLK(NULL, "uart9_gfclk_mux", "l4per2-clkctrl:01dc:24"),
  813. DT_CLK(NULL, "usb_otg_ss1_refclk960m", "l3init-clkctrl:00d0:8"),
  814. DT_CLK(NULL, "usb_otg_ss2_refclk960m", "l3init-clkctrl:0020:8"),
  815. { .node_name = NULL },
  816. };
  817. int __init dra7xx_dt_clk_init(void)
  818. {
  819. int rc;
  820. struct clk *dpll_ck, *hdcp_ck;
  821. ti_dt_clocks_register(dra7xx_clks);
  822. omap2_clk_disable_autoidle_all();
  823. ti_clk_add_aliases();
  824. dpll_ck = clk_get_sys(NULL, "dpll_gmac_ck");
  825. rc = clk_set_rate(dpll_ck, DRA7_DPLL_GMAC_DEFFREQ);
  826. if (rc)
  827. pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
  828. dpll_ck = clk_get_sys(NULL, "dpll_usb_ck");
  829. rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ);
  830. if (rc)
  831. pr_err("%s: failed to configure USB DPLL!\n", __func__);
  832. dpll_ck = clk_get_sys(NULL, "dpll_usb_m2_ck");
  833. rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ/2);
  834. if (rc)
  835. pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
  836. hdcp_ck = clk_get_sys(NULL, "dss_deshdcp_clk");
  837. rc = clk_prepare_enable(hdcp_ck);
  838. if (rc)
  839. pr_err("%s: failed to set dss_deshdcp_clk\n", __func__);
  840. return rc;
  841. }