cclock3xxx_data.c 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681
  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. static const struct clk_div_table dpll4_mx_ck_div_table[] = {
  311. { .div = 1, .val = 1 },
  312. { .div = 2, .val = 2 },
  313. { .div = 3, .val = 3 },
  314. { .div = 4, .val = 4 },
  315. { .div = 5, .val = 5 },
  316. { .div = 6, .val = 6 },
  317. { .div = 7, .val = 7 },
  318. { .div = 8, .val = 8 },
  319. { .div = 9, .val = 9 },
  320. { .div = 10, .val = 10 },
  321. { .div = 11, .val = 11 },
  322. { .div = 12, .val = 12 },
  323. { .div = 13, .val = 13 },
  324. { .div = 14, .val = 14 },
  325. { .div = 15, .val = 15 },
  326. { .div = 16, .val = 16 },
  327. { .div = 17, .val = 17 },
  328. { .div = 18, .val = 18 },
  329. { .div = 19, .val = 19 },
  330. { .div = 20, .val = 20 },
  331. { .div = 21, .val = 21 },
  332. { .div = 22, .val = 22 },
  333. { .div = 23, .val = 23 },
  334. { .div = 24, .val = 24 },
  335. { .div = 25, .val = 25 },
  336. { .div = 26, .val = 26 },
  337. { .div = 27, .val = 27 },
  338. { .div = 28, .val = 28 },
  339. { .div = 29, .val = 29 },
  340. { .div = 30, .val = 30 },
  341. { .div = 31, .val = 31 },
  342. { .div = 32, .val = 32 },
  343. { .div = 0 },
  344. };
  345. DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0,
  346. OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
  347. OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH,
  348. CLK_DIVIDER_ONE_BASED, NULL);
  349. static struct clk dpll4_m5x2_ck;
  350. static const char *dpll4_m5x2_ck_parent_names[] = {
  351. "dpll4_m5_ck",
  352. };
  353. static const struct clk_ops dpll4_m5x2_ck_ops = {
  354. .init = &omap2_init_clk_clkdm,
  355. .enable = &omap2_dflt_clk_enable,
  356. .disable = &omap2_dflt_clk_disable,
  357. .is_enabled = &omap2_dflt_clk_is_enabled,
  358. .set_rate = &omap3_clkoutx2_set_rate,
  359. .recalc_rate = &omap3_clkoutx2_recalc,
  360. .round_rate = &omap3_clkoutx2_round_rate,
  361. };
  362. static const struct clk_ops dpll4_m5x2_ck_3630_ops = {
  363. .init = &omap2_init_clk_clkdm,
  364. .enable = &omap36xx_pwrdn_clk_enable_with_hsdiv_restore,
  365. .disable = &omap2_dflt_clk_disable,
  366. .recalc_rate = &omap3_clkoutx2_recalc,
  367. };
  368. static struct clk_hw_omap dpll4_m5x2_ck_hw = {
  369. .hw = {
  370. .clk = &dpll4_m5x2_ck,
  371. },
  372. .ops = &clkhwops_wait,
  373. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  374. .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
  375. .flags = INVERT_ENABLE,
  376. .clkdm_name = "dpll4_clkdm",
  377. };
  378. DEFINE_STRUCT_CLK_FLAGS(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names,
  379. dpll4_m5x2_ck_ops, CLK_SET_RATE_PARENT);
  380. static struct clk dpll4_m5x2_ck_3630 = {
  381. .name = "dpll4_m5x2_ck",
  382. .hw = &dpll4_m5x2_ck_hw.hw,
  383. .parent_names = dpll4_m5x2_ck_parent_names,
  384. .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names),
  385. .ops = &dpll4_m5x2_ck_3630_ops,
  386. .flags = CLK_SET_RATE_PARENT,
  387. };
  388. static struct clk cam_mclk;
  389. static const char *cam_mclk_parent_names[] = {
  390. "dpll4_m5x2_ck",
  391. };
  392. static struct clk_hw_omap cam_mclk_hw = {
  393. .hw = {
  394. .clk = &cam_mclk,
  395. },
  396. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  397. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  398. .clkdm_name = "cam_clkdm",
  399. };
  400. static struct clk cam_mclk = {
  401. .name = "cam_mclk",
  402. .hw = &cam_mclk_hw.hw,
  403. .parent_names = cam_mclk_parent_names,
  404. .num_parents = ARRAY_SIZE(cam_mclk_parent_names),
  405. .ops = &aes2_ick_ops,
  406. .flags = CLK_SET_RATE_PARENT,
  407. };
  408. static const struct clksel_rate clkout2_src_core_rates[] = {
  409. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  410. { .div = 0 }
  411. };
  412. static const struct clksel_rate clkout2_src_sys_rates[] = {
  413. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  414. { .div = 0 }
  415. };
  416. static const struct clksel_rate clkout2_src_96m_rates[] = {
  417. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  418. { .div = 0 }
  419. };
  420. DEFINE_CLK_DIVIDER(dpll4_m2_ck, "dpll4_ck", &dpll4_ck, 0x0,
  421. OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
  422. OMAP3430_DIV_96M_SHIFT, OMAP3630_DIV_96M_WIDTH,
  423. CLK_DIVIDER_ONE_BASED, NULL);
  424. static struct clk dpll4_m2x2_ck;
  425. static const char *dpll4_m2x2_ck_parent_names[] = {
  426. "dpll4_m2_ck",
  427. };
  428. static struct clk_hw_omap dpll4_m2x2_ck_hw = {
  429. .hw = {
  430. .clk = &dpll4_m2x2_ck,
  431. },
  432. .ops = &clkhwops_wait,
  433. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  434. .enable_bit = OMAP3430_PWRDN_96M_SHIFT,
  435. .flags = INVERT_ENABLE,
  436. .clkdm_name = "dpll4_clkdm",
  437. };
  438. DEFINE_STRUCT_CLK(dpll4_m2x2_ck, dpll4_m2x2_ck_parent_names, dpll4_m5x2_ck_ops);
  439. static struct clk dpll4_m2x2_ck_3630 = {
  440. .name = "dpll4_m2x2_ck",
  441. .hw = &dpll4_m2x2_ck_hw.hw,
  442. .parent_names = dpll4_m2x2_ck_parent_names,
  443. .num_parents = ARRAY_SIZE(dpll4_m2x2_ck_parent_names),
  444. .ops = &dpll4_m5x2_ck_3630_ops,
  445. };
  446. static struct clk omap_96m_alwon_fck;
  447. static const char *omap_96m_alwon_fck_parent_names[] = {
  448. "dpll4_m2x2_ck",
  449. };
  450. DEFINE_STRUCT_CLK_HW_OMAP(omap_96m_alwon_fck, NULL);
  451. DEFINE_STRUCT_CLK(omap_96m_alwon_fck, omap_96m_alwon_fck_parent_names,
  452. core_ck_ops);
  453. static struct clk cm_96m_fck;
  454. static const char *cm_96m_fck_parent_names[] = {
  455. "omap_96m_alwon_fck",
  456. };
  457. DEFINE_STRUCT_CLK_HW_OMAP(cm_96m_fck, NULL);
  458. DEFINE_STRUCT_CLK(cm_96m_fck, cm_96m_fck_parent_names, core_ck_ops);
  459. static const struct clksel_rate clkout2_src_54m_rates[] = {
  460. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  461. { .div = 0 }
  462. };
  463. DEFINE_CLK_DIVIDER_TABLE(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0,
  464. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  465. OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH,
  466. 0, dpll4_mx_ck_div_table, NULL);
  467. static struct clk dpll4_m3x2_ck;
  468. static const char *dpll4_m3x2_ck_parent_names[] = {
  469. "dpll4_m3_ck",
  470. };
  471. static struct clk_hw_omap dpll4_m3x2_ck_hw = {
  472. .hw = {
  473. .clk = &dpll4_m3x2_ck,
  474. },
  475. .ops = &clkhwops_wait,
  476. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  477. .enable_bit = OMAP3430_PWRDN_TV_SHIFT,
  478. .flags = INVERT_ENABLE,
  479. .clkdm_name = "dpll4_clkdm",
  480. };
  481. DEFINE_STRUCT_CLK(dpll4_m3x2_ck, dpll4_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  482. static struct clk dpll4_m3x2_ck_3630 = {
  483. .name = "dpll4_m3x2_ck",
  484. .hw = &dpll4_m3x2_ck_hw.hw,
  485. .parent_names = dpll4_m3x2_ck_parent_names,
  486. .num_parents = ARRAY_SIZE(dpll4_m3x2_ck_parent_names),
  487. .ops = &dpll4_m5x2_ck_3630_ops,
  488. };
  489. static const char *omap_54m_fck_parent_names[] = {
  490. "dpll4_m3x2_ck", "sys_altclk",
  491. };
  492. DEFINE_CLK_MUX(omap_54m_fck, omap_54m_fck_parent_names, NULL, 0x0,
  493. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), OMAP3430_SOURCE_54M_SHIFT,
  494. OMAP3430_SOURCE_54M_WIDTH, 0x0, NULL);
  495. static const struct clksel clkout2_src_clksel[] = {
  496. { .parent = &core_ck, .rates = clkout2_src_core_rates },
  497. { .parent = &sys_ck, .rates = clkout2_src_sys_rates },
  498. { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates },
  499. { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates },
  500. { .parent = NULL },
  501. };
  502. static const char *clkout2_src_ck_parent_names[] = {
  503. "core_ck", "sys_ck", "cm_96m_fck", "omap_54m_fck",
  504. };
  505. static const struct clk_ops clkout2_src_ck_ops = {
  506. .init = &omap2_init_clk_clkdm,
  507. .enable = &omap2_dflt_clk_enable,
  508. .disable = &omap2_dflt_clk_disable,
  509. .is_enabled = &omap2_dflt_clk_is_enabled,
  510. .recalc_rate = &omap2_clksel_recalc,
  511. .get_parent = &omap2_clksel_find_parent_index,
  512. .set_parent = &omap2_clksel_set_parent,
  513. };
  514. DEFINE_CLK_OMAP_MUX_GATE(clkout2_src_ck, "core_clkdm",
  515. clkout2_src_clksel, OMAP3430_CM_CLKOUT_CTRL,
  516. OMAP3430_CLKOUT2SOURCE_MASK,
  517. OMAP3430_CM_CLKOUT_CTRL, OMAP3430_CLKOUT2_EN_SHIFT,
  518. NULL, clkout2_src_ck_parent_names, clkout2_src_ck_ops);
  519. static const struct clksel_rate omap_48m_cm96m_rates[] = {
  520. { .div = 2, .val = 0, .flags = RATE_IN_3XXX },
  521. { .div = 0 }
  522. };
  523. static const struct clksel_rate omap_48m_alt_rates[] = {
  524. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  525. { .div = 0 }
  526. };
  527. static const struct clksel omap_48m_clksel[] = {
  528. { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
  529. { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
  530. { .parent = NULL },
  531. };
  532. static const char *omap_48m_fck_parent_names[] = {
  533. "cm_96m_fck", "sys_altclk",
  534. };
  535. static struct clk omap_48m_fck;
  536. static const struct clk_ops omap_48m_fck_ops = {
  537. .recalc_rate = &omap2_clksel_recalc,
  538. .get_parent = &omap2_clksel_find_parent_index,
  539. .set_parent = &omap2_clksel_set_parent,
  540. };
  541. static struct clk_hw_omap omap_48m_fck_hw = {
  542. .hw = {
  543. .clk = &omap_48m_fck,
  544. },
  545. .clksel = omap_48m_clksel,
  546. .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  547. .clksel_mask = OMAP3430_SOURCE_48M_MASK,
  548. };
  549. DEFINE_STRUCT_CLK(omap_48m_fck, omap_48m_fck_parent_names, omap_48m_fck_ops);
  550. DEFINE_CLK_FIXED_FACTOR(omap_12m_fck, "omap_48m_fck", &omap_48m_fck, 0x0, 1, 4);
  551. static struct clk core_12m_fck;
  552. static const char *core_12m_fck_parent_names[] = {
  553. "omap_12m_fck",
  554. };
  555. DEFINE_STRUCT_CLK_HW_OMAP(core_12m_fck, "core_l4_clkdm");
  556. DEFINE_STRUCT_CLK(core_12m_fck, core_12m_fck_parent_names, core_l4_ick_ops);
  557. static struct clk core_48m_fck;
  558. static const char *core_48m_fck_parent_names[] = {
  559. "omap_48m_fck",
  560. };
  561. DEFINE_STRUCT_CLK_HW_OMAP(core_48m_fck, "core_l4_clkdm");
  562. DEFINE_STRUCT_CLK(core_48m_fck, core_48m_fck_parent_names, core_l4_ick_ops);
  563. static const char *omap_96m_fck_parent_names[] = {
  564. "cm_96m_fck", "sys_ck",
  565. };
  566. DEFINE_CLK_MUX(omap_96m_fck, omap_96m_fck_parent_names, NULL, 0x0,
  567. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  568. OMAP3430_SOURCE_96M_SHIFT, OMAP3430_SOURCE_96M_WIDTH, 0x0, NULL);
  569. static struct clk core_96m_fck;
  570. static const char *core_96m_fck_parent_names[] = {
  571. "omap_96m_fck",
  572. };
  573. DEFINE_STRUCT_CLK_HW_OMAP(core_96m_fck, "core_l4_clkdm");
  574. DEFINE_STRUCT_CLK(core_96m_fck, core_96m_fck_parent_names, core_l4_ick_ops);
  575. static struct clk core_l3_ick;
  576. static const char *core_l3_ick_parent_names[] = {
  577. "l3_ick",
  578. };
  579. DEFINE_STRUCT_CLK_HW_OMAP(core_l3_ick, "core_l3_clkdm");
  580. DEFINE_STRUCT_CLK(core_l3_ick, core_l3_ick_parent_names, core_l4_ick_ops);
  581. DEFINE_CLK_FIXED_FACTOR(dpll3_m2x2_ck, "dpll3_m2_ck", &dpll3_m2_ck, 0x0, 2, 1);
  582. static struct clk corex2_fck;
  583. static const char *corex2_fck_parent_names[] = {
  584. "dpll3_m2x2_ck",
  585. };
  586. DEFINE_STRUCT_CLK_HW_OMAP(corex2_fck, NULL);
  587. DEFINE_STRUCT_CLK(corex2_fck, corex2_fck_parent_names, core_ck_ops);
  588. static struct clk cpefuse_fck;
  589. static struct clk_hw_omap cpefuse_fck_hw = {
  590. .hw = {
  591. .clk = &cpefuse_fck,
  592. },
  593. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
  594. .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT,
  595. .clkdm_name = "core_l4_clkdm",
  596. };
  597. DEFINE_STRUCT_CLK(cpefuse_fck, dpll3_ck_parent_names, aes2_ick_ops);
  598. static struct clk csi2_96m_fck;
  599. static const char *csi2_96m_fck_parent_names[] = {
  600. "core_96m_fck",
  601. };
  602. static struct clk_hw_omap csi2_96m_fck_hw = {
  603. .hw = {
  604. .clk = &csi2_96m_fck,
  605. },
  606. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  607. .enable_bit = OMAP3430_EN_CSI2_SHIFT,
  608. .clkdm_name = "cam_clkdm",
  609. };
  610. DEFINE_STRUCT_CLK(csi2_96m_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  611. static struct clk d2d_26m_fck;
  612. static struct clk_hw_omap d2d_26m_fck_hw = {
  613. .hw = {
  614. .clk = &d2d_26m_fck,
  615. },
  616. .ops = &clkhwops_wait,
  617. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  618. .enable_bit = OMAP3430ES1_EN_D2D_SHIFT,
  619. .clkdm_name = "d2d_clkdm",
  620. };
  621. DEFINE_STRUCT_CLK(d2d_26m_fck, dpll3_ck_parent_names, aes2_ick_ops);
  622. static struct clk des1_ick;
  623. static struct clk_hw_omap des1_ick_hw = {
  624. .hw = {
  625. .clk = &des1_ick,
  626. },
  627. .ops = &clkhwops_iclk_wait,
  628. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  629. .enable_bit = OMAP3430_EN_DES1_SHIFT,
  630. };
  631. DEFINE_STRUCT_CLK(des1_ick, aes1_ick_parent_names, aes1_ick_ops);
  632. static struct clk des2_ick;
  633. static struct clk_hw_omap des2_ick_hw = {
  634. .hw = {
  635. .clk = &des2_ick,
  636. },
  637. .ops = &clkhwops_iclk_wait,
  638. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  639. .enable_bit = OMAP3430_EN_DES2_SHIFT,
  640. .clkdm_name = "core_l4_clkdm",
  641. };
  642. DEFINE_STRUCT_CLK(des2_ick, aes2_ick_parent_names, aes2_ick_ops);
  643. DEFINE_CLK_DIVIDER(dpll1_fck, "core_ck", &core_ck, 0x0,
  644. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  645. OMAP3430_MPU_CLK_SRC_SHIFT, OMAP3430_MPU_CLK_SRC_WIDTH,
  646. CLK_DIVIDER_ONE_BASED, NULL);
  647. static struct clk dpll2_fck;
  648. static struct dpll_data dpll2_dd = {
  649. .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  650. .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
  651. .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
  652. .clk_bypass = &dpll2_fck,
  653. .clk_ref = &sys_ck,
  654. .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
  655. .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
  656. .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
  657. .modes = ((1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
  658. (1 << DPLL_LOW_POWER_BYPASS)),
  659. .auto_recal_bit = OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
  660. .recal_en_bit = OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
  661. .recal_st_bit = OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
  662. .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  663. .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK,
  664. .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
  665. .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK,
  666. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  667. .min_divider = 1,
  668. .max_divider = OMAP3_MAX_DPLL_DIV,
  669. };
  670. static struct clk dpll2_ck;
  671. static struct clk_hw_omap dpll2_ck_hw = {
  672. .hw = {
  673. .clk = &dpll2_ck,
  674. },
  675. .ops = &clkhwops_omap3_dpll,
  676. .dpll_data = &dpll2_dd,
  677. .clkdm_name = "dpll2_clkdm",
  678. };
  679. DEFINE_STRUCT_CLK(dpll2_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  680. DEFINE_CLK_DIVIDER(dpll2_fck, "core_ck", &core_ck, 0x0,
  681. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  682. OMAP3430_IVA2_CLK_SRC_SHIFT, OMAP3430_IVA2_CLK_SRC_WIDTH,
  683. CLK_DIVIDER_ONE_BASED, NULL);
  684. DEFINE_CLK_DIVIDER(dpll2_m2_ck, "dpll2_ck", &dpll2_ck, 0x0,
  685. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL2_PLL),
  686. OMAP3430_IVA2_DPLL_CLKOUT_DIV_SHIFT,
  687. OMAP3430_IVA2_DPLL_CLKOUT_DIV_WIDTH,
  688. CLK_DIVIDER_ONE_BASED, NULL);
  689. DEFINE_CLK_DIVIDER(dpll3_m3_ck, "dpll3_ck", &dpll3_ck, 0x0,
  690. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  691. OMAP3430_DIV_DPLL3_SHIFT, OMAP3430_DIV_DPLL3_WIDTH,
  692. CLK_DIVIDER_ONE_BASED, NULL);
  693. static struct clk dpll3_m3x2_ck;
  694. static const char *dpll3_m3x2_ck_parent_names[] = {
  695. "dpll3_m3_ck",
  696. };
  697. static struct clk_hw_omap dpll3_m3x2_ck_hw = {
  698. .hw = {
  699. .clk = &dpll3_m3x2_ck,
  700. },
  701. .ops = &clkhwops_wait,
  702. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  703. .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT,
  704. .flags = INVERT_ENABLE,
  705. .clkdm_name = "dpll3_clkdm",
  706. };
  707. DEFINE_STRUCT_CLK(dpll3_m3x2_ck, dpll3_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  708. static struct clk dpll3_m3x2_ck_3630 = {
  709. .name = "dpll3_m3x2_ck",
  710. .hw = &dpll3_m3x2_ck_hw.hw,
  711. .parent_names = dpll3_m3x2_ck_parent_names,
  712. .num_parents = ARRAY_SIZE(dpll3_m3x2_ck_parent_names),
  713. .ops = &dpll4_m5x2_ck_3630_ops,
  714. };
  715. DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1);
  716. DEFINE_CLK_DIVIDER_TABLE(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0,
  717. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  718. OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH,
  719. 0, dpll4_mx_ck_div_table, NULL);
  720. static struct clk dpll4_m4x2_ck;
  721. static const char *dpll4_m4x2_ck_parent_names[] = {
  722. "dpll4_m4_ck",
  723. };
  724. static struct clk_hw_omap dpll4_m4x2_ck_hw = {
  725. .hw = {
  726. .clk = &dpll4_m4x2_ck,
  727. },
  728. .ops = &clkhwops_wait,
  729. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  730. .enable_bit = OMAP3430_PWRDN_DSS1_SHIFT,
  731. .flags = INVERT_ENABLE,
  732. .clkdm_name = "dpll4_clkdm",
  733. };
  734. DEFINE_STRUCT_CLK_FLAGS(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names,
  735. dpll4_m5x2_ck_ops, CLK_SET_RATE_PARENT);
  736. static struct clk dpll4_m4x2_ck_3630 = {
  737. .name = "dpll4_m4x2_ck",
  738. .hw = &dpll4_m4x2_ck_hw.hw,
  739. .parent_names = dpll4_m4x2_ck_parent_names,
  740. .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names),
  741. .ops = &dpll4_m5x2_ck_3630_ops,
  742. .flags = CLK_SET_RATE_PARENT,
  743. };
  744. DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0,
  745. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  746. OMAP3430_DIV_DPLL4_SHIFT, OMAP3630_DIV_DPLL4_WIDTH,
  747. CLK_DIVIDER_ONE_BASED, NULL);
  748. static struct clk dpll4_m6x2_ck;
  749. static const char *dpll4_m6x2_ck_parent_names[] = {
  750. "dpll4_m6_ck",
  751. };
  752. static struct clk_hw_omap dpll4_m6x2_ck_hw = {
  753. .hw = {
  754. .clk = &dpll4_m6x2_ck,
  755. },
  756. .ops = &clkhwops_wait,
  757. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  758. .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
  759. .flags = INVERT_ENABLE,
  760. .clkdm_name = "dpll4_clkdm",
  761. };
  762. DEFINE_STRUCT_CLK(dpll4_m6x2_ck, dpll4_m6x2_ck_parent_names, dpll4_m5x2_ck_ops);
  763. static struct clk dpll4_m6x2_ck_3630 = {
  764. .name = "dpll4_m6x2_ck",
  765. .hw = &dpll4_m6x2_ck_hw.hw,
  766. .parent_names = dpll4_m6x2_ck_parent_names,
  767. .num_parents = ARRAY_SIZE(dpll4_m6x2_ck_parent_names),
  768. .ops = &dpll4_m5x2_ck_3630_ops,
  769. };
  770. DEFINE_CLK_FIXED_FACTOR(dpll4_x2_ck, "dpll4_ck", &dpll4_ck, 0x0, 2, 1);
  771. static struct dpll_data dpll5_dd = {
  772. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
  773. .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
  774. .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
  775. .clk_bypass = &sys_ck,
  776. .clk_ref = &sys_ck,
  777. .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
  778. .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
  779. .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
  780. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  781. .auto_recal_bit = OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
  782. .recal_en_bit = OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
  783. .recal_st_bit = OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
  784. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
  785. .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
  786. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
  787. .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
  788. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  789. .min_divider = 1,
  790. .max_divider = OMAP3_MAX_DPLL_DIV,
  791. };
  792. static struct clk dpll5_ck;
  793. static struct clk_hw_omap dpll5_ck_hw = {
  794. .hw = {
  795. .clk = &dpll5_ck,
  796. },
  797. .ops = &clkhwops_omap3_dpll,
  798. .dpll_data = &dpll5_dd,
  799. .clkdm_name = "dpll5_clkdm",
  800. };
  801. DEFINE_STRUCT_CLK(dpll5_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  802. DEFINE_CLK_DIVIDER(dpll5_m2_ck, "dpll5_ck", &dpll5_ck, 0x0,
  803. OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
  804. OMAP3430ES2_DIV_120M_SHIFT, OMAP3430ES2_DIV_120M_WIDTH,
  805. CLK_DIVIDER_ONE_BASED, NULL);
  806. static struct clk dss1_alwon_fck_3430es1;
  807. static const char *dss1_alwon_fck_3430es1_parent_names[] = {
  808. "dpll4_m4x2_ck",
  809. };
  810. static struct clk_hw_omap dss1_alwon_fck_3430es1_hw = {
  811. .hw = {
  812. .clk = &dss1_alwon_fck_3430es1,
  813. },
  814. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  815. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  816. .clkdm_name = "dss_clkdm",
  817. };
  818. DEFINE_STRUCT_CLK_FLAGS(dss1_alwon_fck_3430es1,
  819. dss1_alwon_fck_3430es1_parent_names, aes2_ick_ops,
  820. CLK_SET_RATE_PARENT);
  821. static struct clk dss1_alwon_fck_3430es2;
  822. static struct clk_hw_omap dss1_alwon_fck_3430es2_hw = {
  823. .hw = {
  824. .clk = &dss1_alwon_fck_3430es2,
  825. },
  826. .ops = &clkhwops_omap3430es2_dss_usbhost_wait,
  827. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  828. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  829. .clkdm_name = "dss_clkdm",
  830. };
  831. DEFINE_STRUCT_CLK_FLAGS(dss1_alwon_fck_3430es2,
  832. dss1_alwon_fck_3430es1_parent_names, aes2_ick_ops,
  833. CLK_SET_RATE_PARENT);
  834. static struct clk dss2_alwon_fck;
  835. static struct clk_hw_omap dss2_alwon_fck_hw = {
  836. .hw = {
  837. .clk = &dss2_alwon_fck,
  838. },
  839. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  840. .enable_bit = OMAP3430_EN_DSS2_SHIFT,
  841. .clkdm_name = "dss_clkdm",
  842. };
  843. DEFINE_STRUCT_CLK(dss2_alwon_fck, dpll3_ck_parent_names, aes2_ick_ops);
  844. static struct clk dss_96m_fck;
  845. static struct clk_hw_omap dss_96m_fck_hw = {
  846. .hw = {
  847. .clk = &dss_96m_fck,
  848. },
  849. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  850. .enable_bit = OMAP3430_EN_TV_SHIFT,
  851. .clkdm_name = "dss_clkdm",
  852. };
  853. DEFINE_STRUCT_CLK(dss_96m_fck, core_96m_fck_parent_names, aes2_ick_ops);
  854. static struct clk dss_ick_3430es1;
  855. static struct clk_hw_omap dss_ick_3430es1_hw = {
  856. .hw = {
  857. .clk = &dss_ick_3430es1,
  858. },
  859. .ops = &clkhwops_iclk,
  860. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
  861. .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
  862. .clkdm_name = "dss_clkdm",
  863. };
  864. DEFINE_STRUCT_CLK(dss_ick_3430es1, security_l4_ick2_parent_names, aes2_ick_ops);
  865. static struct clk dss_ick_3430es2;
  866. static struct clk_hw_omap dss_ick_3430es2_hw = {
  867. .hw = {
  868. .clk = &dss_ick_3430es2,
  869. },
  870. .ops = &clkhwops_omap3430es2_iclk_dss_usbhost_wait,
  871. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
  872. .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
  873. .clkdm_name = "dss_clkdm",
  874. };
  875. DEFINE_STRUCT_CLK(dss_ick_3430es2, security_l4_ick2_parent_names, aes2_ick_ops);
  876. static struct clk dss_tv_fck;
  877. static const char *dss_tv_fck_parent_names[] = {
  878. "omap_54m_fck",
  879. };
  880. static struct clk_hw_omap dss_tv_fck_hw = {
  881. .hw = {
  882. .clk = &dss_tv_fck,
  883. },
  884. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  885. .enable_bit = OMAP3430_EN_TV_SHIFT,
  886. .clkdm_name = "dss_clkdm",
  887. };
  888. DEFINE_STRUCT_CLK(dss_tv_fck, dss_tv_fck_parent_names, aes2_ick_ops);
  889. static struct clk emac_fck;
  890. static const char *emac_fck_parent_names[] = {
  891. "rmii_ck",
  892. };
  893. static struct clk_hw_omap emac_fck_hw = {
  894. .hw = {
  895. .clk = &emac_fck,
  896. },
  897. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  898. .enable_bit = AM35XX_CPGMAC_FCLK_SHIFT,
  899. };
  900. DEFINE_STRUCT_CLK(emac_fck, emac_fck_parent_names, aes1_ick_ops);
  901. static struct clk ipss_ick;
  902. static const char *ipss_ick_parent_names[] = {
  903. "core_l3_ick",
  904. };
  905. static struct clk_hw_omap ipss_ick_hw = {
  906. .hw = {
  907. .clk = &ipss_ick,
  908. },
  909. .ops = &clkhwops_am35xx_ipss_wait,
  910. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  911. .enable_bit = AM35XX_EN_IPSS_SHIFT,
  912. .clkdm_name = "core_l3_clkdm",
  913. };
  914. DEFINE_STRUCT_CLK(ipss_ick, ipss_ick_parent_names, aes2_ick_ops);
  915. static struct clk emac_ick;
  916. static const char *emac_ick_parent_names[] = {
  917. "ipss_ick",
  918. };
  919. static struct clk_hw_omap emac_ick_hw = {
  920. .hw = {
  921. .clk = &emac_ick,
  922. },
  923. .ops = &clkhwops_am35xx_ipss_module_wait,
  924. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  925. .enable_bit = AM35XX_CPGMAC_VBUSP_CLK_SHIFT,
  926. .clkdm_name = "core_l3_clkdm",
  927. };
  928. DEFINE_STRUCT_CLK(emac_ick, emac_ick_parent_names, aes2_ick_ops);
  929. static struct clk emu_core_alwon_ck;
  930. static const char *emu_core_alwon_ck_parent_names[] = {
  931. "dpll3_m3x2_ck",
  932. };
  933. DEFINE_STRUCT_CLK_HW_OMAP(emu_core_alwon_ck, "dpll3_clkdm");
  934. DEFINE_STRUCT_CLK(emu_core_alwon_ck, emu_core_alwon_ck_parent_names,
  935. core_l4_ick_ops);
  936. static struct clk emu_mpu_alwon_ck;
  937. static const char *emu_mpu_alwon_ck_parent_names[] = {
  938. "mpu_ck",
  939. };
  940. DEFINE_STRUCT_CLK_HW_OMAP(emu_mpu_alwon_ck, NULL);
  941. DEFINE_STRUCT_CLK(emu_mpu_alwon_ck, emu_mpu_alwon_ck_parent_names, core_ck_ops);
  942. static struct clk emu_per_alwon_ck;
  943. static const char *emu_per_alwon_ck_parent_names[] = {
  944. "dpll4_m6x2_ck",
  945. };
  946. DEFINE_STRUCT_CLK_HW_OMAP(emu_per_alwon_ck, "dpll4_clkdm");
  947. DEFINE_STRUCT_CLK(emu_per_alwon_ck, emu_per_alwon_ck_parent_names,
  948. core_l4_ick_ops);
  949. static const char *emu_src_ck_parent_names[] = {
  950. "sys_ck", "emu_core_alwon_ck", "emu_per_alwon_ck", "emu_mpu_alwon_ck",
  951. };
  952. static const struct clksel_rate emu_src_sys_rates[] = {
  953. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  954. { .div = 0 },
  955. };
  956. static const struct clksel_rate emu_src_core_rates[] = {
  957. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  958. { .div = 0 },
  959. };
  960. static const struct clksel_rate emu_src_per_rates[] = {
  961. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  962. { .div = 0 },
  963. };
  964. static const struct clksel_rate emu_src_mpu_rates[] = {
  965. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  966. { .div = 0 },
  967. };
  968. static const struct clksel emu_src_clksel[] = {
  969. { .parent = &sys_ck, .rates = emu_src_sys_rates },
  970. { .parent = &emu_core_alwon_ck, .rates = emu_src_core_rates },
  971. { .parent = &emu_per_alwon_ck, .rates = emu_src_per_rates },
  972. { .parent = &emu_mpu_alwon_ck, .rates = emu_src_mpu_rates },
  973. { .parent = NULL },
  974. };
  975. static const struct clk_ops emu_src_ck_ops = {
  976. .init = &omap2_init_clk_clkdm,
  977. .recalc_rate = &omap2_clksel_recalc,
  978. .get_parent = &omap2_clksel_find_parent_index,
  979. .set_parent = &omap2_clksel_set_parent,
  980. .enable = &omap2_clkops_enable_clkdm,
  981. .disable = &omap2_clkops_disable_clkdm,
  982. };
  983. static struct clk emu_src_ck;
  984. static struct clk_hw_omap emu_src_ck_hw = {
  985. .hw = {
  986. .clk = &emu_src_ck,
  987. },
  988. .clksel = emu_src_clksel,
  989. .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  990. .clksel_mask = OMAP3430_MUX_CTRL_MASK,
  991. .clkdm_name = "emu_clkdm",
  992. };
  993. DEFINE_STRUCT_CLK(emu_src_ck, emu_src_ck_parent_names, emu_src_ck_ops);
  994. DEFINE_CLK_DIVIDER(atclk_fck, "emu_src_ck", &emu_src_ck, 0x0,
  995. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  996. OMAP3430_CLKSEL_ATCLK_SHIFT, OMAP3430_CLKSEL_ATCLK_WIDTH,
  997. CLK_DIVIDER_ONE_BASED, NULL);
  998. static struct clk fac_ick;
  999. static struct clk_hw_omap fac_ick_hw = {
  1000. .hw = {
  1001. .clk = &fac_ick,
  1002. },
  1003. .ops = &clkhwops_iclk_wait,
  1004. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1005. .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
  1006. .clkdm_name = "core_l4_clkdm",
  1007. };
  1008. DEFINE_STRUCT_CLK(fac_ick, aes2_ick_parent_names, aes2_ick_ops);
  1009. static struct clk fshostusb_fck;
  1010. static const char *fshostusb_fck_parent_names[] = {
  1011. "core_48m_fck",
  1012. };
  1013. static struct clk_hw_omap fshostusb_fck_hw = {
  1014. .hw = {
  1015. .clk = &fshostusb_fck,
  1016. },
  1017. .ops = &clkhwops_wait,
  1018. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1019. .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
  1020. .clkdm_name = "core_l4_clkdm",
  1021. };
  1022. DEFINE_STRUCT_CLK(fshostusb_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1023. static struct clk gfx_l3_ck;
  1024. static struct clk_hw_omap gfx_l3_ck_hw = {
  1025. .hw = {
  1026. .clk = &gfx_l3_ck,
  1027. },
  1028. .ops = &clkhwops_wait,
  1029. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
  1030. .enable_bit = OMAP_EN_GFX_SHIFT,
  1031. .clkdm_name = "gfx_3430es1_clkdm",
  1032. };
  1033. DEFINE_STRUCT_CLK(gfx_l3_ck, core_l3_ick_parent_names, aes1_ick_ops);
  1034. DEFINE_CLK_DIVIDER(gfx_l3_fck, "l3_ick", &l3_ick, 0x0,
  1035. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  1036. OMAP_CLKSEL_GFX_SHIFT, OMAP_CLKSEL_GFX_WIDTH,
  1037. CLK_DIVIDER_ONE_BASED, NULL);
  1038. static struct clk gfx_cg1_ck;
  1039. static const char *gfx_cg1_ck_parent_names[] = {
  1040. "gfx_l3_fck",
  1041. };
  1042. static struct clk_hw_omap gfx_cg1_ck_hw = {
  1043. .hw = {
  1044. .clk = &gfx_cg1_ck,
  1045. },
  1046. .ops = &clkhwops_wait,
  1047. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  1048. .enable_bit = OMAP3430ES1_EN_2D_SHIFT,
  1049. .clkdm_name = "gfx_3430es1_clkdm",
  1050. };
  1051. DEFINE_STRUCT_CLK(gfx_cg1_ck, gfx_cg1_ck_parent_names, aes2_ick_ops);
  1052. static struct clk gfx_cg2_ck;
  1053. static struct clk_hw_omap gfx_cg2_ck_hw = {
  1054. .hw = {
  1055. .clk = &gfx_cg2_ck,
  1056. },
  1057. .ops = &clkhwops_wait,
  1058. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  1059. .enable_bit = OMAP3430ES1_EN_3D_SHIFT,
  1060. .clkdm_name = "gfx_3430es1_clkdm",
  1061. };
  1062. DEFINE_STRUCT_CLK(gfx_cg2_ck, gfx_cg1_ck_parent_names, aes2_ick_ops);
  1063. static struct clk gfx_l3_ick;
  1064. static const char *gfx_l3_ick_parent_names[] = {
  1065. "gfx_l3_ck",
  1066. };
  1067. DEFINE_STRUCT_CLK_HW_OMAP(gfx_l3_ick, "gfx_3430es1_clkdm");
  1068. DEFINE_STRUCT_CLK(gfx_l3_ick, gfx_l3_ick_parent_names, core_l4_ick_ops);
  1069. static struct clk wkup_32k_fck;
  1070. static const char *wkup_32k_fck_parent_names[] = {
  1071. "omap_32k_fck",
  1072. };
  1073. DEFINE_STRUCT_CLK_HW_OMAP(wkup_32k_fck, "wkup_clkdm");
  1074. DEFINE_STRUCT_CLK(wkup_32k_fck, wkup_32k_fck_parent_names, core_l4_ick_ops);
  1075. static struct clk gpio1_dbck;
  1076. static const char *gpio1_dbck_parent_names[] = {
  1077. "wkup_32k_fck",
  1078. };
  1079. static struct clk_hw_omap gpio1_dbck_hw = {
  1080. .hw = {
  1081. .clk = &gpio1_dbck,
  1082. },
  1083. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1084. .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
  1085. .clkdm_name = "wkup_clkdm",
  1086. };
  1087. DEFINE_STRUCT_CLK(gpio1_dbck, gpio1_dbck_parent_names, aes2_ick_ops);
  1088. static struct clk wkup_l4_ick;
  1089. DEFINE_STRUCT_CLK_HW_OMAP(wkup_l4_ick, "wkup_clkdm");
  1090. DEFINE_STRUCT_CLK(wkup_l4_ick, dpll3_ck_parent_names, core_l4_ick_ops);
  1091. static struct clk gpio1_ick;
  1092. static const char *gpio1_ick_parent_names[] = {
  1093. "wkup_l4_ick",
  1094. };
  1095. static struct clk_hw_omap gpio1_ick_hw = {
  1096. .hw = {
  1097. .clk = &gpio1_ick,
  1098. },
  1099. .ops = &clkhwops_iclk_wait,
  1100. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1101. .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
  1102. .clkdm_name = "wkup_clkdm",
  1103. };
  1104. DEFINE_STRUCT_CLK(gpio1_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1105. static struct clk per_32k_alwon_fck;
  1106. DEFINE_STRUCT_CLK_HW_OMAP(per_32k_alwon_fck, "per_clkdm");
  1107. DEFINE_STRUCT_CLK(per_32k_alwon_fck, wkup_32k_fck_parent_names,
  1108. core_l4_ick_ops);
  1109. static struct clk gpio2_dbck;
  1110. static const char *gpio2_dbck_parent_names[] = {
  1111. "per_32k_alwon_fck",
  1112. };
  1113. static struct clk_hw_omap gpio2_dbck_hw = {
  1114. .hw = {
  1115. .clk = &gpio2_dbck,
  1116. },
  1117. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1118. .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
  1119. .clkdm_name = "per_clkdm",
  1120. };
  1121. DEFINE_STRUCT_CLK(gpio2_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1122. static struct clk per_l4_ick;
  1123. DEFINE_STRUCT_CLK_HW_OMAP(per_l4_ick, "per_clkdm");
  1124. DEFINE_STRUCT_CLK(per_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  1125. static struct clk gpio2_ick;
  1126. static const char *gpio2_ick_parent_names[] = {
  1127. "per_l4_ick",
  1128. };
  1129. static struct clk_hw_omap gpio2_ick_hw = {
  1130. .hw = {
  1131. .clk = &gpio2_ick,
  1132. },
  1133. .ops = &clkhwops_iclk_wait,
  1134. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1135. .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
  1136. .clkdm_name = "per_clkdm",
  1137. };
  1138. DEFINE_STRUCT_CLK(gpio2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1139. static struct clk gpio3_dbck;
  1140. static struct clk_hw_omap gpio3_dbck_hw = {
  1141. .hw = {
  1142. .clk = &gpio3_dbck,
  1143. },
  1144. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1145. .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
  1146. .clkdm_name = "per_clkdm",
  1147. };
  1148. DEFINE_STRUCT_CLK(gpio3_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1149. static struct clk gpio3_ick;
  1150. static struct clk_hw_omap gpio3_ick_hw = {
  1151. .hw = {
  1152. .clk = &gpio3_ick,
  1153. },
  1154. .ops = &clkhwops_iclk_wait,
  1155. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1156. .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
  1157. .clkdm_name = "per_clkdm",
  1158. };
  1159. DEFINE_STRUCT_CLK(gpio3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1160. static struct clk gpio4_dbck;
  1161. static struct clk_hw_omap gpio4_dbck_hw = {
  1162. .hw = {
  1163. .clk = &gpio4_dbck,
  1164. },
  1165. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1166. .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
  1167. .clkdm_name = "per_clkdm",
  1168. };
  1169. DEFINE_STRUCT_CLK(gpio4_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1170. static struct clk gpio4_ick;
  1171. static struct clk_hw_omap gpio4_ick_hw = {
  1172. .hw = {
  1173. .clk = &gpio4_ick,
  1174. },
  1175. .ops = &clkhwops_iclk_wait,
  1176. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1177. .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
  1178. .clkdm_name = "per_clkdm",
  1179. };
  1180. DEFINE_STRUCT_CLK(gpio4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1181. static struct clk gpio5_dbck;
  1182. static struct clk_hw_omap gpio5_dbck_hw = {
  1183. .hw = {
  1184. .clk = &gpio5_dbck,
  1185. },
  1186. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1187. .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
  1188. .clkdm_name = "per_clkdm",
  1189. };
  1190. DEFINE_STRUCT_CLK(gpio5_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1191. static struct clk gpio5_ick;
  1192. static struct clk_hw_omap gpio5_ick_hw = {
  1193. .hw = {
  1194. .clk = &gpio5_ick,
  1195. },
  1196. .ops = &clkhwops_iclk_wait,
  1197. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1198. .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
  1199. .clkdm_name = "per_clkdm",
  1200. };
  1201. DEFINE_STRUCT_CLK(gpio5_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1202. static struct clk gpio6_dbck;
  1203. static struct clk_hw_omap gpio6_dbck_hw = {
  1204. .hw = {
  1205. .clk = &gpio6_dbck,
  1206. },
  1207. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1208. .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
  1209. .clkdm_name = "per_clkdm",
  1210. };
  1211. DEFINE_STRUCT_CLK(gpio6_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1212. static struct clk gpio6_ick;
  1213. static struct clk_hw_omap gpio6_ick_hw = {
  1214. .hw = {
  1215. .clk = &gpio6_ick,
  1216. },
  1217. .ops = &clkhwops_iclk_wait,
  1218. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1219. .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
  1220. .clkdm_name = "per_clkdm",
  1221. };
  1222. DEFINE_STRUCT_CLK(gpio6_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1223. static struct clk gpmc_fck;
  1224. static struct clk_hw_omap gpmc_fck_hw = {
  1225. .hw = {
  1226. .clk = &gpmc_fck,
  1227. },
  1228. .flags = ENABLE_ON_INIT,
  1229. .clkdm_name = "core_l3_clkdm",
  1230. };
  1231. DEFINE_STRUCT_CLK(gpmc_fck, ipss_ick_parent_names, core_l4_ick_ops);
  1232. static const struct clksel omap343x_gpt_clksel[] = {
  1233. { .parent = &omap_32k_fck, .rates = gpt_32k_rates },
  1234. { .parent = &sys_ck, .rates = gpt_sys_rates },
  1235. { .parent = NULL },
  1236. };
  1237. static const char *gpt10_fck_parent_names[] = {
  1238. "omap_32k_fck", "sys_ck",
  1239. };
  1240. DEFINE_CLK_OMAP_MUX_GATE(gpt10_fck, "core_l4_clkdm", omap343x_gpt_clksel,
  1241. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1242. OMAP3430_CLKSEL_GPT10_MASK,
  1243. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1244. OMAP3430_EN_GPT10_SHIFT, &clkhwops_wait,
  1245. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1246. static struct clk gpt10_ick;
  1247. static struct clk_hw_omap gpt10_ick_hw = {
  1248. .hw = {
  1249. .clk = &gpt10_ick,
  1250. },
  1251. .ops = &clkhwops_iclk_wait,
  1252. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1253. .enable_bit = OMAP3430_EN_GPT10_SHIFT,
  1254. .clkdm_name = "core_l4_clkdm",
  1255. };
  1256. DEFINE_STRUCT_CLK(gpt10_ick, aes2_ick_parent_names, aes2_ick_ops);
  1257. DEFINE_CLK_OMAP_MUX_GATE(gpt11_fck, "core_l4_clkdm", omap343x_gpt_clksel,
  1258. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1259. OMAP3430_CLKSEL_GPT11_MASK,
  1260. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1261. OMAP3430_EN_GPT11_SHIFT, &clkhwops_wait,
  1262. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1263. static struct clk gpt11_ick;
  1264. static struct clk_hw_omap gpt11_ick_hw = {
  1265. .hw = {
  1266. .clk = &gpt11_ick,
  1267. },
  1268. .ops = &clkhwops_iclk_wait,
  1269. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1270. .enable_bit = OMAP3430_EN_GPT11_SHIFT,
  1271. .clkdm_name = "core_l4_clkdm",
  1272. };
  1273. DEFINE_STRUCT_CLK(gpt11_ick, aes2_ick_parent_names, aes2_ick_ops);
  1274. static struct clk gpt12_fck;
  1275. static const char *gpt12_fck_parent_names[] = {
  1276. "secure_32k_fck",
  1277. };
  1278. DEFINE_STRUCT_CLK_HW_OMAP(gpt12_fck, "wkup_clkdm");
  1279. DEFINE_STRUCT_CLK(gpt12_fck, gpt12_fck_parent_names, core_l4_ick_ops);
  1280. static struct clk gpt12_ick;
  1281. static struct clk_hw_omap gpt12_ick_hw = {
  1282. .hw = {
  1283. .clk = &gpt12_ick,
  1284. },
  1285. .ops = &clkhwops_iclk_wait,
  1286. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1287. .enable_bit = OMAP3430_EN_GPT12_SHIFT,
  1288. .clkdm_name = "wkup_clkdm",
  1289. };
  1290. DEFINE_STRUCT_CLK(gpt12_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1291. DEFINE_CLK_OMAP_MUX_GATE(gpt1_fck, "wkup_clkdm", omap343x_gpt_clksel,
  1292. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
  1293. OMAP3430_CLKSEL_GPT1_MASK,
  1294. OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1295. OMAP3430_EN_GPT1_SHIFT, &clkhwops_wait,
  1296. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1297. static struct clk gpt1_ick;
  1298. static struct clk_hw_omap gpt1_ick_hw = {
  1299. .hw = {
  1300. .clk = &gpt1_ick,
  1301. },
  1302. .ops = &clkhwops_iclk_wait,
  1303. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1304. .enable_bit = OMAP3430_EN_GPT1_SHIFT,
  1305. .clkdm_name = "wkup_clkdm",
  1306. };
  1307. DEFINE_STRUCT_CLK(gpt1_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1308. DEFINE_CLK_OMAP_MUX_GATE(gpt2_fck, "per_clkdm", omap343x_gpt_clksel,
  1309. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1310. OMAP3430_CLKSEL_GPT2_MASK,
  1311. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1312. OMAP3430_EN_GPT2_SHIFT, &clkhwops_wait,
  1313. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1314. static struct clk gpt2_ick;
  1315. static struct clk_hw_omap gpt2_ick_hw = {
  1316. .hw = {
  1317. .clk = &gpt2_ick,
  1318. },
  1319. .ops = &clkhwops_iclk_wait,
  1320. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1321. .enable_bit = OMAP3430_EN_GPT2_SHIFT,
  1322. .clkdm_name = "per_clkdm",
  1323. };
  1324. DEFINE_STRUCT_CLK(gpt2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1325. DEFINE_CLK_OMAP_MUX_GATE(gpt3_fck, "per_clkdm", omap343x_gpt_clksel,
  1326. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1327. OMAP3430_CLKSEL_GPT3_MASK,
  1328. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1329. OMAP3430_EN_GPT3_SHIFT, &clkhwops_wait,
  1330. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1331. static struct clk gpt3_ick;
  1332. static struct clk_hw_omap gpt3_ick_hw = {
  1333. .hw = {
  1334. .clk = &gpt3_ick,
  1335. },
  1336. .ops = &clkhwops_iclk_wait,
  1337. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1338. .enable_bit = OMAP3430_EN_GPT3_SHIFT,
  1339. .clkdm_name = "per_clkdm",
  1340. };
  1341. DEFINE_STRUCT_CLK(gpt3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1342. DEFINE_CLK_OMAP_MUX_GATE(gpt4_fck, "per_clkdm", omap343x_gpt_clksel,
  1343. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1344. OMAP3430_CLKSEL_GPT4_MASK,
  1345. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1346. OMAP3430_EN_GPT4_SHIFT, &clkhwops_wait,
  1347. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1348. static struct clk gpt4_ick;
  1349. static struct clk_hw_omap gpt4_ick_hw = {
  1350. .hw = {
  1351. .clk = &gpt4_ick,
  1352. },
  1353. .ops = &clkhwops_iclk_wait,
  1354. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1355. .enable_bit = OMAP3430_EN_GPT4_SHIFT,
  1356. .clkdm_name = "per_clkdm",
  1357. };
  1358. DEFINE_STRUCT_CLK(gpt4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1359. DEFINE_CLK_OMAP_MUX_GATE(gpt5_fck, "per_clkdm", omap343x_gpt_clksel,
  1360. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1361. OMAP3430_CLKSEL_GPT5_MASK,
  1362. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1363. OMAP3430_EN_GPT5_SHIFT, &clkhwops_wait,
  1364. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1365. static struct clk gpt5_ick;
  1366. static struct clk_hw_omap gpt5_ick_hw = {
  1367. .hw = {
  1368. .clk = &gpt5_ick,
  1369. },
  1370. .ops = &clkhwops_iclk_wait,
  1371. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1372. .enable_bit = OMAP3430_EN_GPT5_SHIFT,
  1373. .clkdm_name = "per_clkdm",
  1374. };
  1375. DEFINE_STRUCT_CLK(gpt5_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1376. DEFINE_CLK_OMAP_MUX_GATE(gpt6_fck, "per_clkdm", omap343x_gpt_clksel,
  1377. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1378. OMAP3430_CLKSEL_GPT6_MASK,
  1379. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1380. OMAP3430_EN_GPT6_SHIFT, &clkhwops_wait,
  1381. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1382. static struct clk gpt6_ick;
  1383. static struct clk_hw_omap gpt6_ick_hw = {
  1384. .hw = {
  1385. .clk = &gpt6_ick,
  1386. },
  1387. .ops = &clkhwops_iclk_wait,
  1388. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1389. .enable_bit = OMAP3430_EN_GPT6_SHIFT,
  1390. .clkdm_name = "per_clkdm",
  1391. };
  1392. DEFINE_STRUCT_CLK(gpt6_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1393. DEFINE_CLK_OMAP_MUX_GATE(gpt7_fck, "per_clkdm", omap343x_gpt_clksel,
  1394. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1395. OMAP3430_CLKSEL_GPT7_MASK,
  1396. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1397. OMAP3430_EN_GPT7_SHIFT, &clkhwops_wait,
  1398. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1399. static struct clk gpt7_ick;
  1400. static struct clk_hw_omap gpt7_ick_hw = {
  1401. .hw = {
  1402. .clk = &gpt7_ick,
  1403. },
  1404. .ops = &clkhwops_iclk_wait,
  1405. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1406. .enable_bit = OMAP3430_EN_GPT7_SHIFT,
  1407. .clkdm_name = "per_clkdm",
  1408. };
  1409. DEFINE_STRUCT_CLK(gpt7_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1410. DEFINE_CLK_OMAP_MUX_GATE(gpt8_fck, "per_clkdm", omap343x_gpt_clksel,
  1411. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1412. OMAP3430_CLKSEL_GPT8_MASK,
  1413. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1414. OMAP3430_EN_GPT8_SHIFT, &clkhwops_wait,
  1415. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1416. static struct clk gpt8_ick;
  1417. static struct clk_hw_omap gpt8_ick_hw = {
  1418. .hw = {
  1419. .clk = &gpt8_ick,
  1420. },
  1421. .ops = &clkhwops_iclk_wait,
  1422. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1423. .enable_bit = OMAP3430_EN_GPT8_SHIFT,
  1424. .clkdm_name = "per_clkdm",
  1425. };
  1426. DEFINE_STRUCT_CLK(gpt8_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1427. DEFINE_CLK_OMAP_MUX_GATE(gpt9_fck, "per_clkdm", omap343x_gpt_clksel,
  1428. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
  1429. OMAP3430_CLKSEL_GPT9_MASK,
  1430. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1431. OMAP3430_EN_GPT9_SHIFT, &clkhwops_wait,
  1432. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1433. static struct clk gpt9_ick;
  1434. static struct clk_hw_omap gpt9_ick_hw = {
  1435. .hw = {
  1436. .clk = &gpt9_ick,
  1437. },
  1438. .ops = &clkhwops_iclk_wait,
  1439. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1440. .enable_bit = OMAP3430_EN_GPT9_SHIFT,
  1441. .clkdm_name = "per_clkdm",
  1442. };
  1443. DEFINE_STRUCT_CLK(gpt9_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1444. static struct clk hdq_fck;
  1445. static const char *hdq_fck_parent_names[] = {
  1446. "core_12m_fck",
  1447. };
  1448. static struct clk_hw_omap hdq_fck_hw = {
  1449. .hw = {
  1450. .clk = &hdq_fck,
  1451. },
  1452. .ops = &clkhwops_wait,
  1453. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1454. .enable_bit = OMAP3430_EN_HDQ_SHIFT,
  1455. .clkdm_name = "core_l4_clkdm",
  1456. };
  1457. DEFINE_STRUCT_CLK(hdq_fck, hdq_fck_parent_names, aes2_ick_ops);
  1458. static struct clk hdq_ick;
  1459. static struct clk_hw_omap hdq_ick_hw = {
  1460. .hw = {
  1461. .clk = &hdq_ick,
  1462. },
  1463. .ops = &clkhwops_iclk_wait,
  1464. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1465. .enable_bit = OMAP3430_EN_HDQ_SHIFT,
  1466. .clkdm_name = "core_l4_clkdm",
  1467. };
  1468. DEFINE_STRUCT_CLK(hdq_ick, aes2_ick_parent_names, aes2_ick_ops);
  1469. static struct clk hecc_ck;
  1470. static struct clk_hw_omap hecc_ck_hw = {
  1471. .hw = {
  1472. .clk = &hecc_ck,
  1473. },
  1474. .ops = &clkhwops_am35xx_ipss_module_wait,
  1475. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  1476. .enable_bit = AM35XX_HECC_VBUSP_CLK_SHIFT,
  1477. .clkdm_name = "core_l3_clkdm",
  1478. };
  1479. DEFINE_STRUCT_CLK(hecc_ck, dpll3_ck_parent_names, aes2_ick_ops);
  1480. static struct clk hsotgusb_fck_am35xx;
  1481. static struct clk_hw_omap hsotgusb_fck_am35xx_hw = {
  1482. .hw = {
  1483. .clk = &hsotgusb_fck_am35xx,
  1484. },
  1485. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  1486. .enable_bit = AM35XX_USBOTG_FCLK_SHIFT,
  1487. .clkdm_name = "core_l3_clkdm",
  1488. };
  1489. DEFINE_STRUCT_CLK(hsotgusb_fck_am35xx, dpll3_ck_parent_names, aes2_ick_ops);
  1490. static struct clk hsotgusb_ick_3430es1;
  1491. static struct clk_hw_omap hsotgusb_ick_3430es1_hw = {
  1492. .hw = {
  1493. .clk = &hsotgusb_ick_3430es1,
  1494. },
  1495. .ops = &clkhwops_iclk,
  1496. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1497. .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
  1498. .clkdm_name = "core_l3_clkdm",
  1499. };
  1500. DEFINE_STRUCT_CLK(hsotgusb_ick_3430es1, ipss_ick_parent_names, aes2_ick_ops);
  1501. static struct clk hsotgusb_ick_3430es2;
  1502. static struct clk_hw_omap hsotgusb_ick_3430es2_hw = {
  1503. .hw = {
  1504. .clk = &hsotgusb_ick_3430es2,
  1505. },
  1506. .ops = &clkhwops_omap3430es2_iclk_hsotgusb_wait,
  1507. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1508. .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
  1509. .clkdm_name = "core_l3_clkdm",
  1510. };
  1511. DEFINE_STRUCT_CLK(hsotgusb_ick_3430es2, ipss_ick_parent_names, aes2_ick_ops);
  1512. static struct clk hsotgusb_ick_am35xx;
  1513. static struct clk_hw_omap hsotgusb_ick_am35xx_hw = {
  1514. .hw = {
  1515. .clk = &hsotgusb_ick_am35xx,
  1516. },
  1517. .ops = &clkhwops_am35xx_ipss_module_wait,
  1518. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  1519. .enable_bit = AM35XX_USBOTG_VBUSP_CLK_SHIFT,
  1520. .clkdm_name = "core_l3_clkdm",
  1521. };
  1522. DEFINE_STRUCT_CLK(hsotgusb_ick_am35xx, emac_ick_parent_names, aes2_ick_ops);
  1523. static struct clk i2c1_fck;
  1524. static struct clk_hw_omap i2c1_fck_hw = {
  1525. .hw = {
  1526. .clk = &i2c1_fck,
  1527. },
  1528. .ops = &clkhwops_wait,
  1529. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1530. .enable_bit = OMAP3430_EN_I2C1_SHIFT,
  1531. .clkdm_name = "core_l4_clkdm",
  1532. };
  1533. DEFINE_STRUCT_CLK(i2c1_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1534. static struct clk i2c1_ick;
  1535. static struct clk_hw_omap i2c1_ick_hw = {
  1536. .hw = {
  1537. .clk = &i2c1_ick,
  1538. },
  1539. .ops = &clkhwops_iclk_wait,
  1540. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1541. .enable_bit = OMAP3430_EN_I2C1_SHIFT,
  1542. .clkdm_name = "core_l4_clkdm",
  1543. };
  1544. DEFINE_STRUCT_CLK(i2c1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1545. static struct clk i2c2_fck;
  1546. static struct clk_hw_omap i2c2_fck_hw = {
  1547. .hw = {
  1548. .clk = &i2c2_fck,
  1549. },
  1550. .ops = &clkhwops_wait,
  1551. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1552. .enable_bit = OMAP3430_EN_I2C2_SHIFT,
  1553. .clkdm_name = "core_l4_clkdm",
  1554. };
  1555. DEFINE_STRUCT_CLK(i2c2_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1556. static struct clk i2c2_ick;
  1557. static struct clk_hw_omap i2c2_ick_hw = {
  1558. .hw = {
  1559. .clk = &i2c2_ick,
  1560. },
  1561. .ops = &clkhwops_iclk_wait,
  1562. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1563. .enable_bit = OMAP3430_EN_I2C2_SHIFT,
  1564. .clkdm_name = "core_l4_clkdm",
  1565. };
  1566. DEFINE_STRUCT_CLK(i2c2_ick, aes2_ick_parent_names, aes2_ick_ops);
  1567. static struct clk i2c3_fck;
  1568. static struct clk_hw_omap i2c3_fck_hw = {
  1569. .hw = {
  1570. .clk = &i2c3_fck,
  1571. },
  1572. .ops = &clkhwops_wait,
  1573. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1574. .enable_bit = OMAP3430_EN_I2C3_SHIFT,
  1575. .clkdm_name = "core_l4_clkdm",
  1576. };
  1577. DEFINE_STRUCT_CLK(i2c3_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1578. static struct clk i2c3_ick;
  1579. static struct clk_hw_omap i2c3_ick_hw = {
  1580. .hw = {
  1581. .clk = &i2c3_ick,
  1582. },
  1583. .ops = &clkhwops_iclk_wait,
  1584. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1585. .enable_bit = OMAP3430_EN_I2C3_SHIFT,
  1586. .clkdm_name = "core_l4_clkdm",
  1587. };
  1588. DEFINE_STRUCT_CLK(i2c3_ick, aes2_ick_parent_names, aes2_ick_ops);
  1589. static struct clk icr_ick;
  1590. static struct clk_hw_omap icr_ick_hw = {
  1591. .hw = {
  1592. .clk = &icr_ick,
  1593. },
  1594. .ops = &clkhwops_iclk_wait,
  1595. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1596. .enable_bit = OMAP3430_EN_ICR_SHIFT,
  1597. .clkdm_name = "core_l4_clkdm",
  1598. };
  1599. DEFINE_STRUCT_CLK(icr_ick, aes2_ick_parent_names, aes2_ick_ops);
  1600. static struct clk iva2_ck;
  1601. static const char *iva2_ck_parent_names[] = {
  1602. "dpll2_m2_ck",
  1603. };
  1604. static struct clk_hw_omap iva2_ck_hw = {
  1605. .hw = {
  1606. .clk = &iva2_ck,
  1607. },
  1608. .ops = &clkhwops_wait,
  1609. .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN),
  1610. .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
  1611. .clkdm_name = "iva2_clkdm",
  1612. };
  1613. DEFINE_STRUCT_CLK(iva2_ck, iva2_ck_parent_names, aes2_ick_ops);
  1614. static struct clk mad2d_ick;
  1615. static struct clk_hw_omap mad2d_ick_hw = {
  1616. .hw = {
  1617. .clk = &mad2d_ick,
  1618. },
  1619. .ops = &clkhwops_iclk_wait,
  1620. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  1621. .enable_bit = OMAP3430_EN_MAD2D_SHIFT,
  1622. .clkdm_name = "d2d_clkdm",
  1623. };
  1624. DEFINE_STRUCT_CLK(mad2d_ick, core_l3_ick_parent_names, aes2_ick_ops);
  1625. static struct clk mailboxes_ick;
  1626. static struct clk_hw_omap mailboxes_ick_hw = {
  1627. .hw = {
  1628. .clk = &mailboxes_ick,
  1629. },
  1630. .ops = &clkhwops_iclk_wait,
  1631. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1632. .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT,
  1633. .clkdm_name = "core_l4_clkdm",
  1634. };
  1635. DEFINE_STRUCT_CLK(mailboxes_ick, aes2_ick_parent_names, aes2_ick_ops);
  1636. static const struct clksel_rate common_mcbsp_96m_rates[] = {
  1637. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  1638. { .div = 0 }
  1639. };
  1640. static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
  1641. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  1642. { .div = 0 }
  1643. };
  1644. static const struct clksel mcbsp_15_clksel[] = {
  1645. { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
  1646. { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
  1647. { .parent = NULL },
  1648. };
  1649. static const char *mcbsp1_fck_parent_names[] = {
  1650. "core_96m_fck", "mcbsp_clks",
  1651. };
  1652. DEFINE_CLK_OMAP_MUX_GATE(mcbsp1_fck, "core_l4_clkdm", mcbsp_15_clksel,
  1653. OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  1654. OMAP2_MCBSP1_CLKS_MASK,
  1655. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1656. OMAP3430_EN_MCBSP1_SHIFT, &clkhwops_wait,
  1657. mcbsp1_fck_parent_names, clkout2_src_ck_ops);
  1658. static struct clk mcbsp1_ick;
  1659. static struct clk_hw_omap mcbsp1_ick_hw = {
  1660. .hw = {
  1661. .clk = &mcbsp1_ick,
  1662. },
  1663. .ops = &clkhwops_iclk_wait,
  1664. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1665. .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
  1666. .clkdm_name = "core_l4_clkdm",
  1667. };
  1668. DEFINE_STRUCT_CLK(mcbsp1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1669. static struct clk per_96m_fck;
  1670. DEFINE_STRUCT_CLK_HW_OMAP(per_96m_fck, "per_clkdm");
  1671. DEFINE_STRUCT_CLK(per_96m_fck, cm_96m_fck_parent_names, core_l4_ick_ops);
  1672. static const struct clksel mcbsp_234_clksel[] = {
  1673. { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates },
  1674. { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
  1675. { .parent = NULL },
  1676. };
  1677. static const char *mcbsp2_fck_parent_names[] = {
  1678. "per_96m_fck", "mcbsp_clks",
  1679. };
  1680. DEFINE_CLK_OMAP_MUX_GATE(mcbsp2_fck, "per_clkdm", mcbsp_234_clksel,
  1681. OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
  1682. OMAP2_MCBSP2_CLKS_MASK,
  1683. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1684. OMAP3430_EN_MCBSP2_SHIFT, &clkhwops_wait,
  1685. mcbsp2_fck_parent_names, clkout2_src_ck_ops);
  1686. static struct clk mcbsp2_ick;
  1687. static struct clk_hw_omap mcbsp2_ick_hw = {
  1688. .hw = {
  1689. .clk = &mcbsp2_ick,
  1690. },
  1691. .ops = &clkhwops_iclk_wait,
  1692. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1693. .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
  1694. .clkdm_name = "per_clkdm",
  1695. };
  1696. DEFINE_STRUCT_CLK(mcbsp2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1697. DEFINE_CLK_OMAP_MUX_GATE(mcbsp3_fck, "per_clkdm", mcbsp_234_clksel,
  1698. OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
  1699. OMAP2_MCBSP3_CLKS_MASK,
  1700. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1701. OMAP3430_EN_MCBSP3_SHIFT, &clkhwops_wait,
  1702. mcbsp2_fck_parent_names, clkout2_src_ck_ops);
  1703. static struct clk mcbsp3_ick;
  1704. static struct clk_hw_omap mcbsp3_ick_hw = {
  1705. .hw = {
  1706. .clk = &mcbsp3_ick,
  1707. },
  1708. .ops = &clkhwops_iclk_wait,
  1709. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1710. .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
  1711. .clkdm_name = "per_clkdm",
  1712. };
  1713. DEFINE_STRUCT_CLK(mcbsp3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1714. DEFINE_CLK_OMAP_MUX_GATE(mcbsp4_fck, "per_clkdm", mcbsp_234_clksel,
  1715. OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
  1716. OMAP2_MCBSP4_CLKS_MASK,
  1717. OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1718. OMAP3430_EN_MCBSP4_SHIFT, &clkhwops_wait,
  1719. mcbsp2_fck_parent_names, clkout2_src_ck_ops);
  1720. static struct clk mcbsp4_ick;
  1721. static struct clk_hw_omap mcbsp4_ick_hw = {
  1722. .hw = {
  1723. .clk = &mcbsp4_ick,
  1724. },
  1725. .ops = &clkhwops_iclk_wait,
  1726. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1727. .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
  1728. .clkdm_name = "per_clkdm",
  1729. };
  1730. DEFINE_STRUCT_CLK(mcbsp4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1731. DEFINE_CLK_OMAP_MUX_GATE(mcbsp5_fck, "core_l4_clkdm", mcbsp_15_clksel,
  1732. OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
  1733. OMAP2_MCBSP5_CLKS_MASK,
  1734. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1735. OMAP3430_EN_MCBSP5_SHIFT, &clkhwops_wait,
  1736. mcbsp1_fck_parent_names, clkout2_src_ck_ops);
  1737. static struct clk mcbsp5_ick;
  1738. static struct clk_hw_omap mcbsp5_ick_hw = {
  1739. .hw = {
  1740. .clk = &mcbsp5_ick,
  1741. },
  1742. .ops = &clkhwops_iclk_wait,
  1743. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1744. .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
  1745. .clkdm_name = "core_l4_clkdm",
  1746. };
  1747. DEFINE_STRUCT_CLK(mcbsp5_ick, aes2_ick_parent_names, aes2_ick_ops);
  1748. static struct clk mcspi1_fck;
  1749. static struct clk_hw_omap mcspi1_fck_hw = {
  1750. .hw = {
  1751. .clk = &mcspi1_fck,
  1752. },
  1753. .ops = &clkhwops_wait,
  1754. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1755. .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
  1756. .clkdm_name = "core_l4_clkdm",
  1757. };
  1758. DEFINE_STRUCT_CLK(mcspi1_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1759. static struct clk mcspi1_ick;
  1760. static struct clk_hw_omap mcspi1_ick_hw = {
  1761. .hw = {
  1762. .clk = &mcspi1_ick,
  1763. },
  1764. .ops = &clkhwops_iclk_wait,
  1765. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1766. .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
  1767. .clkdm_name = "core_l4_clkdm",
  1768. };
  1769. DEFINE_STRUCT_CLK(mcspi1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1770. static struct clk mcspi2_fck;
  1771. static struct clk_hw_omap mcspi2_fck_hw = {
  1772. .hw = {
  1773. .clk = &mcspi2_fck,
  1774. },
  1775. .ops = &clkhwops_wait,
  1776. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1777. .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
  1778. .clkdm_name = "core_l4_clkdm",
  1779. };
  1780. DEFINE_STRUCT_CLK(mcspi2_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1781. static struct clk mcspi2_ick;
  1782. static struct clk_hw_omap mcspi2_ick_hw = {
  1783. .hw = {
  1784. .clk = &mcspi2_ick,
  1785. },
  1786. .ops = &clkhwops_iclk_wait,
  1787. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1788. .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
  1789. .clkdm_name = "core_l4_clkdm",
  1790. };
  1791. DEFINE_STRUCT_CLK(mcspi2_ick, aes2_ick_parent_names, aes2_ick_ops);
  1792. static struct clk mcspi3_fck;
  1793. static struct clk_hw_omap mcspi3_fck_hw = {
  1794. .hw = {
  1795. .clk = &mcspi3_fck,
  1796. },
  1797. .ops = &clkhwops_wait,
  1798. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1799. .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
  1800. .clkdm_name = "core_l4_clkdm",
  1801. };
  1802. DEFINE_STRUCT_CLK(mcspi3_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1803. static struct clk mcspi3_ick;
  1804. static struct clk_hw_omap mcspi3_ick_hw = {
  1805. .hw = {
  1806. .clk = &mcspi3_ick,
  1807. },
  1808. .ops = &clkhwops_iclk_wait,
  1809. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1810. .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
  1811. .clkdm_name = "core_l4_clkdm",
  1812. };
  1813. DEFINE_STRUCT_CLK(mcspi3_ick, aes2_ick_parent_names, aes2_ick_ops);
  1814. static struct clk mcspi4_fck;
  1815. static struct clk_hw_omap mcspi4_fck_hw = {
  1816. .hw = {
  1817. .clk = &mcspi4_fck,
  1818. },
  1819. .ops = &clkhwops_wait,
  1820. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1821. .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
  1822. .clkdm_name = "core_l4_clkdm",
  1823. };
  1824. DEFINE_STRUCT_CLK(mcspi4_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  1825. static struct clk mcspi4_ick;
  1826. static struct clk_hw_omap mcspi4_ick_hw = {
  1827. .hw = {
  1828. .clk = &mcspi4_ick,
  1829. },
  1830. .ops = &clkhwops_iclk_wait,
  1831. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1832. .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
  1833. .clkdm_name = "core_l4_clkdm",
  1834. };
  1835. DEFINE_STRUCT_CLK(mcspi4_ick, aes2_ick_parent_names, aes2_ick_ops);
  1836. static struct clk mmchs1_fck;
  1837. static struct clk_hw_omap mmchs1_fck_hw = {
  1838. .hw = {
  1839. .clk = &mmchs1_fck,
  1840. },
  1841. .ops = &clkhwops_wait,
  1842. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1843. .enable_bit = OMAP3430_EN_MMC1_SHIFT,
  1844. .clkdm_name = "core_l4_clkdm",
  1845. };
  1846. DEFINE_STRUCT_CLK(mmchs1_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1847. static struct clk mmchs1_ick;
  1848. static struct clk_hw_omap mmchs1_ick_hw = {
  1849. .hw = {
  1850. .clk = &mmchs1_ick,
  1851. },
  1852. .ops = &clkhwops_iclk_wait,
  1853. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1854. .enable_bit = OMAP3430_EN_MMC1_SHIFT,
  1855. .clkdm_name = "core_l4_clkdm",
  1856. };
  1857. DEFINE_STRUCT_CLK(mmchs1_ick, aes2_ick_parent_names, aes2_ick_ops);
  1858. static struct clk mmchs2_fck;
  1859. static struct clk_hw_omap mmchs2_fck_hw = {
  1860. .hw = {
  1861. .clk = &mmchs2_fck,
  1862. },
  1863. .ops = &clkhwops_wait,
  1864. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1865. .enable_bit = OMAP3430_EN_MMC2_SHIFT,
  1866. .clkdm_name = "core_l4_clkdm",
  1867. };
  1868. DEFINE_STRUCT_CLK(mmchs2_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1869. static struct clk mmchs2_ick;
  1870. static struct clk_hw_omap mmchs2_ick_hw = {
  1871. .hw = {
  1872. .clk = &mmchs2_ick,
  1873. },
  1874. .ops = &clkhwops_iclk_wait,
  1875. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1876. .enable_bit = OMAP3430_EN_MMC2_SHIFT,
  1877. .clkdm_name = "core_l4_clkdm",
  1878. };
  1879. DEFINE_STRUCT_CLK(mmchs2_ick, aes2_ick_parent_names, aes2_ick_ops);
  1880. static struct clk mmchs3_fck;
  1881. static struct clk_hw_omap mmchs3_fck_hw = {
  1882. .hw = {
  1883. .clk = &mmchs3_fck,
  1884. },
  1885. .ops = &clkhwops_wait,
  1886. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1887. .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
  1888. .clkdm_name = "core_l4_clkdm",
  1889. };
  1890. DEFINE_STRUCT_CLK(mmchs3_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1891. static struct clk mmchs3_ick;
  1892. static struct clk_hw_omap mmchs3_ick_hw = {
  1893. .hw = {
  1894. .clk = &mmchs3_ick,
  1895. },
  1896. .ops = &clkhwops_iclk_wait,
  1897. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1898. .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
  1899. .clkdm_name = "core_l4_clkdm",
  1900. };
  1901. DEFINE_STRUCT_CLK(mmchs3_ick, aes2_ick_parent_names, aes2_ick_ops);
  1902. static struct clk modem_fck;
  1903. static struct clk_hw_omap modem_fck_hw = {
  1904. .hw = {
  1905. .clk = &modem_fck,
  1906. },
  1907. .ops = &clkhwops_iclk_wait,
  1908. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1909. .enable_bit = OMAP3430_EN_MODEM_SHIFT,
  1910. .clkdm_name = "d2d_clkdm",
  1911. };
  1912. DEFINE_STRUCT_CLK(modem_fck, dpll3_ck_parent_names, aes2_ick_ops);
  1913. static struct clk mspro_fck;
  1914. static struct clk_hw_omap mspro_fck_hw = {
  1915. .hw = {
  1916. .clk = &mspro_fck,
  1917. },
  1918. .ops = &clkhwops_wait,
  1919. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1920. .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
  1921. .clkdm_name = "core_l4_clkdm",
  1922. };
  1923. DEFINE_STRUCT_CLK(mspro_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  1924. static struct clk mspro_ick;
  1925. static struct clk_hw_omap mspro_ick_hw = {
  1926. .hw = {
  1927. .clk = &mspro_ick,
  1928. },
  1929. .ops = &clkhwops_iclk_wait,
  1930. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1931. .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
  1932. .clkdm_name = "core_l4_clkdm",
  1933. };
  1934. DEFINE_STRUCT_CLK(mspro_ick, aes2_ick_parent_names, aes2_ick_ops);
  1935. static struct clk omap_192m_alwon_fck;
  1936. DEFINE_STRUCT_CLK_HW_OMAP(omap_192m_alwon_fck, NULL);
  1937. DEFINE_STRUCT_CLK(omap_192m_alwon_fck, omap_96m_alwon_fck_parent_names,
  1938. core_ck_ops);
  1939. static struct clk omap_32ksync_ick;
  1940. static struct clk_hw_omap omap_32ksync_ick_hw = {
  1941. .hw = {
  1942. .clk = &omap_32ksync_ick,
  1943. },
  1944. .ops = &clkhwops_iclk_wait,
  1945. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1946. .enable_bit = OMAP3430_EN_32KSYNC_SHIFT,
  1947. .clkdm_name = "wkup_clkdm",
  1948. };
  1949. DEFINE_STRUCT_CLK(omap_32ksync_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1950. static const struct clksel_rate omap_96m_alwon_fck_rates[] = {
  1951. { .div = 1, .val = 1, .flags = RATE_IN_36XX },
  1952. { .div = 2, .val = 2, .flags = RATE_IN_36XX },
  1953. { .div = 0 }
  1954. };
  1955. static const struct clksel omap_96m_alwon_fck_clksel[] = {
  1956. { .parent = &omap_192m_alwon_fck, .rates = omap_96m_alwon_fck_rates },
  1957. { .parent = NULL }
  1958. };
  1959. static struct clk omap_96m_alwon_fck_3630;
  1960. static const char *omap_96m_alwon_fck_3630_parent_names[] = {
  1961. "omap_192m_alwon_fck",
  1962. };
  1963. static const struct clk_ops omap_96m_alwon_fck_3630_ops = {
  1964. .set_rate = &omap2_clksel_set_rate,
  1965. .recalc_rate = &omap2_clksel_recalc,
  1966. .round_rate = &omap2_clksel_round_rate,
  1967. };
  1968. static struct clk_hw_omap omap_96m_alwon_fck_3630_hw = {
  1969. .hw = {
  1970. .clk = &omap_96m_alwon_fck_3630,
  1971. },
  1972. .clksel = omap_96m_alwon_fck_clksel,
  1973. .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1974. .clksel_mask = OMAP3630_CLKSEL_96M_MASK,
  1975. };
  1976. static struct clk omap_96m_alwon_fck_3630 = {
  1977. .name = "omap_96m_alwon_fck",
  1978. .hw = &omap_96m_alwon_fck_3630_hw.hw,
  1979. .parent_names = omap_96m_alwon_fck_3630_parent_names,
  1980. .num_parents = ARRAY_SIZE(omap_96m_alwon_fck_3630_parent_names),
  1981. .ops = &omap_96m_alwon_fck_3630_ops,
  1982. };
  1983. static struct clk omapctrl_ick;
  1984. static struct clk_hw_omap omapctrl_ick_hw = {
  1985. .hw = {
  1986. .clk = &omapctrl_ick,
  1987. },
  1988. .ops = &clkhwops_iclk_wait,
  1989. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1990. .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT,
  1991. .flags = ENABLE_ON_INIT,
  1992. .clkdm_name = "core_l4_clkdm",
  1993. };
  1994. DEFINE_STRUCT_CLK(omapctrl_ick, aes2_ick_parent_names, aes2_ick_ops);
  1995. DEFINE_CLK_DIVIDER(pclk_fck, "emu_src_ck", &emu_src_ck, 0x0,
  1996. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  1997. OMAP3430_CLKSEL_PCLK_SHIFT, OMAP3430_CLKSEL_PCLK_WIDTH,
  1998. CLK_DIVIDER_ONE_BASED, NULL);
  1999. DEFINE_CLK_DIVIDER(pclkx2_fck, "emu_src_ck", &emu_src_ck, 0x0,
  2000. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  2001. OMAP3430_CLKSEL_PCLKX2_SHIFT, OMAP3430_CLKSEL_PCLKX2_WIDTH,
  2002. CLK_DIVIDER_ONE_BASED, NULL);
  2003. static struct clk per_48m_fck;
  2004. DEFINE_STRUCT_CLK_HW_OMAP(per_48m_fck, "per_clkdm");
  2005. DEFINE_STRUCT_CLK(per_48m_fck, core_48m_fck_parent_names, core_l4_ick_ops);
  2006. static struct clk security_l3_ick;
  2007. DEFINE_STRUCT_CLK_HW_OMAP(security_l3_ick, NULL);
  2008. DEFINE_STRUCT_CLK(security_l3_ick, core_l3_ick_parent_names, core_ck_ops);
  2009. static struct clk pka_ick;
  2010. static const char *pka_ick_parent_names[] = {
  2011. "security_l3_ick",
  2012. };
  2013. static struct clk_hw_omap pka_ick_hw = {
  2014. .hw = {
  2015. .clk = &pka_ick,
  2016. },
  2017. .ops = &clkhwops_iclk_wait,
  2018. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  2019. .enable_bit = OMAP3430_EN_PKA_SHIFT,
  2020. };
  2021. DEFINE_STRUCT_CLK(pka_ick, pka_ick_parent_names, aes1_ick_ops);
  2022. DEFINE_CLK_DIVIDER(rm_ick, "l4_ick", &l4_ick, 0x0,
  2023. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
  2024. OMAP3430_CLKSEL_RM_SHIFT, OMAP3430_CLKSEL_RM_WIDTH,
  2025. CLK_DIVIDER_ONE_BASED, NULL);
  2026. static struct clk rng_ick;
  2027. static struct clk_hw_omap rng_ick_hw = {
  2028. .hw = {
  2029. .clk = &rng_ick,
  2030. },
  2031. .ops = &clkhwops_iclk_wait,
  2032. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  2033. .enable_bit = OMAP3430_EN_RNG_SHIFT,
  2034. };
  2035. DEFINE_STRUCT_CLK(rng_ick, aes1_ick_parent_names, aes1_ick_ops);
  2036. static struct clk sad2d_ick;
  2037. static struct clk_hw_omap sad2d_ick_hw = {
  2038. .hw = {
  2039. .clk = &sad2d_ick,
  2040. },
  2041. .ops = &clkhwops_iclk_wait,
  2042. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2043. .enable_bit = OMAP3430_EN_SAD2D_SHIFT,
  2044. .clkdm_name = "d2d_clkdm",
  2045. };
  2046. DEFINE_STRUCT_CLK(sad2d_ick, core_l3_ick_parent_names, aes2_ick_ops);
  2047. static struct clk sdrc_ick;
  2048. static struct clk_hw_omap sdrc_ick_hw = {
  2049. .hw = {
  2050. .clk = &sdrc_ick,
  2051. },
  2052. .ops = &clkhwops_wait,
  2053. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2054. .enable_bit = OMAP3430_EN_SDRC_SHIFT,
  2055. .flags = ENABLE_ON_INIT,
  2056. .clkdm_name = "core_l3_clkdm",
  2057. };
  2058. DEFINE_STRUCT_CLK(sdrc_ick, ipss_ick_parent_names, aes2_ick_ops);
  2059. static const struct clksel_rate sgx_core_rates[] = {
  2060. { .div = 2, .val = 5, .flags = RATE_IN_36XX },
  2061. { .div = 3, .val = 0, .flags = RATE_IN_3XXX },
  2062. { .div = 4, .val = 1, .flags = RATE_IN_3XXX },
  2063. { .div = 6, .val = 2, .flags = RATE_IN_3XXX },
  2064. { .div = 0 }
  2065. };
  2066. static const struct clksel_rate sgx_96m_rates[] = {
  2067. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  2068. { .div = 0 }
  2069. };
  2070. static const struct clksel_rate sgx_192m_rates[] = {
  2071. { .div = 1, .val = 4, .flags = RATE_IN_36XX },
  2072. { .div = 0 }
  2073. };
  2074. static const struct clksel_rate sgx_corex2_rates[] = {
  2075. { .div = 3, .val = 6, .flags = RATE_IN_36XX },
  2076. { .div = 5, .val = 7, .flags = RATE_IN_36XX },
  2077. { .div = 0 }
  2078. };
  2079. static const struct clksel sgx_clksel[] = {
  2080. { .parent = &core_ck, .rates = sgx_core_rates },
  2081. { .parent = &cm_96m_fck, .rates = sgx_96m_rates },
  2082. { .parent = &omap_192m_alwon_fck, .rates = sgx_192m_rates },
  2083. { .parent = &corex2_fck, .rates = sgx_corex2_rates },
  2084. { .parent = NULL },
  2085. };
  2086. static const char *sgx_fck_parent_names[] = {
  2087. "core_ck", "cm_96m_fck", "omap_192m_alwon_fck", "corex2_fck",
  2088. };
  2089. static struct clk sgx_fck;
  2090. static const struct clk_ops sgx_fck_ops = {
  2091. .init = &omap2_init_clk_clkdm,
  2092. .enable = &omap2_dflt_clk_enable,
  2093. .disable = &omap2_dflt_clk_disable,
  2094. .is_enabled = &omap2_dflt_clk_is_enabled,
  2095. .recalc_rate = &omap2_clksel_recalc,
  2096. .set_rate = &omap2_clksel_set_rate,
  2097. .round_rate = &omap2_clksel_round_rate,
  2098. .get_parent = &omap2_clksel_find_parent_index,
  2099. .set_parent = &omap2_clksel_set_parent,
  2100. };
  2101. DEFINE_CLK_OMAP_MUX_GATE(sgx_fck, "sgx_clkdm", sgx_clksel,
  2102. OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
  2103. OMAP3430ES2_CLKSEL_SGX_MASK,
  2104. OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
  2105. OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT,
  2106. &clkhwops_wait, sgx_fck_parent_names, sgx_fck_ops);
  2107. static struct clk sgx_ick;
  2108. static struct clk_hw_omap sgx_ick_hw = {
  2109. .hw = {
  2110. .clk = &sgx_ick,
  2111. },
  2112. .ops = &clkhwops_wait,
  2113. .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN),
  2114. .enable_bit = OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT,
  2115. .clkdm_name = "sgx_clkdm",
  2116. };
  2117. DEFINE_STRUCT_CLK(sgx_ick, core_l3_ick_parent_names, aes2_ick_ops);
  2118. static struct clk sha11_ick;
  2119. static struct clk_hw_omap sha11_ick_hw = {
  2120. .hw = {
  2121. .clk = &sha11_ick,
  2122. },
  2123. .ops = &clkhwops_iclk_wait,
  2124. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  2125. .enable_bit = OMAP3430_EN_SHA11_SHIFT,
  2126. };
  2127. DEFINE_STRUCT_CLK(sha11_ick, aes1_ick_parent_names, aes1_ick_ops);
  2128. static struct clk sha12_ick;
  2129. static struct clk_hw_omap sha12_ick_hw = {
  2130. .hw = {
  2131. .clk = &sha12_ick,
  2132. },
  2133. .ops = &clkhwops_iclk_wait,
  2134. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2135. .enable_bit = OMAP3430_EN_SHA12_SHIFT,
  2136. .clkdm_name = "core_l4_clkdm",
  2137. };
  2138. DEFINE_STRUCT_CLK(sha12_ick, aes2_ick_parent_names, aes2_ick_ops);
  2139. static struct clk sr1_fck;
  2140. static struct clk_hw_omap sr1_fck_hw = {
  2141. .hw = {
  2142. .clk = &sr1_fck,
  2143. },
  2144. .ops = &clkhwops_wait,
  2145. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  2146. .enable_bit = OMAP3430_EN_SR1_SHIFT,
  2147. .clkdm_name = "wkup_clkdm",
  2148. };
  2149. DEFINE_STRUCT_CLK(sr1_fck, dpll3_ck_parent_names, aes2_ick_ops);
  2150. static struct clk sr2_fck;
  2151. static struct clk_hw_omap sr2_fck_hw = {
  2152. .hw = {
  2153. .clk = &sr2_fck,
  2154. },
  2155. .ops = &clkhwops_wait,
  2156. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  2157. .enable_bit = OMAP3430_EN_SR2_SHIFT,
  2158. .clkdm_name = "wkup_clkdm",
  2159. };
  2160. DEFINE_STRUCT_CLK(sr2_fck, dpll3_ck_parent_names, aes2_ick_ops);
  2161. static struct clk sr_l4_ick;
  2162. DEFINE_STRUCT_CLK_HW_OMAP(sr_l4_ick, "core_l4_clkdm");
  2163. DEFINE_STRUCT_CLK(sr_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  2164. static struct clk ssi_l4_ick;
  2165. DEFINE_STRUCT_CLK_HW_OMAP(ssi_l4_ick, "core_l4_clkdm");
  2166. DEFINE_STRUCT_CLK(ssi_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  2167. static struct clk ssi_ick_3430es1;
  2168. static const char *ssi_ick_3430es1_parent_names[] = {
  2169. "ssi_l4_ick",
  2170. };
  2171. static struct clk_hw_omap ssi_ick_3430es1_hw = {
  2172. .hw = {
  2173. .clk = &ssi_ick_3430es1,
  2174. },
  2175. .ops = &clkhwops_iclk,
  2176. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2177. .enable_bit = OMAP3430_EN_SSI_SHIFT,
  2178. .clkdm_name = "core_l4_clkdm",
  2179. };
  2180. DEFINE_STRUCT_CLK(ssi_ick_3430es1, ssi_ick_3430es1_parent_names, aes2_ick_ops);
  2181. static struct clk ssi_ick_3430es2;
  2182. static struct clk_hw_omap ssi_ick_3430es2_hw = {
  2183. .hw = {
  2184. .clk = &ssi_ick_3430es2,
  2185. },
  2186. .ops = &clkhwops_omap3430es2_iclk_ssi_wait,
  2187. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2188. .enable_bit = OMAP3430_EN_SSI_SHIFT,
  2189. .clkdm_name = "core_l4_clkdm",
  2190. };
  2191. DEFINE_STRUCT_CLK(ssi_ick_3430es2, ssi_ick_3430es1_parent_names, aes2_ick_ops);
  2192. static const struct clksel_rate ssi_ssr_corex2_rates[] = {
  2193. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  2194. { .div = 2, .val = 2, .flags = RATE_IN_3XXX },
  2195. { .div = 3, .val = 3, .flags = RATE_IN_3XXX },
  2196. { .div = 4, .val = 4, .flags = RATE_IN_3XXX },
  2197. { .div = 6, .val = 6, .flags = RATE_IN_3XXX },
  2198. { .div = 8, .val = 8, .flags = RATE_IN_3XXX },
  2199. { .div = 0 }
  2200. };
  2201. static const struct clksel ssi_ssr_clksel[] = {
  2202. { .parent = &corex2_fck, .rates = ssi_ssr_corex2_rates },
  2203. { .parent = NULL },
  2204. };
  2205. static const char *ssi_ssr_fck_3430es1_parent_names[] = {
  2206. "corex2_fck",
  2207. };
  2208. static const struct clk_ops ssi_ssr_fck_3430es1_ops = {
  2209. .init = &omap2_init_clk_clkdm,
  2210. .enable = &omap2_dflt_clk_enable,
  2211. .disable = &omap2_dflt_clk_disable,
  2212. .is_enabled = &omap2_dflt_clk_is_enabled,
  2213. .recalc_rate = &omap2_clksel_recalc,
  2214. .set_rate = &omap2_clksel_set_rate,
  2215. .round_rate = &omap2_clksel_round_rate,
  2216. };
  2217. DEFINE_CLK_OMAP_MUX_GATE(ssi_ssr_fck_3430es1, "core_l4_clkdm",
  2218. ssi_ssr_clksel, OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  2219. OMAP3430_CLKSEL_SSI_MASK,
  2220. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  2221. OMAP3430_EN_SSI_SHIFT,
  2222. NULL, ssi_ssr_fck_3430es1_parent_names,
  2223. ssi_ssr_fck_3430es1_ops);
  2224. DEFINE_CLK_OMAP_MUX_GATE(ssi_ssr_fck_3430es2, "core_l4_clkdm",
  2225. ssi_ssr_clksel, OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  2226. OMAP3430_CLKSEL_SSI_MASK,
  2227. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  2228. OMAP3430_EN_SSI_SHIFT,
  2229. NULL, ssi_ssr_fck_3430es1_parent_names,
  2230. ssi_ssr_fck_3430es1_ops);
  2231. DEFINE_CLK_FIXED_FACTOR(ssi_sst_fck_3430es1, "ssi_ssr_fck_3430es1",
  2232. &ssi_ssr_fck_3430es1, 0x0, 1, 2);
  2233. DEFINE_CLK_FIXED_FACTOR(ssi_sst_fck_3430es2, "ssi_ssr_fck_3430es2",
  2234. &ssi_ssr_fck_3430es2, 0x0, 1, 2);
  2235. static struct clk sys_clkout1;
  2236. static const char *sys_clkout1_parent_names[] = {
  2237. "osc_sys_ck",
  2238. };
  2239. static struct clk_hw_omap sys_clkout1_hw = {
  2240. .hw = {
  2241. .clk = &sys_clkout1,
  2242. },
  2243. .enable_reg = OMAP3430_PRM_CLKOUT_CTRL,
  2244. .enable_bit = OMAP3430_CLKOUT_EN_SHIFT,
  2245. };
  2246. DEFINE_STRUCT_CLK(sys_clkout1, sys_clkout1_parent_names, aes1_ick_ops);
  2247. DEFINE_CLK_DIVIDER(sys_clkout2, "clkout2_src_ck", &clkout2_src_ck, 0x0,
  2248. OMAP3430_CM_CLKOUT_CTRL, OMAP3430_CLKOUT2_DIV_SHIFT,
  2249. OMAP3430_CLKOUT2_DIV_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
  2250. DEFINE_CLK_MUX(traceclk_src_fck, emu_src_ck_parent_names, NULL, 0x0,
  2251. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  2252. OMAP3430_TRACE_MUX_CTRL_SHIFT, OMAP3430_TRACE_MUX_CTRL_WIDTH,
  2253. 0x0, NULL);
  2254. DEFINE_CLK_DIVIDER(traceclk_fck, "traceclk_src_fck", &traceclk_src_fck, 0x0,
  2255. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  2256. OMAP3430_CLKSEL_TRACECLK_SHIFT,
  2257. OMAP3430_CLKSEL_TRACECLK_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
  2258. static struct clk ts_fck;
  2259. static struct clk_hw_omap ts_fck_hw = {
  2260. .hw = {
  2261. .clk = &ts_fck,
  2262. },
  2263. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
  2264. .enable_bit = OMAP3430ES2_EN_TS_SHIFT,
  2265. .clkdm_name = "core_l4_clkdm",
  2266. };
  2267. DEFINE_STRUCT_CLK(ts_fck, wkup_32k_fck_parent_names, aes2_ick_ops);
  2268. static struct clk uart1_fck;
  2269. static struct clk_hw_omap uart1_fck_hw = {
  2270. .hw = {
  2271. .clk = &uart1_fck,
  2272. },
  2273. .ops = &clkhwops_wait,
  2274. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  2275. .enable_bit = OMAP3430_EN_UART1_SHIFT,
  2276. .clkdm_name = "core_l4_clkdm",
  2277. };
  2278. DEFINE_STRUCT_CLK(uart1_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  2279. static struct clk uart1_ick;
  2280. static struct clk_hw_omap uart1_ick_hw = {
  2281. .hw = {
  2282. .clk = &uart1_ick,
  2283. },
  2284. .ops = &clkhwops_iclk_wait,
  2285. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2286. .enable_bit = OMAP3430_EN_UART1_SHIFT,
  2287. .clkdm_name = "core_l4_clkdm",
  2288. };
  2289. DEFINE_STRUCT_CLK(uart1_ick, aes2_ick_parent_names, aes2_ick_ops);
  2290. static struct clk uart2_fck;
  2291. static struct clk_hw_omap uart2_fck_hw = {
  2292. .hw = {
  2293. .clk = &uart2_fck,
  2294. },
  2295. .ops = &clkhwops_wait,
  2296. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  2297. .enable_bit = OMAP3430_EN_UART2_SHIFT,
  2298. .clkdm_name = "core_l4_clkdm",
  2299. };
  2300. DEFINE_STRUCT_CLK(uart2_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  2301. static struct clk uart2_ick;
  2302. static struct clk_hw_omap uart2_ick_hw = {
  2303. .hw = {
  2304. .clk = &uart2_ick,
  2305. },
  2306. .ops = &clkhwops_iclk_wait,
  2307. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2308. .enable_bit = OMAP3430_EN_UART2_SHIFT,
  2309. .clkdm_name = "core_l4_clkdm",
  2310. };
  2311. DEFINE_STRUCT_CLK(uart2_ick, aes2_ick_parent_names, aes2_ick_ops);
  2312. static struct clk uart3_fck;
  2313. static const char *uart3_fck_parent_names[] = {
  2314. "per_48m_fck",
  2315. };
  2316. static struct clk_hw_omap uart3_fck_hw = {
  2317. .hw = {
  2318. .clk = &uart3_fck,
  2319. },
  2320. .ops = &clkhwops_wait,
  2321. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  2322. .enable_bit = OMAP3430_EN_UART3_SHIFT,
  2323. .clkdm_name = "per_clkdm",
  2324. };
  2325. DEFINE_STRUCT_CLK(uart3_fck, uart3_fck_parent_names, aes2_ick_ops);
  2326. static struct clk uart3_ick;
  2327. static struct clk_hw_omap uart3_ick_hw = {
  2328. .hw = {
  2329. .clk = &uart3_ick,
  2330. },
  2331. .ops = &clkhwops_iclk_wait,
  2332. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  2333. .enable_bit = OMAP3430_EN_UART3_SHIFT,
  2334. .clkdm_name = "per_clkdm",
  2335. };
  2336. DEFINE_STRUCT_CLK(uart3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  2337. static struct clk uart4_fck;
  2338. static struct clk_hw_omap uart4_fck_hw = {
  2339. .hw = {
  2340. .clk = &uart4_fck,
  2341. },
  2342. .ops = &clkhwops_wait,
  2343. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  2344. .enable_bit = OMAP3630_EN_UART4_SHIFT,
  2345. .clkdm_name = "per_clkdm",
  2346. };
  2347. DEFINE_STRUCT_CLK(uart4_fck, uart3_fck_parent_names, aes2_ick_ops);
  2348. static struct clk uart4_fck_am35xx;
  2349. static struct clk_hw_omap uart4_fck_am35xx_hw = {
  2350. .hw = {
  2351. .clk = &uart4_fck_am35xx,
  2352. },
  2353. .ops = &clkhwops_wait,
  2354. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  2355. .enable_bit = AM35XX_EN_UART4_SHIFT,
  2356. .clkdm_name = "core_l4_clkdm",
  2357. };
  2358. DEFINE_STRUCT_CLK(uart4_fck_am35xx, fshostusb_fck_parent_names, aes2_ick_ops);
  2359. static struct clk uart4_ick;
  2360. static struct clk_hw_omap uart4_ick_hw = {
  2361. .hw = {
  2362. .clk = &uart4_ick,
  2363. },
  2364. .ops = &clkhwops_iclk_wait,
  2365. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  2366. .enable_bit = OMAP3630_EN_UART4_SHIFT,
  2367. .clkdm_name = "per_clkdm",
  2368. };
  2369. DEFINE_STRUCT_CLK(uart4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  2370. static struct clk uart4_ick_am35xx;
  2371. static struct clk_hw_omap uart4_ick_am35xx_hw = {
  2372. .hw = {
  2373. .clk = &uart4_ick_am35xx,
  2374. },
  2375. .ops = &clkhwops_iclk_wait,
  2376. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2377. .enable_bit = AM35XX_EN_UART4_SHIFT,
  2378. .clkdm_name = "core_l4_clkdm",
  2379. };
  2380. DEFINE_STRUCT_CLK(uart4_ick_am35xx, aes2_ick_parent_names, aes2_ick_ops);
  2381. static const struct clksel_rate div2_rates[] = {
  2382. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  2383. { .div = 2, .val = 2, .flags = RATE_IN_3XXX },
  2384. { .div = 0 }
  2385. };
  2386. static const struct clksel usb_l4_clksel[] = {
  2387. { .parent = &l4_ick, .rates = div2_rates },
  2388. { .parent = NULL },
  2389. };
  2390. static const char *usb_l4_ick_parent_names[] = {
  2391. "l4_ick",
  2392. };
  2393. DEFINE_CLK_OMAP_MUX_GATE(usb_l4_ick, "core_l4_clkdm", usb_l4_clksel,
  2394. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  2395. OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK,
  2396. OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  2397. OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
  2398. &clkhwops_iclk_wait, usb_l4_ick_parent_names,
  2399. ssi_ssr_fck_3430es1_ops);
  2400. static struct clk usbhost_120m_fck;
  2401. static const char *usbhost_120m_fck_parent_names[] = {
  2402. "dpll5_m2_ck",
  2403. };
  2404. static struct clk_hw_omap usbhost_120m_fck_hw = {
  2405. .hw = {
  2406. .clk = &usbhost_120m_fck,
  2407. },
  2408. .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
  2409. .enable_bit = OMAP3430ES2_EN_USBHOST2_SHIFT,
  2410. .clkdm_name = "usbhost_clkdm",
  2411. };
  2412. DEFINE_STRUCT_CLK(usbhost_120m_fck, usbhost_120m_fck_parent_names,
  2413. aes2_ick_ops);
  2414. static struct clk usbhost_48m_fck;
  2415. static struct clk_hw_omap usbhost_48m_fck_hw = {
  2416. .hw = {
  2417. .clk = &usbhost_48m_fck,
  2418. },
  2419. .ops = &clkhwops_omap3430es2_dss_usbhost_wait,
  2420. .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
  2421. .enable_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
  2422. .clkdm_name = "usbhost_clkdm",
  2423. };
  2424. DEFINE_STRUCT_CLK(usbhost_48m_fck, core_48m_fck_parent_names, aes2_ick_ops);
  2425. static struct clk usbhost_ick;
  2426. static struct clk_hw_omap usbhost_ick_hw = {
  2427. .hw = {
  2428. .clk = &usbhost_ick,
  2429. },
  2430. .ops = &clkhwops_omap3430es2_iclk_dss_usbhost_wait,
  2431. .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
  2432. .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT,
  2433. .clkdm_name = "usbhost_clkdm",
  2434. };
  2435. DEFINE_STRUCT_CLK(usbhost_ick, security_l4_ick2_parent_names, aes2_ick_ops);
  2436. static struct clk usbtll_fck;
  2437. static struct clk_hw_omap usbtll_fck_hw = {
  2438. .hw = {
  2439. .clk = &usbtll_fck,
  2440. },
  2441. .ops = &clkhwops_wait,
  2442. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
  2443. .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
  2444. .clkdm_name = "core_l4_clkdm",
  2445. };
  2446. DEFINE_STRUCT_CLK(usbtll_fck, usbhost_120m_fck_parent_names, aes2_ick_ops);
  2447. static struct clk usbtll_ick;
  2448. static struct clk_hw_omap usbtll_ick_hw = {
  2449. .hw = {
  2450. .clk = &usbtll_ick,
  2451. },
  2452. .ops = &clkhwops_iclk_wait,
  2453. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
  2454. .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
  2455. .clkdm_name = "core_l4_clkdm",
  2456. };
  2457. DEFINE_STRUCT_CLK(usbtll_ick, aes2_ick_parent_names, aes2_ick_ops);
  2458. static const struct clksel_rate usim_96m_rates[] = {
  2459. { .div = 2, .val = 3, .flags = RATE_IN_3XXX },
  2460. { .div = 4, .val = 4, .flags = RATE_IN_3XXX },
  2461. { .div = 8, .val = 5, .flags = RATE_IN_3XXX },
  2462. { .div = 10, .val = 6, .flags = RATE_IN_3XXX },
  2463. { .div = 0 }
  2464. };
  2465. static const struct clksel_rate usim_120m_rates[] = {
  2466. { .div = 4, .val = 7, .flags = RATE_IN_3XXX },
  2467. { .div = 8, .val = 8, .flags = RATE_IN_3XXX },
  2468. { .div = 16, .val = 9, .flags = RATE_IN_3XXX },
  2469. { .div = 20, .val = 10, .flags = RATE_IN_3XXX },
  2470. { .div = 0 }
  2471. };
  2472. static const struct clksel usim_clksel[] = {
  2473. { .parent = &omap_96m_fck, .rates = usim_96m_rates },
  2474. { .parent = &dpll5_m2_ck, .rates = usim_120m_rates },
  2475. { .parent = &sys_ck, .rates = div2_rates },
  2476. { .parent = NULL },
  2477. };
  2478. static const char *usim_fck_parent_names[] = {
  2479. "omap_96m_fck", "dpll5_m2_ck", "sys_ck",
  2480. };
  2481. static struct clk usim_fck;
  2482. static const struct clk_ops usim_fck_ops = {
  2483. .enable = &omap2_dflt_clk_enable,
  2484. .disable = &omap2_dflt_clk_disable,
  2485. .is_enabled = &omap2_dflt_clk_is_enabled,
  2486. .recalc_rate = &omap2_clksel_recalc,
  2487. .get_parent = &omap2_clksel_find_parent_index,
  2488. .set_parent = &omap2_clksel_set_parent,
  2489. };
  2490. DEFINE_CLK_OMAP_MUX_GATE(usim_fck, NULL, usim_clksel,
  2491. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
  2492. OMAP3430ES2_CLKSEL_USIMOCP_MASK,
  2493. OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  2494. OMAP3430ES2_EN_USIMOCP_SHIFT, &clkhwops_wait,
  2495. usim_fck_parent_names, usim_fck_ops);
  2496. static struct clk usim_ick;
  2497. static struct clk_hw_omap usim_ick_hw = {
  2498. .hw = {
  2499. .clk = &usim_ick,
  2500. },
  2501. .ops = &clkhwops_iclk_wait,
  2502. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  2503. .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
  2504. .clkdm_name = "wkup_clkdm",
  2505. };
  2506. DEFINE_STRUCT_CLK(usim_ick, gpio1_ick_parent_names, aes2_ick_ops);
  2507. static struct clk vpfe_fck;
  2508. static const char *vpfe_fck_parent_names[] = {
  2509. "pclk_ck",
  2510. };
  2511. static struct clk_hw_omap vpfe_fck_hw = {
  2512. .hw = {
  2513. .clk = &vpfe_fck,
  2514. },
  2515. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  2516. .enable_bit = AM35XX_VPFE_FCLK_SHIFT,
  2517. };
  2518. DEFINE_STRUCT_CLK(vpfe_fck, vpfe_fck_parent_names, aes1_ick_ops);
  2519. static struct clk vpfe_ick;
  2520. static struct clk_hw_omap vpfe_ick_hw = {
  2521. .hw = {
  2522. .clk = &vpfe_ick,
  2523. },
  2524. .ops = &clkhwops_am35xx_ipss_module_wait,
  2525. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  2526. .enable_bit = AM35XX_VPFE_VBUSP_CLK_SHIFT,
  2527. .clkdm_name = "core_l3_clkdm",
  2528. };
  2529. DEFINE_STRUCT_CLK(vpfe_ick, emac_ick_parent_names, aes2_ick_ops);
  2530. static struct clk wdt1_fck;
  2531. DEFINE_STRUCT_CLK_HW_OMAP(wdt1_fck, "wkup_clkdm");
  2532. DEFINE_STRUCT_CLK(wdt1_fck, gpt12_fck_parent_names, core_l4_ick_ops);
  2533. static struct clk wdt1_ick;
  2534. static struct clk_hw_omap wdt1_ick_hw = {
  2535. .hw = {
  2536. .clk = &wdt1_ick,
  2537. },
  2538. .ops = &clkhwops_iclk_wait,
  2539. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  2540. .enable_bit = OMAP3430_EN_WDT1_SHIFT,
  2541. .clkdm_name = "wkup_clkdm",
  2542. };
  2543. DEFINE_STRUCT_CLK(wdt1_ick, gpio1_ick_parent_names, aes2_ick_ops);
  2544. static struct clk wdt2_fck;
  2545. static struct clk_hw_omap wdt2_fck_hw = {
  2546. .hw = {
  2547. .clk = &wdt2_fck,
  2548. },
  2549. .ops = &clkhwops_wait,
  2550. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  2551. .enable_bit = OMAP3430_EN_WDT2_SHIFT,
  2552. .clkdm_name = "wkup_clkdm",
  2553. };
  2554. DEFINE_STRUCT_CLK(wdt2_fck, gpio1_dbck_parent_names, aes2_ick_ops);
  2555. static struct clk wdt2_ick;
  2556. static struct clk_hw_omap wdt2_ick_hw = {
  2557. .hw = {
  2558. .clk = &wdt2_ick,
  2559. },
  2560. .ops = &clkhwops_iclk_wait,
  2561. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  2562. .enable_bit = OMAP3430_EN_WDT2_SHIFT,
  2563. .clkdm_name = "wkup_clkdm",
  2564. };
  2565. DEFINE_STRUCT_CLK(wdt2_ick, gpio1_ick_parent_names, aes2_ick_ops);
  2566. static struct clk wdt3_fck;
  2567. static struct clk_hw_omap wdt3_fck_hw = {
  2568. .hw = {
  2569. .clk = &wdt3_fck,
  2570. },
  2571. .ops = &clkhwops_wait,
  2572. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  2573. .enable_bit = OMAP3430_EN_WDT3_SHIFT,
  2574. .clkdm_name = "per_clkdm",
  2575. };
  2576. DEFINE_STRUCT_CLK(wdt3_fck, gpio2_dbck_parent_names, aes2_ick_ops);
  2577. static struct clk wdt3_ick;
  2578. static struct clk_hw_omap wdt3_ick_hw = {
  2579. .hw = {
  2580. .clk = &wdt3_ick,
  2581. },
  2582. .ops = &clkhwops_iclk_wait,
  2583. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  2584. .enable_bit = OMAP3430_EN_WDT3_SHIFT,
  2585. .clkdm_name = "per_clkdm",
  2586. };
  2587. DEFINE_STRUCT_CLK(wdt3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  2588. /*
  2589. * clocks specific to omap3430es1
  2590. */
  2591. static struct omap_clk omap3430es1_clks[] = {
  2592. CLK(NULL, "gfx_l3_ck", &gfx_l3_ck),
  2593. CLK(NULL, "gfx_l3_fck", &gfx_l3_fck),
  2594. CLK(NULL, "gfx_l3_ick", &gfx_l3_ick),
  2595. CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck),
  2596. CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck),
  2597. CLK(NULL, "d2d_26m_fck", &d2d_26m_fck),
  2598. CLK(NULL, "fshostusb_fck", &fshostusb_fck),
  2599. CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1),
  2600. CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1),
  2601. CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es1),
  2602. CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_3430es1),
  2603. CLK(NULL, "fac_ick", &fac_ick),
  2604. CLK(NULL, "ssi_ick", &ssi_ick_3430es1),
  2605. CLK(NULL, "usb_l4_ick", &usb_l4_ick),
  2606. CLK(NULL, "dss1_alwon_fck", &dss1_alwon_fck_3430es1),
  2607. CLK("omapdss_dss", "ick", &dss_ick_3430es1),
  2608. CLK(NULL, "dss_ick", &dss_ick_3430es1),
  2609. };
  2610. /*
  2611. * clocks specific to am35xx
  2612. */
  2613. static struct omap_clk am35xx_clks[] = {
  2614. CLK(NULL, "ipss_ick", &ipss_ick),
  2615. CLK(NULL, "rmii_ck", &rmii_ck),
  2616. CLK(NULL, "pclk_ck", &pclk_ck),
  2617. CLK(NULL, "emac_ick", &emac_ick),
  2618. CLK(NULL, "emac_fck", &emac_fck),
  2619. CLK("davinci_emac.0", NULL, &emac_ick),
  2620. CLK("davinci_mdio.0", NULL, &emac_fck),
  2621. CLK("vpfe-capture", "master", &vpfe_ick),
  2622. CLK("vpfe-capture", "slave", &vpfe_fck),
  2623. CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_am35xx),
  2624. CLK(NULL, "hsotgusb_fck", &hsotgusb_fck_am35xx),
  2625. CLK(NULL, "hecc_ck", &hecc_ck),
  2626. CLK(NULL, "uart4_ick", &uart4_ick_am35xx),
  2627. CLK(NULL, "uart4_fck", &uart4_fck_am35xx),
  2628. };
  2629. /*
  2630. * clocks specific to omap36xx
  2631. */
  2632. static struct omap_clk omap36xx_clks[] = {
  2633. CLK(NULL, "omap_192m_alwon_fck", &omap_192m_alwon_fck),
  2634. CLK(NULL, "uart4_fck", &uart4_fck),
  2635. };
  2636. /*
  2637. * clocks common to omap36xx omap34xx
  2638. */
  2639. static struct omap_clk omap34xx_omap36xx_clks[] = {
  2640. CLK(NULL, "aes1_ick", &aes1_ick),
  2641. CLK("omap_rng", "ick", &rng_ick),
  2642. CLK("omap3-rom-rng", "ick", &rng_ick),
  2643. CLK(NULL, "sha11_ick", &sha11_ick),
  2644. CLK(NULL, "des1_ick", &des1_ick),
  2645. CLK(NULL, "cam_mclk", &cam_mclk),
  2646. CLK(NULL, "cam_ick", &cam_ick),
  2647. CLK(NULL, "csi2_96m_fck", &csi2_96m_fck),
  2648. CLK(NULL, "security_l3_ick", &security_l3_ick),
  2649. CLK(NULL, "pka_ick", &pka_ick),
  2650. CLK(NULL, "icr_ick", &icr_ick),
  2651. CLK("omap-aes", "ick", &aes2_ick),
  2652. CLK("omap-sham", "ick", &sha12_ick),
  2653. CLK(NULL, "des2_ick", &des2_ick),
  2654. CLK(NULL, "mspro_ick", &mspro_ick),
  2655. CLK(NULL, "mailboxes_ick", &mailboxes_ick),
  2656. CLK(NULL, "ssi_l4_ick", &ssi_l4_ick),
  2657. CLK(NULL, "sr1_fck", &sr1_fck),
  2658. CLK(NULL, "sr2_fck", &sr2_fck),
  2659. CLK(NULL, "sr_l4_ick", &sr_l4_ick),
  2660. CLK(NULL, "security_l4_ick2", &security_l4_ick2),
  2661. CLK(NULL, "wkup_l4_ick", &wkup_l4_ick),
  2662. CLK(NULL, "dpll2_fck", &dpll2_fck),
  2663. CLK(NULL, "iva2_ck", &iva2_ck),
  2664. CLK(NULL, "modem_fck", &modem_fck),
  2665. CLK(NULL, "sad2d_ick", &sad2d_ick),
  2666. CLK(NULL, "mad2d_ick", &mad2d_ick),
  2667. CLK(NULL, "mspro_fck", &mspro_fck),
  2668. CLK(NULL, "dpll2_ck", &dpll2_ck),
  2669. CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck),
  2670. };
  2671. /*
  2672. * clocks common to omap36xx and omap3430es2plus
  2673. */
  2674. static struct omap_clk omap36xx_omap3430es2plus_clks[] = {
  2675. CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2),
  2676. CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2),
  2677. CLK("musb-omap2430", "ick", &hsotgusb_ick_3430es2),
  2678. CLK(NULL, "hsotgusb_ick", &hsotgusb_ick_3430es2),
  2679. CLK(NULL, "ssi_ick", &ssi_ick_3430es2),
  2680. CLK(NULL, "usim_fck", &usim_fck),
  2681. CLK(NULL, "usim_ick", &usim_ick),
  2682. };
  2683. /*
  2684. * clocks common to am35xx omap36xx and omap3430es2plus
  2685. */
  2686. static struct omap_clk omap36xx_am35xx_omap3430es2plus_clks[] = {
  2687. CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck),
  2688. CLK(NULL, "dpll5_ck", &dpll5_ck),
  2689. CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck),
  2690. CLK(NULL, "sgx_fck", &sgx_fck),
  2691. CLK(NULL, "sgx_ick", &sgx_ick),
  2692. CLK(NULL, "cpefuse_fck", &cpefuse_fck),
  2693. CLK(NULL, "ts_fck", &ts_fck),
  2694. CLK(NULL, "usbtll_fck", &usbtll_fck),
  2695. CLK(NULL, "usbtll_ick", &usbtll_ick),
  2696. CLK("omap_hsmmc.2", "ick", &mmchs3_ick),
  2697. CLK(NULL, "mmchs3_ick", &mmchs3_ick),
  2698. CLK(NULL, "mmchs3_fck", &mmchs3_fck),
  2699. CLK(NULL, "dss1_alwon_fck", &dss1_alwon_fck_3430es2),
  2700. CLK("omapdss_dss", "ick", &dss_ick_3430es2),
  2701. CLK(NULL, "dss_ick", &dss_ick_3430es2),
  2702. CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck),
  2703. CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck),
  2704. CLK(NULL, "usbhost_ick", &usbhost_ick),
  2705. };
  2706. /*
  2707. * common clocks
  2708. */
  2709. static struct omap_clk omap3xxx_clks[] = {
  2710. CLK(NULL, "apb_pclk", &dummy_apb_pclk),
  2711. CLK(NULL, "omap_32k_fck", &omap_32k_fck),
  2712. CLK(NULL, "virt_12m_ck", &virt_12m_ck),
  2713. CLK(NULL, "virt_13m_ck", &virt_13m_ck),
  2714. CLK(NULL, "virt_19200000_ck", &virt_19200000_ck),
  2715. CLK(NULL, "virt_26000000_ck", &virt_26000000_ck),
  2716. CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck),
  2717. CLK(NULL, "osc_sys_ck", &osc_sys_ck),
  2718. CLK("twl", "fck", &osc_sys_ck),
  2719. CLK(NULL, "sys_ck", &sys_ck),
  2720. CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck),
  2721. CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck),
  2722. CLK(NULL, "sys_altclk", &sys_altclk),
  2723. CLK(NULL, "mcbsp_clks", &mcbsp_clks),
  2724. CLK(NULL, "sys_clkout1", &sys_clkout1),
  2725. CLK(NULL, "dpll1_ck", &dpll1_ck),
  2726. CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck),
  2727. CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck),
  2728. CLK(NULL, "dpll3_ck", &dpll3_ck),
  2729. CLK(NULL, "core_ck", &core_ck),
  2730. CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck),
  2731. CLK(NULL, "dpll3_m2_ck", &dpll3_m2_ck),
  2732. CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck),
  2733. CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck),
  2734. CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck),
  2735. CLK(NULL, "dpll4_ck", &dpll4_ck),
  2736. CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck),
  2737. CLK(NULL, "omap_96m_fck", &omap_96m_fck),
  2738. CLK(NULL, "cm_96m_fck", &cm_96m_fck),
  2739. CLK(NULL, "omap_54m_fck", &omap_54m_fck),
  2740. CLK(NULL, "omap_48m_fck", &omap_48m_fck),
  2741. CLK(NULL, "omap_12m_fck", &omap_12m_fck),
  2742. CLK(NULL, "dpll4_m2_ck", &dpll4_m2_ck),
  2743. CLK(NULL, "dpll4_m2x2_ck", &dpll4_m2x2_ck),
  2744. CLK(NULL, "dpll4_m3_ck", &dpll4_m3_ck),
  2745. CLK(NULL, "dpll4_m3x2_ck", &dpll4_m3x2_ck),
  2746. CLK(NULL, "dpll4_m4_ck", &dpll4_m4_ck),
  2747. CLK(NULL, "dpll4_m4x2_ck", &dpll4_m4x2_ck),
  2748. CLK(NULL, "dpll4_m5_ck", &dpll4_m5_ck),
  2749. CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck),
  2750. CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck),
  2751. CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck),
  2752. CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck),
  2753. CLK(NULL, "clkout2_src_ck", &clkout2_src_ck),
  2754. CLK(NULL, "sys_clkout2", &sys_clkout2),
  2755. CLK(NULL, "corex2_fck", &corex2_fck),
  2756. CLK(NULL, "dpll1_fck", &dpll1_fck),
  2757. CLK(NULL, "mpu_ck", &mpu_ck),
  2758. CLK(NULL, "arm_fck", &arm_fck),
  2759. CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck),
  2760. CLK(NULL, "l3_ick", &l3_ick),
  2761. CLK(NULL, "l4_ick", &l4_ick),
  2762. CLK(NULL, "rm_ick", &rm_ick),
  2763. CLK(NULL, "gpt10_fck", &gpt10_fck),
  2764. CLK(NULL, "gpt11_fck", &gpt11_fck),
  2765. CLK(NULL, "core_96m_fck", &core_96m_fck),
  2766. CLK(NULL, "mmchs2_fck", &mmchs2_fck),
  2767. CLK(NULL, "mmchs1_fck", &mmchs1_fck),
  2768. CLK(NULL, "i2c3_fck", &i2c3_fck),
  2769. CLK(NULL, "i2c2_fck", &i2c2_fck),
  2770. CLK(NULL, "i2c1_fck", &i2c1_fck),
  2771. CLK(NULL, "mcbsp5_fck", &mcbsp5_fck),
  2772. CLK(NULL, "mcbsp1_fck", &mcbsp1_fck),
  2773. CLK(NULL, "core_48m_fck", &core_48m_fck),
  2774. CLK(NULL, "mcspi4_fck", &mcspi4_fck),
  2775. CLK(NULL, "mcspi3_fck", &mcspi3_fck),
  2776. CLK(NULL, "mcspi2_fck", &mcspi2_fck),
  2777. CLK(NULL, "mcspi1_fck", &mcspi1_fck),
  2778. CLK(NULL, "uart2_fck", &uart2_fck),
  2779. CLK(NULL, "uart1_fck", &uart1_fck),
  2780. CLK(NULL, "core_12m_fck", &core_12m_fck),
  2781. CLK("omap_hdq.0", "fck", &hdq_fck),
  2782. CLK(NULL, "hdq_fck", &hdq_fck),
  2783. CLK(NULL, "core_l3_ick", &core_l3_ick),
  2784. CLK(NULL, "sdrc_ick", &sdrc_ick),
  2785. CLK(NULL, "gpmc_fck", &gpmc_fck),
  2786. CLK(NULL, "core_l4_ick", &core_l4_ick),
  2787. CLK("omap_hsmmc.1", "ick", &mmchs2_ick),
  2788. CLK("omap_hsmmc.0", "ick", &mmchs1_ick),
  2789. CLK(NULL, "mmchs2_ick", &mmchs2_ick),
  2790. CLK(NULL, "mmchs1_ick", &mmchs1_ick),
  2791. CLK("omap_hdq.0", "ick", &hdq_ick),
  2792. CLK(NULL, "hdq_ick", &hdq_ick),
  2793. CLK("omap2_mcspi.4", "ick", &mcspi4_ick),
  2794. CLK("omap2_mcspi.3", "ick", &mcspi3_ick),
  2795. CLK("omap2_mcspi.2", "ick", &mcspi2_ick),
  2796. CLK("omap2_mcspi.1", "ick", &mcspi1_ick),
  2797. CLK(NULL, "mcspi4_ick", &mcspi4_ick),
  2798. CLK(NULL, "mcspi3_ick", &mcspi3_ick),
  2799. CLK(NULL, "mcspi2_ick", &mcspi2_ick),
  2800. CLK(NULL, "mcspi1_ick", &mcspi1_ick),
  2801. CLK("omap_i2c.3", "ick", &i2c3_ick),
  2802. CLK("omap_i2c.2", "ick", &i2c2_ick),
  2803. CLK("omap_i2c.1", "ick", &i2c1_ick),
  2804. CLK(NULL, "i2c3_ick", &i2c3_ick),
  2805. CLK(NULL, "i2c2_ick", &i2c2_ick),
  2806. CLK(NULL, "i2c1_ick", &i2c1_ick),
  2807. CLK(NULL, "uart2_ick", &uart2_ick),
  2808. CLK(NULL, "uart1_ick", &uart1_ick),
  2809. CLK(NULL, "gpt11_ick", &gpt11_ick),
  2810. CLK(NULL, "gpt10_ick", &gpt10_ick),
  2811. CLK("omap-mcbsp.5", "ick", &mcbsp5_ick),
  2812. CLK("omap-mcbsp.1", "ick", &mcbsp1_ick),
  2813. CLK(NULL, "mcbsp5_ick", &mcbsp5_ick),
  2814. CLK(NULL, "mcbsp1_ick", &mcbsp1_ick),
  2815. CLK(NULL, "omapctrl_ick", &omapctrl_ick),
  2816. CLK(NULL, "dss_tv_fck", &dss_tv_fck),
  2817. CLK(NULL, "dss_96m_fck", &dss_96m_fck),
  2818. CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck),
  2819. CLK(NULL, "init_60m_fclk", &dummy_ck),
  2820. CLK(NULL, "gpt1_fck", &gpt1_fck),
  2821. CLK(NULL, "aes2_ick", &aes2_ick),
  2822. CLK(NULL, "wkup_32k_fck", &wkup_32k_fck),
  2823. CLK(NULL, "gpio1_dbck", &gpio1_dbck),
  2824. CLK(NULL, "sha12_ick", &sha12_ick),
  2825. CLK(NULL, "wdt2_fck", &wdt2_fck),
  2826. CLK("omap_wdt", "ick", &wdt2_ick),
  2827. CLK(NULL, "wdt2_ick", &wdt2_ick),
  2828. CLK(NULL, "wdt1_ick", &wdt1_ick),
  2829. CLK(NULL, "gpio1_ick", &gpio1_ick),
  2830. CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick),
  2831. CLK(NULL, "gpt12_ick", &gpt12_ick),
  2832. CLK(NULL, "gpt1_ick", &gpt1_ick),
  2833. CLK(NULL, "per_96m_fck", &per_96m_fck),
  2834. CLK(NULL, "per_48m_fck", &per_48m_fck),
  2835. CLK(NULL, "uart3_fck", &uart3_fck),
  2836. CLK(NULL, "gpt2_fck", &gpt2_fck),
  2837. CLK(NULL, "gpt3_fck", &gpt3_fck),
  2838. CLK(NULL, "gpt4_fck", &gpt4_fck),
  2839. CLK(NULL, "gpt5_fck", &gpt5_fck),
  2840. CLK(NULL, "gpt6_fck", &gpt6_fck),
  2841. CLK(NULL, "gpt7_fck", &gpt7_fck),
  2842. CLK(NULL, "gpt8_fck", &gpt8_fck),
  2843. CLK(NULL, "gpt9_fck", &gpt9_fck),
  2844. CLK(NULL, "per_32k_alwon_fck", &per_32k_alwon_fck),
  2845. CLK(NULL, "gpio6_dbck", &gpio6_dbck),
  2846. CLK(NULL, "gpio5_dbck", &gpio5_dbck),
  2847. CLK(NULL, "gpio4_dbck", &gpio4_dbck),
  2848. CLK(NULL, "gpio3_dbck", &gpio3_dbck),
  2849. CLK(NULL, "gpio2_dbck", &gpio2_dbck),
  2850. CLK(NULL, "wdt3_fck", &wdt3_fck),
  2851. CLK(NULL, "per_l4_ick", &per_l4_ick),
  2852. CLK(NULL, "gpio6_ick", &gpio6_ick),
  2853. CLK(NULL, "gpio5_ick", &gpio5_ick),
  2854. CLK(NULL, "gpio4_ick", &gpio4_ick),
  2855. CLK(NULL, "gpio3_ick", &gpio3_ick),
  2856. CLK(NULL, "gpio2_ick", &gpio2_ick),
  2857. CLK(NULL, "wdt3_ick", &wdt3_ick),
  2858. CLK(NULL, "uart3_ick", &uart3_ick),
  2859. CLK(NULL, "uart4_ick", &uart4_ick),
  2860. CLK(NULL, "gpt9_ick", &gpt9_ick),
  2861. CLK(NULL, "gpt8_ick", &gpt8_ick),
  2862. CLK(NULL, "gpt7_ick", &gpt7_ick),
  2863. CLK(NULL, "gpt6_ick", &gpt6_ick),
  2864. CLK(NULL, "gpt5_ick", &gpt5_ick),
  2865. CLK(NULL, "gpt4_ick", &gpt4_ick),
  2866. CLK(NULL, "gpt3_ick", &gpt3_ick),
  2867. CLK(NULL, "gpt2_ick", &gpt2_ick),
  2868. CLK("omap-mcbsp.2", "ick", &mcbsp2_ick),
  2869. CLK("omap-mcbsp.3", "ick", &mcbsp3_ick),
  2870. CLK("omap-mcbsp.4", "ick", &mcbsp4_ick),
  2871. CLK(NULL, "mcbsp4_ick", &mcbsp2_ick),
  2872. CLK(NULL, "mcbsp3_ick", &mcbsp3_ick),
  2873. CLK(NULL, "mcbsp2_ick", &mcbsp4_ick),
  2874. CLK(NULL, "mcbsp2_fck", &mcbsp2_fck),
  2875. CLK(NULL, "mcbsp3_fck", &mcbsp3_fck),
  2876. CLK(NULL, "mcbsp4_fck", &mcbsp4_fck),
  2877. CLK("etb", "emu_src_ck", &emu_src_ck),
  2878. CLK(NULL, "emu_src_ck", &emu_src_ck),
  2879. CLK(NULL, "pclk_fck", &pclk_fck),
  2880. CLK(NULL, "pclkx2_fck", &pclkx2_fck),
  2881. CLK(NULL, "atclk_fck", &atclk_fck),
  2882. CLK(NULL, "traceclk_src_fck", &traceclk_src_fck),
  2883. CLK(NULL, "traceclk_fck", &traceclk_fck),
  2884. CLK(NULL, "secure_32k_fck", &secure_32k_fck),
  2885. CLK(NULL, "gpt12_fck", &gpt12_fck),
  2886. CLK(NULL, "wdt1_fck", &wdt1_fck),
  2887. CLK(NULL, "timer_32k_ck", &omap_32k_fck),
  2888. CLK(NULL, "timer_sys_ck", &sys_ck),
  2889. CLK(NULL, "cpufreq_ck", &dpll1_ck),
  2890. };
  2891. static const char *enable_init_clks[] = {
  2892. "sdrc_ick",
  2893. "gpmc_fck",
  2894. "omapctrl_ick",
  2895. };
  2896. int __init omap3xxx_clk_init(void)
  2897. {
  2898. if (omap3_has_192mhz_clk())
  2899. omap_96m_alwon_fck = omap_96m_alwon_fck_3630;
  2900. if (cpu_is_omap3630()) {
  2901. dpll3_m3x2_ck = dpll3_m3x2_ck_3630;
  2902. dpll4_m2x2_ck = dpll4_m2x2_ck_3630;
  2903. dpll4_m3x2_ck = dpll4_m3x2_ck_3630;
  2904. dpll4_m4x2_ck = dpll4_m4x2_ck_3630;
  2905. dpll4_m5x2_ck = dpll4_m5x2_ck_3630;
  2906. dpll4_m6x2_ck = dpll4_m6x2_ck_3630;
  2907. }
  2908. /*
  2909. * XXX This type of dynamic rewriting of the clock tree is
  2910. * deprecated and should be revised soon.
  2911. */
  2912. if (cpu_is_omap3630())
  2913. dpll4_dd = dpll4_dd_3630;
  2914. else
  2915. dpll4_dd = dpll4_dd_34xx;
  2916. /*
  2917. * 3505 must be tested before 3517, since 3517 returns true
  2918. * for both AM3517 chips and AM3517 family chips, which
  2919. * includes 3505. Unfortunately there's no obvious family
  2920. * test for 3517/3505 :-(
  2921. */
  2922. if (soc_is_am35xx()) {
  2923. cpu_mask = RATE_IN_34XX;
  2924. omap_clocks_register(am35xx_clks, ARRAY_SIZE(am35xx_clks));
  2925. omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
  2926. ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
  2927. omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
  2928. } else if (cpu_is_omap3630()) {
  2929. cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
  2930. omap_clocks_register(omap36xx_clks, ARRAY_SIZE(omap36xx_clks));
  2931. omap_clocks_register(omap36xx_omap3430es2plus_clks,
  2932. ARRAY_SIZE(omap36xx_omap3430es2plus_clks));
  2933. omap_clocks_register(omap34xx_omap36xx_clks,
  2934. ARRAY_SIZE(omap34xx_omap36xx_clks));
  2935. omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
  2936. ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
  2937. omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
  2938. } else if (soc_is_am33xx()) {
  2939. cpu_mask = RATE_IN_AM33XX;
  2940. } else if (cpu_is_ti814x()) {
  2941. cpu_mask = RATE_IN_TI814X;
  2942. } else if (cpu_is_omap34xx()) {
  2943. if (omap_rev() == OMAP3430_REV_ES1_0) {
  2944. cpu_mask = RATE_IN_3430ES1;
  2945. omap_clocks_register(omap3430es1_clks,
  2946. ARRAY_SIZE(omap3430es1_clks));
  2947. omap_clocks_register(omap34xx_omap36xx_clks,
  2948. ARRAY_SIZE(omap34xx_omap36xx_clks));
  2949. omap_clocks_register(omap3xxx_clks,
  2950. ARRAY_SIZE(omap3xxx_clks));
  2951. } else {
  2952. /*
  2953. * Assume that anything that we haven't matched yet
  2954. * has 3430ES2-type clocks.
  2955. */
  2956. cpu_mask = RATE_IN_3430ES2PLUS;
  2957. omap_clocks_register(omap34xx_omap36xx_clks,
  2958. ARRAY_SIZE(omap34xx_omap36xx_clks));
  2959. omap_clocks_register(omap36xx_omap3430es2plus_clks,
  2960. ARRAY_SIZE(omap36xx_omap3430es2plus_clks));
  2961. omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
  2962. ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
  2963. omap_clocks_register(omap3xxx_clks,
  2964. ARRAY_SIZE(omap3xxx_clks));
  2965. }
  2966. } else {
  2967. WARN(1, "clock: could not identify OMAP3 variant\n");
  2968. }
  2969. omap2_clk_disable_autoidle_all();
  2970. omap2_clk_enable_init_clocks(enable_init_clks,
  2971. ARRAY_SIZE(enable_init_clks));
  2972. pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
  2973. (clk_get_rate(&osc_sys_ck) / 1000000),
  2974. (clk_get_rate(&osc_sys_ck) / 100000) % 10,
  2975. (clk_get_rate(&core_ck) / 1000000),
  2976. (clk_get_rate(&arm_fck) / 1000000));
  2977. /*
  2978. * Lock DPLL5 -- here only until other device init code can
  2979. * handle this
  2980. */
  2981. if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
  2982. omap3_clk_lock_dpll5();
  2983. /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
  2984. sdrc_ick_p = clk_get(NULL, "sdrc_ick");
  2985. arm_fck_p = clk_get(NULL, "arm_fck");
  2986. return 0;
  2987. }