preliminaryDataProcessing.c 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580
  1. /*
  2. * OMAP3 clock data
  3. *
  4. * Copyright (C) 2007-2012 Texas Instruments, Inc.
  5. * Copyright (C) 2007-2011 Nokia Corporation
  6. *
  7. * Written by Paul Walmsley
  8. * Updated to COMMON clk data format by Rajendra Nayak <rnayak@ti.com>
  9. * With many device clock fixes by Kevin Hilman and Jouni Högander
  10. * DPLL bypass clock support added by Roman Tereshonkov
  11. *
  12. */
  13. /*
  14. * Virtual clocks are introduced as convenient tools.
  15. * They are sources for other clocks and not supposed
  16. * to be requested from drivers directly.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/clk.h>
  20. #include <linux/clk-private.h>
  21. #include <linux/list.h>
  22. #include <linux/io.h>
  23. #include "soc.h"
  24. #include "iomap.h"
  25. #include "clock.h"
  26. #include "clock3xxx.h"
  27. #include "clock34xx.h"
  28. #include "clock36xx.h"
  29. #include "clock3517.h"
  30. #include "cm3xxx.h"
  31. #include "cm-regbits-34xx.h"
  32. #include "prm3xxx.h"
  33. #include "prm-regbits-34xx.h"
  34. #include "control.h"
  35. /*
  36. * clocks
  37. */
  38. #define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR
  39. /* Maximum DPLL multiplier, divider values for OMAP3 */
  40. #define OMAP3_MAX_DPLL_MULT 2047
  41. #define OMAP3630_MAX_JTYPE_DPLL_MULT 4095
  42. #define OMAP3_MAX_DPLL_DIV 128
  43. DEFINE_CLK_FIXED_RATE(dummy_apb_pclk, CLK_IS_ROOT, 0x0, 0x0);
  44. DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0);
  45. DEFINE_CLK_FIXED_RATE(omap_32k_fck, CLK_IS_ROOT, 32768, 0x0);
  46. DEFINE_CLK_FIXED_RATE(pclk_ck, CLK_IS_ROOT, 27000000, 0x0);
  47. DEFINE_CLK_FIXED_RATE(rmii_ck, CLK_IS_ROOT, 50000000, 0x0);
  48. DEFINE_CLK_FIXED_RATE(secure_32k_fck, CLK_IS_ROOT, 32768, 0x0);
  49. DEFINE_CLK_FIXED_RATE(sys_altclk, CLK_IS_ROOT, 0x0, 0x0);
  50. DEFINE_CLK_FIXED_RATE(virt_12m_ck, CLK_IS_ROOT, 12000000, 0x0);
  51. DEFINE_CLK_FIXED_RATE(virt_13m_ck, CLK_IS_ROOT, 13000000, 0x0);
  52. DEFINE_CLK_FIXED_RATE(virt_16_8m_ck, CLK_IS_ROOT, 16800000, 0x0);
  53. DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
  54. DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
  55. DEFINE_CLK_FIXED_RATE(virt_38_4m_ck, CLK_IS_ROOT, 38400000, 0x0);
  56. static const char *osc_sys_ck_parent_names[] = {
  57. "virt_12m_ck", "virt_13m_ck", "virt_19200000_ck", "virt_26000000_ck",
  58. "virt_38_4m_ck", "virt_16_8m_ck",
  59. };
  60. DEFINE_CLK_MUX(osc_sys_ck, osc_sys_ck_parent_names, NULL, 0x0,
  61. OMAP3430_PRM_CLKSEL, OMAP3430_SYS_CLKIN_SEL_SHIFT,
  62. OMAP3430_SYS_CLKIN_SEL_WIDTH, 0x0, NULL);
  63. DEFINE_CLK_DIVIDER(sys_ck, "osc_sys_ck", &osc_sys_ck, 0x0,
  64. OMAP3430_PRM_CLKSRC_CTRL, OMAP_SYSCLKDIV_SHIFT,
  65. OMAP_SYSCLKDIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
  66. static struct dpll_data dpll3_dd = {
  67. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  68. .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK,
  69. .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK,
  70. .clk_bypass = &sys_ck,
  71. .clk_ref = &sys_ck,
  72. .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK,
  73. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  74. .enable_mask = OMAP3430_EN_CORE_DPLL_MASK,
  75. .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
  76. .recal_en_bit = OMAP3430_CORE_DPLL_RECAL_EN_SHIFT,
  77. .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT,
  78. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  79. .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK,
  80. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  81. .idlest_mask = OMAP3430_ST_CORE_CLK_MASK,
  82. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  83. .min_divider = 1,
  84. .max_divider = OMAP3_MAX_DPLL_DIV,
  85. };
  86. static struct clk dpll3_ck;
  87. static const char *dpll3_ck_parent_names[] = {
  88. "sys_ck",
  89. };
  90. static const struct clk_ops dpll3_ck_ops = {
  91. .init = &omap2_init_clk_clkdm,
  92. .get_parent = &omap2_init_dpll_parent,
  93. .recalc_rate = &omap3_dpll_recalc,
  94. .round_rate = &omap2_dpll_round_rate,
  95. };
  96. static struct clk_hw_omap dpll3_ck_hw = {
  97. .hw = {
  98. .clk = &dpll3_ck,
  99. },
  100. .ops = &clkhwops_omap3_dpll,
  101. .dpll_data = &dpll3_dd,
  102. .clkdm_name = "dpll3_clkdm",
  103. };
  104. DEFINE_STRUCT_CLK(dpll3_ck, dpll3_ck_parent_names, dpll3_ck_ops);
  105. DEFINE_CLK_DIVIDER(dpll3_m2_ck, "dpll3_ck", &dpll3_ck, 0x0,
  106. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  107. OMAP3430_CORE_DPLL_CLKOUT_DIV_SHIFT,
  108. OMAP3430_CORE_DPLL_CLKOUT_DIV_WIDTH,
  109. CLK_DIVIDER_ONE_BASED, NULL);
  110. static struct clk core_ck;
  111. static const char *core_ck_parent_names[] = {
  112. "dpll3_m2_ck",
  113. };
  114. static const struct clk_ops core_ck_ops = {};
  115. DEFINE_STRUCT_CLK_HW_OMAP(core_ck, NULL);
  116. DEFINE_STRUCT_CLK(core_ck, core_ck_parent_names, core_ck_ops);
  117. DEFINE_CLK_DIVIDER(l3_ick, "core_ck", &core_ck, 0x0,
  118. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  119. OMAP3430_CLKSEL_L3_SHIFT, OMAP3430_CLKSEL_L3_WIDTH,
  120. CLK_DIVIDER_ONE_BASED, NULL);
  121. DEFINE_CLK_DIVIDER(l4_ick, "l3_ick", &l3_ick, 0x0,
  122. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  123. OMAP3430_CLKSEL_L4_SHIFT, OMAP3430_CLKSEL_L4_WIDTH,
  124. CLK_DIVIDER_ONE_BASED, NULL);
  125. static struct clk security_l4_ick2;
  126. static const char *security_l4_ick2_parent_names[] = {
  127. "l4_ick",
  128. };
  129. DEFINE_STRUCT_CLK_HW_OMAP(security_l4_ick2, NULL);
  130. DEFINE_STRUCT_CLK(security_l4_ick2, security_l4_ick2_parent_names, core_ck_ops);
  131. static struct clk aes1_ick;
  132. static const char *aes1_ick_parent_names[] = {
  133. "security_l4_ick2",
  134. };
  135. static const struct clk_ops aes1_ick_ops = {
  136. .enable = &omap2_dflt_clk_enable,
  137. .disable = &omap2_dflt_clk_disable,
  138. .is_enabled = &omap2_dflt_clk_is_enabled,
  139. };
  140. static struct clk_hw_omap aes1_ick_hw = {
  141. .hw = {
  142. .clk = &aes1_ick,
  143. },
  144. .ops = &clkhwops_iclk_wait,
  145. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  146. .enable_bit = OMAP3430_EN_AES1_SHIFT,
  147. };
  148. DEFINE_STRUCT_CLK(aes1_ick, aes1_ick_parent_names, aes1_ick_ops);
  149. static struct clk core_l4_ick;
  150. static const struct clk_ops core_l4_ick_ops = {
  151. .init = &omap2_init_clk_clkdm,
  152. };
  153. DEFINE_STRUCT_CLK_HW_OMAP(core_l4_ick, "core_l4_clkdm");
  154. DEFINE_STRUCT_CLK(core_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  155. static struct clk aes2_ick;
  156. static const char *aes2_ick_parent_names[] = {
  157. "core_l4_ick",
  158. };
  159. static const struct clk_ops aes2_ick_ops = {
  160. .init = &omap2_init_clk_clkdm,
  161. .enable = &omap2_dflt_clk_enable,
  162. .disable = &omap2_dflt_clk_disable,
  163. .is_enabled = &omap2_dflt_clk_is_enabled,
  164. };
  165. static struct clk_hw_omap aes2_ick_hw = {
  166. .hw = {
  167. .clk = &aes2_ick,
  168. },
  169. .ops = &clkhwops_iclk_wait,
  170. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  171. .enable_bit = OMAP3430_EN_AES2_SHIFT,
  172. .clkdm_name = "core_l4_clkdm",
  173. };
  174. DEFINE_STRUCT_CLK(aes2_ick, aes2_ick_parent_names, aes2_ick_ops);
  175. static struct clk dpll1_fck;
  176. static struct dpll_data dpll1_dd = {
  177. .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  178. .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK,
  179. .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK,
  180. .clk_bypass = &dpll1_fck,
  181. .clk_ref = &sys_ck,
  182. .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK,
  183. .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
  184. .enable_mask = OMAP3430_EN_MPU_DPLL_MASK,
  185. .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
  186. .auto_recal_bit = OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT,
  187. .recal_en_bit = OMAP3430_MPU_DPLL_RECAL_EN_SHIFT,
  188. .recal_st_bit = OMAP3430_MPU_DPLL_ST_SHIFT,
  189. .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  190. .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK,
  191. .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
  192. .idlest_mask = OMAP3430_ST_MPU_CLK_MASK,
  193. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  194. .min_divider = 1,
  195. .max_divider = OMAP3_MAX_DPLL_DIV,
  196. };
  197. static struct clk dpll1_ck;
  198. static const struct clk_ops dpll1_ck_ops = {
  199. .init = &omap2_init_clk_clkdm,
  200. .enable = &omap3_noncore_dpll_enable,
  201. .disable = &omap3_noncore_dpll_disable,
  202. .get_parent = &omap2_init_dpll_parent,
  203. .recalc_rate = &omap3_dpll_recalc,
  204. .set_rate = &omap3_noncore_dpll_set_rate,
  205. .round_rate = &omap2_dpll_round_rate,
  206. };
  207. static struct clk_hw_omap dpll1_ck_hw = {
  208. .hw = {
  209. .clk = &dpll1_ck,
  210. },
  211. .ops = &clkhwops_omap3_dpll,
  212. .dpll_data = &dpll1_dd,
  213. .clkdm_name = "dpll1_clkdm",
  214. };
  215. DEFINE_STRUCT_CLK(dpll1_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  216. DEFINE_CLK_FIXED_FACTOR(dpll1_x2_ck, "dpll1_ck", &dpll1_ck, 0x0, 2, 1);
  217. DEFINE_CLK_DIVIDER(dpll1_x2m2_ck, "dpll1_x2_ck", &dpll1_x2_ck, 0x0,
  218. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
  219. OMAP3430_MPU_DPLL_CLKOUT_DIV_SHIFT,
  220. OMAP3430_MPU_DPLL_CLKOUT_DIV_WIDTH,
  221. CLK_DIVIDER_ONE_BASED, NULL);
  222. static struct clk mpu_ck;
  223. static const char *mpu_ck_parent_names[] = {
  224. "dpll1_x2m2_ck",
  225. };
  226. DEFINE_STRUCT_CLK_HW_OMAP(mpu_ck, "mpu_clkdm");
  227. DEFINE_STRUCT_CLK(mpu_ck, mpu_ck_parent_names, core_l4_ick_ops);
  228. DEFINE_CLK_DIVIDER(arm_fck, "mpu_ck", &mpu_ck, 0x0,
  229. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
  230. OMAP3430_ST_MPU_CLK_SHIFT, OMAP3430_ST_MPU_CLK_WIDTH,
  231. 0x0, NULL);
  232. static struct clk cam_ick;
  233. static struct clk_hw_omap cam_ick_hw = {
  234. .hw = {
  235. .clk = &cam_ick,
  236. },
  237. .ops = &clkhwops_iclk,
  238. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
  239. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  240. .clkdm_name = "cam_clkdm",
  241. };
  242. DEFINE_STRUCT_CLK(cam_ick, security_l4_ick2_parent_names, aes2_ick_ops);
  243. /* DPLL4 */
  244. /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
  245. /* Type: DPLL */
  246. static struct dpll_data dpll4_dd;
  247. static struct dpll_data dpll4_dd_34xx __initdata = {
  248. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
  249. .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK,
  250. .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
  251. .clk_bypass = &sys_ck,
  252. .clk_ref = &sys_ck,
  253. .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
  254. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  255. .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
  256. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  257. .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
  258. .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
  259. .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
  260. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  261. .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
  262. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  263. .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
  264. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  265. .min_divider = 1,
  266. .max_divider = OMAP3_MAX_DPLL_DIV,
  267. };
  268. static struct dpll_data dpll4_dd_3630 __initdata = {
  269. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
  270. .mult_mask = OMAP3630_PERIPH_DPLL_MULT_MASK,
  271. .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
  272. .clk_bypass = &sys_ck,
  273. .clk_ref = &sys_ck,
  274. .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  275. .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
  276. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  277. .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
  278. .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
  279. .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
  280. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
  281. .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
  282. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
  283. .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
  284. .dco_mask = OMAP3630_PERIPH_DPLL_DCO_SEL_MASK,
  285. .sddiv_mask = OMAP3630_PERIPH_DPLL_SD_DIV_MASK,
  286. .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
  287. .min_divider = 1,
  288. .max_divider = OMAP3_MAX_DPLL_DIV,
  289. .flags = DPLL_J_TYPE
  290. };
  291. static struct clk dpll4_ck;
  292. static const struct clk_ops dpll4_ck_ops = {
  293. .init = &omap2_init_clk_clkdm,
  294. .enable = &omap3_noncore_dpll_enable,
  295. .disable = &omap3_noncore_dpll_disable,
  296. .get_parent = &omap2_init_dpll_parent,
  297. .recalc_rate = &omap3_dpll_recalc,
  298. .set_rate = &omap3_dpll4_set_rate,
  299. .round_rate = &omap2_dpll_round_rate,
  300. };
  301. static struct clk_hw_omap dpll4_ck_hw = {
  302. .hw = {
  303. .clk = &dpll4_ck,
  304. },
  305. .dpll_data = &dpll4_dd,
  306. .ops = &clkhwops_omap3_dpll,
  307. .clkdm_name = "dpll4_clkdm",
  308. };
  309. DEFINE_STRUCT_CLK(dpll4_ck, dpll3_ck_parent_names, dpll4_ck_ops);
  310. DEFINE_CLK_DIVIDER(dpll4_m5_ck, "dpll4_ck", &dpll4_ck, 0x0,
  311. OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
  312. OMAP3430_CLKSEL_CAM_SHIFT, OMAP3630_CLKSEL_CAM_WIDTH,
  313. CLK_DIVIDER_ONE_BASED, NULL);
  314. static struct clk dpll4_m5x2_ck;
  315. static const char *dpll4_m5x2_ck_parent_names[] = {
  316. "dpll4_m5_ck",
  317. };
  318. static const struct clk_ops dpll4_m5x2_ck_ops = {
  319. .init = &omap2_init_clk_clkdm,
  320. .enable = &omap2_dflt_clk_enable,
  321. .disable = &omap2_dflt_clk_disable,
  322. .is_enabled = &omap2_dflt_clk_is_enabled,
  323. .recalc_rate = &omap3_clkoutx2_recalc,
  324. };
  325. static const struct clk_ops dpll4_m5x2_ck_3630_ops = {
  326. .init = &omap2_init_clk_clkdm,
  327. .enable = &omap36xx_pwrdn_clk_enable_with_hsdiv_restore,
  328. .disable = &omap2_dflt_clk_disable,
  329. .recalc_rate = &omap3_clkoutx2_recalc,
  330. };
  331. static struct clk_hw_omap dpll4_m5x2_ck_hw = {
  332. .hw = {
  333. .clk = &dpll4_m5x2_ck,
  334. },
  335. .ops = &clkhwops_wait,
  336. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  337. .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
  338. .flags = INVERT_ENABLE,
  339. .clkdm_name = "dpll4_clkdm",
  340. };
  341. DEFINE_STRUCT_CLK(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, dpll4_m5x2_ck_ops);
  342. static struct clk dpll4_m5x2_ck_3630 = {
  343. .name = "dpll4_m5x2_ck",
  344. .hw = &dpll4_m5x2_ck_hw.hw,
  345. .parent_names = dpll4_m5x2_ck_parent_names,
  346. .num_parents = ARRAY_SIZE(dpll4_m5x2_ck_parent_names),
  347. .ops = &dpll4_m5x2_ck_3630_ops,
  348. };
  349. static struct clk cam_mclk;
  350. static const char *cam_mclk_parent_names[] = {
  351. "dpll4_m5x2_ck",
  352. };
  353. static struct clk_hw_omap cam_mclk_hw = {
  354. .hw = {
  355. .clk = &cam_mclk,
  356. },
  357. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  358. .enable_bit = OMAP3430_EN_CAM_SHIFT,
  359. .clkdm_name = "cam_clkdm",
  360. };
  361. DEFINE_STRUCT_CLK(cam_mclk, cam_mclk_parent_names, aes2_ick_ops);
  362. static const struct clksel_rate clkout2_src_core_rates[] = {
  363. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  364. { .div = 0 }
  365. };
  366. static const struct clksel_rate clkout2_src_sys_rates[] = {
  367. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  368. { .div = 0 }
  369. };
  370. static const struct clksel_rate clkout2_src_96m_rates[] = {
  371. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  372. { .div = 0 }
  373. };
  374. DEFINE_CLK_DIVIDER(dpll4_m2_ck, "dpll4_ck", &dpll4_ck, 0x0,
  375. OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
  376. OMAP3430_DIV_96M_SHIFT, OMAP3630_DIV_96M_WIDTH,
  377. CLK_DIVIDER_ONE_BASED, NULL);
  378. static struct clk dpll4_m2x2_ck;
  379. static const char *dpll4_m2x2_ck_parent_names[] = {
  380. "dpll4_m2_ck",
  381. };
  382. static struct clk_hw_omap dpll4_m2x2_ck_hw = {
  383. .hw = {
  384. .clk = &dpll4_m2x2_ck,
  385. },
  386. .ops = &clkhwops_wait,
  387. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  388. .enable_bit = OMAP3430_PWRDN_96M_SHIFT,
  389. .flags = INVERT_ENABLE,
  390. .clkdm_name = "dpll4_clkdm",
  391. };
  392. DEFINE_STRUCT_CLK(dpll4_m2x2_ck, dpll4_m2x2_ck_parent_names, dpll4_m5x2_ck_ops);
  393. static struct clk dpll4_m2x2_ck_3630 = {
  394. .name = "dpll4_m2x2_ck",
  395. .hw = &dpll4_m2x2_ck_hw.hw,
  396. .parent_names = dpll4_m2x2_ck_parent_names,
  397. .num_parents = ARRAY_SIZE(dpll4_m2x2_ck_parent_names),
  398. .ops = &dpll4_m5x2_ck_3630_ops,
  399. };
  400. static struct clk omap_96m_alwon_fck;
  401. static const char *omap_96m_alwon_fck_parent_names[] = {
  402. "dpll4_m2x2_ck",
  403. };
  404. DEFINE_STRUCT_CLK_HW_OMAP(omap_96m_alwon_fck, NULL);
  405. DEFINE_STRUCT_CLK(omap_96m_alwon_fck, omap_96m_alwon_fck_parent_names,
  406. core_ck_ops);
  407. static struct clk cm_96m_fck;
  408. static const char *cm_96m_fck_parent_names[] = {
  409. "omap_96m_alwon_fck",
  410. };
  411. DEFINE_STRUCT_CLK_HW_OMAP(cm_96m_fck, NULL);
  412. DEFINE_STRUCT_CLK(cm_96m_fck, cm_96m_fck_parent_names, core_ck_ops);
  413. static const struct clksel_rate clkout2_src_54m_rates[] = {
  414. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  415. { .div = 0 }
  416. };
  417. DEFINE_CLK_DIVIDER(dpll4_m3_ck, "dpll4_ck", &dpll4_ck, 0x0,
  418. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  419. OMAP3430_CLKSEL_TV_SHIFT, OMAP3630_CLKSEL_TV_WIDTH,
  420. CLK_DIVIDER_ONE_BASED, NULL);
  421. static struct clk dpll4_m3x2_ck;
  422. static const char *dpll4_m3x2_ck_parent_names[] = {
  423. "dpll4_m3_ck",
  424. };
  425. static struct clk_hw_omap dpll4_m3x2_ck_hw = {
  426. .hw = {
  427. .clk = &dpll4_m3x2_ck,
  428. },
  429. .ops = &clkhwops_wait,
  430. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  431. .enable_bit = OMAP3430_PWRDN_TV_SHIFT,
  432. .flags = INVERT_ENABLE,
  433. .clkdm_name = "dpll4_clkdm",
  434. };
  435. DEFINE_STRUCT_CLK(dpll4_m3x2_ck, dpll4_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  436. static struct clk dpll4_m3x2_ck_3630 = {
  437. .name = "dpll4_m3x2_ck",
  438. .hw = &dpll4_m3x2_ck_hw.hw,
  439. .parent_names = dpll4_m3x2_ck_parent_names,
  440. .num_parents = ARRAY_SIZE(dpll4_m3x2_ck_parent_names),
  441. .ops = &dpll4_m5x2_ck_3630_ops,
  442. };
  443. static const char *omap_54m_fck_parent_names[] = {
  444. "dpll4_m3x2_ck", "sys_altclk",
  445. };
  446. DEFINE_CLK_MUX(omap_54m_fck, omap_54m_fck_parent_names, NULL, 0x0,
  447. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), OMAP3430_SOURCE_54M_SHIFT,
  448. OMAP3430_SOURCE_54M_WIDTH, 0x0, NULL);
  449. static const struct clksel clkout2_src_clksel[] = {
  450. { .parent = &core_ck, .rates = clkout2_src_core_rates },
  451. { .parent = &sys_ck, .rates = clkout2_src_sys_rates },
  452. { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates },
  453. { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates },
  454. { .parent = NULL },
  455. };
  456. static const char *clkout2_src_ck_parent_names[] = {
  457. "core_ck", "sys_ck", "cm_96m_fck", "omap_54m_fck",
  458. };
  459. static const struct clk_ops clkout2_src_ck_ops = {
  460. .init = &omap2_init_clk_clkdm,
  461. .enable = &omap2_dflt_clk_enable,
  462. .disable = &omap2_dflt_clk_disable,
  463. .is_enabled = &omap2_dflt_clk_is_enabled,
  464. .recalc_rate = &omap2_clksel_recalc,
  465. .get_parent = &omap2_clksel_find_parent_index,
  466. .set_parent = &omap2_clksel_set_parent,
  467. };
  468. DEFINE_CLK_OMAP_MUX_GATE(clkout2_src_ck, "core_clkdm",
  469. clkout2_src_clksel, OMAP3430_CM_CLKOUT_CTRL,
  470. OMAP3430_CLKOUT2SOURCE_MASK,
  471. OMAP3430_CM_CLKOUT_CTRL, OMAP3430_CLKOUT2_EN_SHIFT,
  472. NULL, clkout2_src_ck_parent_names, clkout2_src_ck_ops);
  473. static const struct clksel_rate omap_48m_cm96m_rates[] = {
  474. { .div = 2, .val = 0, .flags = RATE_IN_3XXX },
  475. { .div = 0 }
  476. };
  477. static const struct clksel_rate omap_48m_alt_rates[] = {
  478. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  479. { .div = 0 }
  480. };
  481. static const struct clksel omap_48m_clksel[] = {
  482. { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
  483. { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
  484. { .parent = NULL },
  485. };
  486. static const char *omap_48m_fck_parent_names[] = {
  487. "cm_96m_fck", "sys_altclk",
  488. };
  489. static struct clk omap_48m_fck;
  490. static const struct clk_ops omap_48m_fck_ops = {
  491. .recalc_rate = &omap2_clksel_recalc,
  492. .get_parent = &omap2_clksel_find_parent_index,
  493. .set_parent = &omap2_clksel_set_parent,
  494. };
  495. static struct clk_hw_omap omap_48m_fck_hw = {
  496. .hw = {
  497. .clk = &omap_48m_fck,
  498. },
  499. .clksel = omap_48m_clksel,
  500. .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  501. .clksel_mask = OMAP3430_SOURCE_48M_MASK,
  502. };
  503. DEFINE_STRUCT_CLK(omap_48m_fck, omap_48m_fck_parent_names, omap_48m_fck_ops);
  504. DEFINE_CLK_FIXED_FACTOR(omap_12m_fck, "omap_48m_fck", &omap_48m_fck, 0x0, 1, 4);
  505. static struct clk core_12m_fck;
  506. static const char *core_12m_fck_parent_names[] = {
  507. "omap_12m_fck",
  508. };
  509. DEFINE_STRUCT_CLK_HW_OMAP(core_12m_fck, "core_l4_clkdm");
  510. DEFINE_STRUCT_CLK(core_12m_fck, core_12m_fck_parent_names, core_l4_ick_ops);
  511. static struct clk core_48m_fck;
  512. static const char *core_48m_fck_parent_names[] = {
  513. "omap_48m_fck",
  514. };
  515. DEFINE_STRUCT_CLK_HW_OMAP(core_48m_fck, "core_l4_clkdm");
  516. DEFINE_STRUCT_CLK(core_48m_fck, core_48m_fck_parent_names, core_l4_ick_ops);
  517. static const char *omap_96m_fck_parent_names[] = {
  518. "cm_96m_fck", "sys_ck",
  519. };
  520. DEFINE_CLK_MUX(omap_96m_fck, omap_96m_fck_parent_names, NULL, 0x0,
  521. OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
  522. OMAP3430_SOURCE_96M_SHIFT, OMAP3430_SOURCE_96M_WIDTH, 0x0, NULL);
  523. static struct clk core_96m_fck;
  524. static const char *core_96m_fck_parent_names[] = {
  525. "omap_96m_fck",
  526. };
  527. DEFINE_STRUCT_CLK_HW_OMAP(core_96m_fck, "core_l4_clkdm");
  528. DEFINE_STRUCT_CLK(core_96m_fck, core_96m_fck_parent_names, core_l4_ick_ops);
  529. static struct clk core_l3_ick;
  530. static const char *core_l3_ick_parent_names[] = {
  531. "l3_ick",
  532. };
  533. DEFINE_STRUCT_CLK_HW_OMAP(core_l3_ick, "core_l3_clkdm");
  534. DEFINE_STRUCT_CLK(core_l3_ick, core_l3_ick_parent_names, core_l4_ick_ops);
  535. DEFINE_CLK_FIXED_FACTOR(dpll3_m2x2_ck, "dpll3_m2_ck", &dpll3_m2_ck, 0x0, 2, 1);
  536. static struct clk corex2_fck;
  537. static const char *corex2_fck_parent_names[] = {
  538. "dpll3_m2x2_ck",
  539. };
  540. DEFINE_STRUCT_CLK_HW_OMAP(corex2_fck, NULL);
  541. DEFINE_STRUCT_CLK(corex2_fck, corex2_fck_parent_names, core_ck_ops);
  542. static struct clk cpefuse_fck;
  543. static struct clk_hw_omap cpefuse_fck_hw = {
  544. .hw = {
  545. .clk = &cpefuse_fck,
  546. },
  547. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
  548. .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT,
  549. .clkdm_name = "core_l4_clkdm",
  550. };
  551. DEFINE_STRUCT_CLK(cpefuse_fck, dpll3_ck_parent_names, aes2_ick_ops);
  552. static struct clk csi2_96m_fck;
  553. static const char *csi2_96m_fck_parent_names[] = {
  554. "core_96m_fck",
  555. };
  556. static struct clk_hw_omap csi2_96m_fck_hw = {
  557. .hw = {
  558. .clk = &csi2_96m_fck,
  559. },
  560. .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
  561. .enable_bit = OMAP3430_EN_CSI2_SHIFT,
  562. .clkdm_name = "cam_clkdm",
  563. };
  564. DEFINE_STRUCT_CLK(csi2_96m_fck, csi2_96m_fck_parent_names, aes2_ick_ops);
  565. static struct clk d2d_26m_fck;
  566. static struct clk_hw_omap d2d_26m_fck_hw = {
  567. .hw = {
  568. .clk = &d2d_26m_fck,
  569. },
  570. .ops = &clkhwops_wait,
  571. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  572. .enable_bit = OMAP3430ES1_EN_D2D_SHIFT,
  573. .clkdm_name = "d2d_clkdm",
  574. };
  575. DEFINE_STRUCT_CLK(d2d_26m_fck, dpll3_ck_parent_names, aes2_ick_ops);
  576. static struct clk des1_ick;
  577. static struct clk_hw_omap des1_ick_hw = {
  578. .hw = {
  579. .clk = &des1_ick,
  580. },
  581. .ops = &clkhwops_iclk_wait,
  582. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
  583. .enable_bit = OMAP3430_EN_DES1_SHIFT,
  584. };
  585. DEFINE_STRUCT_CLK(des1_ick, aes1_ick_parent_names, aes1_ick_ops);
  586. static struct clk des2_ick;
  587. static struct clk_hw_omap des2_ick_hw = {
  588. .hw = {
  589. .clk = &des2_ick,
  590. },
  591. .ops = &clkhwops_iclk_wait,
  592. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  593. .enable_bit = OMAP3430_EN_DES2_SHIFT,
  594. .clkdm_name = "core_l4_clkdm",
  595. };
  596. DEFINE_STRUCT_CLK(des2_ick, aes2_ick_parent_names, aes2_ick_ops);
  597. DEFINE_CLK_DIVIDER(dpll1_fck, "core_ck", &core_ck, 0x0,
  598. OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
  599. OMAP3430_MPU_CLK_SRC_SHIFT, OMAP3430_MPU_CLK_SRC_WIDTH,
  600. CLK_DIVIDER_ONE_BASED, NULL);
  601. static struct clk dpll2_fck;
  602. static struct dpll_data dpll2_dd = {
  603. .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  604. .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
  605. .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
  606. .clk_bypass = &dpll2_fck,
  607. .clk_ref = &sys_ck,
  608. .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
  609. .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
  610. .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
  611. .modes = ((1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
  612. (1 << DPLL_LOW_POWER_BYPASS)),
  613. .auto_recal_bit = OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
  614. .recal_en_bit = OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
  615. .recal_st_bit = OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
  616. .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
  617. .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK,
  618. .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
  619. .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK,
  620. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  621. .min_divider = 1,
  622. .max_divider = OMAP3_MAX_DPLL_DIV,
  623. };
  624. static struct clk dpll2_ck;
  625. static struct clk_hw_omap dpll2_ck_hw = {
  626. .hw = {
  627. .clk = &dpll2_ck,
  628. },
  629. .ops = &clkhwops_omap3_dpll,
  630. .dpll_data = &dpll2_dd,
  631. .clkdm_name = "dpll2_clkdm",
  632. };
  633. DEFINE_STRUCT_CLK(dpll2_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  634. DEFINE_CLK_DIVIDER(dpll2_fck, "core_ck", &core_ck, 0x0,
  635. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
  636. OMAP3430_IVA2_CLK_SRC_SHIFT, OMAP3430_IVA2_CLK_SRC_WIDTH,
  637. CLK_DIVIDER_ONE_BASED, NULL);
  638. DEFINE_CLK_DIVIDER(dpll2_m2_ck, "dpll2_ck", &dpll2_ck, 0x0,
  639. OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL2_PLL),
  640. OMAP3430_IVA2_DPLL_CLKOUT_DIV_SHIFT,
  641. OMAP3430_IVA2_DPLL_CLKOUT_DIV_WIDTH,
  642. CLK_DIVIDER_ONE_BASED, NULL);
  643. DEFINE_CLK_DIVIDER(dpll3_m3_ck, "dpll3_ck", &dpll3_ck, 0x0,
  644. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  645. OMAP3430_DIV_DPLL3_SHIFT, OMAP3430_DIV_DPLL3_WIDTH,
  646. CLK_DIVIDER_ONE_BASED, NULL);
  647. static struct clk dpll3_m3x2_ck;
  648. static const char *dpll3_m3x2_ck_parent_names[] = {
  649. "dpll3_m3_ck",
  650. };
  651. static struct clk_hw_omap dpll3_m3x2_ck_hw = {
  652. .hw = {
  653. .clk = &dpll3_m3x2_ck,
  654. },
  655. .ops = &clkhwops_wait,
  656. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  657. .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT,
  658. .flags = INVERT_ENABLE,
  659. .clkdm_name = "dpll3_clkdm",
  660. };
  661. DEFINE_STRUCT_CLK(dpll3_m3x2_ck, dpll3_m3x2_ck_parent_names, dpll4_m5x2_ck_ops);
  662. static struct clk dpll3_m3x2_ck_3630 = {
  663. .name = "dpll3_m3x2_ck",
  664. .hw = &dpll3_m3x2_ck_hw.hw,
  665. .parent_names = dpll3_m3x2_ck_parent_names,
  666. .num_parents = ARRAY_SIZE(dpll3_m3x2_ck_parent_names),
  667. .ops = &dpll4_m5x2_ck_3630_ops,
  668. };
  669. DEFINE_CLK_FIXED_FACTOR(dpll3_x2_ck, "dpll3_ck", &dpll3_ck, 0x0, 2, 1);
  670. DEFINE_CLK_DIVIDER(dpll4_m4_ck, "dpll4_ck", &dpll4_ck, 0x0,
  671. OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
  672. OMAP3430_CLKSEL_DSS1_SHIFT, OMAP3630_CLKSEL_DSS1_WIDTH,
  673. CLK_DIVIDER_ONE_BASED, NULL);
  674. static struct clk dpll4_m4x2_ck;
  675. static const char *dpll4_m4x2_ck_parent_names[] = {
  676. "dpll4_m4_ck",
  677. };
  678. static struct clk_hw_omap dpll4_m4x2_ck_hw = {
  679. .hw = {
  680. .clk = &dpll4_m4x2_ck,
  681. },
  682. .ops = &clkhwops_wait,
  683. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  684. .enable_bit = OMAP3430_PWRDN_DSS1_SHIFT,
  685. .flags = INVERT_ENABLE,
  686. .clkdm_name = "dpll4_clkdm",
  687. };
  688. DEFINE_STRUCT_CLK(dpll4_m4x2_ck, dpll4_m4x2_ck_parent_names, dpll4_m5x2_ck_ops);
  689. static struct clk dpll4_m4x2_ck_3630 = {
  690. .name = "dpll4_m4x2_ck",
  691. .hw = &dpll4_m4x2_ck_hw.hw,
  692. .parent_names = dpll4_m4x2_ck_parent_names,
  693. .num_parents = ARRAY_SIZE(dpll4_m4x2_ck_parent_names),
  694. .ops = &dpll4_m5x2_ck_3630_ops,
  695. };
  696. DEFINE_CLK_DIVIDER(dpll4_m6_ck, "dpll4_ck", &dpll4_ck, 0x0,
  697. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  698. OMAP3430_DIV_DPLL4_SHIFT, OMAP3630_DIV_DPLL4_WIDTH,
  699. CLK_DIVIDER_ONE_BASED, NULL);
  700. static struct clk dpll4_m6x2_ck;
  701. static const char *dpll4_m6x2_ck_parent_names[] = {
  702. "dpll4_m6_ck",
  703. };
  704. static struct clk_hw_omap dpll4_m6x2_ck_hw = {
  705. .hw = {
  706. .clk = &dpll4_m6x2_ck,
  707. },
  708. .ops = &clkhwops_wait,
  709. .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
  710. .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
  711. .flags = INVERT_ENABLE,
  712. .clkdm_name = "dpll4_clkdm",
  713. };
  714. DEFINE_STRUCT_CLK(dpll4_m6x2_ck, dpll4_m6x2_ck_parent_names, dpll4_m5x2_ck_ops);
  715. static struct clk dpll4_m6x2_ck_3630 = {
  716. .name = "dpll4_m6x2_ck",
  717. .hw = &dpll4_m6x2_ck_hw.hw,
  718. .parent_names = dpll4_m6x2_ck_parent_names,
  719. .num_parents = ARRAY_SIZE(dpll4_m6x2_ck_parent_names),
  720. .ops = &dpll4_m5x2_ck_3630_ops,
  721. };
  722. DEFINE_CLK_FIXED_FACTOR(dpll4_x2_ck, "dpll4_ck", &dpll4_ck, 0x0, 2, 1);
  723. static struct dpll_data dpll5_dd = {
  724. .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
  725. .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
  726. .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
  727. .clk_bypass = &sys_ck,
  728. .clk_ref = &sys_ck,
  729. .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
  730. .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
  731. .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
  732. .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
  733. .auto_recal_bit = OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
  734. .recal_en_bit = OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
  735. .recal_st_bit = OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
  736. .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
  737. .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
  738. .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
  739. .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
  740. .max_multiplier = OMAP3_MAX_DPLL_MULT,
  741. .min_divider = 1,
  742. .max_divider = OMAP3_MAX_DPLL_DIV,
  743. };
  744. static struct clk dpll5_ck;
  745. static struct clk_hw_omap dpll5_ck_hw = {
  746. .hw = {
  747. .clk = &dpll5_ck,
  748. },
  749. .ops = &clkhwops_omap3_dpll,
  750. .dpll_data = &dpll5_dd,
  751. .clkdm_name = "dpll5_clkdm",
  752. };
  753. DEFINE_STRUCT_CLK(dpll5_ck, dpll3_ck_parent_names, dpll1_ck_ops);
  754. DEFINE_CLK_DIVIDER(dpll5_m2_ck, "dpll5_ck", &dpll5_ck, 0x0,
  755. OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
  756. OMAP3430ES2_DIV_120M_SHIFT, OMAP3430ES2_DIV_120M_WIDTH,
  757. CLK_DIVIDER_ONE_BASED, NULL);
  758. static struct clk dss1_alwon_fck_3430es1;
  759. static const char *dss1_alwon_fck_3430es1_parent_names[] = {
  760. "dpll4_m4x2_ck",
  761. };
  762. static struct clk_hw_omap dss1_alwon_fck_3430es1_hw = {
  763. .hw = {
  764. .clk = &dss1_alwon_fck_3430es1,
  765. },
  766. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  767. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  768. .clkdm_name = "dss_clkdm",
  769. };
  770. DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es1, dss1_alwon_fck_3430es1_parent_names,
  771. aes2_ick_ops);
  772. static struct clk dss1_alwon_fck_3430es2;
  773. static struct clk_hw_omap dss1_alwon_fck_3430es2_hw = {
  774. .hw = {
  775. .clk = &dss1_alwon_fck_3430es2,
  776. },
  777. .ops = &clkhwops_omap3430es2_dss_usbhost_wait,
  778. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  779. .enable_bit = OMAP3430_EN_DSS1_SHIFT,
  780. .clkdm_name = "dss_clkdm",
  781. };
  782. DEFINE_STRUCT_CLK(dss1_alwon_fck_3430es2, dss1_alwon_fck_3430es1_parent_names,
  783. aes2_ick_ops);
  784. static struct clk dss2_alwon_fck;
  785. static struct clk_hw_omap dss2_alwon_fck_hw = {
  786. .hw = {
  787. .clk = &dss2_alwon_fck,
  788. },
  789. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  790. .enable_bit = OMAP3430_EN_DSS2_SHIFT,
  791. .clkdm_name = "dss_clkdm",
  792. };
  793. DEFINE_STRUCT_CLK(dss2_alwon_fck, dpll3_ck_parent_names, aes2_ick_ops);
  794. static struct clk dss_96m_fck;
  795. static struct clk_hw_omap dss_96m_fck_hw = {
  796. .hw = {
  797. .clk = &dss_96m_fck,
  798. },
  799. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  800. .enable_bit = OMAP3430_EN_TV_SHIFT,
  801. .clkdm_name = "dss_clkdm",
  802. };
  803. DEFINE_STRUCT_CLK(dss_96m_fck, core_96m_fck_parent_names, aes2_ick_ops);
  804. static struct clk dss_ick_3430es1;
  805. static struct clk_hw_omap dss_ick_3430es1_hw = {
  806. .hw = {
  807. .clk = &dss_ick_3430es1,
  808. },
  809. .ops = &clkhwops_iclk,
  810. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
  811. .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
  812. .clkdm_name = "dss_clkdm",
  813. };
  814. DEFINE_STRUCT_CLK(dss_ick_3430es1, security_l4_ick2_parent_names, aes2_ick_ops);
  815. static struct clk dss_ick_3430es2;
  816. static struct clk_hw_omap dss_ick_3430es2_hw = {
  817. .hw = {
  818. .clk = &dss_ick_3430es2,
  819. },
  820. .ops = &clkhwops_omap3430es2_iclk_dss_usbhost_wait,
  821. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
  822. .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
  823. .clkdm_name = "dss_clkdm",
  824. };
  825. DEFINE_STRUCT_CLK(dss_ick_3430es2, security_l4_ick2_parent_names, aes2_ick_ops);
  826. static struct clk dss_tv_fck;
  827. static const char *dss_tv_fck_parent_names[] = {
  828. "omap_54m_fck",
  829. };
  830. static struct clk_hw_omap dss_tv_fck_hw = {
  831. .hw = {
  832. .clk = &dss_tv_fck,
  833. },
  834. .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
  835. .enable_bit = OMAP3430_EN_TV_SHIFT,
  836. .clkdm_name = "dss_clkdm",
  837. };
  838. DEFINE_STRUCT_CLK(dss_tv_fck, dss_tv_fck_parent_names, aes2_ick_ops);
  839. static struct clk emac_fck;
  840. static const char *emac_fck_parent_names[] = {
  841. "rmii_ck",
  842. };
  843. static struct clk_hw_omap emac_fck_hw = {
  844. .hw = {
  845. .clk = &emac_fck,
  846. },
  847. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  848. .enable_bit = AM35XX_CPGMAC_FCLK_SHIFT,
  849. };
  850. DEFINE_STRUCT_CLK(emac_fck, emac_fck_parent_names, aes1_ick_ops);
  851. static struct clk ipss_ick;
  852. static const char *ipss_ick_parent_names[] = {
  853. "core_l3_ick",
  854. };
  855. static struct clk_hw_omap ipss_ick_hw = {
  856. .hw = {
  857. .clk = &ipss_ick,
  858. },
  859. .ops = &clkhwops_am35xx_ipss_wait,
  860. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  861. .enable_bit = AM35XX_EN_IPSS_SHIFT,
  862. .clkdm_name = "core_l3_clkdm",
  863. };
  864. DEFINE_STRUCT_CLK(ipss_ick, ipss_ick_parent_names, aes2_ick_ops);
  865. static struct clk emac_ick;
  866. static const char *emac_ick_parent_names[] = {
  867. "ipss_ick",
  868. };
  869. static struct clk_hw_omap emac_ick_hw = {
  870. .hw = {
  871. .clk = &emac_ick,
  872. },
  873. .ops = &clkhwops_am35xx_ipss_module_wait,
  874. .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL),
  875. .enable_bit = AM35XX_CPGMAC_VBUSP_CLK_SHIFT,
  876. .clkdm_name = "core_l3_clkdm",
  877. };
  878. DEFINE_STRUCT_CLK(emac_ick, emac_ick_parent_names, aes2_ick_ops);
  879. static struct clk emu_core_alwon_ck;
  880. static const char *emu_core_alwon_ck_parent_names[] = {
  881. "dpll3_m3x2_ck",
  882. };
  883. DEFINE_STRUCT_CLK_HW_OMAP(emu_core_alwon_ck, "dpll3_clkdm");
  884. DEFINE_STRUCT_CLK(emu_core_alwon_ck, emu_core_alwon_ck_parent_names,
  885. core_l4_ick_ops);
  886. static struct clk emu_mpu_alwon_ck;
  887. static const char *emu_mpu_alwon_ck_parent_names[] = {
  888. "mpu_ck",
  889. };
  890. DEFINE_STRUCT_CLK_HW_OMAP(emu_mpu_alwon_ck, NULL);
  891. DEFINE_STRUCT_CLK(emu_mpu_alwon_ck, emu_mpu_alwon_ck_parent_names, core_ck_ops);
  892. static struct clk emu_per_alwon_ck;
  893. static const char *emu_per_alwon_ck_parent_names[] = {
  894. "dpll4_m6x2_ck",
  895. };
  896. DEFINE_STRUCT_CLK_HW_OMAP(emu_per_alwon_ck, "dpll4_clkdm");
  897. DEFINE_STRUCT_CLK(emu_per_alwon_ck, emu_per_alwon_ck_parent_names,
  898. core_l4_ick_ops);
  899. static const char *emu_src_ck_parent_names[] = {
  900. "sys_ck", "emu_core_alwon_ck", "emu_per_alwon_ck", "emu_mpu_alwon_ck",
  901. };
  902. static const struct clksel_rate emu_src_sys_rates[] = {
  903. { .div = 1, .val = 0, .flags = RATE_IN_3XXX },
  904. { .div = 0 },
  905. };
  906. static const struct clksel_rate emu_src_core_rates[] = {
  907. { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
  908. { .div = 0 },
  909. };
  910. static const struct clksel_rate emu_src_per_rates[] = {
  911. { .div = 1, .val = 2, .flags = RATE_IN_3XXX },
  912. { .div = 0 },
  913. };
  914. static const struct clksel_rate emu_src_mpu_rates[] = {
  915. { .div = 1, .val = 3, .flags = RATE_IN_3XXX },
  916. { .div = 0 },
  917. };
  918. static const struct clksel emu_src_clksel[] = {
  919. { .parent = &sys_ck, .rates = emu_src_sys_rates },
  920. { .parent = &emu_core_alwon_ck, .rates = emu_src_core_rates },
  921. { .parent = &emu_per_alwon_ck, .rates = emu_src_per_rates },
  922. { .parent = &emu_mpu_alwon_ck, .rates = emu_src_mpu_rates },
  923. { .parent = NULL },
  924. };
  925. static const struct clk_ops emu_src_ck_ops = {
  926. .init = &omap2_init_clk_clkdm,
  927. .recalc_rate = &omap2_clksel_recalc,
  928. .get_parent = &omap2_clksel_find_parent_index,
  929. .set_parent = &omap2_clksel_set_parent,
  930. .enable = &omap2_clkops_enable_clkdm,
  931. .disable = &omap2_clkops_disable_clkdm,
  932. };
  933. static struct clk emu_src_ck;
  934. static struct clk_hw_omap emu_src_ck_hw = {
  935. .hw = {
  936. .clk = &emu_src_ck,
  937. },
  938. .clksel = emu_src_clksel,
  939. .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  940. .clksel_mask = OMAP3430_MUX_CTRL_MASK,
  941. .clkdm_name = "emu_clkdm",
  942. };
  943. DEFINE_STRUCT_CLK(emu_src_ck, emu_src_ck_parent_names, emu_src_ck_ops);
  944. DEFINE_CLK_DIVIDER(atclk_fck, "emu_src_ck", &emu_src_ck, 0x0,
  945. OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
  946. OMAP3430_CLKSEL_ATCLK_SHIFT, OMAP3430_CLKSEL_ATCLK_WIDTH,
  947. CLK_DIVIDER_ONE_BASED, NULL);
  948. static struct clk fac_ick;
  949. static struct clk_hw_omap fac_ick_hw = {
  950. .hw = {
  951. .clk = &fac_ick,
  952. },
  953. .ops = &clkhwops_iclk_wait,
  954. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  955. .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
  956. .clkdm_name = "core_l4_clkdm",
  957. };
  958. DEFINE_STRUCT_CLK(fac_ick, aes2_ick_parent_names, aes2_ick_ops);
  959. static struct clk fshostusb_fck;
  960. static const char *fshostusb_fck_parent_names[] = {
  961. "core_48m_fck",
  962. };
  963. static struct clk_hw_omap fshostusb_fck_hw = {
  964. .hw = {
  965. .clk = &fshostusb_fck,
  966. },
  967. .ops = &clkhwops_wait,
  968. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  969. .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
  970. .clkdm_name = "core_l4_clkdm",
  971. };
  972. DEFINE_STRUCT_CLK(fshostusb_fck, fshostusb_fck_parent_names, aes2_ick_ops);
  973. static struct clk gfx_l3_ck;
  974. static struct clk_hw_omap gfx_l3_ck_hw = {
  975. .hw = {
  976. .clk = &gfx_l3_ck,
  977. },
  978. .ops = &clkhwops_wait,
  979. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
  980. .enable_bit = OMAP_EN_GFX_SHIFT,
  981. .clkdm_name = "gfx_3430es1_clkdm",
  982. };
  983. DEFINE_STRUCT_CLK(gfx_l3_ck, core_l3_ick_parent_names, aes1_ick_ops);
  984. DEFINE_CLK_DIVIDER(gfx_l3_fck, "l3_ick", &l3_ick, 0x0,
  985. OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
  986. OMAP_CLKSEL_GFX_SHIFT, OMAP_CLKSEL_GFX_WIDTH,
  987. CLK_DIVIDER_ONE_BASED, NULL);
  988. static struct clk gfx_cg1_ck;
  989. static const char *gfx_cg1_ck_parent_names[] = {
  990. "gfx_l3_fck",
  991. };
  992. static struct clk_hw_omap gfx_cg1_ck_hw = {
  993. .hw = {
  994. .clk = &gfx_cg1_ck,
  995. },
  996. .ops = &clkhwops_wait,
  997. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  998. .enable_bit = OMAP3430ES1_EN_2D_SHIFT,
  999. .clkdm_name = "gfx_3430es1_clkdm",
  1000. };
  1001. DEFINE_STRUCT_CLK(gfx_cg1_ck, gfx_cg1_ck_parent_names, aes2_ick_ops);
  1002. static struct clk gfx_cg2_ck;
  1003. static struct clk_hw_omap gfx_cg2_ck_hw = {
  1004. .hw = {
  1005. .clk = &gfx_cg2_ck,
  1006. },
  1007. .ops = &clkhwops_wait,
  1008. .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
  1009. .enable_bit = OMAP3430ES1_EN_3D_SHIFT,
  1010. .clkdm_name = "gfx_3430es1_clkdm",
  1011. };
  1012. DEFINE_STRUCT_CLK(gfx_cg2_ck, gfx_cg1_ck_parent_names, aes2_ick_ops);
  1013. static struct clk gfx_l3_ick;
  1014. static const char *gfx_l3_ick_parent_names[] = {
  1015. "gfx_l3_ck",
  1016. };
  1017. DEFINE_STRUCT_CLK_HW_OMAP(gfx_l3_ick, "gfx_3430es1_clkdm");
  1018. DEFINE_STRUCT_CLK(gfx_l3_ick, gfx_l3_ick_parent_names, core_l4_ick_ops);
  1019. static struct clk wkup_32k_fck;
  1020. static const char *wkup_32k_fck_parent_names[] = {
  1021. "omap_32k_fck",
  1022. };
  1023. DEFINE_STRUCT_CLK_HW_OMAP(wkup_32k_fck, "wkup_clkdm");
  1024. DEFINE_STRUCT_CLK(wkup_32k_fck, wkup_32k_fck_parent_names, core_l4_ick_ops);
  1025. static struct clk gpio1_dbck;
  1026. static const char *gpio1_dbck_parent_names[] = {
  1027. "wkup_32k_fck",
  1028. };
  1029. static struct clk_hw_omap gpio1_dbck_hw = {
  1030. .hw = {
  1031. .clk = &gpio1_dbck,
  1032. },
  1033. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1034. .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
  1035. .clkdm_name = "wkup_clkdm",
  1036. };
  1037. DEFINE_STRUCT_CLK(gpio1_dbck, gpio1_dbck_parent_names, aes2_ick_ops);
  1038. static struct clk wkup_l4_ick;
  1039. DEFINE_STRUCT_CLK_HW_OMAP(wkup_l4_ick, "wkup_clkdm");
  1040. DEFINE_STRUCT_CLK(wkup_l4_ick, dpll3_ck_parent_names, core_l4_ick_ops);
  1041. static struct clk gpio1_ick;
  1042. static const char *gpio1_ick_parent_names[] = {
  1043. "wkup_l4_ick",
  1044. };
  1045. static struct clk_hw_omap gpio1_ick_hw = {
  1046. .hw = {
  1047. .clk = &gpio1_ick,
  1048. },
  1049. .ops = &clkhwops_iclk_wait,
  1050. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1051. .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
  1052. .clkdm_name = "wkup_clkdm",
  1053. };
  1054. DEFINE_STRUCT_CLK(gpio1_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1055. static struct clk per_32k_alwon_fck;
  1056. DEFINE_STRUCT_CLK_HW_OMAP(per_32k_alwon_fck, "per_clkdm");
  1057. DEFINE_STRUCT_CLK(per_32k_alwon_fck, wkup_32k_fck_parent_names,
  1058. core_l4_ick_ops);
  1059. static struct clk gpio2_dbck;
  1060. static const char *gpio2_dbck_parent_names[] = {
  1061. "per_32k_alwon_fck",
  1062. };
  1063. static struct clk_hw_omap gpio2_dbck_hw = {
  1064. .hw = {
  1065. .clk = &gpio2_dbck,
  1066. },
  1067. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1068. .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
  1069. .clkdm_name = "per_clkdm",
  1070. };
  1071. DEFINE_STRUCT_CLK(gpio2_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1072. static struct clk per_l4_ick;
  1073. DEFINE_STRUCT_CLK_HW_OMAP(per_l4_ick, "per_clkdm");
  1074. DEFINE_STRUCT_CLK(per_l4_ick, security_l4_ick2_parent_names, core_l4_ick_ops);
  1075. static struct clk gpio2_ick;
  1076. static const char *gpio2_ick_parent_names[] = {
  1077. "per_l4_ick",
  1078. };
  1079. static struct clk_hw_omap gpio2_ick_hw = {
  1080. .hw = {
  1081. .clk = &gpio2_ick,
  1082. },
  1083. .ops = &clkhwops_iclk_wait,
  1084. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1085. .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
  1086. .clkdm_name = "per_clkdm",
  1087. };
  1088. DEFINE_STRUCT_CLK(gpio2_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1089. static struct clk gpio3_dbck;
  1090. static struct clk_hw_omap gpio3_dbck_hw = {
  1091. .hw = {
  1092. .clk = &gpio3_dbck,
  1093. },
  1094. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1095. .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
  1096. .clkdm_name = "per_clkdm",
  1097. };
  1098. DEFINE_STRUCT_CLK(gpio3_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1099. static struct clk gpio3_ick;
  1100. static struct clk_hw_omap gpio3_ick_hw = {
  1101. .hw = {
  1102. .clk = &gpio3_ick,
  1103. },
  1104. .ops = &clkhwops_iclk_wait,
  1105. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1106. .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
  1107. .clkdm_name = "per_clkdm",
  1108. };
  1109. DEFINE_STRUCT_CLK(gpio3_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1110. static struct clk gpio4_dbck;
  1111. static struct clk_hw_omap gpio4_dbck_hw = {
  1112. .hw = {
  1113. .clk = &gpio4_dbck,
  1114. },
  1115. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1116. .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
  1117. .clkdm_name = "per_clkdm",
  1118. };
  1119. DEFINE_STRUCT_CLK(gpio4_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1120. static struct clk gpio4_ick;
  1121. static struct clk_hw_omap gpio4_ick_hw = {
  1122. .hw = {
  1123. .clk = &gpio4_ick,
  1124. },
  1125. .ops = &clkhwops_iclk_wait,
  1126. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1127. .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
  1128. .clkdm_name = "per_clkdm",
  1129. };
  1130. DEFINE_STRUCT_CLK(gpio4_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1131. static struct clk gpio5_dbck;
  1132. static struct clk_hw_omap gpio5_dbck_hw = {
  1133. .hw = {
  1134. .clk = &gpio5_dbck,
  1135. },
  1136. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1137. .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
  1138. .clkdm_name = "per_clkdm",
  1139. };
  1140. DEFINE_STRUCT_CLK(gpio5_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1141. static struct clk gpio5_ick;
  1142. static struct clk_hw_omap gpio5_ick_hw = {
  1143. .hw = {
  1144. .clk = &gpio5_ick,
  1145. },
  1146. .ops = &clkhwops_iclk_wait,
  1147. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1148. .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
  1149. .clkdm_name = "per_clkdm",
  1150. };
  1151. DEFINE_STRUCT_CLK(gpio5_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1152. static struct clk gpio6_dbck;
  1153. static struct clk_hw_omap gpio6_dbck_hw = {
  1154. .hw = {
  1155. .clk = &gpio6_dbck,
  1156. },
  1157. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
  1158. .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
  1159. .clkdm_name = "per_clkdm",
  1160. };
  1161. DEFINE_STRUCT_CLK(gpio6_dbck, gpio2_dbck_parent_names, aes2_ick_ops);
  1162. static struct clk gpio6_ick;
  1163. static struct clk_hw_omap gpio6_ick_hw = {
  1164. .hw = {
  1165. .clk = &gpio6_ick,
  1166. },
  1167. .ops = &clkhwops_iclk_wait,
  1168. .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
  1169. .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
  1170. .clkdm_name = "per_clkdm",
  1171. };
  1172. DEFINE_STRUCT_CLK(gpio6_ick, gpio2_ick_parent_names, aes2_ick_ops);
  1173. static struct clk gpmc_fck;
  1174. static struct clk_hw_omap gpmc_fck_hw = {
  1175. .hw = {
  1176. .clk = &gpmc_fck,
  1177. },
  1178. .flags = ENABLE_ON_INIT,
  1179. .clkdm_name = "core_l3_clkdm",
  1180. };
  1181. DEFINE_STRUCT_CLK(gpmc_fck, ipss_ick_parent_names, core_l4_ick_ops);
  1182. static const struct clksel omap343x_gpt_clksel[] = {
  1183. { .parent = &omap_32k_fck, .rates = gpt_32k_rates },
  1184. { .parent = &sys_ck, .rates = gpt_sys_rates },
  1185. { .parent = NULL },
  1186. };
  1187. static const char *gpt10_fck_parent_names[] = {
  1188. "omap_32k_fck", "sys_ck",
  1189. };
  1190. DEFINE_CLK_OMAP_MUX_GATE(gpt10_fck, "core_l4_clkdm", omap343x_gpt_clksel,
  1191. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1192. OMAP3430_CLKSEL_GPT10_MASK,
  1193. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1194. OMAP3430_EN_GPT10_SHIFT, &clkhwops_wait,
  1195. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1196. static struct clk gpt10_ick;
  1197. static struct clk_hw_omap gpt10_ick_hw = {
  1198. .hw = {
  1199. .clk = &gpt10_ick,
  1200. },
  1201. .ops = &clkhwops_iclk_wait,
  1202. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1203. .enable_bit = OMAP3430_EN_GPT10_SHIFT,
  1204. .clkdm_name = "core_l4_clkdm",
  1205. };
  1206. DEFINE_STRUCT_CLK(gpt10_ick, aes2_ick_parent_names, aes2_ick_ops);
  1207. DEFINE_CLK_OMAP_MUX_GATE(gpt11_fck, "core_l4_clkdm", omap343x_gpt_clksel,
  1208. OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
  1209. OMAP3430_CLKSEL_GPT11_MASK,
  1210. OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
  1211. OMAP3430_EN_GPT11_SHIFT, &clkhwops_wait,
  1212. gpt10_fck_parent_names, clkout2_src_ck_ops);
  1213. static struct clk gpt11_ick;
  1214. static struct clk_hw_omap gpt11_ick_hw = {
  1215. .hw = {
  1216. .clk = &gpt11_ick,
  1217. },
  1218. .ops = &clkhwops_iclk_wait,
  1219. .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
  1220. .enable_bit = OMAP3430_EN_GPT11_SHIFT,
  1221. .clkdm_name = "core_l4_clkdm",
  1222. };
  1223. DEFINE_STRUCT_CLK(gpt11_ick, aes2_ick_parent_names, aes2_ick_ops);
  1224. static struct clk gpt12_fck;
  1225. static const char *gpt12_fck_parent_names[] = {
  1226. "secure_32k_fck",
  1227. };
  1228. DEFINE_STRUCT_CLK_HW_OMAP(gpt12_fck, "wkup_clkdm");
  1229. DEFINE_STRUCT_CLK(gpt12_fck, gpt12_fck_parent_names, core_l4_ick_ops);
  1230. static struct clk gpt12_ick;
  1231. static struct clk_hw_omap gpt12_ick_hw = {
  1232. .hw = {
  1233. .clk = &gpt12_ick,
  1234. },
  1235. .ops = &clkhwops_iclk_wait,
  1236. .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
  1237. .enable_bit = OMAP3430_EN_GPT12_SHIFT,
  1238. .clkdm_name = "wkup_clkdm",
  1239. };
  1240. DEFINE_STRUCT_CLK(gpt12_ick, gpio1_ick_parent_names, aes2_ick_ops);
  1241. DEFINE_CLK_OMAP_MUX_GATE(gpt1_fck, "wkup_clkdm", omap343x_gpt_clksel,
  1242. OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
  1243. OMAP3430_CLKSEL_GPT1_MASK,
  1244. OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
  1245. OMAP3430_EN_GPT1_SHIFT, &clkhwops_wait,
  1246. gpt10_fck_parent_names, clkout2_src_ck_ops);