clock.h 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103
  1. /*
  2. * linux/arch/arm/mach-omap24xx/clock.h
  3. *
  4. * Copyright (C) 2005 Texas Instruments Inc.
  5. * Richard Woodruff <r-woodruff2@ti.com>
  6. * Created for OMAP2.
  7. *
  8. * Copyright (C) 2004 Nokia corporation
  9. * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
  10. * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H
  17. #define __ARCH_ARM_MACH_OMAP2_CLOCK_H
  18. static void omap2_sys_clk_recalc(struct clk * clk);
  19. static void omap2_clksel_recalc(struct clk * clk);
  20. static void omap2_followparent_recalc(struct clk * clk);
  21. static void omap2_propagate_rate(struct clk * clk);
  22. static void omap2_mpu_recalc(struct clk * clk);
  23. static int omap2_select_table_rate(struct clk * clk, unsigned long rate);
  24. static long omap2_round_to_table_rate(struct clk * clk, unsigned long rate);
  25. static void omap2_clk_disable(struct clk *clk);
  26. static void omap2_sys_clk_recalc(struct clk * clk);
  27. static u32 omap2_clksel_to_divisor(u32 div_sel, u32 field_val);
  28. static u32 omap2_clksel_get_divisor(struct clk *clk);
  29. #define RATE_IN_242X (1 << 0)
  30. #define RATE_IN_243X (1 << 1)
  31. /* Memory timings */
  32. #define M_DDR 1
  33. #define M_LOCK_CTRL (1 << 2)
  34. #define M_UNLOCK 0
  35. #define M_LOCK 1
  36. struct memory_timings {
  37. u32 m_type; /* ddr = 1, sdr = 0 */
  38. u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
  39. u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
  40. u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
  41. u32 base_cs; /* base chip select to use for calculations */
  42. };
  43. /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
  44. * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
  45. * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
  46. */
  47. struct prcm_config {
  48. unsigned long xtal_speed; /* crystal rate */
  49. unsigned long dpll_speed; /* dpll: out*xtal*M/(N-1)table_recalc */
  50. unsigned long mpu_speed; /* speed of MPU */
  51. unsigned long cm_clksel_mpu; /* mpu divider */
  52. unsigned long cm_clksel_dsp; /* dsp+iva1 div(2420), iva2.1(2430) */
  53. unsigned long cm_clksel_gfx; /* gfx dividers */
  54. unsigned long cm_clksel1_core; /* major subsystem dividers */
  55. unsigned long cm_clksel1_pll; /* m,n */
  56. unsigned long cm_clksel2_pll; /* dpllx1 or x2 out */
  57. unsigned long cm_clksel_mdm; /* modem dividers 2430 only */
  58. unsigned long base_sdrc_rfr; /* base refresh timing for a set */
  59. unsigned char flags;
  60. };
  61. /* Mask for clksel which support parent settign in set_rate */
  62. #define SRC_SEL_MASK (CM_CORE_SEL1 | CM_CORE_SEL2 | CM_WKUP_SEL1 | \
  63. CM_PLL_SEL1 | CM_PLL_SEL2 | CM_SYSCLKOUT_SEL1)
  64. /* Mask for clksel regs which support rate operations */
  65. #define SRC_RATE_SEL_MASK (CM_MPU_SEL1 | CM_DSP_SEL1 | CM_GFX_SEL1 | \
  66. CM_MODEM_SEL1 | CM_CORE_SEL1 | CM_CORE_SEL2 | \
  67. CM_WKUP_SEL1 | CM_PLL_SEL1 | CM_PLL_SEL2 | \
  68. CM_SYSCLKOUT_SEL1)
  69. /*
  70. * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
  71. * These configurations are characterized by voltage and speed for clocks.
  72. * The device is only validated for certain combinations. One way to express
  73. * these combinations is via the 'ratio's' which the clocks operate with
  74. * respect to each other. These ratio sets are for a given voltage/DPLL
  75. * setting. All configurations can be described by a DPLL setting and a ratio
  76. * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
  77. *
  78. * 2430 differs from 2420 in that there are no more phase synchronizers used.
  79. * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
  80. * 2430 (iva2.1, NOdsp, mdm)
  81. */
  82. /* Core fields for cm_clksel, not ratio governed */
  83. #define RX_CLKSEL_DSS1 (0x10 << 8)
  84. #define RX_CLKSEL_DSS2 (0x0 << 13)
  85. #define RX_CLKSEL_SSI (0x5 << 20)
  86. /*-------------------------------------------------------------------------
  87. * Voltage/DPLL ratios
  88. *-------------------------------------------------------------------------*/
  89. /* 2430 Ratio's, 2430-Ratio Config 1 */
  90. #define R1_CLKSEL_L3 (4 << 0)
  91. #define R1_CLKSEL_L4 (2 << 5)
  92. #define R1_CLKSEL_USB (4 << 25)
  93. #define R1_CM_CLKSEL1_CORE_VAL R1_CLKSEL_USB | RX_CLKSEL_SSI | \
  94. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  95. R1_CLKSEL_L4 | R1_CLKSEL_L3
  96. #define R1_CLKSEL_MPU (2 << 0)
  97. #define R1_CM_CLKSEL_MPU_VAL R1_CLKSEL_MPU
  98. #define R1_CLKSEL_DSP (2 << 0)
  99. #define R1_CLKSEL_DSP_IF (2 << 5)
  100. #define R1_CM_CLKSEL_DSP_VAL R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF
  101. #define R1_CLKSEL_GFX (2 << 0)
  102. #define R1_CM_CLKSEL_GFX_VAL R1_CLKSEL_GFX
  103. #define R1_CLKSEL_MDM (4 << 0)
  104. #define R1_CM_CLKSEL_MDM_VAL R1_CLKSEL_MDM
  105. /* 2430-Ratio Config 2 */
  106. #define R2_CLKSEL_L3 (6 << 0)
  107. #define R2_CLKSEL_L4 (2 << 5)
  108. #define R2_CLKSEL_USB (2 << 25)
  109. #define R2_CM_CLKSEL1_CORE_VAL R2_CLKSEL_USB | RX_CLKSEL_SSI | \
  110. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  111. R2_CLKSEL_L4 | R2_CLKSEL_L3
  112. #define R2_CLKSEL_MPU (2 << 0)
  113. #define R2_CM_CLKSEL_MPU_VAL R2_CLKSEL_MPU
  114. #define R2_CLKSEL_DSP (2 << 0)
  115. #define R2_CLKSEL_DSP_IF (3 << 5)
  116. #define R2_CM_CLKSEL_DSP_VAL R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF
  117. #define R2_CLKSEL_GFX (2 << 0)
  118. #define R2_CM_CLKSEL_GFX_VAL R2_CLKSEL_GFX
  119. #define R2_CLKSEL_MDM (6 << 0)
  120. #define R2_CM_CLKSEL_MDM_VAL R2_CLKSEL_MDM
  121. /* 2430-Ratio Bootm (BYPASS) */
  122. #define RB_CLKSEL_L3 (1 << 0)
  123. #define RB_CLKSEL_L4 (1 << 5)
  124. #define RB_CLKSEL_USB (1 << 25)
  125. #define RB_CM_CLKSEL1_CORE_VAL RB_CLKSEL_USB | RX_CLKSEL_SSI | \
  126. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  127. RB_CLKSEL_L4 | RB_CLKSEL_L3
  128. #define RB_CLKSEL_MPU (1 << 0)
  129. #define RB_CM_CLKSEL_MPU_VAL RB_CLKSEL_MPU
  130. #define RB_CLKSEL_DSP (1 << 0)
  131. #define RB_CLKSEL_DSP_IF (1 << 5)
  132. #define RB_CM_CLKSEL_DSP_VAL RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF
  133. #define RB_CLKSEL_GFX (1 << 0)
  134. #define RB_CM_CLKSEL_GFX_VAL RB_CLKSEL_GFX
  135. #define RB_CLKSEL_MDM (1 << 0)
  136. #define RB_CM_CLKSEL_MDM_VAL RB_CLKSEL_MDM
  137. /* 2420 Ratio Equivalents */
  138. #define RXX_CLKSEL_VLYNQ (0x12 << 15)
  139. #define RXX_CLKSEL_SSI (0x8 << 20)
  140. /* 2420-PRCM III 532MHz core */
  141. #define RIII_CLKSEL_L3 (4 << 0) /* 133MHz */
  142. #define RIII_CLKSEL_L4 (2 << 5) /* 66.5MHz */
  143. #define RIII_CLKSEL_USB (4 << 25) /* 33.25MHz */
  144. #define RIII_CM_CLKSEL1_CORE_VAL RIII_CLKSEL_USB | RXX_CLKSEL_SSI | \
  145. RXX_CLKSEL_VLYNQ | RX_CLKSEL_DSS2 | \
  146. RX_CLKSEL_DSS1 | RIII_CLKSEL_L4 | \
  147. RIII_CLKSEL_L3
  148. #define RIII_CLKSEL_MPU (2 << 0) /* 266MHz */
  149. #define RIII_CM_CLKSEL_MPU_VAL RIII_CLKSEL_MPU
  150. #define RIII_CLKSEL_DSP (3 << 0) /* c5x - 177.3MHz */
  151. #define RIII_CLKSEL_DSP_IF (2 << 5) /* c5x - 88.67MHz */
  152. #define RIII_SYNC_DSP (1 << 7) /* Enable sync */
  153. #define RIII_CLKSEL_IVA (6 << 8) /* iva1 - 88.67MHz */
  154. #define RIII_SYNC_IVA (1 << 13) /* Enable sync */
  155. #define RIII_CM_CLKSEL_DSP_VAL RIII_SYNC_IVA | RIII_CLKSEL_IVA | \
  156. RIII_SYNC_DSP | RIII_CLKSEL_DSP_IF | \
  157. RIII_CLKSEL_DSP
  158. #define RIII_CLKSEL_GFX (2 << 0) /* 66.5MHz */
  159. #define RIII_CM_CLKSEL_GFX_VAL RIII_CLKSEL_GFX
  160. /* 2420-PRCM II 600MHz core */
  161. #define RII_CLKSEL_L3 (6 << 0) /* 100MHz */
  162. #define RII_CLKSEL_L4 (2 << 5) /* 50MHz */
  163. #define RII_CLKSEL_USB (2 << 25) /* 50MHz */
  164. #define RII_CM_CLKSEL1_CORE_VAL RII_CLKSEL_USB | \
  165. RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
  166. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  167. RII_CLKSEL_L4 | RII_CLKSEL_L3
  168. #define RII_CLKSEL_MPU (2 << 0) /* 300MHz */
  169. #define RII_CM_CLKSEL_MPU_VAL RII_CLKSEL_MPU
  170. #define RII_CLKSEL_DSP (3 << 0) /* c5x - 200MHz */
  171. #define RII_CLKSEL_DSP_IF (2 << 5) /* c5x - 100MHz */
  172. #define RII_SYNC_DSP (0 << 7) /* Bypass sync */
  173. #define RII_CLKSEL_IVA (6 << 8) /* iva1 - 200MHz */
  174. #define RII_SYNC_IVA (0 << 13) /* Bypass sync */
  175. #define RII_CM_CLKSEL_DSP_VAL RII_SYNC_IVA | RII_CLKSEL_IVA | \
  176. RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \
  177. RII_CLKSEL_DSP
  178. #define RII_CLKSEL_GFX (2 << 0) /* 50MHz */
  179. #define RII_CM_CLKSEL_GFX_VAL RII_CLKSEL_GFX
  180. /* 2420-PRCM VII (boot) */
  181. #define RVII_CLKSEL_L3 (1 << 0)
  182. #define RVII_CLKSEL_L4 (1 << 5)
  183. #define RVII_CLKSEL_DSS1 (1 << 8)
  184. #define RVII_CLKSEL_DSS2 (0 << 13)
  185. #define RVII_CLKSEL_VLYNQ (1 << 15)
  186. #define RVII_CLKSEL_SSI (1 << 20)
  187. #define RVII_CLKSEL_USB (1 << 25)
  188. #define RVII_CM_CLKSEL1_CORE_VAL RVII_CLKSEL_USB | RVII_CLKSEL_SSI | \
  189. RVII_CLKSEL_VLYNQ | RVII_CLKSEL_DSS2 | \
  190. RVII_CLKSEL_DSS1 | RVII_CLKSEL_L4 | RVII_CLKSEL_L3
  191. #define RVII_CLKSEL_MPU (1 << 0) /* all divide by 1 */
  192. #define RVII_CM_CLKSEL_MPU_VAL RVII_CLKSEL_MPU
  193. #define RVII_CLKSEL_DSP (1 << 0)
  194. #define RVII_CLKSEL_DSP_IF (1 << 5)
  195. #define RVII_SYNC_DSP (0 << 7)
  196. #define RVII_CLKSEL_IVA (1 << 8)
  197. #define RVII_SYNC_IVA (0 << 13)
  198. #define RVII_CM_CLKSEL_DSP_VAL RVII_SYNC_IVA | RVII_CLKSEL_IVA | RVII_SYNC_DSP | \
  199. RVII_CLKSEL_DSP_IF | RVII_CLKSEL_DSP
  200. #define RVII_CLKSEL_GFX (1 << 0)
  201. #define RVII_CM_CLKSEL_GFX_VAL RVII_CLKSEL_GFX
  202. /*-------------------------------------------------------------------------
  203. * 2430 Target modes: Along with each configuration the CPU has several
  204. * modes which goes along with them. Modes mainly are the addition of
  205. * describe DPLL combinations to go along with a ratio.
  206. *-------------------------------------------------------------------------*/
  207. /* Hardware governed */
  208. #define MX_48M_SRC (0 << 3)
  209. #define MX_54M_SRC (0 << 5)
  210. #define MX_APLLS_CLIKIN_12 (3 << 23)
  211. #define MX_APLLS_CLIKIN_13 (2 << 23)
  212. #define MX_APLLS_CLIKIN_19_2 (0 << 23)
  213. /*
  214. * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed
  215. * #2 (ratio1) baseport-target
  216. * #5a (ratio1) baseport-target, target DPLL = 266*2 = 532MHz
  217. */
  218. #define M5A_DPLL_MULT_12 (133 << 12)
  219. #define M5A_DPLL_DIV_12 (5 << 8)
  220. #define M5A_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
  221. M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \
  222. MX_APLLS_CLIKIN_12
  223. #define M5A_DPLL_MULT_13 (266 << 12)
  224. #define M5A_DPLL_DIV_13 (12 << 8)
  225. #define M5A_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
  226. M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \
  227. MX_APLLS_CLIKIN_13
  228. #define M5A_DPLL_MULT_19 (180 << 12)
  229. #define M5A_DPLL_DIV_19 (12 << 8)
  230. #define M5A_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
  231. M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \
  232. MX_APLLS_CLIKIN_19_2
  233. /* #5b (ratio1) target DPLL = 200*2 = 400MHz */
  234. #define M5B_DPLL_MULT_12 (50 << 12)
  235. #define M5B_DPLL_DIV_12 (2 << 8)
  236. #define M5B_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
  237. M5B_DPLL_DIV_12 | M5B_DPLL_MULT_12 | \
  238. MX_APLLS_CLIKIN_12
  239. #define M5B_DPLL_MULT_13 (200 << 12)
  240. #define M5B_DPLL_DIV_13 (12 << 8)
  241. #define M5B_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
  242. M5B_DPLL_DIV_13 | M5B_DPLL_MULT_13 | \
  243. MX_APLLS_CLIKIN_13
  244. #define M5B_DPLL_MULT_19 (125 << 12)
  245. #define M5B_DPLL_DIV_19 (31 << 8)
  246. #define M5B_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
  247. M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \
  248. MX_APLLS_CLIKIN_19_2
  249. /*
  250. * #4 (ratio2)
  251. * #3 (ratio2) baseport-target, target DPLL = 330*2 = 660MHz
  252. */
  253. #define M3_DPLL_MULT_12 (55 << 12)
  254. #define M3_DPLL_DIV_12 (1 << 8)
  255. #define M3_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
  256. M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \
  257. MX_APLLS_CLIKIN_12
  258. #define M3_DPLL_MULT_13 (330 << 12)
  259. #define M3_DPLL_DIV_13 (12 << 8)
  260. #define M3_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
  261. M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \
  262. MX_APLLS_CLIKIN_13
  263. #define M3_DPLL_MULT_19 (275 << 12)
  264. #define M3_DPLL_DIV_19 (15 << 8)
  265. #define M3_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
  266. M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \
  267. MX_APLLS_CLIKIN_19_2
  268. /* boot (boot) */
  269. #define MB_DPLL_MULT (1 << 12)
  270. #define MB_DPLL_DIV (0 << 8)
  271. #define MB_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
  272. MB_DPLL_MULT | MX_APLLS_CLIKIN_12
  273. #define MB_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
  274. MB_DPLL_MULT | MX_APLLS_CLIKIN_13
  275. #define MB_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
  276. MB_DPLL_MULT | MX_APLLS_CLIKIN_19
  277. /*
  278. * 2430 - chassis (sedna)
  279. * 165 (ratio1) same as above #2
  280. * 150 (ratio1)
  281. * 133 (ratio2) same as above #4
  282. * 110 (ratio2) same as above #3
  283. * 104 (ratio2)
  284. * boot (boot)
  285. */
  286. /*
  287. * 2420 Equivalent - mode registers
  288. * PRCM II , target DPLL = 2*300MHz = 600MHz
  289. */
  290. #define MII_DPLL_MULT_12 (50 << 12)
  291. #define MII_DPLL_DIV_12 (1 << 8)
  292. #define MII_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
  293. MII_DPLL_DIV_12 | MII_DPLL_MULT_12 | \
  294. MX_APLLS_CLIKIN_12
  295. #define MII_DPLL_MULT_13 (300 << 12)
  296. #define MII_DPLL_DIV_13 (12 << 8)
  297. #define MII_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
  298. MII_DPLL_DIV_13 | MII_DPLL_MULT_13 | \
  299. MX_APLLS_CLIKIN_13
  300. /* PRCM III target DPLL = 2*266 = 532MHz*/
  301. #define MIII_DPLL_MULT_12 (133 << 12)
  302. #define MIII_DPLL_DIV_12 (5 << 8)
  303. #define MIII_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
  304. MIII_DPLL_DIV_12 | MIII_DPLL_MULT_12 | \
  305. MX_APLLS_CLIKIN_12
  306. #define MIII_DPLL_MULT_13 (266 << 12)
  307. #define MIII_DPLL_DIV_13 (12 << 8)
  308. #define MIII_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
  309. MIII_DPLL_DIV_13 | MIII_DPLL_MULT_13 | \
  310. MX_APLLS_CLIKIN_13
  311. /* PRCM VII (boot bypass) */
  312. #define MVII_CM_CLKSEL1_PLL_12_VAL MB_CM_CLKSEL1_PLL_12_VAL
  313. #define MVII_CM_CLKSEL1_PLL_13_VAL MB_CM_CLKSEL1_PLL_13_VAL
  314. /* High and low operation value */
  315. #define MX_CLKSEL2_PLL_2x_VAL (2 << 0)
  316. #define MX_CLKSEL2_PLL_1x_VAL (1 << 0)
  317. /*
  318. * These represent optimal values for common parts, it won't work for all.
  319. * As long as you scale down, most parameters are still work, they just
  320. * become sub-optimal. The RFR value goes in the oppisite direction. If you
  321. * don't adjust it down as your clock period increases the refresh interval
  322. * will not be met. Setting all parameters for complete worst case may work,
  323. * but may cut memory performance by 2x. Due to errata the DLLs need to be
  324. * unlocked and their value needs run time calibration. A dynamic call is
  325. * need for that as no single right value exists acorss production samples.
  326. *
  327. * Only the FULL speed values are given. Current code is such that rate
  328. * changes must be made at DPLLoutx2. The actual value adjustment for low
  329. * frequency operation will be handled by omap_set_performance()
  330. *
  331. * By having the boot loader boot up in the fastest L4 speed available likely
  332. * will result in something which you can switch between.
  333. */
  334. #define V24XX_SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
  335. #define V24XX_SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
  336. #define V24XX_SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
  337. #define V24XX_SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
  338. /* MPU speed defines */
  339. #define S12M 12000000
  340. #define S13M 13000000
  341. #define S19M 19200000
  342. #define S26M 26000000
  343. #define S100M 100000000
  344. #define S133M 133000000
  345. #define S150M 150000000
  346. #define S165M 165000000
  347. #define S200M 200000000
  348. #define S266M 266000000
  349. #define S300M 300000000
  350. #define S330M 330000000
  351. #define S400M 400000000
  352. #define S532M 532000000
  353. #define S600M 600000000
  354. #define S660M 660000000
  355. /*-------------------------------------------------------------------------
  356. * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
  357. * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
  358. * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
  359. * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
  360. *
  361. * Filling in table based on H4 boards and 2430-SDPs variants available.
  362. * There are quite a few more rates combinations which could be defined.
  363. *
  364. * When multiple values are defiend the start up will try and choose the
  365. * fastest one. If a 'fast' value is defined, then automatically, the /2
  366. * one should be included as it can be used. Generally having more that
  367. * one fast set does not make sense, as static timings need to be changed
  368. * to change the set. The exception is the bypass setting which is
  369. * availble for low power bypass.
  370. *
  371. * Note: This table needs to be sorted, fastest to slowest.
  372. *-------------------------------------------------------------------------*/
  373. static struct prcm_config rate_table[] = {
  374. /* PRCM II - FAST */
  375. {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
  376. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  377. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
  378. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
  379. RATE_IN_242X},
  380. {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
  381. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  382. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
  383. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
  384. RATE_IN_242X},
  385. /* PRCM III - FAST */
  386. {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
  387. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  388. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
  389. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
  390. RATE_IN_242X},
  391. {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
  392. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  393. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
  394. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
  395. RATE_IN_242X},
  396. /* PRCM II - SLOW */
  397. {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
  398. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  399. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
  400. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
  401. RATE_IN_242X},
  402. {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
  403. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  404. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
  405. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
  406. RATE_IN_242X},
  407. /* PRCM III - SLOW */
  408. {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
  409. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  410. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
  411. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
  412. RATE_IN_242X},
  413. {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
  414. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  415. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
  416. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
  417. RATE_IN_242X},
  418. /* PRCM-VII (boot-bypass) */
  419. {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL, /* 12MHz ARM*/
  420. RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
  421. RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
  422. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_BYPASS,
  423. RATE_IN_242X},
  424. /* PRCM-VII (boot-bypass) */
  425. {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL, /* 13MHz ARM */
  426. RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
  427. RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
  428. MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_BYPASS,
  429. RATE_IN_242X},
  430. /* PRCM #3 - ratio2 (ES2) - FAST */
  431. {S13M, S660M, S330M, R2_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
  432. R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
  433. R2_CM_CLKSEL1_CORE_VAL, M3_CM_CLKSEL1_PLL_13_VAL,
  434. MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
  435. V24XX_SDRC_RFR_CTRL_110MHz,
  436. RATE_IN_243X},
  437. /* PRCM #5a - ratio1 - FAST */
  438. {S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
  439. R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
  440. R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
  441. MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
  442. V24XX_SDRC_RFR_CTRL_133MHz,
  443. RATE_IN_243X},
  444. /* PRCM #5b - ratio1 - FAST */
  445. {S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL, /* 200MHz ARM */
  446. R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
  447. R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
  448. MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
  449. V24XX_SDRC_RFR_CTRL_100MHz,
  450. RATE_IN_243X},
  451. /* PRCM #3 - ratio2 (ES2) - SLOW */
  452. {S13M, S330M, S165M, R2_CM_CLKSEL_MPU_VAL, /* 165MHz ARM */
  453. R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
  454. R2_CM_CLKSEL1_CORE_VAL, M3_CM_CLKSEL1_PLL_13_VAL,
  455. MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
  456. V24XX_SDRC_RFR_CTRL_110MHz,
  457. RATE_IN_243X},
  458. /* PRCM #5a - ratio1 - SLOW */
  459. {S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
  460. R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
  461. R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
  462. MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
  463. V24XX_SDRC_RFR_CTRL_133MHz,
  464. RATE_IN_243X},
  465. /* PRCM #5b - ratio1 - SLOW*/
  466. {S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL, /* 100MHz ARM */
  467. R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
  468. R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
  469. MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
  470. V24XX_SDRC_RFR_CTRL_100MHz,
  471. RATE_IN_243X},
  472. /* PRCM-boot/bypass */
  473. {S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL, /* 13Mhz */
  474. RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
  475. RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
  476. MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
  477. V24XX_SDRC_RFR_CTRL_BYPASS,
  478. RATE_IN_243X},
  479. /* PRCM-boot/bypass */
  480. {S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL, /* 12Mhz */
  481. RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
  482. RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
  483. MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
  484. V24XX_SDRC_RFR_CTRL_BYPASS,
  485. RATE_IN_243X},
  486. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  487. };
  488. /*-------------------------------------------------------------------------
  489. * 24xx clock tree.
  490. *
  491. * NOTE:In many cases here we are assigning a 'default' parent. In many
  492. * cases the parent is selectable. The get/set parent calls will also
  493. * switch sources.
  494. *
  495. * Many some clocks say always_enabled, but they can be auto idled for
  496. * power savings. They will always be available upon clock request.
  497. *
  498. * Several sources are given initial rates which may be wrong, this will
  499. * be fixed up in the init func.
  500. *
  501. * Things are broadly separated below by clock domains. It is
  502. * noteworthy that most periferals have dependencies on multiple clock
  503. * domains. Many get their interface clocks from the L4 domain, but get
  504. * functional clocks from fixed sources or other core domain derived
  505. * clocks.
  506. *-------------------------------------------------------------------------*/
  507. /* Base external input clocks */
  508. static struct clk func_32k_ck = {
  509. .name = "func_32k_ck",
  510. .rate = 32000,
  511. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  512. RATE_FIXED | ALWAYS_ENABLED,
  513. };
  514. /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
  515. static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
  516. .name = "osc_ck",
  517. .rate = 26000000, /* fixed up in clock init */
  518. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  519. RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
  520. };
  521. /* With out modem likely 12MHz, with modem likely 13MHz */
  522. static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
  523. .name = "sys_ck", /* ~ ref_clk also */
  524. .parent = &osc_ck,
  525. .rate = 13000000,
  526. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  527. RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
  528. .rate_offset = 6, /* sysclkdiv 1 or 2, already handled or no boot */
  529. .recalc = &omap2_sys_clk_recalc,
  530. };
  531. static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
  532. .name = "alt_ck",
  533. .rate = 54000000,
  534. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  535. RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
  536. .recalc = &omap2_propagate_rate,
  537. };
  538. /*
  539. * Analog domain root source clocks
  540. */
  541. /* dpll_ck, is broken out in to special cases through clksel */
  542. static struct clk dpll_ck = {
  543. .name = "dpll_ck",
  544. .parent = &sys_ck, /* Can be func_32k also */
  545. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  546. RATE_PROPAGATES | RATE_CKCTL | CM_PLL_SEL1,
  547. .recalc = &omap2_clksel_recalc,
  548. };
  549. static struct clk apll96_ck = {
  550. .name = "apll96_ck",
  551. .parent = &sys_ck,
  552. .rate = 96000000,
  553. .flags = CLOCK_IN_OMAP242X |CLOCK_IN_OMAP243X |
  554. RATE_FIXED | RATE_PROPAGATES,
  555. .enable_reg = (void __iomem *)&CM_CLKEN_PLL,
  556. .enable_bit = 0x2,
  557. .recalc = &omap2_propagate_rate,
  558. };
  559. static struct clk apll54_ck = {
  560. .name = "apll54_ck",
  561. .parent = &sys_ck,
  562. .rate = 54000000,
  563. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  564. RATE_FIXED | RATE_PROPAGATES,
  565. .enable_reg = (void __iomem *)&CM_CLKEN_PLL,
  566. .enable_bit = 0x6,
  567. .recalc = &omap2_propagate_rate,
  568. };
  569. /*
  570. * PRCM digital base sources
  571. */
  572. static struct clk func_54m_ck = {
  573. .name = "func_54m_ck",
  574. .parent = &apll54_ck, /* can also be alt_clk */
  575. .rate = 54000000,
  576. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  577. RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES,
  578. .src_offset = 5,
  579. .enable_reg = (void __iomem *)&CM_CLKEN_PLL,
  580. .enable_bit = 0xff,
  581. .recalc = &omap2_propagate_rate,
  582. };
  583. static struct clk core_ck = {
  584. .name = "core_ck",
  585. .parent = &dpll_ck, /* can also be 32k */
  586. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  587. ALWAYS_ENABLED | RATE_PROPAGATES,
  588. .recalc = &omap2_propagate_rate,
  589. };
  590. static struct clk sleep_ck = { /* sys_clk or 32k */
  591. .name = "sleep_ck",
  592. .parent = &func_32k_ck,
  593. .rate = 32000,
  594. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  595. .recalc = &omap2_propagate_rate,
  596. };
  597. static struct clk func_96m_ck = {
  598. .name = "func_96m_ck",
  599. .parent = &apll96_ck,
  600. .rate = 96000000,
  601. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  602. RATE_FIXED | RATE_PROPAGATES,
  603. .enable_reg = (void __iomem *)&CM_CLKEN_PLL,
  604. .enable_bit = 0xff,
  605. .recalc = &omap2_propagate_rate,
  606. };
  607. static struct clk func_48m_ck = {
  608. .name = "func_48m_ck",
  609. .parent = &apll96_ck, /* 96M or Alt */
  610. .rate = 48000000,
  611. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  612. RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES,
  613. .src_offset = 3,
  614. .enable_reg = (void __iomem *)&CM_CLKEN_PLL,
  615. .enable_bit = 0xff,
  616. .recalc = &omap2_propagate_rate,
  617. };
  618. static struct clk func_12m_ck = {
  619. .name = "func_12m_ck",
  620. .parent = &func_48m_ck,
  621. .rate = 12000000,
  622. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  623. RATE_FIXED | RATE_PROPAGATES,
  624. .recalc = &omap2_propagate_rate,
  625. .enable_reg = (void __iomem *)&CM_CLKEN_PLL,
  626. .enable_bit = 0xff,
  627. };
  628. /* Secure timer, only available in secure mode */
  629. static struct clk wdt1_osc_ck = {
  630. .name = "ck_wdt1_osc",
  631. .parent = &osc_ck,
  632. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  633. .recalc = &omap2_followparent_recalc,
  634. };
  635. static struct clk sys_clkout = {
  636. .name = "sys_clkout",
  637. .parent = &func_54m_ck,
  638. .rate = 54000000,
  639. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  640. CM_SYSCLKOUT_SEL1 | RATE_CKCTL,
  641. .src_offset = 0,
  642. .enable_reg = (void __iomem *)&PRCM_CLKOUT_CTRL,
  643. .enable_bit = 7,
  644. .rate_offset = 3,
  645. .recalc = &omap2_clksel_recalc,
  646. };
  647. /* In 2430, new in 2420 ES2 */
  648. static struct clk sys_clkout2 = {
  649. .name = "sys_clkout2",
  650. .parent = &func_54m_ck,
  651. .rate = 54000000,
  652. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  653. CM_SYSCLKOUT_SEL1 | RATE_CKCTL,
  654. .src_offset = 8,
  655. .enable_reg = (void __iomem *)&PRCM_CLKOUT_CTRL,
  656. .enable_bit = 15,
  657. .rate_offset = 11,
  658. .recalc = &omap2_clksel_recalc,
  659. };
  660. /*
  661. * MPU clock domain
  662. * Clocks:
  663. * MPU_FCLK, MPU_ICLK
  664. * INT_M_FCLK, INT_M_I_CLK
  665. *
  666. * - Individual clocks are hardware managed.
  667. * - Base divider comes from: CM_CLKSEL_MPU
  668. *
  669. */
  670. static struct clk mpu_ck = { /* Control cpu */
  671. .name = "mpu_ck",
  672. .parent = &core_ck,
  673. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL |
  674. ALWAYS_ENABLED | CM_MPU_SEL1 | DELAYED_APP |
  675. CONFIG_PARTICIPANT | RATE_PROPAGATES,
  676. .rate_offset = 0, /* bits 0-4 */
  677. .recalc = &omap2_clksel_recalc,
  678. };
  679. /*
  680. * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
  681. * Clocks:
  682. * 2430: IVA2.1_FCLK, IVA2.1_ICLK
  683. * 2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
  684. */
  685. static struct clk iva2_1_fck = {
  686. .name = "iva2_1_fck",
  687. .parent = &core_ck,
  688. .flags = CLOCK_IN_OMAP243X | RATE_CKCTL | CM_DSP_SEL1 |
  689. DELAYED_APP | RATE_PROPAGATES |
  690. CONFIG_PARTICIPANT,
  691. .rate_offset = 0,
  692. .enable_reg = (void __iomem *)&CM_FCLKEN_DSP,
  693. .enable_bit = 0,
  694. .recalc = &omap2_clksel_recalc,
  695. };
  696. static struct clk iva2_1_ick = {
  697. .name = "iva2_1_ick",
  698. .parent = &iva2_1_fck,
  699. .flags = CLOCK_IN_OMAP243X | RATE_CKCTL | CM_DSP_SEL1 |
  700. DELAYED_APP | CONFIG_PARTICIPANT,
  701. .rate_offset = 5,
  702. .recalc = &omap2_clksel_recalc,
  703. };
  704. /*
  705. * Won't be too specific here. The core clock comes into this block
  706. * it is divided then tee'ed. One branch goes directly to xyz enable
  707. * controls. The other branch gets further divided by 2 then possibly
  708. * routed into a synchronizer and out of clocks abc.
  709. */
  710. static struct clk dsp_fck = {
  711. .name = "dsp_fck",
  712. .parent = &core_ck,
  713. .flags = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_DSP_SEL1 |
  714. DELAYED_APP | CONFIG_PARTICIPANT | RATE_PROPAGATES,
  715. .rate_offset = 0,
  716. .enable_reg = (void __iomem *)&CM_FCLKEN_DSP,
  717. .enable_bit = 0,
  718. .recalc = &omap2_clksel_recalc,
  719. };
  720. static struct clk dsp_ick = {
  721. .name = "dsp_ick", /* apparently ipi and isp */
  722. .parent = &dsp_fck,
  723. .flags = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_DSP_SEL1 |
  724. DELAYED_APP | CONFIG_PARTICIPANT,
  725. .rate_offset = 5,
  726. .enable_reg = (void __iomem *)&CM_ICLKEN_DSP,
  727. .enable_bit = 1, /* for ipi */
  728. .recalc = &omap2_clksel_recalc,
  729. };
  730. static struct clk iva1_ifck = {
  731. .name = "iva1_ifck",
  732. .parent = &core_ck,
  733. .flags = CLOCK_IN_OMAP242X | CM_DSP_SEL1 | RATE_CKCTL |
  734. CONFIG_PARTICIPANT | RATE_PROPAGATES | DELAYED_APP,
  735. .rate_offset= 8,
  736. .enable_reg = (void __iomem *)&CM_FCLKEN_DSP,
  737. .enable_bit = 10,
  738. .recalc = &omap2_clksel_recalc,
  739. };
  740. /* IVA1 mpu/int/i/f clocks are /2 of parent */
  741. static struct clk iva1_mpu_int_ifck = {
  742. .name = "iva1_mpu_int_ifck",
  743. .parent = &iva1_ifck,
  744. .flags = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_DSP_SEL1,
  745. .enable_reg = (void __iomem *)&CM_FCLKEN_DSP,
  746. .enable_bit = 8,
  747. .recalc = &omap2_clksel_recalc,
  748. };
  749. /*
  750. * L3 clock domain
  751. * L3 clocks are used for both interface and functional clocks to
  752. * multiple entities. Some of these clocks are completely managed
  753. * by hardware, and some others allow software control. Hardware
  754. * managed ones general are based on directly CLK_REQ signals and
  755. * various auto idle settings. The functional spec sets many of these
  756. * as 'tie-high' for their enables.
  757. *
  758. * I-CLOCKS:
  759. * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
  760. * CAM, HS-USB.
  761. * F-CLOCK
  762. * SSI.
  763. *
  764. * GPMC memories and SDRC have timing and clock sensitive registers which
  765. * may very well need notification when the clock changes. Currently for low
  766. * operating points, these are taken care of in sleep.S.
  767. */
  768. static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
  769. .name = "core_l3_ck",
  770. .parent = &core_ck,
  771. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  772. RATE_CKCTL | ALWAYS_ENABLED | CM_CORE_SEL1 |
  773. DELAYED_APP | CONFIG_PARTICIPANT |
  774. RATE_PROPAGATES,
  775. .rate_offset = 0,
  776. .recalc = &omap2_clksel_recalc,
  777. };
  778. static struct clk usb_l4_ick = { /* FS-USB interface clock */
  779. .name = "usb_l4_ick",
  780. .parent = &core_l3_ck,
  781. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  782. RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP |
  783. CONFIG_PARTICIPANT,
  784. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  785. .enable_bit = 0,
  786. .rate_offset = 25,
  787. .recalc = &omap2_clksel_recalc,
  788. };
  789. /*
  790. * SSI is in L3 management domain, its direct parent is core not l3,
  791. * many core power domain entities are grouped into the L3 clock
  792. * domain.
  793. * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_CLIK
  794. *
  795. * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
  796. */
  797. static struct clk ssi_ssr_sst_fck = {
  798. .name = "ssi_fck",
  799. .parent = &core_ck,
  800. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  801. RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
  802. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE, /* bit 1 */
  803. .enable_bit = 1,
  804. .rate_offset = 20,
  805. .recalc = &omap2_clksel_recalc,
  806. };
  807. /*
  808. * GFX clock domain
  809. * Clocks:
  810. * GFX_FCLK, GFX_ICLK
  811. * GFX_CG1(2d), GFX_CG2(3d)
  812. *
  813. * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
  814. * The 2d and 3d clocks run at a hardware determined
  815. * divided value of fclk.
  816. *
  817. */
  818. static struct clk gfx_3d_fck = {
  819. .name = "gfx_3d_fck",
  820. .parent = &core_l3_ck,
  821. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  822. RATE_CKCTL | CM_GFX_SEL1,
  823. .enable_reg = (void __iomem *)&CM_FCLKEN_GFX,
  824. .enable_bit = 2,
  825. .rate_offset= 0,
  826. .recalc = &omap2_clksel_recalc,
  827. };
  828. static struct clk gfx_2d_fck = {
  829. .name = "gfx_2d_fck",
  830. .parent = &core_l3_ck,
  831. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  832. RATE_CKCTL | CM_GFX_SEL1,
  833. .enable_reg = (void __iomem *)&CM_FCLKEN_GFX,
  834. .enable_bit = 1,
  835. .rate_offset= 0,
  836. .recalc = &omap2_clksel_recalc,
  837. };
  838. static struct clk gfx_ick = {
  839. .name = "gfx_ick", /* From l3 */
  840. .parent = &core_l3_ck,
  841. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  842. RATE_CKCTL,
  843. .enable_reg = (void __iomem *)&CM_ICLKEN_GFX, /* bit 0 */
  844. .enable_bit = 0,
  845. .recalc = &omap2_followparent_recalc,
  846. };
  847. /*
  848. * Modem clock domain (2430)
  849. * CLOCKS:
  850. * MDM_OSC_CLK
  851. * MDM_ICLK
  852. */
  853. static struct clk mdm_ick = { /* used both as a ick and fck */
  854. .name = "mdm_ick",
  855. .parent = &core_ck,
  856. .flags = CLOCK_IN_OMAP243X | RATE_CKCTL | CM_MODEM_SEL1 |
  857. DELAYED_APP | CONFIG_PARTICIPANT,
  858. .rate_offset = 0,
  859. .enable_reg = (void __iomem *)&CM_ICLKEN_MDM,
  860. .enable_bit = 0,
  861. .recalc = &omap2_clksel_recalc,
  862. };
  863. static struct clk mdm_osc_ck = {
  864. .name = "mdm_osc_ck",
  865. .rate = 26000000,
  866. .parent = &osc_ck,
  867. .flags = CLOCK_IN_OMAP243X | RATE_FIXED,
  868. .enable_reg = (void __iomem *)&CM_FCLKEN_MDM,
  869. .enable_bit = 1,
  870. .recalc = &omap2_followparent_recalc,
  871. };
  872. /*
  873. * L4 clock management domain
  874. *
  875. * This domain contains lots of interface clocks from the L4 interface, some
  876. * functional clocks. Fixed APLL functional source clocks are managed in
  877. * this domain.
  878. */
  879. static struct clk l4_ck = { /* used both as an ick and fck */
  880. .name = "l4_ck",
  881. .parent = &core_l3_ck,
  882. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  883. RATE_CKCTL | ALWAYS_ENABLED | CM_CORE_SEL1 |
  884. DELAYED_APP | RATE_PROPAGATES,
  885. .rate_offset = 5,
  886. .recalc = &omap2_clksel_recalc,
  887. };
  888. static struct clk ssi_l4_ick = {
  889. .name = "ssi_l4_ick",
  890. .parent = &l4_ck,
  891. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL,
  892. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE, /* bit 1 */
  893. .enable_bit = 1,
  894. .recalc = &omap2_followparent_recalc,
  895. };
  896. /*
  897. * DSS clock domain
  898. * CLOCKs:
  899. * DSS_L4_ICLK, DSS_L3_ICLK,
  900. * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
  901. *
  902. * DSS is both initiator and target.
  903. */
  904. static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
  905. .name = "dss_ick",
  906. .parent = &l4_ck, /* really both l3 and l4 */
  907. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL,
  908. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  909. .enable_bit = 0,
  910. .recalc = &omap2_followparent_recalc,
  911. };
  912. static struct clk dss1_fck = {
  913. .name = "dss1_fck",
  914. .parent = &core_ck, /* Core or sys */
  915. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  916. RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
  917. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  918. .enable_bit = 0,
  919. .rate_offset = 8,
  920. .src_offset = 8,
  921. .recalc = &omap2_clksel_recalc,
  922. };
  923. static struct clk dss2_fck = { /* Alt clk used in power management */
  924. .name = "dss2_fck",
  925. .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
  926. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  927. RATE_CKCTL | CM_CORE_SEL1 | RATE_FIXED,
  928. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  929. .enable_bit = 1,
  930. .src_offset = 13,
  931. .recalc = &omap2_followparent_recalc,
  932. };
  933. static struct clk dss_54m_fck = { /* Alt clk used in power management */
  934. .name = "dss_54m_fck", /* 54m tv clk */
  935. .parent = &func_54m_ck,
  936. .rate = 54000000,
  937. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  938. RATE_FIXED | RATE_PROPAGATES,
  939. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  940. .enable_bit = 2,
  941. .recalc = &omap2_propagate_rate,
  942. };
  943. /*
  944. * CORE power domain ICLK & FCLK defines.
  945. * Many of the these can have more than one possible parent. Entries
  946. * here will likely have an L4 interface parent, and may have multiple
  947. * functional clock parents.
  948. */
  949. static struct clk gpt1_ick = {
  950. .name = "gpt1_ick",
  951. .parent = &l4_ck,
  952. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  953. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP, /* Bit0 */
  954. .enable_bit = 0,
  955. .recalc = &omap2_followparent_recalc,
  956. };
  957. static struct clk gpt1_fck = {
  958. .name = "gpt1_fck",
  959. .parent = &func_32k_ck,
  960. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  961. CM_WKUP_SEL1,
  962. .enable_reg = (void __iomem *)&CM_FCLKEN_WKUP, /* Bit0 */
  963. .enable_bit = 0,
  964. .src_offset = 0,
  965. .recalc = &omap2_followparent_recalc,
  966. };
  967. static struct clk gpt2_ick = {
  968. .name = "gpt2_ick",
  969. .parent = &l4_ck,
  970. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  971. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit4 */
  972. .enable_bit = 0,
  973. .recalc = &omap2_followparent_recalc,
  974. };
  975. static struct clk gpt2_fck = {
  976. .name = "gpt2_fck",
  977. .parent = &func_32k_ck,
  978. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  979. CM_CORE_SEL2,
  980. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  981. .enable_bit = 4,
  982. .src_offset = 2,
  983. .recalc = &omap2_followparent_recalc,
  984. };
  985. static struct clk gpt3_ick = {
  986. .name = "gpt3_ick",
  987. .parent = &l4_ck,
  988. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  989. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit5 */
  990. .enable_bit = 5,
  991. .recalc = &omap2_followparent_recalc,
  992. };
  993. static struct clk gpt3_fck = {
  994. .name = "gpt3_fck",
  995. .parent = &func_32k_ck,
  996. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  997. CM_CORE_SEL2,
  998. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  999. .enable_bit = 5,
  1000. .src_offset = 4,
  1001. .recalc = &omap2_followparent_recalc,
  1002. };
  1003. static struct clk gpt4_ick = {
  1004. .name = "gpt4_ick",
  1005. .parent = &l4_ck,
  1006. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1007. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit6 */
  1008. .enable_bit = 6,
  1009. .recalc = &omap2_followparent_recalc,
  1010. };
  1011. static struct clk gpt4_fck = {
  1012. .name = "gpt4_fck",
  1013. .parent = &func_32k_ck,
  1014. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1015. CM_CORE_SEL2,
  1016. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1017. .enable_bit = 6,
  1018. .src_offset = 6,
  1019. .recalc = &omap2_followparent_recalc,
  1020. };
  1021. static struct clk gpt5_ick = {
  1022. .name = "gpt5_ick",
  1023. .parent = &l4_ck,
  1024. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1025. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit7 */
  1026. .enable_bit = 7,
  1027. .recalc = &omap2_followparent_recalc,
  1028. };
  1029. static struct clk gpt5_fck = {
  1030. .name = "gpt5_fck",
  1031. .parent = &func_32k_ck,
  1032. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1033. CM_CORE_SEL2,
  1034. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1035. .enable_bit = 7,
  1036. .src_offset = 8,
  1037. .recalc = &omap2_followparent_recalc,
  1038. };
  1039. static struct clk gpt6_ick = {
  1040. .name = "gpt6_ick",
  1041. .parent = &l4_ck,
  1042. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1043. .enable_bit = 8,
  1044. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit8 */
  1045. .recalc = &omap2_followparent_recalc,
  1046. };
  1047. static struct clk gpt6_fck = {
  1048. .name = "gpt6_fck",
  1049. .parent = &func_32k_ck,
  1050. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1051. CM_CORE_SEL2,
  1052. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1053. .enable_bit = 8,
  1054. .src_offset = 10,
  1055. .recalc = &omap2_followparent_recalc,
  1056. };
  1057. static struct clk gpt7_ick = {
  1058. .name = "gpt7_ick",
  1059. .parent = &l4_ck,
  1060. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1061. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit9 */
  1062. .enable_bit = 9,
  1063. .recalc = &omap2_followparent_recalc,
  1064. };
  1065. static struct clk gpt7_fck = {
  1066. .name = "gpt7_fck",
  1067. .parent = &func_32k_ck,
  1068. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1069. CM_CORE_SEL2,
  1070. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1071. .enable_bit = 9,
  1072. .src_offset = 12,
  1073. .recalc = &omap2_followparent_recalc,
  1074. };
  1075. static struct clk gpt8_ick = {
  1076. .name = "gpt8_ick",
  1077. .parent = &l4_ck,
  1078. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1079. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit10 */
  1080. .enable_bit = 10,
  1081. .recalc = &omap2_followparent_recalc,
  1082. };
  1083. static struct clk gpt8_fck = {
  1084. .name = "gpt8_fck",
  1085. .parent = &func_32k_ck,
  1086. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1087. CM_CORE_SEL2,
  1088. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1089. .enable_bit = 10,
  1090. .src_offset = 14,
  1091. .recalc = &omap2_followparent_recalc,
  1092. };
  1093. static struct clk gpt9_ick = {
  1094. .name = "gpt9_ick",
  1095. .parent = &l4_ck,
  1096. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1097. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1098. .enable_bit = 11,
  1099. .recalc = &omap2_followparent_recalc,
  1100. };
  1101. static struct clk gpt9_fck = {
  1102. .name = "gpt9_fck",
  1103. .parent = &func_32k_ck,
  1104. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1105. CM_CORE_SEL2,
  1106. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1107. .enable_bit = 11,
  1108. .src_offset = 16,
  1109. .recalc = &omap2_followparent_recalc,
  1110. };
  1111. static struct clk gpt10_ick = {
  1112. .name = "gpt10_ick",
  1113. .parent = &l4_ck,
  1114. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1115. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1116. .enable_bit = 12,
  1117. .recalc = &omap2_followparent_recalc,
  1118. };
  1119. static struct clk gpt10_fck = {
  1120. .name = "gpt10_fck",
  1121. .parent = &func_32k_ck,
  1122. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1123. CM_CORE_SEL2,
  1124. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1125. .enable_bit = 12,
  1126. .src_offset = 18,
  1127. .recalc = &omap2_followparent_recalc,
  1128. };
  1129. static struct clk gpt11_ick = {
  1130. .name = "gpt11_ick",
  1131. .parent = &l4_ck,
  1132. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1133. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1134. .enable_bit = 13,
  1135. .recalc = &omap2_followparent_recalc,
  1136. };
  1137. static struct clk gpt11_fck = {
  1138. .name = "gpt11_fck",
  1139. .parent = &func_32k_ck,
  1140. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1141. CM_CORE_SEL2,
  1142. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1143. .enable_bit = 13,
  1144. .src_offset = 20,
  1145. .recalc = &omap2_followparent_recalc,
  1146. };
  1147. static struct clk gpt12_ick = {
  1148. .name = "gpt12_ick",
  1149. .parent = &l4_ck,
  1150. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1151. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit14 */
  1152. .enable_bit = 14,
  1153. .recalc = &omap2_followparent_recalc,
  1154. };
  1155. static struct clk gpt12_fck = {
  1156. .name = "gpt12_fck",
  1157. .parent = &func_32k_ck,
  1158. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1159. CM_CORE_SEL2,
  1160. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1161. .enable_bit = 14,
  1162. .src_offset = 22,
  1163. .recalc = &omap2_followparent_recalc,
  1164. };
  1165. static struct clk mcbsp1_ick = {
  1166. .name = "mcbsp1_ick",
  1167. .parent = &l4_ck,
  1168. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1169. .enable_bit = 15,
  1170. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit16 */
  1171. .recalc = &omap2_followparent_recalc,
  1172. };
  1173. static struct clk mcbsp1_fck = {
  1174. .name = "mcbsp1_fck",
  1175. .parent = &func_96m_ck,
  1176. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1177. .enable_bit = 15,
  1178. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1179. .recalc = &omap2_followparent_recalc,
  1180. };
  1181. static struct clk mcbsp2_ick = {
  1182. .name = "mcbsp2_ick",
  1183. .parent = &l4_ck,
  1184. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1185. .enable_bit = 16,
  1186. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1187. .recalc = &omap2_followparent_recalc,
  1188. };
  1189. static struct clk mcbsp2_fck = {
  1190. .name = "mcbsp2_fck",
  1191. .parent = &func_96m_ck,
  1192. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1193. .enable_bit = 16,
  1194. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1195. .recalc = &omap2_followparent_recalc,
  1196. };
  1197. static struct clk mcbsp3_ick = {
  1198. .name = "mcbsp3_ick",
  1199. .parent = &l4_ck,
  1200. .flags = CLOCK_IN_OMAP243X,
  1201. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1202. .enable_bit = 3,
  1203. .recalc = &omap2_followparent_recalc,
  1204. };
  1205. static struct clk mcbsp3_fck = {
  1206. .name = "mcbsp3_fck",
  1207. .parent = &func_96m_ck,
  1208. .flags = CLOCK_IN_OMAP243X,
  1209. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1210. .enable_bit = 3,
  1211. .recalc = &omap2_followparent_recalc,
  1212. };
  1213. static struct clk mcbsp4_ick = {
  1214. .name = "mcbsp4_ick",
  1215. .parent = &l4_ck,
  1216. .flags = CLOCK_IN_OMAP243X,
  1217. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1218. .enable_bit = 4,
  1219. .recalc = &omap2_followparent_recalc,
  1220. };
  1221. static struct clk mcbsp4_fck = {
  1222. .name = "mcbsp4_fck",
  1223. .parent = &func_96m_ck,
  1224. .flags = CLOCK_IN_OMAP243X,
  1225. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1226. .enable_bit = 4,
  1227. .recalc = &omap2_followparent_recalc,
  1228. };
  1229. static struct clk mcbsp5_ick = {
  1230. .name = "mcbsp5_ick",
  1231. .parent = &l4_ck,
  1232. .flags = CLOCK_IN_OMAP243X,
  1233. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1234. .enable_bit = 5,
  1235. .recalc = &omap2_followparent_recalc,
  1236. };
  1237. static struct clk mcbsp5_fck = {
  1238. .name = "mcbsp5_fck",
  1239. .parent = &func_96m_ck,
  1240. .flags = CLOCK_IN_OMAP243X,
  1241. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1242. .enable_bit = 5,
  1243. .recalc = &omap2_followparent_recalc,
  1244. };
  1245. static struct clk mcspi1_ick = {
  1246. .name = "mcspi1_ick",
  1247. .parent = &l4_ck,
  1248. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1249. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1250. .enable_bit = 17,
  1251. .recalc = &omap2_followparent_recalc,
  1252. };
  1253. static struct clk mcspi1_fck = {
  1254. .name = "mcspi1_fck",
  1255. .parent = &func_48m_ck,
  1256. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1257. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1258. .enable_bit = 17,
  1259. .recalc = &omap2_followparent_recalc,
  1260. };
  1261. static struct clk mcspi2_ick = {
  1262. .name = "mcspi2_ick",
  1263. .parent = &l4_ck,
  1264. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1265. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1266. .enable_bit = 18,
  1267. .recalc = &omap2_followparent_recalc,
  1268. };
  1269. static struct clk mcspi2_fck = {
  1270. .name = "mcspi2_fck",
  1271. .parent = &func_48m_ck,
  1272. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1273. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1274. .enable_bit = 18,
  1275. .recalc = &omap2_followparent_recalc,
  1276. };
  1277. static struct clk mcspi3_ick = {
  1278. .name = "mcspi3_ick",
  1279. .parent = &l4_ck,
  1280. .flags = CLOCK_IN_OMAP243X,
  1281. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1282. .enable_bit = 9,
  1283. .recalc = &omap2_followparent_recalc,
  1284. };
  1285. static struct clk mcspi3_fck = {
  1286. .name = "mcspi3_fck",
  1287. .parent = &func_48m_ck,
  1288. .flags = CLOCK_IN_OMAP243X,
  1289. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1290. .enable_bit = 9,
  1291. .recalc = &omap2_followparent_recalc,
  1292. };
  1293. static struct clk uart1_ick = {
  1294. .name = "uart1_ick",
  1295. .parent = &l4_ck,
  1296. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1297. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1298. .enable_bit = 21,
  1299. .recalc = &omap2_followparent_recalc,
  1300. };
  1301. static struct clk uart1_fck = {
  1302. .name = "uart1_fck",
  1303. .parent = &func_48m_ck,
  1304. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1305. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1306. .enable_bit = 21,
  1307. .recalc = &omap2_followparent_recalc,
  1308. };
  1309. static struct clk uart2_ick = {
  1310. .name = "uart2_ick",
  1311. .parent = &l4_ck,
  1312. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1313. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1314. .enable_bit = 22,
  1315. .recalc = &omap2_followparent_recalc,
  1316. };
  1317. static struct clk uart2_fck = {
  1318. .name = "uart2_fck",
  1319. .parent = &func_48m_ck,
  1320. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1321. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1322. .enable_bit = 22,
  1323. .recalc = &omap2_followparent_recalc,
  1324. };
  1325. static struct clk uart3_ick = {
  1326. .name = "uart3_ick",
  1327. .parent = &l4_ck,
  1328. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1329. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1330. .enable_bit = 2,
  1331. .recalc = &omap2_followparent_recalc,
  1332. };
  1333. static struct clk uart3_fck = {
  1334. .name = "uart3_fck",
  1335. .parent = &func_48m_ck,
  1336. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1337. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1338. .enable_bit = 2,
  1339. .recalc = &omap2_followparent_recalc,
  1340. };
  1341. static struct clk gpios_ick = {
  1342. .name = "gpios_ick",
  1343. .parent = &l4_ck,
  1344. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1345. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1346. .enable_bit = 2,
  1347. .recalc = &omap2_followparent_recalc,
  1348. };
  1349. static struct clk gpios_fck = {
  1350. .name = "gpios_fck",
  1351. .parent = &func_32k_ck,
  1352. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1353. .enable_reg = (void __iomem *)&CM_FCLKEN_WKUP,
  1354. .enable_bit = 2,
  1355. .recalc = &omap2_followparent_recalc,
  1356. };
  1357. static struct clk mpu_wdt_ick = {
  1358. .name = "mpu_wdt_ick",
  1359. .parent = &l4_ck,
  1360. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1361. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1362. .enable_bit = 3,
  1363. .recalc = &omap2_followparent_recalc,
  1364. };
  1365. static struct clk mpu_wdt_fck = {
  1366. .name = "mpu_wdt_fck",
  1367. .parent = &func_32k_ck,
  1368. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1369. .enable_reg = (void __iomem *)&CM_FCLKEN_WKUP,
  1370. .enable_bit = 3,
  1371. .recalc = &omap2_followparent_recalc,
  1372. };
  1373. static struct clk sync_32k_ick = {
  1374. .name = "sync_32k_ick",
  1375. .parent = &l4_ck,
  1376. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1377. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1378. .enable_bit = 1,
  1379. .recalc = &omap2_followparent_recalc,
  1380. };
  1381. static struct clk wdt1_ick = {
  1382. .name = "wdt1_ick",
  1383. .parent = &l4_ck,
  1384. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1385. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1386. .enable_bit = 4,
  1387. .recalc = &omap2_followparent_recalc,
  1388. };
  1389. static struct clk omapctrl_ick = {
  1390. .name = "omapctrl_ick",
  1391. .parent = &l4_ck,
  1392. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1393. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1394. .enable_bit = 5,
  1395. .recalc = &omap2_followparent_recalc,
  1396. };
  1397. static struct clk icr_ick = {
  1398. .name = "icr_ick",
  1399. .parent = &l4_ck,
  1400. .flags = CLOCK_IN_OMAP243X,
  1401. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1402. .enable_bit = 6,
  1403. .recalc = &omap2_followparent_recalc,
  1404. };
  1405. static struct clk cam_ick = {
  1406. .name = "cam_ick",
  1407. .parent = &l4_ck,
  1408. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1409. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1410. .enable_bit = 31,
  1411. .recalc = &omap2_followparent_recalc,
  1412. };
  1413. static struct clk cam_fck = {
  1414. .name = "cam_fck",
  1415. .parent = &func_96m_ck,
  1416. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1417. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1418. .enable_bit = 31,
  1419. .recalc = &omap2_followparent_recalc,
  1420. };
  1421. static struct clk mailboxes_ick = {
  1422. .name = "mailboxes_ick",
  1423. .parent = &l4_ck,
  1424. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1425. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1426. .enable_bit = 30,
  1427. .recalc = &omap2_followparent_recalc,
  1428. };
  1429. static struct clk wdt4_ick = {
  1430. .name = "wdt4_ick",
  1431. .parent = &l4_ck,
  1432. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1433. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1434. .enable_bit = 29,
  1435. .recalc = &omap2_followparent_recalc,
  1436. };
  1437. static struct clk wdt4_fck = {
  1438. .name = "wdt4_fck",
  1439. .parent = &func_32k_ck,
  1440. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1441. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1442. .enable_bit = 29,
  1443. .recalc = &omap2_followparent_recalc,
  1444. };
  1445. static struct clk wdt3_ick = {
  1446. .name = "wdt3_ick",
  1447. .parent = &l4_ck,
  1448. .flags = CLOCK_IN_OMAP242X,
  1449. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1450. .enable_bit = 28,
  1451. .recalc = &omap2_followparent_recalc,
  1452. };
  1453. static struct clk wdt3_fck = {
  1454. .name = "wdt3_fck",
  1455. .parent = &func_32k_ck,
  1456. .flags = CLOCK_IN_OMAP242X,
  1457. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1458. .enable_bit = 28,
  1459. .recalc = &omap2_followparent_recalc,
  1460. };
  1461. static struct clk mspro_ick = {
  1462. .name = "mspro_ick",
  1463. .parent = &l4_ck,
  1464. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1465. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1466. .enable_bit = 27,
  1467. .recalc = &omap2_followparent_recalc,
  1468. };
  1469. static struct clk mspro_fck = {
  1470. .name = "mspro_fck",
  1471. .parent = &func_96m_ck,
  1472. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1473. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1474. .enable_bit = 27,
  1475. .recalc = &omap2_followparent_recalc,
  1476. };
  1477. static struct clk mmc_ick = {
  1478. .name = "mmc_ick",
  1479. .parent = &l4_ck,
  1480. .flags = CLOCK_IN_OMAP242X,
  1481. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1482. .enable_bit = 26,
  1483. .recalc = &omap2_followparent_recalc,
  1484. };
  1485. static struct clk mmc_fck = {
  1486. .name = "mmc_fck",
  1487. .parent = &func_96m_ck,
  1488. .flags = CLOCK_IN_OMAP242X,
  1489. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1490. .enable_bit = 26,
  1491. .recalc = &omap2_followparent_recalc,
  1492. };
  1493. static struct clk fac_ick = {
  1494. .name = "fac_ick",
  1495. .parent = &l4_ck,
  1496. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1497. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1498. .enable_bit = 25,
  1499. .recalc = &omap2_followparent_recalc,
  1500. };
  1501. static struct clk fac_fck = {
  1502. .name = "fac_fck",
  1503. .parent = &func_12m_ck,
  1504. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1505. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1506. .enable_bit = 25,
  1507. .recalc = &omap2_followparent_recalc,
  1508. };
  1509. static struct clk eac_ick = {
  1510. .name = "eac_ick",
  1511. .parent = &l4_ck,
  1512. .flags = CLOCK_IN_OMAP242X,
  1513. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1514. .enable_bit = 24,
  1515. .recalc = &omap2_followparent_recalc,
  1516. };
  1517. static struct clk eac_fck = {
  1518. .name = "eac_fck",
  1519. .parent = &func_96m_ck,
  1520. .flags = CLOCK_IN_OMAP242X,
  1521. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1522. .enable_bit = 24,
  1523. .recalc = &omap2_followparent_recalc,
  1524. };
  1525. static struct clk hdq_ick = {
  1526. .name = "hdq_ick",
  1527. .parent = &l4_ck,
  1528. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1529. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1530. .enable_bit = 23,
  1531. .recalc = &omap2_followparent_recalc,
  1532. };
  1533. static struct clk hdq_fck = {
  1534. .name = "hdq_fck",
  1535. .parent = &func_12m_ck,
  1536. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1537. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1538. .enable_bit = 23,
  1539. .recalc = &omap2_followparent_recalc,
  1540. };
  1541. static struct clk i2c2_ick = {
  1542. .name = "i2c2_ick",
  1543. .parent = &l4_ck,
  1544. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1545. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1546. .enable_bit = 20,
  1547. .recalc = &omap2_followparent_recalc,
  1548. };
  1549. static struct clk i2c2_fck = {
  1550. .name = "i2c2_fck",
  1551. .parent = &func_12m_ck,
  1552. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1553. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1554. .enable_bit = 20,
  1555. .recalc = &omap2_followparent_recalc,
  1556. };
  1557. static struct clk i2chs2_fck = {
  1558. .name = "i2chs2_fck",
  1559. .parent = &func_96m_ck,
  1560. .flags = CLOCK_IN_OMAP243X,
  1561. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1562. .enable_bit = 20,
  1563. .recalc = &omap2_followparent_recalc,
  1564. };
  1565. static struct clk i2c1_ick = {
  1566. .name = "i2c1_ick",
  1567. .parent = &l4_ck,
  1568. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1569. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1570. .enable_bit = 19,
  1571. .recalc = &omap2_followparent_recalc,
  1572. };
  1573. static struct clk i2c1_fck = {
  1574. .name = "i2c1_fck",
  1575. .parent = &func_12m_ck,
  1576. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1577. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1578. .enable_bit = 19,
  1579. .recalc = &omap2_followparent_recalc,
  1580. };
  1581. static struct clk i2chs1_fck = {
  1582. .name = "i2chs1_fck",
  1583. .parent = &func_96m_ck,
  1584. .flags = CLOCK_IN_OMAP243X,
  1585. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1586. .enable_bit = 19,
  1587. .recalc = &omap2_followparent_recalc,
  1588. };
  1589. static struct clk vlynq_ick = {
  1590. .name = "vlynq_ick",
  1591. .parent = &core_l3_ck,
  1592. .flags = CLOCK_IN_OMAP242X,
  1593. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1594. .enable_bit = 3,
  1595. .recalc = &omap2_followparent_recalc,
  1596. };
  1597. static struct clk vlynq_fck = {
  1598. .name = "vlynq_fck",
  1599. .parent = &func_96m_ck,
  1600. .flags = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
  1601. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1602. .enable_bit = 3,
  1603. .src_offset = 15,
  1604. .recalc = &omap2_followparent_recalc,
  1605. };
  1606. static struct clk sdrc_ick = {
  1607. .name = "sdrc_ick",
  1608. .parent = &l4_ck,
  1609. .flags = CLOCK_IN_OMAP243X,
  1610. .enable_reg = (void __iomem *)&CM_ICLKEN3_CORE,
  1611. .enable_bit = 2,
  1612. .recalc = &omap2_followparent_recalc,
  1613. };
  1614. static struct clk des_ick = {
  1615. .name = "des_ick",
  1616. .parent = &l4_ck,
  1617. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1618. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1619. .enable_bit = 0,
  1620. .recalc = &omap2_followparent_recalc,
  1621. };
  1622. static struct clk sha_ick = {
  1623. .name = "sha_ick",
  1624. .parent = &l4_ck,
  1625. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1626. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1627. .enable_bit = 1,
  1628. .recalc = &omap2_followparent_recalc,
  1629. };
  1630. static struct clk rng_ick = {
  1631. .name = "rng_ick",
  1632. .parent = &l4_ck,
  1633. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1634. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1635. .enable_bit = 2,
  1636. .recalc = &omap2_followparent_recalc,
  1637. };
  1638. static struct clk aes_ick = {
  1639. .name = "aes_ick",
  1640. .parent = &l4_ck,
  1641. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1642. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1643. .enable_bit = 3,
  1644. .recalc = &omap2_followparent_recalc,
  1645. };
  1646. static struct clk pka_ick = {
  1647. .name = "pka_ick",
  1648. .parent = &l4_ck,
  1649. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1650. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1651. .enable_bit = 4,
  1652. .recalc = &omap2_followparent_recalc,
  1653. };
  1654. static struct clk usb_fck = {
  1655. .name = "usb_fck",
  1656. .parent = &func_48m_ck,
  1657. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1658. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1659. .enable_bit = 0,
  1660. .recalc = &omap2_followparent_recalc,
  1661. };
  1662. static struct clk usbhs_ick = {
  1663. .name = "usbhs_ick",
  1664. .parent = &core_l3_ck,
  1665. .flags = CLOCK_IN_OMAP243X,
  1666. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1667. .enable_bit = 6,
  1668. .recalc = &omap2_followparent_recalc,
  1669. };
  1670. static struct clk mmchs1_ick = {
  1671. .name = "mmchs1_ick",
  1672. .parent = &l4_ck,
  1673. .flags = CLOCK_IN_OMAP243X,
  1674. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1675. .enable_bit = 7,
  1676. .recalc = &omap2_followparent_recalc,
  1677. };
  1678. static struct clk mmchs1_fck = {
  1679. .name = "mmchs1_fck",
  1680. .parent = &func_96m_ck,
  1681. .flags = CLOCK_IN_OMAP243X,
  1682. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1683. .enable_bit = 7,
  1684. .recalc = &omap2_followparent_recalc,
  1685. };
  1686. static struct clk mmchs2_ick = {
  1687. .name = "mmchs2_ick",
  1688. .parent = &l4_ck,
  1689. .flags = CLOCK_IN_OMAP243X,
  1690. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1691. .enable_bit = 8,
  1692. .recalc = &omap2_followparent_recalc,
  1693. };
  1694. static struct clk mmchs2_fck = {
  1695. .name = "mmchs2_fck",
  1696. .parent = &func_96m_ck,
  1697. .flags = CLOCK_IN_OMAP243X,
  1698. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1699. .enable_bit = 8,
  1700. .recalc = &omap2_followparent_recalc,
  1701. };
  1702. static struct clk gpio5_ick = {
  1703. .name = "gpio5_ick",
  1704. .parent = &l4_ck,
  1705. .flags = CLOCK_IN_OMAP243X,
  1706. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1707. .enable_bit = 10,
  1708. .recalc = &omap2_followparent_recalc,
  1709. };
  1710. static struct clk gpio5_fck = {
  1711. .name = "gpio5_fck",
  1712. .parent = &func_32k_ck,
  1713. .flags = CLOCK_IN_OMAP243X,
  1714. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1715. .enable_bit = 10,
  1716. .recalc = &omap2_followparent_recalc,
  1717. };
  1718. static struct clk mdm_intc_ick = {
  1719. .name = "mdm_intc_ick",
  1720. .parent = &l4_ck,
  1721. .flags = CLOCK_IN_OMAP243X,
  1722. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1723. .enable_bit = 11,
  1724. .recalc = &omap2_followparent_recalc,
  1725. };
  1726. static struct clk mmchsdb1_fck = {
  1727. .name = "mmchsdb1_fck",
  1728. .parent = &func_32k_ck,
  1729. .flags = CLOCK_IN_OMAP243X,
  1730. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1731. .enable_bit = 16,
  1732. .recalc = &omap2_followparent_recalc,
  1733. };
  1734. static struct clk mmchsdb2_fck = {
  1735. .name = "mmchsdb2_fck",
  1736. .parent = &func_32k_ck,
  1737. .flags = CLOCK_IN_OMAP243X,
  1738. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1739. .enable_bit = 17,
  1740. .recalc = &omap2_followparent_recalc,
  1741. };
  1742. /*
  1743. * This clock is a composite clock which does entire set changes then
  1744. * forces a rebalance. It keys on the MPU speed, but it really could
  1745. * be any key speed part of a set in the rate table.
  1746. *
  1747. * to really change a set, you need memory table sets which get changed
  1748. * in sram, pre-notifiers & post notifiers, changing the top set, without
  1749. * having low level display recalc's won't work... this is why dpm notifiers
  1750. * work, isr's off, walk a list of clocks already _off_ and not messing with
  1751. * the bus.
  1752. *
  1753. * This clock should have no parent. It embodies the entire upper level
  1754. * active set. A parent will mess up some of the init also.
  1755. */
  1756. static struct clk virt_prcm_set = {
  1757. .name = "virt_prcm_set",
  1758. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1759. VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP,
  1760. .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
  1761. .recalc = &omap2_mpu_recalc, /* sets are keyed on mpu rate */
  1762. .set_rate = &omap2_select_table_rate,
  1763. .round_rate = &omap2_round_to_table_rate,
  1764. };
  1765. static struct clk *onchip_clks[] = {
  1766. /* external root sources */
  1767. &func_32k_ck,
  1768. &osc_ck,
  1769. &sys_ck,
  1770. &alt_ck,
  1771. /* internal analog sources */
  1772. &dpll_ck,
  1773. &apll96_ck,
  1774. &apll54_ck,
  1775. /* internal prcm root sources */
  1776. &func_54m_ck,
  1777. &core_ck,
  1778. &sleep_ck,
  1779. &func_96m_ck,
  1780. &func_48m_ck,
  1781. &func_12m_ck,
  1782. &wdt1_osc_ck,
  1783. &sys_clkout,
  1784. &sys_clkout2,
  1785. /* mpu domain clocks */
  1786. &mpu_ck,
  1787. /* dsp domain clocks */
  1788. &iva2_1_fck, /* 2430 */
  1789. &iva2_1_ick,
  1790. &dsp_ick, /* 2420 */
  1791. &dsp_fck,
  1792. &iva1_ifck,
  1793. &iva1_mpu_int_ifck,
  1794. /* GFX domain clocks */
  1795. &gfx_3d_fck,
  1796. &gfx_2d_fck,
  1797. &gfx_ick,
  1798. /* Modem domain clocks */
  1799. &mdm_ick,
  1800. &mdm_osc_ck,
  1801. /* DSS domain clocks */
  1802. &dss_ick,
  1803. &dss1_fck,
  1804. &dss2_fck,
  1805. &dss_54m_fck,
  1806. /* L3 domain clocks */
  1807. &core_l3_ck,
  1808. &ssi_ssr_sst_fck,
  1809. &usb_l4_ick,
  1810. /* L4 domain clocks */
  1811. &l4_ck, /* used as both core_l4 and wu_l4 */
  1812. &ssi_l4_ick,
  1813. /* virtual meta-group clock */
  1814. &virt_prcm_set,
  1815. /* general l4 interface ck, multi-parent functional clk */
  1816. &gpt1_ick,
  1817. &gpt1_fck,
  1818. &gpt2_ick,
  1819. &gpt2_fck,
  1820. &gpt3_ick,
  1821. &gpt3_fck,
  1822. &gpt4_ick,
  1823. &gpt4_fck,
  1824. &gpt5_ick,
  1825. &gpt5_fck,
  1826. &gpt6_ick,
  1827. &gpt6_fck,
  1828. &gpt7_ick,
  1829. &gpt7_fck,
  1830. &gpt8_ick,
  1831. &gpt8_fck,
  1832. &gpt9_ick,
  1833. &gpt9_fck,
  1834. &gpt10_ick,
  1835. &gpt10_fck,
  1836. &gpt11_ick,
  1837. &gpt11_fck,
  1838. &gpt12_ick,
  1839. &gpt12_fck,
  1840. &mcbsp1_ick,
  1841. &mcbsp1_fck,
  1842. &mcbsp2_ick,
  1843. &mcbsp2_fck,
  1844. &mcbsp3_ick,
  1845. &mcbsp3_fck,
  1846. &mcbsp4_ick,
  1847. &mcbsp4_fck,
  1848. &mcbsp5_ick,
  1849. &mcbsp5_fck,
  1850. &mcspi1_ick,
  1851. &mcspi1_fck,
  1852. &mcspi2_ick,
  1853. &mcspi2_fck,
  1854. &mcspi3_ick,
  1855. &mcspi3_fck,
  1856. &uart1_ick,
  1857. &uart1_fck,
  1858. &uart2_ick,
  1859. &uart2_fck,
  1860. &uart3_ick,
  1861. &uart3_fck,
  1862. &gpios_ick,
  1863. &gpios_fck,
  1864. &mpu_wdt_ick,
  1865. &mpu_wdt_fck,
  1866. &sync_32k_ick,
  1867. &wdt1_ick,
  1868. &omapctrl_ick,
  1869. &icr_ick,
  1870. &cam_fck,
  1871. &cam_ick,
  1872. &mailboxes_ick,
  1873. &wdt4_ick,
  1874. &wdt4_fck,
  1875. &wdt3_ick,
  1876. &wdt3_fck,
  1877. &mspro_ick,
  1878. &mspro_fck,
  1879. &mmc_ick,
  1880. &mmc_fck,
  1881. &fac_ick,
  1882. &fac_fck,
  1883. &eac_ick,
  1884. &eac_fck,
  1885. &hdq_ick,
  1886. &hdq_fck,
  1887. &i2c1_ick,
  1888. &i2c1_fck,
  1889. &i2chs1_fck,
  1890. &i2c2_ick,
  1891. &i2c2_fck,
  1892. &i2chs2_fck,
  1893. &vlynq_ick,
  1894. &vlynq_fck,
  1895. &sdrc_ick,
  1896. &des_ick,
  1897. &sha_ick,
  1898. &rng_ick,
  1899. &aes_ick,
  1900. &pka_ick,
  1901. &usb_fck,
  1902. &usbhs_ick,
  1903. &mmchs1_ick,
  1904. &mmchs1_fck,
  1905. &mmchs2_ick,
  1906. &mmchs2_fck,
  1907. &gpio5_ick,
  1908. &gpio5_fck,
  1909. &mdm_intc_ick,
  1910. &mmchsdb1_fck,
  1911. &mmchsdb2_fck,
  1912. };
  1913. #endif