clock.h 60 KB

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