clock.h 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111
  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. DELAYED_APP,
  925. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  926. .enable_bit = 1,
  927. .src_offset = 13,
  928. .recalc = &omap2_followparent_recalc,
  929. };
  930. static struct clk dss_54m_fck = { /* Alt clk used in power management */
  931. .name = "dss_54m_fck", /* 54m tv clk */
  932. .parent = &func_54m_ck,
  933. .rate = 54000000,
  934. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  935. RATE_FIXED | RATE_PROPAGATES,
  936. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  937. .enable_bit = 2,
  938. .recalc = &omap2_propagate_rate,
  939. };
  940. /*
  941. * CORE power domain ICLK & FCLK defines.
  942. * Many of the these can have more than one possible parent. Entries
  943. * here will likely have an L4 interface parent, and may have multiple
  944. * functional clock parents.
  945. */
  946. static struct clk gpt1_ick = {
  947. .name = "gpt1_ick",
  948. .parent = &l4_ck,
  949. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  950. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP, /* Bit0 */
  951. .enable_bit = 0,
  952. .recalc = &omap2_followparent_recalc,
  953. };
  954. static struct clk gpt1_fck = {
  955. .name = "gpt1_fck",
  956. .parent = &func_32k_ck,
  957. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  958. CM_WKUP_SEL1,
  959. .enable_reg = (void __iomem *)&CM_FCLKEN_WKUP, /* Bit0 */
  960. .enable_bit = 0,
  961. .src_offset = 0,
  962. .recalc = &omap2_followparent_recalc,
  963. };
  964. static struct clk gpt2_ick = {
  965. .name = "gpt2_ick",
  966. .parent = &l4_ck,
  967. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  968. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit4 */
  969. .enable_bit = 4,
  970. .recalc = &omap2_followparent_recalc,
  971. };
  972. static struct clk gpt2_fck = {
  973. .name = "gpt2_fck",
  974. .parent = &func_32k_ck,
  975. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  976. CM_CORE_SEL2,
  977. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  978. .enable_bit = 4,
  979. .src_offset = 2,
  980. .recalc = &omap2_followparent_recalc,
  981. };
  982. static struct clk gpt3_ick = {
  983. .name = "gpt3_ick",
  984. .parent = &l4_ck,
  985. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  986. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit5 */
  987. .enable_bit = 5,
  988. .recalc = &omap2_followparent_recalc,
  989. };
  990. static struct clk gpt3_fck = {
  991. .name = "gpt3_fck",
  992. .parent = &func_32k_ck,
  993. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  994. CM_CORE_SEL2,
  995. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  996. .enable_bit = 5,
  997. .src_offset = 4,
  998. .recalc = &omap2_followparent_recalc,
  999. };
  1000. static struct clk gpt4_ick = {
  1001. .name = "gpt4_ick",
  1002. .parent = &l4_ck,
  1003. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1004. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit6 */
  1005. .enable_bit = 6,
  1006. .recalc = &omap2_followparent_recalc,
  1007. };
  1008. static struct clk gpt4_fck = {
  1009. .name = "gpt4_fck",
  1010. .parent = &func_32k_ck,
  1011. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1012. CM_CORE_SEL2,
  1013. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1014. .enable_bit = 6,
  1015. .src_offset = 6,
  1016. .recalc = &omap2_followparent_recalc,
  1017. };
  1018. static struct clk gpt5_ick = {
  1019. .name = "gpt5_ick",
  1020. .parent = &l4_ck,
  1021. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1022. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* Bit7 */
  1023. .enable_bit = 7,
  1024. .recalc = &omap2_followparent_recalc,
  1025. };
  1026. static struct clk gpt5_fck = {
  1027. .name = "gpt5_fck",
  1028. .parent = &func_32k_ck,
  1029. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1030. CM_CORE_SEL2,
  1031. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1032. .enable_bit = 7,
  1033. .src_offset = 8,
  1034. .recalc = &omap2_followparent_recalc,
  1035. };
  1036. static struct clk gpt6_ick = {
  1037. .name = "gpt6_ick",
  1038. .parent = &l4_ck,
  1039. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1040. .enable_bit = 8,
  1041. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit8 */
  1042. .recalc = &omap2_followparent_recalc,
  1043. };
  1044. static struct clk gpt6_fck = {
  1045. .name = "gpt6_fck",
  1046. .parent = &func_32k_ck,
  1047. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1048. CM_CORE_SEL2,
  1049. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1050. .enable_bit = 8,
  1051. .src_offset = 10,
  1052. .recalc = &omap2_followparent_recalc,
  1053. };
  1054. static struct clk gpt7_ick = {
  1055. .name = "gpt7_ick",
  1056. .parent = &l4_ck,
  1057. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1058. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit9 */
  1059. .enable_bit = 9,
  1060. .recalc = &omap2_followparent_recalc,
  1061. };
  1062. static struct clk gpt7_fck = {
  1063. .name = "gpt7_fck",
  1064. .parent = &func_32k_ck,
  1065. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1066. CM_CORE_SEL2,
  1067. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1068. .enable_bit = 9,
  1069. .src_offset = 12,
  1070. .recalc = &omap2_followparent_recalc,
  1071. };
  1072. static struct clk gpt8_ick = {
  1073. .name = "gpt8_ick",
  1074. .parent = &l4_ck,
  1075. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1076. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit10 */
  1077. .enable_bit = 10,
  1078. .recalc = &omap2_followparent_recalc,
  1079. };
  1080. static struct clk gpt8_fck = {
  1081. .name = "gpt8_fck",
  1082. .parent = &func_32k_ck,
  1083. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1084. CM_CORE_SEL2,
  1085. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1086. .enable_bit = 10,
  1087. .src_offset = 14,
  1088. .recalc = &omap2_followparent_recalc,
  1089. };
  1090. static struct clk gpt9_ick = {
  1091. .name = "gpt9_ick",
  1092. .parent = &l4_ck,
  1093. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1094. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1095. .enable_bit = 11,
  1096. .recalc = &omap2_followparent_recalc,
  1097. };
  1098. static struct clk gpt9_fck = {
  1099. .name = "gpt9_fck",
  1100. .parent = &func_32k_ck,
  1101. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1102. CM_CORE_SEL2,
  1103. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1104. .enable_bit = 11,
  1105. .src_offset = 16,
  1106. .recalc = &omap2_followparent_recalc,
  1107. };
  1108. static struct clk gpt10_ick = {
  1109. .name = "gpt10_ick",
  1110. .parent = &l4_ck,
  1111. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1112. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1113. .enable_bit = 12,
  1114. .recalc = &omap2_followparent_recalc,
  1115. };
  1116. static struct clk gpt10_fck = {
  1117. .name = "gpt10_fck",
  1118. .parent = &func_32k_ck,
  1119. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1120. CM_CORE_SEL2,
  1121. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1122. .enable_bit = 12,
  1123. .src_offset = 18,
  1124. .recalc = &omap2_followparent_recalc,
  1125. };
  1126. static struct clk gpt11_ick = {
  1127. .name = "gpt11_ick",
  1128. .parent = &l4_ck,
  1129. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1130. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1131. .enable_bit = 13,
  1132. .recalc = &omap2_followparent_recalc,
  1133. };
  1134. static struct clk gpt11_fck = {
  1135. .name = "gpt11_fck",
  1136. .parent = &func_32k_ck,
  1137. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1138. CM_CORE_SEL2,
  1139. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1140. .enable_bit = 13,
  1141. .src_offset = 20,
  1142. .recalc = &omap2_followparent_recalc,
  1143. };
  1144. static struct clk gpt12_ick = {
  1145. .name = "gpt12_ick",
  1146. .parent = &l4_ck,
  1147. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1148. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit14 */
  1149. .enable_bit = 14,
  1150. .recalc = &omap2_followparent_recalc,
  1151. };
  1152. static struct clk gpt12_fck = {
  1153. .name = "gpt12_fck",
  1154. .parent = &func_32k_ck,
  1155. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1156. CM_CORE_SEL2,
  1157. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1158. .enable_bit = 14,
  1159. .src_offset = 22,
  1160. .recalc = &omap2_followparent_recalc,
  1161. };
  1162. static struct clk mcbsp1_ick = {
  1163. .name = "mcbsp1_ick",
  1164. .parent = &l4_ck,
  1165. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1166. .enable_bit = 15,
  1167. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE, /* bit16 */
  1168. .recalc = &omap2_followparent_recalc,
  1169. };
  1170. static struct clk mcbsp1_fck = {
  1171. .name = "mcbsp1_fck",
  1172. .parent = &func_96m_ck,
  1173. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1174. .enable_bit = 15,
  1175. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1176. .recalc = &omap2_followparent_recalc,
  1177. };
  1178. static struct clk mcbsp2_ick = {
  1179. .name = "mcbsp2_ick",
  1180. .parent = &l4_ck,
  1181. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1182. .enable_bit = 16,
  1183. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1184. .recalc = &omap2_followparent_recalc,
  1185. };
  1186. static struct clk mcbsp2_fck = {
  1187. .name = "mcbsp2_fck",
  1188. .parent = &func_96m_ck,
  1189. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1190. .enable_bit = 16,
  1191. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1192. .recalc = &omap2_followparent_recalc,
  1193. };
  1194. static struct clk mcbsp3_ick = {
  1195. .name = "mcbsp3_ick",
  1196. .parent = &l4_ck,
  1197. .flags = CLOCK_IN_OMAP243X,
  1198. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1199. .enable_bit = 3,
  1200. .recalc = &omap2_followparent_recalc,
  1201. };
  1202. static struct clk mcbsp3_fck = {
  1203. .name = "mcbsp3_fck",
  1204. .parent = &func_96m_ck,
  1205. .flags = CLOCK_IN_OMAP243X,
  1206. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1207. .enable_bit = 3,
  1208. .recalc = &omap2_followparent_recalc,
  1209. };
  1210. static struct clk mcbsp4_ick = {
  1211. .name = "mcbsp4_ick",
  1212. .parent = &l4_ck,
  1213. .flags = CLOCK_IN_OMAP243X,
  1214. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1215. .enable_bit = 4,
  1216. .recalc = &omap2_followparent_recalc,
  1217. };
  1218. static struct clk mcbsp4_fck = {
  1219. .name = "mcbsp4_fck",
  1220. .parent = &func_96m_ck,
  1221. .flags = CLOCK_IN_OMAP243X,
  1222. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1223. .enable_bit = 4,
  1224. .recalc = &omap2_followparent_recalc,
  1225. };
  1226. static struct clk mcbsp5_ick = {
  1227. .name = "mcbsp5_ick",
  1228. .parent = &l4_ck,
  1229. .flags = CLOCK_IN_OMAP243X,
  1230. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1231. .enable_bit = 5,
  1232. .recalc = &omap2_followparent_recalc,
  1233. };
  1234. static struct clk mcbsp5_fck = {
  1235. .name = "mcbsp5_fck",
  1236. .parent = &func_96m_ck,
  1237. .flags = CLOCK_IN_OMAP243X,
  1238. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1239. .enable_bit = 5,
  1240. .recalc = &omap2_followparent_recalc,
  1241. };
  1242. static struct clk mcspi1_ick = {
  1243. .name = "mcspi_ick",
  1244. .id = 1,
  1245. .parent = &l4_ck,
  1246. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1247. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1248. .enable_bit = 17,
  1249. .recalc = &omap2_followparent_recalc,
  1250. };
  1251. static struct clk mcspi1_fck = {
  1252. .name = "mcspi_fck",
  1253. .id = 1,
  1254. .parent = &func_48m_ck,
  1255. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1256. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1257. .enable_bit = 17,
  1258. .recalc = &omap2_followparent_recalc,
  1259. };
  1260. static struct clk mcspi2_ick = {
  1261. .name = "mcspi_ick",
  1262. .id = 2,
  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 = "mcspi_fck",
  1271. .id = 2,
  1272. .parent = &func_48m_ck,
  1273. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1274. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1275. .enable_bit = 18,
  1276. .recalc = &omap2_followparent_recalc,
  1277. };
  1278. static struct clk mcspi3_ick = {
  1279. .name = "mcspi_ick",
  1280. .id = 3,
  1281. .parent = &l4_ck,
  1282. .flags = CLOCK_IN_OMAP243X,
  1283. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1284. .enable_bit = 9,
  1285. .recalc = &omap2_followparent_recalc,
  1286. };
  1287. static struct clk mcspi3_fck = {
  1288. .name = "mcspi_fck",
  1289. .id = 3,
  1290. .parent = &func_48m_ck,
  1291. .flags = CLOCK_IN_OMAP243X,
  1292. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1293. .enable_bit = 9,
  1294. .recalc = &omap2_followparent_recalc,
  1295. };
  1296. static struct clk uart1_ick = {
  1297. .name = "uart1_ick",
  1298. .parent = &l4_ck,
  1299. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1300. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1301. .enable_bit = 21,
  1302. .recalc = &omap2_followparent_recalc,
  1303. };
  1304. static struct clk uart1_fck = {
  1305. .name = "uart1_fck",
  1306. .parent = &func_48m_ck,
  1307. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1308. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1309. .enable_bit = 21,
  1310. .recalc = &omap2_followparent_recalc,
  1311. };
  1312. static struct clk uart2_ick = {
  1313. .name = "uart2_ick",
  1314. .parent = &l4_ck,
  1315. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1316. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1317. .enable_bit = 22,
  1318. .recalc = &omap2_followparent_recalc,
  1319. };
  1320. static struct clk uart2_fck = {
  1321. .name = "uart2_fck",
  1322. .parent = &func_48m_ck,
  1323. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1324. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1325. .enable_bit = 22,
  1326. .recalc = &omap2_followparent_recalc,
  1327. };
  1328. static struct clk uart3_ick = {
  1329. .name = "uart3_ick",
  1330. .parent = &l4_ck,
  1331. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1332. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1333. .enable_bit = 2,
  1334. .recalc = &omap2_followparent_recalc,
  1335. };
  1336. static struct clk uart3_fck = {
  1337. .name = "uart3_fck",
  1338. .parent = &func_48m_ck,
  1339. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1340. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1341. .enable_bit = 2,
  1342. .recalc = &omap2_followparent_recalc,
  1343. };
  1344. static struct clk gpios_ick = {
  1345. .name = "gpios_ick",
  1346. .parent = &l4_ck,
  1347. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1348. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1349. .enable_bit = 2,
  1350. .recalc = &omap2_followparent_recalc,
  1351. };
  1352. static struct clk gpios_fck = {
  1353. .name = "gpios_fck",
  1354. .parent = &func_32k_ck,
  1355. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1356. .enable_reg = (void __iomem *)&CM_FCLKEN_WKUP,
  1357. .enable_bit = 2,
  1358. .recalc = &omap2_followparent_recalc,
  1359. };
  1360. static struct clk mpu_wdt_ick = {
  1361. .name = "mpu_wdt_ick",
  1362. .parent = &l4_ck,
  1363. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1364. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1365. .enable_bit = 3,
  1366. .recalc = &omap2_followparent_recalc,
  1367. };
  1368. static struct clk mpu_wdt_fck = {
  1369. .name = "mpu_wdt_fck",
  1370. .parent = &func_32k_ck,
  1371. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1372. .enable_reg = (void __iomem *)&CM_FCLKEN_WKUP,
  1373. .enable_bit = 3,
  1374. .recalc = &omap2_followparent_recalc,
  1375. };
  1376. static struct clk sync_32k_ick = {
  1377. .name = "sync_32k_ick",
  1378. .parent = &l4_ck,
  1379. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1380. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1381. .enable_bit = 1,
  1382. .recalc = &omap2_followparent_recalc,
  1383. };
  1384. static struct clk wdt1_ick = {
  1385. .name = "wdt1_ick",
  1386. .parent = &l4_ck,
  1387. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1388. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1389. .enable_bit = 4,
  1390. .recalc = &omap2_followparent_recalc,
  1391. };
  1392. static struct clk omapctrl_ick = {
  1393. .name = "omapctrl_ick",
  1394. .parent = &l4_ck,
  1395. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1396. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1397. .enable_bit = 5,
  1398. .recalc = &omap2_followparent_recalc,
  1399. };
  1400. static struct clk icr_ick = {
  1401. .name = "icr_ick",
  1402. .parent = &l4_ck,
  1403. .flags = CLOCK_IN_OMAP243X,
  1404. .enable_reg = (void __iomem *)&CM_ICLKEN_WKUP,
  1405. .enable_bit = 6,
  1406. .recalc = &omap2_followparent_recalc,
  1407. };
  1408. static struct clk cam_ick = {
  1409. .name = "cam_ick",
  1410. .parent = &l4_ck,
  1411. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1412. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1413. .enable_bit = 31,
  1414. .recalc = &omap2_followparent_recalc,
  1415. };
  1416. static struct clk cam_fck = {
  1417. .name = "cam_fck",
  1418. .parent = &func_96m_ck,
  1419. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1420. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1421. .enable_bit = 31,
  1422. .recalc = &omap2_followparent_recalc,
  1423. };
  1424. static struct clk mailboxes_ick = {
  1425. .name = "mailboxes_ick",
  1426. .parent = &l4_ck,
  1427. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1428. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1429. .enable_bit = 30,
  1430. .recalc = &omap2_followparent_recalc,
  1431. };
  1432. static struct clk wdt4_ick = {
  1433. .name = "wdt4_ick",
  1434. .parent = &l4_ck,
  1435. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1436. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1437. .enable_bit = 29,
  1438. .recalc = &omap2_followparent_recalc,
  1439. };
  1440. static struct clk wdt4_fck = {
  1441. .name = "wdt4_fck",
  1442. .parent = &func_32k_ck,
  1443. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1444. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1445. .enable_bit = 29,
  1446. .recalc = &omap2_followparent_recalc,
  1447. };
  1448. static struct clk wdt3_ick = {
  1449. .name = "wdt3_ick",
  1450. .parent = &l4_ck,
  1451. .flags = CLOCK_IN_OMAP242X,
  1452. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1453. .enable_bit = 28,
  1454. .recalc = &omap2_followparent_recalc,
  1455. };
  1456. static struct clk wdt3_fck = {
  1457. .name = "wdt3_fck",
  1458. .parent = &func_32k_ck,
  1459. .flags = CLOCK_IN_OMAP242X,
  1460. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1461. .enable_bit = 28,
  1462. .recalc = &omap2_followparent_recalc,
  1463. };
  1464. static struct clk mspro_ick = {
  1465. .name = "mspro_ick",
  1466. .parent = &l4_ck,
  1467. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1468. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1469. .enable_bit = 27,
  1470. .recalc = &omap2_followparent_recalc,
  1471. };
  1472. static struct clk mspro_fck = {
  1473. .name = "mspro_fck",
  1474. .parent = &func_96m_ck,
  1475. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1476. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1477. .enable_bit = 27,
  1478. .recalc = &omap2_followparent_recalc,
  1479. };
  1480. static struct clk mmc_ick = {
  1481. .name = "mmc_ick",
  1482. .parent = &l4_ck,
  1483. .flags = CLOCK_IN_OMAP242X,
  1484. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1485. .enable_bit = 26,
  1486. .recalc = &omap2_followparent_recalc,
  1487. };
  1488. static struct clk mmc_fck = {
  1489. .name = "mmc_fck",
  1490. .parent = &func_96m_ck,
  1491. .flags = CLOCK_IN_OMAP242X,
  1492. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1493. .enable_bit = 26,
  1494. .recalc = &omap2_followparent_recalc,
  1495. };
  1496. static struct clk fac_ick = {
  1497. .name = "fac_ick",
  1498. .parent = &l4_ck,
  1499. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1500. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1501. .enable_bit = 25,
  1502. .recalc = &omap2_followparent_recalc,
  1503. };
  1504. static struct clk fac_fck = {
  1505. .name = "fac_fck",
  1506. .parent = &func_12m_ck,
  1507. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1508. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1509. .enable_bit = 25,
  1510. .recalc = &omap2_followparent_recalc,
  1511. };
  1512. static struct clk eac_ick = {
  1513. .name = "eac_ick",
  1514. .parent = &l4_ck,
  1515. .flags = CLOCK_IN_OMAP242X,
  1516. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1517. .enable_bit = 24,
  1518. .recalc = &omap2_followparent_recalc,
  1519. };
  1520. static struct clk eac_fck = {
  1521. .name = "eac_fck",
  1522. .parent = &func_96m_ck,
  1523. .flags = CLOCK_IN_OMAP242X,
  1524. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1525. .enable_bit = 24,
  1526. .recalc = &omap2_followparent_recalc,
  1527. };
  1528. static struct clk hdq_ick = {
  1529. .name = "hdq_ick",
  1530. .parent = &l4_ck,
  1531. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1532. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1533. .enable_bit = 23,
  1534. .recalc = &omap2_followparent_recalc,
  1535. };
  1536. static struct clk hdq_fck = {
  1537. .name = "hdq_fck",
  1538. .parent = &func_12m_ck,
  1539. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1540. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1541. .enable_bit = 23,
  1542. .recalc = &omap2_followparent_recalc,
  1543. };
  1544. static struct clk i2c2_ick = {
  1545. .name = "i2c_ick",
  1546. .id = 2,
  1547. .parent = &l4_ck,
  1548. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1549. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1550. .enable_bit = 20,
  1551. .recalc = &omap2_followparent_recalc,
  1552. };
  1553. static struct clk i2c2_fck = {
  1554. .name = "i2c_fck",
  1555. .id = 2,
  1556. .parent = &func_12m_ck,
  1557. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1558. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1559. .enable_bit = 20,
  1560. .recalc = &omap2_followparent_recalc,
  1561. };
  1562. static struct clk i2chs2_fck = {
  1563. .name = "i2chs2_fck",
  1564. .parent = &func_96m_ck,
  1565. .flags = CLOCK_IN_OMAP243X,
  1566. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1567. .enable_bit = 20,
  1568. .recalc = &omap2_followparent_recalc,
  1569. };
  1570. static struct clk i2c1_ick = {
  1571. .name = "i2c_ick",
  1572. .id = 1,
  1573. .parent = &l4_ck,
  1574. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1575. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1576. .enable_bit = 19,
  1577. .recalc = &omap2_followparent_recalc,
  1578. };
  1579. static struct clk i2c1_fck = {
  1580. .name = "i2c_fck",
  1581. .id = 1,
  1582. .parent = &func_12m_ck,
  1583. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
  1584. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1585. .enable_bit = 19,
  1586. .recalc = &omap2_followparent_recalc,
  1587. };
  1588. static struct clk i2chs1_fck = {
  1589. .name = "i2chs1_fck",
  1590. .parent = &func_96m_ck,
  1591. .flags = CLOCK_IN_OMAP243X,
  1592. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1593. .enable_bit = 19,
  1594. .recalc = &omap2_followparent_recalc,
  1595. };
  1596. static struct clk vlynq_ick = {
  1597. .name = "vlynq_ick",
  1598. .parent = &core_l3_ck,
  1599. .flags = CLOCK_IN_OMAP242X,
  1600. .enable_reg = (void __iomem *)&CM_ICLKEN1_CORE,
  1601. .enable_bit = 3,
  1602. .recalc = &omap2_followparent_recalc,
  1603. };
  1604. static struct clk vlynq_fck = {
  1605. .name = "vlynq_fck",
  1606. .parent = &func_96m_ck,
  1607. .flags = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
  1608. .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE,
  1609. .enable_bit = 3,
  1610. .src_offset = 15,
  1611. .recalc = &omap2_followparent_recalc,
  1612. };
  1613. static struct clk sdrc_ick = {
  1614. .name = "sdrc_ick",
  1615. .parent = &l4_ck,
  1616. .flags = CLOCK_IN_OMAP243X,
  1617. .enable_reg = (void __iomem *)&CM_ICLKEN3_CORE,
  1618. .enable_bit = 2,
  1619. .recalc = &omap2_followparent_recalc,
  1620. };
  1621. static struct clk des_ick = {
  1622. .name = "des_ick",
  1623. .parent = &l4_ck,
  1624. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1625. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1626. .enable_bit = 0,
  1627. .recalc = &omap2_followparent_recalc,
  1628. };
  1629. static struct clk sha_ick = {
  1630. .name = "sha_ick",
  1631. .parent = &l4_ck,
  1632. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1633. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1634. .enable_bit = 1,
  1635. .recalc = &omap2_followparent_recalc,
  1636. };
  1637. static struct clk rng_ick = {
  1638. .name = "rng_ick",
  1639. .parent = &l4_ck,
  1640. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1641. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1642. .enable_bit = 2,
  1643. .recalc = &omap2_followparent_recalc,
  1644. };
  1645. static struct clk aes_ick = {
  1646. .name = "aes_ick",
  1647. .parent = &l4_ck,
  1648. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1649. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1650. .enable_bit = 3,
  1651. .recalc = &omap2_followparent_recalc,
  1652. };
  1653. static struct clk pka_ick = {
  1654. .name = "pka_ick",
  1655. .parent = &l4_ck,
  1656. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1657. .enable_reg = (void __iomem *)&CM_ICLKEN4_CORE,
  1658. .enable_bit = 4,
  1659. .recalc = &omap2_followparent_recalc,
  1660. };
  1661. static struct clk usb_fck = {
  1662. .name = "usb_fck",
  1663. .parent = &func_48m_ck,
  1664. .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
  1665. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1666. .enable_bit = 0,
  1667. .recalc = &omap2_followparent_recalc,
  1668. };
  1669. static struct clk usbhs_ick = {
  1670. .name = "usbhs_ick",
  1671. .parent = &core_l3_ck,
  1672. .flags = CLOCK_IN_OMAP243X,
  1673. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1674. .enable_bit = 6,
  1675. .recalc = &omap2_followparent_recalc,
  1676. };
  1677. static struct clk mmchs1_ick = {
  1678. .name = "mmchs1_ick",
  1679. .parent = &l4_ck,
  1680. .flags = CLOCK_IN_OMAP243X,
  1681. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1682. .enable_bit = 7,
  1683. .recalc = &omap2_followparent_recalc,
  1684. };
  1685. static struct clk mmchs1_fck = {
  1686. .name = "mmchs1_fck",
  1687. .parent = &func_96m_ck,
  1688. .flags = CLOCK_IN_OMAP243X,
  1689. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1690. .enable_bit = 7,
  1691. .recalc = &omap2_followparent_recalc,
  1692. };
  1693. static struct clk mmchs2_ick = {
  1694. .name = "mmchs2_ick",
  1695. .parent = &l4_ck,
  1696. .flags = CLOCK_IN_OMAP243X,
  1697. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1698. .enable_bit = 8,
  1699. .recalc = &omap2_followparent_recalc,
  1700. };
  1701. static struct clk mmchs2_fck = {
  1702. .name = "mmchs2_fck",
  1703. .parent = &func_96m_ck,
  1704. .flags = CLOCK_IN_OMAP243X,
  1705. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1706. .enable_bit = 8,
  1707. .recalc = &omap2_followparent_recalc,
  1708. };
  1709. static struct clk gpio5_ick = {
  1710. .name = "gpio5_ick",
  1711. .parent = &l4_ck,
  1712. .flags = CLOCK_IN_OMAP243X,
  1713. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1714. .enable_bit = 10,
  1715. .recalc = &omap2_followparent_recalc,
  1716. };
  1717. static struct clk gpio5_fck = {
  1718. .name = "gpio5_fck",
  1719. .parent = &func_32k_ck,
  1720. .flags = CLOCK_IN_OMAP243X,
  1721. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1722. .enable_bit = 10,
  1723. .recalc = &omap2_followparent_recalc,
  1724. };
  1725. static struct clk mdm_intc_ick = {
  1726. .name = "mdm_intc_ick",
  1727. .parent = &l4_ck,
  1728. .flags = CLOCK_IN_OMAP243X,
  1729. .enable_reg = (void __iomem *)&CM_ICLKEN2_CORE,
  1730. .enable_bit = 11,
  1731. .recalc = &omap2_followparent_recalc,
  1732. };
  1733. static struct clk mmchsdb1_fck = {
  1734. .name = "mmchsdb1_fck",
  1735. .parent = &func_32k_ck,
  1736. .flags = CLOCK_IN_OMAP243X,
  1737. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1738. .enable_bit = 16,
  1739. .recalc = &omap2_followparent_recalc,
  1740. };
  1741. static struct clk mmchsdb2_fck = {
  1742. .name = "mmchsdb2_fck",
  1743. .parent = &func_32k_ck,
  1744. .flags = CLOCK_IN_OMAP243X,
  1745. .enable_reg = (void __iomem *)&CM_FCLKEN2_CORE,
  1746. .enable_bit = 17,
  1747. .recalc = &omap2_followparent_recalc,
  1748. };
  1749. /*
  1750. * This clock is a composite clock which does entire set changes then
  1751. * forces a rebalance. It keys on the MPU speed, but it really could
  1752. * be any key speed part of a set in the rate table.
  1753. *
  1754. * to really change a set, you need memory table sets which get changed
  1755. * in sram, pre-notifiers & post notifiers, changing the top set, without
  1756. * having low level display recalc's won't work... this is why dpm notifiers
  1757. * work, isr's off, walk a list of clocks already _off_ and not messing with
  1758. * the bus.
  1759. *
  1760. * This clock should have no parent. It embodies the entire upper level
  1761. * active set. A parent will mess up some of the init also.
  1762. */
  1763. static struct clk virt_prcm_set = {
  1764. .name = "virt_prcm_set",
  1765. .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  1766. VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP,
  1767. .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
  1768. .recalc = &omap2_mpu_recalc, /* sets are keyed on mpu rate */
  1769. .set_rate = &omap2_select_table_rate,
  1770. .round_rate = &omap2_round_to_table_rate,
  1771. };
  1772. static struct clk *onchip_clks[] = {
  1773. /* external root sources */
  1774. &func_32k_ck,
  1775. &osc_ck,
  1776. &sys_ck,
  1777. &alt_ck,
  1778. /* internal analog sources */
  1779. &dpll_ck,
  1780. &apll96_ck,
  1781. &apll54_ck,
  1782. /* internal prcm root sources */
  1783. &func_54m_ck,
  1784. &core_ck,
  1785. &sleep_ck,
  1786. &func_96m_ck,
  1787. &func_48m_ck,
  1788. &func_12m_ck,
  1789. &wdt1_osc_ck,
  1790. &sys_clkout,
  1791. &sys_clkout2,
  1792. &emul_ck,
  1793. /* mpu domain clocks */
  1794. &mpu_ck,
  1795. /* dsp domain clocks */
  1796. &iva2_1_fck, /* 2430 */
  1797. &iva2_1_ick,
  1798. &dsp_ick, /* 2420 */
  1799. &dsp_fck,
  1800. &iva1_ifck,
  1801. &iva1_mpu_int_ifck,
  1802. /* GFX domain clocks */
  1803. &gfx_3d_fck,
  1804. &gfx_2d_fck,
  1805. &gfx_ick,
  1806. /* Modem domain clocks */
  1807. &mdm_ick,
  1808. &mdm_osc_ck,
  1809. /* DSS domain clocks */
  1810. &dss_ick,
  1811. &dss1_fck,
  1812. &dss2_fck,
  1813. &dss_54m_fck,
  1814. /* L3 domain clocks */
  1815. &core_l3_ck,
  1816. &ssi_ssr_sst_fck,
  1817. &usb_l4_ick,
  1818. /* L4 domain clocks */
  1819. &l4_ck, /* used as both core_l4 and wu_l4 */
  1820. &ssi_l4_ick,
  1821. /* virtual meta-group clock */
  1822. &virt_prcm_set,
  1823. /* general l4 interface ck, multi-parent functional clk */
  1824. &gpt1_ick,
  1825. &gpt1_fck,
  1826. &gpt2_ick,
  1827. &gpt2_fck,
  1828. &gpt3_ick,
  1829. &gpt3_fck,
  1830. &gpt4_ick,
  1831. &gpt4_fck,
  1832. &gpt5_ick,
  1833. &gpt5_fck,
  1834. &gpt6_ick,
  1835. &gpt6_fck,
  1836. &gpt7_ick,
  1837. &gpt7_fck,
  1838. &gpt8_ick,
  1839. &gpt8_fck,
  1840. &gpt9_ick,
  1841. &gpt9_fck,
  1842. &gpt10_ick,
  1843. &gpt10_fck,
  1844. &gpt11_ick,
  1845. &gpt11_fck,
  1846. &gpt12_ick,
  1847. &gpt12_fck,
  1848. &mcbsp1_ick,
  1849. &mcbsp1_fck,
  1850. &mcbsp2_ick,
  1851. &mcbsp2_fck,
  1852. &mcbsp3_ick,
  1853. &mcbsp3_fck,
  1854. &mcbsp4_ick,
  1855. &mcbsp4_fck,
  1856. &mcbsp5_ick,
  1857. &mcbsp5_fck,
  1858. &mcspi1_ick,
  1859. &mcspi1_fck,
  1860. &mcspi2_ick,
  1861. &mcspi2_fck,
  1862. &mcspi3_ick,
  1863. &mcspi3_fck,
  1864. &uart1_ick,
  1865. &uart1_fck,
  1866. &uart2_ick,
  1867. &uart2_fck,
  1868. &uart3_ick,
  1869. &uart3_fck,
  1870. &gpios_ick,
  1871. &gpios_fck,
  1872. &mpu_wdt_ick,
  1873. &mpu_wdt_fck,
  1874. &sync_32k_ick,
  1875. &wdt1_ick,
  1876. &omapctrl_ick,
  1877. &icr_ick,
  1878. &cam_fck,
  1879. &cam_ick,
  1880. &mailboxes_ick,
  1881. &wdt4_ick,
  1882. &wdt4_fck,
  1883. &wdt3_ick,
  1884. &wdt3_fck,
  1885. &mspro_ick,
  1886. &mspro_fck,
  1887. &mmc_ick,
  1888. &mmc_fck,
  1889. &fac_ick,
  1890. &fac_fck,
  1891. &eac_ick,
  1892. &eac_fck,
  1893. &hdq_ick,
  1894. &hdq_fck,
  1895. &i2c1_ick,
  1896. &i2c1_fck,
  1897. &i2chs1_fck,
  1898. &i2c2_ick,
  1899. &i2c2_fck,
  1900. &i2chs2_fck,
  1901. &vlynq_ick,
  1902. &vlynq_fck,
  1903. &sdrc_ick,
  1904. &des_ick,
  1905. &sha_ick,
  1906. &rng_ick,
  1907. &aes_ick,
  1908. &pka_ick,
  1909. &usb_fck,
  1910. &usbhs_ick,
  1911. &mmchs1_ick,
  1912. &mmchs1_fck,
  1913. &mmchs2_ick,
  1914. &mmchs2_fck,
  1915. &gpio5_ick,
  1916. &gpio5_fck,
  1917. &mdm_intc_ick,
  1918. &mmchsdb1_fck,
  1919. &mmchsdb2_fck,
  1920. };
  1921. #endif