preliminaryDataProcessing.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  1. /*
  2. * OMAP3 clock data
  3. *
  4. * Copyright (C) 2007-2012 Texas Instruments, Inc.
  5. * Copyright (C) 2007-2011 Nokia Corporation
  6. *
  7. * Written by Paul Walmsley
  8. * Updated to COMMON clk data format by Rajendra Nayak <rnayak@ti.com>
  9. * With many device clock fixes by Kevin Hilman and Jouni Högander
  10. * DPLL bypass clock support added by Roman Tereshonkov
  11. *
  12. */
  13. /*
  14. * Virtual clocks are introduced as convenient tools.
  15. * They are sources for other clocks and not supposed
  16. * to be requested from drivers directly.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/clk.h>
  20. #include <linux/clk-private.h>
  21. #include <linux/list.h>
  22. #include <linux/io.h>
  23. #include "soc.h"
  24. #include "iomap.h"
  25. #include "clock.h"
  26. #include "clock3xxx.h"
  27. #include "clock34xx.h"
  28. #include "clock36xx.h"
  29. #include "clock3517.h"
  30. #include "cm3xxx.h"
  31. #include "cm-regbits-34xx.h"
  32. #include "prm3xxx.h"
  33. #include "prm-regbits-34xx.h"
  34. #include "control.h"
  35. /*
  36. * clocks
  37. */
  38. #define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR
  39. /* Maximum DPLL multiplier, divider values for OMAP3 */
  40. #define OMAP3_MAX_DPLL_MULT 2047
  41. #define OMAP3630_MAX_JTYPE_DPLL_MULT 4095
  42. #define OMAP3_MAX_DPLL_DIV 128
  43. DEFINE_CLK_FIXED_RATE(dummy_apb_pclk, CLK_IS_ROOT, 0x0, 0x0);
  44. DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0);
  45. DEFINE_CLK_FIXED_RATE(omap_32k_fck, CLK_IS_ROOT, 32768, 0x0);
  46. DEFINE_CLK_FIXED_RATE(pclk_ck, CLK_IS_ROOT, 27000000, 0x0);
  47. DEFINE_CLK_FIXED_RATE(rmii_ck, CLK_IS_ROOT, 50000000, 0x0);
  48. DEFINE_CLK_FIXED_RATE(secure_32k_fck, CLK_IS_ROOT, 32768, 0x0);
  49. DEFINE_CLK_FIXED_RATE(sys_altclk, CLK_IS_ROOT, 0x0, 0x0);
  50. DEFINE_CLK_FIXED_RATE(virt_12m_ck, CLK_IS_ROOT, 12000000, 0x0);
  51. DEFINE_CLK_FIXED_RATE(virt_13m_ck, CLK_IS_ROOT, 13000000, 0x0);
  52. DEFINE_CLK_FIXED_RATE(virt_16_8m_ck, CLK_IS_ROOT, 16800000, 0x0);
  53. DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
  54. DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
  55. DEFINE_CLK_FIXED_RATE(virt_38_4m_ck, CLK_IS_ROOT, 38400000, 0x0);
  56. static const char *osc_sys_ck_parent_names[] = {
  57. "virt_12m_ck", "virt_13m_ck", "virt_19200000_ck", "virt_26000000_ck",
  58. "virt_38_4m_ck", "virt_16_8m_ck",
  59. };
  60. DEFINE_CLK_MUX(osc_sys_ck, osc_sys_ck_parent_names, NULL, 0x0,
  61. OMAP3430_PRM_CLKSEL, OMAP3430_SYS_CLKIN_SEL_SHIFT,
  62. OMAP3430_SYS_CLKIN_SEL_WIDTH, 0x0, NULL);
  63. DEFINE_CLK_DIVIDER(sys_ck, "osc_sys_ck", &osc_sys_ck, 0x0,
  64. OMAP3430_PRM_CLKSRC_CTRL, OMAP_SYSCLKDIV_SHIFT,
  65. OMAP_SYSCLKDIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
  66. static struct dpll_data dpll3_dd = {
  67. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  68. .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK,
  69. .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK,
  70. .clk_bypass = &sys_ck,
  71. .clk_ref = &sys_ck,
  72. .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK,
  73. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  74. .enable_mask = OMAP3430_EN_CORE_DPLL_MASK,
  75. .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
  76. .recal_en_bit = OMAP3430_CORE_DPLL_RECAL_EN_SHIFT,
  77. .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT,
  78. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  79. .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK,
  80. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  81. .idlest_mask = OMAP3430_ST_CORE_CLK_MASK,
  82. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  83. .min_divider = 1,
  84. .max_divider = OMAP3_MAX_DPLL_DIV,
  85. };
  86. static struct clk dpll3_ck;
  87. static const char *dpll3_ck_parent_names[] = {
  88. "sys_ck",
  89. };
  90. static const struct clk_ops dpll3_ck_ops = {
  91. .init = &omap2_init_clk_clkdm,
  92. .get_parent = &omap2_init_dpll_parent,
  93. .recalc_rate = &omap3_dpll_recalc,
  94. .round_rate = &omap2_dpll_round_rate,
  95. };
  96. static struct clk_hw_omap dpll3_ck_hw = {
  97. .hw = {
  98. .clk = &dpll3_ck,
  99. },
  100. .ops = &clkhwops_omap3_dpll,
  101. .dpll_data = &dpll3_dd,
  102. .clkdm_name = "dpll3_clkdm",
  103. };
  104. DEFINE_STRUCT_CLK(dpll3_ck, dpll3_ck_parent_names, dpll3_ck_ops);
  105. DEFINE_CLK_DIVIDER(dpll3_m2_ck, "dpll3_ck", &dpll3_ck, 0x0,
  106. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  107. OMAP3430_CORE_DPLL_CLKOUT_DIV_SHIFT,
  108. OMAP3430_CORE_DPLL_CLKOUT_DIV_WIDTH,
  109. CLK_DIVIDER_ONE_BASED, NULL);
  110. static struct clk core_ck;
  111. static const char *core_ck_parent_names[] = {
  112. "dpll3_m2_ck",
  113. };
  114. static const struct clk_ops core_ck_ops = {};
  115. DEFINE_STRUCT_CLK_HW_OMAP(core_ck, NULL);
  116. DEFINE_STRUCT_CLK(core_ck, core_ck_parent_names, core_ck_ops);
  117. DEFINE_CLK_DIVIDER(l3_ick, "core_ck", &core_ck, 0x0,
  118. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  119. OMAP3430_CLKSEL_L3_SHIFT, OMAP3430_CLKSEL_L3_WIDTH,
  120. CLK_DIVIDER_ONE_BASED, NULL);
  121. DEFINE_CLK_DIVIDER(l4_ick, "l3_ick", &l3_ick, 0x0,
  122. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  123. OMAP3430_CLKSEL_L4_SHIFT, OMAP3430_CLKSEL_L4_WIDTH,
  124. CLK_DIVIDER_ONE_BASED, NULL);
  125. static struct clk security_l4_ick2;
  126. static const char *security_l4_ick2_parent_names[] = {
  127. "l4_ick",
  128. };
  129. DEFINE_STRUCT_CLK_HW_OMAP(security_l4_ick2, NULL);
  130. DEFINE_STRUCT_CLK(security_l4_ick2, security_l4_ick2_parent_names, core_ck_ops);
  131. static struct clk aes1_ick;
  132. static const char *aes1_ick_parent_names[] = {
  133. "security_l4_ick2",
  134. };
  135. static const struct clk_ops aes1_ick_ops = {
  136. .enable = &omap2_dflt_clk_enable,
  137. .disable = &omap2_dflt_clk_disable,
  138. .is_enabled = &omap2_dflt_clk_is_enabled,
  139. };
  140. static struct clk_hw_omap aes1_ick_hw = {
  141. .hw = {
  142. .clk = &aes1_ick,
  143. },
  144. .ops = &clkhwops_iclk_wait,
  145. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  146. .enable_bit = OMAP3430_EN_AES1_SHIFT,
  147. };
  148. DEFINE_STRUCT_CLK(aes1_ick, aes1_ick_parent_names, aes1_ick_ops);
  149. static struct clk core_l4_ick;
  150. static const struct clk_ops core_l4_ick_ops = {
  151. .init = &omap2_init_clk_clkdm,
  152. };
  153. DEFINE_STRUCT_CLK_HW_OMAP(core_l4_ick, "core_l4_clkdm");
  154. DEFINE_STRUCT_CLK(core_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  155. static struct clk aes2_ick;
  156. static const char *aes2_ick_parent_names[] = {
  157. "core_l4_ick",
  158. };
  159. static const struct clk_ops aes2_ick_ops = {
  160. .init = &omap2_init_clk_clkdm,
  161. .enable = &omap2_dflt_clk_enable,
  162. .disable = &omap2_dflt_clk_disable,
  163. .is_enabled = &omap2_dflt_clk_is_enabled,
  164. };
  165. static struct clk_hw_omap aes2_ick_hw = {
  166. .hw = {
  167. .clk = &aes2_ick,
  168. },
  169. .ops = &clkhwops_iclk_wait,
  170. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  171. .enable_bit = OMAP3430_EN_AES2_SHIFT,
  172. .clkdm_name = "core_l4_clkdm",
  173. };
  174. DEFINE_STRUCT_CLK(aes2_ick, aes2_ick_parent_names, aes2_ick_ops);
  175. static struct clk dpll1_fck;
  176. static struct dpll_data dpll1_dd = {
  177. .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  178. .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK,
  179. .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK,
  180. .clk_bypass = &dpll1_fck,
  181. .clk_ref = &sys_ck,
  182. .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK,
  183. .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
  184. .enable_mask = OMAP3430_EN_MPU_DPLL_MASK,
  185. .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
  186. .auto_recal_bit = OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT,
  187. .recal_en_bit = OMAP3430_MPU_DPLL_RECAL_EN_SHIFT,
  188. .recal_st_bit = OMAP3430_MPU_DPLL_ST_SHIFT,
  189. .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  190. .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK,
  191. .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
  192. .idlest_mask = OMAP3430_ST_MPU_CLK_MASK,
  193. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  194. .min_divider = 1,
  195. .max_divider = OMAP3_MAX_DPLL_DIV,
  196. };
  197. static struct clk dpll1_ck;
  198. static const struct clk_ops dpll1_ck_ops = {
  199. .init = &omap2_init_clk_clkdm,
  200. .enable = &omap3_noncore_dpll_enable,
  201. .disable = &omap3_noncore_dpll_disable,
  202. .get_parent = &omap2_init_dpll_parent,
  203. .recalc_rate = &omap3_dpll_recalc,
  204. .set_rate = &omap3_noncore_dpll_set_rate,
  205. .round_rate = &omap2_dpll_round_rate,
  206. };
  207. static struct clk_hw_omap dpll1_ck_hw = {
  208. .hw = {
  209. .clk = &dpll1_ck,
  210. },
  211. .ops = &clkhwops_omap3_dpll,
  212. .dpll_data = &dpll1_dd,
  213. .clkdm_name = "dpll1_clkdm",
  214. };
  215. DEFINE_STRUCT_CLK(dpll1_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  216. DEFINE_CLK_FIXED_FACTOR(dpll1_x2_ck, "dpll1_ck", &dpll1_ck, 0x0, 2, 1);
  217. DEFINE_CLK_DIVIDER(dpll1_x2m2_ck, "dpll1_x2_ck", &dpll1_x2_ck, 0x0,
  218. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
  219. OMAP3430_MPU_DPLL_CLKOUT_DIV_SHIFT,
  220. OMAP3430_MPU_DPLL_CLKOUT_DIV_WIDTH,
  221. CLK_DIVIDER_ONE_BASED, NULL);
  222. static struct clk mpu_ck;
  223. static const char *mpu_ck_parent_names[] = {
  224. "dpll1_x2m2_ck",
  225. };
  226. DEFINE_STRUCT_CLK_HW_OMAP(mpu_ck, "mpu_clkdm");
  227. DEFINE_STRUCT_CLK(mpu_ck, mpu_ck_parent_names, core_l4_ick_ops);
  228. DEFINE_CLK_DIVIDER(arm_fck, "mpu_ck", &mpu_ck, 0x0,
  229. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
  230. OMAP3430_ST_MPU_CLK_SHIFT, OMAP3430_ST_MPU_CLK_WIDTH,
  231. 0x0, NULL);
  232. static struct clk cam_ick;
  233. static struct clk_hw_omap cam_ick_hw = {
  234. .hw = {
  235. .clk = &cam_ick,
  236. },
  237. .ops = &clkhwops_iclk,
  238. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
  239. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  240. .clkdm_name = "cam_clkdm",
  241. };
  242. DEFINE_STRUCT_CLK(cam_ick, security_l4_ick2_parent_names, aes2_ick_ops);
  243. /* DPLL4 */
  244. /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
  245. /* Type: DPLL */
  246. static struct dpll_data dpll4_dd;
  247. static struct dpll_data dpll4_dd_34xx __initdata = {
  248. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
  249. .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK,
  250. .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
  251. .clk_bypass = &sys_ck,
  252. .clk_ref = &sys_ck,
  253. .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
  254. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  255. .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
  256. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  257. .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
  258. .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
  259. .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
  260. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  261. .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
  262. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  263. .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
  264. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  265. .min_divider = 1,
  266. .max_divider = OMAP3_MAX_DPLL_DIV,
  267. };
  268. static struct dpll_data dpll4_dd_3630 __initdata = {
  269. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
  270. .mult_mask = OMAP3630_PERIPH_DPLL_MULT_MASK,
  271. .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
  272. .clk_bypass = &sys_ck,
  273. .clk_ref = &sys_ck,
  274. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  275. .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
  276. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  277. .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
  278. .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
  279. .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
  280. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  281. .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
  282. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  283. .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
  284. .dco_mask = OMAP3630_PERIPH_DPLL_DCO_SEL_MASK,
  285. .sddiv_mask = OMAP3630_PERIPH_DPLL_SD_DIV_MASK,
  286. .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
  287. .min_divider = 1,
  288. .max_divider = OMAP3_MAX_DPLL_DIV,
  289. .flags = DPLL_J_TYPE
  290. };
  291. static struct clk dpll4_ck;
  292. static const struct clk_ops dpll4_ck_ops = {
  293. .init = &omap2_init_clk_clkdm,
  294. .enable = &omap3_noncore_dpll_enable,
  295. .disable = &omap3_noncore_dpll_disable,
  296. .get_parent = &omap2_init_dpll_parent,
  297. .recalc_rate = &omap3_dpll_recalc,
  298. .set_rate = &omap3_dpll4_set_rate,
  299. .round_rate = &omap2_dpll_round_rate,
  300. };
  301. static struct clk_hw_omap dpll4_ck_hw = {
  302. .hw = {
  303. .clk = &dpll4_ck,
  304. },
  305. .dpll_data = &dpll4_dd,
  306. .ops = &clkhwops_omap3_dpll,
  307. .clkdm_name = "dpll4_clkdm",
  308. };
  309. DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops);
  310. DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0,
  311. OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
  312. OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH,
  313. CLK_DIVIDER_ONE_BASED, NULL);
  314. static struct clk dpll4_m5x2_ck;
  315. static const char *dpll4_m5x2_ck_parent_names[] = {
  316. "dpll4_m5_ck",
  317. };
  318. static const struct clk_ops dpll4_m5x2_ck_ops = {
  319. .init = &omap2_init_clk_clkdm,
  320. .enable = &omap2_dflt_clk_enable,
  321. .disable = &omap2_dflt_clk_disable,
  322. .is_enabled = &omap2_dflt_clk_is_enabled,
  323. .recalc_rate = &omap3_clkoutx2_recalc,
  324. };
  325. static const struct clk_ops dpll4_m5x2_ck_3630_ops = {
  326. .init = &omap2_init_clk_clkdm,
  327. .enable = &omap36xx_pwrdn_clk_enable_with_hsdiv_restore,
  328. .disable = &omap2_dflt_clk_disable,
  329. .recalc_rate = &omap3_clkoutx2_recalc,
  330. };
  331. static struct clk_hw_omap dpll4_m5x2_ck_hw = {
  332. .hw = {
  333. .clk = &dpll4_m5x2_ck,
  334. },
  335. .ops = &clkhwops_wait,
  336. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  337. .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
  338. .flags = INVERT_ENABLE,
  339. .clkdm_name = "dpll4_clkdm",
  340. };
  341. DEFINE_STRUCT_CLK(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, dpll4_m5x2_ck_ops);
  342. static struct clk dpll4_m5x2_ck_3630 = {
  343. .name = "dpll4_m5x2_ck",
  344. .hw = &dpll4_m5x2_ck_hw.hw,
  345. .parent_names = dpll4_m5x2_ck_parent_names,
  346. .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names),
  347. .ops = &dpll4_m5x2_ck_3630_ops,
  348. };
  349. static struct clk cam_mclk;
  350. static const char *cam_mclk_parent_names[] = {
  351. "dpll4_m5x2_ck",
  352. };
  353. static struct clk_hw_omap cam_mclk_hw = {
  354. .hw = {
  355. .clk = &cam_mclk,
  356. },
  357. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  358. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  359. .clkdm_name = "cam_clkdm",
  360. };
  361. DEFINE_STRUCT_CLK(cam_mclk, cam_mclk_parent_names, aes2_ick_ops);
  362. static const struct clksel_rate clkout2_src_core_rates[] = {
  363. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  364. { .div = 0 }
  365. };
  366. static const struct clksel_rate clkout2_src_sys_rates[] = {
  367. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  368. { .div = 0 }
  369. };
  370. static const struct clksel_rate clkout2_src_96m_rates[] = {
  371. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  372. { .div = 0 }
  373. };
  374. DEFINE_CLK_DIVIDER(dpll4_m2_ck, "dpll4_ck", &dpll4_ck, 0x0,
  375. OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
  376. OMAP3430_DIV_96M_SHIFT, OMAP3630_DIV_96M_WIDTH,
  377. CLK_DIVIDER_ONE_BASED, NULL);
  378. static struct clk dpll4_m2x2_ck;
  379. static const char *dpll4_m2x2_ck_parent_names[] = {
  380. "dpll4_m2_ck",
  381. };
  382. static struct clk_hw_omap dpll4_m2x2_ck_hw = {
  383. .hw = {
  384. .clk = &dpll4_m2x2_ck,
  385. },
  386. .ops = &clkhwops_wait,
  387. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  388. .enable_bit = OMAP3430_PWRDN_96M_SHIFT,
  389. .flags = INVERT_ENABLE,
  390. .clkdm_name = "dpll4_clkdm",
  391. };
  392. DEFINE_STRUCT_CLK(dpll4_m2x2_ck, dpll4_m2x2_ck_parent_names, dpll4_m5x2_ck_ops);
  393. static struct clk dpll4_m2x2_ck_3630 = {
  394. .name = "dpll4_m2x2_ck",
  395. .hw = &dpll4_m2x2_ck_hw.hw,
  396. .parent_names = dpll4_m2x2_ck_parent_names,
  397. .num_parents = ARRAY_SIZE(dpll4_m2x2_ck_parent_names),
  398. .ops = &dpll4_m5x2_ck_3630_ops,
  399. };
  400. static struct clk omap_96m_alwon_fck;
  401. static const char *omap_96m_alwon_fck_parent_names[] = {
  402. "dpll4_m2x2_ck",
  403. };
  404. DEFINE_STRUCT_CLK_HW_OMAP(omap_96m_alwon_fck, NULL);
  405. DEFINE_STRUCT_CLK(omap_96m_alwon_fck, omap_96m_alwon_fck_parent_names,
  406. core_ck_ops);
  407. static struct clk cm_96m_fck;
  408. static const char *cm_96m_fck_parent_names[] = {
  409. "omap_96m_alwon_fck",
  410. };
  411. DEFINE_STRUCT_CLK_HW_OMAP(cm_96m_fck, NULL);
  412. DEFINE_STRUCT_CLK(cm_96m_fck, cm_96m_fck_parent_names, core_ck_ops);
  413. static const struct clksel_rate clkout2_src_54m_rates[] = {
  414. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  415. { .div = 0 }
  416. };
  417. DEFINE_CLK_DIVIDER(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0,
  418. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  419. OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH,
  420. CLK_DIVIDER_ONE_BASED, NULL);
  421. static struct clk dpll4_m3x2_ck;
  422. static const char *dpll4_m3x2_ck_parent_names[] = {
  423. "dpll4_m3_ck",
  424. };
  425. static struct clk_hw_omap dpll4_m3x2_ck_hw = {
  426. .hw = {
  427. .clk = &dpll4_m3x2_ck,
  428. },
  429. .ops = &clkhwops_wait,
  430. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  431. .enable_bit = OMAP3430_PWRDN_TV_SHIFT,
  432. .flags = INVERT_ENABLE,
  433. .clkdm_name = "dpll4_clkdm",
  434. };
  435. DEFINE_STRUCT_CLK(dpll4_m3x2_ck, dpll4_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  436. static struct clk dpll4_m3x2_ck_3630 = {
  437. .name = "dpll4_m3x2_ck",
  438. .hw = &dpll4_m3x2_ck_hw.hw,
  439. .parent_names = dpll4_m3x2_ck_parent_names,
  440. .num_parents = ARRAY_SIZE(dpll4_m3x2_ck_parent_names),
  441. .ops = &dpll4_m5x2_ck_3630_ops,
  442. };
  443. static const char *omap_54m_fck_parent_names[] = {
  444. "dpll4_m3x2_ck", "sys_altclk",
  445. };
  446. DEFINE_CLK_MUX(omap_54m_fck, omap_54m_fck_parent_names, NULL, 0x0,
  447. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), OMAP3430_SOURCE_54M_SHIFT,
  448. OMAP3430_SOURCE_54M_WIDTH, 0x0, NULL);
  449. static const struct clksel clkout2_src_clksel[] = {
  450. { .parent = &core_ck, .rates = clkout2_src_core_rates },
  451. { .parent = &sys_ck, .rates = clkout2_src_sys_rates },
  452. { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates },
  453. { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates },
  454. { .parent = NULL },
  455. };
  456. static const char *clkout2_src_ck_parent_names[] = {
  457. "core_ck", "sys_ck", "cm_96m_fck", "omap_54m_fck",
  458. };
  459. static const struct clk_ops clkout2_src_ck_ops = {
  460. .init = &omap2_init_clk_clkdm,
  461. .enable = &omap2_dflt_clk_enable,
  462. .disable = &omap2_dflt_clk_disable,
  463. .is_enabled = &omap2_dflt_clk_is_enabled,
  464. .recalc_rate = &omap2_clksel_recalc,
  465. .get_parent = &omap2_clksel_find_parent_index,
  466. .set_parent = &omap2_clksel_set_parent,
  467. };
  468. DEFINE_CLK_OMAP_MUX_GATE(clkout2_src_ck, "core_clkdm",
  469. clkout2_src_clksel, OMAP3430_CM_CLKOUT_CTRL,
  470. OMAP3430_CLKOUT2SOURCE_MASK,
  471. OMAP3430_CM_CLKOUT_CTRL, OMAP3430_CLKOUT2_EN_SHIFT,
  472. NULL, clkout2_src_ck_parent_names, clkout2_src_ck_ops);
  473. static const struct clksel_rate omap_48m_cm96m_rates[] = {
  474. { .div = 2, .val = 0, .flags = RATE_IN_3XXX },
  475. { .div = 0 }
  476. };
  477. static const struct clksel_rate omap_48m_alt_rates[] = {
  478. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  479. { .div = 0 }
  480. };
  481. static const struct clksel omap_48m_clksel[] = {
  482. { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
  483. { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
  484. { .parent = NULL },
  485. };
  486. static const char *omap_48m_fck_parent_names[] = {
  487. "cm_96m_fck", "sys_altclk",
  488. };
  489. static struct clk omap_48m_fck;
  490. static const struct clk_ops omap_48m_fck_ops = {
  491. .recalc_rate = &omap2_clksel_recalc,
  492. .get_parent = &omap2_clksel_find_parent_index,
  493. .set_parent = &omap2_clksel_set_parent,
  494. };
  495. static struct clk_hw_omap omap_48m_fck_hw = {
  496. .hw = {
  497. .clk = &omap_48m_fck,
  498. },
  499. .clksel = omap_48m_clksel,
  500. .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  501. .clksel_mask = OMAP3430_SOURCE_48M_MASK,
  502. };
  503. DEFINE_STRUCT_CLK(omap_48m_fck, omap_48m_fck_parent_names, omap_48m_fck_ops);
  504. DEFINE_CLK_FIXED_FACTOR(omap_12m_fck, "omap_48m_fck", &omap_48m_fck, 0x0, 1, 4);
  505. static struct clk core_12m_fck;
  506. static const char *core_12m_fck_parent_names[] = {
  507. "omap_12m_fck",
  508. };
  509. DEFINE_STRUCT_CLK_HW_OMAP(core_12m_fck, "core_l4_clkdm");
  510. DEFINE_STRUCT_CLK(core_12m_fck, core_12m_fck_parent_names, core_l4_ick_ops);
  511. static struct clk core_48m_fck;
  512. static const char *core_48m_fck_parent_names[] = {
  513. "omap_48m_fck",
  514. };
  515. DEFINE_STRUCT_CLK_HW_OMAP(core_48m_fck, "core_l4_clkdm");
  516. DEFINE_STRUCT_CLK(core_48m_fck, core_48m_fck_parent_names, core_l4_ick_ops);
  517. static const char *omap_96m_fck_parent_names[] = {
  518. "cm_96m_fck", "sys_ck",
  519. };
  520. DEFINE_CLK_MUX(omap_96m_fck, omap_96m_fck_parent_names, NULL, 0x0,
  521. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  522. OMAP3430_SOURCE_96M_SHIFT, OMAP3430_SOURCE_96M_WIDTH, 0x0, NULL);
  523. static struct clk core_96m_fck;
  524. static const char *core_96m_fck_parent_names[] = {
  525. "omap_96m_fck",
  526. };
  527. DEFINE_STRUCT_CLK_HW_OMAP(core_96m_fck, "core_l4_clkdm");
  528. DEFINE_STRUCT_CLK(core_96m_fck, core_96m_fck_parent_names, core_l4_ick_ops);
  529. static struct clk core_l3_ick;
  530. static const char *core_l3_ick_parent_names[] = {
  531. "l3_ick",
  532. };
  533. DEFINE_STRUCT_CLK_HW_OMAP(core_l3_ick, "core_l3_clkdm");
  534. DEFINE_STRUCT_CLK(core_l3_ick, core_l3_ick_parent_names, core_l4_ick_ops);
  535. DEFINE_CLK_FIXED_FACTOR(dpll3_m2x2_ck, "dpll3_m2_ck", &dpll3_m2_ck, 0x0, 2, 1);
  536. static struct clk corex2_fck;
  537. static const char *corex2_fck_parent_names[] = {
  538. "dpll3_m2x2_ck",
  539. };
  540. DEFINE_STRUCT_CLK_HW_OMAP(corex2_fck, NULL);
  541. DEFINE_STRUCT_CLK(corex2_fck, corex2_fck_parent_names, core_ck_ops);
  542. static struct clk cpefuse_fck;
  543. static struct clk_hw_omap cpefuse_fck_hw = {
  544. .hw = {
  545. .clk = &cpefuse_fck,
  546. },
  547. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
  548. .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT,
  549. .clkdm_name = "core_l4_clkdm",
  550. };
  551. DEFINE_STRUCT_CLK(cpefuse_fck, dpll3_ck_parent_names, aes2_ick_ops);
  552. static struct clk csi2_96m_fck;
  553. static const char *csi2_96m_fck_parent_names[] = {
  554. "core_96m_fck",
  555. };
  556. static struct clk_hw_omap csi2_96m_fck_hw = {
  557. .hw = {
  558. .clk = &csi2_96m_fck,
  559. },
  560. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  561. .enable_bit = OMAP3430_EN_CSI2_SHIFT,
  562. .clkdm_name = "cam_clkdm",
  563. };
  564. DEFINE_STRUCT_CLK(csi2_96m_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  565. static struct clk d2d_26m_fck;
  566. static struct clk_hw_omap d2d_26m_fck_hw = {
  567. .hw = {
  568. .clk = &d2d_26m_fck,
  569. },
  570. .ops = &clkhwops_wait,
  571. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  572. .enable_bit = OMAP3430ES1_EN_D2D_SHIFT,
  573. .clkdm_name = "d2d_clkdm",
  574. };
  575. DEFINE_STRUCT_CLK(d2d_26m_fck, dpll3_ck_parent_names, aes2_ick_ops);
  576. static struct clk des1_ick;
  577. static struct clk_hw_omap des1_ick_hw = {
  578. .hw = {
  579. .clk = &des1_ick,
  580. },
  581. .ops = &clkhwops_iclk_wait,
  582. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  583. .enable_bit = OMAP3430_EN_DES1_SHIFT,
  584. };
  585. DEFINE_STRUCT_CLK(des1_ick, aes1_ick_parent_names, aes1_ick_ops);
  586. static struct clk des2_ick;
  587. static struct clk_hw_omap des2_ick_hw = {
  588. .hw = {
  589. .clk = &des2_ick,
  590. },
  591. .ops = &clkhwops_iclk_wait,
  592. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  593. .enable_bit = OMAP3430_EN_DES2_SHIFT,
  594. .clkdm_name = "core_l4_clkdm",
  595. };
  596. DEFINE_STRUCT_CLK(des2_ick, aes2_ick_parent_names, aes2_ick_ops);
  597. DEFINE_CLK_DIVIDER(dpll1_fck, "core_ck", &core_ck, 0x0,
  598. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  599. OMAP3430_MPU_CLK_SRC_SHIFT, OMAP3430_MPU_CLK_SRC_WIDTH,
  600. CLK_DIVIDER_ONE_BASED, NULL);
  601. static struct clk dpll2_fck;
  602. static struct dpll_data dpll2_dd = {
  603. .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  604. .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
  605. .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
  606. .clk_bypass = &dpll2_fck,
  607. .clk_ref = &sys_ck,
  608. .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
  609. .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
  610. .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
  611. .modes = ((1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
  612. (1 << DPLL_LOW_POWER_BYPASS)),
  613. .auto_recal_bit = OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
  614. .recal_en_bit = OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
  615. .recal_st_bit = OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
  616. .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  617. .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK,
  618. .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
  619. .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK,
  620. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  621. .min_divider = 1,
  622. .max_divider = OMAP3_MAX_DPLL_DIV,
  623. };
  624. static struct clk dpll2_ck;
  625. static struct clk_hw_omap dpll2_ck_hw = {
  626. .hw = {
  627. .clk = &dpll2_ck,
  628. },
  629. .ops = &clkhwops_omap3_dpll,
  630. .dpll_data = &dpll2_dd,
  631. .clkdm_name = "dpll2_clkdm",
  632. };
  633. DEFINE_STRUCT_CLK(dpll2_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  634. DEFINE_CLK_DIVIDER(dpll2_fck, "core_ck", &core_ck, 0x0,
  635. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  636. OMAP3430_IVA2_CLK_SRC_SHIFT, OMAP3430_IVA2_CLK_SRC_WIDTH,
  637. CLK_DIVIDER_ONE_BASED, NULL);
  638. DEFINE_CLK_DIVIDER(dpll2_m2_ck, "dpll2_ck", &dpll2_ck, 0x0,
  639. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL2_PLL),
  640. OMAP3430_IVA2_DPLL_CLKOUT_DIV_SHIFT,
  641. OMAP3430_IVA2_DPLL_CLKOUT_DIV_WIDTH,
  642. CLK_DIVIDER_ONE_BASED, NULL);
  643. DEFINE_CLK_DIVIDER(dpll3_m3_ck, "dpll3_ck", &dpll3_ck, 0x0,
  644. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  645. OMAP3430_DIV_DPLL3_SHIFT, OMAP3430_DIV_DPLL3_WIDTH,
  646. CLK_DIVIDER_ONE_BASED, NULL);
  647. static struct clk dpll3_m3x2_ck;
  648. static const char *dpll3_m3x2_ck_parent_names[] = {
  649. "dpll3_m3_ck",
  650. };
  651. static struct clk_hw_omap dpll3_m3x2_ck_hw = {
  652. .hw = {
  653. .clk = &dpll3_m3x2_ck,
  654. },
  655. .ops = &clkhwops_wait,
  656. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  657. .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT,
  658. .flags = INVERT_ENABLE,
  659. .clkdm_name = "dpll3_clkdm",
  660. };
  661. DEFINE_STRUCT_CLK(dpll3_m3x2_ck, dpll3_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  662. static struct clk dpll3_m3x2_ck_3630 = {
  663. .name = "dpll3_m3x2_ck",
  664. .hw = &dpll3_m3x2_ck_hw.hw,
  665. .parent_names = dpll3_m3x2_ck_parent_names,
  666. .num_parents = ARRAY_SIZE(dpll3_m3x2_ck_parent_names),
  667. .ops = &dpll4_m5x2_ck_3630_ops,
  668. };
  669. DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1);
  670. DEFINE_CLK_DIVIDER(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0,
  671. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  672. OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH,
  673. CLK_DIVIDER_ONE_BASED, NULL);
  674. static struct clk dpll4_m4x2_ck;
  675. static const char *dpll4_m4x2_ck_parent_names[] = {
  676. "dpll4_m4_ck",
  677. };
  678. static struct clk_hw_omap dpll4_m4x2_ck_hw = {
  679. .hw = {
  680. .clk = &dpll4_m4x2_ck,
  681. },
  682. .ops = &clkhwops_wait,
  683. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  684. .enable_bit = OMAP3430_PWRDN_DSS1_SHIFT,
  685. .flags = INVERT_ENABLE,
  686. .clkdm_name = "dpll4_clkdm",
  687. };
  688. DEFINE_STRUCT_CLK(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names, dpll4_m5x2_ck_ops);
  689. static struct clk dpll4_m4x2_ck_3630 = {
  690. .name = "dpll4_m4x2_ck",
  691. .hw = &dpll4_m4x2_ck_hw.hw,
  692. .parent_names = dpll4_m4x2_ck_parent_names,
  693. .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names),
  694. .ops = &dpll4_m5x2_ck_3630_ops,
  695. };
  696. DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0,
  697. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  698. OMAP3430_DIV_DPLL4_SHIFT, OMAP3630_DIV_DPLL4_WIDTH,
  699. CLK_DIVIDER_ONE_BASED, NULL);
  700. static struct clk dpll4_m6x2_ck;
  701. static const char *dpll4_m6x2_ck_parent_names[] = {
  702. "dpll4_m6_ck",
  703. };
  704. static struct clk_hw_omap dpll4_m6x2_ck_hw = {
  705. .hw = {
  706. .clk = &dpll4_m6x2_ck,
  707. },
  708. .ops = &clkhwops_wait,
  709. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  710. .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
  711. .flags = INVERT_ENABLE,
  712. .clkdm_name = "dpll4_clkdm",
  713. };
  714. DEFINE_STRUCT_CLK(dpll4_m6x2_ck, dpll4_m6x2_ck_parent_names, dpll4_m5x2_ck_ops);
  715. static struct clk dpll4_m6x2_ck_3630 = {
  716. .name = "dpll4_m6x2_ck",
  717. .hw = &dpll4_m6x2_ck_hw.hw,
  718. .parent_names = dpll4_m6x2_ck_parent_names,
  719. .num_parents = ARRAY_SIZE(dpll4_m6x2_ck_parent_names),
  720. .ops = &dpll4_m5x2_ck_3630_ops,
  721. };
  722. DEFINE_CLK_FIXED_FACTOR(dpll4_x2_ck, "dpll4_ck", &dpll4_ck, 0x0, 2, 1);
  723. static struct dpll_data dpll5_dd = {
  724. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
  725. .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
  726. .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
  727. .clk_bypass = &sys_ck,
  728. .clk_ref = &sys_ck,
  729. .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
  730. .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
  731. .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
  732. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  733. .auto_recal_bit = OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
  734. .recal_en_bit = OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
  735. .recal_st_bit = OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
  736. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
  737. .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
  738. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
  739. .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
  740. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  741. .min_divider = 1,
  742. .max_divider = OMAP3_MAX_DPLL_DIV,
  743. };
  744. static struct clk dpll5_ck;
  745. static struct clk_hw_omap dpll5_ck_hw = {
  746. .hw = {
  747. .clk = &dpll5_ck,
  748. },
  749. .ops = &clkhwops_omap3_dpll,
  750. .dpll_data = &dpll5_dd,
  751. .clkdm_name = "dpll5_clkdm",
  752. };
  753. DEFINE_STRUCT_CLK(dpll5_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  754. DEFINE_CLK_DIVIDER(dpll5_m2_ck, "dpll5_ck", &dpll5_ck, 0x0,
  755. OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
  756. OMAP3430ES2_DIV_120M_SHIFT, OMAP3430ES2_DIV_120M_WIDTH,
  757. CLK_DIVIDER_ONE_BASED, NULL);
  758. static struct clk dss1_alwon_fck_3430es1;
  759. static const char *dss1_alwon_fck_3430es1_parent_names[] = {
  760. "dpll4_m4x2_ck",
  761. };
  762. static struct clk_hw_omap dss1_alwon_fck_3430es1_hw = {
  763. .hw = {
  764. .clk = &dss1_alwon_fck_3430es1,
  765. },
  766. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  767. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  768. .clkdm_name = "dss_clkdm",
  769. };
  770. DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es1, dss1_alwon_fck_3430es1_parent_names,