cclock2430_data.c 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053
  1. /*
  2. * OMAP2430 clock data
  3. *
  4. * Copyright (C) 2005-2009, 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. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/clk.h>
  17. #include <linux/clk-private.h>
  18. #include <linux/list.h>
  19. #include "soc.h"
  20. #include "iomap.h"
  21. #include "clock.h"
  22. #include "clock2xxx.h"
  23. #include "opp2xxx.h"
  24. #include "cm2xxx.h"
  25. #include "prm2xxx.h"
  26. #include "prm-regbits-24xx.h"
  27. #include "cm-regbits-24xx.h"
  28. #include "sdrc.h"
  29. #include "control.h"
  30. #define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
  31. /*
  32. * 2430 clock tree.
  33. *
  34. * NOTE:In many cases here we are assigning a 'default' parent. In
  35. * many cases the parent is selectable. The set parent calls will
  36. * also switch sources.
  37. *
  38. * Several sources are given initial rates which may be wrong, this will
  39. * be fixed up in the init func.
  40. *
  41. * Things are broadly separated below by clock domains. It is
  42. * noteworthy that most peripherals have dependencies on multiple clock
  43. * domains. Many get their interface clocks from the L4 domain, but get
  44. * functional clocks from fixed sources or other core domain derived
  45. * clocks.
  46. */
  47. DEFINE_CLK_FIXED_RATE(alt_ck, CLK_IS_ROOT, 54000000, 0x0);
  48. DEFINE_CLK_FIXED_RATE(func_32k_ck, CLK_IS_ROOT, 32768, 0x0);
  49. DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0);
  50. static struct clk osc_ck;
  51. static const struct clk_ops osc_ck_ops = {
  52. .enable = &omap2_enable_osc_ck,
  53. .disable = omap2_disable_osc_ck,
  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 const char *func_96m_ck_parent_names[] = {
  184. "apll96_ck", "alt_ck",
  185. };
  186. DEFINE_CLK_MUX(func_96m_ck, func_96m_ck_parent_names, NULL, 0x0,
  187. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), OMAP2430_96M_SOURCE_SHIFT,
  188. OMAP2430_96M_SOURCE_WIDTH, 0x0, NULL);
  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 = 0 }
  230. };
  231. static const struct clksel dsp_fck_clksel[] = {
  232. { .parent = &core_ck, .rates = dsp_fck_core_rates },
  233. { .parent = NULL },
  234. };
  235. static const char *dsp_fck_parent_names[] = {
  236. "core_ck",
  237. };
  238. static struct clk dsp_fck;
  239. static const struct clk_ops dsp_fck_ops = {
  240. .init = &omap2_init_clk_clkdm,
  241. .enable = &omap2_dflt_clk_enable,
  242. .disable = &omap2_dflt_clk_disable,
  243. .is_enabled = &omap2_dflt_clk_is_enabled,
  244. .recalc_rate = &omap2_clksel_recalc,
  245. .set_rate = &omap2_clksel_set_rate,
  246. .round_rate = &omap2_clksel_round_rate,
  247. };
  248. DEFINE_CLK_OMAP_MUX_GATE(dsp_fck, "dsp_clkdm", dsp_fck_clksel,
  249. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
  250. OMAP24XX_CLKSEL_DSP_MASK,
  251. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
  252. OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, &clkhwops_wait,
  253. dsp_fck_parent_names, dsp_fck_ops);
  254. static const struct clksel_rate dss1_fck_sys_rates[] = {
  255. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  256. { .div = 0 }
  257. };
  258. static const struct clksel_rate dss1_fck_core_rates[] = {
  259. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  260. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  261. { .div = 3, .val = 3, .flags = RATE_IN_24XX },
  262. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  263. { .div = 5, .val = 5, .flags = RATE_IN_24XX },
  264. { .div = 6, .val = 6, .flags = RATE_IN_24XX },
  265. { .div = 8, .val = 8, .flags = RATE_IN_24XX },
  266. { .div = 9, .val = 9, .flags = RATE_IN_24XX },
  267. { .div = 12, .val = 12, .flags = RATE_IN_24XX },
  268. { .div = 16, .val = 16, .flags = RATE_IN_24XX },
  269. { .div = 0 }
  270. };
  271. static const struct clksel dss1_fck_clksel[] = {
  272. { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
  273. { .parent = &core_ck, .rates = dss1_fck_core_rates },
  274. { .parent = NULL },
  275. };
  276. static const char *dss1_fck_parent_names[] = {
  277. "sys_ck", "core_ck",
  278. };
  279. static const struct clk_ops dss1_fck_ops = {
  280. .init = &omap2_init_clk_clkdm,
  281. .enable = &omap2_dflt_clk_enable,
  282. .disable = &omap2_dflt_clk_disable,
  283. .is_enabled = &omap2_dflt_clk_is_enabled,
  284. .recalc_rate = &omap2_clksel_recalc,
  285. .get_parent = &omap2_clksel_find_parent_index,
  286. .set_parent = &omap2_clksel_set_parent,
  287. };
  288. DEFINE_CLK_OMAP_MUX_GATE(dss1_fck, "dss_clkdm", dss1_fck_clksel,
  289. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  290. OMAP24XX_CLKSEL_DSS1_MASK,
  291. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  292. OMAP24XX_EN_DSS1_SHIFT, NULL,
  293. dss1_fck_parent_names, dss1_fck_ops);
  294. static const struct clksel_rate dss2_fck_sys_rates[] = {
  295. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  296. { .div = 0 }
  297. };
  298. static const struct clksel_rate dss2_fck_48m_rates[] = {
  299. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  300. { .div = 0 }
  301. };
  302. static const struct clksel_rate func_48m_apll96_rates[] = {
  303. { .div = 2, .val = 0, .flags = RATE_IN_24XX },
  304. { .div = 0 }
  305. };
  306. static const struct clksel_rate func_48m_alt_rates[] = {
  307. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  308. { .div = 0 }
  309. };
  310. static const struct clksel func_48m_clksel[] = {
  311. { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
  312. { .parent = &alt_ck, .rates = func_48m_alt_rates },
  313. { .parent = NULL },
  314. };
  315. static const char *func_48m_ck_parent_names[] = {
  316. "apll96_ck", "alt_ck",
  317. };
  318. static struct clk func_48m_ck;
  319. static const struct clk_ops func_48m_ck_ops = {
  320. .init = &omap2_init_clk_clkdm,
  321. .recalc_rate = &omap2_clksel_recalc,
  322. .set_rate = &omap2_clksel_set_rate,
  323. .round_rate = &omap2_clksel_round_rate,
  324. .get_parent = &omap2_clksel_find_parent_index,
  325. .set_parent = &omap2_clksel_set_parent,
  326. };
  327. static struct clk_hw_omap func_48m_ck_hw = {
  328. .hw = {
  329. .clk = &func_48m_ck,
  330. },
  331. .clksel = func_48m_clksel,
  332. .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  333. .clksel_mask = OMAP24XX_48M_SOURCE_MASK,
  334. .clkdm_name = "wkup_clkdm",
  335. };
  336. DEFINE_STRUCT_CLK(func_48m_ck, func_48m_ck_parent_names, func_48m_ck_ops);
  337. static const struct clksel dss2_fck_clksel[] = {
  338. { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
  339. { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
  340. { .parent = NULL },
  341. };
  342. static const char *dss2_fck_parent_names[] = {
  343. "sys_ck", "func_48m_ck",
  344. };
  345. DEFINE_CLK_OMAP_MUX_GATE(dss2_fck, "dss_clkdm", dss2_fck_clksel,
  346. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  347. OMAP24XX_CLKSEL_DSS2_MASK,
  348. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  349. OMAP24XX_EN_DSS2_SHIFT, NULL,
  350. dss2_fck_parent_names, dss1_fck_ops);
  351. static const char *func_54m_ck_parent_names[] = {
  352. "apll54_ck", "alt_ck",
  353. };
  354. DEFINE_CLK_MUX(func_54m_ck, func_54m_ck_parent_names, NULL, 0x0,
  355. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  356. OMAP24XX_54M_SOURCE_SHIFT, OMAP24XX_54M_SOURCE_WIDTH, 0x0, NULL);
  357. static struct clk dss_54m_fck;
  358. static const char *dss_54m_fck_parent_names[] = {
  359. "func_54m_ck",
  360. };
  361. static struct clk_hw_omap dss_54m_fck_hw = {
  362. .hw = {
  363. .clk = &dss_54m_fck,
  364. },
  365. .ops = &clkhwops_wait,
  366. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  367. .enable_bit = OMAP24XX_EN_TV_SHIFT,
  368. .clkdm_name = "dss_clkdm",
  369. };
  370. DEFINE_STRUCT_CLK(dss_54m_fck, dss_54m_fck_parent_names, aes_ick_ops);
  371. static struct clk dss_ick;
  372. static struct clk_hw_omap dss_ick_hw = {
  373. .hw = {
  374. .clk = &dss_ick,
  375. },
  376. .ops = &clkhwops_iclk,
  377. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  378. .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
  379. .clkdm_name = "dss_clkdm",
  380. };
  381. DEFINE_STRUCT_CLK(dss_ick, aes_ick_parent_names, aes_ick_ops);
  382. static struct clk emul_ck;
  383. static struct clk_hw_omap emul_ck_hw = {
  384. .hw = {
  385. .clk = &emul_ck,
  386. },
  387. .enable_reg = OMAP2430_PRCM_CLKEMUL_CTRL,
  388. .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
  389. .clkdm_name = "wkup_clkdm",
  390. };
  391. DEFINE_STRUCT_CLK(emul_ck, dss_54m_fck_parent_names, aes_ick_ops);
  392. DEFINE_CLK_FIXED_FACTOR(func_12m_ck, "func_48m_ck", &func_48m_ck, 0x0, 1, 4);
  393. static struct clk fac_fck;
  394. static const char *fac_fck_parent_names[] = {
  395. "func_12m_ck",
  396. };
  397. static struct clk_hw_omap fac_fck_hw = {
  398. .hw = {
  399. .clk = &fac_fck,
  400. },
  401. .ops = &clkhwops_wait,
  402. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  403. .enable_bit = OMAP24XX_EN_FAC_SHIFT,
  404. .clkdm_name = "core_l4_clkdm",
  405. };
  406. DEFINE_STRUCT_CLK(fac_fck, fac_fck_parent_names, aes_ick_ops);
  407. static struct clk fac_ick;
  408. static struct clk_hw_omap fac_ick_hw = {
  409. .hw = {
  410. .clk = &fac_ick,
  411. },
  412. .ops = &clkhwops_iclk_wait,
  413. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  414. .enable_bit = OMAP24XX_EN_FAC_SHIFT,
  415. .clkdm_name = "core_l4_clkdm",
  416. };
  417. DEFINE_STRUCT_CLK(fac_ick, aes_ick_parent_names, aes_ick_ops);
  418. static const struct clksel gfx_fck_clksel[] = {
  419. { .parent = &core_l3_ck, .rates = gfx_l3_rates },
  420. { .parent = NULL },
  421. };
  422. static const char *gfx_2d_fck_parent_names[] = {
  423. "core_l3_ck",
  424. };
  425. DEFINE_CLK_OMAP_MUX_GATE(gfx_2d_fck, "gfx_clkdm", gfx_fck_clksel,
  426. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  427. OMAP_CLKSEL_GFX_MASK,
  428. OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  429. OMAP24XX_EN_2D_SHIFT, &clkhwops_wait,
  430. gfx_2d_fck_parent_names, dsp_fck_ops);
  431. DEFINE_CLK_OMAP_MUX_GATE(gfx_3d_fck, "gfx_clkdm", gfx_fck_clksel,
  432. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  433. OMAP_CLKSEL_GFX_MASK,
  434. OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  435. OMAP24XX_EN_3D_SHIFT, &clkhwops_wait,
  436. gfx_2d_fck_parent_names, dsp_fck_ops);
  437. static struct clk gfx_ick;
  438. static const char *gfx_ick_parent_names[] = {
  439. "core_l3_ck",
  440. };
  441. static struct clk_hw_omap gfx_ick_hw = {
  442. .hw = {
  443. .clk = &gfx_ick,
  444. },
  445. .ops = &clkhwops_wait,
  446. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
  447. .enable_bit = OMAP_EN_GFX_SHIFT,
  448. .clkdm_name = "gfx_clkdm",
  449. };
  450. DEFINE_STRUCT_CLK(gfx_ick, gfx_ick_parent_names, aes_ick_ops);
  451. static struct clk gpio5_fck;
  452. static const char *gpio5_fck_parent_names[] = {
  453. "func_32k_ck",
  454. };
  455. static struct clk_hw_omap gpio5_fck_hw = {
  456. .hw = {
  457. .clk = &gpio5_fck,
  458. },
  459. .ops = &clkhwops_wait,
  460. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  461. .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
  462. .clkdm_name = "core_l4_clkdm",
  463. };
  464. DEFINE_STRUCT_CLK(gpio5_fck, gpio5_fck_parent_names, aes_ick_ops);
  465. static struct clk gpio5_ick;
  466. static struct clk_hw_omap gpio5_ick_hw = {
  467. .hw = {
  468. .clk = &gpio5_ick,
  469. },
  470. .ops = &clkhwops_iclk_wait,
  471. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  472. .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
  473. .clkdm_name = "core_l4_clkdm",
  474. };
  475. DEFINE_STRUCT_CLK(gpio5_ick, aes_ick_parent_names, aes_ick_ops);
  476. static struct clk gpios_fck;
  477. static struct clk_hw_omap gpios_fck_hw = {
  478. .hw = {
  479. .clk = &gpios_fck,
  480. },
  481. .ops = &clkhwops_wait,
  482. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  483. .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
  484. .clkdm_name = "wkup_clkdm",
  485. };
  486. DEFINE_STRUCT_CLK(gpios_fck, gpio5_fck_parent_names, aes_ick_ops);
  487. static struct clk gpios_ick;
  488. static const char *gpios_ick_parent_names[] = {
  489. "sys_ck",
  490. };
  491. static struct clk_hw_omap gpios_ick_hw = {
  492. .hw = {
  493. .clk = &gpios_ick,
  494. },
  495. .ops = &clkhwops_iclk_wait,
  496. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  497. .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
  498. .clkdm_name = "wkup_clkdm",
  499. };
  500. DEFINE_STRUCT_CLK(gpios_ick, gpios_ick_parent_names, aes_ick_ops);
  501. static struct clk gpmc_fck;
  502. static struct clk_hw_omap gpmc_fck_hw = {
  503. .hw = {
  504. .clk = &gpmc_fck,
  505. },
  506. .ops = &clkhwops_iclk,
  507. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  508. .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
  509. .flags = ENABLE_ON_INIT,
  510. .clkdm_name = "core_l3_clkdm",
  511. };
  512. DEFINE_STRUCT_CLK(gpmc_fck, gfx_ick_parent_names, core_ck_ops);
  513. static const struct clksel_rate gpt_alt_rates[] = {
  514. { .div = 1, .val = 2, .flags = RATE_IN_24XX },
  515. { .div = 0 }
  516. };
  517. static const struct clksel omap24xx_gpt_clksel[] = {
  518. { .parent = &func_32k_ck, .rates = gpt_32k_rates },
  519. { .parent = &sys_ck, .rates = gpt_sys_rates },
  520. { .parent = &alt_ck, .rates = gpt_alt_rates },
  521. { .parent = NULL },
  522. };
  523. static const char *gpt10_fck_parent_names[] = {
  524. "func_32k_ck", "sys_ck", "alt_ck",
  525. };
  526. DEFINE_CLK_OMAP_MUX_GATE(gpt10_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  527. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  528. OMAP24XX_CLKSEL_GPT10_MASK,
  529. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  530. OMAP24XX_EN_GPT10_SHIFT, &clkhwops_wait,
  531. gpt10_fck_parent_names, dss1_fck_ops);
  532. static struct clk gpt10_ick;
  533. static struct clk_hw_omap gpt10_ick_hw = {
  534. .hw = {
  535. .clk = &gpt10_ick,
  536. },
  537. .ops = &clkhwops_iclk_wait,
  538. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  539. .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
  540. .clkdm_name = "core_l4_clkdm",
  541. };
  542. DEFINE_STRUCT_CLK(gpt10_ick, aes_ick_parent_names, aes_ick_ops);
  543. DEFINE_CLK_OMAP_MUX_GATE(gpt11_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  544. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  545. OMAP24XX_CLKSEL_GPT11_MASK,
  546. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  547. OMAP24XX_EN_GPT11_SHIFT, &clkhwops_wait,
  548. gpt10_fck_parent_names, dss1_fck_ops);
  549. static struct clk gpt11_ick;
  550. static struct clk_hw_omap gpt11_ick_hw = {
  551. .hw = {
  552. .clk = &gpt11_ick,
  553. },
  554. .ops = &clkhwops_iclk_wait,
  555. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  556. .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
  557. .clkdm_name = "core_l4_clkdm",
  558. };
  559. DEFINE_STRUCT_CLK(gpt11_ick, aes_ick_parent_names, aes_ick_ops);
  560. DEFINE_CLK_OMAP_MUX_GATE(gpt12_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  561. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  562. OMAP24XX_CLKSEL_GPT12_MASK,
  563. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  564. OMAP24XX_EN_GPT12_SHIFT, &clkhwops_wait,
  565. gpt10_fck_parent_names, dss1_fck_ops);
  566. static struct clk gpt12_ick;
  567. static struct clk_hw_omap gpt12_ick_hw = {
  568. .hw = {
  569. .clk = &gpt12_ick,
  570. },
  571. .ops = &clkhwops_iclk_wait,
  572. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  573. .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
  574. .clkdm_name = "core_l4_clkdm",
  575. };
  576. DEFINE_STRUCT_CLK(gpt12_ick, aes_ick_parent_names, aes_ick_ops);
  577. static const struct clk_ops gpt1_fck_ops = {
  578. .init = &omap2_init_clk_clkdm,
  579. .enable = &omap2_dflt_clk_enable,
  580. .disable = &omap2_dflt_clk_disable,
  581. .is_enabled = &omap2_dflt_clk_is_enabled,
  582. .recalc_rate = &omap2_clksel_recalc,
  583. .set_rate = &omap2_clksel_set_rate,
  584. .round_rate = &omap2_clksel_round_rate,
  585. .get_parent = &omap2_clksel_find_parent_index,
  586. .set_parent = &omap2_clksel_set_parent,
  587. };
  588. DEFINE_CLK_OMAP_MUX_GATE(gpt1_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  589. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
  590. OMAP24XX_CLKSEL_GPT1_MASK,
  591. OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  592. OMAP24XX_EN_GPT1_SHIFT, &clkhwops_wait,
  593. gpt10_fck_parent_names, gpt1_fck_ops);
  594. static struct clk gpt1_ick;
  595. static struct clk_hw_omap gpt1_ick_hw = {
  596. .hw = {
  597. .clk = &gpt1_ick,
  598. },
  599. .ops = &clkhwops_iclk_wait,
  600. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  601. .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
  602. .clkdm_name = "wkup_clkdm",
  603. };
  604. DEFINE_STRUCT_CLK(gpt1_ick, gpios_ick_parent_names, aes_ick_ops);
  605. DEFINE_CLK_OMAP_MUX_GATE(gpt2_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  606. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  607. OMAP24XX_CLKSEL_GPT2_MASK,
  608. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  609. OMAP24XX_EN_GPT2_SHIFT, &clkhwops_wait,
  610. gpt10_fck_parent_names, dss1_fck_ops);
  611. static struct clk gpt2_ick;
  612. static struct clk_hw_omap gpt2_ick_hw = {
  613. .hw = {
  614. .clk = &gpt2_ick,
  615. },
  616. .ops = &clkhwops_iclk_wait,
  617. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  618. .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
  619. .clkdm_name = "core_l4_clkdm",
  620. };
  621. DEFINE_STRUCT_CLK(gpt2_ick, aes_ick_parent_names, aes_ick_ops);
  622. DEFINE_CLK_OMAP_MUX_GATE(gpt3_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  623. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  624. OMAP24XX_CLKSEL_GPT3_MASK,
  625. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  626. OMAP24XX_EN_GPT3_SHIFT, &clkhwops_wait,
  627. gpt10_fck_parent_names, dss1_fck_ops);
  628. static struct clk gpt3_ick;
  629. static struct clk_hw_omap gpt3_ick_hw = {
  630. .hw = {
  631. .clk = &gpt3_ick,
  632. },
  633. .ops = &clkhwops_iclk_wait,
  634. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  635. .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
  636. .clkdm_name = "core_l4_clkdm",
  637. };
  638. DEFINE_STRUCT_CLK(gpt3_ick, aes_ick_parent_names, aes_ick_ops);
  639. DEFINE_CLK_OMAP_MUX_GATE(gpt4_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  640. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  641. OMAP24XX_CLKSEL_GPT4_MASK,
  642. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  643. OMAP24XX_EN_GPT4_SHIFT, &clkhwops_wait,
  644. gpt10_fck_parent_names, dss1_fck_ops);
  645. static struct clk gpt4_ick;
  646. static struct clk_hw_omap gpt4_ick_hw = {
  647. .hw = {
  648. .clk = &gpt4_ick,
  649. },
  650. .ops = &clkhwops_iclk_wait,
  651. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  652. .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
  653. .clkdm_name = "core_l4_clkdm",
  654. };
  655. DEFINE_STRUCT_CLK(gpt4_ick, aes_ick_parent_names, aes_ick_ops);
  656. DEFINE_CLK_OMAP_MUX_GATE(gpt5_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  657. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  658. OMAP24XX_CLKSEL_GPT5_MASK,
  659. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  660. OMAP24XX_EN_GPT5_SHIFT, &clkhwops_wait,
  661. gpt10_fck_parent_names, dss1_fck_ops);
  662. static struct clk gpt5_ick;
  663. static struct clk_hw_omap gpt5_ick_hw = {
  664. .hw = {
  665. .clk = &gpt5_ick,
  666. },
  667. .ops = &clkhwops_iclk_wait,
  668. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  669. .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
  670. .clkdm_name = "core_l4_clkdm",
  671. };
  672. DEFINE_STRUCT_CLK(gpt5_ick, aes_ick_parent_names, aes_ick_ops);
  673. DEFINE_CLK_OMAP_MUX_GATE(gpt6_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  674. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  675. OMAP24XX_CLKSEL_GPT6_MASK,
  676. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  677. OMAP24XX_EN_GPT6_SHIFT, &clkhwops_wait,
  678. gpt10_fck_parent_names, dss1_fck_ops);
  679. static struct clk gpt6_ick;
  680. static struct clk_hw_omap gpt6_ick_hw = {
  681. .hw = {
  682. .clk = &gpt6_ick,
  683. },
  684. .ops = &clkhwops_iclk_wait,
  685. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  686. .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
  687. .clkdm_name = "core_l4_clkdm",
  688. };
  689. DEFINE_STRUCT_CLK(gpt6_ick, aes_ick_parent_names, aes_ick_ops);
  690. DEFINE_CLK_OMAP_MUX_GATE(gpt7_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  691. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  692. OMAP24XX_CLKSEL_GPT7_MASK,
  693. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  694. OMAP24XX_EN_GPT7_SHIFT, &clkhwops_wait,
  695. gpt10_fck_parent_names, dss1_fck_ops);
  696. static struct clk gpt7_ick;
  697. static struct clk_hw_omap gpt7_ick_hw = {
  698. .hw = {
  699. .clk = &gpt7_ick,
  700. },
  701. .ops = &clkhwops_iclk_wait,
  702. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  703. .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
  704. .clkdm_name = "core_l4_clkdm",
  705. };
  706. DEFINE_STRUCT_CLK(gpt7_ick, aes_ick_parent_names, aes_ick_ops);
  707. static struct clk gpt8_fck;
  708. DEFINE_CLK_OMAP_MUX_GATE(gpt8_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  709. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  710. OMAP24XX_CLKSEL_GPT8_MASK,
  711. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  712. OMAP24XX_EN_GPT8_SHIFT, &clkhwops_wait,
  713. gpt10_fck_parent_names, dss1_fck_ops);
  714. static struct clk gpt8_ick;
  715. static struct clk_hw_omap gpt8_ick_hw = {
  716. .hw = {
  717. .clk = &gpt8_ick,
  718. },
  719. .ops = &clkhwops_iclk_wait,
  720. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  721. .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
  722. .clkdm_name = "core_l4_clkdm",
  723. };
  724. DEFINE_STRUCT_CLK(gpt8_ick, aes_ick_parent_names, aes_ick_ops);
  725. DEFINE_CLK_OMAP_MUX_GATE(gpt9_fck, "core_l4_clkdm", omap24xx_gpt_clksel,
  726. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
  727. OMAP24XX_CLKSEL_GPT9_MASK,
  728. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  729. OMAP24XX_EN_GPT9_SHIFT, &clkhwops_wait,
  730. gpt10_fck_parent_names, dss1_fck_ops);
  731. static struct clk gpt9_ick;
  732. static struct clk_hw_omap gpt9_ick_hw = {
  733. .hw = {
  734. .clk = &gpt9_ick,
  735. },
  736. .ops = &clkhwops_iclk_wait,
  737. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  738. .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
  739. .clkdm_name = "core_l4_clkdm",
  740. };
  741. DEFINE_STRUCT_CLK(gpt9_ick, aes_ick_parent_names, aes_ick_ops);
  742. static struct clk hdq_fck;
  743. static struct clk_hw_omap hdq_fck_hw = {
  744. .hw = {
  745. .clk = &hdq_fck,
  746. },
  747. .ops = &clkhwops_wait,
  748. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  749. .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
  750. .clkdm_name = "core_l4_clkdm",
  751. };
  752. DEFINE_STRUCT_CLK(hdq_fck, fac_fck_parent_names, aes_ick_ops);
  753. static struct clk hdq_ick;
  754. static struct clk_hw_omap hdq_ick_hw = {
  755. .hw = {
  756. .clk = &hdq_ick,
  757. },
  758. .ops = &clkhwops_iclk_wait,
  759. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  760. .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
  761. .clkdm_name = "core_l4_clkdm",
  762. };
  763. DEFINE_STRUCT_CLK(hdq_ick, aes_ick_parent_names, aes_ick_ops);
  764. static struct clk i2c1_ick;
  765. static struct clk_hw_omap i2c1_ick_hw = {
  766. .hw = {
  767. .clk = &i2c1_ick,
  768. },
  769. .ops = &clkhwops_iclk_wait,
  770. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  771. .enable_bit = OMAP2420_EN_I2C1_SHIFT,
  772. .clkdm_name = "core_l4_clkdm",
  773. };
  774. DEFINE_STRUCT_CLK(i2c1_ick, aes_ick_parent_names, aes_ick_ops);
  775. static struct clk i2c2_ick;
  776. static struct clk_hw_omap i2c2_ick_hw = {
  777. .hw = {
  778. .clk = &i2c2_ick,
  779. },
  780. .ops = &clkhwops_iclk_wait,
  781. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  782. .enable_bit = OMAP2420_EN_I2C2_SHIFT,
  783. .clkdm_name = "core_l4_clkdm",
  784. };
  785. DEFINE_STRUCT_CLK(i2c2_ick, aes_ick_parent_names, aes_ick_ops);
  786. static struct clk i2chs1_fck;
  787. static struct clk_hw_omap i2chs1_fck_hw = {
  788. .hw = {
  789. .clk = &i2chs1_fck,
  790. },
  791. .ops = &clkhwops_omap2430_i2chs_wait,
  792. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  793. .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
  794. .clkdm_name = "core_l4_clkdm",
  795. };
  796. DEFINE_STRUCT_CLK(i2chs1_fck, cam_fck_parent_names, aes_ick_ops);
  797. static struct clk i2chs2_fck;
  798. static struct clk_hw_omap i2chs2_fck_hw = {
  799. .hw = {
  800. .clk = &i2chs2_fck,
  801. },
  802. .ops = &clkhwops_omap2430_i2chs_wait,
  803. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  804. .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
  805. .clkdm_name = "core_l4_clkdm",
  806. };
  807. DEFINE_STRUCT_CLK(i2chs2_fck, cam_fck_parent_names, aes_ick_ops);
  808. static struct clk icr_ick;
  809. static struct clk_hw_omap icr_ick_hw = {
  810. .hw = {
  811. .clk = &icr_ick,
  812. },
  813. .ops = &clkhwops_iclk_wait,
  814. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  815. .enable_bit = OMAP2430_EN_ICR_SHIFT,
  816. .clkdm_name = "wkup_clkdm",
  817. };
  818. DEFINE_STRUCT_CLK(icr_ick, gpios_ick_parent_names, aes_ick_ops);
  819. static const struct clksel dsp_ick_clksel[] = {
  820. { .parent = &dsp_fck, .rates = dsp_ick_rates },
  821. { .parent = NULL },
  822. };
  823. static const char *iva2_1_ick_parent_names[] = {
  824. "dsp_fck",
  825. };
  826. DEFINE_CLK_OMAP_MUX_GATE(iva2_1_ick, "dsp_clkdm", dsp_ick_clksel,
  827. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
  828. OMAP24XX_CLKSEL_DSP_IF_MASK,
  829. OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
  830. OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, &clkhwops_wait,
  831. iva2_1_ick_parent_names, dsp_fck_ops);
  832. static struct clk mailboxes_ick;
  833. static struct clk_hw_omap mailboxes_ick_hw = {
  834. .hw = {
  835. .clk = &mailboxes_ick,
  836. },
  837. .ops = &clkhwops_iclk_wait,
  838. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  839. .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  840. .clkdm_name = "core_l4_clkdm",
  841. };
  842. DEFINE_STRUCT_CLK(mailboxes_ick, aes_ick_parent_names, aes_ick_ops);
  843. static const struct clksel_rate common_mcbsp_96m_rates[] = {
  844. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  845. { .div = 0 }
  846. };
  847. static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
  848. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  849. { .div = 0 }
  850. };
  851. static const struct clksel mcbsp_fck_clksel[] = {
  852. { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates },
  853. { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
  854. { .parent = NULL },
  855. };
  856. static const char *mcbsp1_fck_parent_names[] = {
  857. "func_96m_ck", "mcbsp_clks",
  858. };
  859. DEFINE_CLK_OMAP_MUX_GATE(mcbsp1_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  860. OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  861. OMAP2_MCBSP1_CLKS_MASK,
  862. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  863. OMAP24XX_EN_MCBSP1_SHIFT, &clkhwops_wait,
  864. mcbsp1_fck_parent_names, dss1_fck_ops);
  865. static struct clk mcbsp1_ick;
  866. static struct clk_hw_omap mcbsp1_ick_hw = {
  867. .hw = {
  868. .clk = &mcbsp1_ick,
  869. },
  870. .ops = &clkhwops_iclk_wait,
  871. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  872. .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
  873. .clkdm_name = "core_l4_clkdm",
  874. };
  875. DEFINE_STRUCT_CLK(mcbsp1_ick, aes_ick_parent_names, aes_ick_ops);
  876. DEFINE_CLK_OMAP_MUX_GATE(mcbsp2_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  877. OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  878. OMAP2_MCBSP2_CLKS_MASK,
  879. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  880. OMAP24XX_EN_MCBSP2_SHIFT, &clkhwops_wait,
  881. mcbsp1_fck_parent_names, dss1_fck_ops);
  882. static struct clk mcbsp2_ick;
  883. static struct clk_hw_omap mcbsp2_ick_hw = {
  884. .hw = {
  885. .clk = &mcbsp2_ick,
  886. },
  887. .ops = &clkhwops_iclk_wait,
  888. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  889. .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
  890. .clkdm_name = "core_l4_clkdm",
  891. };
  892. DEFINE_STRUCT_CLK(mcbsp2_ick, aes_ick_parent_names, aes_ick_ops);
  893. DEFINE_CLK_OMAP_MUX_GATE(mcbsp3_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  894. OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
  895. OMAP2_MCBSP3_CLKS_MASK,
  896. OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  897. OMAP2430_EN_MCBSP3_SHIFT, &clkhwops_wait,
  898. mcbsp1_fck_parent_names, dss1_fck_ops);
  899. static struct clk mcbsp3_ick;
  900. static struct clk_hw_omap mcbsp3_ick_hw = {
  901. .hw = {
  902. .clk = &mcbsp3_ick,
  903. },
  904. .ops = &clkhwops_iclk_wait,
  905. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  906. .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
  907. .clkdm_name = "core_l4_clkdm",
  908. };
  909. DEFINE_STRUCT_CLK(mcbsp3_ick, aes_ick_parent_names, aes_ick_ops);
  910. DEFINE_CLK_OMAP_MUX_GATE(mcbsp4_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  911. OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
  912. OMAP2_MCBSP4_CLKS_MASK,
  913. OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  914. OMAP2430_EN_MCBSP4_SHIFT, &clkhwops_wait,
  915. mcbsp1_fck_parent_names, dss1_fck_ops);
  916. static struct clk mcbsp4_ick;
  917. static struct clk_hw_omap mcbsp4_ick_hw = {
  918. .hw = {
  919. .clk = &mcbsp4_ick,
  920. },
  921. .ops = &clkhwops_iclk_wait,
  922. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  923. .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
  924. .clkdm_name = "core_l4_clkdm",
  925. };
  926. DEFINE_STRUCT_CLK(mcbsp4_ick, aes_ick_parent_names, aes_ick_ops);
  927. DEFINE_CLK_OMAP_MUX_GATE(mcbsp5_fck, "core_l4_clkdm", mcbsp_fck_clksel,
  928. OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
  929. OMAP2_MCBSP5_CLKS_MASK,
  930. OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  931. OMAP2430_EN_MCBSP5_SHIFT, &clkhwops_wait,
  932. mcbsp1_fck_parent_names, dss1_fck_ops);
  933. static struct clk mcbsp5_ick;
  934. static struct clk_hw_omap mcbsp5_ick_hw = {
  935. .hw = {
  936. .clk = &mcbsp5_ick,
  937. },
  938. .ops = &clkhwops_iclk_wait,
  939. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  940. .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
  941. .clkdm_name = "core_l4_clkdm",
  942. };
  943. DEFINE_STRUCT_CLK(mcbsp5_ick, aes_ick_parent_names, aes_ick_ops);
  944. static struct clk mcspi1_fck;
  945. static const char *mcspi1_fck_parent_names[] = {
  946. "func_48m_ck",
  947. };
  948. static struct clk_hw_omap mcspi1_fck_hw = {
  949. .hw = {
  950. .clk = &mcspi1_fck,
  951. },
  952. .ops = &clkhwops_wait,
  953. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  954. .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  955. .clkdm_name = "core_l4_clkdm",
  956. };
  957. DEFINE_STRUCT_CLK(mcspi1_fck, mcspi1_fck_parent_names, aes_ick_ops);
  958. static struct clk mcspi1_ick;
  959. static struct clk_hw_omap mcspi1_ick_hw = {
  960. .hw = {
  961. .clk = &mcspi1_ick,
  962. },
  963. .ops = &clkhwops_iclk_wait,
  964. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  965. .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  966. .clkdm_name = "core_l4_clkdm",
  967. };
  968. DEFINE_STRUCT_CLK(mcspi1_ick, aes_ick_parent_names, aes_ick_ops);
  969. static struct clk mcspi2_fck;
  970. static struct clk_hw_omap mcspi2_fck_hw = {
  971. .hw = {
  972. .clk = &mcspi2_fck,
  973. },
  974. .ops = &clkhwops_wait,
  975. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  976. .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  977. .clkdm_name = "core_l4_clkdm",
  978. };
  979. DEFINE_STRUCT_CLK(mcspi2_fck, mcspi1_fck_parent_names, aes_ick_ops);
  980. static struct clk mcspi2_ick;
  981. static struct clk_hw_omap mcspi2_ick_hw = {
  982. .hw = {
  983. .clk = &mcspi2_ick,
  984. },
  985. .ops = &clkhwops_iclk_wait,
  986. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  987. .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  988. .clkdm_name = "core_l4_clkdm",
  989. };
  990. DEFINE_STRUCT_CLK(mcspi2_ick, aes_ick_parent_names, aes_ick_ops);
  991. static struct clk mcspi3_fck;
  992. static struct clk_hw_omap mcspi3_fck_hw = {
  993. .hw = {
  994. .clk = &mcspi3_fck,
  995. },
  996. .ops = &clkhwops_wait,
  997. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  998. .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
  999. .clkdm_name = "core_l4_clkdm",
  1000. };
  1001. DEFINE_STRUCT_CLK(mcspi3_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1002. static struct clk mcspi3_ick;
  1003. static struct clk_hw_omap mcspi3_ick_hw = {
  1004. .hw = {
  1005. .clk = &mcspi3_ick,
  1006. },
  1007. .ops = &clkhwops_iclk_wait,
  1008. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1009. .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
  1010. .clkdm_name = "core_l4_clkdm",
  1011. };
  1012. DEFINE_STRUCT_CLK(mcspi3_ick, aes_ick_parent_names, aes_ick_ops);
  1013. static const struct clksel_rate mdm_ick_core_rates[] = {
  1014. { .div = 1, .val = 1, .flags = RATE_IN_243X },
  1015. { .div = 4, .val = 4, .flags = RATE_IN_243X },
  1016. { .div = 6, .val = 6, .flags = RATE_IN_243X },
  1017. { .div = 9, .val = 9, .flags = RATE_IN_243X },
  1018. { .div = 0 }
  1019. };
  1020. static const struct clksel mdm_ick_clksel[] = {
  1021. { .parent = &core_ck, .rates = mdm_ick_core_rates },
  1022. { .parent = NULL },
  1023. };
  1024. static const char *mdm_ick_parent_names[] = {
  1025. "core_ck",
  1026. };
  1027. DEFINE_CLK_OMAP_MUX_GATE(mdm_ick, "mdm_clkdm", mdm_ick_clksel,
  1028. OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
  1029. OMAP2430_CLKSEL_MDM_MASK,
  1030. OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
  1031. OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
  1032. &clkhwops_iclk_wait, mdm_ick_parent_names,
  1033. dsp_fck_ops);
  1034. static struct clk mdm_intc_ick;
  1035. static struct clk_hw_omap mdm_intc_ick_hw = {
  1036. .hw = {
  1037. .clk = &mdm_intc_ick,
  1038. },
  1039. .ops = &clkhwops_iclk_wait,
  1040. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1041. .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
  1042. .clkdm_name = "core_l4_clkdm",
  1043. };
  1044. DEFINE_STRUCT_CLK(mdm_intc_ick, aes_ick_parent_names, aes_ick_ops);
  1045. static struct clk mdm_osc_ck;
  1046. static struct clk_hw_omap mdm_osc_ck_hw = {
  1047. .hw = {
  1048. .clk = &mdm_osc_ck,
  1049. },
  1050. .ops = &clkhwops_iclk_wait,
  1051. .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
  1052. .enable_bit = OMAP2430_EN_OSC_SHIFT,
  1053. .clkdm_name = "mdm_clkdm",
  1054. };
  1055. DEFINE_STRUCT_CLK(mdm_osc_ck, sys_ck_parent_names, aes_ick_ops);
  1056. static struct clk mmchs1_fck;
  1057. static struct clk_hw_omap mmchs1_fck_hw = {
  1058. .hw = {
  1059. .clk = &mmchs1_fck,
  1060. },
  1061. .ops = &clkhwops_wait,
  1062. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1063. .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
  1064. .clkdm_name = "core_l4_clkdm",
  1065. };
  1066. DEFINE_STRUCT_CLK(mmchs1_fck, cam_fck_parent_names, aes_ick_ops);
  1067. static struct clk mmchs1_ick;
  1068. static struct clk_hw_omap mmchs1_ick_hw = {
  1069. .hw = {
  1070. .clk = &mmchs1_ick,
  1071. },
  1072. .ops = &clkhwops_iclk_wait,
  1073. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1074. .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
  1075. .clkdm_name = "core_l4_clkdm",
  1076. };
  1077. DEFINE_STRUCT_CLK(mmchs1_ick, aes_ick_parent_names, aes_ick_ops);
  1078. static struct clk mmchs2_fck;
  1079. static struct clk_hw_omap mmchs2_fck_hw = {
  1080. .hw = {
  1081. .clk = &mmchs2_fck,
  1082. },
  1083. .ops = &clkhwops_wait,
  1084. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1085. .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
  1086. .clkdm_name = "core_l4_clkdm",
  1087. };
  1088. DEFINE_STRUCT_CLK(mmchs2_fck, cam_fck_parent_names, aes_ick_ops);
  1089. static struct clk mmchs2_ick;
  1090. static struct clk_hw_omap mmchs2_ick_hw = {
  1091. .hw = {
  1092. .clk = &mmchs2_ick,
  1093. },
  1094. .ops = &clkhwops_iclk_wait,
  1095. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1096. .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
  1097. .clkdm_name = "core_l4_clkdm",
  1098. };
  1099. DEFINE_STRUCT_CLK(mmchs2_ick, aes_ick_parent_names, aes_ick_ops);
  1100. static struct clk mmchsdb1_fck;
  1101. static struct clk_hw_omap mmchsdb1_fck_hw = {
  1102. .hw = {
  1103. .clk = &mmchsdb1_fck,
  1104. },
  1105. .ops = &clkhwops_wait,
  1106. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1107. .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
  1108. .clkdm_name = "core_l4_clkdm",
  1109. };
  1110. DEFINE_STRUCT_CLK(mmchsdb1_fck, gpio5_fck_parent_names, aes_ick_ops);
  1111. static struct clk mmchsdb2_fck;
  1112. static struct clk_hw_omap mmchsdb2_fck_hw = {
  1113. .hw = {
  1114. .clk = &mmchsdb2_fck,
  1115. },
  1116. .ops = &clkhwops_wait,
  1117. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1118. .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
  1119. .clkdm_name = "core_l4_clkdm",
  1120. };
  1121. DEFINE_STRUCT_CLK(mmchsdb2_fck, gpio5_fck_parent_names, aes_ick_ops);
  1122. DEFINE_CLK_DIVIDER(mpu_ck, "core_ck", &core_ck, 0x0,
  1123. OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
  1124. OMAP24XX_CLKSEL_MPU_SHIFT, OMAP24XX_CLKSEL_MPU_WIDTH,
  1125. CLK_DIVIDER_ONE_BASED, NULL);
  1126. static struct clk mpu_wdt_fck;
  1127. static struct clk_hw_omap mpu_wdt_fck_hw = {
  1128. .hw = {
  1129. .clk = &mpu_wdt_fck,
  1130. },
  1131. .ops = &clkhwops_wait,
  1132. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1133. .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  1134. .clkdm_name = "wkup_clkdm",
  1135. };
  1136. DEFINE_STRUCT_CLK(mpu_wdt_fck, gpio5_fck_parent_names, aes_ick_ops);
  1137. static struct clk mpu_wdt_ick;
  1138. static struct clk_hw_omap mpu_wdt_ick_hw = {
  1139. .hw = {
  1140. .clk = &mpu_wdt_ick,
  1141. },
  1142. .ops = &clkhwops_iclk_wait,
  1143. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1144. .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  1145. .clkdm_name = "wkup_clkdm",
  1146. };
  1147. DEFINE_STRUCT_CLK(mpu_wdt_ick, gpios_ick_parent_names, aes_ick_ops);
  1148. static struct clk mspro_fck;
  1149. static struct clk_hw_omap mspro_fck_hw = {
  1150. .hw = {
  1151. .clk = &mspro_fck,
  1152. },
  1153. .ops = &clkhwops_wait,
  1154. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1155. .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
  1156. .clkdm_name = "core_l4_clkdm",
  1157. };
  1158. DEFINE_STRUCT_CLK(mspro_fck, cam_fck_parent_names, aes_ick_ops);
  1159. static struct clk mspro_ick;
  1160. static struct clk_hw_omap mspro_ick_hw = {
  1161. .hw = {
  1162. .clk = &mspro_ick,
  1163. },
  1164. .ops = &clkhwops_iclk_wait,
  1165. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1166. .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
  1167. .clkdm_name = "core_l4_clkdm",
  1168. };
  1169. DEFINE_STRUCT_CLK(mspro_ick, aes_ick_parent_names, aes_ick_ops);
  1170. static struct clk omapctrl_ick;
  1171. static struct clk_hw_omap omapctrl_ick_hw = {
  1172. .hw = {
  1173. .clk = &omapctrl_ick,
  1174. },
  1175. .ops = &clkhwops_iclk_wait,
  1176. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1177. .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
  1178. .flags = ENABLE_ON_INIT,
  1179. .clkdm_name = "wkup_clkdm",
  1180. };
  1181. DEFINE_STRUCT_CLK(omapctrl_ick, gpios_ick_parent_names, aes_ick_ops);
  1182. static struct clk pka_ick;
  1183. static struct clk_hw_omap pka_ick_hw = {
  1184. .hw = {
  1185. .clk = &pka_ick,
  1186. },
  1187. .ops = &clkhwops_iclk_wait,
  1188. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  1189. .enable_bit = OMAP24XX_EN_PKA_SHIFT,
  1190. .clkdm_name = "core_l4_clkdm",
  1191. };
  1192. DEFINE_STRUCT_CLK(pka_ick, aes_ick_parent_names, aes_ick_ops);
  1193. static struct clk rng_ick;
  1194. static struct clk_hw_omap rng_ick_hw = {
  1195. .hw = {
  1196. .clk = &rng_ick,
  1197. },
  1198. .ops = &clkhwops_iclk_wait,
  1199. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  1200. .enable_bit = OMAP24XX_EN_RNG_SHIFT,
  1201. .clkdm_name = "core_l4_clkdm",
  1202. };
  1203. DEFINE_STRUCT_CLK(rng_ick, aes_ick_parent_names, aes_ick_ops);
  1204. static struct clk sdma_fck;
  1205. DEFINE_STRUCT_CLK_HW_OMAP(sdma_fck, "core_l3_clkdm");
  1206. DEFINE_STRUCT_CLK(sdma_fck, gfx_ick_parent_names, core_ck_ops);
  1207. static struct clk sdma_ick;
  1208. static struct clk_hw_omap sdma_ick_hw = {
  1209. .hw = {
  1210. .clk = &sdma_ick,
  1211. },
  1212. .ops = &clkhwops_iclk,
  1213. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  1214. .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
  1215. .clkdm_name = "core_l3_clkdm",
  1216. };
  1217. DEFINE_STRUCT_CLK(sdma_ick, gfx_ick_parent_names, core_ck_ops);
  1218. static struct clk sdrc_ick;
  1219. static struct clk_hw_omap sdrc_ick_hw = {
  1220. .hw = {
  1221. .clk = &sdrc_ick,
  1222. },
  1223. .ops = &clkhwops_iclk,
  1224. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  1225. .enable_bit = OMAP2430_EN_SDRC_SHIFT,
  1226. .flags = ENABLE_ON_INIT,
  1227. .clkdm_name = "core_l3_clkdm",
  1228. };
  1229. DEFINE_STRUCT_CLK(sdrc_ick, gfx_ick_parent_names, core_ck_ops);
  1230. static struct clk sha_ick;
  1231. static struct clk_hw_omap sha_ick_hw = {
  1232. .hw = {
  1233. .clk = &sha_ick,
  1234. },
  1235. .ops = &clkhwops_iclk_wait,
  1236. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
  1237. .enable_bit = OMAP24XX_EN_SHA_SHIFT,
  1238. .clkdm_name = "core_l4_clkdm",
  1239. };
  1240. DEFINE_STRUCT_CLK(sha_ick, aes_ick_parent_names, aes_ick_ops);
  1241. static struct clk ssi_l4_ick;
  1242. static struct clk_hw_omap ssi_l4_ick_hw = {
  1243. .hw = {
  1244. .clk = &ssi_l4_ick,
  1245. },
  1246. .ops = &clkhwops_iclk_wait,
  1247. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1248. .enable_bit = OMAP24XX_EN_SSI_SHIFT,
  1249. .clkdm_name = "core_l4_clkdm",
  1250. };
  1251. DEFINE_STRUCT_CLK(ssi_l4_ick, aes_ick_parent_names, aes_ick_ops);
  1252. static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
  1253. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  1254. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  1255. { .div = 3, .val = 3, .flags = RATE_IN_24XX },
  1256. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  1257. { .div = 5, .val = 5, .flags = RATE_IN_243X },
  1258. { .div = 0 }
  1259. };
  1260. static const struct clksel ssi_ssr_sst_fck_clksel[] = {
  1261. { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
  1262. { .parent = NULL },
  1263. };
  1264. static const char *ssi_ssr_sst_fck_parent_names[] = {
  1265. "core_ck",
  1266. };
  1267. DEFINE_CLK_OMAP_MUX_GATE(ssi_ssr_sst_fck, "core_l3_clkdm",
  1268. ssi_ssr_sst_fck_clksel,
  1269. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  1270. OMAP24XX_CLKSEL_SSI_MASK,
  1271. OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1272. OMAP24XX_EN_SSI_SHIFT, &clkhwops_wait,
  1273. ssi_ssr_sst_fck_parent_names, dsp_fck_ops);
  1274. static struct clk sync_32k_ick;
  1275. static struct clk_hw_omap sync_32k_ick_hw = {
  1276. .hw = {
  1277. .clk = &sync_32k_ick,
  1278. },
  1279. .ops = &clkhwops_iclk_wait,
  1280. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1281. .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
  1282. .flags = ENABLE_ON_INIT,
  1283. .clkdm_name = "wkup_clkdm",
  1284. };
  1285. DEFINE_STRUCT_CLK(sync_32k_ick, gpios_ick_parent_names, aes_ick_ops);
  1286. static const struct clksel_rate common_clkout_src_core_rates[] = {
  1287. { .div = 1, .val = 0, .flags = RATE_IN_24XX },
  1288. { .div = 0 }
  1289. };
  1290. static const struct clksel_rate common_clkout_src_sys_rates[] = {
  1291. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  1292. { .div = 0 }
  1293. };
  1294. static const struct clksel_rate common_clkout_src_96m_rates[] = {
  1295. { .div = 1, .val = 2, .flags = RATE_IN_24XX },
  1296. { .div = 0 }
  1297. };
  1298. static const struct clksel_rate common_clkout_src_54m_rates[] = {
  1299. { .div = 1, .val = 3, .flags = RATE_IN_24XX },
  1300. { .div = 0 }
  1301. };
  1302. static const struct clksel common_clkout_src_clksel[] = {
  1303. { .parent = &core_ck, .rates = common_clkout_src_core_rates },
  1304. { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
  1305. { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
  1306. { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
  1307. { .parent = NULL },
  1308. };
  1309. static const char *sys_clkout_src_parent_names[] = {
  1310. "core_ck", "sys_ck", "func_96m_ck", "func_54m_ck",
  1311. };
  1312. DEFINE_CLK_OMAP_MUX_GATE(sys_clkout_src, "wkup_clkdm", common_clkout_src_clksel,
  1313. OMAP2430_PRCM_CLKOUT_CTRL, OMAP24XX_CLKOUT_SOURCE_MASK,
  1314. OMAP2430_PRCM_CLKOUT_CTRL, OMAP24XX_CLKOUT_EN_SHIFT,
  1315. NULL, sys_clkout_src_parent_names, gpt1_fck_ops);
  1316. DEFINE_CLK_DIVIDER(sys_clkout, "sys_clkout_src", &sys_clkout_src, 0x0,
  1317. OMAP2430_PRCM_CLKOUT_CTRL, OMAP24XX_CLKOUT_DIV_SHIFT,
  1318. OMAP24XX_CLKOUT_DIV_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
  1319. static struct clk uart1_fck;
  1320. static struct clk_hw_omap uart1_fck_hw = {
  1321. .hw = {
  1322. .clk = &uart1_fck,
  1323. },
  1324. .ops = &clkhwops_wait,
  1325. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1326. .enable_bit = OMAP24XX_EN_UART1_SHIFT,
  1327. .clkdm_name = "core_l4_clkdm",
  1328. };
  1329. DEFINE_STRUCT_CLK(uart1_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1330. static struct clk uart1_ick;
  1331. static struct clk_hw_omap uart1_ick_hw = {
  1332. .hw = {
  1333. .clk = &uart1_ick,
  1334. },
  1335. .ops = &clkhwops_iclk_wait,
  1336. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1337. .enable_bit = OMAP24XX_EN_UART1_SHIFT,
  1338. .clkdm_name = "core_l4_clkdm",
  1339. };
  1340. DEFINE_STRUCT_CLK(uart1_ick, aes_ick_parent_names, aes_ick_ops);
  1341. static struct clk uart2_fck;
  1342. static struct clk_hw_omap uart2_fck_hw = {
  1343. .hw = {
  1344. .clk = &uart2_fck,
  1345. },
  1346. .ops = &clkhwops_wait,
  1347. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1348. .enable_bit = OMAP24XX_EN_UART2_SHIFT,
  1349. .clkdm_name = "core_l4_clkdm",
  1350. };
  1351. DEFINE_STRUCT_CLK(uart2_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1352. static struct clk uart2_ick;
  1353. static struct clk_hw_omap uart2_ick_hw = {
  1354. .hw = {
  1355. .clk = &uart2_ick,
  1356. },
  1357. .ops = &clkhwops_iclk_wait,
  1358. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1359. .enable_bit = OMAP24XX_EN_UART2_SHIFT,
  1360. .clkdm_name = "core_l4_clkdm",
  1361. };
  1362. DEFINE_STRUCT_CLK(uart2_ick, aes_ick_parent_names, aes_ick_ops);
  1363. static struct clk uart3_fck;
  1364. static struct clk_hw_omap uart3_fck_hw = {
  1365. .hw = {
  1366. .clk = &uart3_fck,
  1367. },
  1368. .ops = &clkhwops_wait,
  1369. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1370. .enable_bit = OMAP24XX_EN_UART3_SHIFT,
  1371. .clkdm_name = "core_l4_clkdm",
  1372. };
  1373. DEFINE_STRUCT_CLK(uart3_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1374. static struct clk uart3_ick;
  1375. static struct clk_hw_omap uart3_ick_hw = {
  1376. .hw = {
  1377. .clk = &uart3_ick,
  1378. },
  1379. .ops = &clkhwops_iclk_wait,
  1380. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1381. .enable_bit = OMAP24XX_EN_UART3_SHIFT,
  1382. .clkdm_name = "core_l4_clkdm",
  1383. };
  1384. DEFINE_STRUCT_CLK(uart3_ick, aes_ick_parent_names, aes_ick_ops);
  1385. static struct clk usb_fck;
  1386. static struct clk_hw_omap usb_fck_hw = {
  1387. .hw = {
  1388. .clk = &usb_fck,
  1389. },
  1390. .ops = &clkhwops_wait,
  1391. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
  1392. .enable_bit = OMAP24XX_EN_USB_SHIFT,
  1393. .clkdm_name = "core_l3_clkdm",
  1394. };
  1395. DEFINE_STRUCT_CLK(usb_fck, mcspi1_fck_parent_names, aes_ick_ops);
  1396. static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
  1397. { .div = 1, .val = 1, .flags = RATE_IN_24XX },
  1398. { .div = 2, .val = 2, .flags = RATE_IN_24XX },
  1399. { .div = 4, .val = 4, .flags = RATE_IN_24XX },
  1400. { .div = 0 }
  1401. };
  1402. static const struct clksel usb_l4_ick_clksel[] = {
  1403. { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
  1404. { .parent = NULL },
  1405. };
  1406. static const char *usb_l4_ick_parent_names[] = {
  1407. "core_l3_ck",
  1408. };
  1409. DEFINE_CLK_OMAP_MUX_GATE(usb_l4_ick, "core_l4_clkdm", usb_l4_ick_clksel,
  1410. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
  1411. OMAP24XX_CLKSEL_USB_MASK,
  1412. OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1413. OMAP24XX_EN_USB_SHIFT, &clkhwops_iclk_wait,
  1414. usb_l4_ick_parent_names, dsp_fck_ops);
  1415. static struct clk usbhs_ick;
  1416. static struct clk_hw_omap usbhs_ick_hw = {
  1417. .hw = {
  1418. .clk = &usbhs_ick,
  1419. },
  1420. .ops = &clkhwops_iclk_wait,
  1421. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  1422. .enable_bit = OMAP2430_EN_USBHS_SHIFT,
  1423. .clkdm_name = "core_l3_clkdm",
  1424. };
  1425. DEFINE_STRUCT_CLK(usbhs_ick, gfx_ick_parent_names, aes_ick_ops);
  1426. static struct clk virt_prcm_set;
  1427. static const char *virt_prcm_set_parent_names[] = {
  1428. "mpu_ck",
  1429. };
  1430. static const struct clk_ops virt_prcm_set_ops = {
  1431. .recalc_rate = &omap2_table_mpu_recalc,
  1432. .set_rate = &omap2_select_table_rate,
  1433. .round_rate = &omap2_round_to_table_rate,
  1434. };
  1435. DEFINE_STRUCT_CLK_HW_OMAP(virt_prcm_set, NULL);
  1436. DEFINE_STRUCT_CLK(virt_prcm_set, virt_prcm_set_parent_names, virt_prcm_set_ops);
  1437. static struct clk wdt1_ick;
  1438. static struct clk_hw_omap wdt1_ick_hw = {
  1439. .hw = {
  1440. .clk = &wdt1_ick,
  1441. },
  1442. .ops = &clkhwops_iclk_wait,
  1443. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1444. .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
  1445. .clkdm_name = "wkup_clkdm",
  1446. };
  1447. DEFINE_STRUCT_CLK(wdt1_ick, gpios_ick_parent_names, aes_ick_ops);
  1448. static struct clk wdt4_fck;
  1449. static struct clk_hw_omap wdt4_fck_hw = {
  1450. .hw = {
  1451. .clk = &wdt4_fck,
  1452. },
  1453. .ops = &clkhwops_wait,
  1454. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1455. .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
  1456. .clkdm_name = "core_l4_clkdm",
  1457. };
  1458. DEFINE_STRUCT_CLK(wdt4_fck, gpio5_fck_parent_names, aes_ick_ops);
  1459. static struct clk wdt4_ick;
  1460. static struct clk_hw_omap wdt4_ick_hw = {
  1461. .hw = {
  1462. .clk = &wdt4_ick,
  1463. },
  1464. .ops = &clkhwops_iclk_wait,
  1465. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1466. .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
  1467. .clkdm_name = "core_l4_clkdm",
  1468. };
  1469. DEFINE_STRUCT_CLK(wdt4_ick, aes_ick_parent_names, aes_ick_ops);
  1470. /*
  1471. * clkdev integration
  1472. */
  1473. static struct omap_clk omap2430_clks[] = {
  1474. /* external root sources */
  1475. CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
  1476. CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
  1477. CLK(NULL, "osc_ck", &osc_ck, CK_243X),
  1478. CLK("twl", "fck", &osc_ck, CK_243X),
  1479. CLK(NULL, "sys_ck", &sys_ck, CK_243X),
  1480. CLK(NULL, "alt_ck", &alt_ck, CK_243X),
  1481. CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
  1482. /* internal analog sources */
  1483. CLK(NULL, "dpll_ck", &dpll_ck, CK_243X),
  1484. CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
  1485. CLK(NULL, "apll54_ck", &apll54_ck, CK_243X),
  1486. /* internal prcm root sources */
  1487. CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X),
  1488. CLK(NULL, "core_ck", &core_ck, CK_243X),
  1489. CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
  1490. CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
  1491. CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
  1492. CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X),
  1493. CLK(NULL, "sys_clkout", &sys_clkout, CK_243X),
  1494. CLK(NULL, "emul_ck", &emul_ck, CK_243X),
  1495. /* mpu domain clocks */
  1496. CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
  1497. /* dsp domain clocks */
  1498. CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
  1499. CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
  1500. /* GFX domain clocks */
  1501. CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
  1502. CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X),
  1503. CLK(NULL, "gfx_ick", &gfx_ick, CK_243X),
  1504. /* Modem domain clocks */
  1505. CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
  1506. CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
  1507. /* DSS domain clocks */
  1508. CLK("omapdss_dss", "ick", &dss_ick, CK_243X),
  1509. CLK(NULL, "dss_ick", &dss_ick, CK_243X),
  1510. CLK(NULL, "dss1_fck", &dss1_fck, CK_243X),
  1511. CLK(NULL, "dss2_fck", &dss2_fck, CK_243X),
  1512. CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X),
  1513. /* L3 domain clocks */
  1514. CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
  1515. CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
  1516. CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X),
  1517. /* L4 domain clocks */
  1518. CLK(NULL, "l4_ck", &l4_ck, CK_243X),
  1519. CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
  1520. /* virtual meta-group clock */
  1521. CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
  1522. /* general l4 interface ck, multi-parent functional clk */
  1523. CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X),
  1524. CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X),
  1525. CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X),
  1526. CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X),
  1527. CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X),
  1528. CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X),
  1529. CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X),
  1530. CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X),
  1531. CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X),
  1532. CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X),
  1533. CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X),
  1534. CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X),
  1535. CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X),
  1536. CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X),
  1537. CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X),
  1538. CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X),
  1539. CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X),
  1540. CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X),
  1541. CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X),
  1542. CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X),
  1543. CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X),
  1544. CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X),
  1545. CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
  1546. CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
  1547. CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
  1548. CLK(NULL, "mcbsp1_ick", &mcbsp1_ick, CK_243X),
  1549. CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_243X),
  1550. CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
  1551. CLK(NULL, "mcbsp2_ick", &mcbsp2_ick, CK_243X),
  1552. CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_243X),
  1553. CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
  1554. CLK(NULL, "mcbsp3_ick", &mcbsp3_ick, CK_243X),
  1555. CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_243X),
  1556. CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
  1557. CLK(NULL, "mcbsp4_ick", &mcbsp4_ick, CK_243X),
  1558. CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_243X),
  1559. CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
  1560. CLK(NULL, "mcbsp5_ick", &mcbsp5_ick, CK_243X),
  1561. CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_243X),
  1562. CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
  1563. CLK(NULL, "mcspi1_ick", &mcspi1_ick, CK_243X),
  1564. CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_243X),
  1565. CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
  1566. CLK(NULL, "mcspi2_ick", &mcspi2_ick, CK_243X),
  1567. CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_243X),
  1568. CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
  1569. CLK(NULL, "mcspi3_ick", &mcspi3_ick, CK_243X),
  1570. CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_243X),
  1571. CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
  1572. CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
  1573. CLK(NULL, "uart2_ick", &uart2_ick, CK_243X),
  1574. CLK(NULL, "uart2_fck", &uart2_fck, CK_243X),
  1575. CLK(NULL, "uart3_ick", &uart3_ick, CK_243X),
  1576. CLK(NULL, "uart3_fck", &uart3_fck, CK_243X),
  1577. CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
  1578. CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
  1579. CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
  1580. CLK(NULL, "mpu_wdt_ick", &mpu_wdt_ick, CK_243X),
  1581. CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_243X),
  1582. CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
  1583. CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
  1584. CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
  1585. CLK(NULL, "icr_ick", &icr_ick, CK_243X),
  1586. CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
  1587. CLK(NULL, "cam_fck", &cam_fck, CK_243X),
  1588. CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
  1589. CLK(NULL, "cam_ick", &cam_ick, CK_243X),
  1590. CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
  1591. CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
  1592. CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
  1593. CLK(NULL, "mspro_ick", &mspro_ick, CK_243X),
  1594. CLK(NULL, "mspro_fck", &mspro_fck, CK_243X),
  1595. CLK(NULL, "fac_ick", &fac_ick, CK_243X),
  1596. CLK(NULL, "fac_fck", &fac_fck, CK_243X),
  1597. CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
  1598. CLK(NULL, "hdq_ick", &hdq_ick, CK_243X),
  1599. CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
  1600. CLK(NULL, "hdq_fck", &hdq_fck, CK_243X),
  1601. CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
  1602. CLK(NULL, "i2c1_ick", &i2c1_ick, CK_243X),
  1603. CLK(NULL, "i2chs1_fck", &i2chs1_fck, CK_243X),
  1604. CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
  1605. CLK(NULL, "i2c2_ick", &i2c2_ick, CK_243X),
  1606. CLK(NULL, "i2chs2_fck", &i2chs2_fck, CK_243X),
  1607. CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
  1608. CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
  1609. CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
  1610. CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
  1611. CLK(NULL, "des_ick", &des_ick, CK_243X),
  1612. CLK("omap-sham", "ick", &sha_ick, CK_243X),
  1613. CLK("omap_rng", "ick", &rng_ick, CK_243X),
  1614. CLK(NULL, "rng_ick", &rng_ick, CK_243X),
  1615. CLK("omap-aes", "ick", &aes_ick, CK_243X),
  1616. CLK(NULL, "pka_ick", &pka_ick, CK_243X),
  1617. CLK(NULL, "usb_fck", &usb_fck, CK_243X),
  1618. CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
  1619. CLK(NULL, "usbhs_ick", &usbhs_ick, CK_243X),
  1620. CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
  1621. CLK(NULL, "mmchs1_ick", &mmchs1_ick, CK_243X),
  1622. CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_243X),
  1623. CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
  1624. CLK(NULL, "mmchs2_ick", &mmchs2_ick, CK_243X),
  1625. CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_243X),
  1626. CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
  1627. CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
  1628. CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
  1629. CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
  1630. CLK(NULL, "mmchsdb1_fck", &mmchsdb1_fck, CK_243X),
  1631. CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
  1632. CLK(NULL, "mmchsdb2_fck", &mmchsdb2_fck, CK_243X),
  1633. CLK(NULL, "timer_32k_ck", &func_32k_ck, CK_243X),
  1634. CLK(NULL, "timer_sys_ck", &sys_ck, CK_243X),
  1635. CLK(NULL, "timer_ext_ck", &alt_ck, CK_243X),
  1636. CLK(NULL, "cpufreq_ck", &virt_prcm_set, CK_243X),
  1637. };
  1638. static const char *enable_init_clks[] = {
  1639. "apll96_ck",
  1640. "apll54_ck",
  1641. "sync_32k_ick",
  1642. "omapctrl_ick",
  1643. "gpmc_fck",
  1644. "sdrc_ick",
  1645. };
  1646. /*
  1647. * init code
  1648. */
  1649. int __init omap2430_clk_init(void)
  1650. {
  1651. struct omap_clk *c;
  1652. prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
  1653. cpu_mask = RATE_IN_243X;
  1654. rate_table = omap2430_rate_table;
  1655. omap2xxx_clkt_dpllcore_init(&dpll_ck_hw.hw);
  1656. omap2xxx_clkt_vps_check_bootloader_rates();
  1657. for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
  1658. c++) {
  1659. clkdev_add(&c->lk);
  1660. if (!__clk_init(NULL, c->lk.clk))
  1661. omap2_init_clk_hw_omap_clocks(c->lk.clk);
  1662. }
  1663. omap2xxx_clkt_vps_late_init();
  1664. omap2_clk_disable_autoidle_all();
  1665. omap2_clk_enable_init_clocks(enable_init_clks,
  1666. ARRAY_SIZE(enable_init_clks));
  1667. pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n",
  1668. (clk_get_rate(&sys_ck) / 1000000),
  1669. (clk_get_rate(&sys_ck) / 100000) % 10,
  1670. (clk_get_rate(&dpll_ck) / 1000000),
  1671. (clk_get_rate(&mpu_ck) / 1000000));
  1672. return 0;
  1673. }