preliminaryDataProcessing.c 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248
  1. /*
  2. * OMAP3 clock data
  3. *
  4. * Copyright (C) 2007-2012 Texas Instruments, Inc.
  5. * Copyright (C) 2007-2011 Nokia Corporation
  6. *
  7. * Written by Paul Walmsley
  8. * Updated to COMMON clk data format by Rajendra Nayak <rnayak@ti.com>
  9. * With many device clock fixes by Kevin Hilman and Jouni Högander
  10. * DPLL bypass clock support added by Roman Tereshonkov
  11. *
  12. */
  13. /*
  14. * Virtual clocks are introduced as convenient tools.
  15. * They are sources for other clocks and not supposed
  16. * to be requested from drivers directly.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/clk.h>
  20. #include <linux/clk-private.h>
  21. #include <linux/list.h>
  22. #include <linux/io.h>
  23. #include "soc.h"
  24. #include "iomap.h"
  25. #include "clock.h"
  26. #include "clock3xxx.h"
  27. #include "clock34xx.h"
  28. #include "clock36xx.h"
  29. #include "clock3517.h"
  30. #include "cm3xxx.h"
  31. #include "cm-regbits-34xx.h"
  32. #include "prm3xxx.h"
  33. #include "prm-regbits-34xx.h"
  34. #include "control.h"
  35. /*
  36. * clocks
  37. */
  38. #define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR
  39. /* Maximum DPLL multiplier, divider values for OMAP3 */
  40. #define OMAP3_MAX_DPLL_MULT 2047
  41. #define OMAP3630_MAX_JTYPE_DPLL_MULT 4095
  42. #define OMAP3_MAX_DPLL_DIV 128
  43. DEFINE_CLK_FIXED_RATE(dummy_apb_pclk, CLK_IS_ROOT, 0x0, 0x0);
  44. DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0);
  45. DEFINE_CLK_FIXED_RATE(omap_32k_fck, CLK_IS_ROOT, 32768, 0x0);
  46. DEFINE_CLK_FIXED_RATE(pclk_ck, CLK_IS_ROOT, 27000000, 0x0);
  47. DEFINE_CLK_FIXED_RATE(rmii_ck, CLK_IS_ROOT, 50000000, 0x0);
  48. DEFINE_CLK_FIXED_RATE(secure_32k_fck, CLK_IS_ROOT, 32768, 0x0);
  49. DEFINE_CLK_FIXED_RATE(sys_altclk, CLK_IS_ROOT, 0x0, 0x0);
  50. DEFINE_CLK_FIXED_RATE(virt_12m_ck, CLK_IS_ROOT, 12000000, 0x0);
  51. DEFINE_CLK_FIXED_RATE(virt_13m_ck, CLK_IS_ROOT, 13000000, 0x0);
  52. DEFINE_CLK_FIXED_RATE(virt_16_8m_ck, CLK_IS_ROOT, 16800000, 0x0);
  53. DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
  54. DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
  55. DEFINE_CLK_FIXED_RATE(virt_38_4m_ck, CLK_IS_ROOT, 38400000, 0x0);
  56. static const char *osc_sys_ck_parent_names[] = {
  57. "virt_12m_ck", "virt_13m_ck", "virt_19200000_ck", "virt_26000000_ck",
  58. "virt_38_4m_ck", "virt_16_8m_ck",
  59. };
  60. DEFINE_CLK_MUX(osc_sys_ck, osc_sys_ck_parent_names, NULL, 0x0,
  61. OMAP3430_PRM_CLKSEL, OMAP3430_SYS_CLKIN_SEL_SHIFT,
  62. OMAP3430_SYS_CLKIN_SEL_WIDTH, 0x0, NULL);
  63. DEFINE_CLK_DIVIDER(sys_ck, "osc_sys_ck", &osc_sys_ck, 0x0,
  64. OMAP3430_PRM_CLKSRC_CTRL, OMAP_SYSCLKDIV_SHIFT,
  65. OMAP_SYSCLKDIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
  66. static struct dpll_data dpll3_dd = {
  67. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  68. .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK,
  69. .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK,
  70. .clk_bypass = &sys_ck,
  71. .clk_ref = &sys_ck,
  72. .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK,
  73. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  74. .enable_mask = OMAP3430_EN_CORE_DPLL_MASK,
  75. .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
  76. .recal_en_bit = OMAP3430_CORE_DPLL_RECAL_EN_SHIFT,
  77. .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT,
  78. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  79. .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK,
  80. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  81. .idlest_mask = OMAP3430_ST_CORE_CLK_MASK,
  82. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  83. .min_divider = 1,
  84. .max_divider = OMAP3_MAX_DPLL_DIV,
  85. };
  86. static struct clk dpll3_ck;
  87. static const char *dpll3_ck_parent_names[] = {
  88. "sys_ck",
  89. };
  90. static const struct clk_ops dpll3_ck_ops = {
  91. .init = &omap2_init_clk_clkdm,
  92. .get_parent = &omap2_init_dpll_parent,
  93. .recalc_rate = &omap3_dpll_recalc,
  94. .round_rate = &omap2_dpll_round_rate,
  95. };
  96. static struct clk_hw_omap dpll3_ck_hw = {
  97. .hw = {
  98. .clk = &dpll3_ck,
  99. },
  100. .ops = &clkhwops_omap3_dpll,
  101. .dpll_data = &dpll3_dd,
  102. .clkdm_name = "dpll3_clkdm",
  103. };
  104. DEFINE_STRUCT_CLK(dpll3_ck, dpll3_ck_parent_names, dpll3_ck_ops);
  105. DEFINE_CLK_DIVIDER(dpll3_m2_ck, "dpll3_ck", &dpll3_ck, 0x0,
  106. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  107. OMAP3430_CORE_DPLL_CLKOUT_DIV_SHIFT,
  108. OMAP3430_CORE_DPLL_CLKOUT_DIV_WIDTH,
  109. CLK_DIVIDER_ONE_BASED, NULL);
  110. static struct clk core_ck;
  111. static const char *core_ck_parent_names[] = {
  112. "dpll3_m2_ck",
  113. };
  114. static const struct clk_ops core_ck_ops = {};
  115. DEFINE_STRUCT_CLK_HW_OMAP(core_ck, NULL);
  116. DEFINE_STRUCT_CLK(core_ck, core_ck_parent_names, core_ck_ops);
  117. DEFINE_CLK_DIVIDER(l3_ick, "core_ck", &core_ck, 0x0,
  118. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  119. OMAP3430_CLKSEL_L3_SHIFT, OMAP3430_CLKSEL_L3_WIDTH,
  120. CLK_DIVIDER_ONE_BASED, NULL);
  121. DEFINE_CLK_DIVIDER(l4_ick, "l3_ick", &l3_ick, 0x0,
  122. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  123. OMAP3430_CLKSEL_L4_SHIFT, OMAP3430_CLKSEL_L4_WIDTH,
  124. CLK_DIVIDER_ONE_BASED, NULL);
  125. static struct clk security_l4_ick2;
  126. static const char *security_l4_ick2_parent_names[] = {
  127. "l4_ick",
  128. };
  129. DEFINE_STRUCT_CLK_HW_OMAP(security_l4_ick2, NULL);
  130. DEFINE_STRUCT_CLK(security_l4_ick2, security_l4_ick2_parent_names, core_ck_ops);
  131. static struct clk aes1_ick;
  132. static const char *aes1_ick_parent_names[] = {
  133. "security_l4_ick2",
  134. };
  135. static const struct clk_ops aes1_ick_ops = {
  136. .enable = &omap2_dflt_clk_enable,
  137. .disable = &omap2_dflt_clk_disable,
  138. .is_enabled = &omap2_dflt_clk_is_enabled,
  139. };
  140. static struct clk_hw_omap aes1_ick_hw = {
  141. .hw = {
  142. .clk = &aes1_ick,
  143. },
  144. .ops = &clkhwops_iclk_wait,
  145. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  146. .enable_bit = OMAP3430_EN_AES1_SHIFT,
  147. };
  148. DEFINE_STRUCT_CLK(aes1_ick, aes1_ick_parent_names, aes1_ick_ops);
  149. static struct clk core_l4_ick;
  150. static const struct clk_ops core_l4_ick_ops = {
  151. .init = &omap2_init_clk_clkdm,
  152. };
  153. DEFINE_STRUCT_CLK_HW_OMAP(core_l4_ick, "core_l4_clkdm");
  154. DEFINE_STRUCT_CLK(core_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  155. static struct clk aes2_ick;
  156. static const char *aes2_ick_parent_names[] = {
  157. "core_l4_ick",
  158. };
  159. static const struct clk_ops aes2_ick_ops = {
  160. .init = &omap2_init_clk_clkdm,
  161. .enable = &omap2_dflt_clk_enable,
  162. .disable = &omap2_dflt_clk_disable,
  163. .is_enabled = &omap2_dflt_clk_is_enabled,
  164. };
  165. static struct clk_hw_omap aes2_ick_hw = {
  166. .hw = {
  167. .clk = &aes2_ick,
  168. },
  169. .ops = &clkhwops_iclk_wait,
  170. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  171. .enable_bit = OMAP3430_EN_AES2_SHIFT,
  172. .clkdm_name = "core_l4_clkdm",
  173. };
  174. DEFINE_STRUCT_CLK(aes2_ick, aes2_ick_parent_names, aes2_ick_ops);
  175. static struct clk dpll1_fck;
  176. static struct dpll_data dpll1_dd = {
  177. .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  178. .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK,
  179. .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK,
  180. .clk_bypass = &dpll1_fck,
  181. .clk_ref = &sys_ck,
  182. .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK,
  183. .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
  184. .enable_mask = OMAP3430_EN_MPU_DPLL_MASK,
  185. .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
  186. .auto_recal_bit = OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT,
  187. .recal_en_bit = OMAP3430_MPU_DPLL_RECAL_EN_SHIFT,
  188. .recal_st_bit = OMAP3430_MPU_DPLL_ST_SHIFT,
  189. .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  190. .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK,
  191. .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
  192. .idlest_mask = OMAP3430_ST_MPU_CLK_MASK,
  193. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  194. .min_divider = 1,
  195. .max_divider = OMAP3_MAX_DPLL_DIV,
  196. };
  197. static struct clk dpll1_ck;
  198. static const struct clk_ops dpll1_ck_ops = {
  199. .init = &omap2_init_clk_clkdm,
  200. .enable = &omap3_noncore_dpll_enable,
  201. .disable = &omap3_noncore_dpll_disable,
  202. .get_parent = &omap2_init_dpll_parent,
  203. .recalc_rate = &omap3_dpll_recalc,
  204. .set_rate = &omap3_noncore_dpll_set_rate,
  205. .round_rate = &omap2_dpll_round_rate,
  206. };
  207. static struct clk_hw_omap dpll1_ck_hw = {
  208. .hw = {
  209. .clk = &dpll1_ck,
  210. },
  211. .ops = &clkhwops_omap3_dpll,
  212. .dpll_data = &dpll1_dd,
  213. .clkdm_name = "dpll1_clkdm",
  214. };
  215. DEFINE_STRUCT_CLK(dpll1_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  216. DEFINE_CLK_FIXED_FACTOR(dpll1_x2_ck, "dpll1_ck", &dpll1_ck, 0x0, 2, 1);
  217. DEFINE_CLK_DIVIDER(dpll1_x2m2_ck, "dpll1_x2_ck", &dpll1_x2_ck, 0x0,
  218. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
  219. OMAP3430_MPU_DPLL_CLKOUT_DIV_SHIFT,
  220. OMAP3430_MPU_DPLL_CLKOUT_DIV_WIDTH,
  221. CLK_DIVIDER_ONE_BASED, NULL);
  222. static struct clk mpu_ck;
  223. static const char *mpu_ck_parent_names[] = {
  224. "dpll1_x2m2_ck",
  225. };
  226. DEFINE_STRUCT_CLK_HW_OMAP(mpu_ck, "mpu_clkdm");
  227. DEFINE_STRUCT_CLK(mpu_ck, mpu_ck_parent_names, core_l4_ick_ops);
  228. DEFINE_CLK_DIVIDER(arm_fck, "mpu_ck", &mpu_ck, 0x0,
  229. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
  230. OMAP3430_ST_MPU_CLK_SHIFT, OMAP3430_ST_MPU_CLK_WIDTH,
  231. 0x0, NULL);
  232. static struct clk cam_ick;
  233. static struct clk_hw_omap cam_ick_hw = {
  234. .hw = {
  235. .clk = &cam_ick,
  236. },
  237. .ops = &clkhwops_iclk,
  238. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
  239. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  240. .clkdm_name = "cam_clkdm",
  241. };
  242. DEFINE_STRUCT_CLK(cam_ick, security_l4_ick2_parent_names, aes2_ick_ops);
  243. /* DPLL4 */
  244. /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
  245. /* Type: DPLL */
  246. static struct dpll_data dpll4_dd;
  247. static struct dpll_data dpll4_dd_34xx __initdata = {
  248. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
  249. .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK,
  250. .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
  251. .clk_bypass = &sys_ck,
  252. .clk_ref = &sys_ck,
  253. .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
  254. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  255. .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
  256. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  257. .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
  258. .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
  259. .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
  260. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  261. .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
  262. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  263. .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
  264. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  265. .min_divider = 1,
  266. .max_divider = OMAP3_MAX_DPLL_DIV,
  267. };
  268. static struct dpll_data dpll4_dd_3630 __initdata = {
  269. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
  270. .mult_mask = OMAP3630_PERIPH_DPLL_MULT_MASK,
  271. .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
  272. .clk_bypass = &sys_ck,
  273. .clk_ref = &sys_ck,
  274. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  275. .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
  276. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  277. .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
  278. .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
  279. .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
  280. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  281. .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
  282. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  283. .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
  284. .dco_mask = OMAP3630_PERIPH_DPLL_DCO_SEL_MASK,
  285. .sddiv_mask = OMAP3630_PERIPH_DPLL_SD_DIV_MASK,
  286. .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
  287. .min_divider = 1,
  288. .max_divider = OMAP3_MAX_DPLL_DIV,
  289. .flags = DPLL_J_TYPE
  290. };
  291. static struct clk dpll4_ck;
  292. static const struct clk_ops dpll4_ck_ops = {
  293. .init = &omap2_init_clk_clkdm,
  294. .enable = &omap3_noncore_dpll_enable,
  295. .disable = &omap3_noncore_dpll_disable,
  296. .get_parent = &omap2_init_dpll_parent,
  297. .recalc_rate = &omap3_dpll_recalc,
  298. .set_rate = &omap3_dpll4_set_rate,
  299. .round_rate = &omap2_dpll_round_rate,
  300. };
  301. static struct clk_hw_omap dpll4_ck_hw = {
  302. .hw = {
  303. .clk = &dpll4_ck,
  304. },
  305. .dpll_data = &dpll4_dd,
  306. .ops = &clkhwops_omap3_dpll,
  307. .clkdm_name = "dpll4_clkdm",
  308. };
  309. DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops);
  310. DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0,
  311. OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
  312. OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH,
  313. CLK_DIVIDER_ONE_BASED, NULL);
  314. static struct clk dpll4_m5x2_ck;
  315. static const char *dpll4_m5x2_ck_parent_names[] = {
  316. "dpll4_m5_ck",
  317. };
  318. static const struct clk_ops dpll4_m5x2_ck_ops = {
  319. .init = &omap2_init_clk_clkdm,
  320. .enable = &omap2_dflt_clk_enable,
  321. .disable = &omap2_dflt_clk_disable,
  322. .is_enabled = &omap2_dflt_clk_is_enabled,
  323. .recalc_rate = &omap3_clkoutx2_recalc,
  324. };
  325. static const struct clk_ops dpll4_m5x2_ck_3630_ops = {
  326. .init = &omap2_init_clk_clkdm,
  327. .enable = &omap36xx_pwrdn_clk_enable_with_hsdiv_restore,
  328. .disable = &omap2_dflt_clk_disable,
  329. .recalc_rate = &omap3_clkoutx2_recalc,
  330. };
  331. static struct clk_hw_omap dpll4_m5x2_ck_hw = {
  332. .hw = {
  333. .clk = &dpll4_m5x2_ck,
  334. },
  335. .ops = &clkhwops_wait,
  336. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  337. .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
  338. .flags = INVERT_ENABLE,
  339. .clkdm_name = "dpll4_clkdm",
  340. };
  341. DEFINE_STRUCT_CLK(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, dpll4_m5x2_ck_ops);
  342. static struct clk dpll4_m5x2_ck_3630 = {
  343. .name = "dpll4_m5x2_ck",
  344. .hw = &dpll4_m5x2_ck_hw.hw,
  345. .parent_names = dpll4_m5x2_ck_parent_names,
  346. .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names),
  347. .ops = &dpll4_m5x2_ck_3630_ops,
  348. };
  349. static struct clk cam_mclk;
  350. static const char *cam_mclk_parent_names[] = {
  351. "dpll4_m5x2_ck",
  352. };
  353. static struct clk_hw_omap cam_mclk_hw = {
  354. .hw = {
  355. .clk = &cam_mclk,
  356. },
  357. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  358. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  359. .clkdm_name = "cam_clkdm",
  360. };
  361. DEFINE_STRUCT_CLK(cam_mclk, cam_mclk_parent_names, aes2_ick_ops);
  362. static const struct clksel_rate clkout2_src_core_rates[] = {
  363. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  364. { .div = 0 }
  365. };
  366. static const struct clksel_rate clkout2_src_sys_rates[] = {
  367. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  368. { .div = 0 }
  369. };
  370. static const struct clksel_rate clkout2_src_96m_rates[] = {
  371. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  372. { .div = 0 }
  373. };
  374. DEFINE_CLK_DIVIDER(dpll4_m2_ck, "dpll4_ck", &dpll4_ck, 0x0,
  375. OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
  376. OMAP3430_DIV_96M_SHIFT, OMAP3630_DIV_96M_WIDTH,
  377. CLK_DIVIDER_ONE_BASED, NULL);
  378. static struct clk dpll4_m2x2_ck;
  379. static const char *dpll4_m2x2_ck_parent_names[] = {
  380. "dpll4_m2_ck",
  381. };
  382. static struct clk_hw_omap dpll4_m2x2_ck_hw = {
  383. .hw = {
  384. .clk = &dpll4_m2x2_ck,
  385. },
  386. .ops = &clkhwops_wait,
  387. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  388. .enable_bit = OMAP3430_PWRDN_96M_SHIFT,
  389. .flags = INVERT_ENABLE,
  390. .clkdm_name = "dpll4_clkdm",
  391. };
  392. DEFINE_STRUCT_CLK(dpll4_m2x2_ck, dpll4_m2x2_ck_parent_names, dpll4_m5x2_ck_ops);
  393. static struct clk dpll4_m2x2_ck_3630 = {
  394. .name = "dpll4_m2x2_ck",
  395. .hw = &dpll4_m2x2_ck_hw.hw,
  396. .parent_names = dpll4_m2x2_ck_parent_names,
  397. .num_parents = ARRAY_SIZE(dpll4_m2x2_ck_parent_names),
  398. .ops = &dpll4_m5x2_ck_3630_ops,
  399. };
  400. static struct clk omap_96m_alwon_fck;
  401. static const char *omap_96m_alwon_fck_parent_names[] = {
  402. "dpll4_m2x2_ck",
  403. };
  404. DEFINE_STRUCT_CLK_HW_OMAP(omap_96m_alwon_fck, NULL);
  405. DEFINE_STRUCT_CLK(omap_96m_alwon_fck, omap_96m_alwon_fck_parent_names,
  406. core_ck_ops);
  407. static struct clk cm_96m_fck;
  408. static const char *cm_96m_fck_parent_names[] = {
  409. "omap_96m_alwon_fck",
  410. };
  411. DEFINE_STRUCT_CLK_HW_OMAP(cm_96m_fck, NULL);
  412. DEFINE_STRUCT_CLK(cm_96m_fck, cm_96m_fck_parent_names, core_ck_ops);
  413. static const struct clksel_rate clkout2_src_54m_rates[] = {
  414. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  415. { .div = 0 }
  416. };
  417. DEFINE_CLK_DIVIDER(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0,
  418. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  419. OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH,
  420. CLK_DIVIDER_ONE_BASED, NULL);
  421. static struct clk dpll4_m3x2_ck;
  422. static const char *dpll4_m3x2_ck_parent_names[] = {
  423. "dpll4_m3_ck",
  424. };
  425. static struct clk_hw_omap dpll4_m3x2_ck_hw = {
  426. .hw = {
  427. .clk = &dpll4_m3x2_ck,
  428. },
  429. .ops = &clkhwops_wait,
  430. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  431. .enable_bit = OMAP3430_PWRDN_TV_SHIFT,
  432. .flags = INVERT_ENABLE,
  433. .clkdm_name = "dpll4_clkdm",
  434. };
  435. DEFINE_STRUCT_CLK(dpll4_m3x2_ck, dpll4_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  436. static struct clk dpll4_m3x2_ck_3630 = {
  437. .name = "dpll4_m3x2_ck",
  438. .hw = &dpll4_m3x2_ck_hw.hw,
  439. .parent_names = dpll4_m3x2_ck_parent_names,
  440. .num_parents = ARRAY_SIZE(dpll4_m3x2_ck_parent_names),
  441. .ops = &dpll4_m5x2_ck_3630_ops,
  442. };
  443. static const char *omap_54m_fck_parent_names[] = {
  444. "dpll4_m3x2_ck", "sys_altclk",
  445. };
  446. DEFINE_CLK_MUX(omap_54m_fck, omap_54m_fck_parent_names, NULL, 0x0,
  447. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), OMAP3430_SOURCE_54M_SHIFT,
  448. OMAP3430_SOURCE_54M_WIDTH, 0x0, NULL);
  449. static const struct clksel clkout2_src_clksel[] = {
  450. { .parent = &core_ck, .rates = clkout2_src_core_rates },
  451. { .parent = &sys_ck, .rates = clkout2_src_sys_rates },
  452. { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates },
  453. { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates },
  454. { .parent = NULL },
  455. };
  456. static const char *clkout2_src_ck_parent_names[] = {
  457. "core_ck", "sys_ck", "cm_96m_fck", "omap_54m_fck",
  458. };
  459. static const struct clk_ops clkout2_src_ck_ops = {
  460. .init = &omap2_init_clk_clkdm,
  461. .enable = &omap2_dflt_clk_enable,
  462. .disable = &omap2_dflt_clk_disable,
  463. .is_enabled = &omap2_dflt_clk_is_enabled,
  464. .recalc_rate = &omap2_clksel_recalc,
  465. .get_parent = &omap2_clksel_find_parent_index,
  466. .set_parent = &omap2_clksel_set_parent,
  467. };
  468. DEFINE_CLK_OMAP_MUX_GATE(clkout2_src_ck, "core_clkdm",
  469. clkout2_src_clksel, OMAP3430_CM_CLKOUT_CTRL,
  470. OMAP3430_CLKOUT2SOURCE_MASK,
  471. OMAP3430_CM_CLKOUT_CTRL, OMAP3430_CLKOUT2_EN_SHIFT,
  472. NULL, clkout2_src_ck_parent_names, clkout2_src_ck_ops);
  473. static const struct clksel_rate omap_48m_cm96m_rates[] = {
  474. { .div = 2, .val = 0, .flags = RATE_IN_3XXX },
  475. { .div = 0 }
  476. };
  477. static const struct clksel_rate omap_48m_alt_rates[] = {
  478. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  479. { .div = 0 }
  480. };
  481. static const struct clksel omap_48m_clksel[] = {
  482. { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
  483. { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
  484. { .parent = NULL },
  485. };
  486. static const char *omap_48m_fck_parent_names[] = {
  487. "cm_96m_fck", "sys_altclk",
  488. };
  489. static struct clk omap_48m_fck;
  490. static const struct clk_ops omap_48m_fck_ops = {
  491. .recalc_rate = &omap2_clksel_recalc,
  492. .get_parent = &omap2_clksel_find_parent_index,
  493. .set_parent = &omap2_clksel_set_parent,
  494. };
  495. static struct clk_hw_omap omap_48m_fck_hw = {
  496. .hw = {
  497. .clk = &omap_48m_fck,
  498. },
  499. .clksel = omap_48m_clksel,
  500. .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  501. .clksel_mask = OMAP3430_SOURCE_48M_MASK,
  502. };
  503. DEFINE_STRUCT_CLK(omap_48m_fck, omap_48m_fck_parent_names, omap_48m_fck_ops);
  504. DEFINE_CLK_FIXED_FACTOR(omap_12m_fck, "omap_48m_fck", &omap_48m_fck, 0x0, 1, 4);
  505. static struct clk core_12m_fck;
  506. static const char *core_12m_fck_parent_names[] = {
  507. "omap_12m_fck",
  508. };
  509. DEFINE_STRUCT_CLK_HW_OMAP(core_12m_fck, "core_l4_clkdm");
  510. DEFINE_STRUCT_CLK(core_12m_fck, core_12m_fck_parent_names, core_l4_ick_ops);
  511. static struct clk core_48m_fck;
  512. static const char *core_48m_fck_parent_names[] = {
  513. "omap_48m_fck",
  514. };
  515. DEFINE_STRUCT_CLK_HW_OMAP(core_48m_fck, "core_l4_clkdm");
  516. DEFINE_STRUCT_CLK(core_48m_fck, core_48m_fck_parent_names, core_l4_ick_ops);
  517. static const char *omap_96m_fck_parent_names[] = {
  518. "cm_96m_fck", "sys_ck",
  519. };
  520. DEFINE_CLK_MUX(omap_96m_fck, omap_96m_fck_parent_names, NULL, 0x0,
  521. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  522. OMAP3430_SOURCE_96M_SHIFT, OMAP3430_SOURCE_96M_WIDTH, 0x0, NULL);
  523. static struct clk core_96m_fck;
  524. static const char *core_96m_fck_parent_names[] = {
  525. "omap_96m_fck",
  526. };
  527. DEFINE_STRUCT_CLK_HW_OMAP(core_96m_fck, "core_l4_clkdm");
  528. DEFINE_STRUCT_CLK(core_96m_fck, core_96m_fck_parent_names, core_l4_ick_ops);
  529. static struct clk core_l3_ick;
  530. static const char *core_l3_ick_parent_names[] = {
  531. "l3_ick",
  532. };
  533. DEFINE_STRUCT_CLK_HW_OMAP(core_l3_ick, "core_l3_clkdm");
  534. DEFINE_STRUCT_CLK(core_l3_ick, core_l3_ick_parent_names, core_l4_ick_ops);
  535. DEFINE_CLK_FIXED_FACTOR(dpll3_m2x2_ck, "dpll3_m2_ck", &dpll3_m2_ck, 0x0, 2, 1);
  536. static struct clk corex2_fck;
  537. static const char *corex2_fck_parent_names[] = {
  538. "dpll3_m2x2_ck",
  539. };
  540. DEFINE_STRUCT_CLK_HW_OMAP(corex2_fck, NULL);
  541. DEFINE_STRUCT_CLK(corex2_fck, corex2_fck_parent_names, core_ck_ops);
  542. static struct clk cpefuse_fck;
  543. static struct clk_hw_omap cpefuse_fck_hw = {
  544. .hw = {
  545. .clk = &cpefuse_fck,
  546. },
  547. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
  548. .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT,
  549. .clkdm_name = "core_l4_clkdm",
  550. };
  551. DEFINE_STRUCT_CLK(cpefuse_fck, dpll3_ck_parent_names, aes2_ick_ops);
  552. static struct clk csi2_96m_fck;
  553. static const char *csi2_96m_fck_parent_names[] = {
  554. "core_96m_fck",
  555. };
  556. static struct clk_hw_omap csi2_96m_fck_hw = {
  557. .hw = {
  558. .clk = &csi2_96m_fck,
  559. },
  560. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  561. .enable_bit = OMAP3430_EN_CSI2_SHIFT,
  562. .clkdm_name = "cam_clkdm",
  563. };
  564. DEFINE_STRUCT_CLK(csi2_96m_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  565. static struct clk d2d_26m_fck;
  566. static struct clk_hw_omap d2d_26m_fck_hw = {
  567. .hw = {
  568. .clk = &d2d_26m_fck,
  569. },
  570. .ops = &clkhwops_wait,
  571. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  572. .enable_bit = OMAP3430ES1_EN_D2D_SHIFT,
  573. .clkdm_name = "d2d_clkdm",
  574. };
  575. DEFINE_STRUCT_CLK(d2d_26m_fck, dpll3_ck_parent_names, aes2_ick_ops);
  576. static struct clk des1_ick;
  577. static struct clk_hw_omap des1_ick_hw = {
  578. .hw = {
  579. .clk = &des1_ick,
  580. },
  581. .ops = &clkhwops_iclk_wait,
  582. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  583. .enable_bit = OMAP3430_EN_DES1_SHIFT,
  584. };
  585. DEFINE_STRUCT_CLK(des1_ick, aes1_ick_parent_names, aes1_ick_ops);
  586. static struct clk des2_ick;
  587. static struct clk_hw_omap des2_ick_hw = {
  588. .hw = {
  589. .clk = &des2_ick,
  590. },
  591. .ops = &clkhwops_iclk_wait,
  592. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  593. .enable_bit = OMAP3430_EN_DES2_SHIFT,
  594. .clkdm_name = "core_l4_clkdm",
  595. };
  596. DEFINE_STRUCT_CLK(des2_ick, aes2_ick_parent_names, aes2_ick_ops);
  597. DEFINE_CLK_DIVIDER(dpll1_fck, "core_ck", &core_ck, 0x0,
  598. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  599. OMAP3430_MPU_CLK_SRC_SHIFT, OMAP3430_MPU_CLK_SRC_WIDTH,
  600. CLK_DIVIDER_ONE_BASED, NULL);
  601. static struct clk dpll2_fck;
  602. static struct dpll_data dpll2_dd = {
  603. .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  604. .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
  605. .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
  606. .clk_bypass = &dpll2_fck,
  607. .clk_ref = &sys_ck,
  608. .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
  609. .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
  610. .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
  611. .modes = ((1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
  612. (1 << DPLL_LOW_POWER_BYPASS)),
  613. .auto_recal_bit = OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
  614. .recal_en_bit = OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
  615. .recal_st_bit = OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
  616. .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  617. .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK,
  618. .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
  619. .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK,
  620. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  621. .min_divider = 1,
  622. .max_divider = OMAP3_MAX_DPLL_DIV,
  623. };
  624. static struct clk dpll2_ck;
  625. static struct clk_hw_omap dpll2_ck_hw = {
  626. .hw = {
  627. .clk = &dpll2_ck,
  628. },
  629. .ops = &clkhwops_omap3_dpll,
  630. .dpll_data = &dpll2_dd,
  631. .clkdm_name = "dpll2_clkdm",
  632. };
  633. DEFINE_STRUCT_CLK(dpll2_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  634. DEFINE_CLK_DIVIDER(dpll2_fck, "core_ck", &core_ck, 0x0,
  635. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  636. OMAP3430_IVA2_CLK_SRC_SHIFT, OMAP3430_IVA2_CLK_SRC_WIDTH,
  637. CLK_DIVIDER_ONE_BASED, NULL);
  638. DEFINE_CLK_DIVIDER(dpll2_m2_ck, "dpll2_ck", &dpll2_ck, 0x0,
  639. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL2_PLL),
  640. OMAP3430_IVA2_DPLL_CLKOUT_DIV_SHIFT,
  641. OMAP3430_IVA2_DPLL_CLKOUT_DIV_WIDTH,
  642. CLK_DIVIDER_ONE_BASED, NULL);
  643. DEFINE_CLK_DIVIDER(dpll3_m3_ck, "dpll3_ck", &dpll3_ck, 0x0,
  644. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  645. OMAP3430_DIV_DPLL3_SHIFT, OMAP3430_DIV_DPLL3_WIDTH,
  646. CLK_DIVIDER_ONE_BASED, NULL);
  647. static struct clk dpll3_m3x2_ck;
  648. static const char *dpll3_m3x2_ck_parent_names[] = {
  649. "dpll3_m3_ck",
  650. };
  651. static struct clk_hw_omap dpll3_m3x2_ck_hw = {
  652. .hw = {
  653. .clk = &dpll3_m3x2_ck,
  654. },
  655. .ops = &clkhwops_wait,
  656. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  657. .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT,
  658. .flags = INVERT_ENABLE,
  659. .clkdm_name = "dpll3_clkdm",
  660. };
  661. DEFINE_STRUCT_CLK(dpll3_m3x2_ck, dpll3_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  662. static struct clk dpll3_m3x2_ck_3630 = {
  663. .name = "dpll3_m3x2_ck",
  664. .hw = &dpll3_m3x2_ck_hw.hw,
  665. .parent_names = dpll3_m3x2_ck_parent_names,
  666. .num_parents = ARRAY_SIZE(dpll3_m3x2_ck_parent_names),
  667. .ops = &dpll4_m5x2_ck_3630_ops,
  668. };
  669. DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1);
  670. DEFINE_CLK_DIVIDER(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0,
  671. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  672. OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH,
  673. CLK_DIVIDER_ONE_BASED, NULL);
  674. static struct clk dpll4_m4x2_ck;
  675. static const char *dpll4_m4x2_ck_parent_names[] = {
  676. "dpll4_m4_ck",
  677. };
  678. static struct clk_hw_omap dpll4_m4x2_ck_hw = {
  679. .hw = {
  680. .clk = &dpll4_m4x2_ck,
  681. },
  682. .ops = &clkhwops_wait,
  683. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  684. .enable_bit = OMAP3430_PWRDN_DSS1_SHIFT,
  685. .flags = INVERT_ENABLE,
  686. .clkdm_name = "dpll4_clkdm",
  687. };
  688. DEFINE_STRUCT_CLK(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names, dpll4_m5x2_ck_ops);
  689. static struct clk dpll4_m4x2_ck_3630 = {
  690. .name = "dpll4_m4x2_ck",
  691. .hw = &dpll4_m4x2_ck_hw.hw,
  692. .parent_names = dpll4_m4x2_ck_parent_names,
  693. .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names),
  694. .ops = &dpll4_m5x2_ck_3630_ops,
  695. };
  696. DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0,
  697. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  698. OMAP3430_DIV_DPLL4_SHIFT, OMAP3630_DIV_DPLL4_WIDTH,
  699. CLK_DIVIDER_ONE_BASED, NULL);
  700. static struct clk dpll4_m6x2_ck;
  701. static const char *dpll4_m6x2_ck_parent_names[] = {
  702. "dpll4_m6_ck",
  703. };
  704. static struct clk_hw_omap dpll4_m6x2_ck_hw = {
  705. .hw = {
  706. .clk = &dpll4_m6x2_ck,
  707. },
  708. .ops = &clkhwops_wait,
  709. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  710. .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
  711. .flags = INVERT_ENABLE,
  712. .clkdm_name = "dpll4_clkdm",
  713. };
  714. DEFINE_STRUCT_CLK(dpll4_m6x2_ck, dpll4_m6x2_ck_parent_names, dpll4_m5x2_ck_ops);
  715. static struct clk dpll4_m6x2_ck_3630 = {
  716. .name = "dpll4_m6x2_ck",
  717. .hw = &dpll4_m6x2_ck_hw.hw,
  718. .parent_names = dpll4_m6x2_ck_parent_names,
  719. .num_parents = ARRAY_SIZE(dpll4_m6x2_ck_parent_names),
  720. .ops = &dpll4_m5x2_ck_3630_ops,
  721. };
  722. DEFINE_CLK_FIXED_FACTOR(dpll4_x2_ck, "dpll4_ck", &dpll4_ck, 0x0, 2, 1);
  723. static struct dpll_data dpll5_dd = {
  724. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
  725. .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
  726. .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
  727. .clk_bypass = &sys_ck,
  728. .clk_ref = &sys_ck,
  729. .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
  730. .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
  731. .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
  732. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  733. .auto_recal_bit = OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
  734. .recal_en_bit = OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
  735. .recal_st_bit = OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
  736. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
  737. .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
  738. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
  739. .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
  740. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  741. .min_divider = 1,
  742. .max_divider = OMAP3_MAX_DPLL_DIV,
  743. };
  744. static struct clk dpll5_ck;
  745. static struct clk_hw_omap dpll5_ck_hw = {
  746. .hw = {
  747. .clk = &dpll5_ck,
  748. },
  749. .ops = &clkhwops_omap3_dpll,
  750. .dpll_data = &dpll5_dd,
  751. .clkdm_name = "dpll5_clkdm",
  752. };
  753. DEFINE_STRUCT_CLK(dpll5_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  754. DEFINE_CLK_DIVIDER(dpll5_m2_ck, "dpll5_ck", &dpll5_ck, 0x0,
  755. OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
  756. OMAP3430ES2_DIV_120M_SHIFT, OMAP3430ES2_DIV_120M_WIDTH,
  757. CLK_DIVIDER_ONE_BASED, NULL);
  758. static struct clk dss1_alwon_fck_3430es1;
  759. static const char *dss1_alwon_fck_3430es1_parent_names[] = {
  760. "dpll4_m4x2_ck",
  761. };
  762. static struct clk_hw_omap dss1_alwon_fck_3430es1_hw = {
  763. .hw = {
  764. .clk = &dss1_alwon_fck_3430es1,
  765. },
  766. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  767. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  768. .clkdm_name = "dss_clkdm",
  769. };
  770. DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es1, dss1_alwon_fck_3430es1_parent_names,
  771. aes2_ick_ops);
  772. static struct clk dss1_alwon_fck_3430es2;
  773. static struct clk_hw_omap dss1_alwon_fck_3430es2_hw = {
  774. .hw = {
  775. .clk = &dss1_alwon_fck_3430es2,
  776. },
  777. .ops = &clkhwops_omap3430es2_dss_usbhost_wait,
  778. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  779. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  780. .clkdm_name = "dss_clkdm",
  781. };
  782. DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es2, dss1_alwon_fck_3430es1_parent_names,
  783. aes2_ick_ops);
  784. static struct clk dss2_alwon_fck;
  785. static struct clk_hw_omap dss2_alwon_fck_hw = {
  786. .hw = {
  787. .clk = &dss2_alwon_fck,
  788. },
  789. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  790. .enable_bit = OMAP3430_EN_DSS2_SHIFT,
  791. .clkdm_name = "dss_clkdm",
  792. };
  793. DEFINE_STRUCT_CLK(dss2_alwon_fck, dpll3_ck_parent_names, aes2_ick_ops);
  794. static struct clk dss_96m_fck;
  795. static struct clk_hw_omap dss_96m_fck_hw = {
  796. .hw = {
  797. .clk = &dss_96m_fck,
  798. },
  799. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  800. .enable_bit = OMAP3430_EN_TV_SHIFT,
  801. .clkdm_name = "dss_clkdm",
  802. };
  803. DEFINE_STRUCT_CLK(dss_96m_fck, core_96m_fck_parent_names, aes2_ick_ops);
  804. static struct clk dss_ick_3430es1;
  805. static struct clk_hw_omap dss_ick_3430es1_hw = {
  806. .hw = {
  807. .clk = &dss_ick_3430es1,
  808. },
  809. .ops = &clkhwops_iclk,
  810. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
  811. .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
  812. .clkdm_name = "dss_clkdm",
  813. };
  814. DEFINE_STRUCT_CLK(dss_ick_3430es1, security_l4_ick2_parent_names, aes2_ick_ops);
  815. static struct clk dss_ick_3430es2;
  816. static struct clk_hw_omap dss_ick_3430es2_hw = {
  817. .hw = {
  818. .clk = &dss_ick_3430es2,
  819. },
  820. .ops = &clkhwops_omap3430es2_iclk_dss_usbhost_wait,
  821. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
  822. .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
  823. .clkdm_name = "dss_clkdm",
  824. };
  825. DEFINE_STRUCT_CLK(dss_ick_3430es2, security_l4_ick2_parent_names, aes2_ick_ops);
  826. static struct clk dss_tv_fck;
  827. static const char *dss_tv_fck_parent_names[] = {
  828. "omap_54m_fck",
  829. };
  830. static struct clk_hw_omap dss_tv_fck_hw = {
  831. .hw = {
  832. .clk = &dss_tv_fck,
  833. },
  834. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  835. .enable_bit = OMAP3430_EN_TV_SHIFT,
  836. .clkdm_name = "dss_clkdm",
  837. };
  838. DEFINE_STRUCT_CLK(dss_tv_fck, dss_tv_fck_parent_names, aes2_ick_ops);
  839. static struct clk emac_fck;
  840. static const char *emac_fck_parent_names[] = {
  841. "rmii_ck",
  842. };
  843. static struct clk_hw_omap emac_fck_hw = {
  844. .hw = {
  845. .clk = &emac_fck,
  846. },
  847. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  848. .enable_bit = AM35XX_CPGMAC_FCLK_SHIFT,
  849. };
  850. DEFINE_STRUCT_CLK(emac_fck, emac_fck_parent_names, aes1_ick_ops);
  851. static struct clk ipss_ick;
  852. static const char *ipss_ick_parent_names[] = {
  853. "core_l3_ick",
  854. };
  855. static struct clk_hw_omap ipss_ick_hw = {
  856. .hw = {
  857. .clk = &ipss_ick,
  858. },
  859. .ops = &clkhwops_am35xx_ipss_wait,
  860. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  861. .enable_bit = AM35XX_EN_IPSS_SHIFT,
  862. .clkdm_name = "core_l3_clkdm",
  863. };
  864. DEFINE_STRUCT_CLK(ipss_ick, ipss_ick_parent_names, aes2_ick_ops);
  865. static struct clk emac_ick;
  866. static const char *emac_ick_parent_names[] = {
  867. "ipss_ick",
  868. };
  869. static struct clk_hw_omap emac_ick_hw = {
  870. .hw = {
  871. .clk = &emac_ick,
  872. },
  873. .ops = &clkhwops_am35xx_ipss_module_wait,
  874. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  875. .enable_bit = AM35XX_CPGMAC_VBUSP_CLK_SHIFT,
  876. .clkdm_name = "core_l3_clkdm",
  877. };
  878. DEFINE_STRUCT_CLK(emac_ick, emac_ick_parent_names, aes2_ick_ops);
  879. static struct clk emu_core_alwon_ck;
  880. static const char *emu_core_alwon_ck_parent_names[] = {
  881. "dpll3_m3x2_ck",
  882. };
  883. DEFINE_STRUCT_CLK_HW_OMAP(emu_core_alwon_ck, "dpll3_clkdm");
  884. DEFINE_STRUCT_CLK(emu_core_alwon_ck, emu_core_alwon_ck_parent_names,
  885. core_l4_ick_ops);
  886. static struct clk emu_mpu_alwon_ck;
  887. static const char *emu_mpu_alwon_ck_parent_names[] = {
  888. "mpu_ck",
  889. };
  890. DEFINE_STRUCT_CLK_HW_OMAP(emu_mpu_alwon_ck, NULL);
  891. DEFINE_STRUCT_CLK(emu_mpu_alwon_ck, emu_mpu_alwon_ck_parent_names, core_ck_ops);
  892. static struct clk emu_per_alwon_ck;
  893. static const char *emu_per_alwon_ck_parent_names[] = {
  894. "dpll4_m6x2_ck",
  895. };
  896. DEFINE_STRUCT_CLK_HW_OMAP(emu_per_alwon_ck, "dpll4_clkdm");
  897. DEFINE_STRUCT_CLK(emu_per_alwon_ck, emu_per_alwon_ck_parent_names,
  898. core_l4_ick_ops);
  899. static const char *emu_src_ck_parent_names[] = {
  900. "sys_ck", "emu_core_alwon_ck", "emu_per_alwon_ck", "emu_mpu_alwon_ck",
  901. };
  902. static const struct clksel_rate emu_src_sys_rates[] = {
  903. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  904. { .div = 0 },
  905. };
  906. static const struct clksel_rate emu_src_core_rates[] = {
  907. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  908. { .div = 0 },
  909. };
  910. static const struct clksel_rate emu_src_per_rates[] = {
  911. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  912. { .div = 0 },
  913. };
  914. static const struct clksel_rate emu_src_mpu_rates[] = {
  915. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  916. { .div = 0 },
  917. };
  918. static const struct clksel emu_src_clksel[] = {
  919. { .parent = &sys_ck, .rates = emu_src_sys_rates },
  920. { .parent = &emu_core_alwon_ck, .rates = emu_src_core_rates },
  921. { .parent = &emu_per_alwon_ck, .rates = emu_src_per_rates },
  922. { .parent = &emu_mpu_alwon_ck, .rates = emu_src_mpu_rates },
  923. { .parent = NULL },
  924. };
  925. static const struct clk_ops emu_src_ck_ops = {
  926. .init = &omap2_init_clk_clkdm,
  927. .recalc_rate = &omap2_clksel_recalc,
  928. .get_parent = &omap2_clksel_find_parent_index,
  929. .set_parent = &omap2_clksel_set_parent,
  930. .enable = &omap2_clkops_enable_clkdm,
  931. .disable = &omap2_clkops_disable_clkdm,
  932. };
  933. static struct clk emu_src_ck;
  934. static struct clk_hw_omap emu_src_ck_hw = {
  935. .hw = {
  936. .clk = &emu_src_ck,
  937. },
  938. .clksel = emu_src_clksel,
  939. .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  940. .clksel_mask = OMAP3430_MUX_CTRL_MASK,
  941. .clkdm_name = "emu_clkdm",
  942. };
  943. DEFINE_STRUCT_CLK(emu_src_ck, emu_src_ck_parent_names, emu_src_ck_ops);
  944. DEFINE_CLK_DIVIDER(atclk_fck, "emu_src_ck", &emu_src_ck, 0x0,
  945. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  946. OMAP3430_CLKSEL_ATCLK_SHIFT, OMAP3430_CLKSEL_ATCLK_WIDTH,
  947. CLK_DIVIDER_ONE_BASED, NULL);
  948. static struct clk fac_ick;
  949. static struct clk_hw_omap fac_ick_hw = {
  950. .hw = {
  951. .clk = &fac_ick,
  952. },
  953. .ops = &clkhwops_iclk_wait,
  954. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  955. .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
  956. .clkdm_name = "core_l4_clkdm",
  957. };
  958. DEFINE_STRUCT_CLK(fac_ick, aes2_ick_parent_names, aes2_ick_ops);
  959. static struct clk fshostusb_fck;
  960. static const char *fshostusb_fck_parent_names[] = {
  961. "core_48m_fck",
  962. };
  963. static struct clk_hw_omap fshostusb_fck_hw = {
  964. .hw = {
  965. .clk = &fshostusb_fck,
  966. },
  967. .ops = &clkhwops_wait,
  968. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  969. .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
  970. .clkdm_name = "core_l4_clkdm",
  971. };
  972. DEFINE_STRUCT_CLK(fshostusb_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  973. static struct clk gfx_l3_ck;
  974. static struct clk_hw_omap gfx_l3_ck_hw = {
  975. .hw = {
  976. .clk = &gfx_l3_ck,
  977. },
  978. .ops = &clkhwops_wait,
  979. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
  980. .enable_bit = OMAP_EN_GFX_SHIFT,
  981. .clkdm_name = "gfx_3430es1_clkdm",
  982. };
  983. DEFINE_STRUCT_CLK(gfx_l3_ck, core_l3_ick_parent_names, aes1_ick_ops);
  984. DEFINE_CLK_DIVIDER(gfx_l3_fck, "l3_ick", &l3_ick, 0x0,
  985. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  986. OMAP_CLKSEL_GFX_SHIFT, OMAP_CLKSEL_GFX_WIDTH,
  987. CLK_DIVIDER_ONE_BASED, NULL);
  988. static struct clk gfx_cg1_ck;
  989. static const char *gfx_cg1_ck_parent_names[] = {
  990. "gfx_l3_fck",
  991. };
  992. static struct clk_hw_omap gfx_cg1_ck_hw = {
  993. .hw = {
  994. .clk = &gfx_cg1_ck,
  995. },
  996. .ops = &clkhwops_wait,
  997. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  998. .enable_bit = OMAP3430ES1_EN_2D_SHIFT,
  999. .clkdm_name = "gfx_3430es1_clkdm",
  1000. };
  1001. DEFINE_STRUCT_CLK(gfx_cg1_ck, gfx_cg1_ck_parent_names, aes2_ick_ops);
  1002. static struct clk gfx_cg2_ck;
  1003. static struct clk_hw_omap gfx_cg2_ck_hw = {
  1004. .hw = {
  1005. .clk = &gfx_cg2_ck,
  1006. },
  1007. .ops = &clkhwops_wait,
  1008. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  1009. .enable_bit = OMAP3430ES1_EN_3D_SHIFT,
  1010. .clkdm_name = "gfx_3430es1_clkdm",
  1011. };
  1012. DEFINE_STRUCT_CLK(gfx_cg2_ck, gfx_cg1_ck_parent_names, aes2_ick_ops);
  1013. static struct clk gfx_l3_ick;
  1014. static const char *gfx_l3_ick_parent_names[] = {
  1015. "gfx_l3_ck",
  1016. };
  1017. DEFINE_STRUCT_CLK_HW_OMAP(gfx_l3_ick, "gfx_3430es1_clkdm");
  1018. DEFINE_STRUCT_CLK(gfx_l3_ick, gfx_l3_ick_parent_names, core_l4_ick_ops);
  1019. static struct clk wkup_32k_fck;
  1020. static const char *wkup_32k_fck_parent_names[] = {
  1021. "omap_32k_fck",
  1022. };
  1023. DEFINE_STRUCT_CLK_HW_OMAP(wkup_32k_fck, "wkup_clkdm");
  1024. DEFINE_STRUCT_CLK(wkup_32k_fck, wkup_32k_fck_parent_names, core_l4_ick_ops);
  1025. static struct clk gpio1_dbck;
  1026. static const char *gpio1_dbck_parent_names[] = {
  1027. "wkup_32k_fck",
  1028. };
  1029. static struct clk_hw_omap gpio1_dbck_hw = {
  1030. .hw = {
  1031. .clk = &gpio1_dbck,
  1032. },
  1033. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1034. .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
  1035. .clkdm_name = "wkup_clkdm",
  1036. };
  1037. DEFINE_STRUCT_CLK(gpio1_dbck, gpio1_dbck_parent_names, aes2_ick_ops);
  1038. static struct clk wkup_l4_ick;
  1039. DEFINE_STRUCT_CLK_HW_OMAP(wkup_l4_ick, "wkup_clkdm");
  1040. DEFINE_STRUCT_CLK(wkup_l4_ick, dpll3_ck_parent_names, core_l4_ick_ops);
  1041. static struct clk gpio1_ick;
  1042. static const char *gpio1_ick_parent_names[] = {
  1043. "wkup_l4_ick",
  1044. };
  1045. static struct clk_hw_omap gpio1_ick_hw = {
  1046. .hw = {
  1047. .clk = &gpio1_ick,
  1048. },
  1049. .ops = &clkhwops_iclk_wait,
  1050. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1051. .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
  1052. .clkdm_name = "wkup_clkdm",
  1053. };
  1054. DEFINE_STRUCT_CLK(gpio1_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1055. static struct clk per_32k_alwon_fck;
  1056. DEFINE_STRUCT_CLK_HW_OMAP(per_32k_alwon_fck, "per_clkdm");
  1057. DEFINE_STRUCT_CLK(per_32k_alwon_fck, wkup_32k_fck_parent_names,
  1058. core_l4_ick_ops);
  1059. static struct clk gpio2_dbck;
  1060. static const char *gpio2_dbck_parent_names[] = {
  1061. "per_32k_alwon_fck",
  1062. };
  1063. static struct clk_hw_omap gpio2_dbck_hw = {
  1064. .hw = {
  1065. .clk = &gpio2_dbck,
  1066. },
  1067. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1068. .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
  1069. .clkdm_name = "per_clkdm",
  1070. };
  1071. DEFINE_STRUCT_CLK(gpio2_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1072. static struct clk per_l4_ick;
  1073. DEFINE_STRUCT_CLK_HW_OMAP(per_l4_ick, "per_clkdm");
  1074. DEFINE_STRUCT_CLK(per_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  1075. static struct clk gpio2_ick;
  1076. static const char *gpio2_ick_parent_names[] = {
  1077. "per_l4_ick",
  1078. };
  1079. static struct clk_hw_omap gpio2_ick_hw = {
  1080. .hw = {
  1081. .clk = &gpio2_ick,
  1082. },
  1083. .ops = &clkhwops_iclk_wait,
  1084. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1085. .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
  1086. .clkdm_name = "per_clkdm",
  1087. };
  1088. DEFINE_STRUCT_CLK(gpio2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1089. static struct clk gpio3_dbck;
  1090. static struct clk_hw_omap gpio3_dbck_hw = {
  1091. .hw = {
  1092. .clk = &gpio3_dbck,
  1093. },
  1094. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1095. .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
  1096. .clkdm_name = "per_clkdm",
  1097. };
  1098. DEFINE_STRUCT_CLK(gpio3_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1099. static struct clk gpio3_ick;
  1100. static struct clk_hw_omap gpio3_ick_hw = {
  1101. .hw = {
  1102. .clk = &gpio3_ick,
  1103. },
  1104. .ops = &clkhwops_iclk_wait,
  1105. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1106. .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
  1107. .clkdm_name = "per_clkdm",
  1108. };
  1109. DEFINE_STRUCT_CLK(gpio3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1110. static struct clk gpio4_dbck;
  1111. static struct clk_hw_omap gpio4_dbck_hw = {
  1112. .hw = {
  1113. .clk = &gpio4_dbck,
  1114. },
  1115. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1116. .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
  1117. .clkdm_name = "per_clkdm",
  1118. };
  1119. DEFINE_STRUCT_CLK(gpio4_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1120. static struct clk gpio4_ick;
  1121. static struct clk_hw_omap gpio4_ick_hw = {
  1122. .hw = {
  1123. .clk = &gpio4_ick,
  1124. },
  1125. .ops = &clkhwops_iclk_wait,
  1126. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1127. .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
  1128. .clkdm_name = "per_clkdm",
  1129. };
  1130. DEFINE_STRUCT_CLK(gpio4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1131. static struct clk gpio5_dbck;
  1132. static struct clk_hw_omap gpio5_dbck_hw = {
  1133. .hw = {
  1134. .clk = &gpio5_dbck,
  1135. },
  1136. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1137. .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
  1138. .clkdm_name = "per_clkdm",
  1139. };
  1140. DEFINE_STRUCT_CLK(gpio5_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1141. static struct clk gpio5_ick;
  1142. static struct clk_hw_omap gpio5_ick_hw = {
  1143. .hw = {
  1144. .clk = &gpio5_ick,
  1145. },
  1146. .ops = &clkhwops_iclk_wait,
  1147. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1148. .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
  1149. .clkdm_name = "per_clkdm",
  1150. };
  1151. DEFINE_STRUCT_CLK(gpio5_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1152. static struct clk gpio6_dbck;
  1153. static struct clk_hw_omap gpio6_dbck_hw = {
  1154. .hw = {
  1155. .clk = &gpio6_dbck,
  1156. },
  1157. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1158. .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
  1159. .clkdm_name = "per_clkdm",
  1160. };
  1161. DEFINE_STRUCT_CLK(gpio6_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1162. static struct clk gpio6_ick;
  1163. static struct clk_hw_omap gpio6_ick_hw = {
  1164. .hw = {
  1165. .clk = &gpio6_ick,
  1166. },
  1167. .ops = &clkhwops_iclk_wait,
  1168. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1169. .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
  1170. .clkdm_name = "per_clkdm",
  1171. };
  1172. DEFINE_STRUCT_CLK(gpio6_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1173. static struct clk gpmc_fck;
  1174. static struct clk_hw_omap gpmc_fck_hw = {
  1175. .hw = {
  1176. .clk = &gpmc_fck,
  1177. },
  1178. .flags = ENABLE_ON_INIT,
  1179. .clkdm_name = "core_l3_clkdm",
  1180. };
  1181. DEFINE_STRUCT_CLK(gpmc_fck, ipss_ick_parent_names, core_l4_ick_ops);
  1182. static const struct clksel omap343x_gpt_clksel[] = {
  1183. { .parent = &omap_32k_fck, .rates = gpt_32k_rates },
  1184. { .parent = &sys_ck, .rates = gpt_sys_rates },
  1185. { .parent = NULL },
  1186. };
  1187. static const char *gpt10_fck_parent_names[] = {
  1188. "omap_32k_fck", "sys_ck",
  1189. };
  1190. DEFINE_CLK_OMAP_MUX_GATE(gpt10_fck, "core_l4_clkdm", omap343x_gpt_clksel,
  1191. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1192. OMAP3430_CLKSEL_GPT10_MASK,
  1193. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1194. OMAP3430_EN_GPT10_SHIFT, &clkhwops_wait,
  1195. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1196. static struct clk gpt10_ick;
  1197. static struct clk_hw_omap gpt10_ick_hw = {
  1198. .hw = {
  1199. .clk = &gpt10_ick,
  1200. },
  1201. .ops = &clkhwops_iclk_wait,
  1202. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1203. .enable_bit = OMAP3430_EN_GPT10_SHIFT,
  1204. .clkdm_name = "core_l4_clkdm",
  1205. };
  1206. DEFINE_STRUCT_CLK(gpt10_ick, aes2_ick_parent_names, aes2_ick_ops);
  1207. DEFINE_CLK_OMAP_MUX_GATE(gpt11_fck, "core_l4_clkdm", omap343x_gpt_clksel,
  1208. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1209. OMAP3430_CLKSEL_GPT11_MASK,
  1210. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1211. OMAP3430_EN_GPT11_SHIFT, &clkhwops_wait,
  1212. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1213. static struct clk gpt11_ick;
  1214. static struct clk_hw_omap gpt11_ick_hw = {
  1215. .hw = {
  1216. .clk = &gpt11_ick,
  1217. },
  1218. .ops = &clkhwops_iclk_wait,
  1219. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1220. .enable_bit = OMAP3430_EN_GPT11_SHIFT,
  1221. .clkdm_name = "core_l4_clkdm",
  1222. };
  1223. DEFINE_STRUCT_CLK(gpt11_ick, aes2_ick_parent_names, aes2_ick_ops);
  1224. static struct clk gpt12_fck;
  1225. static const char *gpt12_fck_parent_names[] = {
  1226. "secure_32k_fck",
  1227. };
  1228. DEFINE_STRUCT_CLK_HW_OMAP(gpt12_fck, "wkup_clkdm");
  1229. DEFINE_STRUCT_CLK(gpt12_fck, gpt12_fck_parent_names, core_l4_ick_ops);
  1230. static struct clk gpt12_ick;
  1231. static struct clk_hw_omap gpt12_ick_hw = {
  1232. .hw = {
  1233. .clk = &gpt12_ick,
  1234. },
  1235. .ops = &clkhwops_iclk_wait,
  1236. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1237. .enable_bit = OMAP3430_EN_GPT12_SHIFT,
  1238. .clkdm_name = "wkup_clkdm",
  1239. };
  1240. DEFINE_STRUCT_CLK(gpt12_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1241. DEFINE_CLK_OMAP_MUX_GATE(gpt1_fck, "wkup_clkdm", omap343x_gpt_clksel,
  1242. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
  1243. OMAP3430_CLKSEL_GPT1_MASK,
  1244. OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1245. OMAP3430_EN_GPT1_SHIFT, &clkhwops_wait,
  1246. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1247. static struct clk gpt1_ick;
  1248. static struct clk_hw_omap gpt1_ick_hw = {
  1249. .hw = {
  1250. .clk = &gpt1_ick,
  1251. },
  1252. .ops = &clkhwops_iclk_wait,
  1253. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1254. .enable_bit = OMAP3430_EN_GPT1_SHIFT,
  1255. .clkdm_name = "wkup_clkdm",
  1256. };
  1257. DEFINE_STRUCT_CLK(gpt1_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1258. DEFINE_CLK_OMAP_MUX_GATE(gpt2_fck, "per_clkdm", omap343x_gpt_clksel,
  1259. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1260. OMAP3430_CLKSEL_GPT2_MASK,
  1261. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1262. OMAP3430_EN_GPT2_SHIFT, &clkhwops_wait,
  1263. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1264. static struct clk gpt2_ick;
  1265. static struct clk_hw_omap gpt2_ick_hw = {
  1266. .hw = {
  1267. .clk = &gpt2_ick,
  1268. },
  1269. .ops = &clkhwops_iclk_wait,
  1270. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1271. .enable_bit = OMAP3430_EN_GPT2_SHIFT,
  1272. .clkdm_name = "per_clkdm",
  1273. };
  1274. DEFINE_STRUCT_CLK(gpt2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1275. DEFINE_CLK_OMAP_MUX_GATE(gpt3_fck, "per_clkdm", omap343x_gpt_clksel,
  1276. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1277. OMAP3430_CLKSEL_GPT3_MASK,
  1278. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1279. OMAP3430_EN_GPT3_SHIFT, &clkhwops_wait,
  1280. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1281. static struct clk gpt3_ick;
  1282. static struct clk_hw_omap gpt3_ick_hw = {
  1283. .hw = {
  1284. .clk = &gpt3_ick,
  1285. },
  1286. .ops = &clkhwops_iclk_wait,
  1287. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1288. .enable_bit = OMAP3430_EN_GPT3_SHIFT,
  1289. .clkdm_name = "per_clkdm",
  1290. };
  1291. DEFINE_STRUCT_CLK(gpt3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1292. DEFINE_CLK_OMAP_MUX_GATE(gpt4_fck, "per_clkdm", omap343x_gpt_clksel,
  1293. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1294. OMAP3430_CLKSEL_GPT4_MASK,
  1295. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1296. OMAP3430_EN_GPT4_SHIFT, &clkhwops_wait,
  1297. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1298. static struct clk gpt4_ick;
  1299. static struct clk_hw_omap gpt4_ick_hw = {
  1300. .hw = {
  1301. .clk = &gpt4_ick,
  1302. },
  1303. .ops = &clkhwops_iclk_wait,
  1304. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1305. .enable_bit = OMAP3430_EN_GPT4_SHIFT,
  1306. .clkdm_name = "per_clkdm",
  1307. };
  1308. DEFINE_STRUCT_CLK(gpt4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1309. DEFINE_CLK_OMAP_MUX_GATE(gpt5_fck, "per_clkdm", omap343x_gpt_clksel,
  1310. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1311. OMAP3430_CLKSEL_GPT5_MASK,
  1312. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1313. OMAP3430_EN_GPT5_SHIFT, &clkhwops_wait,
  1314. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1315. static struct clk gpt5_ick;
  1316. static struct clk_hw_omap gpt5_ick_hw = {
  1317. .hw = {
  1318. .clk = &gpt5_ick,
  1319. },
  1320. .ops = &clkhwops_iclk_wait,
  1321. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1322. .enable_bit = OMAP3430_EN_GPT5_SHIFT,
  1323. .clkdm_name = "per_clkdm",
  1324. };
  1325. DEFINE_STRUCT_CLK(gpt5_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1326. DEFINE_CLK_OMAP_MUX_GATE(gpt6_fck, "per_clkdm", omap343x_gpt_clksel,
  1327. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1328. OMAP3430_CLKSEL_GPT6_MASK,
  1329. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1330. OMAP3430_EN_GPT6_SHIFT, &clkhwops_wait,
  1331. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1332. static struct clk gpt6_ick;
  1333. static struct clk_hw_omap gpt6_ick_hw = {
  1334. .hw = {
  1335. .clk = &gpt6_ick,
  1336. },
  1337. .ops = &clkhwops_iclk_wait,
  1338. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1339. .enable_bit = OMAP3430_EN_GPT6_SHIFT,
  1340. .clkdm_name = "per_clkdm",
  1341. };
  1342. DEFINE_STRUCT_CLK(gpt6_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1343. DEFINE_CLK_OMAP_MUX_GATE(gpt7_fck, "per_clkdm", omap343x_gpt_clksel,
  1344. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1345. OMAP3430_CLKSEL_GPT7_MASK,
  1346. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1347. OMAP3430_EN_GPT7_SHIFT, &clkhwops_wait,
  1348. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1349. static struct clk gpt7_ick;
  1350. static struct clk_hw_omap gpt7_ick_hw = {
  1351. .hw = {
  1352. .clk = &gpt7_ick,
  1353. },
  1354. .ops = &clkhwops_iclk_wait,
  1355. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1356. .enable_bit = OMAP3430_EN_GPT7_SHIFT,
  1357. .clkdm_name = "per_clkdm",
  1358. };
  1359. DEFINE_STRUCT_CLK(gpt7_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1360. DEFINE_CLK_OMAP_MUX_GATE(gpt8_fck, "per_clkdm", omap343x_gpt_clksel,
  1361. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1362. OMAP3430_CLKSEL_GPT8_MASK,
  1363. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1364. OMAP3430_EN_GPT8_SHIFT, &clkhwops_wait,
  1365. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1366. static struct clk gpt8_ick;
  1367. static struct clk_hw_omap gpt8_ick_hw = {
  1368. .hw = {
  1369. .clk = &gpt8_ick,
  1370. },
  1371. .ops = &clkhwops_iclk_wait,
  1372. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1373. .enable_bit = OMAP3430_EN_GPT8_SHIFT,
  1374. .clkdm_name = "per_clkdm",
  1375. };
  1376. DEFINE_STRUCT_CLK(gpt8_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1377. DEFINE_CLK_OMAP_MUX_GATE(gpt9_fck, "per_clkdm", omap343x_gpt_clksel,
  1378. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1379. OMAP3430_CLKSEL_GPT9_MASK,
  1380. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1381. OMAP3430_EN_GPT9_SHIFT, &clkhwops_wait,
  1382. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1383. static struct clk gpt9_ick;
  1384. static struct clk_hw_omap gpt9_ick_hw = {
  1385. .hw = {
  1386. .clk = &gpt9_ick,
  1387. },
  1388. .ops = &clkhwops_iclk_wait,
  1389. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1390. .enable_bit = OMAP3430_EN_GPT9_SHIFT,
  1391. .clkdm_name = "per_clkdm",
  1392. };
  1393. DEFINE_STRUCT_CLK(gpt9_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1394. static struct clk hdq_fck;
  1395. static const char *hdq_fck_parent_names[] = {
  1396. "core_12m_fck",
  1397. };
  1398. static struct clk_hw_omap hdq_fck_hw = {
  1399. .hw = {
  1400. .clk = &hdq_fck,
  1401. },
  1402. .ops = &clkhwops_wait,
  1403. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1404. .enable_bit = OMAP3430_EN_HDQ_SHIFT,
  1405. .clkdm_name = "core_l4_clkdm",
  1406. };
  1407. DEFINE_STRUCT_CLK(hdq_fck, hdq_fck_parent_names, aes2_ick_ops);
  1408. static struct clk hdq_ick;
  1409. static struct clk_hw_omap hdq_ick_hw = {
  1410. .hw = {
  1411. .clk = &hdq_ick,
  1412. },
  1413. .ops = &clkhwops_iclk_wait,
  1414. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1415. .enable_bit = OMAP3430_EN_HDQ_SHIFT,
  1416. .clkdm_name = "core_l4_clkdm",
  1417. };
  1418. DEFINE_STRUCT_CLK(hdq_ick, aes2_ick_parent_names, aes2_ick_ops);
  1419. static struct clk hecc_ck;
  1420. static struct clk_hw_omap hecc_ck_hw = {
  1421. .hw = {
  1422. .clk = &hecc_ck,
  1423. },
  1424. .ops = &clkhwops_am35xx_ipss_module_wait,
  1425. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  1426. .enable_bit = AM35XX_HECC_VBUSP_CLK_SHIFT,
  1427. .clkdm_name = "core_l3_clkdm",
  1428. };
  1429. DEFINE_STRUCT_CLK(hecc_ck, dpll3_ck_parent_names, aes2_ick_ops);
  1430. static struct clk hsotgusb_fck_am35xx;
  1431. static struct clk_hw_omap hsotgusb_fck_am35xx_hw = {
  1432. .hw = {
  1433. .clk = &hsotgusb_fck_am35xx,
  1434. },
  1435. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  1436. .enable_bit = AM35XX_USBOTG_FCLK_SHIFT,
  1437. .clkdm_name = "core_l3_clkdm",
  1438. };
  1439. DEFINE_STRUCT_CLK(hsotgusb_fck_am35xx, dpll3_ck_parent_names, aes2_ick_ops);
  1440. static struct clk hsotgusb_ick_3430es1;
  1441. static struct clk_hw_omap hsotgusb_ick_3430es1_hw = {
  1442. .hw = {
  1443. .clk = &hsotgusb_ick_3430es1,
  1444. },
  1445. .ops = &clkhwops_iclk,
  1446. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1447. .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
  1448. .clkdm_name = "core_l3_clkdm",
  1449. };
  1450. DEFINE_STRUCT_CLK(hsotgusb_ick_3430es1, ipss_ick_parent_names, aes2_ick_ops);
  1451. static struct clk hsotgusb_ick_3430es2;
  1452. static struct clk_hw_omap hsotgusb_ick_3430es2_hw = {
  1453. .hw = {
  1454. .clk = &hsotgusb_ick_3430es2,
  1455. },
  1456. .ops = &clkhwops_omap3430es2_iclk_hsotgusb_wait,
  1457. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1458. .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
  1459. .clkdm_name = "core_l3_clkdm",
  1460. };
  1461. DEFINE_STRUCT_CLK(hsotgusb_ick_3430es2, ipss_ick_parent_names, aes2_ick_ops);
  1462. static struct clk hsotgusb_ick_am35xx;
  1463. static struct clk_hw_omap hsotgusb_ick_am35xx_hw = {
  1464. .hw = {
  1465. .clk = &hsotgusb_ick_am35xx,
  1466. },
  1467. .ops = &clkhwops_am35xx_ipss_module_wait,
  1468. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  1469. .enable_bit = AM35XX_USBOTG_VBUSP_CLK_SHIFT,
  1470. .clkdm_name = "core_l3_clkdm",
  1471. };
  1472. DEFINE_STRUCT_CLK(hsotgusb_ick_am35xx, emac_ick_parent_names, aes2_ick_ops);
  1473. static struct clk i2c1_fck;
  1474. static struct clk_hw_omap i2c1_fck_hw = {
  1475. .hw = {
  1476. .clk = &i2c1_fck,
  1477. },
  1478. .ops = &clkhwops_wait,
  1479. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1480. .enable_bit = OMAP3430_EN_I2C1_SHIFT,
  1481. .clkdm_name = "core_l4_clkdm",
  1482. };
  1483. DEFINE_STRUCT_CLK(i2c1_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1484. static struct clk i2c1_ick;
  1485. static struct clk_hw_omap i2c1_ick_hw = {
  1486. .hw = {
  1487. .clk = &i2c1_ick,
  1488. },
  1489. .ops = &clkhwops_iclk_wait,
  1490. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1491. .enable_bit = OMAP3430_EN_I2C1_SHIFT,
  1492. .clkdm_name = "core_l4_clkdm",
  1493. };
  1494. DEFINE_STRUCT_CLK(i2c1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1495. static struct clk i2c2_fck;
  1496. static struct clk_hw_omap i2c2_fck_hw = {
  1497. .hw = {
  1498. .clk = &i2c2_fck,
  1499. },
  1500. .ops = &clkhwops_wait,
  1501. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1502. .enable_bit = OMAP3430_EN_I2C2_SHIFT,
  1503. .clkdm_name = "core_l4_clkdm",
  1504. };
  1505. DEFINE_STRUCT_CLK(i2c2_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1506. static struct clk i2c2_ick;
  1507. static struct clk_hw_omap i2c2_ick_hw = {
  1508. .hw = {
  1509. .clk = &i2c2_ick,
  1510. },
  1511. .ops = &clkhwops_iclk_wait,
  1512. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1513. .enable_bit = OMAP3430_EN_I2C2_SHIFT,
  1514. .clkdm_name = "core_l4_clkdm",
  1515. };
  1516. DEFINE_STRUCT_CLK(i2c2_ick, aes2_ick_parent_names, aes2_ick_ops);
  1517. static struct clk i2c3_fck;
  1518. static struct clk_hw_omap i2c3_fck_hw = {
  1519. .hw = {
  1520. .clk = &i2c3_fck,
  1521. },
  1522. .ops = &clkhwops_wait,
  1523. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1524. .enable_bit = OMAP3430_EN_I2C3_SHIFT,
  1525. .clkdm_name = "core_l4_clkdm",
  1526. };
  1527. DEFINE_STRUCT_CLK(i2c3_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1528. static struct clk i2c3_ick;
  1529. static struct clk_hw_omap i2c3_ick_hw = {
  1530. .hw = {
  1531. .clk = &i2c3_ick,
  1532. },
  1533. .ops = &clkhwops_iclk_wait,
  1534. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1535. .enable_bit = OMAP3430_EN_I2C3_SHIFT,
  1536. .clkdm_name = "core_l4_clkdm",
  1537. };
  1538. DEFINE_STRUCT_CLK(i2c3_ick, aes2_ick_parent_names, aes2_ick_ops);
  1539. static struct clk icr_ick;
  1540. static struct clk_hw_omap icr_ick_hw = {
  1541. .hw = {
  1542. .clk = &icr_ick,
  1543. },
  1544. .ops = &clkhwops_iclk_wait,
  1545. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1546. .enable_bit = OMAP3430_EN_ICR_SHIFT,
  1547. .clkdm_name = "core_l4_clkdm",
  1548. };
  1549. DEFINE_STRUCT_CLK(icr_ick, aes2_ick_parent_names, aes2_ick_ops);
  1550. static struct clk iva2_ck;
  1551. static const char *iva2_ck_parent_names[] = {
  1552. "dpll2_m2_ck",
  1553. };
  1554. static struct clk_hw_omap iva2_ck_hw = {
  1555. .hw = {
  1556. .clk = &iva2_ck,
  1557. },
  1558. .ops = &clkhwops_wait,
  1559. .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN),
  1560. .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
  1561. .clkdm_name = "iva2_clkdm",
  1562. };
  1563. DEFINE_STRUCT_CLK(iva2_ck, iva2_ck_parent_names, aes2_ick_ops);
  1564. static struct clk mad2d_ick;
  1565. static struct clk_hw_omap mad2d_ick_hw = {
  1566. .hw = {
  1567. .clk = &mad2d_ick,
  1568. },
  1569. .ops = &clkhwops_iclk_wait,
  1570. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  1571. .enable_bit = OMAP3430_EN_MAD2D_SHIFT,
  1572. .clkdm_name = "d2d_clkdm",
  1573. };
  1574. DEFINE_STRUCT_CLK(mad2d_ick, core_l3_ick_parent_names, aes2_ick_ops);
  1575. static struct clk mailboxes_ick;
  1576. static struct clk_hw_omap mailboxes_ick_hw = {
  1577. .hw = {
  1578. .clk = &mailboxes_ick,
  1579. },
  1580. .ops = &clkhwops_iclk_wait,
  1581. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1582. .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT,
  1583. .clkdm_name = "core_l4_clkdm",
  1584. };
  1585. DEFINE_STRUCT_CLK(mailboxes_ick, aes2_ick_parent_names, aes2_ick_ops);
  1586. static const struct clksel_rate common_mcbsp_96m_rates[] = {
  1587. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  1588. { .div = 0 }
  1589. };
  1590. static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
  1591. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  1592. { .div = 0 }
  1593. };
  1594. static const struct clksel mcbsp_15_clksel[] = {
  1595. { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
  1596. { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
  1597. { .parent = NULL },
  1598. };
  1599. static const char *mcbsp1_fck_parent_names[] = {
  1600. "core_96m_fck", "mcbsp_clks",
  1601. };
  1602. DEFINE_CLK_OMAP_MUX_GATE(mcbsp1_fck, "core_l4_clkdm", mcbsp_15_clksel,
  1603. OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  1604. OMAP2_MCBSP1_CLKS_MASK,
  1605. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1606. OMAP3430_EN_MCBSP1_SHIFT, &clkhwops_wait,
  1607. mcbsp1_fck_parent_names, clkout2_src_ck_ops);
  1608. static struct clk mcbsp1_ick;
  1609. static struct clk_hw_omap mcbsp1_ick_hw = {
  1610. .hw = {
  1611. .clk = &mcbsp1_ick,
  1612. },
  1613. .ops = &clkhwops_iclk_wait,
  1614. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1615. .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
  1616. .clkdm_name = "core_l4_clkdm",
  1617. };
  1618. DEFINE_STRUCT_CLK(mcbsp1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1619. static struct clk per_96m_fck;
  1620. DEFINE_STRUCT_CLK_HW_OMAP(per_96m_fck, "per_clkdm");
  1621. DEFINE_STRUCT_CLK(per_96m_fck, cm_96m_fck_parent_names, core_l4_ick_ops);
  1622. static const struct clksel mcbsp_234_clksel[] = {
  1623. { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates },
  1624. { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
  1625. { .parent = NULL },
  1626. };
  1627. static const char *mcbsp2_fck_parent_names[] = {
  1628. "per_96m_fck", "mcbsp_clks",
  1629. };
  1630. DEFINE_CLK_OMAP_MUX_GATE(mcbsp2_fck, "per_clkdm", mcbsp_234_clksel,
  1631. OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  1632. OMAP2_MCBSP2_CLKS_MASK,
  1633. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1634. OMAP3430_EN_MCBSP2_SHIFT, &clkhwops_wait,
  1635. mcbsp2_fck_parent_names, clkout2_src_ck_ops);
  1636. static struct clk mcbsp2_ick;
  1637. static struct clk_hw_omap mcbsp2_ick_hw = {
  1638. .hw = {
  1639. .clk = &mcbsp2_ick,
  1640. },
  1641. .ops = &clkhwops_iclk_wait,
  1642. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1643. .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
  1644. .clkdm_name = "per_clkdm",
  1645. };
  1646. DEFINE_STRUCT_CLK(mcbsp2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1647. DEFINE_CLK_OMAP_MUX_GATE(mcbsp3_fck, "per_clkdm", mcbsp_234_clksel,
  1648. OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
  1649. OMAP2_MCBSP3_CLKS_MASK,
  1650. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1651. OMAP3430_EN_MCBSP3_SHIFT, &clkhwops_wait,
  1652. mcbsp2_fck_parent_names, clkout2_src_ck_ops);
  1653. static struct clk mcbsp3_ick;
  1654. static struct clk_hw_omap mcbsp3_ick_hw = {
  1655. .hw = {
  1656. .clk = &mcbsp3_ick,
  1657. },
  1658. .ops = &clkhwops_iclk_wait,
  1659. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1660. .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
  1661. .clkdm_name = "per_clkdm",
  1662. };
  1663. DEFINE_STRUCT_CLK(mcbsp3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1664. DEFINE_CLK_OMAP_MUX_GATE(mcbsp4_fck, "per_clkdm", mcbsp_234_clksel,
  1665. OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
  1666. OMAP2_MCBSP4_CLKS_MASK,
  1667. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1668. OMAP3430_EN_MCBSP4_SHIFT, &clkhwops_wait,
  1669. mcbsp2_fck_parent_names, clkout2_src_ck_ops);
  1670. static struct clk mcbsp4_ick;
  1671. static struct clk_hw_omap mcbsp4_ick_hw = {
  1672. .hw = {
  1673. .clk = &mcbsp4_ick,
  1674. },
  1675. .ops = &clkhwops_iclk_wait,
  1676. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1677. .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
  1678. .clkdm_name = "per_clkdm",
  1679. };
  1680. DEFINE_STRUCT_CLK(mcbsp4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1681. DEFINE_CLK_OMAP_MUX_GATE(mcbsp5_fck, "core_l4_clkdm", mcbsp_15_clksel,
  1682. OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
  1683. OMAP2_MCBSP5_CLKS_MASK,
  1684. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1685. OMAP3430_EN_MCBSP5_SHIFT, &clkhwops_wait,
  1686. mcbsp1_fck_parent_names, clkout2_src_ck_ops);
  1687. static struct clk mcbsp5_ick;
  1688. static struct clk_hw_omap mcbsp5_ick_hw = {
  1689. .hw = {
  1690. .clk = &mcbsp5_ick,
  1691. },
  1692. .ops = &clkhwops_iclk_wait,
  1693. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1694. .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
  1695. .clkdm_name = "core_l4_clkdm",
  1696. };
  1697. DEFINE_STRUCT_CLK(mcbsp5_ick, aes2_ick_parent_names, aes2_ick_ops);
  1698. static struct clk mcspi1_fck;
  1699. static struct clk_hw_omap mcspi1_fck_hw = {
  1700. .hw = {
  1701. .clk = &mcspi1_fck,
  1702. },
  1703. .ops = &clkhwops_wait,
  1704. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1705. .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
  1706. .clkdm_name = "core_l4_clkdm",
  1707. };
  1708. DEFINE_STRUCT_CLK(mcspi1_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1709. static struct clk mcspi1_ick;
  1710. static struct clk_hw_omap mcspi1_ick_hw = {
  1711. .hw = {
  1712. .clk = &mcspi1_ick,
  1713. },
  1714. .ops = &clkhwops_iclk_wait,
  1715. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1716. .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
  1717. .clkdm_name = "core_l4_clkdm",
  1718. };
  1719. DEFINE_STRUCT_CLK(mcspi1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1720. static struct clk mcspi2_fck;
  1721. static struct clk_hw_omap mcspi2_fck_hw = {
  1722. .hw = {
  1723. .clk = &mcspi2_fck,
  1724. },
  1725. .ops = &clkhwops_wait,
  1726. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1727. .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
  1728. .clkdm_name = "core_l4_clkdm",
  1729. };
  1730. DEFINE_STRUCT_CLK(mcspi2_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1731. static struct clk mcspi2_ick;
  1732. static struct clk_hw_omap mcspi2_ick_hw = {
  1733. .hw = {
  1734. .clk = &mcspi2_ick,
  1735. },
  1736. .ops = &clkhwops_iclk_wait,
  1737. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1738. .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
  1739. .clkdm_name = "core_l4_clkdm",
  1740. };
  1741. DEFINE_STRUCT_CLK(mcspi2_ick, aes2_ick_parent_names, aes2_ick_ops);
  1742. static struct clk mcspi3_fck;
  1743. static struct clk_hw_omap mcspi3_fck_hw = {
  1744. .hw = {
  1745. .clk = &mcspi3_fck,
  1746. },
  1747. .ops = &clkhwops_wait,
  1748. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1749. .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
  1750. .clkdm_name = "core_l4_clkdm",
  1751. };
  1752. DEFINE_STRUCT_CLK(mcspi3_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1753. static struct clk mcspi3_ick;
  1754. static struct clk_hw_omap mcspi3_ick_hw = {
  1755. .hw = {
  1756. .clk = &mcspi3_ick,
  1757. },
  1758. .ops = &clkhwops_iclk_wait,
  1759. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1760. .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
  1761. .clkdm_name = "core_l4_clkdm",
  1762. };
  1763. DEFINE_STRUCT_CLK(mcspi3_ick, aes2_ick_parent_names, aes2_ick_ops);
  1764. static struct clk mcspi4_fck;
  1765. static struct clk_hw_omap mcspi4_fck_hw = {
  1766. .hw = {
  1767. .clk = &mcspi4_fck,
  1768. },
  1769. .ops = &clkhwops_wait,
  1770. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1771. .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
  1772. .clkdm_name = "core_l4_clkdm",
  1773. };
  1774. DEFINE_STRUCT_CLK(mcspi4_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1775. static struct clk mcspi4_ick;