cclock2420_data.c 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938
  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,
  501. .clkdm_name = "wkup_clkdm",
  502. };
  503. DEFINE_STRUCT_CLK(gpios_fck, gpios_fck_parent_names, aes_ick_ops);
  504. static struct clk gpios_ick;
  505. static const char *gpios_ick_parent_names[] = {
  506. "sys_ck",
  507. };
  508. static struct clk_hw_omap gpios_ick_hw = {
  509. .hw = {
  510. .clk = &gpios_ick,
  511. },
  512. .ops = &clkhwops_iclk_wait,
  513. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  514. .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
  515. .clkdm_name = "wkup_clkdm",
  516. };
  517. DEFINE_STRUCT_CLK(gpios_ick, gpios_ick_parent_names, aes_ick_ops);
  518. static struct clk gpmc_fck;
  519. static struct clk_hw_omap gpmc_fck_hw = {
  520. .hw = {
  521. .clk = &gpmc_fck,
  522. },
  523. .ops = &clkhwops_iclk,
  524. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  525. .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
  526. .flags = ENABLE_ON_INIT,
  527. .clkdm_name = "core_l3_clkdm",
  528. };
  529. DEFINE_STRUCT_CLK(gpmc_fck, gfx_ick_parent_names, core_ck_ops);
  530. static const struct clksel_rate gpt_alt_rates[] = {
  531. { .div = 1, .val = 2, .flags = RATE_IN_24XX },
  532. { .div = 0 }
  533. };
  534. static const struct clksel omap24xx_gpt_clksel[] = {
  535. { .parent = &func_32k_ck, .rates = gpt_32k_rates },
  536. { .parent = &sys_ck, .rates = gpt_sys_rates },
  537. { .parent = &alt_ck, .rates = gpt_alt_rates },
  538. { .parent = NULL },
  539. };
  540. static const char *gpt10_fck_parent_names[] = {
  541. "func_32k_ck", "sys_ck", "alt_ck",
  542. };
  543. DEFINE_CLK_OMAP_MUX_GATE(gpt10_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  544. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  545. OMAP24XX_CLKSEL_GPT10_MASK,
  546. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  547. OMAP24XX_EN_GPT10_SHIFT, &clkhwops_wait,
  548. gpt10_fck_parent_names, dss1_fck_ops);
  549. static struct clk gpt10_ick;
  550. static struct clk_hw_omap gpt10_ick_hw = {
  551. .hw = {
  552. .clk = &gpt10_ick,
  553. },
  554. .ops = &clkhwops_iclk_wait,
  555. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  556. .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
  557. .clkdm_name = "core_l4_clkdm",
  558. };
  559. DEFINE_STRUCT_CLK(gpt10_ick, aes_ick_parent_names, aes_ick_ops);
  560. DEFINE_CLK_OMAP_MUX_GATE(gpt11_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  561. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  562. OMAP24XX_CLKSEL_GPT11_MASK,
  563. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  564. OMAP24XX_EN_GPT11_SHIFT, &clkhwops_wait,
  565. gpt10_fck_parent_names, dss1_fck_ops);
  566. static struct clk gpt11_ick;
  567. static struct clk_hw_omap gpt11_ick_hw = {
  568. .hw = {
  569. .clk = &gpt11_ick,
  570. },
  571. .ops = &clkhwops_iclk_wait,
  572. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  573. .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
  574. .clkdm_name = "core_l4_clkdm",
  575. };
  576. DEFINE_STRUCT_CLK(gpt11_ick, aes_ick_parent_names, aes_ick_ops);
  577. DEFINE_CLK_OMAP_MUX_GATE(gpt12_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  578. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  579. OMAP24XX_CLKSEL_GPT12_MASK,
  580. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  581. OMAP24XX_EN_GPT12_SHIFT, &clkhwops_wait,
  582. gpt10_fck_parent_names, dss1_fck_ops);
  583. static struct clk gpt12_ick;
  584. static struct clk_hw_omap gpt12_ick_hw = {
  585. .hw = {
  586. .clk = &gpt12_ick,
  587. },
  588. .ops = &clkhwops_iclk_wait,
  589. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  590. .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
  591. .clkdm_name = "core_l4_clkdm",
  592. };
  593. DEFINE_STRUCT_CLK(gpt12_ick, aes_ick_parent_names, aes_ick_ops);
  594. static const struct clk_ops gpt1_fck_ops = {
  595. .init = &omap2_init_clk_clkdm,
  596. .enable = &omap2_dflt_clk_enable,
  597. .disable = &omap2_dflt_clk_disable,
  598. .is_enabled = &omap2_dflt_clk_is_enabled,
  599. .recalc_rate = &omap2_clksel_recalc,
  600. .set_rate = &omap2_clksel_set_rate,
  601. .round_rate = &omap2_clksel_round_rate,
  602. .get_parent = &omap2_clksel_find_parent_index,
  603. .set_parent = &omap2_clksel_set_parent,
  604. };
  605. DEFINE_CLK_OMAP_MUX_GATE(gpt1_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  606. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
  607. OMAP24XX_CLKSEL_GPT1_MASK,
  608. OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  609. OMAP24XX_EN_GPT1_SHIFT, &clkhwops_wait,
  610. gpt10_fck_parent_names, gpt1_fck_ops);
  611. static struct clk gpt1_ick;
  612. static struct clk_hw_omap gpt1_ick_hw = {
  613. .hw = {
  614. .clk = &gpt1_ick,
  615. },
  616. .ops = &clkhwops_iclk_wait,
  617. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  618. .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
  619. .clkdm_name = "wkup_clkdm",
  620. };
  621. DEFINE_STRUCT_CLK(gpt1_ick, gpios_ick_parent_names, aes_ick_ops);
  622. DEFINE_CLK_OMAP_MUX_GATE(gpt2_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  623. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  624. OMAP24XX_CLKSEL_GPT2_MASK,
  625. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  626. OMAP24XX_EN_GPT2_SHIFT, &clkhwops_wait,
  627. gpt10_fck_parent_names, dss1_fck_ops);
  628. static struct clk gpt2_ick;
  629. static struct clk_hw_omap gpt2_ick_hw = {
  630. .hw = {
  631. .clk = &gpt2_ick,
  632. },
  633. .ops = &clkhwops_iclk_wait,
  634. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  635. .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
  636. .clkdm_name = "core_l4_clkdm",
  637. };
  638. DEFINE_STRUCT_CLK(gpt2_ick, aes_ick_parent_names, aes_ick_ops);
  639. DEFINE_CLK_OMAP_MUX_GATE(gpt3_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  640. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  641. OMAP24XX_CLKSEL_GPT3_MASK,
  642. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  643. OMAP24XX_EN_GPT3_SHIFT, &clkhwops_wait,
  644. gpt10_fck_parent_names, dss1_fck_ops);
  645. static struct clk gpt3_ick;
  646. static struct clk_hw_omap gpt3_ick_hw = {
  647. .hw = {
  648. .clk = &gpt3_ick,
  649. },
  650. .ops = &clkhwops_iclk_wait,
  651. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  652. .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
  653. .clkdm_name = "core_l4_clkdm",
  654. };
  655. DEFINE_STRUCT_CLK(gpt3_ick, aes_ick_parent_names, aes_ick_ops);
  656. DEFINE_CLK_OMAP_MUX_GATE(gpt4_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  657. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  658. OMAP24XX_CLKSEL_GPT4_MASK,
  659. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  660. OMAP24XX_EN_GPT4_SHIFT, &clkhwops_wait,
  661. gpt10_fck_parent_names, dss1_fck_ops);
  662. static struct clk gpt4_ick;
  663. static struct clk_hw_omap gpt4_ick_hw = {
  664. .hw = {
  665. .clk = &gpt4_ick,
  666. },
  667. .ops = &clkhwops_iclk_wait,
  668. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  669. .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
  670. .clkdm_name = "core_l4_clkdm",
  671. };
  672. DEFINE_STRUCT_CLK(gpt4_ick, aes_ick_parent_names, aes_ick_ops);
  673. DEFINE_CLK_OMAP_MUX_GATE(gpt5_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  674. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  675. OMAP24XX_CLKSEL_GPT5_MASK,
  676. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  677. OMAP24XX_EN_GPT5_SHIFT, &clkhwops_wait,
  678. gpt10_fck_parent_names, dss1_fck_ops);
  679. static struct clk gpt5_ick;
  680. static struct clk_hw_omap gpt5_ick_hw = {
  681. .hw = {
  682. .clk = &gpt5_ick,
  683. },
  684. .ops = &clkhwops_iclk_wait,
  685. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  686. .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
  687. .clkdm_name = "core_l4_clkdm",
  688. };
  689. DEFINE_STRUCT_CLK(gpt5_ick, aes_ick_parent_names, aes_ick_ops);
  690. DEFINE_CLK_OMAP_MUX_GATE(gpt6_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  691. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  692. OMAP24XX_CLKSEL_GPT6_MASK,
  693. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  694. OMAP24XX_EN_GPT6_SHIFT, &clkhwops_wait,
  695. gpt10_fck_parent_names, dss1_fck_ops);
  696. static struct clk gpt6_ick;
  697. static struct clk_hw_omap gpt6_ick_hw = {
  698. .hw = {
  699. .clk = &gpt6_ick,
  700. },
  701. .ops = &clkhwops_iclk_wait,
  702. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  703. .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
  704. .clkdm_name = "core_l4_clkdm",
  705. };
  706. DEFINE_STRUCT_CLK(gpt6_ick, aes_ick_parent_names, aes_ick_ops);
  707. DEFINE_CLK_OMAP_MUX_GATE(gpt7_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  708. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  709. OMAP24XX_CLKSEL_GPT7_MASK,
  710. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  711. OMAP24XX_EN_GPT7_SHIFT, &clkhwops_wait,
  712. gpt10_fck_parent_names, dss1_fck_ops);
  713. static struct clk gpt7_ick;
  714. static struct clk_hw_omap gpt7_ick_hw = {
  715. .hw = {
  716. .clk = &gpt7_ick,
  717. },
  718. .ops = &clkhwops_iclk_wait,
  719. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  720. .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
  721. .clkdm_name = "core_l4_clkdm",
  722. };
  723. DEFINE_STRUCT_CLK(gpt7_ick, aes_ick_parent_names, aes_ick_ops);
  724. DEFINE_CLK_OMAP_MUX_GATE(gpt8_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  725. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  726. OMAP24XX_CLKSEL_GPT8_MASK,
  727. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  728. OMAP24XX_EN_GPT8_SHIFT, &clkhwops_wait,
  729. gpt10_fck_parent_names, dss1_fck_ops);
  730. static struct clk gpt8_ick;
  731. static struct clk_hw_omap gpt8_ick_hw = {
  732. .hw = {
  733. .clk = &gpt8_ick,
  734. },
  735. .ops = &clkhwops_iclk_wait,
  736. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  737. .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
  738. .clkdm_name = "core_l4_clkdm",
  739. };
  740. DEFINE_STRUCT_CLK(gpt8_ick, aes_ick_parent_names, aes_ick_ops);
  741. DEFINE_CLK_OMAP_MUX_GATE(gpt9_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  742. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  743. OMAP24XX_CLKSEL_GPT9_MASK,
  744. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  745. OMAP24XX_EN_GPT9_SHIFT, &clkhwops_wait,
  746. gpt10_fck_parent_names, dss1_fck_ops);
  747. static struct clk gpt9_ick;
  748. static struct clk_hw_omap gpt9_ick_hw = {
  749. .hw = {
  750. .clk = &gpt9_ick,
  751. },
  752. .ops = &clkhwops_iclk_wait,
  753. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  754. .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
  755. .clkdm_name = "core_l4_clkdm",
  756. };
  757. DEFINE_STRUCT_CLK(gpt9_ick, aes_ick_parent_names, aes_ick_ops);
  758. static struct clk hdq_fck;
  759. static struct clk_hw_omap hdq_fck_hw = {
  760. .hw = {
  761. .clk = &hdq_fck,
  762. },
  763. .ops = &clkhwops_wait,
  764. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  765. .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
  766. .clkdm_name = "core_l4_clkdm",
  767. };
  768. DEFINE_STRUCT_CLK(hdq_fck, fac_fck_parent_names, aes_ick_ops);
  769. static struct clk hdq_ick;
  770. static struct clk_hw_omap hdq_ick_hw = {
  771. .hw = {
  772. .clk = &hdq_ick,
  773. },
  774. .ops = &clkhwops_iclk_wait,
  775. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  776. .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
  777. .clkdm_name = "core_l4_clkdm",
  778. };
  779. DEFINE_STRUCT_CLK(hdq_ick, aes_ick_parent_names, aes_ick_ops);
  780. static struct clk i2c1_fck;
  781. static struct clk_hw_omap i2c1_fck_hw = {
  782. .hw = {
  783. .clk = &i2c1_fck,
  784. },
  785. .ops = &clkhwops_wait,
  786. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  787. .enable_bit = OMAP2420_EN_I2C1_SHIFT,
  788. .clkdm_name = "core_l4_clkdm",
  789. };
  790. DEFINE_STRUCT_CLK(i2c1_fck, fac_fck_parent_names, aes_ick_ops);
  791. static struct clk i2c1_ick;
  792. static struct clk_hw_omap i2c1_ick_hw = {
  793. .hw = {
  794. .clk = &i2c1_ick,
  795. },
  796. .ops = &clkhwops_iclk_wait,
  797. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  798. .enable_bit = OMAP2420_EN_I2C1_SHIFT,
  799. .clkdm_name = "core_l4_clkdm",
  800. };
  801. DEFINE_STRUCT_CLK(i2c1_ick, aes_ick_parent_names, aes_ick_ops);
  802. static struct clk i2c2_fck;
  803. static struct clk_hw_omap i2c2_fck_hw = {
  804. .hw = {
  805. .clk = &i2c2_fck,
  806. },
  807. .ops = &clkhwops_wait,
  808. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  809. .enable_bit = OMAP2420_EN_I2C2_SHIFT,
  810. .clkdm_name = "core_l4_clkdm",
  811. };
  812. DEFINE_STRUCT_CLK(i2c2_fck, fac_fck_parent_names, aes_ick_ops);
  813. static struct clk i2c2_ick;
  814. static struct clk_hw_omap i2c2_ick_hw = {
  815. .hw = {
  816. .clk = &i2c2_ick,
  817. },
  818. .ops = &clkhwops_iclk_wait,
  819. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  820. .enable_bit = OMAP2420_EN_I2C2_SHIFT,
  821. .clkdm_name = "core_l4_clkdm",
  822. };
  823. DEFINE_STRUCT_CLK(i2c2_ick, aes_ick_parent_names, aes_ick_ops);
  824. DEFINE_CLK_OMAP_MUX_GATE(iva1_ifck, "iva1_clkdm", dsp_fck_clksel,
  825. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
  826. OMAP2420_CLKSEL_IVA_MASK,
  827. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
  828. OMAP2420_EN_IVA_COP_SHIFT, &clkhwops_wait,
  829. dsp_fck_parent_names, dsp_fck_ops);
  830. static struct clk iva1_mpu_int_ifck;
  831. static const char *iva1_mpu_int_ifck_parent_names[] = {
  832. "iva1_ifck",
  833. };
  834. static const struct clk_ops iva1_mpu_int_ifck_ops = {
  835. .init = &omap2_init_clk_clkdm,
  836. .enable = &omap2_dflt_clk_enable,
  837. .disable = &omap2_dflt_clk_disable,
  838. .is_enabled = &omap2_dflt_clk_is_enabled,
  839. .recalc_rate = &omap_fixed_divisor_recalc,
  840. };
  841. static struct clk_hw_omap iva1_mpu_int_ifck_hw = {
  842. .hw = {
  843. .clk = &iva1_mpu_int_ifck,
  844. },
  845. .ops = &clkhwops_wait,
  846. .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
  847. .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT,
  848. .clkdm_name = "iva1_clkdm",
  849. .fixed_div = 2,
  850. };
  851. DEFINE_STRUCT_CLK(iva1_mpu_int_ifck, iva1_mpu_int_ifck_parent_names,
  852. iva1_mpu_int_ifck_ops);
  853. static struct clk mailboxes_ick;
  854. static struct clk_hw_omap mailboxes_ick_hw = {
  855. .hw = {
  856. .clk = &mailboxes_ick,
  857. },
  858. .ops = &clkhwops_iclk_wait,
  859. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  860. .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  861. .clkdm_name = "core_l4_clkdm",
  862. };
  863. DEFINE_STRUCT_CLK(mailboxes_ick, aes_ick_parent_names, aes_ick_ops);
  864. static const struct clksel_rate common_mcbsp_96m_rates[] = {
  865. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  866. { .div = 0 }
  867. };
  868. static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
  869. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  870. { .div = 0 }
  871. };
  872. static const struct clksel mcbsp_fck_clksel[] = {
  873. { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates },
  874. { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
  875. { .parent = NULL },
  876. };
  877. static const char *mcbsp1_fck_parent_names[] = {
  878. "func_96m_ck", "mcbsp_clks",
  879. };
  880. DEFINE_CLK_OMAP_MUX_GATE(mcbsp1_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  881. OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  882. OMAP2_MCBSP1_CLKS_MASK,
  883. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  884. OMAP24XX_EN_MCBSP1_SHIFT, &clkhwops_wait,
  885. mcbsp1_fck_parent_names, dss1_fck_ops);
  886. static struct clk mcbsp1_ick;
  887. static struct clk_hw_omap mcbsp1_ick_hw = {
  888. .hw = {
  889. .clk = &mcbsp1_ick,
  890. },
  891. .ops = &clkhwops_iclk_wait,
  892. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  893. .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
  894. .clkdm_name = "core_l4_clkdm",
  895. };
  896. DEFINE_STRUCT_CLK(mcbsp1_ick, aes_ick_parent_names, aes_ick_ops);
  897. DEFINE_CLK_OMAP_MUX_GATE(mcbsp2_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  898. OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  899. OMAP2_MCBSP2_CLKS_MASK,
  900. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  901. OMAP24XX_EN_MCBSP2_SHIFT, &clkhwops_wait,
  902. mcbsp1_fck_parent_names, dss1_fck_ops);
  903. static struct clk mcbsp2_ick;
  904. static struct clk_hw_omap mcbsp2_ick_hw = {
  905. .hw = {
  906. .clk = &mcbsp2_ick,
  907. },
  908. .ops = &clkhwops_iclk_wait,
  909. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  910. .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
  911. .clkdm_name = "core_l4_clkdm",
  912. };
  913. DEFINE_STRUCT_CLK(mcbsp2_ick, aes_ick_parent_names, aes_ick_ops);
  914. static struct clk mcspi1_fck;
  915. static const char *mcspi1_fck_parent_names[] = {
  916. "func_48m_ck",
  917. };
  918. static struct clk_hw_omap mcspi1_fck_hw = {
  919. .hw = {
  920. .clk = &mcspi1_fck,
  921. },
  922. .ops = &clkhwops_wait,
  923. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  924. .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  925. .clkdm_name = "core_l4_clkdm",
  926. };
  927. DEFINE_STRUCT_CLK(mcspi1_fck, mcspi1_fck_parent_names, aes_ick_ops);
  928. static struct clk mcspi1_ick;
  929. static struct clk_hw_omap mcspi1_ick_hw = {
  930. .hw = {
  931. .clk = &mcspi1_ick,
  932. },
  933. .ops = &clkhwops_iclk_wait,
  934. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  935. .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  936. .clkdm_name = "core_l4_clkdm",
  937. };
  938. DEFINE_STRUCT_CLK(mcspi1_ick, aes_ick_parent_names, aes_ick_ops);
  939. static struct clk mcspi2_fck;
  940. static struct clk_hw_omap mcspi2_fck_hw = {
  941. .hw = {
  942. .clk = &mcspi2_fck,
  943. },
  944. .ops = &clkhwops_wait,
  945. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  946. .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  947. .clkdm_name = "core_l4_clkdm",
  948. };
  949. DEFINE_STRUCT_CLK(mcspi2_fck, mcspi1_fck_parent_names, aes_ick_ops);
  950. static struct clk mcspi2_ick;
  951. static struct clk_hw_omap mcspi2_ick_hw = {
  952. .hw = {
  953. .clk = &mcspi2_ick,
  954. },
  955. .ops = &clkhwops_iclk_wait,
  956. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  957. .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  958. .clkdm_name = "core_l4_clkdm",
  959. };
  960. DEFINE_STRUCT_CLK(mcspi2_ick, aes_ick_parent_names, aes_ick_ops);
  961. static struct clk mmc_fck;
  962. static struct clk_hw_omap mmc_fck_hw = {
  963. .hw = {
  964. .clk = &mmc_fck,
  965. },
  966. .ops = &clkhwops_wait,
  967. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  968. .enable_bit = OMAP2420_EN_MMC_SHIFT,
  969. .clkdm_name = "core_l4_clkdm",
  970. };
  971. DEFINE_STRUCT_CLK(mmc_fck, cam_fck_parent_names, aes_ick_ops);
  972. static struct clk mmc_ick;
  973. static struct clk_hw_omap mmc_ick_hw = {
  974. .hw = {
  975. .clk = &mmc_ick,
  976. },
  977. .ops = &clkhwops_iclk_wait,
  978. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  979. .enable_bit = OMAP2420_EN_MMC_SHIFT,
  980. .clkdm_name = "core_l4_clkdm",
  981. };
  982. DEFINE_STRUCT_CLK(mmc_ick, aes_ick_parent_names, aes_ick_ops);
  983. DEFINE_CLK_DIVIDER(mpu_ck, "core_ck", &core_ck, 0x0,
  984. OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
  985. OMAP24XX_CLKSEL_MPU_SHIFT, OMAP24XX_CLKSEL_MPU_WIDTH,
  986. CLK_DIVIDER_ONE_BASED, NULL);
  987. static struct clk mpu_wdt_fck;
  988. static struct clk_hw_omap mpu_wdt_fck_hw = {
  989. .hw = {
  990. .clk = &mpu_wdt_fck,
  991. },
  992. .ops = &clkhwops_wait,
  993. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  994. .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  995. .clkdm_name = "wkup_clkdm",
  996. };
  997. DEFINE_STRUCT_CLK(mpu_wdt_fck, gpios_fck_parent_names, aes_ick_ops);
  998. static struct clk mpu_wdt_ick;
  999. static struct clk_hw_omap mpu_wdt_ick_hw = {
  1000. .hw = {
  1001. .clk = &mpu_wdt_ick,
  1002. },
  1003. .ops = &clkhwops_iclk_wait,
  1004. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1005. .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  1006. .clkdm_name = "wkup_clkdm",
  1007. };
  1008. DEFINE_STRUCT_CLK(mpu_wdt_ick, gpios_ick_parent_names, aes_ick_ops);
  1009. static struct clk mspro_fck;
  1010. static struct clk_hw_omap mspro_fck_hw = {
  1011. .hw = {
  1012. .clk = &mspro_fck,
  1013. },
  1014. .ops = &clkhwops_wait,
  1015. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1016. .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
  1017. .clkdm_name = "core_l4_clkdm",
  1018. };
  1019. DEFINE_STRUCT_CLK(mspro_fck, cam_fck_parent_names, aes_ick_ops);
  1020. static struct clk mspro_ick;
  1021. static struct clk_hw_omap mspro_ick_hw = {
  1022. .hw = {
  1023. .clk = &mspro_ick,
  1024. },
  1025. .ops = &clkhwops_iclk_wait,
  1026. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1027. .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
  1028. .clkdm_name = "core_l4_clkdm",
  1029. };
  1030. DEFINE_STRUCT_CLK(mspro_ick, aes_ick_parent_names, aes_ick_ops);
  1031. static struct clk omapctrl_ick;
  1032. static struct clk_hw_omap omapctrl_ick_hw = {
  1033. .hw = {
  1034. .clk = &omapctrl_ick,
  1035. },
  1036. .ops = &clkhwops_iclk_wait,
  1037. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1038. .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
  1039. .flags = ENABLE_ON_INIT,
  1040. .clkdm_name = "wkup_clkdm",
  1041. };
  1042. DEFINE_STRUCT_CLK(omapctrl_ick, gpios_ick_parent_names, aes_ick_ops);
  1043. static struct clk pka_ick;
  1044. static struct clk_hw_omap pka_ick_hw = {
  1045. .hw = {
  1046. .clk = &pka_ick,
  1047. },
  1048. .ops = &clkhwops_iclk_wait,
  1049. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  1050. .enable_bit = OMAP24XX_EN_PKA_SHIFT,
  1051. .clkdm_name = "core_l4_clkdm",
  1052. };
  1053. DEFINE_STRUCT_CLK(pka_ick, aes_ick_parent_names, aes_ick_ops);
  1054. static struct clk rng_ick;
  1055. static struct clk_hw_omap rng_ick_hw = {
  1056. .hw = {
  1057. .clk = &rng_ick,
  1058. },
  1059. .ops = &clkhwops_iclk_wait,
  1060. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  1061. .enable_bit = OMAP24XX_EN_RNG_SHIFT,
  1062. .clkdm_name = "core_l4_clkdm",
  1063. };
  1064. DEFINE_STRUCT_CLK(rng_ick, aes_ick_parent_names, aes_ick_ops);
  1065. static struct clk sdma_fck;
  1066. DEFINE_STRUCT_CLK_HW_OMAP(sdma_fck, "core_l3_clkdm");
  1067. DEFINE_STRUCT_CLK(sdma_fck, gfx_ick_parent_names, core_ck_ops);
  1068. static struct clk sdma_ick;
  1069. static struct clk_hw_omap sdma_ick_hw = {
  1070. .hw = {
  1071. .clk = &sdma_ick,
  1072. },
  1073. .ops = &clkhwops_iclk,
  1074. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  1075. .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
  1076. .clkdm_name = "core_l3_clkdm",
  1077. };
  1078. DEFINE_STRUCT_CLK(sdma_ick, gfx_ick_parent_names, core_ck_ops);
  1079. static struct clk sdrc_ick;
  1080. static struct clk_hw_omap sdrc_ick_hw = {
  1081. .hw = {
  1082. .clk = &sdrc_ick,
  1083. },
  1084. .ops = &clkhwops_iclk,
  1085. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  1086. .enable_bit = OMAP24XX_AUTO_SDRC_SHIFT,
  1087. .flags = ENABLE_ON_INIT,
  1088. .clkdm_name = "core_l3_clkdm",
  1089. };
  1090. DEFINE_STRUCT_CLK(sdrc_ick, gfx_ick_parent_names, core_ck_ops);
  1091. static struct clk sha_ick;
  1092. static struct clk_hw_omap sha_ick_hw = {
  1093. .hw = {
  1094. .clk = &sha_ick,
  1095. },
  1096. .ops = &clkhwops_iclk_wait,
  1097. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  1098. .enable_bit = OMAP24XX_EN_SHA_SHIFT,
  1099. .clkdm_name = "core_l4_clkdm",
  1100. };
  1101. DEFINE_STRUCT_CLK(sha_ick, aes_ick_parent_names, aes_ick_ops);
  1102. static struct clk ssi_l4_ick;
  1103. static struct clk_hw_omap ssi_l4_ick_hw = {
  1104. .hw = {
  1105. .clk = &ssi_l4_ick,
  1106. },
  1107. .ops = &clkhwops_iclk_wait,
  1108. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1109. .enable_bit = OMAP24XX_EN_SSI_SHIFT,
  1110. .clkdm_name = "core_l4_clkdm",
  1111. };
  1112. DEFINE_STRUCT_CLK(ssi_l4_ick, aes_ick_parent_names, aes_ick_ops);
  1113. static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
  1114. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  1115. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  1116. { .div = 3, .val = 3, .flags = RATE_IN_24XX },
  1117. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  1118. { .div = 6, .val = 6, .flags = RATE_IN_242X },
  1119. { .div = 8, .val = 8, .flags = RATE_IN_242X },
  1120. { .div = 0 }
  1121. };
  1122. static const struct clksel ssi_ssr_sst_fck_clksel[] = {
  1123. { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
  1124. { .parent = NULL },
  1125. };
  1126. static const char *ssi_ssr_sst_fck_parent_names[] = {
  1127. "core_ck",
  1128. };
  1129. DEFINE_CLK_OMAP_MUX_GATE(ssi_ssr_sst_fck, "core_l3_clkdm",
  1130. ssi_ssr_sst_fck_clksel,
  1131. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  1132. OMAP24XX_CLKSEL_SSI_MASK,
  1133. OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1134. OMAP24XX_EN_SSI_SHIFT, &clkhwops_wait,
  1135. ssi_ssr_sst_fck_parent_names, dsp_fck_ops);
  1136. static struct clk sync_32k_ick;
  1137. static struct clk_hw_omap sync_32k_ick_hw = {
  1138. .hw = {
  1139. .clk = &sync_32k_ick,
  1140. },
  1141. .ops = &clkhwops_iclk_wait,
  1142. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1143. .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
  1144. .flags = ENABLE_ON_INIT,
  1145. .clkdm_name = "wkup_clkdm",
  1146. };
  1147. DEFINE_STRUCT_CLK(sync_32k_ick, gpios_ick_parent_names, aes_ick_ops);
  1148. static const struct clksel_rate common_clkout_src_core_rates[] = {
  1149. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  1150. { .div = 0 }
  1151. };
  1152. static const struct clksel_rate common_clkout_src_sys_rates[] = {
  1153. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  1154. { .div = 0 }
  1155. };
  1156. static const struct clksel_rate common_clkout_src_96m_rates[] = {
  1157. { .div = 1, .val = 2, .flags = RATE_IN_24XX },
  1158. { .div = 0 }
  1159. };
  1160. static const struct clksel_rate common_clkout_src_54m_rates[] = {
  1161. { .div = 1, .val = 3, .flags = RATE_IN_24XX },
  1162. { .div = 0 }
  1163. };
  1164. static const struct clksel common_clkout_src_clksel[] = {
  1165. { .parent = &core_ck, .rates = common_clkout_src_core_rates },
  1166. { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
  1167. { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
  1168. { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
  1169. { .parent = NULL },
  1170. };
  1171. static const char *sys_clkout_src_parent_names[] = {
  1172. "core_ck", "sys_ck", "func_96m_ck", "func_54m_ck",
  1173. };
  1174. DEFINE_CLK_OMAP_MUX_GATE(sys_clkout_src, "wkup_clkdm", common_clkout_src_clksel,
  1175. OMAP2420_PRCM_CLKOUT_CTRL, OMAP24XX_CLKOUT_SOURCE_MASK,
  1176. OMAP2420_PRCM_CLKOUT_CTRL, OMAP24XX_CLKOUT_EN_SHIFT,
  1177. NULL, sys_clkout_src_parent_names, gpt1_fck_ops);
  1178. DEFINE_CLK_DIVIDER(sys_clkout, "sys_clkout_src", &sys_clkout_src, 0x0,
  1179. OMAP2420_PRCM_CLKOUT_CTRL, OMAP24XX_CLKOUT_DIV_SHIFT,
  1180. OMAP24XX_CLKOUT_DIV_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
  1181. DEFINE_CLK_OMAP_MUX_GATE(sys_clkout2_src, "wkup_clkdm",
  1182. common_clkout_src_clksel, OMAP2420_PRCM_CLKOUT_CTRL,
  1183. OMAP2420_CLKOUT2_SOURCE_MASK,
  1184. OMAP2420_PRCM_CLKOUT_CTRL, OMAP2420_CLKOUT2_EN_SHIFT,
  1185. NULL, sys_clkout_src_parent_names, gpt1_fck_ops);
  1186. DEFINE_CLK_DIVIDER(sys_clkout2, "sys_clkout2_src", &sys_clkout2_src, 0x0,
  1187. OMAP2420_PRCM_CLKOUT_CTRL, OMAP2420_CLKOUT2_DIV_SHIFT,
  1188. OMAP2420_CLKOUT2_DIV_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
  1189. static struct clk uart1_fck;
  1190. static struct clk_hw_omap uart1_fck_hw = {
  1191. .hw = {
  1192. .clk = &uart1_fck,
  1193. },
  1194. .ops = &clkhwops_wait,
  1195. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1196. .enable_bit = OMAP24XX_EN_UART1_SHIFT,
  1197. .clkdm_name = "core_l4_clkdm",
  1198. };
  1199. DEFINE_STRUCT_CLK(uart1_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1200. static struct clk uart1_ick;
  1201. static struct clk_hw_omap uart1_ick_hw = {
  1202. .hw = {
  1203. .clk = &uart1_ick,
  1204. },
  1205. .ops = &clkhwops_iclk_wait,
  1206. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1207. .enable_bit = OMAP24XX_EN_UART1_SHIFT,
  1208. .clkdm_name = "core_l4_clkdm",
  1209. };
  1210. DEFINE_STRUCT_CLK(uart1_ick, aes_ick_parent_names, aes_ick_ops);
  1211. static struct clk uart2_fck;
  1212. static struct clk_hw_omap uart2_fck_hw = {
  1213. .hw = {
  1214. .clk = &uart2_fck,
  1215. },
  1216. .ops = &clkhwops_wait,
  1217. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1218. .enable_bit = OMAP24XX_EN_UART2_SHIFT,
  1219. .clkdm_name = "core_l4_clkdm",
  1220. };
  1221. DEFINE_STRUCT_CLK(uart2_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1222. static struct clk uart2_ick;
  1223. static struct clk_hw_omap uart2_ick_hw = {
  1224. .hw = {
  1225. .clk = &uart2_ick,
  1226. },
  1227. .ops = &clkhwops_iclk_wait,
  1228. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1229. .enable_bit = OMAP24XX_EN_UART2_SHIFT,
  1230. .clkdm_name = "core_l4_clkdm",
  1231. };
  1232. DEFINE_STRUCT_CLK(uart2_ick, aes_ick_parent_names, aes_ick_ops);
  1233. static struct clk uart3_fck;
  1234. static struct clk_hw_omap uart3_fck_hw = {
  1235. .hw = {
  1236. .clk = &uart3_fck,
  1237. },
  1238. .ops = &clkhwops_wait,
  1239. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1240. .enable_bit = OMAP24XX_EN_UART3_SHIFT,
  1241. .clkdm_name = "core_l4_clkdm",
  1242. };
  1243. DEFINE_STRUCT_CLK(uart3_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1244. static struct clk uart3_ick;
  1245. static struct clk_hw_omap uart3_ick_hw = {
  1246. .hw = {
  1247. .clk = &uart3_ick,
  1248. },
  1249. .ops = &clkhwops_iclk_wait,
  1250. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1251. .enable_bit = OMAP24XX_EN_UART3_SHIFT,
  1252. .clkdm_name = "core_l4_clkdm",
  1253. };
  1254. DEFINE_STRUCT_CLK(uart3_ick, aes_ick_parent_names, aes_ick_ops);
  1255. static struct clk usb_fck;
  1256. static struct clk_hw_omap usb_fck_hw = {
  1257. .hw = {
  1258. .clk = &usb_fck,
  1259. },
  1260. .ops = &clkhwops_wait,
  1261. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1262. .enable_bit = OMAP24XX_EN_USB_SHIFT,
  1263. .clkdm_name = "core_l3_clkdm",
  1264. };
  1265. DEFINE_STRUCT_CLK(usb_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1266. static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
  1267. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  1268. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  1269. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  1270. { .div = 0 }
  1271. };
  1272. static const struct clksel usb_l4_ick_clksel[] = {
  1273. { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
  1274. { .parent = NULL },
  1275. };
  1276. static const char *usb_l4_ick_parent_names[] = {
  1277. "core_l3_ck",
  1278. };
  1279. DEFINE_CLK_OMAP_MUX_GATE(usb_l4_ick, "core_l4_clkdm", usb_l4_ick_clksel,
  1280. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  1281. OMAP24XX_CLKSEL_USB_MASK,
  1282. OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1283. OMAP24XX_EN_USB_SHIFT, &clkhwops_iclk_wait,
  1284. usb_l4_ick_parent_names, dsp_fck_ops);
  1285. static struct clk virt_prcm_set;
  1286. static const char *virt_prcm_set_parent_names[] = {
  1287. "mpu_ck",
  1288. };
  1289. static const struct clk_ops virt_prcm_set_ops = {
  1290. .recalc_rate = &omap2_table_mpu_recalc,
  1291. .set_rate = &omap2_select_table_rate,
  1292. .round_rate = &omap2_round_to_table_rate,
  1293. };
  1294. DEFINE_STRUCT_CLK_HW_OMAP(virt_prcm_set, NULL);
  1295. DEFINE_STRUCT_CLK(virt_prcm_set, virt_prcm_set_parent_names, virt_prcm_set_ops);
  1296. static const struct clksel_rate vlynq_fck_96m_rates[] = {
  1297. { .div = 1, .val = 0, .flags = RATE_IN_242X },
  1298. { .div = 0 }
  1299. };
  1300. static const struct clksel_rate vlynq_fck_core_rates[] = {
  1301. { .div = 1, .val = 1, .flags = RATE_IN_242X },
  1302. { .div = 2, .val = 2, .flags = RATE_IN_242X },
  1303. { .div = 3, .val = 3, .flags = RATE_IN_242X },
  1304. { .div = 4, .val = 4, .flags = RATE_IN_242X },
  1305. { .div = 6, .val = 6, .flags = RATE_IN_242X },
  1306. { .div = 8, .val = 8, .flags = RATE_IN_242X },
  1307. { .div = 9, .val = 9, .flags = RATE_IN_242X },
  1308. { .div = 12, .val = 12, .flags = RATE_IN_242X },
  1309. { .div = 16, .val = 16, .flags = RATE_IN_242X },
  1310. { .div = 18, .val = 18, .flags = RATE_IN_242X },
  1311. { .div = 0 }
  1312. };
  1313. static const struct clksel vlynq_fck_clksel[] = {
  1314. { .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates },
  1315. { .parent = &core_ck, .rates = vlynq_fck_core_rates },
  1316. { .parent = NULL },
  1317. };
  1318. static const char *vlynq_fck_parent_names[] = {
  1319. "func_96m_ck", "core_ck",
  1320. };
  1321. DEFINE_CLK_OMAP_MUX_GATE(vlynq_fck, "core_l3_clkdm", vlynq_fck_clksel,
  1322. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  1323. OMAP2420_CLKSEL_VLYNQ_MASK,
  1324. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1325. OMAP2420_EN_VLYNQ_SHIFT, &clkhwops_wait,
  1326. vlynq_fck_parent_names, dss1_fck_ops);
  1327. static struct clk vlynq_ick;
  1328. static struct clk_hw_omap vlynq_ick_hw = {
  1329. .hw = {
  1330. .clk = &vlynq_ick,
  1331. },
  1332. .ops = &clkhwops_iclk_wait,
  1333. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1334. .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
  1335. .clkdm_name = "core_l3_clkdm",
  1336. };
  1337. DEFINE_STRUCT_CLK(vlynq_ick, gfx_ick_parent_names, aes_ick_ops);
  1338. static struct clk wdt1_ick;
  1339. static struct clk_hw_omap wdt1_ick_hw = {
  1340. .hw = {
  1341. .clk = &wdt1_ick,
  1342. },
  1343. .ops = &clkhwops_iclk_wait,
  1344. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1345. .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
  1346. .clkdm_name = "wkup_clkdm",
  1347. };
  1348. DEFINE_STRUCT_CLK(wdt1_ick, gpios_ick_parent_names, aes_ick_ops);
  1349. static struct clk wdt3_fck;
  1350. static struct clk_hw_omap wdt3_fck_hw = {
  1351. .hw = {
  1352. .clk = &wdt3_fck,
  1353. },
  1354. .ops = &clkhwops_wait,
  1355. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1356. .enable_bit = OMAP2420_EN_WDT3_SHIFT,
  1357. .clkdm_name = "core_l4_clkdm",
  1358. };
  1359. DEFINE_STRUCT_CLK(wdt3_fck, gpios_fck_parent_names, aes_ick_ops);
  1360. static struct clk wdt3_ick;
  1361. static struct clk_hw_omap wdt3_ick_hw = {
  1362. .hw = {
  1363. .clk = &wdt3_ick,
  1364. },
  1365. .ops = &clkhwops_iclk_wait,
  1366. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1367. .enable_bit = OMAP2420_EN_WDT3_SHIFT,
  1368. .clkdm_name = "core_l4_clkdm",
  1369. };
  1370. DEFINE_STRUCT_CLK(wdt3_ick, aes_ick_parent_names, aes_ick_ops);
  1371. static struct clk wdt4_fck;
  1372. static struct clk_hw_omap wdt4_fck_hw = {
  1373. .hw = {
  1374. .clk = &wdt4_fck,
  1375. },
  1376. .ops = &clkhwops_wait,
  1377. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1378. .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
  1379. .clkdm_name = "core_l4_clkdm",
  1380. };
  1381. DEFINE_STRUCT_CLK(wdt4_fck, gpios_fck_parent_names, aes_ick_ops);
  1382. static struct clk wdt4_ick;
  1383. static struct clk_hw_omap wdt4_ick_hw = {
  1384. .hw = {
  1385. .clk = &wdt4_ick,
  1386. },
  1387. .ops = &clkhwops_iclk_wait,
  1388. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1389. .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
  1390. .clkdm_name = "core_l4_clkdm",
  1391. };
  1392. DEFINE_STRUCT_CLK(wdt4_ick, aes_ick_parent_names, aes_ick_ops);
  1393. /*
  1394. * clkdev integration
  1395. */
  1396. static struct omap_clk omap2420_clks[] = {
  1397. /* external root sources */
  1398. CLK(NULL, "func_32k_ck", &func_32k_ck, CK_242X),
  1399. CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_242X),
  1400. CLK(NULL, "osc_ck", &osc_ck, CK_242X),
  1401. CLK(NULL, "sys_ck", &sys_ck, CK_242X),
  1402. CLK(NULL, "alt_ck", &alt_ck, CK_242X),
  1403. CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_242X),
  1404. /* internal analog sources */
  1405. CLK(NULL, "dpll_ck", &dpll_ck, CK_242X),
  1406. CLK(NULL, "apll96_ck", &apll96_ck, CK_242X),
  1407. CLK(NULL, "apll54_ck", &apll54_ck, CK_242X),
  1408. /* internal prcm root sources */
  1409. CLK(NULL, "func_54m_ck", &func_54m_ck, CK_242X),
  1410. CLK(NULL, "core_ck", &core_ck, CK_242X),
  1411. CLK(NULL, "func_96m_ck", &func_96m_ck, CK_242X),
  1412. CLK(NULL, "func_48m_ck", &func_48m_ck, CK_242X),
  1413. CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X),
  1414. CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_242X),
  1415. CLK(NULL, "sys_clkout", &sys_clkout, CK_242X),
  1416. CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X),
  1417. CLK(NULL, "sys_clkout2", &sys_clkout2, CK_242X),
  1418. CLK(NULL, "emul_ck", &emul_ck, CK_242X),
  1419. /* mpu domain clocks */
  1420. CLK(NULL, "mpu_ck", &mpu_ck, CK_242X),
  1421. /* dsp domain clocks */
  1422. CLK(NULL, "dsp_fck", &dsp_fck, CK_242X),
  1423. CLK(NULL, "dsp_ick", &dsp_ick, CK_242X),
  1424. CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X),
  1425. CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
  1426. /* GFX domain clocks */
  1427. CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_242X),
  1428. CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_242X),
  1429. CLK(NULL, "gfx_ick", &gfx_ick, CK_242X),
  1430. /* DSS domain clocks */
  1431. CLK("omapdss_dss", "ick", &dss_ick, CK_242X),
  1432. CLK(NULL, "dss_ick", &dss_ick, CK_242X),
  1433. CLK(NULL, "dss1_fck", &dss1_fck, CK_242X),
  1434. CLK(NULL, "dss2_fck", &dss2_fck, CK_242X),
  1435. CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_242X),
  1436. /* L3 domain clocks */
  1437. CLK(NULL, "core_l3_ck", &core_l3_ck, CK_242X),
  1438. CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X),
  1439. CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_242X),
  1440. /* L4 domain clocks */
  1441. CLK(NULL, "l4_ck", &l4_ck, CK_242X),
  1442. CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X),
  1443. /* virtual meta-group clock */
  1444. CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X),
  1445. /* general l4 interface ck, multi-parent functional clk */
  1446. CLK(NULL, "gpt1_ick", &gpt1_ick, CK_242X),
  1447. CLK(NULL, "gpt1_fck", &gpt1_fck, CK_242X),
  1448. CLK(NULL, "gpt2_ick", &gpt2_ick, CK_242X),
  1449. CLK(NULL, "gpt2_fck", &gpt2_fck, CK_242X),
  1450. CLK(NULL, "gpt3_ick", &gpt3_ick, CK_242X),
  1451. CLK(NULL, "gpt3_fck", &gpt3_fck, CK_242X),
  1452. CLK(NULL, "gpt4_ick", &gpt4_ick, CK_242X),
  1453. CLK(NULL, "gpt4_fck", &gpt4_fck, CK_242X),
  1454. CLK(NULL, "gpt5_ick", &gpt5_ick, CK_242X),
  1455. CLK(NULL, "gpt5_fck", &gpt5_fck, CK_242X),
  1456. CLK(NULL, "gpt6_ick", &gpt6_ick, CK_242X),
  1457. CLK(NULL, "gpt6_fck", &gpt6_fck, CK_242X),
  1458. CLK(NULL, "gpt7_ick", &gpt7_ick, CK_242X),
  1459. CLK(NULL, "gpt7_fck", &gpt7_fck, CK_242X),
  1460. CLK(NULL, "gpt8_ick", &gpt8_ick, CK_242X),
  1461. CLK(NULL, "gpt8_fck", &gpt8_fck, CK_242X),
  1462. CLK(NULL, "gpt9_ick", &gpt9_ick, CK_242X),
  1463. CLK(NULL, "gpt9_fck", &gpt9_fck, CK_242X),
  1464. CLK(NULL, "gpt10_ick", &gpt10_ick, CK_242X),
  1465. CLK(NULL, "gpt10_fck", &gpt10_fck, CK_242X),
  1466. CLK(NULL, "gpt11_ick", &gpt11_ick, CK_242X),
  1467. CLK(NULL, "gpt11_fck", &gpt11_fck, CK_242X),
  1468. CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X),
  1469. CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X),
  1470. CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X),
  1471. CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_242X),
  1472. CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_242X),
  1473. CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X),
  1474. CLK(NULL, "mcbsp2_ick", &mcbsp2_ick, CK_242X),
  1475. CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_242X),
  1476. CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X),
  1477. CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_242X),
  1478. CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_242X),
  1479. CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X),
  1480. CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_242X),
  1481. CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_242X),
  1482. CLK(NULL, "uart1_ick", &uart1_ick, CK_242X),
  1483. CLK(NULL, "uart1_fck", &uart1_fck, CK_242X),
  1484. CLK(NULL, "uart2_ick", &uart2_ick, CK_242X),
  1485. CLK(NULL, "uart2_fck", &uart2_fck, CK_242X),
  1486. CLK(NULL, "uart3_ick", &uart3_ick, CK_242X),
  1487. CLK(NULL, "uart3_fck", &uart3_fck, CK_242X),
  1488. CLK(NULL, "gpios_ick", &gpios_ick, CK_242X),
  1489. CLK(NULL, "gpios_fck", &gpios_fck, CK_242X),
  1490. CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X),
  1491. CLK(NULL, "mpu_wdt_ick", &mpu_wdt_ick, CK_242X),
  1492. CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_242X),
  1493. CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X),
  1494. CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X),
  1495. CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X),
  1496. CLK("omap24xxcam", "fck", &cam_fck, CK_242X),
  1497. CLK(NULL, "cam_fck", &cam_fck, CK_242X),
  1498. CLK("omap24xxcam", "ick", &cam_ick, CK_242X),
  1499. CLK(NULL, "cam_ick", &cam_ick, CK_242X),
  1500. CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_242X),
  1501. CLK(NULL, "wdt4_ick", &wdt4_ick, CK_242X),
  1502. CLK(NULL, "wdt4_fck", &wdt4_fck, CK_242X),
  1503. CLK(NULL, "wdt3_ick", &wdt3_ick, CK_242X),
  1504. CLK(NULL, "wdt3_fck", &wdt3_fck, CK_242X),
  1505. CLK(NULL, "mspro_ick", &mspro_ick, CK_242X),
  1506. CLK(NULL, "mspro_fck", &mspro_fck, CK_242X),
  1507. CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X),
  1508. CLK(NULL, "mmc_ick", &mmc_ick, CK_242X),
  1509. CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X),
  1510. CLK(NULL, "mmc_fck", &mmc_fck, CK_242X),
  1511. CLK(NULL, "fac_ick", &fac_ick, CK_242X),
  1512. CLK(NULL, "fac_fck", &fac_fck, CK_242X),
  1513. CLK(NULL, "eac_ick", &eac_ick, CK_242X),
  1514. CLK(NULL, "eac_fck", &eac_fck, CK_242X),
  1515. CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X),
  1516. CLK(NULL, "hdq_ick", &hdq_ick, CK_242X),
  1517. CLK("omap_hdq.0", "fck", &hdq_fck, CK_242X),
  1518. CLK(NULL, "hdq_fck", &hdq_fck, CK_242X),
  1519. CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X),
  1520. CLK(NULL, "i2c1_ick", &i2c1_ick, CK_242X),
  1521. CLK(NULL, "i2c1_fck", &i2c1_fck, CK_242X),
  1522. CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X),
  1523. CLK(NULL, "i2c2_ick", &i2c2_ick, CK_242X),
  1524. CLK(NULL, "i2c2_fck", &i2c2_fck, CK_242X),
  1525. CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
  1526. CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
  1527. CLK(NULL, "sdma_ick", &sdma_ick, CK_242X),
  1528. CLK(NULL, "sdrc_ick", &sdrc_ick, CK_242X),
  1529. CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X),
  1530. CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
  1531. CLK(NULL, "des_ick", &des_ick, CK_242X),
  1532. CLK("omap-sham", "ick", &sha_ick, CK_242X),
  1533. CLK(NULL, "sha_ick", &sha_ick, CK_242X),
  1534. CLK("omap_rng", "ick", &rng_ick, CK_242X),
  1535. CLK(NULL, "rng_ick", &rng_ick, CK_242X),
  1536. CLK("omap-aes", "ick", &aes_ick, CK_242X),
  1537. CLK(NULL, "aes_ick", &aes_ick, CK_242X),
  1538. CLK(NULL, "pka_ick", &pka_ick, CK_242X),
  1539. CLK(NULL, "usb_fck", &usb_fck, CK_242X),
  1540. CLK("musb-hdrc", "fck", &osc_ck, CK_242X),
  1541. CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_242X),
  1542. CLK(NULL, "timer_sys_ck", &sys_ck, CK_242X),
  1543. CLK(NULL, "timer_ext_ck", &alt_ck, CK_242X),
  1544. CLK(NULL, "cpufreq_ck", &virt_prcm_set, CK_242X),
  1545. };
  1546. static const char *enable_init_clks[] = {
  1547. "apll96_ck",
  1548. "apll54_ck",
  1549. "sync_32k_ick",
  1550. "omapctrl_ick",
  1551. "gpmc_fck",
  1552. "sdrc_ick",
  1553. };
  1554. /*
  1555. * init code
  1556. */
  1557. int __init omap2420_clk_init(void)
  1558. {
  1559. struct omap_clk *c;
  1560. prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL;
  1561. cpu_mask = RATE_IN_242X;
  1562. rate_table = omap2420_rate_table;
  1563. omap2xxx_clkt_dpllcore_init(&dpll_ck_hw.hw);
  1564. omap2xxx_clkt_vps_check_bootloader_rates();
  1565. for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks);
  1566. c++) {
  1567. clkdev_add(&c->lk);
  1568. if (!__clk_init(NULL, c->lk.clk))
  1569. omap2_init_clk_hw_omap_clocks(c->lk.clk);
  1570. }
  1571. omap2xxx_clkt_vps_late_init();
  1572. omap2_clk_disable_autoidle_all();
  1573. omap2_clk_enable_init_clocks(enable_init_clks,
  1574. ARRAY_SIZE(enable_init_clks));
  1575. pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n",
  1576. (clk_get_rate(&sys_ck) / 1000000),
  1577. (clk_get_rate(&sys_ck) / 100000) % 10,
  1578. (clk_get_rate(&dpll_ck) / 1000000),
  1579. (clk_get_rate(&mpu_ck) / 1000000));
  1580. return 0;
  1581. }