analysisDataOperation.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * OMAP2420 clock data
  3. *
  4. * Copyright (C) 2005-2012 Texas Instruments, Inc.
  5. * Copyright (C) 2004-2011 Nokia Corporation
  6. *
  7. * Contacts:
  8. * Richard Woodruff <r-woodruff2@ti.com>
  9. * Paul Walmsley
  10. * Updated to COMMON clk format by Rajendra Nayak <rnayak@ti.com>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/io.h>
  18. #include <linux/clk.h>
  19. #include <linux/clk-private.h>
  20. #include <linux/list.h>
  21. #include "soc.h"
  22. #include "iomap.h"
  23. #include "clock.h"
  24. #include "clock2xxx.h"
  25. #include "opp2xxx.h"
  26. #include "cm2xxx.h"
  27. #include "prm2xxx.h"
  28. #include "prm-regbits-24xx.h"
  29. #include "cm-regbits-24xx.h"
  30. #include "sdrc.h"
  31. #include "control.h"
  32. #define OMAP_CM_REGADDR OMAP2420_CM_REGADDR
  33. /*
  34. * 2420 clock tree.
  35. *
  36. * NOTE:In many cases here we are assigning a 'default' parent. In
  37. * many cases the parent is selectable. The set parent calls will
  38. * also switch sources.
  39. *
  40. * Several sources are given initial rates which may be wrong, this will
  41. * be fixed up in the init func.
  42. *
  43. * Things are broadly separated below by clock domains. It is
  44. * noteworthy that most peripherals have dependencies on multiple clock
  45. * domains. Many get their interface clocks from the L4 domain, but get
  46. * functional clocks from fixed sources or other core domain derived
  47. * clocks.
  48. */
  49. DEFINE_CLK_FIXED_RATE(alt_ck, CLK_IS_ROOT, 54000000, 0x0);
  50. DEFINE_CLK_FIXED_RATE(func_32k_ck, CLK_IS_ROOT, 32768, 0x0);
  51. DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0);
  52. static struct clk osc_ck;
  53. static const struct clk_ops osc_ck_ops = {
  54. .recalc_rate = &omap2_osc_clk_recalc,
  55. };
  56. static struct clk_hw_omap osc_ck_hw = {
  57. .hw = {
  58. .clk = &osc_ck,
  59. },
  60. };
  61. static struct clk osc_ck = {
  62. .name = "osc_ck",
  63. .ops = &osc_ck_ops,
  64. .hw = &osc_ck_hw.hw,
  65. .flags = CLK_IS_ROOT,
  66. };
  67. DEFINE_CLK_FIXED_RATE(secure_32k_ck, CLK_IS_ROOT, 32768, 0x0);
  68. static struct clk sys_ck;
  69. static const char *sys_ck_parent_names[] = {
  70. "osc_ck",
  71. };
  72. static const struct clk_ops sys_ck_ops = {
  73. .init = &omap2_init_clk_clkdm,
  74. .recalc_rate = &omap2xxx_sys_clk_recalc,
  75. };
  76. DEFINE_STRUCT_CLK_HW_OMAP(sys_ck, "wkup_clkdm");
  77. DEFINE_STRUCT_CLK(sys_ck, sys_ck_parent_names, sys_ck_ops);
  78. static struct dpll_data dpll_dd = {
  79. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  80. .mult_mask = OMAP24XX_DPLL_MULT_MASK,
  81. .div1_mask = OMAP24XX_DPLL_DIV_MASK,
  82. .clk_bypass = &sys_ck,
  83. .clk_ref = &sys_ck,
  84. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  85. .enable_mask = OMAP24XX_EN_DPLL_MASK,
  86. .max_multiplier = 1023,
  87. .min_divider = 1,
  88. .max_divider = 16,
  89. };
  90. static struct clk dpll_ck;
  91. static const char *dpll_ck_parent_names[] = {
  92. "sys_ck",
  93. };
  94. static const struct clk_ops dpll_ck_ops = {
  95. .init = &omap2_init_clk_clkdm,
  96. .get_parent = &omap2_init_dpll_parent,
  97. .recalc_rate = &omap2_dpllcore_recalc,
  98. .round_rate = &omap2_dpll_round_rate,
  99. .set_rate = &omap2_reprogram_dpllcore,
  100. };
  101. static struct clk_hw_omap dpll_ck_hw = {
  102. .hw = {
  103. .clk = &dpll_ck,
  104. },
  105. .ops = &clkhwops_omap2xxx_dpll,
  106. .dpll_data = &dpll_dd,
  107. .clkdm_name = "wkup_clkdm",
  108. };
  109. DEFINE_STRUCT_CLK(dpll_ck, dpll_ck_parent_names, dpll_ck_ops);
  110. static struct clk core_ck;
  111. static const char *core_ck_parent_names[] = {
  112. "dpll_ck",
  113. };
  114. static const struct clk_ops core_ck_ops = {
  115. .init = &omap2_init_clk_clkdm,
  116. };
  117. DEFINE_STRUCT_CLK_HW_OMAP(core_ck, "wkup_clkdm");
  118. DEFINE_STRUCT_CLK(core_ck, core_ck_parent_names, core_ck_ops);
  119. DEFINE_CLK_DIVIDER(core_l3_ck, "core_ck", &core_ck, 0x0,
  120. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  121. OMAP24XX_CLKSEL_L3_SHIFT, OMAP24XX_CLKSEL_L3_WIDTH,
  122. CLK_DIVIDER_ONE_BASED, NULL);
  123. DEFINE_CLK_DIVIDER(l4_ck, "core_l3_ck", &core_l3_ck, 0x0,
  124. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  125. OMAP24XX_CLKSEL_L4_SHIFT, OMAP24XX_CLKSEL_L4_WIDTH,
  126. CLK_DIVIDER_ONE_BASED, NULL);
  127. static struct clk aes_ick;
  128. static const char *aes_ick_parent_names[] = {
  129. "l4_ck",
  130. };
  131. static const struct clk_ops aes_ick_ops = {
  132. .init = &omap2_init_clk_clkdm,
  133. .enable = &omap2_dflt_clk_enable,
  134. .disable = &omap2_dflt_clk_disable,
  135. .is_enabled = &omap2_dflt_clk_is_enabled,
  136. };
  137. static struct clk_hw_omap aes_ick_hw = {
  138. .hw = {
  139. .clk = &aes_ick,
  140. },
  141. .ops = &clkhwops_iclk_wait,
  142. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  143. .enable_bit = OMAP24XX_EN_AES_SHIFT,
  144. .clkdm_name = "core_l4_clkdm",
  145. };
  146. DEFINE_STRUCT_CLK(aes_ick, aes_ick_parent_names, aes_ick_ops);
  147. static struct clk apll54_ck;
  148. static const struct clk_ops apll54_ck_ops = {
  149. .init = &omap2_init_clk_clkdm,
  150. .enable = &omap2_clk_apll54_enable,
  151. .disable = &omap2_clk_apll54_disable,
  152. .recalc_rate = &omap2_clk_apll54_recalc,
  153. };
  154. static struct clk_hw_omap apll54_ck_hw = {
  155. .hw = {
  156. .clk = &apll54_ck,
  157. },
  158. .ops = &clkhwops_apll54,
  159. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  160. .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
  161. .flags = ENABLE_ON_INIT,
  162. .clkdm_name = "wkup_clkdm",
  163. };
  164. DEFINE_STRUCT_CLK(apll54_ck, dpll_ck_parent_names, apll54_ck_ops);
  165. static struct clk apll96_ck;
  166. static const struct clk_ops apll96_ck_ops = {
  167. .init = &omap2_init_clk_clkdm,
  168. .enable = &omap2_clk_apll96_enable,
  169. .disable = &omap2_clk_apll96_disable,
  170. .recalc_rate = &omap2_clk_apll96_recalc,
  171. };
  172. static struct clk_hw_omap apll96_ck_hw = {
  173. .hw = {
  174. .clk = &apll96_ck,
  175. },
  176. .ops = &clkhwops_apll96,
  177. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  178. .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
  179. .flags = ENABLE_ON_INIT,
  180. .clkdm_name = "wkup_clkdm",
  181. };
  182. DEFINE_STRUCT_CLK(apll96_ck, dpll_ck_parent_names, apll96_ck_ops);
  183. static struct clk func_96m_ck;
  184. static const char *func_96m_ck_parent_names[] = {
  185. "apll96_ck",
  186. };
  187. DEFINE_STRUCT_CLK_HW_OMAP(func_96m_ck, "wkup_clkdm");
  188. DEFINE_STRUCT_CLK(func_96m_ck, func_96m_ck_parent_names, core_ck_ops);
  189. static struct clk cam_fck;
  190. static const char *cam_fck_parent_names[] = {
  191. "func_96m_ck",
  192. };
  193. static struct clk_hw_omap cam_fck_hw = {
  194. .hw = {
  195. .clk = &cam_fck,
  196. },
  197. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  198. .enable_bit = OMAP24XX_EN_CAM_SHIFT,
  199. .clkdm_name = "core_l3_clkdm",
  200. };
  201. DEFINE_STRUCT_CLK(cam_fck, cam_fck_parent_names, aes_ick_ops);
  202. static struct clk cam_ick;
  203. static struct clk_hw_omap cam_ick_hw = {
  204. .hw = {
  205. .clk = &cam_ick,
  206. },
  207. .ops = &clkhwops_iclk,
  208. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  209. .enable_bit = OMAP24XX_EN_CAM_SHIFT,
  210. .clkdm_name = "core_l4_clkdm",
  211. };
  212. DEFINE_STRUCT_CLK(cam_ick, aes_ick_parent_names, aes_ick_ops);
  213. static struct clk des_ick;
  214. static struct clk_hw_omap des_ick_hw = {
  215. .hw = {
  216. .clk = &des_ick,
  217. },
  218. .ops = &clkhwops_iclk_wait,
  219. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  220. .enable_bit = OMAP24XX_EN_DES_SHIFT,
  221. .clkdm_name = "core_l4_clkdm",
  222. };
  223. DEFINE_STRUCT_CLK(des_ick, aes_ick_parent_names, aes_ick_ops);
  224. static const struct clksel_rate dsp_fck_core_rates[] = {
  225. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  226. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  227. { .div = 3, .val = 3, .flags = RATE_IN_24XX },
  228. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  229. { .div = 6, .val = 6, .flags = RATE_IN_242X },
  230. { .div = 8, .val = 8, .flags = RATE_IN_242X },
  231. { .div = 12, .val = 12, .flags = RATE_IN_242X },
  232. { .div = 0 }
  233. };
  234. static const struct clksel dsp_fck_clksel[] = {
  235. { .parent = &core_ck, .rates = dsp_fck_core_rates },
  236. { .parent = NULL },
  237. };
  238. static const char *dsp_fck_parent_names[] = {
  239. "core_ck",
  240. };
  241. static const struct clk_ops dsp_fck_ops = {
  242. .init = &omap2_init_clk_clkdm,
  243. .enable = &omap2_dflt_clk_enable,
  244. .disable = &omap2_dflt_clk_disable,
  245. .is_enabled = &omap2_dflt_clk_is_enabled,
  246. .recalc_rate = &omap2_clksel_recalc,
  247. .set_rate = &omap2_clksel_set_rate,
  248. .round_rate = &omap2_clksel_round_rate,
  249. };
  250. DEFINE_CLK_OMAP_MUX_GATE(dsp_fck, "dsp_clkdm", dsp_fck_clksel,
  251. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
  252. OMAP24XX_CLKSEL_DSP_MASK,
  253. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
  254. OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, &clkhwops_wait,
  255. dsp_fck_parent_names, dsp_fck_ops);
  256. static const struct clksel dsp_ick_clksel[] = {
  257. { .parent = &dsp_fck, .rates = dsp_ick_rates },
  258. { .parent = NULL },
  259. };
  260. static const char *dsp_ick_parent_names[] = {
  261. "dsp_fck",
  262. };
  263. DEFINE_CLK_OMAP_MUX_GATE(dsp_ick, "dsp_clkdm", dsp_ick_clksel,
  264. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
  265. OMAP24XX_CLKSEL_DSP_IF_MASK,
  266. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
  267. OMAP2420_EN_DSP_IPI_SHIFT, &clkhwops_iclk_wait,
  268. dsp_ick_parent_names, dsp_fck_ops);
  269. static const struct clksel_rate dss1_fck_sys_rates[] = {
  270. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  271. { .div = 0 }
  272. };
  273. static const struct clksel_rate dss1_fck_core_rates[] = {
  274. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  275. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  276. { .div = 3, .val = 3, .flags = RATE_IN_24XX },
  277. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  278. { .div = 5, .val = 5, .flags = RATE_IN_24XX },
  279. { .div = 6, .val = 6, .flags = RATE_IN_24XX },
  280. { .div = 8, .val = 8, .flags = RATE_IN_24XX },
  281. { .div = 9, .val = 9, .flags = RATE_IN_24XX },
  282. { .div = 12, .val = 12, .flags = RATE_IN_24XX },
  283. { .div = 16, .val = 16, .flags = RATE_IN_24XX },
  284. { .div = 0 }
  285. };
  286. static const struct clksel dss1_fck_clksel[] = {
  287. { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
  288. { .parent = &core_ck, .rates = dss1_fck_core_rates },
  289. { .parent = NULL },
  290. };
  291. static const char *dss1_fck_parent_names[] = {
  292. "sys_ck", "core_ck",
  293. };
  294. static struct clk dss1_fck;
  295. static const struct clk_ops dss1_fck_ops = {
  296. .init = &omap2_init_clk_clkdm,
  297. .enable = &omap2_dflt_clk_enable,
  298. .disable = &omap2_dflt_clk_disable,
  299. .is_enabled = &omap2_dflt_clk_is_enabled,
  300. .recalc_rate = &omap2_clksel_recalc,
  301. .get_parent = &omap2_clksel_find_parent_index,
  302. .set_parent = &omap2_clksel_set_parent,
  303. };
  304. DEFINE_CLK_OMAP_MUX_GATE(dss1_fck, "dss_clkdm", dss1_fck_clksel,
  305. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  306. OMAP24XX_CLKSEL_DSS1_MASK,
  307. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  308. OMAP24XX_EN_DSS1_SHIFT, NULL,
  309. dss1_fck_parent_names, dss1_fck_ops);
  310. static const struct clksel_rate dss2_fck_sys_rates[] = {
  311. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  312. { .div = 0 }
  313. };
  314. static const struct clksel_rate dss2_fck_48m_rates[] = {
  315. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  316. { .div = 0 }
  317. };
  318. static const struct clksel_rate func_48m_apll96_rates[] = {
  319. { .div = 2, .val = 0, .flags = RATE_IN_24XX },
  320. { .div = 0 }
  321. };
  322. static const struct clksel_rate func_48m_alt_rates[] = {
  323. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  324. { .div = 0 }
  325. };
  326. static const struct clksel func_48m_clksel[] = {
  327. { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
  328. { .parent = &alt_ck, .rates = func_48m_alt_rates },
  329. { .parent = NULL },
  330. };
  331. static const char *func_48m_ck_parent_names[] = {
  332. "apll96_ck", "alt_ck",
  333. };
  334. static struct clk func_48m_ck;
  335. static const struct clk_ops func_48m_ck_ops = {
  336. .init = &omap2_init_clk_clkdm,
  337. .recalc_rate = &omap2_clksel_recalc,
  338. .set_rate = &omap2_clksel_set_rate,
  339. .round_rate = &omap2_clksel_round_rate,
  340. .get_parent = &omap2_clksel_find_parent_index,
  341. .set_parent = &omap2_clksel_set_parent,
  342. };
  343. static struct clk_hw_omap func_48m_ck_hw = {
  344. .hw = {
  345. .clk = &func_48m_ck,
  346. },
  347. .clksel = func_48m_clksel,
  348. .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  349. .clksel_mask = OMAP24XX_48M_SOURCE_MASK,
  350. .clkdm_name = "wkup_clkdm",
  351. };
  352. DEFINE_STRUCT_CLK(func_48m_ck, func_48m_ck_parent_names, func_48m_ck_ops);
  353. static const struct clksel dss2_fck_clksel[] = {
  354. { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
  355. { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
  356. { .parent = NULL },
  357. };
  358. static const char *dss2_fck_parent_names[] = {
  359. "sys_ck", "func_48m_ck",
  360. };
  361. DEFINE_CLK_OMAP_MUX_GATE(dss2_fck, "dss_clkdm", dss2_fck_clksel,
  362. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  363. OMAP24XX_CLKSEL_DSS2_MASK,
  364. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  365. OMAP24XX_EN_DSS2_SHIFT, NULL,
  366. dss2_fck_parent_names, dss1_fck_ops);
  367. static const char *func_54m_ck_parent_names[] = {
  368. "apll54_ck", "alt_ck",
  369. };
  370. DEFINE_CLK_MUX(func_54m_ck, func_54m_ck_parent_names, NULL, 0x0,
  371. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  372. OMAP24XX_54M_SOURCE_SHIFT, OMAP24XX_54M_SOURCE_WIDTH,
  373. 0x0, NULL);
  374. static struct clk dss_54m_fck;
  375. static const char *dss_54m_fck_parent_names[] = {
  376. "func_54m_ck",
  377. };
  378. static struct clk_hw_omap dss_54m_fck_hw = {
  379. .hw = {
  380. .clk = &dss_54m_fck,
  381. },
  382. .ops = &clkhwops_wait,
  383. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  384. .enable_bit = OMAP24XX_EN_TV_SHIFT,
  385. .clkdm_name = "dss_clkdm",
  386. };
  387. DEFINE_STRUCT_CLK(dss_54m_fck, dss_54m_fck_parent_names, aes_ick_ops);
  388. static struct clk dss_ick;
  389. static struct clk_hw_omap dss_ick_hw = {
  390. .hw = {
  391. .clk = &dss_ick,
  392. },
  393. .ops = &clkhwops_iclk,
  394. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  395. .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
  396. .clkdm_name = "dss_clkdm",
  397. };
  398. DEFINE_STRUCT_CLK(dss_ick, aes_ick_parent_names, aes_ick_ops);
  399. static struct clk eac_fck;
  400. static struct clk_hw_omap eac_fck_hw = {
  401. .hw = {
  402. .clk = &eac_fck,
  403. },
  404. .ops = &clkhwops_wait,
  405. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  406. .enable_bit = OMAP2420_EN_EAC_SHIFT,
  407. .clkdm_name = "core_l4_clkdm",
  408. };
  409. DEFINE_STRUCT_CLK(eac_fck, cam_fck_parent_names, aes_ick_ops);
  410. static struct clk eac_ick;
  411. static struct clk_hw_omap eac_ick_hw = {
  412. .hw = {
  413. .clk = &eac_ick,
  414. },
  415. .ops = &clkhwops_iclk_wait,
  416. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  417. .enable_bit = OMAP2420_EN_EAC_SHIFT,
  418. .clkdm_name = "core_l4_clkdm",
  419. };
  420. DEFINE_STRUCT_CLK(eac_ick, aes_ick_parent_names, aes_ick_ops);
  421. static struct clk emul_ck;
  422. static struct clk_hw_omap emul_ck_hw = {
  423. .hw = {
  424. .clk = &emul_ck,
  425. },
  426. .enable_reg = OMAP2420_PRCM_CLKEMUL_CTRL,
  427. .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
  428. .clkdm_name = "wkup_clkdm",
  429. };
  430. DEFINE_STRUCT_CLK(emul_ck, dss_54m_fck_parent_names, aes_ick_ops);
  431. DEFINE_CLK_FIXED_FACTOR(func_12m_ck, "func_48m_ck", &func_48m_ck, 0x0, 1, 4);
  432. static struct clk fac_fck;
  433. static const char *fac_fck_parent_names[] = {
  434. "func_12m_ck",
  435. };
  436. static struct clk_hw_omap fac_fck_hw = {
  437. .hw = {
  438. .clk = &fac_fck,
  439. },
  440. .ops = &clkhwops_wait,
  441. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  442. .enable_bit = OMAP24XX_EN_FAC_SHIFT,
  443. .clkdm_name = "core_l4_clkdm",
  444. };
  445. DEFINE_STRUCT_CLK(fac_fck, fac_fck_parent_names, aes_ick_ops);
  446. static struct clk fac_ick;
  447. static struct clk_hw_omap fac_ick_hw = {
  448. .hw = {
  449. .clk = &fac_ick,
  450. },
  451. .ops = &clkhwops_iclk_wait,
  452. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  453. .enable_bit = OMAP24XX_EN_FAC_SHIFT,
  454. .clkdm_name = "core_l4_clkdm",
  455. };
  456. DEFINE_STRUCT_CLK(fac_ick, aes_ick_parent_names, aes_ick_ops);
  457. static const struct clksel gfx_fck_clksel[] = {
  458. { .parent = &core_l3_ck, .rates = gfx_l3_rates },
  459. { .parent = NULL },
  460. };
  461. static const char *gfx_2d_fck_parent_names[] = {
  462. "core_l3_ck",
  463. };
  464. DEFINE_CLK_OMAP_MUX_GATE(gfx_2d_fck, "gfx_clkdm", gfx_fck_clksel,
  465. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  466. OMAP_CLKSEL_GFX_MASK,
  467. OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  468. OMAP24XX_EN_2D_SHIFT, &clkhwops_wait,
  469. gfx_2d_fck_parent_names, dsp_fck_ops);
  470. DEFINE_CLK_OMAP_MUX_GATE(gfx_3d_fck, "gfx_clkdm", gfx_fck_clksel,
  471. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  472. OMAP_CLKSEL_GFX_MASK,
  473. OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  474. OMAP24XX_EN_3D_SHIFT, &clkhwops_wait,
  475. gfx_2d_fck_parent_names, dsp_fck_ops);
  476. static struct clk gfx_ick;
  477. static const char *gfx_ick_parent_names[] = {
  478. "core_l3_ck",
  479. };
  480. static struct clk_hw_omap gfx_ick_hw = {
  481. .hw = {
  482. .clk = &gfx_ick,
  483. },
  484. .ops = &clkhwops_wait,
  485. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
  486. .enable_bit = OMAP_EN_GFX_SHIFT,
  487. .clkdm_name = "gfx_clkdm",
  488. };
  489. DEFINE_STRUCT_CLK(gfx_ick, gfx_ick_parent_names, aes_ick_ops);
  490. static struct clk gpios_fck;
  491. static const char *gpios_fck_parent_names[] = {
  492. "func_32k_ck",
  493. };
  494. static struct clk_hw_omap gpios_fck_hw = {
  495. .hw = {
  496. .clk = &gpios_fck,
  497. },
  498. .ops = &clkhwops_wait,
  499. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  500. .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,