mmcc-msm8960.c 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321
  1. /*
  2. * Copyright (c) 2013, The Linux Foundation. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/bitops.h>
  15. #include <linux/err.h>
  16. #include <linux/delay.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/module.h>
  19. #include <linux/of.h>
  20. #include <linux/of_device.h>
  21. #include <linux/clk-provider.h>
  22. #include <linux/regmap.h>
  23. #include <linux/reset-controller.h>
  24. #include <dt-bindings/clock/qcom,mmcc-msm8960.h>
  25. #include <dt-bindings/reset/qcom,mmcc-msm8960.h>
  26. #include "clk-regmap.h"
  27. #include "clk-pll.h"
  28. #include "clk-rcg.h"
  29. #include "clk-branch.h"
  30. #include "reset.h"
  31. #define P_PXO 0
  32. #define P_PLL8 1
  33. #define P_PLL2 2
  34. #define P_PLL3 3
  35. static u8 mmcc_pxo_pll8_pll2_map[] = {
  36. [P_PXO] = 0,
  37. [P_PLL8] = 2,
  38. [P_PLL2] = 1,
  39. };
  40. static const char *mmcc_pxo_pll8_pll2[] = {
  41. "pxo",
  42. "pll8_vote",
  43. "pll2",
  44. };
  45. static u8 mmcc_pxo_pll8_pll2_pll3_map[] = {
  46. [P_PXO] = 0,
  47. [P_PLL8] = 2,
  48. [P_PLL2] = 1,
  49. [P_PLL3] = 3,
  50. };
  51. static const char *mmcc_pxo_pll8_pll2_pll3[] = {
  52. "pxo",
  53. "pll2",
  54. "pll8_vote",
  55. "pll3",
  56. };
  57. static struct clk_pll pll2 = {
  58. .l_reg = 0x320,
  59. .m_reg = 0x324,
  60. .n_reg = 0x328,
  61. .config_reg = 0x32c,
  62. .mode_reg = 0x31c,
  63. .status_reg = 0x334,
  64. .status_bit = 16,
  65. .clkr.hw.init = &(struct clk_init_data){
  66. .name = "pll2",
  67. .parent_names = (const char *[]){ "pxo" },
  68. .num_parents = 1,
  69. .ops = &clk_pll_ops,
  70. },
  71. };
  72. static struct freq_tbl clk_tbl_cam[] = {
  73. { 6000000, P_PLL8, 4, 1, 16 },
  74. { 8000000, P_PLL8, 4, 1, 12 },
  75. { 12000000, P_PLL8, 4, 1, 8 },
  76. { 16000000, P_PLL8, 4, 1, 6 },
  77. { 19200000, P_PLL8, 4, 1, 5 },
  78. { 24000000, P_PLL8, 4, 1, 4 },
  79. { 32000000, P_PLL8, 4, 1, 3 },
  80. { 48000000, P_PLL8, 4, 1, 2 },
  81. { 64000000, P_PLL8, 3, 1, 2 },
  82. { 96000000, P_PLL8, 4, 0, 0 },
  83. { 128000000, P_PLL8, 3, 0, 0 },
  84. { }
  85. };
  86. static struct clk_rcg camclk0_src = {
  87. .ns_reg = 0x0148,
  88. .md_reg = 0x0144,
  89. .mn = {
  90. .mnctr_en_bit = 5,
  91. .mnctr_reset_bit = 8,
  92. .reset_in_cc = true,
  93. .mnctr_mode_shift = 6,
  94. .n_val_shift = 24,
  95. .m_val_shift = 8,
  96. .width = 8,
  97. },
  98. .p = {
  99. .pre_div_shift = 14,
  100. .pre_div_width = 2,
  101. },
  102. .s = {
  103. .src_sel_shift = 0,
  104. .parent_map = mmcc_pxo_pll8_pll2_map,
  105. },
  106. .freq_tbl = clk_tbl_cam,
  107. .clkr = {
  108. .enable_reg = 0x0140,
  109. .enable_mask = BIT(2),
  110. .hw.init = &(struct clk_init_data){
  111. .name = "camclk0_src",
  112. .parent_names = mmcc_pxo_pll8_pll2,
  113. .num_parents = 3,
  114. .ops = &clk_rcg_ops,
  115. },
  116. },
  117. };
  118. static struct clk_branch camclk0_clk = {
  119. .halt_reg = 0x01e8,
  120. .halt_bit = 15,
  121. .clkr = {
  122. .enable_reg = 0x0140,
  123. .enable_mask = BIT(0),
  124. .hw.init = &(struct clk_init_data){
  125. .name = "camclk0_clk",
  126. .parent_names = (const char *[]){ "camclk0_src" },
  127. .num_parents = 1,
  128. .ops = &clk_branch_ops,
  129. },
  130. },
  131. };
  132. static struct clk_rcg camclk1_src = {
  133. .ns_reg = 0x015c,
  134. .md_reg = 0x0158,
  135. .mn = {
  136. .mnctr_en_bit = 5,
  137. .mnctr_reset_bit = 8,
  138. .reset_in_cc = true,
  139. .mnctr_mode_shift = 6,
  140. .n_val_shift = 24,
  141. .m_val_shift = 8,
  142. .width = 8,
  143. },
  144. .p = {
  145. .pre_div_shift = 14,
  146. .pre_div_width = 2,
  147. },
  148. .s = {
  149. .src_sel_shift = 0,
  150. .parent_map = mmcc_pxo_pll8_pll2_map,
  151. },
  152. .freq_tbl = clk_tbl_cam,
  153. .clkr = {
  154. .enable_reg = 0x0154,
  155. .enable_mask = BIT(2),
  156. .hw.init = &(struct clk_init_data){
  157. .name = "camclk1_src",
  158. .parent_names = mmcc_pxo_pll8_pll2,
  159. .num_parents = 3,
  160. .ops = &clk_rcg_ops,
  161. },
  162. },
  163. };
  164. static struct clk_branch camclk1_clk = {
  165. .halt_reg = 0x01e8,
  166. .halt_bit = 16,
  167. .clkr = {
  168. .enable_reg = 0x0154,
  169. .enable_mask = BIT(0),
  170. .hw.init = &(struct clk_init_data){
  171. .name = "camclk1_clk",
  172. .parent_names = (const char *[]){ "camclk1_src" },
  173. .num_parents = 1,
  174. .ops = &clk_branch_ops,
  175. },
  176. },
  177. };
  178. static struct clk_rcg camclk2_src = {
  179. .ns_reg = 0x0228,
  180. .md_reg = 0x0224,
  181. .mn = {
  182. .mnctr_en_bit = 5,
  183. .mnctr_reset_bit = 8,
  184. .reset_in_cc = true,
  185. .mnctr_mode_shift = 6,
  186. .n_val_shift = 24,
  187. .m_val_shift = 8,
  188. .width = 8,
  189. },
  190. .p = {
  191. .pre_div_shift = 14,
  192. .pre_div_width = 2,
  193. },
  194. .s = {
  195. .src_sel_shift = 0,
  196. .parent_map = mmcc_pxo_pll8_pll2_map,
  197. },
  198. .freq_tbl = clk_tbl_cam,
  199. .clkr = {
  200. .enable_reg = 0x0220,
  201. .enable_mask = BIT(2),
  202. .hw.init = &(struct clk_init_data){
  203. .name = "camclk2_src",
  204. .parent_names = mmcc_pxo_pll8_pll2,
  205. .num_parents = 3,
  206. .ops = &clk_rcg_ops,
  207. },
  208. },
  209. };
  210. static struct clk_branch camclk2_clk = {
  211. .halt_reg = 0x01e8,
  212. .halt_bit = 16,
  213. .clkr = {
  214. .enable_reg = 0x0220,
  215. .enable_mask = BIT(0),
  216. .hw.init = &(struct clk_init_data){
  217. .name = "camclk2_clk",
  218. .parent_names = (const char *[]){ "camclk2_src" },
  219. .num_parents = 1,
  220. .ops = &clk_branch_ops,
  221. },
  222. },
  223. };
  224. static struct freq_tbl clk_tbl_csi[] = {
  225. { 27000000, P_PXO, 1, 0, 0 },
  226. { 85330000, P_PLL8, 1, 2, 9 },
  227. { 177780000, P_PLL2, 1, 2, 9 },
  228. { }
  229. };
  230. static struct clk_rcg csi0_src = {
  231. .ns_reg = 0x0048,
  232. .md_reg = 0x0044,
  233. .mn = {
  234. .mnctr_en_bit = 5,
  235. .mnctr_reset_bit = 7,
  236. .mnctr_mode_shift = 6,
  237. .n_val_shift = 24,
  238. .m_val_shift = 8,
  239. .width = 8,
  240. },
  241. .p = {
  242. .pre_div_shift = 14,
  243. .pre_div_width = 2,
  244. },
  245. .s = {
  246. .src_sel_shift = 0,
  247. .parent_map = mmcc_pxo_pll8_pll2_map,
  248. },
  249. .freq_tbl = clk_tbl_csi,
  250. .clkr = {
  251. .enable_reg = 0x0040,
  252. .enable_mask = BIT(2),
  253. .hw.init = &(struct clk_init_data){
  254. .name = "csi0_src",
  255. .parent_names = mmcc_pxo_pll8_pll2,
  256. .num_parents = 3,
  257. .ops = &clk_rcg_ops,
  258. },
  259. },
  260. };
  261. static struct clk_branch csi0_clk = {
  262. .halt_reg = 0x01cc,
  263. .halt_bit = 13,
  264. .clkr = {
  265. .enable_reg = 0x0040,
  266. .enable_mask = BIT(0),
  267. .hw.init = &(struct clk_init_data){
  268. .parent_names = (const char *[]){ "csi0_src" },
  269. .num_parents = 1,
  270. .name = "csi0_clk",
  271. .ops = &clk_branch_ops,
  272. .flags = CLK_SET_RATE_PARENT,
  273. },
  274. },
  275. };
  276. static struct clk_branch csi0_phy_clk = {
  277. .halt_reg = 0x01e8,
  278. .halt_bit = 9,
  279. .clkr = {
  280. .enable_reg = 0x0040,
  281. .enable_mask = BIT(8),
  282. .hw.init = &(struct clk_init_data){
  283. .parent_names = (const char *[]){ "csi0_src" },
  284. .num_parents = 1,
  285. .name = "csi0_phy_clk",
  286. .ops = &clk_branch_ops,
  287. .flags = CLK_SET_RATE_PARENT,
  288. },
  289. },
  290. };
  291. static struct clk_rcg csi1_src = {
  292. .ns_reg = 0x0010,
  293. .md_reg = 0x0028,
  294. .mn = {
  295. .mnctr_en_bit = 5,
  296. .mnctr_reset_bit = 7,
  297. .mnctr_mode_shift = 6,
  298. .n_val_shift = 24,
  299. .m_val_shift = 8,
  300. .width = 8,
  301. },
  302. .p = {
  303. .pre_div_shift = 14,
  304. .pre_div_width = 2,
  305. },
  306. .s = {
  307. .src_sel_shift = 0,
  308. .parent_map = mmcc_pxo_pll8_pll2_map,
  309. },
  310. .freq_tbl = clk_tbl_csi,
  311. .clkr = {
  312. .enable_reg = 0x0024,
  313. .enable_mask = BIT(2),
  314. .hw.init = &(struct clk_init_data){
  315. .name = "csi1_src",
  316. .parent_names = mmcc_pxo_pll8_pll2,
  317. .num_parents = 3,
  318. .ops = &clk_rcg_ops,
  319. },
  320. },
  321. };
  322. static struct clk_branch csi1_clk = {
  323. .halt_reg = 0x01cc,
  324. .halt_bit = 14,
  325. .clkr = {
  326. .enable_reg = 0x0024,
  327. .enable_mask = BIT(0),
  328. .hw.init = &(struct clk_init_data){
  329. .parent_names = (const char *[]){ "csi1_src" },
  330. .num_parents = 1,
  331. .name = "csi1_clk",
  332. .ops = &clk_branch_ops,
  333. .flags = CLK_SET_RATE_PARENT,
  334. },
  335. },
  336. };
  337. static struct clk_branch csi1_phy_clk = {
  338. .halt_reg = 0x01e8,
  339. .halt_bit = 10,
  340. .clkr = {
  341. .enable_reg = 0x0024,
  342. .enable_mask = BIT(8),
  343. .hw.init = &(struct clk_init_data){
  344. .parent_names = (const char *[]){ "csi1_src" },
  345. .num_parents = 1,
  346. .name = "csi1_phy_clk",
  347. .ops = &clk_branch_ops,
  348. .flags = CLK_SET_RATE_PARENT,
  349. },
  350. },
  351. };
  352. static struct clk_rcg csi2_src = {
  353. .ns_reg = 0x0234,
  354. .md_reg = 0x022c,
  355. .mn = {
  356. .mnctr_en_bit = 5,
  357. .mnctr_reset_bit = 7,
  358. .mnctr_mode_shift = 6,
  359. .n_val_shift = 24,
  360. .m_val_shift = 8,
  361. .width = 8,
  362. },
  363. .p = {
  364. .pre_div_shift = 14,
  365. .pre_div_width = 2,
  366. },
  367. .s = {
  368. .src_sel_shift = 0,
  369. .parent_map = mmcc_pxo_pll8_pll2_map,
  370. },
  371. .freq_tbl = clk_tbl_csi,
  372. .clkr = {
  373. .enable_reg = 0x022c,
  374. .enable_mask = BIT(2),
  375. .hw.init = &(struct clk_init_data){
  376. .name = "csi2_src",
  377. .parent_names = mmcc_pxo_pll8_pll2,
  378. .num_parents = 3,
  379. .ops = &clk_rcg_ops,
  380. },
  381. },
  382. };
  383. static struct clk_branch csi2_clk = {
  384. .halt_reg = 0x01cc,
  385. .halt_bit = 29,
  386. .clkr = {
  387. .enable_reg = 0x022c,
  388. .enable_mask = BIT(0),
  389. .hw.init = &(struct clk_init_data){
  390. .parent_names = (const char *[]){ "csi2_src" },
  391. .num_parents = 1,
  392. .name = "csi2_clk",
  393. .ops = &clk_branch_ops,
  394. .flags = CLK_SET_RATE_PARENT,
  395. },
  396. },
  397. };
  398. static struct clk_branch csi2_phy_clk = {
  399. .halt_reg = 0x01e8,
  400. .halt_bit = 29,
  401. .clkr = {
  402. .enable_reg = 0x022c,
  403. .enable_mask = BIT(8),
  404. .hw.init = &(struct clk_init_data){
  405. .parent_names = (const char *[]){ "csi2_src" },
  406. .num_parents = 1,
  407. .name = "csi2_phy_clk",
  408. .ops = &clk_branch_ops,
  409. .flags = CLK_SET_RATE_PARENT,
  410. },
  411. },
  412. };
  413. struct clk_pix_rdi {
  414. u32 s_reg;
  415. u32 s_mask;
  416. u32 s2_reg;
  417. u32 s2_mask;
  418. struct clk_regmap clkr;
  419. };
  420. #define to_clk_pix_rdi(_hw) \
  421. container_of(to_clk_regmap(_hw), struct clk_pix_rdi, clkr)
  422. static int pix_rdi_set_parent(struct clk_hw *hw, u8 index)
  423. {
  424. int i;
  425. int ret = 0;
  426. u32 val;
  427. struct clk_pix_rdi *rdi = to_clk_pix_rdi(hw);
  428. struct clk *clk = hw->clk;
  429. int num_parents = __clk_get_num_parents(hw->clk);
  430. /*
  431. * These clocks select three inputs via two muxes. One mux selects
  432. * between csi0 and csi1 and the second mux selects between that mux's
  433. * output and csi2. The source and destination selections for each
  434. * mux must be clocking for the switch to succeed so just turn on
  435. * all three sources because it's easier than figuring out what source
  436. * needs to be on at what time.
  437. */
  438. for (i = 0; i < num_parents; i++) {
  439. ret = clk_prepare_enable(clk_get_parent_by_index(clk, i));
  440. if (ret)
  441. goto err;
  442. }
  443. if (index == 2)
  444. val = rdi->s2_mask;
  445. else
  446. val = 0;
  447. regmap_update_bits(rdi->clkr.regmap, rdi->s2_reg, rdi->s2_mask, val);
  448. /*
  449. * Wait at least 6 cycles of slowest clock
  450. * for the glitch-free MUX to fully switch sources.
  451. */
  452. udelay(1);
  453. if (index == 1)
  454. val = rdi->s_mask;
  455. else
  456. val = 0;
  457. regmap_update_bits(rdi->clkr.regmap, rdi->s_reg, rdi->s_mask, val);
  458. /*
  459. * Wait at least 6 cycles of slowest clock
  460. * for the glitch-free MUX to fully switch sources.
  461. */
  462. udelay(1);
  463. err:
  464. for (i--; i >= 0; i--)
  465. clk_disable_unprepare(clk_get_parent_by_index(clk, i));
  466. return ret;
  467. }
  468. static u8 pix_rdi_get_parent(struct clk_hw *hw)
  469. {
  470. u32 val;
  471. struct clk_pix_rdi *rdi = to_clk_pix_rdi(hw);
  472. regmap_read(rdi->clkr.regmap, rdi->s2_reg, &val);
  473. if (val & rdi->s2_mask)
  474. return 2;
  475. regmap_read(rdi->clkr.regmap, rdi->s_reg, &val);
  476. if (val & rdi->s_mask)
  477. return 1;
  478. return 0;
  479. }
  480. static const struct clk_ops clk_ops_pix_rdi = {
  481. .enable = clk_enable_regmap,
  482. .disable = clk_disable_regmap,
  483. .set_parent = pix_rdi_set_parent,
  484. .get_parent = pix_rdi_get_parent,
  485. .determine_rate = __clk_mux_determine_rate,
  486. };
  487. static const char *pix_rdi_parents[] = {
  488. "csi0_clk",
  489. "csi1_clk",
  490. "csi2_clk",
  491. };
  492. static struct clk_pix_rdi csi_pix_clk = {
  493. .s_reg = 0x0058,
  494. .s_mask = BIT(25),
  495. .s2_reg = 0x0238,
  496. .s2_mask = BIT(13),
  497. .clkr = {
  498. .enable_reg = 0x0058,
  499. .enable_mask = BIT(26),
  500. .hw.init = &(struct clk_init_data){
  501. .name = "csi_pix_clk",
  502. .parent_names = pix_rdi_parents,
  503. .num_parents = 3,
  504. .ops = &clk_ops_pix_rdi,
  505. },
  506. },
  507. };
  508. static struct clk_pix_rdi csi_pix1_clk = {
  509. .s_reg = 0x0238,
  510. .s_mask = BIT(8),
  511. .s2_reg = 0x0238,
  512. .s2_mask = BIT(9),
  513. .clkr = {
  514. .enable_reg = 0x0238,
  515. .enable_mask = BIT(10),
  516. .hw.init = &(struct clk_init_data){
  517. .name = "csi_pix1_clk",
  518. .parent_names = pix_rdi_parents,
  519. .num_parents = 3,
  520. .ops = &clk_ops_pix_rdi,
  521. },
  522. },
  523. };
  524. static struct clk_pix_rdi csi_rdi_clk = {
  525. .s_reg = 0x0058,
  526. .s_mask = BIT(12),
  527. .s2_reg = 0x0238,
  528. .s2_mask = BIT(12),
  529. .clkr = {
  530. .enable_reg = 0x0058,
  531. .enable_mask = BIT(13),
  532. .hw.init = &(struct clk_init_data){
  533. .name = "csi_rdi_clk",
  534. .parent_names = pix_rdi_parents,
  535. .num_parents = 3,
  536. .ops = &clk_ops_pix_rdi,
  537. },
  538. },
  539. };
  540. static struct clk_pix_rdi csi_rdi1_clk = {
  541. .s_reg = 0x0238,
  542. .s_mask = BIT(0),
  543. .s2_reg = 0x0238,
  544. .s2_mask = BIT(1),
  545. .clkr = {
  546. .enable_reg = 0x0238,
  547. .enable_mask = BIT(2),
  548. .hw.init = &(struct clk_init_data){
  549. .name = "csi_rdi1_clk",
  550. .parent_names = pix_rdi_parents,
  551. .num_parents = 3,
  552. .ops = &clk_ops_pix_rdi,
  553. },
  554. },
  555. };
  556. static struct clk_pix_rdi csi_rdi2_clk = {
  557. .s_reg = 0x0238,
  558. .s_mask = BIT(4),
  559. .s2_reg = 0x0238,
  560. .s2_mask = BIT(5),
  561. .clkr = {
  562. .enable_reg = 0x0238,
  563. .enable_mask = BIT(6),
  564. .hw.init = &(struct clk_init_data){
  565. .name = "csi_rdi2_clk",
  566. .parent_names = pix_rdi_parents,
  567. .num_parents = 3,
  568. .ops = &clk_ops_pix_rdi,
  569. },
  570. },
  571. };
  572. static struct freq_tbl clk_tbl_csiphytimer[] = {
  573. { 85330000, P_PLL8, 1, 2, 9 },
  574. { 177780000, P_PLL2, 1, 2, 9 },
  575. { }
  576. };
  577. static struct clk_rcg csiphytimer_src = {
  578. .ns_reg = 0x0168,
  579. .md_reg = 0x0164,
  580. .mn = {
  581. .mnctr_en_bit = 5,
  582. .mnctr_reset_bit = 8,
  583. .reset_in_cc = true,
  584. .mnctr_mode_shift = 6,
  585. .n_val_shift = 24,
  586. .m_val_shift = 8,
  587. .width = 8,
  588. },
  589. .p = {
  590. .pre_div_shift = 14,
  591. .pre_div_width = 2,
  592. },
  593. .s = {
  594. .src_sel_shift = 0,
  595. .parent_map = mmcc_pxo_pll8_pll2_map,
  596. },
  597. .freq_tbl = clk_tbl_csiphytimer,
  598. .clkr = {
  599. .enable_reg = 0x0160,
  600. .enable_mask = BIT(2),
  601. .hw.init = &(struct clk_init_data){
  602. .name = "csiphytimer_src",
  603. .parent_names = mmcc_pxo_pll8_pll2,
  604. .num_parents = 3,
  605. .ops = &clk_rcg_ops,
  606. },
  607. },
  608. };
  609. static const char *csixphy_timer_src[] = { "csiphytimer_src" };
  610. static struct clk_branch csiphy0_timer_clk = {
  611. .halt_reg = 0x01e8,
  612. .halt_bit = 17,
  613. .clkr = {
  614. .enable_reg = 0x0160,
  615. .enable_mask = BIT(0),
  616. .hw.init = &(struct clk_init_data){
  617. .parent_names = csixphy_timer_src,
  618. .num_parents = 1,
  619. .name = "csiphy0_timer_clk",
  620. .ops = &clk_branch_ops,
  621. .flags = CLK_SET_RATE_PARENT,
  622. },
  623. },
  624. };
  625. static struct clk_branch csiphy1_timer_clk = {
  626. .halt_reg = 0x01e8,
  627. .halt_bit = 18,
  628. .clkr = {
  629. .enable_reg = 0x0160,
  630. .enable_mask = BIT(9),
  631. .hw.init = &(struct clk_init_data){
  632. .parent_names = csixphy_timer_src,
  633. .num_parents = 1,
  634. .name = "csiphy1_timer_clk",
  635. .ops = &clk_branch_ops,
  636. .flags = CLK_SET_RATE_PARENT,
  637. },
  638. },
  639. };
  640. static struct clk_branch csiphy2_timer_clk = {
  641. .halt_reg = 0x01e8,
  642. .halt_bit = 30,
  643. .clkr = {
  644. .enable_reg = 0x0160,
  645. .enable_mask = BIT(11),
  646. .hw.init = &(struct clk_init_data){
  647. .parent_names = csixphy_timer_src,
  648. .num_parents = 1,
  649. .name = "csiphy2_timer_clk",
  650. .ops = &clk_branch_ops,
  651. .flags = CLK_SET_RATE_PARENT,
  652. },
  653. },
  654. };
  655. static struct freq_tbl clk_tbl_gfx2d[] = {
  656. { 27000000, P_PXO, 1, 0 },
  657. { 48000000, P_PLL8, 1, 8 },
  658. { 54857000, P_PLL8, 1, 7 },
  659. { 64000000, P_PLL8, 1, 6 },
  660. { 76800000, P_PLL8, 1, 5 },
  661. { 96000000, P_PLL8, 1, 4 },
  662. { 128000000, P_PLL8, 1, 3 },
  663. { 145455000, P_PLL2, 2, 11 },
  664. { 160000000, P_PLL2, 1, 5 },
  665. { 177778000, P_PLL2, 2, 9 },
  666. { 200000000, P_PLL2, 1, 4 },
  667. { 228571000, P_PLL2, 2, 7 },
  668. { }
  669. };
  670. static struct clk_dyn_rcg gfx2d0_src = {
  671. .ns_reg = 0x0070,
  672. .md_reg[0] = 0x0064,
  673. .md_reg[1] = 0x0068,
  674. .mn[0] = {
  675. .mnctr_en_bit = 8,
  676. .mnctr_reset_bit = 25,
  677. .mnctr_mode_shift = 9,
  678. .n_val_shift = 20,
  679. .m_val_shift = 4,
  680. .width = 4,
  681. },
  682. .mn[1] = {
  683. .mnctr_en_bit = 5,
  684. .mnctr_reset_bit = 24,
  685. .mnctr_mode_shift = 6,
  686. .n_val_shift = 16,
  687. .m_val_shift = 4,
  688. .width = 4,
  689. },
  690. .s[0] = {
  691. .src_sel_shift = 3,
  692. .parent_map = mmcc_pxo_pll8_pll2_map,
  693. },
  694. .s[1] = {
  695. .src_sel_shift = 0,
  696. .parent_map = mmcc_pxo_pll8_pll2_map,
  697. },
  698. .mux_sel_bit = 11,
  699. .freq_tbl = clk_tbl_gfx2d,
  700. .clkr = {
  701. .enable_reg = 0x0060,
  702. .enable_mask = BIT(2),
  703. .hw.init = &(struct clk_init_data){
  704. .name = "gfx2d0_src",
  705. .parent_names = mmcc_pxo_pll8_pll2,
  706. .num_parents = 3,
  707. .ops = &clk_dyn_rcg_ops,
  708. },
  709. },
  710. };
  711. static struct clk_branch gfx2d0_clk = {
  712. .halt_reg = 0x01c8,
  713. .halt_bit = 9,
  714. .clkr = {
  715. .enable_reg = 0x0060,
  716. .enable_mask = BIT(0),
  717. .hw.init = &(struct clk_init_data){
  718. .name = "gfx2d0_clk",
  719. .parent_names = (const char *[]){ "gfx2d0_src" },
  720. .num_parents = 1,
  721. .ops = &clk_branch_ops,
  722. .flags = CLK_SET_RATE_PARENT,
  723. },
  724. },
  725. };
  726. static struct clk_dyn_rcg gfx2d1_src = {
  727. .ns_reg = 0x007c,
  728. .md_reg[0] = 0x0078,
  729. .md_reg[1] = 0x006c,
  730. .mn[0] = {
  731. .mnctr_en_bit = 8,
  732. .mnctr_reset_bit = 25,
  733. .mnctr_mode_shift = 9,
  734. .n_val_shift = 20,
  735. .m_val_shift = 4,
  736. .width = 4,
  737. },
  738. .mn[1] = {
  739. .mnctr_en_bit = 5,
  740. .mnctr_reset_bit = 24,
  741. .mnctr_mode_shift = 6,
  742. .n_val_shift = 16,
  743. .m_val_shift = 4,
  744. .width = 4,
  745. },
  746. .s[0] = {
  747. .src_sel_shift = 3,
  748. .parent_map = mmcc_pxo_pll8_pll2_map,
  749. },
  750. .s[1] = {
  751. .src_sel_shift = 0,
  752. .parent_map = mmcc_pxo_pll8_pll2_map,
  753. },
  754. .mux_sel_bit = 11,
  755. .freq_tbl = clk_tbl_gfx2d,
  756. .clkr = {
  757. .enable_reg = 0x0074,
  758. .enable_mask = BIT(2),
  759. .hw.init = &(struct clk_init_data){
  760. .name = "gfx2d1_src",
  761. .parent_names = mmcc_pxo_pll8_pll2,
  762. .num_parents = 3,
  763. .ops = &clk_dyn_rcg_ops,
  764. },
  765. },
  766. };
  767. static struct clk_branch gfx2d1_clk = {
  768. .halt_reg = 0x01c8,
  769. .halt_bit = 14,
  770. .clkr = {
  771. .enable_reg = 0x0074,
  772. .enable_mask = BIT(0),
  773. .hw.init = &(struct clk_init_data){
  774. .name = "gfx2d1_clk",
  775. .parent_names = (const char *[]){ "gfx2d1_src" },
  776. .num_parents = 1,
  777. .ops = &clk_branch_ops,
  778. .flags = CLK_SET_RATE_PARENT,
  779. },
  780. },
  781. };
  782. static struct freq_tbl clk_tbl_gfx3d[] = {
  783. { 27000000, P_PXO, 1, 0 },
  784. { 48000000, P_PLL8, 1, 8 },
  785. { 54857000, P_PLL8, 1, 7 },
  786. { 64000000, P_PLL8, 1, 6 },
  787. { 76800000, P_PLL8, 1, 5 },
  788. { 96000000, P_PLL8, 1, 4 },
  789. { 128000000, P_PLL8, 1, 3 },
  790. { 145455000, P_PLL2, 2, 11 },
  791. { 160000000, P_PLL2, 1, 5 },
  792. { 177778000, P_PLL2, 2, 9 },
  793. { 200000000, P_PLL2, 1, 4 },
  794. { 228571000, P_PLL2, 2, 7 },
  795. { 266667000, P_PLL2, 1, 3 },
  796. { 300000000, P_PLL3, 1, 4 },
  797. { 320000000, P_PLL2, 2, 5 },
  798. { 400000000, P_PLL2, 1, 2 },
  799. { }
  800. };
  801. static struct clk_dyn_rcg gfx3d_src = {
  802. .ns_reg = 0x008c,
  803. .md_reg[0] = 0x0084,
  804. .md_reg[1] = 0x0088,
  805. .mn[0] = {
  806. .mnctr_en_bit = 8,
  807. .mnctr_reset_bit = 25,
  808. .mnctr_mode_shift = 9,
  809. .n_val_shift = 18,
  810. .m_val_shift = 4,
  811. .width = 4,
  812. },
  813. .mn[1] = {
  814. .mnctr_en_bit = 5,
  815. .mnctr_reset_bit = 24,
  816. .mnctr_mode_shift = 6,
  817. .n_val_shift = 14,
  818. .m_val_shift = 4,
  819. .width = 4,
  820. },
  821. .s[0] = {
  822. .src_sel_shift = 3,
  823. .parent_map = mmcc_pxo_pll8_pll2_pll3_map,
  824. },
  825. .s[1] = {
  826. .src_sel_shift = 0,
  827. .parent_map = mmcc_pxo_pll8_pll2_pll3_map,
  828. },
  829. .mux_sel_bit = 11,
  830. .freq_tbl = clk_tbl_gfx3d,
  831. .clkr = {
  832. .enable_reg = 0x0080,
  833. .enable_mask = BIT(2),
  834. .hw.init = &(struct clk_init_data){
  835. .name = "gfx3d_src",
  836. .parent_names = mmcc_pxo_pll8_pll2_pll3,
  837. .num_parents = 3,
  838. .ops = &clk_dyn_rcg_ops,
  839. },
  840. },
  841. };
  842. static struct clk_branch gfx3d_clk = {
  843. .halt_reg = 0x01c8,
  844. .halt_bit = 4,
  845. .clkr = {
  846. .enable_reg = 0x0080,
  847. .enable_mask = BIT(0),
  848. .hw.init = &(struct clk_init_data){
  849. .name = "gfx3d_clk",
  850. .parent_names = (const char *[]){ "gfx3d_src" },
  851. .num_parents = 1,
  852. .ops = &clk_branch_ops,
  853. .flags = CLK_SET_RATE_PARENT,
  854. },
  855. },
  856. };
  857. static struct freq_tbl clk_tbl_ijpeg[] = {
  858. { 27000000, P_PXO, 1, 0, 0 },
  859. { 36570000, P_PLL8, 1, 2, 21 },
  860. { 54860000, P_PLL8, 7, 0, 0 },
  861. { 96000000, P_PLL8, 4, 0, 0 },
  862. { 109710000, P_PLL8, 1, 2, 7 },
  863. { 128000000, P_PLL8, 3, 0, 0 },
  864. { 153600000, P_PLL8, 1, 2, 5 },
  865. { 200000000, P_PLL2, 4, 0, 0 },
  866. { 228571000, P_PLL2, 1, 2, 7 },
  867. { 266667000, P_PLL2, 1, 1, 3 },
  868. { 320000000, P_PLL2, 1, 2, 5 },
  869. { }
  870. };
  871. static struct clk_rcg ijpeg_src = {
  872. .ns_reg = 0x00a0,
  873. .md_reg = 0x009c,
  874. .mn = {
  875. .mnctr_en_bit = 5,
  876. .mnctr_reset_bit = 7,
  877. .mnctr_mode_shift = 6,
  878. .n_val_shift = 16,
  879. .m_val_shift = 8,
  880. .width = 8,
  881. },
  882. .p = {
  883. .pre_div_shift = 12,
  884. .pre_div_width = 2,
  885. },
  886. .s = {
  887. .src_sel_shift = 0,
  888. .parent_map = mmcc_pxo_pll8_pll2_map,
  889. },
  890. .freq_tbl = clk_tbl_ijpeg,
  891. .clkr = {
  892. .enable_reg = 0x0098,
  893. .enable_mask = BIT(2),
  894. .hw.init = &(struct clk_init_data){
  895. .name = "ijpeg_src",
  896. .parent_names = mmcc_pxo_pll8_pll2,
  897. .num_parents = 3,
  898. .ops = &clk_rcg_ops,
  899. },
  900. },
  901. };
  902. static struct clk_branch ijpeg_clk = {
  903. .halt_reg = 0x01c8,
  904. .halt_bit = 24,
  905. .clkr = {
  906. .enable_reg = 0x0098,
  907. .enable_mask = BIT(0),
  908. .hw.init = &(struct clk_init_data){
  909. .name = "ijpeg_clk",
  910. .parent_names = (const char *[]){ "ijpeg_src" },
  911. .num_parents = 1,
  912. .ops = &clk_branch_ops,
  913. .flags = CLK_SET_RATE_PARENT,
  914. },
  915. },
  916. };
  917. static struct freq_tbl clk_tbl_jpegd[] = {
  918. { 64000000, P_PLL8, 6 },
  919. { 76800000, P_PLL8, 5 },
  920. { 96000000, P_PLL8, 4 },
  921. { 160000000, P_PLL2, 5 },
  922. { 200000000, P_PLL2, 4 },
  923. { }
  924. };
  925. static struct clk_rcg jpegd_src = {
  926. .ns_reg = 0x00ac,
  927. .p = {
  928. .pre_div_shift = 12,
  929. .pre_div_width = 2,
  930. },
  931. .s = {
  932. .src_sel_shift = 0,
  933. .parent_map = mmcc_pxo_pll8_pll2_map,
  934. },
  935. .freq_tbl = clk_tbl_jpegd,
  936. .clkr = {
  937. .enable_reg = 0x00a4,
  938. .enable_mask = BIT(2),
  939. .hw.init = &(struct clk_init_data){
  940. .name = "jpegd_src",
  941. .parent_names = mmcc_pxo_pll8_pll2,
  942. .num_parents = 3,
  943. .ops = &clk_rcg_ops,
  944. },
  945. },
  946. };
  947. static struct clk_branch jpegd_clk = {
  948. .halt_reg = 0x01c8,
  949. .halt_bit = 19,
  950. .clkr = {
  951. .enable_reg = 0x00a4,
  952. .enable_mask = BIT(0),
  953. .hw.init = &(struct clk_init_data){
  954. .name = "jpegd_clk",
  955. .parent_names = (const char *[]){ "jpegd_src" },
  956. .num_parents = 1,
  957. .ops = &clk_branch_ops,
  958. .flags = CLK_SET_RATE_PARENT,
  959. },
  960. },
  961. };
  962. static struct freq_tbl clk_tbl_mdp[] = {
  963. { 9600000, P_PLL8, 1, 1, 40 },
  964. { 13710000, P_PLL8, 1, 1, 28 },
  965. { 27000000, P_PXO, 1, 0, 0 },
  966. { 29540000, P_PLL8, 1, 1, 13 },
  967. { 34910000, P_PLL8, 1, 1, 11 },
  968. { 38400000, P_PLL8, 1, 1, 10 },
  969. { 59080000, P_PLL8, 1, 2, 13 },
  970. { 76800000, P_PLL8, 1, 1, 5 },
  971. { 85330000, P_PLL8, 1, 2, 9 },
  972. { 96000000, P_PLL8, 1, 1, 4 },
  973. { 128000000, P_PLL8, 1, 1, 3 },
  974. { 160000000, P_PLL2, 1, 1, 5 },
  975. { 177780000, P_PLL2, 1, 2, 9 },
  976. { 200000000, P_PLL2, 1, 1, 4 },
  977. { 228571000, P_PLL2, 1, 2, 7 },
  978. { 266667000, P_PLL2, 1, 1, 3 },
  979. { }
  980. };
  981. static struct clk_dyn_rcg mdp_src = {
  982. .ns_reg = 0x00d0,
  983. .md_reg[0] = 0x00c4,
  984. .md_reg[1] = 0x00c8,
  985. .mn[0] = {
  986. .mnctr_en_bit = 8,
  987. .mnctr_reset_bit = 31,
  988. .mnctr_mode_shift = 9,
  989. .n_val_shift = 22,
  990. .m_val_shift = 8,
  991. .width = 8,
  992. },
  993. .mn[1] = {
  994. .mnctr_en_bit = 5,
  995. .mnctr_reset_bit = 30,
  996. .mnctr_mode_shift = 6,
  997. .n_val_shift = 14,
  998. .m_val_shift = 8,
  999. .width = 8,
  1000. },
  1001. .s[0] = {
  1002. .src_sel_shift = 3,
  1003. .parent_map = mmcc_pxo_pll8_pll2_map,
  1004. },
  1005. .s[1] = {
  1006. .src_sel_shift = 0,
  1007. .parent_map = mmcc_pxo_pll8_pll2_map,
  1008. },
  1009. .mux_sel_bit = 11,
  1010. .freq_tbl = clk_tbl_mdp,
  1011. .clkr = {
  1012. .enable_reg = 0x00c0,
  1013. .enable_mask = BIT(2),
  1014. .hw.init = &(struct clk_init_data){
  1015. .name = "mdp_src",
  1016. .parent_names = mmcc_pxo_pll8_pll2,
  1017. .num_parents = 3,
  1018. .ops = &clk_dyn_rcg_ops,
  1019. },
  1020. },
  1021. };
  1022. static struct clk_branch mdp_clk = {
  1023. .halt_reg = 0x01d0,
  1024. .halt_bit = 10,
  1025. .clkr = {
  1026. .enable_reg = 0x00c0,
  1027. .enable_mask = BIT(0),
  1028. .hw.init = &(struct clk_init_data){
  1029. .name = "mdp_clk",
  1030. .parent_names = (const char *[]){ "mdp_src" },
  1031. .num_parents = 1,
  1032. .ops = &clk_branch_ops,
  1033. .flags = CLK_SET_RATE_PARENT,
  1034. },
  1035. },
  1036. };
  1037. static struct clk_branch mdp_lut_clk = {
  1038. .halt_reg = 0x01e8,
  1039. .halt_bit = 13,
  1040. .clkr = {
  1041. .enable_reg = 0x016c,
  1042. .enable_mask = BIT(0),
  1043. .hw.init = &(struct clk_init_data){
  1044. .parent_names = (const char *[]){ "mdp_clk" },
  1045. .num_parents = 1,
  1046. .name = "mdp_lut_clk",
  1047. .ops = &clk_branch_ops,
  1048. .flags = CLK_SET_RATE_PARENT,
  1049. },
  1050. },
  1051. };
  1052. static struct clk_branch mdp_vsync_clk = {
  1053. .halt_reg = 0x01cc,
  1054. .halt_bit = 22,
  1055. .clkr = {
  1056. .enable_reg = 0x0058,
  1057. .enable_mask = BIT(6),
  1058. .hw.init = &(struct clk_init_data){
  1059. .name = "mdp_vsync_clk",
  1060. .parent_names = (const char *[]){ "pxo" },
  1061. .num_parents = 1,
  1062. .ops = &clk_branch_ops
  1063. },
  1064. },
  1065. };
  1066. static struct freq_tbl clk_tbl_rot[] = {
  1067. { 27000000, P_PXO, 1 },
  1068. { 29540000, P_PLL8, 13 },
  1069. { 32000000, P_PLL8, 12 },
  1070. { 38400000, P_PLL8, 10 },
  1071. { 48000000, P_PLL8, 8 },
  1072. { 54860000, P_PLL8, 7 },
  1073. { 64000000, P_PLL8, 6 },
  1074. { 76800000, P_PLL8, 5 },
  1075. { 96000000, P_PLL8, 4 },
  1076. { 100000000, P_PLL2, 8 },
  1077. { 114290000, P_PLL2, 7 },
  1078. { 133330000, P_PLL2, 6 },
  1079. { 160000000, P_PLL2, 5 },
  1080. { 200000000, P_PLL2, 4 },
  1081. { }
  1082. };
  1083. static struct clk_dyn_rcg rot_src = {
  1084. .ns_reg = 0x00e8,
  1085. .p[0] = {
  1086. .pre_div_shift = 22,
  1087. .pre_div_width = 4,
  1088. },
  1089. .p[1] = {
  1090. .pre_div_shift = 26,
  1091. .pre_div_width = 4,
  1092. },
  1093. .s[0] = {
  1094. .src_sel_shift = 16,
  1095. .parent_map = mmcc_pxo_pll8_pll2_map,
  1096. },
  1097. .s[1] = {
  1098. .src_sel_shift = 19,
  1099. .parent_map = mmcc_pxo_pll8_pll2_map,
  1100. },
  1101. .mux_sel_bit = 30,
  1102. .freq_tbl = clk_tbl_rot,
  1103. .clkr = {
  1104. .enable_reg = 0x00e0,
  1105. .enable_mask = BIT(2),
  1106. .hw.init = &(struct clk_init_data){
  1107. .name = "rot_src",
  1108. .parent_names = mmcc_pxo_pll8_pll2,
  1109. .num_parents = 3,
  1110. .ops = &clk_dyn_rcg_ops,
  1111. },
  1112. },
  1113. };
  1114. static struct clk_branch rot_clk = {
  1115. .halt_reg = 0x01d0,
  1116. .halt_bit = 15,
  1117. .clkr = {
  1118. .enable_reg = 0x00e0,
  1119. .enable_mask = BIT(0),
  1120. .hw.init = &(struct clk_init_data){
  1121. .name = "rot_clk",
  1122. .parent_names = (const char *[]){ "rot_src" },
  1123. .num_parents = 1,
  1124. .ops = &clk_branch_ops,
  1125. .flags = CLK_SET_RATE_PARENT,
  1126. },
  1127. },
  1128. };
  1129. #define P_HDMI_PLL 1
  1130. static u8 mmcc_pxo_hdmi_map[] = {
  1131. [P_PXO] = 0,
  1132. [P_HDMI_PLL] = 2,
  1133. };
  1134. static const char *mmcc_pxo_hdmi[] = {
  1135. "pxo",
  1136. "hdmi_pll",
  1137. };
  1138. static struct freq_tbl clk_tbl_tv[] = {
  1139. { 25200000, P_HDMI_PLL, 1, 0, 0 },
  1140. { 27000000, P_HDMI_PLL, 1, 0, 0 },
  1141. { 27030000, P_HDMI_PLL, 1, 0, 0 },
  1142. { 74250000, P_HDMI_PLL, 1, 0, 0 },
  1143. { 108000000, P_HDMI_PLL, 1, 0, 0 },
  1144. { 148500000, P_HDMI_PLL, 1, 0, 0 },
  1145. { }
  1146. };
  1147. static struct clk_rcg tv_src = {
  1148. .ns_reg = 0x00f4,
  1149. .md_reg = 0x00f0,
  1150. .mn = {
  1151. .mnctr_en_bit = 5,
  1152. .mnctr_reset_bit = 7,
  1153. .mnctr_mode_shift = 6,
  1154. .n_val_shift = 16,
  1155. .m_val_shift = 8,
  1156. .width = 8,
  1157. },
  1158. .p = {
  1159. .pre_div_shift = 14,
  1160. .pre_div_width = 2,
  1161. },
  1162. .s = {
  1163. .src_sel_shift = 0,
  1164. .parent_map = mmcc_pxo_hdmi_map,
  1165. },
  1166. .freq_tbl = clk_tbl_tv,
  1167. .clkr = {
  1168. .enable_reg = 0x00ec,
  1169. .enable_mask = BIT(2),
  1170. .hw.init = &(struct clk_init_data){
  1171. .name = "tv_src",
  1172. .parent_names = mmcc_pxo_hdmi,
  1173. .num_parents = 2,
  1174. .ops = &clk_rcg_ops,
  1175. .flags = CLK_SET_RATE_PARENT,
  1176. },
  1177. },
  1178. };
  1179. static const char *tv_src_name[] = { "tv_src" };
  1180. static struct clk_branch tv_enc_clk = {
  1181. .halt_reg = 0x01d4,
  1182. .halt_bit = 9,
  1183. .clkr = {
  1184. .enable_reg = 0x00ec,
  1185. .enable_mask = BIT(8),
  1186. .hw.init = &(struct clk_init_data){
  1187. .parent_names = tv_src_name,
  1188. .num_parents = 1,
  1189. .name = "tv_enc_clk",
  1190. .ops = &clk_branch_ops,
  1191. .flags = CLK_SET_RATE_PARENT,
  1192. },
  1193. },
  1194. };
  1195. static struct clk_branch tv_dac_clk = {
  1196. .halt_reg = 0x01d4,
  1197. .halt_bit = 10,
  1198. .clkr = {
  1199. .enable_reg = 0x00ec,
  1200. .enable_mask = BIT(10),
  1201. .hw.init = &(struct clk_init_data){
  1202. .parent_names = tv_src_name,
  1203. .num_parents = 1,
  1204. .name = "tv_dac_clk",
  1205. .ops = &clk_branch_ops,
  1206. .flags = CLK_SET_RATE_PARENT,
  1207. },
  1208. },
  1209. };
  1210. static struct clk_branch mdp_tv_clk = {
  1211. .halt_reg = 0x01d4,
  1212. .halt_bit = 12,
  1213. .clkr = {
  1214. .enable_reg = 0x00ec,
  1215. .enable_mask = BIT(0),
  1216. .hw.init = &(struct clk_init_data){
  1217. .parent_names = tv_src_name,
  1218. .num_parents = 1,
  1219. .name = "mdp_tv_clk",
  1220. .ops = &clk_branch_ops,
  1221. .flags = CLK_SET_RATE_PARENT,
  1222. },
  1223. },
  1224. };
  1225. static struct clk_branch hdmi_tv_clk = {
  1226. .halt_reg = 0x01d4,
  1227. .halt_bit = 11,
  1228. .clkr = {
  1229. .enable_reg = 0x00ec,
  1230. .enable_mask = BIT(12),
  1231. .hw.init = &(struct clk_init_data){
  1232. .parent_names = tv_src_name,
  1233. .num_parents = 1,
  1234. .name = "hdmi_tv_clk",
  1235. .ops = &clk_branch_ops,
  1236. .flags = CLK_SET_RATE_PARENT,
  1237. },
  1238. },
  1239. };
  1240. static struct clk_branch hdmi_app_clk = {
  1241. .halt_reg = 0x01cc,
  1242. .halt_bit = 25,
  1243. .clkr = {
  1244. .enable_reg = 0x005c,
  1245. .enable_mask = BIT(11),
  1246. .hw.init = &(struct clk_init_data){
  1247. .parent_names = (const char *[]){ "pxo" },
  1248. .num_parents = 1,
  1249. .name = "hdmi_app_clk",
  1250. .ops = &clk_branch_ops,
  1251. },
  1252. },
  1253. };
  1254. static struct freq_tbl clk_tbl_vcodec[] = {
  1255. { 27000000, P_PXO, 1, 0 },
  1256. { 32000000, P_PLL8, 1, 12 },
  1257. { 48000000, P_PLL8, 1, 8 },
  1258. { 54860000, P_PLL8, 1, 7 },
  1259. { 96000000, P_PLL8, 1, 4 },
  1260. { 133330000, P_PLL2, 1, 6 },
  1261. { 200000000, P_PLL2, 1, 4 },
  1262. { 228570000, P_PLL2, 2, 7 },
  1263. { 266670000, P_PLL2, 1, 3 },
  1264. { }
  1265. };
  1266. static struct clk_dyn_rcg vcodec_src = {
  1267. .ns_reg = 0x0100,
  1268. .md_reg[0] = 0x00fc,
  1269. .md_reg[1] = 0x0128,
  1270. .mn[0] = {
  1271. .mnctr_en_bit = 5,
  1272. .mnctr_reset_bit = 31,
  1273. .mnctr_mode_shift = 6,
  1274. .n_val_shift = 11,
  1275. .m_val_shift = 8,
  1276. .width = 8,
  1277. },
  1278. .mn[1] = {
  1279. .mnctr_en_bit = 10,
  1280. .mnctr_reset_bit = 30,
  1281. .mnctr_mode_shift = 11,
  1282. .n_val_shift = 19,
  1283. .m_val_shift = 8,
  1284. .width = 8,
  1285. },
  1286. .s[0] = {
  1287. .src_sel_shift = 27,
  1288. .parent_map = mmcc_pxo_pll8_pll2_map,
  1289. },
  1290. .s[1] = {
  1291. .src_sel_shift = 0,
  1292. .parent_map = mmcc_pxo_pll8_pll2_map,
  1293. },
  1294. .mux_sel_bit = 13,
  1295. .freq_tbl = clk_tbl_vcodec,
  1296. .clkr = {
  1297. .enable_reg = 0x00f8,
  1298. .enable_mask = BIT(2),
  1299. .hw.init = &(struct clk_init_data){
  1300. .name = "vcodec_src",
  1301. .parent_names = mmcc_pxo_pll8_pll2,
  1302. .num_parents = 3,
  1303. .ops = &clk_dyn_rcg_ops,
  1304. },
  1305. },
  1306. };
  1307. static struct clk_branch vcodec_clk = {
  1308. .halt_reg = 0x01d0,
  1309. .halt_bit = 29,
  1310. .clkr = {
  1311. .enable_reg = 0x00f8,
  1312. .enable_mask = BIT(0),
  1313. .hw.init = &(struct clk_init_data){
  1314. .name = "vcodec_clk",
  1315. .parent_names = (const char *[]){ "vcodec_src" },
  1316. .num_parents = 1,
  1317. .ops = &clk_branch_ops,
  1318. .flags = CLK_SET_RATE_PARENT,
  1319. },
  1320. },
  1321. };
  1322. static struct freq_tbl clk_tbl_vpe[] = {
  1323. { 27000000, P_PXO, 1 },
  1324. { 34909000, P_PLL8, 11 },
  1325. { 38400000, P_PLL8, 10 },
  1326. { 64000000, P_PLL8, 6 },
  1327. { 76800000, P_PLL8, 5 },
  1328. { 96000000, P_PLL8, 4 },
  1329. { 100000000, P_PLL2, 8 },
  1330. { 160000000, P_PLL2, 5 },
  1331. { }
  1332. };
  1333. static struct clk_rcg vpe_src = {
  1334. .ns_reg = 0x0118,
  1335. .p = {
  1336. .pre_div_shift = 12,
  1337. .pre_div_width = 4,
  1338. },
  1339. .s = {
  1340. .src_sel_shift = 0,
  1341. .parent_map = mmcc_pxo_pll8_pll2_map,
  1342. },
  1343. .freq_tbl = clk_tbl_vpe,
  1344. .clkr = {
  1345. .enable_reg = 0x0110,
  1346. .enable_mask = BIT(2),
  1347. .hw.init = &(struct clk_init_data){
  1348. .name = "vpe_src",
  1349. .parent_names = mmcc_pxo_pll8_pll2,
  1350. .num_parents = 3,
  1351. .ops = &clk_rcg_ops,
  1352. },
  1353. },
  1354. };
  1355. static struct clk_branch vpe_clk = {
  1356. .halt_reg = 0x01c8,
  1357. .halt_bit = 28,
  1358. .clkr = {
  1359. .enable_reg = 0x0110,
  1360. .enable_mask = BIT(0),
  1361. .hw.init = &(struct clk_init_data){
  1362. .name = "vpe_clk",
  1363. .parent_names = (const char *[]){ "vpe_src" },
  1364. .num_parents = 1,
  1365. .ops = &clk_branch_ops,
  1366. .flags = CLK_SET_RATE_PARENT,
  1367. },
  1368. },
  1369. };
  1370. static struct freq_tbl clk_tbl_vfe[] = {
  1371. { 13960000, P_PLL8, 1, 2, 55 },
  1372. { 27000000, P_PXO, 1, 0, 0 },
  1373. { 36570000, P_PLL8, 1, 2, 21 },
  1374. { 38400000, P_PLL8, 2, 1, 5 },
  1375. { 45180000, P_PLL8, 1, 2, 17 },
  1376. { 48000000, P_PLL8, 2, 1, 4 },
  1377. { 54860000, P_PLL8, 1, 1, 7 },
  1378. { 64000000, P_PLL8, 2, 1, 3 },
  1379. { 76800000, P_PLL8, 1, 1, 5 },
  1380. { 96000000, P_PLL8, 2, 1, 2 },
  1381. { 109710000, P_PLL8, 1, 2, 7 },
  1382. { 128000000, P_PLL8, 1, 1, 3 },
  1383. { 153600000, P_PLL8, 1, 2, 5 },
  1384. { 200000000, P_PLL2, 2, 1, 2 },
  1385. { 228570000, P_PLL2, 1, 2, 7 },
  1386. { 266667000, P_PLL2, 1, 1, 3 },
  1387. { 320000000, P_PLL2, 1, 2, 5 },
  1388. { }
  1389. };
  1390. static struct clk_rcg vfe_src = {
  1391. .ns_reg = 0x0108,
  1392. .mn = {
  1393. .mnctr_en_bit = 5,
  1394. .mnctr_reset_bit = 7,
  1395. .mnctr_mode_shift = 6,
  1396. .n_val_shift = 16,
  1397. .m_val_shift = 8,
  1398. .width = 8,
  1399. },
  1400. .p = {
  1401. .pre_div_shift = 10,
  1402. .pre_div_width = 1,
  1403. },
  1404. .s = {
  1405. .src_sel_shift = 0,
  1406. .parent_map = mmcc_pxo_pll8_pll2_map,
  1407. },
  1408. .freq_tbl = clk_tbl_vfe,
  1409. .clkr = {
  1410. .enable_reg = 0x0104,
  1411. .enable_mask = BIT(2),
  1412. .hw.init = &(struct clk_init_data){
  1413. .name = "vfe_src",
  1414. .parent_names = mmcc_pxo_pll8_pll2,
  1415. .num_parents = 3,
  1416. .ops = &clk_rcg_ops,
  1417. },
  1418. },
  1419. };
  1420. static struct clk_branch vfe_clk = {
  1421. .halt_reg = 0x01cc,
  1422. .halt_bit = 6,
  1423. .clkr = {
  1424. .enable_reg = 0x0104,
  1425. .enable_mask = BIT(0),
  1426. .hw.init = &(struct clk_init_data){
  1427. .name = "vfe_clk",
  1428. .parent_names = (const char *[]){ "vfe_src" },
  1429. .num_parents = 1,
  1430. .ops = &clk_branch_ops,
  1431. .flags = CLK_SET_RATE_PARENT,
  1432. },
  1433. },
  1434. };
  1435. static struct clk_branch vfe_csi_clk = {
  1436. .halt_reg = 0x01cc,
  1437. .halt_bit = 8,
  1438. .clkr = {
  1439. .enable_reg = 0x0104,
  1440. .enable_mask = BIT(12),
  1441. .hw.init = &(struct clk_init_data){
  1442. .parent_names = (const char *[]){ "vfe_src" },
  1443. .num_parents = 1,
  1444. .name = "vfe_csi_clk",
  1445. .ops = &clk_branch_ops,
  1446. .flags = CLK_SET_RATE_PARENT,
  1447. },
  1448. },
  1449. };
  1450. static struct clk_branch gmem_axi_clk = {
  1451. .halt_reg = 0x01d8,
  1452. .halt_bit = 6,
  1453. .clkr = {
  1454. .enable_reg = 0x0018,
  1455. .enable_mask = BIT(24),
  1456. .hw.init = &(struct clk_init_data){
  1457. .name = "gmem_axi_clk",
  1458. .ops = &clk_branch_ops,
  1459. .flags = CLK_IS_ROOT,
  1460. },
  1461. },
  1462. };
  1463. static struct clk_branch ijpeg_axi_clk = {
  1464. .hwcg_reg = 0x0018,
  1465. .hwcg_bit = 11,
  1466. .halt_reg = 0x01d8,
  1467. .halt_bit = 4,
  1468. .clkr = {
  1469. .enable_reg = 0x0018,
  1470. .enable_mask = BIT(21),
  1471. .hw.init = &(struct clk_init_data){
  1472. .name = "ijpeg_axi_clk",
  1473. .ops = &clk_branch_ops,
  1474. .flags = CLK_IS_ROOT,
  1475. },
  1476. },
  1477. };
  1478. static struct clk_branch mmss_imem_axi_clk = {
  1479. .hwcg_reg = 0x0018,
  1480. .hwcg_bit = 15,
  1481. .halt_reg = 0x01d8,
  1482. .halt_bit = 7,
  1483. .clkr = {
  1484. .enable_reg = 0x0018,
  1485. .enable_mask = BIT(22),
  1486. .hw.init = &(struct clk_init_data){
  1487. .name = "mmss_imem_axi_clk",
  1488. .ops = &clk_branch_ops,
  1489. .flags = CLK_IS_ROOT,
  1490. },
  1491. },
  1492. };
  1493. static struct clk_branch jpegd_axi_clk = {
  1494. .halt_reg = 0x01d8,
  1495. .halt_bit = 5,
  1496. .clkr = {
  1497. .enable_reg = 0x0018,
  1498. .enable_mask = BIT(25),
  1499. .hw.init = &(struct clk_init_data){
  1500. .name = "jpegd_axi_clk",
  1501. .ops = &clk_branch_ops,
  1502. .flags = CLK_IS_ROOT,
  1503. },
  1504. },
  1505. };
  1506. static struct clk_branch vcodec_axi_b_clk = {
  1507. .hwcg_reg = 0x0114,
  1508. .hwcg_bit = 22,
  1509. .halt_reg = 0x01e8,
  1510. .halt_bit = 25,
  1511. .clkr = {
  1512. .enable_reg = 0x0114,
  1513. .enable_mask = BIT(23),
  1514. .hw.init = &(struct clk_init_data){
  1515. .name = "vcodec_axi_b_clk",
  1516. .ops = &clk_branch_ops,
  1517. .flags = CLK_IS_ROOT,
  1518. },
  1519. },
  1520. };
  1521. static struct clk_branch vcodec_axi_a_clk = {
  1522. .hwcg_reg = 0x0114,
  1523. .hwcg_bit = 24,
  1524. .halt_reg = 0x01e8,
  1525. .halt_bit = 26,
  1526. .clkr = {
  1527. .enable_reg = 0x0114,
  1528. .enable_mask = BIT(25),
  1529. .hw.init = &(struct clk_init_data){
  1530. .name = "vcodec_axi_a_clk",
  1531. .ops = &clk_branch_ops,
  1532. .flags = CLK_IS_ROOT,
  1533. },
  1534. },
  1535. };
  1536. static struct clk_branch vcodec_axi_clk = {
  1537. .hwcg_reg = 0x0018,
  1538. .hwcg_bit = 13,
  1539. .halt_reg = 0x01d8,
  1540. .halt_bit = 3,
  1541. .clkr = {
  1542. .enable_reg = 0x0018,
  1543. .enable_mask = BIT(19),
  1544. .hw.init = &(struct clk_init_data){
  1545. .name = "vcodec_axi_clk",
  1546. .ops = &clk_branch_ops,
  1547. .flags = CLK_IS_ROOT,
  1548. },
  1549. },
  1550. };
  1551. static struct clk_branch vfe_axi_clk = {
  1552. .halt_reg = 0x01d8,
  1553. .halt_bit = 0,
  1554. .clkr = {
  1555. .enable_reg = 0x0018,
  1556. .enable_mask = BIT(18),
  1557. .hw.init = &(struct clk_init_data){
  1558. .name = "vfe_axi_clk",
  1559. .ops = &clk_branch_ops,
  1560. .flags = CLK_IS_ROOT,
  1561. },
  1562. },
  1563. };
  1564. static struct clk_branch mdp_axi_clk = {
  1565. .hwcg_reg = 0x0018,
  1566. .hwcg_bit = 16,
  1567. .halt_reg = 0x01d8,
  1568. .halt_bit = 8,
  1569. .clkr = {
  1570. .enable_reg = 0x0018,
  1571. .enable_mask = BIT(23),
  1572. .hw.init = &(struct clk_init_data){
  1573. .name = "mdp_axi_clk",
  1574. .ops = &clk_branch_ops,
  1575. .flags = CLK_IS_ROOT,
  1576. },
  1577. },
  1578. };
  1579. static struct clk_branch rot_axi_clk = {
  1580. .hwcg_reg = 0x0020,
  1581. .hwcg_bit = 25,
  1582. .halt_reg = 0x01d8,
  1583. .halt_bit = 2,
  1584. .clkr = {
  1585. .enable_reg = 0x0020,
  1586. .enable_mask = BIT(24),
  1587. .hw.init = &(struct clk_init_data){
  1588. .name = "rot_axi_clk",
  1589. .ops = &clk_branch_ops,
  1590. .flags = CLK_IS_ROOT,
  1591. },
  1592. },
  1593. };
  1594. static struct clk_branch vpe_axi_clk = {
  1595. .hwcg_reg = 0x0020,
  1596. .hwcg_bit = 27,
  1597. .halt_reg = 0x01d8,
  1598. .halt_bit = 1,
  1599. .clkr = {
  1600. .enable_reg = 0x0020,
  1601. .enable_mask = BIT(26),
  1602. .hw.init = &(struct clk_init_data){
  1603. .name = "vpe_axi_clk",
  1604. .ops = &clk_branch_ops,
  1605. .flags = CLK_IS_ROOT,
  1606. },
  1607. },
  1608. };
  1609. static struct clk_branch gfx3d_axi_clk = {
  1610. .hwcg_reg = 0x0244,
  1611. .hwcg_bit = 24,
  1612. .halt_reg = 0x0240,
  1613. .halt_bit = 30,
  1614. .clkr = {
  1615. .enable_reg = 0x0244,
  1616. .enable_mask = BIT(25),
  1617. .hw.init = &(struct clk_init_data){
  1618. .name = "gfx3d_axi_clk",
  1619. .ops = &clk_branch_ops,
  1620. .flags = CLK_IS_ROOT,
  1621. },
  1622. },
  1623. };
  1624. static struct clk_branch amp_ahb_clk = {
  1625. .halt_reg = 0x01dc,
  1626. .halt_bit = 18,
  1627. .clkr = {
  1628. .enable_reg = 0x0008,
  1629. .enable_mask = BIT(24),
  1630. .hw.init = &(struct clk_init_data){
  1631. .name = "amp_ahb_clk",
  1632. .ops = &clk_branch_ops,
  1633. .flags = CLK_IS_ROOT,
  1634. },
  1635. },
  1636. };
  1637. static struct clk_branch csi_ahb_clk = {
  1638. .halt_reg = 0x01dc,
  1639. .halt_bit = 16,
  1640. .clkr = {
  1641. .enable_reg = 0x0008,
  1642. .enable_mask = BIT(7),
  1643. .hw.init = &(struct clk_init_data){
  1644. .name = "csi_ahb_clk",
  1645. .ops = &clk_branch_ops,
  1646. .flags = CLK_IS_ROOT
  1647. },
  1648. },
  1649. };
  1650. static struct clk_branch dsi_m_ahb_clk = {
  1651. .halt_reg = 0x01dc,
  1652. .halt_bit = 19,
  1653. .clkr = {
  1654. .enable_reg = 0x0008,
  1655. .enable_mask = BIT(9),
  1656. .hw.init = &(struct clk_init_data){
  1657. .name = "dsi_m_ahb_clk",
  1658. .ops = &clk_branch_ops,
  1659. .flags = CLK_IS_ROOT,
  1660. },
  1661. },
  1662. };
  1663. static struct clk_branch dsi_s_ahb_clk = {
  1664. .hwcg_reg = 0x0038,
  1665. .hwcg_bit = 20,
  1666. .halt_reg = 0x01dc,
  1667. .halt_bit = 21,
  1668. .clkr = {
  1669. .enable_reg = 0x0008,
  1670. .enable_mask = BIT(18),
  1671. .hw.init = &(struct clk_init_data){
  1672. .name = "dsi_s_ahb_clk",
  1673. .ops = &clk_branch_ops,
  1674. .flags = CLK_IS_ROOT,
  1675. },
  1676. },
  1677. };
  1678. static struct clk_branch dsi2_m_ahb_clk = {
  1679. .halt_reg = 0x01d8,
  1680. .halt_bit = 18,
  1681. .clkr = {
  1682. .enable_reg = 0x0008,
  1683. .enable_mask = BIT(17),
  1684. .hw.init = &(struct clk_init_data){
  1685. .name = "dsi2_m_ahb_clk",
  1686. .ops = &clk_branch_ops,
  1687. .flags = CLK_IS_ROOT
  1688. },
  1689. },
  1690. };
  1691. static struct clk_branch dsi2_s_ahb_clk = {
  1692. .hwcg_reg = 0x0038,
  1693. .hwcg_bit = 15,
  1694. .halt_reg = 0x01dc,
  1695. .halt_bit = 20,
  1696. .clkr = {
  1697. .enable_reg = 0x0008,
  1698. .enable_mask = BIT(22),
  1699. .hw.init = &(struct clk_init_data){
  1700. .name = "dsi2_s_ahb_clk",
  1701. .ops = &clk_branch_ops,
  1702. .flags = CLK_IS_ROOT,
  1703. },
  1704. },
  1705. };
  1706. static struct clk_branch gfx2d0_ahb_clk = {
  1707. .hwcg_reg = 0x0038,
  1708. .hwcg_bit = 28,
  1709. .halt_reg = 0x01dc,
  1710. .halt_bit = 2,
  1711. .clkr = {
  1712. .enable_reg = 0x0008,
  1713. .enable_mask = BIT(19),
  1714. .hw.init = &(struct clk_init_data){
  1715. .name = "gfx2d0_ahb_clk",
  1716. .ops = &clk_branch_ops,
  1717. .flags = CLK_IS_ROOT,
  1718. },
  1719. },
  1720. };
  1721. static struct clk_branch gfx2d1_ahb_clk = {
  1722. .hwcg_reg = 0x0038,
  1723. .hwcg_bit = 29,
  1724. .halt_reg = 0x01dc,
  1725. .halt_bit = 3,
  1726. .clkr = {
  1727. .enable_reg = 0x0008,
  1728. .enable_mask = BIT(2),
  1729. .hw.init = &(struct clk_init_data){
  1730. .name = "gfx2d1_ahb_clk",
  1731. .ops = &clk_branch_ops,
  1732. .flags = CLK_IS_ROOT,
  1733. },
  1734. },
  1735. };
  1736. static struct clk_branch gfx3d_ahb_clk = {
  1737. .hwcg_reg = 0x0038,
  1738. .hwcg_bit = 27,
  1739. .halt_reg = 0x01dc,
  1740. .halt_bit = 4,
  1741. .clkr = {
  1742. .enable_reg = 0x0008,
  1743. .enable_mask = BIT(3),
  1744. .hw.init = &(struct clk_init_data){
  1745. .name = "gfx3d_ahb_clk",
  1746. .ops = &clk_branch_ops,
  1747. .flags = CLK_IS_ROOT,
  1748. },
  1749. },
  1750. };
  1751. static struct clk_branch hdmi_m_ahb_clk = {
  1752. .hwcg_reg = 0x0038,
  1753. .hwcg_bit = 21,
  1754. .halt_reg = 0x01dc,
  1755. .halt_bit = 5,
  1756. .clkr = {
  1757. .enable_reg = 0x0008,
  1758. .enable_mask = BIT(14),
  1759. .hw.init = &(struct clk_init_data){
  1760. .name = "hdmi_m_ahb_clk",
  1761. .ops = &clk_branch_ops,
  1762. .flags = CLK_IS_ROOT,
  1763. },
  1764. },
  1765. };
  1766. static struct clk_branch hdmi_s_ahb_clk = {
  1767. .hwcg_reg = 0x0038,
  1768. .hwcg_bit = 22,
  1769. .halt_reg = 0x01dc,
  1770. .halt_bit = 6,
  1771. .clkr = {
  1772. .enable_reg = 0x0008,
  1773. .enable_mask = BIT(4),
  1774. .hw.init = &(struct clk_init_data){
  1775. .name = "hdmi_s_ahb_clk",
  1776. .ops = &clk_branch_ops,
  1777. .flags = CLK_IS_ROOT,
  1778. },
  1779. },
  1780. };
  1781. static struct clk_branch ijpeg_ahb_clk = {
  1782. .halt_reg = 0x01dc,
  1783. .halt_bit = 9,
  1784. .clkr = {
  1785. .enable_reg = 0x0008,
  1786. .enable_mask = BIT(5),
  1787. .hw.init = &(struct clk_init_data){
  1788. .name = "ijpeg_ahb_clk",
  1789. .ops = &clk_branch_ops,
  1790. .flags = CLK_IS_ROOT
  1791. },
  1792. },
  1793. };
  1794. static struct clk_branch mmss_imem_ahb_clk = {
  1795. .hwcg_reg = 0x0038,
  1796. .hwcg_bit = 12,
  1797. .halt_reg = 0x01dc,
  1798. .halt_bit = 10,
  1799. .clkr = {
  1800. .enable_reg = 0x0008,
  1801. .enable_mask = BIT(6),
  1802. .hw.init = &(struct clk_init_data){
  1803. .name = "mmss_imem_ahb_clk",
  1804. .ops = &clk_branch_ops,
  1805. .flags = CLK_IS_ROOT
  1806. },
  1807. },
  1808. };
  1809. static struct clk_branch jpegd_ahb_clk = {
  1810. .halt_reg = 0x01dc,
  1811. .halt_bit = 7,
  1812. .clkr = {
  1813. .enable_reg = 0x0008,
  1814. .enable_mask = BIT(21),
  1815. .hw.init = &(struct clk_init_data){
  1816. .name = "jpegd_ahb_clk",
  1817. .ops = &clk_branch_ops,
  1818. .flags = CLK_IS_ROOT,
  1819. },
  1820. },
  1821. };
  1822. static struct clk_branch mdp_ahb_clk = {
  1823. .halt_reg = 0x01dc,
  1824. .halt_bit = 11,
  1825. .clkr = {
  1826. .enable_reg = 0x0008,
  1827. .enable_mask = BIT(10),
  1828. .hw.init = &(struct clk_init_data){
  1829. .name = "mdp_ahb_clk",
  1830. .ops = &clk_branch_ops,
  1831. .flags = CLK_IS_ROOT,
  1832. },
  1833. },
  1834. };
  1835. static struct clk_branch rot_ahb_clk = {
  1836. .halt_reg = 0x01dc,
  1837. .halt_bit = 13,
  1838. .clkr = {
  1839. .enable_reg = 0x0008,
  1840. .enable_mask = BIT(12),
  1841. .hw.init = &(struct clk_init_data){
  1842. .name = "rot_ahb_clk",
  1843. .ops = &clk_branch_ops,
  1844. .flags = CLK_IS_ROOT
  1845. },
  1846. },
  1847. };
  1848. static struct clk_branch smmu_ahb_clk = {
  1849. .hwcg_reg = 0x0008,
  1850. .hwcg_bit = 26,
  1851. .halt_reg = 0x01dc,
  1852. .halt_bit = 22,
  1853. .clkr = {
  1854. .enable_reg = 0x0008,
  1855. .enable_mask = BIT(15),
  1856. .hw.init = &(struct clk_init_data){
  1857. .name = "smmu_ahb_clk",
  1858. .ops = &clk_branch_ops,
  1859. .flags = CLK_IS_ROOT,
  1860. },
  1861. },
  1862. };
  1863. static struct clk_branch tv_enc_ahb_clk = {
  1864. .halt_reg = 0x01dc,
  1865. .halt_bit = 23,
  1866. .clkr = {
  1867. .enable_reg = 0x0008,
  1868. .enable_mask = BIT(25),
  1869. .hw.init = &(struct clk_init_data){
  1870. .name = "tv_enc_ahb_clk",
  1871. .ops = &clk_branch_ops,
  1872. .flags = CLK_IS_ROOT,
  1873. },
  1874. },
  1875. };
  1876. static struct clk_branch vcodec_ahb_clk = {
  1877. .hwcg_reg = 0x0038,
  1878. .hwcg_bit = 26,
  1879. .halt_reg = 0x01dc,
  1880. .halt_bit = 12,
  1881. .clkr = {
  1882. .enable_reg = 0x0008,
  1883. .enable_mask = BIT(11),
  1884. .hw.init = &(struct clk_init_data){
  1885. .name = "vcodec_ahb_clk",
  1886. .ops = &clk_branch_ops,
  1887. .flags = CLK_IS_ROOT,
  1888. },
  1889. },
  1890. };
  1891. static struct clk_branch vfe_ahb_clk = {
  1892. .halt_reg = 0x01dc,
  1893. .halt_bit = 14,
  1894. .clkr = {
  1895. .enable_reg = 0x0008,
  1896. .enable_mask = BIT(13),
  1897. .hw.init = &(struct clk_init_data){
  1898. .name = "vfe_ahb_clk",
  1899. .ops = &clk_branch_ops,
  1900. .flags = CLK_IS_ROOT,
  1901. },
  1902. },
  1903. };
  1904. static struct clk_branch vpe_ahb_clk = {
  1905. .halt_reg = 0x01dc,
  1906. .halt_bit = 15,
  1907. .clkr = {
  1908. .enable_reg = 0x0008,
  1909. .enable_mask = BIT(16),
  1910. .hw.init = &(struct clk_init_data){
  1911. .name = "vpe_ahb_clk",
  1912. .ops = &clk_branch_ops,
  1913. .flags = CLK_IS_ROOT,
  1914. },
  1915. },
  1916. };
  1917. static struct clk_regmap *mmcc_msm8960_clks[] = {
  1918. [TV_ENC_AHB_CLK] = &tv_enc_ahb_clk.clkr,
  1919. [AMP_AHB_CLK] = &amp_ahb_clk.clkr,
  1920. [DSI2_S_AHB_CLK] = &dsi2_s_ahb_clk.clkr,
  1921. [JPEGD_AHB_CLK] = &jpegd_ahb_clk.clkr,
  1922. [GFX2D0_AHB_CLK] = &gfx2d0_ahb_clk.clkr,
  1923. [DSI_S_AHB_CLK] = &dsi_s_ahb_clk.clkr,
  1924. [DSI2_M_AHB_CLK] = &dsi2_m_ahb_clk.clkr,
  1925. [VPE_AHB_CLK] = &vpe_ahb_clk.clkr,
  1926. [SMMU_AHB_CLK] = &smmu_ahb_clk.clkr,
  1927. [HDMI_M_AHB_CLK] = &hdmi_m_ahb_clk.clkr,
  1928. [VFE_AHB_CLK] = &vfe_ahb_clk.clkr,
  1929. [ROT_AHB_CLK] = &rot_ahb_clk.clkr,
  1930. [VCODEC_AHB_CLK] = &vcodec_ahb_clk.clkr,
  1931. [MDP_AHB_CLK] = &mdp_ahb_clk.clkr,
  1932. [DSI_M_AHB_CLK] = &dsi_m_ahb_clk.clkr,
  1933. [CSI_AHB_CLK] = &csi_ahb_clk.clkr,
  1934. [MMSS_IMEM_AHB_CLK] = &mmss_imem_ahb_clk.clkr,
  1935. [IJPEG_AHB_CLK] = &ijpeg_ahb_clk.clkr,
  1936. [HDMI_S_AHB_CLK] = &hdmi_s_ahb_clk.clkr,
  1937. [GFX3D_AHB_CLK] = &gfx3d_ahb_clk.clkr,
  1938. [GFX2D1_AHB_CLK] = &gfx2d1_ahb_clk.clkr,
  1939. [JPEGD_AXI_CLK] = &jpegd_axi_clk.clkr,
  1940. [GMEM_AXI_CLK] = &gmem_axi_clk.clkr,
  1941. [MDP_AXI_CLK] = &mdp_axi_clk.clkr,
  1942. [MMSS_IMEM_AXI_CLK] = &mmss_imem_axi_clk.clkr,
  1943. [IJPEG_AXI_CLK] = &ijpeg_axi_clk.clkr,
  1944. [GFX3D_AXI_CLK] = &gfx3d_axi_clk.clkr,
  1945. [VCODEC_AXI_CLK] = &vcodec_axi_clk.clkr,
  1946. [VFE_AXI_CLK] = &vfe_axi_clk.clkr,
  1947. [VPE_AXI_CLK] = &vpe_axi_clk.clkr,
  1948. [ROT_AXI_CLK] = &rot_axi_clk.clkr,
  1949. [VCODEC_AXI_A_CLK] = &vcodec_axi_a_clk.clkr,
  1950. [VCODEC_AXI_B_CLK] = &vcodec_axi_b_clk.clkr,
  1951. [CSI0_SRC] = &csi0_src.clkr,
  1952. [CSI0_CLK] = &csi0_clk.clkr,
  1953. [CSI0_PHY_CLK] = &csi0_phy_clk.clkr,
  1954. [CSI1_SRC] = &csi1_src.clkr,
  1955. [CSI1_CLK] = &csi1_clk.clkr,
  1956. [CSI1_PHY_CLK] = &csi1_phy_clk.clkr,
  1957. [CSI2_SRC] = &csi2_src.clkr,
  1958. [CSI2_CLK] = &csi2_clk.clkr,
  1959. [CSI2_PHY_CLK] = &csi2_phy_clk.clkr,
  1960. [CSI_PIX_CLK] = &csi_pix_clk.clkr,
  1961. [CSI_RDI_CLK] = &csi_rdi_clk.clkr,
  1962. [MDP_VSYNC_CLK] = &mdp_vsync_clk.clkr,
  1963. [HDMI_APP_CLK] = &hdmi_app_clk.clkr,
  1964. [CSI_PIX1_CLK] = &csi_pix1_clk.clkr,
  1965. [CSI_RDI2_CLK] = &csi_rdi2_clk.clkr,
  1966. [CSI_RDI1_CLK] = &csi_rdi1_clk.clkr,
  1967. [GFX2D0_SRC] = &gfx2d0_src.clkr,
  1968. [GFX2D0_CLK] = &gfx2d0_clk.clkr,
  1969. [GFX2D1_SRC] = &gfx2d1_src.clkr,
  1970. [GFX2D1_CLK] = &gfx2d1_clk.clkr,
  1971. [GFX3D_SRC] = &gfx3d_src.clkr,
  1972. [GFX3D_CLK] = &gfx3d_clk.clkr,
  1973. [IJPEG_SRC] = &ijpeg_src.clkr,
  1974. [IJPEG_CLK] = &ijpeg_clk.clkr,
  1975. [JPEGD_SRC] = &jpegd_src.clkr,
  1976. [JPEGD_CLK] = &jpegd_clk.clkr,
  1977. [MDP_SRC] = &mdp_src.clkr,
  1978. [MDP_CLK] = &mdp_clk.clkr,
  1979. [MDP_LUT_CLK] = &mdp_lut_clk.clkr,
  1980. [ROT_SRC] = &rot_src.clkr,
  1981. [ROT_CLK] = &rot_clk.clkr,
  1982. [TV_ENC_CLK] = &tv_enc_clk.clkr,
  1983. [TV_DAC_CLK] = &tv_dac_clk.clkr,
  1984. [HDMI_TV_CLK] = &hdmi_tv_clk.clkr,
  1985. [MDP_TV_CLK] = &mdp_tv_clk.clkr,
  1986. [TV_SRC] = &tv_src.clkr,
  1987. [VCODEC_SRC] = &vcodec_src.clkr,
  1988. [VCODEC_CLK] = &vcodec_clk.clkr,
  1989. [VFE_SRC] = &vfe_src.clkr,
  1990. [VFE_CLK] = &vfe_clk.clkr,
  1991. [VFE_CSI_CLK] = &vfe_csi_clk.clkr,
  1992. [VPE_SRC] = &vpe_src.clkr,
  1993. [VPE_CLK] = &vpe_clk.clkr,
  1994. [CAMCLK0_SRC] = &camclk0_src.clkr,
  1995. [CAMCLK0_CLK] = &camclk0_clk.clkr,
  1996. [CAMCLK1_SRC] = &camclk1_src.clkr,
  1997. [CAMCLK1_CLK] = &camclk1_clk.clkr,
  1998. [CAMCLK2_SRC] = &camclk2_src.clkr,
  1999. [CAMCLK2_CLK] = &camclk2_clk.clkr,
  2000. [CSIPHYTIMER_SRC] = &csiphytimer_src.clkr,
  2001. [CSIPHY2_TIMER_CLK] = &csiphy2_timer_clk.clkr,
  2002. [CSIPHY1_TIMER_CLK] = &csiphy1_timer_clk.clkr,
  2003. [CSIPHY0_TIMER_CLK] = &csiphy0_timer_clk.clkr,
  2004. [PLL2] = &pll2.clkr,
  2005. };
  2006. static const struct qcom_reset_map mmcc_msm8960_resets[] = {
  2007. [VPE_AXI_RESET] = { 0x0208, 15 },
  2008. [IJPEG_AXI_RESET] = { 0x0208, 14 },
  2009. [MPD_AXI_RESET] = { 0x0208, 13 },
  2010. [VFE_AXI_RESET] = { 0x0208, 9 },
  2011. [SP_AXI_RESET] = { 0x0208, 8 },
  2012. [VCODEC_AXI_RESET] = { 0x0208, 7 },
  2013. [ROT_AXI_RESET] = { 0x0208, 6 },
  2014. [VCODEC_AXI_A_RESET] = { 0x0208, 5 },
  2015. [VCODEC_AXI_B_RESET] = { 0x0208, 4 },
  2016. [FAB_S3_AXI_RESET] = { 0x0208, 3 },
  2017. [FAB_S2_AXI_RESET] = { 0x0208, 2 },
  2018. [FAB_S1_AXI_RESET] = { 0x0208, 1 },
  2019. [FAB_S0_AXI_RESET] = { 0x0208 },
  2020. [SMMU_GFX3D_ABH_RESET] = { 0x020c, 31 },
  2021. [SMMU_VPE_AHB_RESET] = { 0x020c, 30 },
  2022. [SMMU_VFE_AHB_RESET] = { 0x020c, 29 },
  2023. [SMMU_ROT_AHB_RESET] = { 0x020c, 28 },
  2024. [SMMU_VCODEC_B_AHB_RESET] = { 0x020c, 27 },
  2025. [SMMU_VCODEC_A_AHB_RESET] = { 0x020c, 26 },
  2026. [SMMU_MDP1_AHB_RESET] = { 0x020c, 25 },
  2027. [SMMU_MDP0_AHB_RESET] = { 0x020c, 24 },
  2028. [SMMU_JPEGD_AHB_RESET] = { 0x020c, 23 },
  2029. [SMMU_IJPEG_AHB_RESET] = { 0x020c, 22 },
  2030. [SMMU_GFX2D0_AHB_RESET] = { 0x020c, 21 },
  2031. [SMMU_GFX2D1_AHB_RESET] = { 0x020c, 20 },
  2032. [APU_AHB_RESET] = { 0x020c, 18 },
  2033. [CSI_AHB_RESET] = { 0x020c, 17 },
  2034. [TV_ENC_AHB_RESET] = { 0x020c, 15 },
  2035. [VPE_AHB_RESET] = { 0x020c, 14 },
  2036. [FABRIC_AHB_RESET] = { 0x020c, 13 },
  2037. [GFX2D0_AHB_RESET] = { 0x020c, 12 },
  2038. [GFX2D1_AHB_RESET] = { 0x020c, 11 },
  2039. [GFX3D_AHB_RESET] = { 0x020c, 10 },
  2040. [HDMI_AHB_RESET] = { 0x020c, 9 },
  2041. [MSSS_IMEM_AHB_RESET] = { 0x020c, 8 },
  2042. [IJPEG_AHB_RESET] = { 0x020c, 7 },
  2043. [DSI_M_AHB_RESET] = { 0x020c, 6 },
  2044. [DSI_S_AHB_RESET] = { 0x020c, 5 },
  2045. [JPEGD_AHB_RESET] = { 0x020c, 4 },
  2046. [MDP_AHB_RESET] = { 0x020c, 3 },
  2047. [ROT_AHB_RESET] = { 0x020c, 2 },
  2048. [VCODEC_AHB_RESET] = { 0x020c, 1 },
  2049. [VFE_AHB_RESET] = { 0x020c, 0 },
  2050. [DSI2_M_AHB_RESET] = { 0x0210, 31 },
  2051. [DSI2_S_AHB_RESET] = { 0x0210, 30 },
  2052. [CSIPHY2_RESET] = { 0x0210, 29 },
  2053. [CSI_PIX1_RESET] = { 0x0210, 28 },
  2054. [CSIPHY0_RESET] = { 0x0210, 27 },
  2055. [CSIPHY1_RESET] = { 0x0210, 26 },
  2056. [DSI2_RESET] = { 0x0210, 25 },
  2057. [VFE_CSI_RESET] = { 0x0210, 24 },
  2058. [MDP_RESET] = { 0x0210, 21 },
  2059. [AMP_RESET] = { 0x0210, 20 },
  2060. [JPEGD_RESET] = { 0x0210, 19 },
  2061. [CSI1_RESET] = { 0x0210, 18 },
  2062. [VPE_RESET] = { 0x0210, 17 },
  2063. [MMSS_FABRIC_RESET] = { 0x0210, 16 },
  2064. [VFE_RESET] = { 0x0210, 15 },
  2065. [GFX2D0_RESET] = { 0x0210, 14 },
  2066. [GFX2D1_RESET] = { 0x0210, 13 },
  2067. [GFX3D_RESET] = { 0x0210, 12 },
  2068. [HDMI_RESET] = { 0x0210, 11 },
  2069. [MMSS_IMEM_RESET] = { 0x0210, 10 },
  2070. [IJPEG_RESET] = { 0x0210, 9 },
  2071. [CSI0_RESET] = { 0x0210, 8 },
  2072. [DSI_RESET] = { 0x0210, 7 },
  2073. [VCODEC_RESET] = { 0x0210, 6 },
  2074. [MDP_TV_RESET] = { 0x0210, 4 },
  2075. [MDP_VSYNC_RESET] = { 0x0210, 3 },
  2076. [ROT_RESET] = { 0x0210, 2 },
  2077. [TV_HDMI_RESET] = { 0x0210, 1 },
  2078. [TV_ENC_RESET] = { 0x0210 },
  2079. [CSI2_RESET] = { 0x0214, 2 },
  2080. [CSI_RDI1_RESET] = { 0x0214, 1 },
  2081. [CSI_RDI2_RESET] = { 0x0214 },
  2082. };
  2083. static const struct regmap_config mmcc_msm8960_regmap_config = {
  2084. .reg_bits = 32,
  2085. .reg_stride = 4,
  2086. .val_bits = 32,
  2087. .max_register = 0x334,
  2088. .fast_io = true,
  2089. };
  2090. static const struct of_device_id mmcc_msm8960_match_table[] = {
  2091. { .compatible = "qcom,mmcc-msm8960" },
  2092. { }
  2093. };
  2094. MODULE_DEVICE_TABLE(of, mmcc_msm8960_match_table);
  2095. struct qcom_cc {
  2096. struct qcom_reset_controller reset;
  2097. struct clk_onecell_data data;
  2098. struct clk *clks[];
  2099. };
  2100. static int mmcc_msm8960_probe(struct platform_device *pdev)
  2101. {
  2102. void __iomem *base;
  2103. struct resource *res;
  2104. int i, ret;
  2105. struct device *dev = &pdev->dev;
  2106. struct clk *clk;
  2107. struct clk_onecell_data *data;
  2108. struct clk **clks;
  2109. struct regmap *regmap;
  2110. size_t num_clks;
  2111. struct qcom_reset_controller *reset;
  2112. struct qcom_cc *cc;
  2113. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  2114. base = devm_ioremap_resource(dev, res);
  2115. if (IS_ERR(base))
  2116. return PTR_ERR(base);
  2117. regmap = devm_regmap_init_mmio(dev, base, &mmcc_msm8960_regmap_config);
  2118. if (IS_ERR(regmap))
  2119. return PTR_ERR(regmap);
  2120. num_clks = ARRAY_SIZE(mmcc_msm8960_clks);
  2121. cc = devm_kzalloc(dev, sizeof(*cc) + sizeof(*clks) * num_clks,
  2122. GFP_KERNEL);
  2123. if (!cc)
  2124. return -ENOMEM;
  2125. clks = cc->clks;
  2126. data = &cc->data;
  2127. data->clks = clks;
  2128. data->clk_num = num_clks;
  2129. for (i = 0; i < num_clks; i++) {
  2130. if (!mmcc_msm8960_clks[i])
  2131. continue;
  2132. clk = devm_clk_register_regmap(dev, mmcc_msm8960_clks[i]);
  2133. if (IS_ERR(clk))
  2134. return PTR_ERR(clk);
  2135. clks[i] = clk;
  2136. }
  2137. ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get, data);
  2138. if (ret)
  2139. return ret;
  2140. reset = &cc->reset;
  2141. reset->rcdev.of_node = dev->of_node;
  2142. reset->rcdev.ops = &qcom_reset_ops,
  2143. reset->rcdev.owner = THIS_MODULE,
  2144. reset->rcdev.nr_resets = ARRAY_SIZE(mmcc_msm8960_resets),
  2145. reset->regmap = regmap;
  2146. reset->reset_map = mmcc_msm8960_resets,
  2147. platform_set_drvdata(pdev, &reset->rcdev);
  2148. ret = reset_controller_register(&reset->rcdev);
  2149. if (ret)
  2150. of_clk_del_provider(dev->of_node);
  2151. return ret;
  2152. }
  2153. static int mmcc_msm8960_remove(struct platform_device *pdev)
  2154. {
  2155. of_clk_del_provider(pdev->dev.of_node);
  2156. reset_controller_unregister(platform_get_drvdata(pdev));
  2157. return 0;
  2158. }
  2159. static struct platform_driver mmcc_msm8960_driver = {
  2160. .probe = mmcc_msm8960_probe,
  2161. .remove = mmcc_msm8960_remove,
  2162. .driver = {
  2163. .name = "mmcc-msm8960",
  2164. .owner = THIS_MODULE,
  2165. .of_match_table = mmcc_msm8960_match_table,
  2166. },
  2167. };
  2168. module_platform_driver(mmcc_msm8960_driver);
  2169. MODULE_DESCRIPTION("QCOM MMCC MSM8960 Driver");
  2170. MODULE_LICENSE("GPL v2");
  2171. MODULE_ALIAS("platform:mmcc-msm8960");