cclock3xxx_data.c 101 KB

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