gcc-sdm845.c 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/bitops.h>
  7. #include <linux/err.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/module.h>
  10. #include <linux/of.h>
  11. #include <linux/of_device.h>
  12. #include <linux/clk-provider.h>
  13. #include <linux/regmap.h>
  14. #include <linux/reset-controller.h>
  15. #include <dt-bindings/clock/qcom,gcc-sdm845.h>
  16. #include "common.h"
  17. #include "clk-regmap.h"
  18. #include "clk-pll.h"
  19. #include "clk-rcg.h"
  20. #include "clk-branch.h"
  21. #include "clk-alpha-pll.h"
  22. #include "gdsc.h"
  23. #include "reset.h"
  24. #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
  25. enum {
  26. P_BI_TCXO,
  27. P_AUD_REF_CLK,
  28. P_CORE_BI_PLL_TEST_SE,
  29. P_GPLL0_OUT_EVEN,
  30. P_GPLL0_OUT_MAIN,
  31. P_GPLL4_OUT_MAIN,
  32. P_SLEEP_CLK,
  33. };
  34. static const struct parent_map gcc_parent_map_0[] = {
  35. { P_BI_TCXO, 0 },
  36. { P_GPLL0_OUT_MAIN, 1 },
  37. { P_GPLL0_OUT_EVEN, 6 },
  38. { P_CORE_BI_PLL_TEST_SE, 7 },
  39. };
  40. static const char * const gcc_parent_names_0[] = {
  41. "bi_tcxo",
  42. "gpll0",
  43. "gpll0_out_even",
  44. "core_bi_pll_test_se",
  45. };
  46. static const struct parent_map gcc_parent_map_1[] = {
  47. { P_BI_TCXO, 0 },
  48. { P_GPLL0_OUT_MAIN, 1 },
  49. { P_SLEEP_CLK, 5 },
  50. { P_GPLL0_OUT_EVEN, 6 },
  51. { P_CORE_BI_PLL_TEST_SE, 7 },
  52. };
  53. static const char * const gcc_parent_names_1[] = {
  54. "bi_tcxo",
  55. "gpll0",
  56. "core_pi_sleep_clk",
  57. "gpll0_out_even",
  58. "core_bi_pll_test_se",
  59. };
  60. static const struct parent_map gcc_parent_map_2[] = {
  61. { P_BI_TCXO, 0 },
  62. { P_SLEEP_CLK, 5 },
  63. { P_CORE_BI_PLL_TEST_SE, 7 },
  64. };
  65. static const char * const gcc_parent_names_2[] = {
  66. "bi_tcxo",
  67. "core_pi_sleep_clk",
  68. "core_bi_pll_test_se",
  69. };
  70. static const struct parent_map gcc_parent_map_3[] = {
  71. { P_BI_TCXO, 0 },
  72. { P_GPLL0_OUT_MAIN, 1 },
  73. { P_CORE_BI_PLL_TEST_SE, 7 },
  74. };
  75. static const char * const gcc_parent_names_3[] = {
  76. "bi_tcxo",
  77. "gpll0",
  78. "core_bi_pll_test_se",
  79. };
  80. static const struct parent_map gcc_parent_map_4[] = {
  81. { P_BI_TCXO, 0 },
  82. { P_CORE_BI_PLL_TEST_SE, 7 },
  83. };
  84. static const char * const gcc_parent_names_4[] = {
  85. "bi_tcxo",
  86. "core_bi_pll_test_se",
  87. };
  88. static const struct parent_map gcc_parent_map_5[] = {
  89. { P_BI_TCXO, 0 },
  90. { P_GPLL0_OUT_MAIN, 1 },
  91. { P_GPLL4_OUT_MAIN, 5 },
  92. { P_GPLL0_OUT_EVEN, 6 },
  93. { P_CORE_BI_PLL_TEST_SE, 7 },
  94. };
  95. static const char * const gcc_parent_names_5[] = {
  96. "bi_tcxo",
  97. "gpll0",
  98. "gpll4",
  99. "gpll0_out_even",
  100. "core_bi_pll_test_se",
  101. };
  102. static const struct parent_map gcc_parent_map_6[] = {
  103. { P_BI_TCXO, 0 },
  104. { P_GPLL0_OUT_MAIN, 1 },
  105. { P_AUD_REF_CLK, 2 },
  106. { P_GPLL0_OUT_EVEN, 6 },
  107. { P_CORE_BI_PLL_TEST_SE, 7 },
  108. };
  109. static const char * const gcc_parent_names_6[] = {
  110. "bi_tcxo",
  111. "gpll0",
  112. "aud_ref_clk",
  113. "gpll0_out_even",
  114. "core_bi_pll_test_se",
  115. };
  116. static const char * const gcc_parent_names_7[] = {
  117. "bi_tcxo",
  118. "gpll0",
  119. "gpll0_out_even",
  120. "core_bi_pll_test_se",
  121. };
  122. static const char * const gcc_parent_names_8[] = {
  123. "bi_tcxo",
  124. "gpll0",
  125. "core_bi_pll_test_se",
  126. };
  127. static const struct parent_map gcc_parent_map_10[] = {
  128. { P_BI_TCXO, 0 },
  129. { P_GPLL0_OUT_MAIN, 1 },
  130. { P_GPLL4_OUT_MAIN, 5 },
  131. { P_GPLL0_OUT_EVEN, 6 },
  132. { P_CORE_BI_PLL_TEST_SE, 7 },
  133. };
  134. static const char * const gcc_parent_names_10[] = {
  135. "bi_tcxo",
  136. "gpll0",
  137. "gpll4",
  138. "gpll0_out_even",
  139. "core_bi_pll_test_se",
  140. };
  141. static struct clk_alpha_pll gpll0 = {
  142. .offset = 0x0,
  143. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  144. .clkr = {
  145. .enable_reg = 0x52000,
  146. .enable_mask = BIT(0),
  147. .hw.init = &(struct clk_init_data){
  148. .name = "gpll0",
  149. .parent_names = (const char *[]){ "bi_tcxo" },
  150. .num_parents = 1,
  151. .ops = &clk_alpha_pll_fixed_fabia_ops,
  152. },
  153. },
  154. };
  155. static struct clk_alpha_pll gpll4 = {
  156. .offset = 0x76000,
  157. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  158. .clkr = {
  159. .enable_reg = 0x52000,
  160. .enable_mask = BIT(4),
  161. .hw.init = &(struct clk_init_data){
  162. .name = "gpll4",
  163. .parent_names = (const char *[]){ "bi_tcxo" },
  164. .num_parents = 1,
  165. .ops = &clk_alpha_pll_fixed_fabia_ops,
  166. },
  167. },
  168. };
  169. static const struct clk_div_table post_div_table_fabia_even[] = {
  170. { 0x0, 1 },
  171. { 0x1, 2 },
  172. { 0x3, 4 },
  173. { 0x7, 8 },
  174. { }
  175. };
  176. static struct clk_alpha_pll_postdiv gpll0_out_even = {
  177. .offset = 0x0,
  178. .post_div_shift = 8,
  179. .post_div_table = post_div_table_fabia_even,
  180. .num_post_div = ARRAY_SIZE(post_div_table_fabia_even),
  181. .width = 4,
  182. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  183. .clkr.hw.init = &(struct clk_init_data){
  184. .name = "gpll0_out_even",
  185. .parent_names = (const char *[]){ "gpll0" },
  186. .num_parents = 1,
  187. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  188. },
  189. };
  190. static const struct freq_tbl ftbl_gcc_cpuss_ahb_clk_src[] = {
  191. F(19200000, P_BI_TCXO, 1, 0, 0),
  192. { }
  193. };
  194. static struct clk_rcg2 gcc_cpuss_ahb_clk_src = {
  195. .cmd_rcgr = 0x48014,
  196. .mnd_width = 0,
  197. .hid_width = 5,
  198. .parent_map = gcc_parent_map_0,
  199. .freq_tbl = ftbl_gcc_cpuss_ahb_clk_src,
  200. .clkr.hw.init = &(struct clk_init_data){
  201. .name = "gcc_cpuss_ahb_clk_src",
  202. .parent_names = gcc_parent_names_7,
  203. .num_parents = 4,
  204. .ops = &clk_rcg2_ops,
  205. },
  206. };
  207. static const struct freq_tbl ftbl_gcc_cpuss_rbcpr_clk_src[] = {
  208. F(19200000, P_BI_TCXO, 1, 0, 0),
  209. { }
  210. };
  211. static struct clk_rcg2 gcc_cpuss_rbcpr_clk_src = {
  212. .cmd_rcgr = 0x4815c,
  213. .mnd_width = 0,
  214. .hid_width = 5,
  215. .parent_map = gcc_parent_map_3,
  216. .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
  217. .clkr.hw.init = &(struct clk_init_data){
  218. .name = "gcc_cpuss_rbcpr_clk_src",
  219. .parent_names = gcc_parent_names_8,
  220. .num_parents = 3,
  221. .ops = &clk_rcg2_ops,
  222. },
  223. };
  224. static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = {
  225. F(19200000, P_BI_TCXO, 1, 0, 0),
  226. F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
  227. F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
  228. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  229. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  230. { }
  231. };
  232. static struct clk_rcg2 gcc_gp1_clk_src = {
  233. .cmd_rcgr = 0x64004,
  234. .mnd_width = 8,
  235. .hid_width = 5,
  236. .parent_map = gcc_parent_map_1,
  237. .freq_tbl = ftbl_gcc_gp1_clk_src,
  238. .clkr.hw.init = &(struct clk_init_data){
  239. .name = "gcc_gp1_clk_src",
  240. .parent_names = gcc_parent_names_1,
  241. .num_parents = 5,
  242. .ops = &clk_rcg2_ops,
  243. },
  244. };
  245. static struct clk_rcg2 gcc_gp2_clk_src = {
  246. .cmd_rcgr = 0x65004,
  247. .mnd_width = 8,
  248. .hid_width = 5,
  249. .parent_map = gcc_parent_map_1,
  250. .freq_tbl = ftbl_gcc_gp1_clk_src,
  251. .clkr.hw.init = &(struct clk_init_data){
  252. .name = "gcc_gp2_clk_src",
  253. .parent_names = gcc_parent_names_1,
  254. .num_parents = 5,
  255. .ops = &clk_rcg2_ops,
  256. },
  257. };
  258. static struct clk_rcg2 gcc_gp3_clk_src = {
  259. .cmd_rcgr = 0x66004,
  260. .mnd_width = 8,
  261. .hid_width = 5,
  262. .parent_map = gcc_parent_map_1,
  263. .freq_tbl = ftbl_gcc_gp1_clk_src,
  264. .clkr.hw.init = &(struct clk_init_data){
  265. .name = "gcc_gp3_clk_src",
  266. .parent_names = gcc_parent_names_1,
  267. .num_parents = 5,
  268. .ops = &clk_rcg2_ops,
  269. },
  270. };
  271. static const struct freq_tbl ftbl_gcc_pcie_0_aux_clk_src[] = {
  272. F(9600000, P_BI_TCXO, 2, 0, 0),
  273. F(19200000, P_BI_TCXO, 1, 0, 0),
  274. { }
  275. };
  276. static struct clk_rcg2 gcc_pcie_0_aux_clk_src = {
  277. .cmd_rcgr = 0x6b028,
  278. .mnd_width = 16,
  279. .hid_width = 5,
  280. .parent_map = gcc_parent_map_2,
  281. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  282. .clkr.hw.init = &(struct clk_init_data){
  283. .name = "gcc_pcie_0_aux_clk_src",
  284. .parent_names = gcc_parent_names_2,
  285. .num_parents = 3,
  286. .ops = &clk_rcg2_ops,
  287. },
  288. };
  289. static struct clk_rcg2 gcc_pcie_1_aux_clk_src = {
  290. .cmd_rcgr = 0x8d028,
  291. .mnd_width = 16,
  292. .hid_width = 5,
  293. .parent_map = gcc_parent_map_2,
  294. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  295. .clkr.hw.init = &(struct clk_init_data){
  296. .name = "gcc_pcie_1_aux_clk_src",
  297. .parent_names = gcc_parent_names_2,
  298. .num_parents = 3,
  299. .ops = &clk_rcg2_ops,
  300. },
  301. };
  302. static const struct freq_tbl ftbl_gcc_pcie_phy_refgen_clk_src[] = {
  303. F(19200000, P_BI_TCXO, 1, 0, 0),
  304. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  305. { }
  306. };
  307. static struct clk_rcg2 gcc_pcie_phy_refgen_clk_src = {
  308. .cmd_rcgr = 0x6f014,
  309. .mnd_width = 0,
  310. .hid_width = 5,
  311. .parent_map = gcc_parent_map_0,
  312. .freq_tbl = ftbl_gcc_pcie_phy_refgen_clk_src,
  313. .clkr.hw.init = &(struct clk_init_data){
  314. .name = "gcc_pcie_phy_refgen_clk_src",
  315. .parent_names = gcc_parent_names_0,
  316. .num_parents = 4,
  317. .ops = &clk_rcg2_ops,
  318. },
  319. };
  320. static const struct freq_tbl ftbl_gcc_pdm2_clk_src[] = {
  321. F(9600000, P_BI_TCXO, 2, 0, 0),
  322. F(19200000, P_BI_TCXO, 1, 0, 0),
  323. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  324. { }
  325. };
  326. static struct clk_rcg2 gcc_pdm2_clk_src = {
  327. .cmd_rcgr = 0x33010,
  328. .mnd_width = 0,
  329. .hid_width = 5,
  330. .parent_map = gcc_parent_map_0,
  331. .freq_tbl = ftbl_gcc_pdm2_clk_src,
  332. .clkr.hw.init = &(struct clk_init_data){
  333. .name = "gcc_pdm2_clk_src",
  334. .parent_names = gcc_parent_names_0,
  335. .num_parents = 4,
  336. .ops = &clk_rcg2_ops,
  337. },
  338. };
  339. static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = {
  340. F(7372800, P_GPLL0_OUT_EVEN, 1, 384, 15625),
  341. F(14745600, P_GPLL0_OUT_EVEN, 1, 768, 15625),
  342. F(19200000, P_BI_TCXO, 1, 0, 0),
  343. F(29491200, P_GPLL0_OUT_EVEN, 1, 1536, 15625),
  344. F(32000000, P_GPLL0_OUT_EVEN, 1, 8, 75),
  345. F(48000000, P_GPLL0_OUT_EVEN, 1, 4, 25),
  346. F(64000000, P_GPLL0_OUT_EVEN, 1, 16, 75),
  347. F(80000000, P_GPLL0_OUT_EVEN, 1, 4, 15),
  348. F(96000000, P_GPLL0_OUT_EVEN, 1, 8, 25),
  349. F(100000000, P_GPLL0_OUT_EVEN, 3, 0, 0),
  350. F(102400000, P_GPLL0_OUT_EVEN, 1, 128, 375),
  351. F(112000000, P_GPLL0_OUT_EVEN, 1, 28, 75),
  352. F(117964800, P_GPLL0_OUT_EVEN, 1, 6144, 15625),
  353. F(120000000, P_GPLL0_OUT_EVEN, 2.5, 0, 0),
  354. F(128000000, P_GPLL0_OUT_MAIN, 1, 16, 75),
  355. { }
  356. };
  357. static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
  358. .cmd_rcgr = 0x17034,
  359. .mnd_width = 16,
  360. .hid_width = 5,
  361. .parent_map = gcc_parent_map_0,
  362. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  363. .clkr.hw.init = &(struct clk_init_data){
  364. .name = "gcc_qupv3_wrap0_s0_clk_src",
  365. .parent_names = gcc_parent_names_0,
  366. .num_parents = 4,
  367. .ops = &clk_rcg2_shared_ops,
  368. },
  369. };
  370. static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
  371. .cmd_rcgr = 0x17164,
  372. .mnd_width = 16,
  373. .hid_width = 5,
  374. .parent_map = gcc_parent_map_0,
  375. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  376. .clkr.hw.init = &(struct clk_init_data){
  377. .name = "gcc_qupv3_wrap0_s1_clk_src",
  378. .parent_names = gcc_parent_names_0,
  379. .num_parents = 4,
  380. .ops = &clk_rcg2_shared_ops,
  381. },
  382. };
  383. static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
  384. .cmd_rcgr = 0x17294,
  385. .mnd_width = 16,
  386. .hid_width = 5,
  387. .parent_map = gcc_parent_map_0,
  388. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  389. .clkr.hw.init = &(struct clk_init_data){
  390. .name = "gcc_qupv3_wrap0_s2_clk_src",
  391. .parent_names = gcc_parent_names_0,
  392. .num_parents = 4,
  393. .ops = &clk_rcg2_shared_ops,
  394. },
  395. };
  396. static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
  397. .cmd_rcgr = 0x173c4,
  398. .mnd_width = 16,
  399. .hid_width = 5,
  400. .parent_map = gcc_parent_map_0,
  401. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  402. .clkr.hw.init = &(struct clk_init_data){
  403. .name = "gcc_qupv3_wrap0_s3_clk_src",
  404. .parent_names = gcc_parent_names_0,
  405. .num_parents = 4,
  406. .ops = &clk_rcg2_shared_ops,
  407. },
  408. };
  409. static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
  410. .cmd_rcgr = 0x174f4,
  411. .mnd_width = 16,
  412. .hid_width = 5,
  413. .parent_map = gcc_parent_map_0,
  414. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  415. .clkr.hw.init = &(struct clk_init_data){
  416. .name = "gcc_qupv3_wrap0_s4_clk_src",
  417. .parent_names = gcc_parent_names_0,
  418. .num_parents = 4,
  419. .ops = &clk_rcg2_shared_ops,
  420. },
  421. };
  422. static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
  423. .cmd_rcgr = 0x17624,
  424. .mnd_width = 16,
  425. .hid_width = 5,
  426. .parent_map = gcc_parent_map_0,
  427. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  428. .clkr.hw.init = &(struct clk_init_data){
  429. .name = "gcc_qupv3_wrap0_s5_clk_src",
  430. .parent_names = gcc_parent_names_0,
  431. .num_parents = 4,
  432. .ops = &clk_rcg2_shared_ops,
  433. },
  434. };
  435. static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
  436. .cmd_rcgr = 0x17754,
  437. .mnd_width = 16,
  438. .hid_width = 5,
  439. .parent_map = gcc_parent_map_0,
  440. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  441. .clkr.hw.init = &(struct clk_init_data){
  442. .name = "gcc_qupv3_wrap0_s6_clk_src",
  443. .parent_names = gcc_parent_names_0,
  444. .num_parents = 4,
  445. .ops = &clk_rcg2_shared_ops,
  446. },
  447. };
  448. static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
  449. .cmd_rcgr = 0x17884,
  450. .mnd_width = 16,
  451. .hid_width = 5,
  452. .parent_map = gcc_parent_map_0,
  453. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  454. .clkr.hw.init = &(struct clk_init_data){
  455. .name = "gcc_qupv3_wrap0_s7_clk_src",
  456. .parent_names = gcc_parent_names_0,
  457. .num_parents = 4,
  458. .ops = &clk_rcg2_shared_ops,
  459. },
  460. };
  461. static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
  462. .cmd_rcgr = 0x18018,
  463. .mnd_width = 16,
  464. .hid_width = 5,
  465. .parent_map = gcc_parent_map_0,
  466. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  467. .clkr.hw.init = &(struct clk_init_data){
  468. .name = "gcc_qupv3_wrap1_s0_clk_src",
  469. .parent_names = gcc_parent_names_0,
  470. .num_parents = 4,
  471. .ops = &clk_rcg2_shared_ops,
  472. },
  473. };
  474. static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
  475. .cmd_rcgr = 0x18148,
  476. .mnd_width = 16,
  477. .hid_width = 5,
  478. .parent_map = gcc_parent_map_0,
  479. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  480. .clkr.hw.init = &(struct clk_init_data){
  481. .name = "gcc_qupv3_wrap1_s1_clk_src",
  482. .parent_names = gcc_parent_names_0,
  483. .num_parents = 4,
  484. .ops = &clk_rcg2_shared_ops,
  485. },
  486. };
  487. static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
  488. .cmd_rcgr = 0x18278,
  489. .mnd_width = 16,
  490. .hid_width = 5,
  491. .parent_map = gcc_parent_map_0,
  492. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  493. .clkr.hw.init = &(struct clk_init_data){
  494. .name = "gcc_qupv3_wrap1_s2_clk_src",
  495. .parent_names = gcc_parent_names_0,
  496. .num_parents = 4,
  497. .ops = &clk_rcg2_shared_ops,
  498. },
  499. };
  500. static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
  501. .cmd_rcgr = 0x183a8,
  502. .mnd_width = 16,
  503. .hid_width = 5,
  504. .parent_map = gcc_parent_map_0,
  505. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  506. .clkr.hw.init = &(struct clk_init_data){
  507. .name = "gcc_qupv3_wrap1_s3_clk_src",
  508. .parent_names = gcc_parent_names_0,
  509. .num_parents = 4,
  510. .ops = &clk_rcg2_shared_ops,
  511. },
  512. };
  513. static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
  514. .cmd_rcgr = 0x184d8,
  515. .mnd_width = 16,
  516. .hid_width = 5,
  517. .parent_map = gcc_parent_map_0,
  518. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  519. .clkr.hw.init = &(struct clk_init_data){
  520. .name = "gcc_qupv3_wrap1_s4_clk_src",
  521. .parent_names = gcc_parent_names_0,
  522. .num_parents = 4,
  523. .ops = &clk_rcg2_shared_ops,
  524. },
  525. };
  526. static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
  527. .cmd_rcgr = 0x18608,
  528. .mnd_width = 16,
  529. .hid_width = 5,
  530. .parent_map = gcc_parent_map_0,
  531. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  532. .clkr.hw.init = &(struct clk_init_data){
  533. .name = "gcc_qupv3_wrap1_s5_clk_src",
  534. .parent_names = gcc_parent_names_0,
  535. .num_parents = 4,
  536. .ops = &clk_rcg2_shared_ops,
  537. },
  538. };
  539. static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
  540. .cmd_rcgr = 0x18738,
  541. .mnd_width = 16,
  542. .hid_width = 5,
  543. .parent_map = gcc_parent_map_0,
  544. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  545. .clkr.hw.init = &(struct clk_init_data){
  546. .name = "gcc_qupv3_wrap1_s6_clk_src",
  547. .parent_names = gcc_parent_names_0,
  548. .num_parents = 4,
  549. .ops = &clk_rcg2_shared_ops,
  550. },
  551. };
  552. static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
  553. .cmd_rcgr = 0x18868,
  554. .mnd_width = 16,
  555. .hid_width = 5,
  556. .parent_map = gcc_parent_map_0,
  557. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  558. .clkr.hw.init = &(struct clk_init_data){
  559. .name = "gcc_qupv3_wrap1_s7_clk_src",
  560. .parent_names = gcc_parent_names_0,
  561. .num_parents = 4,
  562. .ops = &clk_rcg2_shared_ops,
  563. },
  564. };
  565. static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
  566. F(400000, P_BI_TCXO, 12, 1, 4),
  567. F(9600000, P_BI_TCXO, 2, 0, 0),
  568. F(19200000, P_BI_TCXO, 1, 0, 0),
  569. F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
  570. F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
  571. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  572. F(201500000, P_GPLL4_OUT_MAIN, 4, 0, 0),
  573. { }
  574. };
  575. static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
  576. .cmd_rcgr = 0x1400c,
  577. .mnd_width = 8,
  578. .hid_width = 5,
  579. .parent_map = gcc_parent_map_10,
  580. .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src,
  581. .clkr.hw.init = &(struct clk_init_data){
  582. .name = "gcc_sdcc2_apps_clk_src",
  583. .parent_names = gcc_parent_names_10,
  584. .num_parents = 5,
  585. .ops = &clk_rcg2_ops,
  586. },
  587. };
  588. static const struct freq_tbl ftbl_gcc_sdcc4_apps_clk_src[] = {
  589. F(400000, P_BI_TCXO, 12, 1, 4),
  590. F(9600000, P_BI_TCXO, 2, 0, 0),
  591. F(19200000, P_BI_TCXO, 1, 0, 0),
  592. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  593. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  594. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  595. { }
  596. };
  597. static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
  598. .cmd_rcgr = 0x1600c,
  599. .mnd_width = 8,
  600. .hid_width = 5,
  601. .parent_map = gcc_parent_map_0,
  602. .freq_tbl = ftbl_gcc_sdcc4_apps_clk_src,
  603. .clkr.hw.init = &(struct clk_init_data){
  604. .name = "gcc_sdcc4_apps_clk_src",
  605. .parent_names = gcc_parent_names_0,
  606. .num_parents = 4,
  607. .ops = &clk_rcg2_ops,
  608. },
  609. };
  610. static const struct freq_tbl ftbl_gcc_tsif_ref_clk_src[] = {
  611. F(105495, P_BI_TCXO, 2, 1, 91),
  612. { }
  613. };
  614. static struct clk_rcg2 gcc_tsif_ref_clk_src = {
  615. .cmd_rcgr = 0x36010,
  616. .mnd_width = 8,
  617. .hid_width = 5,
  618. .parent_map = gcc_parent_map_6,
  619. .freq_tbl = ftbl_gcc_tsif_ref_clk_src,
  620. .clkr.hw.init = &(struct clk_init_data){
  621. .name = "gcc_tsif_ref_clk_src",
  622. .parent_names = gcc_parent_names_6,
  623. .num_parents = 5,
  624. .ops = &clk_rcg2_ops,
  625. },
  626. };
  627. static const struct freq_tbl ftbl_gcc_ufs_card_axi_clk_src[] = {
  628. F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
  629. F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
  630. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  631. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  632. F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
  633. { }
  634. };
  635. static struct clk_rcg2 gcc_ufs_card_axi_clk_src = {
  636. .cmd_rcgr = 0x7501c,
  637. .mnd_width = 8,
  638. .hid_width = 5,
  639. .parent_map = gcc_parent_map_0,
  640. .freq_tbl = ftbl_gcc_ufs_card_axi_clk_src,
  641. .clkr.hw.init = &(struct clk_init_data){
  642. .name = "gcc_ufs_card_axi_clk_src",
  643. .parent_names = gcc_parent_names_0,
  644. .num_parents = 4,
  645. .ops = &clk_rcg2_shared_ops,
  646. },
  647. };
  648. static const struct freq_tbl ftbl_gcc_ufs_card_ice_core_clk_src[] = {
  649. F(37500000, P_GPLL0_OUT_EVEN, 8, 0, 0),
  650. F(75000000, P_GPLL0_OUT_EVEN, 4, 0, 0),
  651. F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
  652. F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
  653. { }
  654. };
  655. static struct clk_rcg2 gcc_ufs_card_ice_core_clk_src = {
  656. .cmd_rcgr = 0x7505c,
  657. .mnd_width = 0,
  658. .hid_width = 5,
  659. .parent_map = gcc_parent_map_0,
  660. .freq_tbl = ftbl_gcc_ufs_card_ice_core_clk_src,
  661. .clkr.hw.init = &(struct clk_init_data){
  662. .name = "gcc_ufs_card_ice_core_clk_src",
  663. .parent_names = gcc_parent_names_0,
  664. .num_parents = 4,
  665. .ops = &clk_rcg2_shared_ops,
  666. },
  667. };
  668. static struct clk_rcg2 gcc_ufs_card_phy_aux_clk_src = {
  669. .cmd_rcgr = 0x75090,
  670. .mnd_width = 0,
  671. .hid_width = 5,
  672. .parent_map = gcc_parent_map_4,
  673. .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
  674. .clkr.hw.init = &(struct clk_init_data){
  675. .name = "gcc_ufs_card_phy_aux_clk_src",
  676. .parent_names = gcc_parent_names_4,
  677. .num_parents = 2,
  678. .ops = &clk_rcg2_ops,
  679. },
  680. };
  681. static const struct freq_tbl ftbl_gcc_ufs_card_unipro_core_clk_src[] = {
  682. F(37500000, P_GPLL0_OUT_EVEN, 8, 0, 0),
  683. F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
  684. F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
  685. { }
  686. };
  687. static struct clk_rcg2 gcc_ufs_card_unipro_core_clk_src = {
  688. .cmd_rcgr = 0x75074,
  689. .mnd_width = 0,
  690. .hid_width = 5,
  691. .parent_map = gcc_parent_map_0,
  692. .freq_tbl = ftbl_gcc_ufs_card_unipro_core_clk_src,
  693. .clkr.hw.init = &(struct clk_init_data){
  694. .name = "gcc_ufs_card_unipro_core_clk_src",
  695. .parent_names = gcc_parent_names_0,
  696. .num_parents = 4,
  697. .ops = &clk_rcg2_shared_ops,
  698. },
  699. };
  700. static const struct freq_tbl ftbl_gcc_ufs_phy_axi_clk_src[] = {
  701. F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
  702. F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
  703. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  704. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  705. F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
  706. { }
  707. };
  708. static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = {
  709. .cmd_rcgr = 0x7701c,
  710. .mnd_width = 8,
  711. .hid_width = 5,
  712. .parent_map = gcc_parent_map_0,
  713. .freq_tbl = ftbl_gcc_ufs_phy_axi_clk_src,
  714. .clkr.hw.init = &(struct clk_init_data){
  715. .name = "gcc_ufs_phy_axi_clk_src",
  716. .parent_names = gcc_parent_names_0,
  717. .num_parents = 4,
  718. .ops = &clk_rcg2_shared_ops,
  719. },
  720. };
  721. static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = {
  722. .cmd_rcgr = 0x7705c,
  723. .mnd_width = 0,
  724. .hid_width = 5,
  725. .parent_map = gcc_parent_map_0,
  726. .freq_tbl = ftbl_gcc_ufs_card_ice_core_clk_src,
  727. .clkr.hw.init = &(struct clk_init_data){
  728. .name = "gcc_ufs_phy_ice_core_clk_src",
  729. .parent_names = gcc_parent_names_0,
  730. .num_parents = 4,
  731. .ops = &clk_rcg2_shared_ops,
  732. },
  733. };
  734. static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = {
  735. .cmd_rcgr = 0x77090,
  736. .mnd_width = 0,
  737. .hid_width = 5,
  738. .parent_map = gcc_parent_map_4,
  739. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  740. .clkr.hw.init = &(struct clk_init_data){
  741. .name = "gcc_ufs_phy_phy_aux_clk_src",
  742. .parent_names = gcc_parent_names_4,
  743. .num_parents = 2,
  744. .ops = &clk_rcg2_shared_ops,
  745. },
  746. };
  747. static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = {
  748. .cmd_rcgr = 0x77074,
  749. .mnd_width = 0,
  750. .hid_width = 5,
  751. .parent_map = gcc_parent_map_0,
  752. .freq_tbl = ftbl_gcc_ufs_card_unipro_core_clk_src,
  753. .clkr.hw.init = &(struct clk_init_data){
  754. .name = "gcc_ufs_phy_unipro_core_clk_src",
  755. .parent_names = gcc_parent_names_0,
  756. .num_parents = 4,
  757. .ops = &clk_rcg2_shared_ops,
  758. },
  759. };
  760. static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = {
  761. F(33333333, P_GPLL0_OUT_EVEN, 9, 0, 0),
  762. F(66666667, P_GPLL0_OUT_EVEN, 4.5, 0, 0),
  763. F(133333333, P_GPLL0_OUT_MAIN, 4.5, 0, 0),
  764. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  765. F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
  766. { }
  767. };
  768. static struct clk_rcg2 gcc_usb30_prim_master_clk_src = {
  769. .cmd_rcgr = 0xf018,
  770. .mnd_width = 8,
  771. .hid_width = 5,
  772. .parent_map = gcc_parent_map_0,
  773. .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src,
  774. .clkr.hw.init = &(struct clk_init_data){
  775. .name = "gcc_usb30_prim_master_clk_src",
  776. .parent_names = gcc_parent_names_0,
  777. .num_parents = 4,
  778. .ops = &clk_rcg2_shared_ops,
  779. },
  780. };
  781. static const struct freq_tbl ftbl_gcc_usb30_prim_mock_utmi_clk_src[] = {
  782. F(19200000, P_BI_TCXO, 1, 0, 0),
  783. F(20000000, P_GPLL0_OUT_EVEN, 15, 0, 0),
  784. F(40000000, P_GPLL0_OUT_EVEN, 7.5, 0, 0),
  785. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  786. { }
  787. };
  788. static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = {
  789. .cmd_rcgr = 0xf030,
  790. .mnd_width = 0,
  791. .hid_width = 5,
  792. .parent_map = gcc_parent_map_0,
  793. .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src,
  794. .clkr.hw.init = &(struct clk_init_data){
  795. .name = "gcc_usb30_prim_mock_utmi_clk_src",
  796. .parent_names = gcc_parent_names_0,
  797. .num_parents = 4,
  798. .ops = &clk_rcg2_shared_ops,
  799. },
  800. };
  801. static struct clk_rcg2 gcc_usb30_sec_master_clk_src = {
  802. .cmd_rcgr = 0x10018,
  803. .mnd_width = 8,
  804. .hid_width = 5,
  805. .parent_map = gcc_parent_map_0,
  806. .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src,
  807. .clkr.hw.init = &(struct clk_init_data){
  808. .name = "gcc_usb30_sec_master_clk_src",
  809. .parent_names = gcc_parent_names_0,
  810. .num_parents = 4,
  811. .ops = &clk_rcg2_ops,
  812. },
  813. };
  814. static struct clk_rcg2 gcc_usb30_sec_mock_utmi_clk_src = {
  815. .cmd_rcgr = 0x10030,
  816. .mnd_width = 0,
  817. .hid_width = 5,
  818. .parent_map = gcc_parent_map_0,
  819. .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src,
  820. .clkr.hw.init = &(struct clk_init_data){
  821. .name = "gcc_usb30_sec_mock_utmi_clk_src",
  822. .parent_names = gcc_parent_names_0,
  823. .num_parents = 4,
  824. .ops = &clk_rcg2_ops,
  825. },
  826. };
  827. static struct clk_rcg2 gcc_usb3_prim_phy_aux_clk_src = {
  828. .cmd_rcgr = 0xf05c,
  829. .mnd_width = 0,
  830. .hid_width = 5,
  831. .parent_map = gcc_parent_map_2,
  832. .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
  833. .clkr.hw.init = &(struct clk_init_data){
  834. .name = "gcc_usb3_prim_phy_aux_clk_src",
  835. .parent_names = gcc_parent_names_2,
  836. .num_parents = 3,
  837. .ops = &clk_rcg2_ops,
  838. },
  839. };
  840. static struct clk_rcg2 gcc_usb3_sec_phy_aux_clk_src = {
  841. .cmd_rcgr = 0x1005c,
  842. .mnd_width = 0,
  843. .hid_width = 5,
  844. .parent_map = gcc_parent_map_2,
  845. .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
  846. .clkr.hw.init = &(struct clk_init_data){
  847. .name = "gcc_usb3_sec_phy_aux_clk_src",
  848. .parent_names = gcc_parent_names_2,
  849. .num_parents = 3,
  850. .ops = &clk_rcg2_shared_ops,
  851. },
  852. };
  853. static struct clk_rcg2 gcc_vs_ctrl_clk_src = {
  854. .cmd_rcgr = 0x7a030,
  855. .mnd_width = 0,
  856. .hid_width = 5,
  857. .parent_map = gcc_parent_map_3,
  858. .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
  859. .clkr.hw.init = &(struct clk_init_data){
  860. .name = "gcc_vs_ctrl_clk_src",
  861. .parent_names = gcc_parent_names_3,
  862. .num_parents = 3,
  863. .ops = &clk_rcg2_ops,
  864. },
  865. };
  866. static const struct freq_tbl ftbl_gcc_vsensor_clk_src[] = {
  867. F(19200000, P_BI_TCXO, 1, 0, 0),
  868. F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
  869. F(600000000, P_GPLL0_OUT_MAIN, 1, 0, 0),
  870. { }
  871. };
  872. static struct clk_rcg2 gcc_vsensor_clk_src = {
  873. .cmd_rcgr = 0x7a018,
  874. .mnd_width = 0,
  875. .hid_width = 5,
  876. .parent_map = gcc_parent_map_3,
  877. .freq_tbl = ftbl_gcc_vsensor_clk_src,
  878. .clkr.hw.init = &(struct clk_init_data){
  879. .name = "gcc_vsensor_clk_src",
  880. .parent_names = gcc_parent_names_8,
  881. .num_parents = 3,
  882. .ops = &clk_rcg2_ops,
  883. },
  884. };
  885. static struct clk_branch gcc_aggre_noc_pcie_tbu_clk = {
  886. .halt_reg = 0x90014,
  887. .halt_check = BRANCH_HALT,
  888. .clkr = {
  889. .enable_reg = 0x90014,
  890. .enable_mask = BIT(0),
  891. .hw.init = &(struct clk_init_data){
  892. .name = "gcc_aggre_noc_pcie_tbu_clk",
  893. .ops = &clk_branch2_ops,
  894. },
  895. },
  896. };
  897. static struct clk_branch gcc_aggre_ufs_card_axi_clk = {
  898. .halt_reg = 0x82028,
  899. .halt_check = BRANCH_HALT,
  900. .hwcg_reg = 0x82028,
  901. .hwcg_bit = 1,
  902. .clkr = {
  903. .enable_reg = 0x82028,
  904. .enable_mask = BIT(0),
  905. .hw.init = &(struct clk_init_data){
  906. .name = "gcc_aggre_ufs_card_axi_clk",
  907. .parent_names = (const char *[]){
  908. "gcc_ufs_card_axi_clk_src",
  909. },
  910. .num_parents = 1,
  911. .flags = CLK_SET_RATE_PARENT,
  912. .ops = &clk_branch2_ops,
  913. },
  914. },
  915. };
  916. static struct clk_branch gcc_aggre_ufs_phy_axi_clk = {
  917. .halt_reg = 0x82024,
  918. .halt_check = BRANCH_HALT,
  919. .hwcg_reg = 0x82024,
  920. .hwcg_bit = 1,
  921. .clkr = {
  922. .enable_reg = 0x82024,
  923. .enable_mask = BIT(0),
  924. .hw.init = &(struct clk_init_data){
  925. .name = "gcc_aggre_ufs_phy_axi_clk",
  926. .parent_names = (const char *[]){
  927. "gcc_ufs_phy_axi_clk_src",
  928. },
  929. .num_parents = 1,
  930. .flags = CLK_SET_RATE_PARENT,
  931. .ops = &clk_branch2_ops,
  932. },
  933. },
  934. };
  935. static struct clk_branch gcc_aggre_usb3_prim_axi_clk = {
  936. .halt_reg = 0x8201c,
  937. .halt_check = BRANCH_HALT,
  938. .clkr = {
  939. .enable_reg = 0x8201c,
  940. .enable_mask = BIT(0),
  941. .hw.init = &(struct clk_init_data){
  942. .name = "gcc_aggre_usb3_prim_axi_clk",
  943. .parent_names = (const char *[]){
  944. "gcc_usb30_prim_master_clk_src",
  945. },
  946. .num_parents = 1,
  947. .flags = CLK_SET_RATE_PARENT,
  948. .ops = &clk_branch2_ops,
  949. },
  950. },
  951. };
  952. static struct clk_branch gcc_aggre_usb3_sec_axi_clk = {
  953. .halt_reg = 0x82020,
  954. .halt_check = BRANCH_HALT,
  955. .clkr = {
  956. .enable_reg = 0x82020,
  957. .enable_mask = BIT(0),
  958. .hw.init = &(struct clk_init_data){
  959. .name = "gcc_aggre_usb3_sec_axi_clk",
  960. .parent_names = (const char *[]){
  961. "gcc_usb30_sec_master_clk_src",
  962. },
  963. .num_parents = 1,
  964. .flags = CLK_SET_RATE_PARENT,
  965. .ops = &clk_branch2_ops,
  966. },
  967. },
  968. };
  969. static struct clk_branch gcc_apc_vs_clk = {
  970. .halt_reg = 0x7a050,
  971. .halt_check = BRANCH_HALT,
  972. .clkr = {
  973. .enable_reg = 0x7a050,
  974. .enable_mask = BIT(0),
  975. .hw.init = &(struct clk_init_data){
  976. .name = "gcc_apc_vs_clk",
  977. .parent_names = (const char *[]){
  978. "gcc_vsensor_clk_src",
  979. },
  980. .num_parents = 1,
  981. .flags = CLK_SET_RATE_PARENT,
  982. .ops = &clk_branch2_ops,
  983. },
  984. },
  985. };
  986. static struct clk_branch gcc_boot_rom_ahb_clk = {
  987. .halt_reg = 0x38004,
  988. .halt_check = BRANCH_HALT_VOTED,
  989. .hwcg_reg = 0x38004,
  990. .hwcg_bit = 1,
  991. .clkr = {
  992. .enable_reg = 0x52004,
  993. .enable_mask = BIT(10),
  994. .hw.init = &(struct clk_init_data){
  995. .name = "gcc_boot_rom_ahb_clk",
  996. .ops = &clk_branch2_ops,
  997. },
  998. },
  999. };
  1000. static struct clk_branch gcc_camera_ahb_clk = {
  1001. .halt_reg = 0xb008,
  1002. .halt_check = BRANCH_HALT,
  1003. .hwcg_reg = 0xb008,
  1004. .hwcg_bit = 1,
  1005. .clkr = {
  1006. .enable_reg = 0xb008,
  1007. .enable_mask = BIT(0),
  1008. .hw.init = &(struct clk_init_data){
  1009. .name = "gcc_camera_ahb_clk",
  1010. .ops = &clk_branch2_ops,
  1011. },
  1012. },
  1013. };
  1014. static struct clk_branch gcc_camera_axi_clk = {
  1015. .halt_reg = 0xb020,
  1016. .halt_check = BRANCH_VOTED,
  1017. .clkr = {
  1018. .enable_reg = 0xb020,
  1019. .enable_mask = BIT(0),
  1020. .hw.init = &(struct clk_init_data){
  1021. .name = "gcc_camera_axi_clk",
  1022. .ops = &clk_branch2_ops,
  1023. },
  1024. },
  1025. };
  1026. static struct clk_branch gcc_camera_xo_clk = {
  1027. .halt_reg = 0xb02c,
  1028. .halt_check = BRANCH_HALT,
  1029. .clkr = {
  1030. .enable_reg = 0xb02c,
  1031. .enable_mask = BIT(0),
  1032. .hw.init = &(struct clk_init_data){
  1033. .name = "gcc_camera_xo_clk",
  1034. .ops = &clk_branch2_ops,
  1035. },
  1036. },
  1037. };
  1038. static struct clk_branch gcc_ce1_ahb_clk = {
  1039. .halt_reg = 0x4100c,
  1040. .halt_check = BRANCH_HALT_VOTED,
  1041. .hwcg_reg = 0x4100c,
  1042. .hwcg_bit = 1,
  1043. .clkr = {
  1044. .enable_reg = 0x52004,
  1045. .enable_mask = BIT(3),
  1046. .hw.init = &(struct clk_init_data){
  1047. .name = "gcc_ce1_ahb_clk",
  1048. .ops = &clk_branch2_ops,
  1049. },
  1050. },
  1051. };
  1052. static struct clk_branch gcc_ce1_axi_clk = {
  1053. .halt_reg = 0x41008,
  1054. .halt_check = BRANCH_HALT_VOTED,
  1055. .clkr = {
  1056. .enable_reg = 0x52004,
  1057. .enable_mask = BIT(4),
  1058. .hw.init = &(struct clk_init_data){
  1059. .name = "gcc_ce1_axi_clk",
  1060. .ops = &clk_branch2_ops,
  1061. },
  1062. },
  1063. };
  1064. static struct clk_branch gcc_ce1_clk = {
  1065. .halt_reg = 0x41004,
  1066. .halt_check = BRANCH_HALT_VOTED,
  1067. .clkr = {
  1068. .enable_reg = 0x52004,
  1069. .enable_mask = BIT(5),
  1070. .hw.init = &(struct clk_init_data){
  1071. .name = "gcc_ce1_clk",
  1072. .ops = &clk_branch2_ops,
  1073. },
  1074. },
  1075. };
  1076. static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = {
  1077. .halt_reg = 0x502c,
  1078. .halt_check = BRANCH_HALT,
  1079. .clkr = {
  1080. .enable_reg = 0x502c,
  1081. .enable_mask = BIT(0),
  1082. .hw.init = &(struct clk_init_data){
  1083. .name = "gcc_cfg_noc_usb3_prim_axi_clk",
  1084. .parent_names = (const char *[]){
  1085. "gcc_usb30_prim_master_clk_src",
  1086. },
  1087. .num_parents = 1,
  1088. .flags = CLK_SET_RATE_PARENT,
  1089. .ops = &clk_branch2_ops,
  1090. },
  1091. },
  1092. };
  1093. static struct clk_branch gcc_cfg_noc_usb3_sec_axi_clk = {
  1094. .halt_reg = 0x5030,
  1095. .halt_check = BRANCH_HALT,
  1096. .clkr = {
  1097. .enable_reg = 0x5030,
  1098. .enable_mask = BIT(0),
  1099. .hw.init = &(struct clk_init_data){
  1100. .name = "gcc_cfg_noc_usb3_sec_axi_clk",
  1101. .parent_names = (const char *[]){
  1102. "gcc_usb30_sec_master_clk_src",
  1103. },
  1104. .num_parents = 1,
  1105. .flags = CLK_SET_RATE_PARENT,
  1106. .ops = &clk_branch2_ops,
  1107. },
  1108. },
  1109. };
  1110. static struct clk_branch gcc_cpuss_ahb_clk = {
  1111. .halt_reg = 0x48000,
  1112. .halt_check = BRANCH_HALT_VOTED,
  1113. .clkr = {
  1114. .enable_reg = 0x52004,
  1115. .enable_mask = BIT(21),
  1116. .hw.init = &(struct clk_init_data){
  1117. .name = "gcc_cpuss_ahb_clk",
  1118. .parent_names = (const char *[]){
  1119. "gcc_cpuss_ahb_clk_src",
  1120. },
  1121. .num_parents = 1,
  1122. .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
  1123. .ops = &clk_branch2_ops,
  1124. },
  1125. },
  1126. };
  1127. static struct clk_branch gcc_cpuss_rbcpr_clk = {
  1128. .halt_reg = 0x48008,
  1129. .halt_check = BRANCH_HALT,
  1130. .clkr = {
  1131. .enable_reg = 0x48008,
  1132. .enable_mask = BIT(0),
  1133. .hw.init = &(struct clk_init_data){
  1134. .name = "gcc_cpuss_rbcpr_clk",
  1135. .parent_names = (const char *[]){
  1136. "gcc_cpuss_rbcpr_clk_src",
  1137. },
  1138. .num_parents = 1,
  1139. .flags = CLK_SET_RATE_PARENT,
  1140. .ops = &clk_branch2_ops,
  1141. },
  1142. },
  1143. };
  1144. static struct clk_branch gcc_ddrss_gpu_axi_clk = {
  1145. .halt_reg = 0x44038,
  1146. .halt_check = BRANCH_VOTED,
  1147. .clkr = {
  1148. .enable_reg = 0x44038,
  1149. .enable_mask = BIT(0),
  1150. .hw.init = &(struct clk_init_data){
  1151. .name = "gcc_ddrss_gpu_axi_clk",
  1152. .ops = &clk_branch2_ops,
  1153. },
  1154. },
  1155. };
  1156. static struct clk_branch gcc_disp_ahb_clk = {
  1157. .halt_reg = 0xb00c,
  1158. .halt_check = BRANCH_HALT,
  1159. .hwcg_reg = 0xb00c,
  1160. .hwcg_bit = 1,
  1161. .clkr = {
  1162. .enable_reg = 0xb00c,
  1163. .enable_mask = BIT(0),
  1164. .hw.init = &(struct clk_init_data){
  1165. .name = "gcc_disp_ahb_clk",
  1166. .ops = &clk_branch2_ops,
  1167. },
  1168. },
  1169. };
  1170. static struct clk_branch gcc_disp_axi_clk = {
  1171. .halt_reg = 0xb024,
  1172. .halt_check = BRANCH_VOTED,
  1173. .clkr = {
  1174. .enable_reg = 0xb024,
  1175. .enable_mask = BIT(0),
  1176. .hw.init = &(struct clk_init_data){
  1177. .name = "gcc_disp_axi_clk",
  1178. .ops = &clk_branch2_ops,
  1179. },
  1180. },
  1181. };
  1182. static struct clk_branch gcc_disp_gpll0_clk_src = {
  1183. .halt_check = BRANCH_HALT_DELAY,
  1184. .clkr = {
  1185. .enable_reg = 0x52004,
  1186. .enable_mask = BIT(18),
  1187. .hw.init = &(struct clk_init_data){
  1188. .name = "gcc_disp_gpll0_clk_src",
  1189. .parent_names = (const char *[]){
  1190. "gpll0",
  1191. },
  1192. .num_parents = 1,
  1193. .ops = &clk_branch2_ops,
  1194. },
  1195. },
  1196. };
  1197. static struct clk_branch gcc_disp_gpll0_div_clk_src = {
  1198. .halt_check = BRANCH_HALT_DELAY,
  1199. .clkr = {
  1200. .enable_reg = 0x52004,
  1201. .enable_mask = BIT(19),
  1202. .hw.init = &(struct clk_init_data){
  1203. .name = "gcc_disp_gpll0_div_clk_src",
  1204. .parent_names = (const char *[]){
  1205. "gpll0_out_even",
  1206. },
  1207. .num_parents = 1,
  1208. .ops = &clk_branch2_ops,
  1209. },
  1210. },
  1211. };
  1212. static struct clk_branch gcc_disp_xo_clk = {
  1213. .halt_reg = 0xb030,
  1214. .halt_check = BRANCH_HALT,
  1215. .clkr = {
  1216. .enable_reg = 0xb030,
  1217. .enable_mask = BIT(0),
  1218. .hw.init = &(struct clk_init_data){
  1219. .name = "gcc_disp_xo_clk",
  1220. .ops = &clk_branch2_ops,
  1221. },
  1222. },
  1223. };
  1224. static struct clk_branch gcc_gp1_clk = {
  1225. .halt_reg = 0x64000,
  1226. .halt_check = BRANCH_HALT,
  1227. .clkr = {
  1228. .enable_reg = 0x64000,
  1229. .enable_mask = BIT(0),
  1230. .hw.init = &(struct clk_init_data){
  1231. .name = "gcc_gp1_clk",
  1232. .parent_names = (const char *[]){
  1233. "gcc_gp1_clk_src",
  1234. },
  1235. .num_parents = 1,
  1236. .flags = CLK_SET_RATE_PARENT,
  1237. .ops = &clk_branch2_ops,
  1238. },
  1239. },
  1240. };
  1241. static struct clk_branch gcc_gp2_clk = {
  1242. .halt_reg = 0x65000,
  1243. .halt_check = BRANCH_HALT,
  1244. .clkr = {
  1245. .enable_reg = 0x65000,
  1246. .enable_mask = BIT(0),
  1247. .hw.init = &(struct clk_init_data){
  1248. .name = "gcc_gp2_clk",
  1249. .parent_names = (const char *[]){
  1250. "gcc_gp2_clk_src",
  1251. },
  1252. .num_parents = 1,
  1253. .flags = CLK_SET_RATE_PARENT,
  1254. .ops = &clk_branch2_ops,
  1255. },
  1256. },
  1257. };
  1258. static struct clk_branch gcc_gp3_clk = {
  1259. .halt_reg = 0x66000,
  1260. .halt_check = BRANCH_HALT,
  1261. .clkr = {
  1262. .enable_reg = 0x66000,
  1263. .enable_mask = BIT(0),
  1264. .hw.init = &(struct clk_init_data){
  1265. .name = "gcc_gp3_clk",
  1266. .parent_names = (const char *[]){
  1267. "gcc_gp3_clk_src",
  1268. },
  1269. .num_parents = 1,
  1270. .flags = CLK_SET_RATE_PARENT,
  1271. .ops = &clk_branch2_ops,
  1272. },
  1273. },
  1274. };
  1275. static struct clk_branch gcc_gpu_cfg_ahb_clk = {
  1276. .halt_reg = 0x71004,
  1277. .halt_check = BRANCH_HALT,
  1278. .hwcg_reg = 0x71004,
  1279. .hwcg_bit = 1,
  1280. .clkr = {
  1281. .enable_reg = 0x71004,
  1282. .enable_mask = BIT(0),
  1283. .hw.init = &(struct clk_init_data){
  1284. .name = "gcc_gpu_cfg_ahb_clk",
  1285. .ops = &clk_branch2_ops,
  1286. },
  1287. },
  1288. };
  1289. static struct clk_branch gcc_gpu_gpll0_clk_src = {
  1290. .halt_check = BRANCH_HALT_DELAY,
  1291. .clkr = {
  1292. .enable_reg = 0x52004,
  1293. .enable_mask = BIT(15),
  1294. .hw.init = &(struct clk_init_data){
  1295. .name = "gcc_gpu_gpll0_clk_src",
  1296. .parent_names = (const char *[]){
  1297. "gpll0",
  1298. },
  1299. .num_parents = 1,
  1300. .ops = &clk_branch2_ops,
  1301. },
  1302. },
  1303. };
  1304. static struct clk_branch gcc_gpu_gpll0_div_clk_src = {
  1305. .halt_check = BRANCH_HALT_DELAY,
  1306. .clkr = {
  1307. .enable_reg = 0x52004,
  1308. .enable_mask = BIT(16),
  1309. .hw.init = &(struct clk_init_data){
  1310. .name = "gcc_gpu_gpll0_div_clk_src",
  1311. .parent_names = (const char *[]){
  1312. "gpll0_out_even",
  1313. },
  1314. .num_parents = 1,
  1315. .ops = &clk_branch2_ops,
  1316. },
  1317. },
  1318. };
  1319. static struct clk_branch gcc_gpu_iref_clk = {
  1320. .halt_reg = 0x8c010,
  1321. .halt_check = BRANCH_HALT,
  1322. .clkr = {
  1323. .enable_reg = 0x8c010,
  1324. .enable_mask = BIT(0),
  1325. .hw.init = &(struct clk_init_data){
  1326. .name = "gcc_gpu_iref_clk",
  1327. .ops = &clk_branch2_ops,
  1328. },
  1329. },
  1330. };
  1331. static struct clk_branch gcc_gpu_memnoc_gfx_clk = {
  1332. .halt_reg = 0x7100c,
  1333. .halt_check = BRANCH_VOTED,
  1334. .clkr = {
  1335. .enable_reg = 0x7100c,
  1336. .enable_mask = BIT(0),
  1337. .hw.init = &(struct clk_init_data){
  1338. .name = "gcc_gpu_memnoc_gfx_clk",
  1339. .ops = &clk_branch2_ops,
  1340. },
  1341. },
  1342. };
  1343. static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = {
  1344. .halt_reg = 0x71018,
  1345. .halt_check = BRANCH_HALT,
  1346. .clkr = {
  1347. .enable_reg = 0x71018,
  1348. .enable_mask = BIT(0),
  1349. .hw.init = &(struct clk_init_data){
  1350. .name = "gcc_gpu_snoc_dvm_gfx_clk",
  1351. .ops = &clk_branch2_ops,
  1352. },
  1353. },
  1354. };
  1355. static struct clk_branch gcc_gpu_vs_clk = {
  1356. .halt_reg = 0x7a04c,
  1357. .halt_check = BRANCH_HALT,
  1358. .clkr = {
  1359. .enable_reg = 0x7a04c,
  1360. .enable_mask = BIT(0),
  1361. .hw.init = &(struct clk_init_data){
  1362. .name = "gcc_gpu_vs_clk",
  1363. .parent_names = (const char *[]){
  1364. "gcc_vsensor_clk_src",
  1365. },
  1366. .num_parents = 1,
  1367. .flags = CLK_SET_RATE_PARENT,
  1368. .ops = &clk_branch2_ops,
  1369. },
  1370. },
  1371. };
  1372. static struct clk_branch gcc_mss_axis2_clk = {
  1373. .halt_reg = 0x8a008,
  1374. .halt_check = BRANCH_HALT,
  1375. .clkr = {
  1376. .enable_reg = 0x8a008,
  1377. .enable_mask = BIT(0),
  1378. .hw.init = &(struct clk_init_data){
  1379. .name = "gcc_mss_axis2_clk",
  1380. .ops = &clk_branch2_ops,
  1381. },
  1382. },
  1383. };
  1384. static struct clk_branch gcc_mss_cfg_ahb_clk = {
  1385. .halt_reg = 0x8a000,
  1386. .halt_check = BRANCH_HALT,
  1387. .hwcg_reg = 0x8a000,
  1388. .hwcg_bit = 1,
  1389. .clkr = {
  1390. .enable_reg = 0x8a000,
  1391. .enable_mask = BIT(0),
  1392. .hw.init = &(struct clk_init_data){
  1393. .name = "gcc_mss_cfg_ahb_clk",
  1394. .ops = &clk_branch2_ops,
  1395. },
  1396. },
  1397. };
  1398. static struct clk_branch gcc_mss_gpll0_div_clk_src = {
  1399. .halt_check = BRANCH_HALT_DELAY,
  1400. .clkr = {
  1401. .enable_reg = 0x52004,
  1402. .enable_mask = BIT(17),
  1403. .hw.init = &(struct clk_init_data){
  1404. .name = "gcc_mss_gpll0_div_clk_src",
  1405. .ops = &clk_branch2_ops,
  1406. },
  1407. },
  1408. };
  1409. static struct clk_branch gcc_mss_mfab_axis_clk = {
  1410. .halt_reg = 0x8a004,
  1411. .halt_check = BRANCH_VOTED,
  1412. .hwcg_reg = 0x8a004,
  1413. .hwcg_bit = 1,
  1414. .clkr = {
  1415. .enable_reg = 0x8a004,
  1416. .enable_mask = BIT(0),
  1417. .hw.init = &(struct clk_init_data){
  1418. .name = "gcc_mss_mfab_axis_clk",
  1419. .ops = &clk_branch2_ops,
  1420. },
  1421. },
  1422. };
  1423. static struct clk_branch gcc_mss_q6_memnoc_axi_clk = {
  1424. .halt_reg = 0x8a154,
  1425. .halt_check = BRANCH_VOTED,
  1426. .clkr = {
  1427. .enable_reg = 0x8a154,
  1428. .enable_mask = BIT(0),
  1429. .hw.init = &(struct clk_init_data){
  1430. .name = "gcc_mss_q6_memnoc_axi_clk",
  1431. .ops = &clk_branch2_ops,
  1432. },
  1433. },
  1434. };
  1435. static struct clk_branch gcc_mss_snoc_axi_clk = {
  1436. .halt_reg = 0x8a150,
  1437. .halt_check = BRANCH_HALT,
  1438. .clkr = {
  1439. .enable_reg = 0x8a150,
  1440. .enable_mask = BIT(0),
  1441. .hw.init = &(struct clk_init_data){
  1442. .name = "gcc_mss_snoc_axi_clk",
  1443. .ops = &clk_branch2_ops,
  1444. },
  1445. },
  1446. };
  1447. static struct clk_branch gcc_mss_vs_clk = {
  1448. .halt_reg = 0x7a048,
  1449. .halt_check = BRANCH_HALT,
  1450. .clkr = {
  1451. .enable_reg = 0x7a048,
  1452. .enable_mask = BIT(0),
  1453. .hw.init = &(struct clk_init_data){
  1454. .name = "gcc_mss_vs_clk",
  1455. .parent_names = (const char *[]){
  1456. "gcc_vsensor_clk_src",
  1457. },
  1458. .num_parents = 1,
  1459. .flags = CLK_SET_RATE_PARENT,
  1460. .ops = &clk_branch2_ops,
  1461. },
  1462. },
  1463. };
  1464. static struct clk_branch gcc_pcie_0_aux_clk = {
  1465. .halt_reg = 0x6b01c,
  1466. .halt_check = BRANCH_HALT_VOTED,
  1467. .clkr = {
  1468. .enable_reg = 0x5200c,
  1469. .enable_mask = BIT(3),
  1470. .hw.init = &(struct clk_init_data){
  1471. .name = "gcc_pcie_0_aux_clk",
  1472. .parent_names = (const char *[]){
  1473. "gcc_pcie_0_aux_clk_src",
  1474. },
  1475. .num_parents = 1,
  1476. .flags = CLK_SET_RATE_PARENT,
  1477. .ops = &clk_branch2_ops,
  1478. },
  1479. },
  1480. };
  1481. static struct clk_branch gcc_pcie_0_cfg_ahb_clk = {
  1482. .halt_reg = 0x6b018,
  1483. .halt_check = BRANCH_HALT_VOTED,
  1484. .hwcg_reg = 0x6b018,
  1485. .hwcg_bit = 1,
  1486. .clkr = {
  1487. .enable_reg = 0x5200c,
  1488. .enable_mask = BIT(2),
  1489. .hw.init = &(struct clk_init_data){
  1490. .name = "gcc_pcie_0_cfg_ahb_clk",
  1491. .ops = &clk_branch2_ops,
  1492. },
  1493. },
  1494. };
  1495. static struct clk_branch gcc_pcie_0_clkref_clk = {
  1496. .halt_reg = 0x8c00c,
  1497. .halt_check = BRANCH_HALT,
  1498. .clkr = {
  1499. .enable_reg = 0x8c00c,
  1500. .enable_mask = BIT(0),
  1501. .hw.init = &(struct clk_init_data){
  1502. .name = "gcc_pcie_0_clkref_clk",
  1503. .ops = &clk_branch2_ops,
  1504. },
  1505. },
  1506. };
  1507. static struct clk_branch gcc_pcie_0_mstr_axi_clk = {
  1508. .halt_reg = 0x6b014,
  1509. .halt_check = BRANCH_HALT_VOTED,
  1510. .clkr = {
  1511. .enable_reg = 0x5200c,
  1512. .enable_mask = BIT(1),
  1513. .hw.init = &(struct clk_init_data){
  1514. .name = "gcc_pcie_0_mstr_axi_clk",
  1515. .ops = &clk_branch2_ops,
  1516. },
  1517. },
  1518. };
  1519. static struct clk_branch gcc_pcie_0_pipe_clk = {
  1520. .halt_check = BRANCH_HALT_SKIP,
  1521. .clkr = {
  1522. .enable_reg = 0x5200c,
  1523. .enable_mask = BIT(4),
  1524. .hw.init = &(struct clk_init_data){
  1525. .name = "gcc_pcie_0_pipe_clk",
  1526. .ops = &clk_branch2_ops,
  1527. },
  1528. },
  1529. };
  1530. static struct clk_branch gcc_pcie_0_slv_axi_clk = {
  1531. .halt_reg = 0x6b010,
  1532. .halt_check = BRANCH_HALT_VOTED,
  1533. .hwcg_reg = 0x6b010,
  1534. .hwcg_bit = 1,
  1535. .clkr = {
  1536. .enable_reg = 0x5200c,
  1537. .enable_mask = BIT(0),
  1538. .hw.init = &(struct clk_init_data){
  1539. .name = "gcc_pcie_0_slv_axi_clk",
  1540. .ops = &clk_branch2_ops,
  1541. },
  1542. },
  1543. };
  1544. static struct clk_branch gcc_pcie_0_slv_q2a_axi_clk = {
  1545. .halt_reg = 0x6b00c,
  1546. .halt_check = BRANCH_HALT_VOTED,
  1547. .clkr = {
  1548. .enable_reg = 0x5200c,
  1549. .enable_mask = BIT(5),
  1550. .hw.init = &(struct clk_init_data){
  1551. .name = "gcc_pcie_0_slv_q2a_axi_clk",
  1552. .ops = &clk_branch2_ops,
  1553. },
  1554. },
  1555. };
  1556. static struct clk_branch gcc_pcie_1_aux_clk = {
  1557. .halt_reg = 0x8d01c,
  1558. .halt_check = BRANCH_HALT_VOTED,
  1559. .clkr = {
  1560. .enable_reg = 0x52004,
  1561. .enable_mask = BIT(29),
  1562. .hw.init = &(struct clk_init_data){
  1563. .name = "gcc_pcie_1_aux_clk",
  1564. .parent_names = (const char *[]){
  1565. "gcc_pcie_1_aux_clk_src",
  1566. },
  1567. .num_parents = 1,
  1568. .flags = CLK_SET_RATE_PARENT,
  1569. .ops = &clk_branch2_ops,
  1570. },
  1571. },
  1572. };
  1573. static struct clk_branch gcc_pcie_1_cfg_ahb_clk = {
  1574. .halt_reg = 0x8d018,
  1575. .halt_check = BRANCH_HALT_VOTED,
  1576. .hwcg_reg = 0x8d018,
  1577. .hwcg_bit = 1,
  1578. .clkr = {
  1579. .enable_reg = 0x52004,
  1580. .enable_mask = BIT(28),
  1581. .hw.init = &(struct clk_init_data){
  1582. .name = "gcc_pcie_1_cfg_ahb_clk",
  1583. .ops = &clk_branch2_ops,
  1584. },
  1585. },
  1586. };
  1587. static struct clk_branch gcc_pcie_1_clkref_clk = {
  1588. .halt_reg = 0x8c02c,
  1589. .halt_check = BRANCH_HALT,
  1590. .clkr = {
  1591. .enable_reg = 0x8c02c,
  1592. .enable_mask = BIT(0),
  1593. .hw.init = &(struct clk_init_data){
  1594. .name = "gcc_pcie_1_clkref_clk",
  1595. .ops = &clk_branch2_ops,
  1596. },
  1597. },
  1598. };
  1599. static struct clk_branch gcc_pcie_1_mstr_axi_clk = {
  1600. .halt_reg = 0x8d014,
  1601. .halt_check = BRANCH_HALT_VOTED,
  1602. .clkr = {
  1603. .enable_reg = 0x52004,
  1604. .enable_mask = BIT(27),
  1605. .hw.init = &(struct clk_init_data){
  1606. .name = "gcc_pcie_1_mstr_axi_clk",
  1607. .ops = &clk_branch2_ops,
  1608. },
  1609. },
  1610. };
  1611. static struct clk_branch gcc_pcie_1_pipe_clk = {
  1612. .halt_check = BRANCH_HALT_SKIP,
  1613. .clkr = {
  1614. .enable_reg = 0x52004,
  1615. .enable_mask = BIT(30),
  1616. .hw.init = &(struct clk_init_data){
  1617. .name = "gcc_pcie_1_pipe_clk",
  1618. .ops = &clk_branch2_ops,
  1619. },
  1620. },
  1621. };
  1622. static struct clk_branch gcc_pcie_1_slv_axi_clk = {
  1623. .halt_reg = 0x8d010,
  1624. .halt_check = BRANCH_HALT_VOTED,
  1625. .hwcg_reg = 0x8d010,
  1626. .hwcg_bit = 1,
  1627. .clkr = {
  1628. .enable_reg = 0x52004,
  1629. .enable_mask = BIT(26),
  1630. .hw.init = &(struct clk_init_data){
  1631. .name = "gcc_pcie_1_slv_axi_clk",
  1632. .ops = &clk_branch2_ops,
  1633. },
  1634. },
  1635. };
  1636. static struct clk_branch gcc_pcie_1_slv_q2a_axi_clk = {
  1637. .halt_reg = 0x8d00c,
  1638. .halt_check = BRANCH_HALT_VOTED,
  1639. .clkr = {
  1640. .enable_reg = 0x52004,
  1641. .enable_mask = BIT(25),
  1642. .hw.init = &(struct clk_init_data){
  1643. .name = "gcc_pcie_1_slv_q2a_axi_clk",
  1644. .ops = &clk_branch2_ops,
  1645. },
  1646. },
  1647. };
  1648. static struct clk_branch gcc_pcie_phy_aux_clk = {
  1649. .halt_reg = 0x6f004,
  1650. .halt_check = BRANCH_HALT,
  1651. .clkr = {
  1652. .enable_reg = 0x6f004,
  1653. .enable_mask = BIT(0),
  1654. .hw.init = &(struct clk_init_data){
  1655. .name = "gcc_pcie_phy_aux_clk",
  1656. .parent_names = (const char *[]){
  1657. "gcc_pcie_0_aux_clk_src",
  1658. },
  1659. .num_parents = 1,
  1660. .flags = CLK_SET_RATE_PARENT,
  1661. .ops = &clk_branch2_ops,
  1662. },
  1663. },
  1664. };
  1665. static struct clk_branch gcc_pcie_phy_refgen_clk = {
  1666. .halt_reg = 0x6f02c,
  1667. .halt_check = BRANCH_HALT,
  1668. .clkr = {
  1669. .enable_reg = 0x6f02c,
  1670. .enable_mask = BIT(0),
  1671. .hw.init = &(struct clk_init_data){
  1672. .name = "gcc_pcie_phy_refgen_clk",
  1673. .parent_names = (const char *[]){
  1674. "gcc_pcie_phy_refgen_clk_src",
  1675. },
  1676. .num_parents = 1,
  1677. .flags = CLK_SET_RATE_PARENT,
  1678. .ops = &clk_branch2_ops,
  1679. },
  1680. },
  1681. };
  1682. static struct clk_branch gcc_pdm2_clk = {
  1683. .halt_reg = 0x3300c,
  1684. .halt_check = BRANCH_HALT,
  1685. .clkr = {
  1686. .enable_reg = 0x3300c,
  1687. .enable_mask = BIT(0),
  1688. .hw.init = &(struct clk_init_data){
  1689. .name = "gcc_pdm2_clk",
  1690. .parent_names = (const char *[]){
  1691. "gcc_pdm2_clk_src",
  1692. },
  1693. .num_parents = 1,
  1694. .flags = CLK_SET_RATE_PARENT,
  1695. .ops = &clk_branch2_ops,
  1696. },
  1697. },
  1698. };
  1699. static struct clk_branch gcc_pdm_ahb_clk = {
  1700. .halt_reg = 0x33004,
  1701. .halt_check = BRANCH_HALT,
  1702. .hwcg_reg = 0x33004,
  1703. .hwcg_bit = 1,
  1704. .clkr = {
  1705. .enable_reg = 0x33004,
  1706. .enable_mask = BIT(0),
  1707. .hw.init = &(struct clk_init_data){
  1708. .name = "gcc_pdm_ahb_clk",
  1709. .ops = &clk_branch2_ops,
  1710. },
  1711. },
  1712. };
  1713. static struct clk_branch gcc_pdm_xo4_clk = {
  1714. .halt_reg = 0x33008,
  1715. .halt_check = BRANCH_HALT,
  1716. .clkr = {
  1717. .enable_reg = 0x33008,
  1718. .enable_mask = BIT(0),
  1719. .hw.init = &(struct clk_init_data){
  1720. .name = "gcc_pdm_xo4_clk",
  1721. .ops = &clk_branch2_ops,
  1722. },
  1723. },
  1724. };
  1725. static struct clk_branch gcc_prng_ahb_clk = {
  1726. .halt_reg = 0x34004,
  1727. .halt_check = BRANCH_HALT_VOTED,
  1728. .hwcg_reg = 0x34004,
  1729. .hwcg_bit = 1,
  1730. .clkr = {
  1731. .enable_reg = 0x52004,
  1732. .enable_mask = BIT(13),
  1733. .hw.init = &(struct clk_init_data){
  1734. .name = "gcc_prng_ahb_clk",
  1735. .ops = &clk_branch2_ops,
  1736. },
  1737. },
  1738. };
  1739. static struct clk_branch gcc_qmip_camera_ahb_clk = {
  1740. .halt_reg = 0xb014,
  1741. .halt_check = BRANCH_HALT,
  1742. .hwcg_reg = 0xb014,
  1743. .hwcg_bit = 1,
  1744. .clkr = {
  1745. .enable_reg = 0xb014,
  1746. .enable_mask = BIT(0),
  1747. .hw.init = &(struct clk_init_data){
  1748. .name = "gcc_qmip_camera_ahb_clk",
  1749. .ops = &clk_branch2_ops,
  1750. },
  1751. },
  1752. };
  1753. static struct clk_branch gcc_qmip_disp_ahb_clk = {
  1754. .halt_reg = 0xb018,
  1755. .halt_check = BRANCH_HALT,
  1756. .hwcg_reg = 0xb018,
  1757. .hwcg_bit = 1,
  1758. .clkr = {
  1759. .enable_reg = 0xb018,
  1760. .enable_mask = BIT(0),
  1761. .hw.init = &(struct clk_init_data){
  1762. .name = "gcc_qmip_disp_ahb_clk",
  1763. .ops = &clk_branch2_ops,
  1764. },
  1765. },
  1766. };
  1767. static struct clk_branch gcc_qmip_video_ahb_clk = {
  1768. .halt_reg = 0xb010,
  1769. .halt_check = BRANCH_HALT,
  1770. .hwcg_reg = 0xb010,
  1771. .hwcg_bit = 1,
  1772. .clkr = {
  1773. .enable_reg = 0xb010,
  1774. .enable_mask = BIT(0),
  1775. .hw.init = &(struct clk_init_data){
  1776. .name = "gcc_qmip_video_ahb_clk",
  1777. .ops = &clk_branch2_ops,
  1778. },
  1779. },
  1780. };
  1781. static struct clk_branch gcc_qupv3_wrap0_s0_clk = {
  1782. .halt_reg = 0x17030,
  1783. .halt_check = BRANCH_HALT_VOTED,
  1784. .clkr = {
  1785. .enable_reg = 0x5200c,
  1786. .enable_mask = BIT(10),
  1787. .hw.init = &(struct clk_init_data){
  1788. .name = "gcc_qupv3_wrap0_s0_clk",
  1789. .parent_names = (const char *[]){
  1790. "gcc_qupv3_wrap0_s0_clk_src",
  1791. },
  1792. .num_parents = 1,
  1793. .flags = CLK_SET_RATE_PARENT,
  1794. .ops = &clk_branch2_ops,
  1795. },
  1796. },
  1797. };
  1798. static struct clk_branch gcc_qupv3_wrap0_s1_clk = {
  1799. .halt_reg = 0x17160,
  1800. .halt_check = BRANCH_HALT_VOTED,
  1801. .clkr = {
  1802. .enable_reg = 0x5200c,
  1803. .enable_mask = BIT(11),
  1804. .hw.init = &(struct clk_init_data){
  1805. .name = "gcc_qupv3_wrap0_s1_clk",
  1806. .parent_names = (const char *[]){
  1807. "gcc_qupv3_wrap0_s1_clk_src",
  1808. },
  1809. .num_parents = 1,
  1810. .flags = CLK_SET_RATE_PARENT,
  1811. .ops = &clk_branch2_ops,
  1812. },
  1813. },
  1814. };
  1815. static struct clk_branch gcc_qupv3_wrap0_s2_clk = {
  1816. .halt_reg = 0x17290,
  1817. .halt_check = BRANCH_HALT_VOTED,
  1818. .clkr = {
  1819. .enable_reg = 0x5200c,
  1820. .enable_mask = BIT(12),
  1821. .hw.init = &(struct clk_init_data){
  1822. .name = "gcc_qupv3_wrap0_s2_clk",
  1823. .parent_names = (const char *[]){
  1824. "gcc_qupv3_wrap0_s2_clk_src",
  1825. },
  1826. .num_parents = 1,
  1827. .flags = CLK_SET_RATE_PARENT,
  1828. .ops = &clk_branch2_ops,
  1829. },
  1830. },
  1831. };
  1832. static struct clk_branch gcc_qupv3_wrap0_s3_clk = {
  1833. .halt_reg = 0x173c0,
  1834. .halt_check = BRANCH_HALT_VOTED,
  1835. .clkr = {
  1836. .enable_reg = 0x5200c,
  1837. .enable_mask = BIT(13),
  1838. .hw.init = &(struct clk_init_data){
  1839. .name = "gcc_qupv3_wrap0_s3_clk",
  1840. .parent_names = (const char *[]){
  1841. "gcc_qupv3_wrap0_s3_clk_src",
  1842. },
  1843. .num_parents = 1,
  1844. .flags = CLK_SET_RATE_PARENT,
  1845. .ops = &clk_branch2_ops,
  1846. },
  1847. },
  1848. };
  1849. static struct clk_branch gcc_qupv3_wrap0_s4_clk = {
  1850. .halt_reg = 0x174f0,
  1851. .halt_check = BRANCH_HALT_VOTED,
  1852. .clkr = {
  1853. .enable_reg = 0x5200c,
  1854. .enable_mask = BIT(14),
  1855. .hw.init = &(struct clk_init_data){
  1856. .name = "gcc_qupv3_wrap0_s4_clk",
  1857. .parent_names = (const char *[]){
  1858. "gcc_qupv3_wrap0_s4_clk_src",
  1859. },
  1860. .num_parents = 1,
  1861. .flags = CLK_SET_RATE_PARENT,
  1862. .ops = &clk_branch2_ops,
  1863. },
  1864. },
  1865. };
  1866. static struct clk_branch gcc_qupv3_wrap0_s5_clk = {
  1867. .halt_reg = 0x17620,
  1868. .halt_check = BRANCH_HALT_VOTED,
  1869. .clkr = {
  1870. .enable_reg = 0x5200c,
  1871. .enable_mask = BIT(15),
  1872. .hw.init = &(struct clk_init_data){
  1873. .name = "gcc_qupv3_wrap0_s5_clk",
  1874. .parent_names = (const char *[]){
  1875. "gcc_qupv3_wrap0_s5_clk_src",
  1876. },
  1877. .num_parents = 1,
  1878. .flags = CLK_SET_RATE_PARENT,
  1879. .ops = &clk_branch2_ops,
  1880. },
  1881. },
  1882. };
  1883. static struct clk_branch gcc_qupv3_wrap0_s6_clk = {
  1884. .halt_reg = 0x17750,
  1885. .halt_check = BRANCH_HALT_VOTED,
  1886. .clkr = {
  1887. .enable_reg = 0x5200c,
  1888. .enable_mask = BIT(16),
  1889. .hw.init = &(struct clk_init_data){
  1890. .name = "gcc_qupv3_wrap0_s6_clk",
  1891. .parent_names = (const char *[]){
  1892. "gcc_qupv3_wrap0_s6_clk_src",
  1893. },
  1894. .num_parents = 1,
  1895. .flags = CLK_SET_RATE_PARENT,
  1896. .ops = &clk_branch2_ops,
  1897. },
  1898. },
  1899. };
  1900. static struct clk_branch gcc_qupv3_wrap0_s7_clk = {
  1901. .halt_reg = 0x17880,
  1902. .halt_check = BRANCH_HALT_VOTED,
  1903. .clkr = {
  1904. .enable_reg = 0x5200c,
  1905. .enable_mask = BIT(17),
  1906. .hw.init = &(struct clk_init_data){
  1907. .name = "gcc_qupv3_wrap0_s7_clk",
  1908. .parent_names = (const char *[]){
  1909. "gcc_qupv3_wrap0_s7_clk_src",
  1910. },
  1911. .num_parents = 1,
  1912. .flags = CLK_SET_RATE_PARENT,
  1913. .ops = &clk_branch2_ops,
  1914. },
  1915. },
  1916. };
  1917. static struct clk_branch gcc_qupv3_wrap1_s0_clk = {
  1918. .halt_reg = 0x18014,
  1919. .halt_check = BRANCH_HALT_VOTED,
  1920. .clkr = {
  1921. .enable_reg = 0x5200c,
  1922. .enable_mask = BIT(22),
  1923. .hw.init = &(struct clk_init_data){
  1924. .name = "gcc_qupv3_wrap1_s0_clk",
  1925. .parent_names = (const char *[]){
  1926. "gcc_qupv3_wrap1_s0_clk_src",
  1927. },
  1928. .num_parents = 1,
  1929. .flags = CLK_SET_RATE_PARENT,
  1930. .ops = &clk_branch2_ops,
  1931. },
  1932. },
  1933. };
  1934. static struct clk_branch gcc_qupv3_wrap1_s1_clk = {
  1935. .halt_reg = 0x18144,
  1936. .halt_check = BRANCH_HALT_VOTED,
  1937. .clkr = {
  1938. .enable_reg = 0x5200c,
  1939. .enable_mask = BIT(23),
  1940. .hw.init = &(struct clk_init_data){
  1941. .name = "gcc_qupv3_wrap1_s1_clk",
  1942. .parent_names = (const char *[]){
  1943. "gcc_qupv3_wrap1_s1_clk_src",
  1944. },
  1945. .num_parents = 1,
  1946. .flags = CLK_SET_RATE_PARENT,
  1947. .ops = &clk_branch2_ops,
  1948. },
  1949. },
  1950. };
  1951. static struct clk_branch gcc_qupv3_wrap1_s2_clk = {
  1952. .halt_reg = 0x18274,
  1953. .halt_check = BRANCH_HALT_VOTED,
  1954. .clkr = {
  1955. .enable_reg = 0x5200c,
  1956. .enable_mask = BIT(24),
  1957. .hw.init = &(struct clk_init_data){
  1958. .name = "gcc_qupv3_wrap1_s2_clk",
  1959. .parent_names = (const char *[]){
  1960. "gcc_qupv3_wrap1_s2_clk_src",
  1961. },
  1962. .num_parents = 1,
  1963. .flags = CLK_SET_RATE_PARENT,
  1964. .ops = &clk_branch2_ops,
  1965. },
  1966. },
  1967. };
  1968. static struct clk_branch gcc_qupv3_wrap1_s3_clk = {
  1969. .halt_reg = 0x183a4,
  1970. .halt_check = BRANCH_HALT_VOTED,
  1971. .clkr = {
  1972. .enable_reg = 0x5200c,
  1973. .enable_mask = BIT(25),
  1974. .hw.init = &(struct clk_init_data){
  1975. .name = "gcc_qupv3_wrap1_s3_clk",
  1976. .parent_names = (const char *[]){
  1977. "gcc_qupv3_wrap1_s3_clk_src",
  1978. },
  1979. .num_parents = 1,
  1980. .flags = CLK_SET_RATE_PARENT,
  1981. .ops = &clk_branch2_ops,
  1982. },
  1983. },
  1984. };
  1985. static struct clk_branch gcc_qupv3_wrap1_s4_clk = {
  1986. .halt_reg = 0x184d4,
  1987. .halt_check = BRANCH_HALT_VOTED,
  1988. .clkr = {
  1989. .enable_reg = 0x5200c,
  1990. .enable_mask = BIT(26),
  1991. .hw.init = &(struct clk_init_data){
  1992. .name = "gcc_qupv3_wrap1_s4_clk",
  1993. .parent_names = (const char *[]){
  1994. "gcc_qupv3_wrap1_s4_clk_src",
  1995. },
  1996. .num_parents = 1,
  1997. .flags = CLK_SET_RATE_PARENT,
  1998. .ops = &clk_branch2_ops,
  1999. },
  2000. },
  2001. };
  2002. static struct clk_branch gcc_qupv3_wrap1_s5_clk = {
  2003. .halt_reg = 0x18604,
  2004. .halt_check = BRANCH_HALT_VOTED,
  2005. .clkr = {
  2006. .enable_reg = 0x5200c,
  2007. .enable_mask = BIT(27),
  2008. .hw.init = &(struct clk_init_data){
  2009. .name = "gcc_qupv3_wrap1_s5_clk",
  2010. .parent_names = (const char *[]){
  2011. "gcc_qupv3_wrap1_s5_clk_src",
  2012. },
  2013. .num_parents = 1,
  2014. .flags = CLK_SET_RATE_PARENT,
  2015. .ops = &clk_branch2_ops,
  2016. },
  2017. },
  2018. };
  2019. static struct clk_branch gcc_qupv3_wrap1_s6_clk = {
  2020. .halt_reg = 0x18734,
  2021. .halt_check = BRANCH_HALT_VOTED,
  2022. .clkr = {
  2023. .enable_reg = 0x5200c,
  2024. .enable_mask = BIT(28),
  2025. .hw.init = &(struct clk_init_data){
  2026. .name = "gcc_qupv3_wrap1_s6_clk",
  2027. .parent_names = (const char *[]){
  2028. "gcc_qupv3_wrap1_s6_clk_src",
  2029. },
  2030. .num_parents = 1,
  2031. .flags = CLK_SET_RATE_PARENT,
  2032. .ops = &clk_branch2_ops,
  2033. },
  2034. },
  2035. };
  2036. static struct clk_branch gcc_qupv3_wrap1_s7_clk = {
  2037. .halt_reg = 0x18864,
  2038. .halt_check = BRANCH_HALT_VOTED,
  2039. .clkr = {
  2040. .enable_reg = 0x5200c,
  2041. .enable_mask = BIT(29),
  2042. .hw.init = &(struct clk_init_data){
  2043. .name = "gcc_qupv3_wrap1_s7_clk",
  2044. .parent_names = (const char *[]){
  2045. "gcc_qupv3_wrap1_s7_clk_src",
  2046. },
  2047. .num_parents = 1,
  2048. .flags = CLK_SET_RATE_PARENT,
  2049. .ops = &clk_branch2_ops,
  2050. },
  2051. },
  2052. };
  2053. static struct clk_branch gcc_qupv3_wrap_0_m_ahb_clk = {
  2054. .halt_reg = 0x17004,
  2055. .halt_check = BRANCH_HALT_VOTED,
  2056. .clkr = {
  2057. .enable_reg = 0x5200c,
  2058. .enable_mask = BIT(6),
  2059. .hw.init = &(struct clk_init_data){
  2060. .name = "gcc_qupv3_wrap_0_m_ahb_clk",
  2061. .ops = &clk_branch2_ops,
  2062. },
  2063. },
  2064. };
  2065. static struct clk_branch gcc_qupv3_wrap_0_s_ahb_clk = {
  2066. .halt_reg = 0x17008,
  2067. .halt_check = BRANCH_HALT_VOTED,
  2068. .hwcg_reg = 0x17008,
  2069. .hwcg_bit = 1,
  2070. .clkr = {
  2071. .enable_reg = 0x5200c,
  2072. .enable_mask = BIT(7),
  2073. .hw.init = &(struct clk_init_data){
  2074. .name = "gcc_qupv3_wrap_0_s_ahb_clk",
  2075. .ops = &clk_branch2_ops,
  2076. },
  2077. },
  2078. };
  2079. static struct clk_branch gcc_qupv3_wrap_1_m_ahb_clk = {
  2080. .halt_reg = 0x1800c,
  2081. .halt_check = BRANCH_HALT_VOTED,
  2082. .clkr = {
  2083. .enable_reg = 0x5200c,
  2084. .enable_mask = BIT(20),
  2085. .hw.init = &(struct clk_init_data){
  2086. .name = "gcc_qupv3_wrap_1_m_ahb_clk",
  2087. .ops = &clk_branch2_ops,
  2088. },
  2089. },
  2090. };
  2091. static struct clk_branch gcc_qupv3_wrap_1_s_ahb_clk = {
  2092. .halt_reg = 0x18010,
  2093. .halt_check = BRANCH_HALT_VOTED,
  2094. .hwcg_reg = 0x18010,
  2095. .hwcg_bit = 1,
  2096. .clkr = {
  2097. .enable_reg = 0x5200c,
  2098. .enable_mask = BIT(21),
  2099. .hw.init = &(struct clk_init_data){
  2100. .name = "gcc_qupv3_wrap_1_s_ahb_clk",
  2101. .ops = &clk_branch2_ops,
  2102. },
  2103. },
  2104. };
  2105. static struct clk_branch gcc_sdcc2_ahb_clk = {
  2106. .halt_reg = 0x14008,
  2107. .halt_check = BRANCH_HALT,
  2108. .clkr = {
  2109. .enable_reg = 0x14008,
  2110. .enable_mask = BIT(0),
  2111. .hw.init = &(struct clk_init_data){
  2112. .name = "gcc_sdcc2_ahb_clk",
  2113. .ops = &clk_branch2_ops,
  2114. },
  2115. },
  2116. };
  2117. static struct clk_branch gcc_sdcc2_apps_clk = {
  2118. .halt_reg = 0x14004,
  2119. .halt_check = BRANCH_HALT,
  2120. .clkr = {
  2121. .enable_reg = 0x14004,
  2122. .enable_mask = BIT(0),
  2123. .hw.init = &(struct clk_init_data){
  2124. .name = "gcc_sdcc2_apps_clk",
  2125. .parent_names = (const char *[]){
  2126. "gcc_sdcc2_apps_clk_src",
  2127. },
  2128. .num_parents = 1,
  2129. .flags = CLK_SET_RATE_PARENT,
  2130. .ops = &clk_branch2_ops,
  2131. },
  2132. },
  2133. };
  2134. static struct clk_branch gcc_sdcc4_ahb_clk = {
  2135. .halt_reg = 0x16008,
  2136. .halt_check = BRANCH_HALT,
  2137. .clkr = {
  2138. .enable_reg = 0x16008,
  2139. .enable_mask = BIT(0),
  2140. .hw.init = &(struct clk_init_data){
  2141. .name = "gcc_sdcc4_ahb_clk",
  2142. .ops = &clk_branch2_ops,
  2143. },
  2144. },
  2145. };
  2146. static struct clk_branch gcc_sdcc4_apps_clk = {
  2147. .halt_reg = 0x16004,
  2148. .halt_check = BRANCH_HALT,
  2149. .clkr = {
  2150. .enable_reg = 0x16004,
  2151. .enable_mask = BIT(0),
  2152. .hw.init = &(struct clk_init_data){
  2153. .name = "gcc_sdcc4_apps_clk",
  2154. .parent_names = (const char *[]){
  2155. "gcc_sdcc4_apps_clk_src",
  2156. },
  2157. .num_parents = 1,
  2158. .flags = CLK_SET_RATE_PARENT,
  2159. .ops = &clk_branch2_ops,
  2160. },
  2161. },
  2162. };
  2163. static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = {
  2164. .halt_reg = 0x414c,
  2165. .halt_check = BRANCH_HALT_VOTED,
  2166. .clkr = {
  2167. .enable_reg = 0x52004,
  2168. .enable_mask = BIT(0),
  2169. .hw.init = &(struct clk_init_data){
  2170. .name = "gcc_sys_noc_cpuss_ahb_clk",
  2171. .parent_names = (const char *[]){
  2172. "gcc_cpuss_ahb_clk_src",
  2173. },
  2174. .num_parents = 1,
  2175. .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
  2176. .ops = &clk_branch2_ops,
  2177. },
  2178. },
  2179. };
  2180. static struct clk_branch gcc_tsif_ahb_clk = {
  2181. .halt_reg = 0x36004,
  2182. .halt_check = BRANCH_HALT,
  2183. .clkr = {
  2184. .enable_reg = 0x36004,
  2185. .enable_mask = BIT(0),
  2186. .hw.init = &(struct clk_init_data){
  2187. .name = "gcc_tsif_ahb_clk",
  2188. .ops = &clk_branch2_ops,
  2189. },
  2190. },
  2191. };
  2192. static struct clk_branch gcc_tsif_inactivity_timers_clk = {
  2193. .halt_reg = 0x3600c,
  2194. .halt_check = BRANCH_HALT,
  2195. .clkr = {
  2196. .enable_reg = 0x3600c,
  2197. .enable_mask = BIT(0),
  2198. .hw.init = &(struct clk_init_data){
  2199. .name = "gcc_tsif_inactivity_timers_clk",
  2200. .ops = &clk_branch2_ops,
  2201. },
  2202. },
  2203. };
  2204. static struct clk_branch gcc_tsif_ref_clk = {
  2205. .halt_reg = 0x36008,
  2206. .halt_check = BRANCH_HALT,
  2207. .clkr = {
  2208. .enable_reg = 0x36008,
  2209. .enable_mask = BIT(0),
  2210. .hw.init = &(struct clk_init_data){
  2211. .name = "gcc_tsif_ref_clk",
  2212. .parent_names = (const char *[]){
  2213. "gcc_tsif_ref_clk_src",
  2214. },
  2215. .num_parents = 1,
  2216. .flags = CLK_SET_RATE_PARENT,
  2217. .ops = &clk_branch2_ops,
  2218. },
  2219. },
  2220. };
  2221. static struct clk_branch gcc_ufs_card_ahb_clk = {
  2222. .halt_reg = 0x75010,
  2223. .halt_check = BRANCH_HALT,
  2224. .hwcg_reg = 0x75010,
  2225. .hwcg_bit = 1,
  2226. .clkr = {
  2227. .enable_reg = 0x75010,
  2228. .enable_mask = BIT(0),
  2229. .hw.init = &(struct clk_init_data){
  2230. .name = "gcc_ufs_card_ahb_clk",
  2231. .ops = &clk_branch2_ops,
  2232. },
  2233. },
  2234. };
  2235. static struct clk_branch gcc_ufs_card_axi_clk = {
  2236. .halt_reg = 0x7500c,
  2237. .halt_check = BRANCH_HALT,
  2238. .hwcg_reg = 0x7500c,
  2239. .hwcg_bit = 1,
  2240. .clkr = {
  2241. .enable_reg = 0x7500c,
  2242. .enable_mask = BIT(0),
  2243. .hw.init = &(struct clk_init_data){
  2244. .name = "gcc_ufs_card_axi_clk",
  2245. .parent_names = (const char *[]){
  2246. "gcc_ufs_card_axi_clk_src",
  2247. },
  2248. .num_parents = 1,
  2249. .flags = CLK_SET_RATE_PARENT,
  2250. .ops = &clk_branch2_ops,
  2251. },
  2252. },
  2253. };
  2254. static struct clk_branch gcc_ufs_card_clkref_clk = {
  2255. .halt_reg = 0x8c004,
  2256. .halt_check = BRANCH_HALT,
  2257. .clkr = {
  2258. .enable_reg = 0x8c004,
  2259. .enable_mask = BIT(0),
  2260. .hw.init = &(struct clk_init_data){
  2261. .name = "gcc_ufs_card_clkref_clk",
  2262. .ops = &clk_branch2_ops,
  2263. },
  2264. },
  2265. };
  2266. static struct clk_branch gcc_ufs_card_ice_core_clk = {
  2267. .halt_reg = 0x75058,
  2268. .halt_check = BRANCH_HALT,
  2269. .hwcg_reg = 0x75058,
  2270. .hwcg_bit = 1,
  2271. .clkr = {
  2272. .enable_reg = 0x75058,
  2273. .enable_mask = BIT(0),
  2274. .hw.init = &(struct clk_init_data){
  2275. .name = "gcc_ufs_card_ice_core_clk",
  2276. .parent_names = (const char *[]){
  2277. "gcc_ufs_card_ice_core_clk_src",
  2278. },
  2279. .num_parents = 1,
  2280. .flags = CLK_SET_RATE_PARENT,
  2281. .ops = &clk_branch2_ops,
  2282. },
  2283. },
  2284. };
  2285. static struct clk_branch gcc_ufs_card_phy_aux_clk = {
  2286. .halt_reg = 0x7508c,
  2287. .halt_check = BRANCH_HALT,
  2288. .hwcg_reg = 0x7508c,
  2289. .hwcg_bit = 1,
  2290. .clkr = {
  2291. .enable_reg = 0x7508c,
  2292. .enable_mask = BIT(0),
  2293. .hw.init = &(struct clk_init_data){
  2294. .name = "gcc_ufs_card_phy_aux_clk",
  2295. .parent_names = (const char *[]){
  2296. "gcc_ufs_card_phy_aux_clk_src",
  2297. },
  2298. .num_parents = 1,
  2299. .flags = CLK_SET_RATE_PARENT,
  2300. .ops = &clk_branch2_ops,
  2301. },
  2302. },
  2303. };
  2304. static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = {
  2305. .halt_check = BRANCH_HALT_SKIP,
  2306. .clkr = {
  2307. .enable_reg = 0x75018,
  2308. .enable_mask = BIT(0),
  2309. .hw.init = &(struct clk_init_data){
  2310. .name = "gcc_ufs_card_rx_symbol_0_clk",
  2311. .ops = &clk_branch2_ops,
  2312. },
  2313. },
  2314. };
  2315. static struct clk_branch gcc_ufs_card_rx_symbol_1_clk = {
  2316. .halt_check = BRANCH_HALT_SKIP,
  2317. .clkr = {
  2318. .enable_reg = 0x750a8,
  2319. .enable_mask = BIT(0),
  2320. .hw.init = &(struct clk_init_data){
  2321. .name = "gcc_ufs_card_rx_symbol_1_clk",
  2322. .ops = &clk_branch2_ops,
  2323. },
  2324. },
  2325. };
  2326. static struct clk_branch gcc_ufs_card_tx_symbol_0_clk = {
  2327. .halt_check = BRANCH_HALT_SKIP,
  2328. .clkr = {
  2329. .enable_reg = 0x75014,
  2330. .enable_mask = BIT(0),
  2331. .hw.init = &(struct clk_init_data){
  2332. .name = "gcc_ufs_card_tx_symbol_0_clk",
  2333. .ops = &clk_branch2_ops,
  2334. },
  2335. },
  2336. };
  2337. static struct clk_branch gcc_ufs_card_unipro_core_clk = {
  2338. .halt_reg = 0x75054,
  2339. .halt_check = BRANCH_HALT,
  2340. .hwcg_reg = 0x75054,
  2341. .hwcg_bit = 1,
  2342. .clkr = {
  2343. .enable_reg = 0x75054,
  2344. .enable_mask = BIT(0),
  2345. .hw.init = &(struct clk_init_data){
  2346. .name = "gcc_ufs_card_unipro_core_clk",
  2347. .parent_names = (const char *[]){
  2348. "gcc_ufs_card_unipro_core_clk_src",
  2349. },
  2350. .num_parents = 1,
  2351. .flags = CLK_SET_RATE_PARENT,
  2352. .ops = &clk_branch2_ops,
  2353. },
  2354. },
  2355. };
  2356. static struct clk_branch gcc_ufs_mem_clkref_clk = {
  2357. .halt_reg = 0x8c000,
  2358. .halt_check = BRANCH_HALT,
  2359. .clkr = {
  2360. .enable_reg = 0x8c000,
  2361. .enable_mask = BIT(0),
  2362. .hw.init = &(struct clk_init_data){
  2363. .name = "gcc_ufs_mem_clkref_clk",
  2364. .ops = &clk_branch2_ops,
  2365. },
  2366. },
  2367. };
  2368. static struct clk_branch gcc_ufs_phy_ahb_clk = {
  2369. .halt_reg = 0x77010,
  2370. .halt_check = BRANCH_HALT,
  2371. .hwcg_reg = 0x77010,
  2372. .hwcg_bit = 1,
  2373. .clkr = {
  2374. .enable_reg = 0x77010,
  2375. .enable_mask = BIT(0),
  2376. .hw.init = &(struct clk_init_data){
  2377. .name = "gcc_ufs_phy_ahb_clk",
  2378. .ops = &clk_branch2_ops,
  2379. },
  2380. },
  2381. };
  2382. static struct clk_branch gcc_ufs_phy_axi_clk = {
  2383. .halt_reg = 0x7700c,
  2384. .halt_check = BRANCH_HALT,
  2385. .hwcg_reg = 0x7700c,
  2386. .hwcg_bit = 1,
  2387. .clkr = {
  2388. .enable_reg = 0x7700c,
  2389. .enable_mask = BIT(0),
  2390. .hw.init = &(struct clk_init_data){
  2391. .name = "gcc_ufs_phy_axi_clk",
  2392. .parent_names = (const char *[]){
  2393. "gcc_ufs_phy_axi_clk_src",
  2394. },
  2395. .num_parents = 1,
  2396. .flags = CLK_SET_RATE_PARENT,
  2397. .ops = &clk_branch2_ops,
  2398. },
  2399. },
  2400. };
  2401. static struct clk_branch gcc_ufs_phy_ice_core_clk = {
  2402. .halt_reg = 0x77058,
  2403. .halt_check = BRANCH_HALT,
  2404. .hwcg_reg = 0x77058,
  2405. .hwcg_bit = 1,
  2406. .clkr = {
  2407. .enable_reg = 0x77058,
  2408. .enable_mask = BIT(0),
  2409. .hw.init = &(struct clk_init_data){
  2410. .name = "gcc_ufs_phy_ice_core_clk",
  2411. .parent_names = (const char *[]){
  2412. "gcc_ufs_phy_ice_core_clk_src",
  2413. },
  2414. .num_parents = 1,
  2415. .flags = CLK_SET_RATE_PARENT,
  2416. .ops = &clk_branch2_ops,
  2417. },
  2418. },
  2419. };
  2420. static struct clk_branch gcc_ufs_phy_phy_aux_clk = {
  2421. .halt_reg = 0x7708c,
  2422. .halt_check = BRANCH_HALT,
  2423. .hwcg_reg = 0x7708c,
  2424. .hwcg_bit = 1,
  2425. .clkr = {
  2426. .enable_reg = 0x7708c,
  2427. .enable_mask = BIT(0),
  2428. .hw.init = &(struct clk_init_data){
  2429. .name = "gcc_ufs_phy_phy_aux_clk",
  2430. .parent_names = (const char *[]){
  2431. "gcc_ufs_phy_phy_aux_clk_src",
  2432. },
  2433. .num_parents = 1,
  2434. .flags = CLK_SET_RATE_PARENT,
  2435. .ops = &clk_branch2_ops,
  2436. },
  2437. },
  2438. };
  2439. static struct clk_branch gcc_ufs_phy_rx_symbol_0_clk = {
  2440. .halt_check = BRANCH_HALT_SKIP,
  2441. .clkr = {
  2442. .enable_reg = 0x77018,
  2443. .enable_mask = BIT(0),
  2444. .hw.init = &(struct clk_init_data){
  2445. .name = "gcc_ufs_phy_rx_symbol_0_clk",
  2446. .ops = &clk_branch2_ops,
  2447. },
  2448. },
  2449. };
  2450. static struct clk_branch gcc_ufs_phy_rx_symbol_1_clk = {
  2451. .halt_check = BRANCH_HALT_SKIP,
  2452. .clkr = {
  2453. .enable_reg = 0x770a8,
  2454. .enable_mask = BIT(0),
  2455. .hw.init = &(struct clk_init_data){
  2456. .name = "gcc_ufs_phy_rx_symbol_1_clk",
  2457. .ops = &clk_branch2_ops,
  2458. },
  2459. },
  2460. };
  2461. static struct clk_branch gcc_ufs_phy_tx_symbol_0_clk = {
  2462. .halt_check = BRANCH_HALT_SKIP,
  2463. .clkr = {
  2464. .enable_reg = 0x77014,
  2465. .enable_mask = BIT(0),
  2466. .hw.init = &(struct clk_init_data){
  2467. .name = "gcc_ufs_phy_tx_symbol_0_clk",
  2468. .ops = &clk_branch2_ops,
  2469. },
  2470. },
  2471. };
  2472. static struct clk_branch gcc_ufs_phy_unipro_core_clk = {
  2473. .halt_reg = 0x77054,
  2474. .halt_check = BRANCH_HALT,
  2475. .hwcg_reg = 0x77054,
  2476. .hwcg_bit = 1,
  2477. .clkr = {
  2478. .enable_reg = 0x77054,
  2479. .enable_mask = BIT(0),
  2480. .hw.init = &(struct clk_init_data){
  2481. .name = "gcc_ufs_phy_unipro_core_clk",
  2482. .parent_names = (const char *[]){
  2483. "gcc_ufs_phy_unipro_core_clk_src",
  2484. },
  2485. .num_parents = 1,
  2486. .flags = CLK_SET_RATE_PARENT,
  2487. .ops = &clk_branch2_ops,
  2488. },
  2489. },
  2490. };
  2491. static struct clk_branch gcc_usb30_prim_master_clk = {
  2492. .halt_reg = 0xf00c,
  2493. .halt_check = BRANCH_HALT,
  2494. .clkr = {
  2495. .enable_reg = 0xf00c,
  2496. .enable_mask = BIT(0),
  2497. .hw.init = &(struct clk_init_data){
  2498. .name = "gcc_usb30_prim_master_clk",
  2499. .parent_names = (const char *[]){
  2500. "gcc_usb30_prim_master_clk_src",
  2501. },
  2502. .num_parents = 1,
  2503. .flags = CLK_SET_RATE_PARENT,
  2504. .ops = &clk_branch2_ops,
  2505. },
  2506. },
  2507. };
  2508. static struct clk_branch gcc_usb30_prim_mock_utmi_clk = {
  2509. .halt_reg = 0xf014,
  2510. .halt_check = BRANCH_HALT,
  2511. .clkr = {
  2512. .enable_reg = 0xf014,
  2513. .enable_mask = BIT(0),
  2514. .hw.init = &(struct clk_init_data){
  2515. .name = "gcc_usb30_prim_mock_utmi_clk",
  2516. .parent_names = (const char *[]){
  2517. "gcc_usb30_prim_mock_utmi_clk_src",
  2518. },
  2519. .num_parents = 1,
  2520. .flags = CLK_SET_RATE_PARENT,
  2521. .ops = &clk_branch2_ops,
  2522. },
  2523. },
  2524. };
  2525. static struct clk_branch gcc_usb30_prim_sleep_clk = {
  2526. .halt_reg = 0xf010,
  2527. .halt_check = BRANCH_HALT,
  2528. .clkr = {
  2529. .enable_reg = 0xf010,
  2530. .enable_mask = BIT(0),
  2531. .hw.init = &(struct clk_init_data){
  2532. .name = "gcc_usb30_prim_sleep_clk",
  2533. .ops = &clk_branch2_ops,
  2534. },
  2535. },
  2536. };
  2537. static struct clk_branch gcc_usb30_sec_master_clk = {
  2538. .halt_reg = 0x1000c,
  2539. .halt_check = BRANCH_HALT,
  2540. .clkr = {
  2541. .enable_reg = 0x1000c,
  2542. .enable_mask = BIT(0),
  2543. .hw.init = &(struct clk_init_data){
  2544. .name = "gcc_usb30_sec_master_clk",
  2545. .parent_names = (const char *[]){
  2546. "gcc_usb30_sec_master_clk_src",
  2547. },
  2548. .num_parents = 1,
  2549. .flags = CLK_SET_RATE_PARENT,
  2550. .ops = &clk_branch2_ops,
  2551. },
  2552. },
  2553. };
  2554. static struct clk_branch gcc_usb30_sec_mock_utmi_clk = {
  2555. .halt_reg = 0x10014,
  2556. .halt_check = BRANCH_HALT,
  2557. .clkr = {
  2558. .enable_reg = 0x10014,
  2559. .enable_mask = BIT(0),
  2560. .hw.init = &(struct clk_init_data){
  2561. .name = "gcc_usb30_sec_mock_utmi_clk",
  2562. .parent_names = (const char *[]){
  2563. "gcc_usb30_sec_mock_utmi_clk_src",
  2564. },
  2565. .num_parents = 1,
  2566. .flags = CLK_SET_RATE_PARENT,
  2567. .ops = &clk_branch2_ops,
  2568. },
  2569. },
  2570. };
  2571. static struct clk_branch gcc_usb30_sec_sleep_clk = {
  2572. .halt_reg = 0x10010,
  2573. .halt_check = BRANCH_HALT,
  2574. .clkr = {
  2575. .enable_reg = 0x10010,
  2576. .enable_mask = BIT(0),
  2577. .hw.init = &(struct clk_init_data){
  2578. .name = "gcc_usb30_sec_sleep_clk",
  2579. .ops = &clk_branch2_ops,
  2580. },
  2581. },
  2582. };
  2583. static struct clk_branch gcc_usb3_prim_clkref_clk = {
  2584. .halt_reg = 0x8c008,
  2585. .halt_check = BRANCH_HALT,
  2586. .clkr = {
  2587. .enable_reg = 0x8c008,
  2588. .enable_mask = BIT(0),
  2589. .hw.init = &(struct clk_init_data){
  2590. .name = "gcc_usb3_prim_clkref_clk",
  2591. .ops = &clk_branch2_ops,
  2592. },
  2593. },
  2594. };
  2595. static struct clk_branch gcc_usb3_prim_phy_aux_clk = {
  2596. .halt_reg = 0xf04c,
  2597. .halt_check = BRANCH_HALT,
  2598. .clkr = {
  2599. .enable_reg = 0xf04c,
  2600. .enable_mask = BIT(0),
  2601. .hw.init = &(struct clk_init_data){
  2602. .name = "gcc_usb3_prim_phy_aux_clk",
  2603. .parent_names = (const char *[]){
  2604. "gcc_usb3_prim_phy_aux_clk_src",
  2605. },
  2606. .num_parents = 1,
  2607. .flags = CLK_SET_RATE_PARENT,
  2608. .ops = &clk_branch2_ops,
  2609. },
  2610. },
  2611. };
  2612. static struct clk_branch gcc_usb3_prim_phy_com_aux_clk = {
  2613. .halt_reg = 0xf050,
  2614. .halt_check = BRANCH_HALT,
  2615. .clkr = {
  2616. .enable_reg = 0xf050,
  2617. .enable_mask = BIT(0),
  2618. .hw.init = &(struct clk_init_data){
  2619. .name = "gcc_usb3_prim_phy_com_aux_clk",
  2620. .parent_names = (const char *[]){
  2621. "gcc_usb3_prim_phy_aux_clk_src",
  2622. },
  2623. .num_parents = 1,
  2624. .flags = CLK_SET_RATE_PARENT,
  2625. .ops = &clk_branch2_ops,
  2626. },
  2627. },
  2628. };
  2629. static struct clk_branch gcc_usb3_prim_phy_pipe_clk = {
  2630. .halt_check = BRANCH_HALT_SKIP,
  2631. .clkr = {
  2632. .enable_reg = 0xf054,
  2633. .enable_mask = BIT(0),
  2634. .hw.init = &(struct clk_init_data){
  2635. .name = "gcc_usb3_prim_phy_pipe_clk",
  2636. .ops = &clk_branch2_ops,
  2637. },
  2638. },
  2639. };
  2640. static struct clk_branch gcc_usb3_sec_clkref_clk = {
  2641. .halt_reg = 0x8c028,
  2642. .halt_check = BRANCH_HALT,
  2643. .clkr = {
  2644. .enable_reg = 0x8c028,
  2645. .enable_mask = BIT(0),
  2646. .hw.init = &(struct clk_init_data){
  2647. .name = "gcc_usb3_sec_clkref_clk",
  2648. .ops = &clk_branch2_ops,
  2649. },
  2650. },
  2651. };
  2652. static struct clk_branch gcc_usb3_sec_phy_aux_clk = {
  2653. .halt_reg = 0x1004c,
  2654. .halt_check = BRANCH_HALT,
  2655. .clkr = {
  2656. .enable_reg = 0x1004c,
  2657. .enable_mask = BIT(0),
  2658. .hw.init = &(struct clk_init_data){
  2659. .name = "gcc_usb3_sec_phy_aux_clk",
  2660. .parent_names = (const char *[]){
  2661. "gcc_usb3_sec_phy_aux_clk_src",
  2662. },
  2663. .num_parents = 1,
  2664. .flags = CLK_SET_RATE_PARENT,
  2665. .ops = &clk_branch2_ops,
  2666. },
  2667. },
  2668. };
  2669. static struct clk_branch gcc_usb3_sec_phy_com_aux_clk = {
  2670. .halt_reg = 0x10050,
  2671. .halt_check = BRANCH_HALT,
  2672. .clkr = {
  2673. .enable_reg = 0x10050,
  2674. .enable_mask = BIT(0),
  2675. .hw.init = &(struct clk_init_data){
  2676. .name = "gcc_usb3_sec_phy_com_aux_clk",
  2677. .parent_names = (const char *[]){
  2678. "gcc_usb3_sec_phy_aux_clk_src",
  2679. },
  2680. .num_parents = 1,
  2681. .flags = CLK_SET_RATE_PARENT,
  2682. .ops = &clk_branch2_ops,
  2683. },
  2684. },
  2685. };
  2686. static struct clk_branch gcc_usb3_sec_phy_pipe_clk = {
  2687. .halt_check = BRANCH_HALT_SKIP,
  2688. .clkr = {
  2689. .enable_reg = 0x10054,
  2690. .enable_mask = BIT(0),
  2691. .hw.init = &(struct clk_init_data){
  2692. .name = "gcc_usb3_sec_phy_pipe_clk",
  2693. .ops = &clk_branch2_ops,
  2694. },
  2695. },
  2696. };
  2697. static struct clk_branch gcc_usb_phy_cfg_ahb2phy_clk = {
  2698. .halt_reg = 0x6a004,
  2699. .halt_check = BRANCH_HALT,
  2700. .hwcg_reg = 0x6a004,
  2701. .hwcg_bit = 1,
  2702. .clkr = {
  2703. .enable_reg = 0x6a004,
  2704. .enable_mask = BIT(0),
  2705. .hw.init = &(struct clk_init_data){
  2706. .name = "gcc_usb_phy_cfg_ahb2phy_clk",
  2707. .ops = &clk_branch2_ops,
  2708. },
  2709. },
  2710. };
  2711. static struct clk_branch gcc_vdda_vs_clk = {
  2712. .halt_reg = 0x7a00c,
  2713. .halt_check = BRANCH_HALT,
  2714. .clkr = {
  2715. .enable_reg = 0x7a00c,
  2716. .enable_mask = BIT(0),
  2717. .hw.init = &(struct clk_init_data){
  2718. .name = "gcc_vdda_vs_clk",
  2719. .parent_names = (const char *[]){
  2720. "gcc_vsensor_clk_src",
  2721. },
  2722. .num_parents = 1,
  2723. .flags = CLK_SET_RATE_PARENT,
  2724. .ops = &clk_branch2_ops,
  2725. },
  2726. },
  2727. };
  2728. static struct clk_branch gcc_vddcx_vs_clk = {
  2729. .halt_reg = 0x7a004,
  2730. .halt_check = BRANCH_HALT,
  2731. .clkr = {
  2732. .enable_reg = 0x7a004,
  2733. .enable_mask = BIT(0),
  2734. .hw.init = &(struct clk_init_data){
  2735. .name = "gcc_vddcx_vs_clk",
  2736. .parent_names = (const char *[]){
  2737. "gcc_vsensor_clk_src",
  2738. },
  2739. .num_parents = 1,
  2740. .flags = CLK_SET_RATE_PARENT,
  2741. .ops = &clk_branch2_ops,
  2742. },
  2743. },
  2744. };
  2745. static struct clk_branch gcc_vddmx_vs_clk = {
  2746. .halt_reg = 0x7a008,
  2747. .halt_check = BRANCH_HALT,
  2748. .clkr = {
  2749. .enable_reg = 0x7a008,
  2750. .enable_mask = BIT(0),
  2751. .hw.init = &(struct clk_init_data){
  2752. .name = "gcc_vddmx_vs_clk",
  2753. .parent_names = (const char *[]){
  2754. "gcc_vsensor_clk_src",
  2755. },
  2756. .num_parents = 1,
  2757. .flags = CLK_SET_RATE_PARENT,
  2758. .ops = &clk_branch2_ops,
  2759. },
  2760. },
  2761. };
  2762. static struct clk_branch gcc_video_ahb_clk = {
  2763. .halt_reg = 0xb004,
  2764. .halt_check = BRANCH_HALT,
  2765. .hwcg_reg = 0xb004,
  2766. .hwcg_bit = 1,
  2767. .clkr = {
  2768. .enable_reg = 0xb004,
  2769. .enable_mask = BIT(0),
  2770. .hw.init = &(struct clk_init_data){
  2771. .name = "gcc_video_ahb_clk",
  2772. .ops = &clk_branch2_ops,
  2773. },
  2774. },
  2775. };
  2776. static struct clk_branch gcc_video_axi_clk = {
  2777. .halt_reg = 0xb01c,
  2778. .halt_check = BRANCH_VOTED,
  2779. .clkr = {
  2780. .enable_reg = 0xb01c,
  2781. .enable_mask = BIT(0),
  2782. .hw.init = &(struct clk_init_data){
  2783. .name = "gcc_video_axi_clk",
  2784. .ops = &clk_branch2_ops,
  2785. },
  2786. },
  2787. };
  2788. static struct clk_branch gcc_video_xo_clk = {
  2789. .halt_reg = 0xb028,
  2790. .halt_check = BRANCH_HALT,
  2791. .clkr = {
  2792. .enable_reg = 0xb028,
  2793. .enable_mask = BIT(0),
  2794. .hw.init = &(struct clk_init_data){
  2795. .name = "gcc_video_xo_clk",
  2796. .ops = &clk_branch2_ops,
  2797. },
  2798. },
  2799. };
  2800. static struct clk_branch gcc_vs_ctrl_ahb_clk = {
  2801. .halt_reg = 0x7a014,
  2802. .halt_check = BRANCH_HALT,
  2803. .hwcg_reg = 0x7a014,
  2804. .hwcg_bit = 1,
  2805. .clkr = {
  2806. .enable_reg = 0x7a014,
  2807. .enable_mask = BIT(0),
  2808. .hw.init = &(struct clk_init_data){
  2809. .name = "gcc_vs_ctrl_ahb_clk",
  2810. .ops = &clk_branch2_ops,
  2811. },
  2812. },
  2813. };
  2814. static struct clk_branch gcc_vs_ctrl_clk = {
  2815. .halt_reg = 0x7a010,
  2816. .halt_check = BRANCH_HALT,
  2817. .clkr = {
  2818. .enable_reg = 0x7a010,
  2819. .enable_mask = BIT(0),
  2820. .hw.init = &(struct clk_init_data){
  2821. .name = "gcc_vs_ctrl_clk",
  2822. .parent_names = (const char *[]){
  2823. "gcc_vs_ctrl_clk_src",
  2824. },
  2825. .num_parents = 1,
  2826. .flags = CLK_SET_RATE_PARENT,
  2827. .ops = &clk_branch2_ops,
  2828. },
  2829. },
  2830. };
  2831. static struct gdsc pcie_0_gdsc = {
  2832. .gdscr = 0x6b004,
  2833. .pd = {
  2834. .name = "pcie_0_gdsc",
  2835. },
  2836. .pwrsts = PWRSTS_OFF_ON,
  2837. .flags = POLL_CFG_GDSCR,
  2838. };
  2839. static struct gdsc pcie_1_gdsc = {
  2840. .gdscr = 0x8d004,
  2841. .pd = {
  2842. .name = "pcie_1_gdsc",
  2843. },
  2844. .pwrsts = PWRSTS_OFF_ON,
  2845. .flags = POLL_CFG_GDSCR,
  2846. };
  2847. static struct gdsc ufs_card_gdsc = {
  2848. .gdscr = 0x75004,
  2849. .pd = {
  2850. .name = "ufs_card_gdsc",
  2851. },
  2852. .pwrsts = PWRSTS_OFF_ON,
  2853. .flags = POLL_CFG_GDSCR,
  2854. };
  2855. static struct gdsc ufs_phy_gdsc = {
  2856. .gdscr = 0x77004,
  2857. .pd = {
  2858. .name = "ufs_phy_gdsc",
  2859. },
  2860. .pwrsts = PWRSTS_OFF_ON,
  2861. .flags = POLL_CFG_GDSCR,
  2862. };
  2863. static struct gdsc usb30_prim_gdsc = {
  2864. .gdscr = 0xf004,
  2865. .pd = {
  2866. .name = "usb30_prim_gdsc",
  2867. },
  2868. .pwrsts = PWRSTS_OFF_ON,
  2869. .flags = POLL_CFG_GDSCR,
  2870. };
  2871. static struct gdsc usb30_sec_gdsc = {
  2872. .gdscr = 0x10004,
  2873. .pd = {
  2874. .name = "usb30_sec_gdsc",
  2875. },
  2876. .pwrsts = PWRSTS_OFF_ON,
  2877. .flags = POLL_CFG_GDSCR,
  2878. };
  2879. static struct gdsc hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc = {
  2880. .gdscr = 0x7d030,
  2881. .pd = {
  2882. .name = "hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc",
  2883. },
  2884. .pwrsts = PWRSTS_OFF_ON,
  2885. };
  2886. static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = {
  2887. .gdscr = 0x7d03c,
  2888. .pd = {
  2889. .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc",
  2890. },
  2891. .pwrsts = PWRSTS_OFF_ON,
  2892. };
  2893. static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = {
  2894. .gdscr = 0x7d034,
  2895. .pd = {
  2896. .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc",
  2897. },
  2898. .pwrsts = PWRSTS_OFF_ON,
  2899. };
  2900. static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = {
  2901. .gdscr = 0x7d038,
  2902. .pd = {
  2903. .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc",
  2904. },
  2905. .pwrsts = PWRSTS_OFF_ON,
  2906. };
  2907. static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = {
  2908. .gdscr = 0x7d040,
  2909. .pd = {
  2910. .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc",
  2911. },
  2912. .pwrsts = PWRSTS_OFF_ON,
  2913. };
  2914. static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = {
  2915. .gdscr = 0x7d048,
  2916. .pd = {
  2917. .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc",
  2918. },
  2919. .pwrsts = PWRSTS_OFF_ON,
  2920. };
  2921. static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = {
  2922. .gdscr = 0x7d044,
  2923. .pd = {
  2924. .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc",
  2925. },
  2926. .pwrsts = PWRSTS_OFF_ON,
  2927. };
  2928. static struct clk_regmap *gcc_sdm845_clocks[] = {
  2929. [GCC_AGGRE_NOC_PCIE_TBU_CLK] = &gcc_aggre_noc_pcie_tbu_clk.clkr,
  2930. [GCC_AGGRE_UFS_CARD_AXI_CLK] = &gcc_aggre_ufs_card_axi_clk.clkr,
  2931. [GCC_AGGRE_UFS_PHY_AXI_CLK] = &gcc_aggre_ufs_phy_axi_clk.clkr,
  2932. [GCC_AGGRE_USB3_PRIM_AXI_CLK] = &gcc_aggre_usb3_prim_axi_clk.clkr,
  2933. [GCC_AGGRE_USB3_SEC_AXI_CLK] = &gcc_aggre_usb3_sec_axi_clk.clkr,
  2934. [GCC_APC_VS_CLK] = &gcc_apc_vs_clk.clkr,
  2935. [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
  2936. [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr,
  2937. [GCC_CAMERA_AXI_CLK] = &gcc_camera_axi_clk.clkr,
  2938. [GCC_CAMERA_XO_CLK] = &gcc_camera_xo_clk.clkr,
  2939. [GCC_CE1_AHB_CLK] = &gcc_ce1_ahb_clk.clkr,
  2940. [GCC_CE1_AXI_CLK] = &gcc_ce1_axi_clk.clkr,
  2941. [GCC_CE1_CLK] = &gcc_ce1_clk.clkr,
  2942. [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr,
  2943. [GCC_CFG_NOC_USB3_SEC_AXI_CLK] = &gcc_cfg_noc_usb3_sec_axi_clk.clkr,
  2944. [GCC_CPUSS_AHB_CLK] = &gcc_cpuss_ahb_clk.clkr,
  2945. [GCC_CPUSS_AHB_CLK_SRC] = &gcc_cpuss_ahb_clk_src.clkr,
  2946. [GCC_CPUSS_RBCPR_CLK] = &gcc_cpuss_rbcpr_clk.clkr,
  2947. [GCC_CPUSS_RBCPR_CLK_SRC] = &gcc_cpuss_rbcpr_clk_src.clkr,
  2948. [GCC_DDRSS_GPU_AXI_CLK] = &gcc_ddrss_gpu_axi_clk.clkr,
  2949. [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr,
  2950. [GCC_DISP_AXI_CLK] = &gcc_disp_axi_clk.clkr,
  2951. [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr,
  2952. [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr,
  2953. [GCC_DISP_XO_CLK] = &gcc_disp_xo_clk.clkr,
  2954. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  2955. [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr,
  2956. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  2957. [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr,
  2958. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  2959. [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr,
  2960. [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
  2961. [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr,
  2962. [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr,
  2963. [GCC_GPU_IREF_CLK] = &gcc_gpu_iref_clk.clkr,
  2964. [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr,
  2965. [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr,
  2966. [GCC_GPU_VS_CLK] = &gcc_gpu_vs_clk.clkr,
  2967. [GCC_MSS_AXIS2_CLK] = &gcc_mss_axis2_clk.clkr,
  2968. [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
  2969. [GCC_MSS_GPLL0_DIV_CLK_SRC] = &gcc_mss_gpll0_div_clk_src.clkr,
  2970. [GCC_MSS_MFAB_AXIS_CLK] = &gcc_mss_mfab_axis_clk.clkr,
  2971. [GCC_MSS_Q6_MEMNOC_AXI_CLK] = &gcc_mss_q6_memnoc_axi_clk.clkr,
  2972. [GCC_MSS_SNOC_AXI_CLK] = &gcc_mss_snoc_axi_clk.clkr,
  2973. [GCC_MSS_VS_CLK] = &gcc_mss_vs_clk.clkr,
  2974. [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr,
  2975. [GCC_PCIE_0_AUX_CLK_SRC] = &gcc_pcie_0_aux_clk_src.clkr,
  2976. [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr,
  2977. [GCC_PCIE_0_CLKREF_CLK] = &gcc_pcie_0_clkref_clk.clkr,
  2978. [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr,
  2979. [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr,
  2980. [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr,
  2981. [GCC_PCIE_0_SLV_Q2A_AXI_CLK] = &gcc_pcie_0_slv_q2a_axi_clk.clkr,
  2982. [GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr,
  2983. [GCC_PCIE_1_AUX_CLK_SRC] = &gcc_pcie_1_aux_clk_src.clkr,
  2984. [GCC_PCIE_1_CFG_AHB_CLK] = &gcc_pcie_1_cfg_ahb_clk.clkr,
  2985. [GCC_PCIE_1_CLKREF_CLK] = &gcc_pcie_1_clkref_clk.clkr,
  2986. [GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr,
  2987. [GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr,
  2988. [GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr,
  2989. [GCC_PCIE_1_SLV_Q2A_AXI_CLK] = &gcc_pcie_1_slv_q2a_axi_clk.clkr,
  2990. [GCC_PCIE_PHY_AUX_CLK] = &gcc_pcie_phy_aux_clk.clkr,
  2991. [GCC_PCIE_PHY_REFGEN_CLK] = &gcc_pcie_phy_refgen_clk.clkr,
  2992. [GCC_PCIE_PHY_REFGEN_CLK_SRC] = &gcc_pcie_phy_refgen_clk_src.clkr,
  2993. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  2994. [GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
  2995. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  2996. [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
  2997. [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
  2998. [GCC_QMIP_CAMERA_AHB_CLK] = &gcc_qmip_camera_ahb_clk.clkr,
  2999. [GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr,
  3000. [GCC_QMIP_VIDEO_AHB_CLK] = &gcc_qmip_video_ahb_clk.clkr,
  3001. [GCC_QUPV3_WRAP0_S0_CLK] = &gcc_qupv3_wrap0_s0_clk.clkr,
  3002. [GCC_QUPV3_WRAP0_S0_CLK_SRC] = &gcc_qupv3_wrap0_s0_clk_src.clkr,
  3003. [GCC_QUPV3_WRAP0_S1_CLK] = &gcc_qupv3_wrap0_s1_clk.clkr,
  3004. [GCC_QUPV3_WRAP0_S1_CLK_SRC] = &gcc_qupv3_wrap0_s1_clk_src.clkr,
  3005. [GCC_QUPV3_WRAP0_S2_CLK] = &gcc_qupv3_wrap0_s2_clk.clkr,
  3006. [GCC_QUPV3_WRAP0_S2_CLK_SRC] = &gcc_qupv3_wrap0_s2_clk_src.clkr,
  3007. [GCC_QUPV3_WRAP0_S3_CLK] = &gcc_qupv3_wrap0_s3_clk.clkr,
  3008. [GCC_QUPV3_WRAP0_S3_CLK_SRC] = &gcc_qupv3_wrap0_s3_clk_src.clkr,
  3009. [GCC_QUPV3_WRAP0_S4_CLK] = &gcc_qupv3_wrap0_s4_clk.clkr,
  3010. [GCC_QUPV3_WRAP0_S4_CLK_SRC] = &gcc_qupv3_wrap0_s4_clk_src.clkr,
  3011. [GCC_QUPV3_WRAP0_S5_CLK] = &gcc_qupv3_wrap0_s5_clk.clkr,
  3012. [GCC_QUPV3_WRAP0_S5_CLK_SRC] = &gcc_qupv3_wrap0_s5_clk_src.clkr,
  3013. [GCC_QUPV3_WRAP0_S6_CLK] = &gcc_qupv3_wrap0_s6_clk.clkr,
  3014. [GCC_QUPV3_WRAP0_S6_CLK_SRC] = &gcc_qupv3_wrap0_s6_clk_src.clkr,
  3015. [GCC_QUPV3_WRAP0_S7_CLK] = &gcc_qupv3_wrap0_s7_clk.clkr,
  3016. [GCC_QUPV3_WRAP0_S7_CLK_SRC] = &gcc_qupv3_wrap0_s7_clk_src.clkr,
  3017. [GCC_QUPV3_WRAP1_S0_CLK] = &gcc_qupv3_wrap1_s0_clk.clkr,
  3018. [GCC_QUPV3_WRAP1_S0_CLK_SRC] = &gcc_qupv3_wrap1_s0_clk_src.clkr,
  3019. [GCC_QUPV3_WRAP1_S1_CLK] = &gcc_qupv3_wrap1_s1_clk.clkr,
  3020. [GCC_QUPV3_WRAP1_S1_CLK_SRC] = &gcc_qupv3_wrap1_s1_clk_src.clkr,
  3021. [GCC_QUPV3_WRAP1_S2_CLK] = &gcc_qupv3_wrap1_s2_clk.clkr,
  3022. [GCC_QUPV3_WRAP1_S2_CLK_SRC] = &gcc_qupv3_wrap1_s2_clk_src.clkr,
  3023. [GCC_QUPV3_WRAP1_S3_CLK] = &gcc_qupv3_wrap1_s3_clk.clkr,
  3024. [GCC_QUPV3_WRAP1_S3_CLK_SRC] = &gcc_qupv3_wrap1_s3_clk_src.clkr,
  3025. [GCC_QUPV3_WRAP1_S4_CLK] = &gcc_qupv3_wrap1_s4_clk.clkr,
  3026. [GCC_QUPV3_WRAP1_S4_CLK_SRC] = &gcc_qupv3_wrap1_s4_clk_src.clkr,
  3027. [GCC_QUPV3_WRAP1_S5_CLK] = &gcc_qupv3_wrap1_s5_clk.clkr,
  3028. [GCC_QUPV3_WRAP1_S5_CLK_SRC] = &gcc_qupv3_wrap1_s5_clk_src.clkr,
  3029. [GCC_QUPV3_WRAP1_S6_CLK] = &gcc_qupv3_wrap1_s6_clk.clkr,
  3030. [GCC_QUPV3_WRAP1_S6_CLK_SRC] = &gcc_qupv3_wrap1_s6_clk_src.clkr,
  3031. [GCC_QUPV3_WRAP1_S7_CLK] = &gcc_qupv3_wrap1_s7_clk.clkr,
  3032. [GCC_QUPV3_WRAP1_S7_CLK_SRC] = &gcc_qupv3_wrap1_s7_clk_src.clkr,
  3033. [GCC_QUPV3_WRAP_0_M_AHB_CLK] = &gcc_qupv3_wrap_0_m_ahb_clk.clkr,
  3034. [GCC_QUPV3_WRAP_0_S_AHB_CLK] = &gcc_qupv3_wrap_0_s_ahb_clk.clkr,
  3035. [GCC_QUPV3_WRAP_1_M_AHB_CLK] = &gcc_qupv3_wrap_1_m_ahb_clk.clkr,
  3036. [GCC_QUPV3_WRAP_1_S_AHB_CLK] = &gcc_qupv3_wrap_1_s_ahb_clk.clkr,
  3037. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  3038. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  3039. [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr,
  3040. [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr,
  3041. [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr,
  3042. [GCC_SDCC4_APPS_CLK_SRC] = &gcc_sdcc4_apps_clk_src.clkr,
  3043. [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr,
  3044. [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr,
  3045. [GCC_TSIF_INACTIVITY_TIMERS_CLK] =
  3046. &gcc_tsif_inactivity_timers_clk.clkr,
  3047. [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr,
  3048. [GCC_TSIF_REF_CLK_SRC] = &gcc_tsif_ref_clk_src.clkr,
  3049. [GCC_UFS_CARD_AHB_CLK] = &gcc_ufs_card_ahb_clk.clkr,
  3050. [GCC_UFS_CARD_AXI_CLK] = &gcc_ufs_card_axi_clk.clkr,
  3051. [GCC_UFS_CARD_AXI_CLK_SRC] = &gcc_ufs_card_axi_clk_src.clkr,
  3052. [GCC_UFS_CARD_CLKREF_CLK] = &gcc_ufs_card_clkref_clk.clkr,
  3053. [GCC_UFS_CARD_ICE_CORE_CLK] = &gcc_ufs_card_ice_core_clk.clkr,
  3054. [GCC_UFS_CARD_ICE_CORE_CLK_SRC] = &gcc_ufs_card_ice_core_clk_src.clkr,
  3055. [GCC_UFS_CARD_PHY_AUX_CLK] = &gcc_ufs_card_phy_aux_clk.clkr,
  3056. [GCC_UFS_CARD_PHY_AUX_CLK_SRC] = &gcc_ufs_card_phy_aux_clk_src.clkr,
  3057. [GCC_UFS_CARD_RX_SYMBOL_0_CLK] = &gcc_ufs_card_rx_symbol_0_clk.clkr,
  3058. [GCC_UFS_CARD_RX_SYMBOL_1_CLK] = &gcc_ufs_card_rx_symbol_1_clk.clkr,
  3059. [GCC_UFS_CARD_TX_SYMBOL_0_CLK] = &gcc_ufs_card_tx_symbol_0_clk.clkr,
  3060. [GCC_UFS_CARD_UNIPRO_CORE_CLK] = &gcc_ufs_card_unipro_core_clk.clkr,
  3061. [GCC_UFS_CARD_UNIPRO_CORE_CLK_SRC] =
  3062. &gcc_ufs_card_unipro_core_clk_src.clkr,
  3063. [GCC_UFS_MEM_CLKREF_CLK] = &gcc_ufs_mem_clkref_clk.clkr,
  3064. [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr,
  3065. [GCC_UFS_PHY_AXI_CLK] = &gcc_ufs_phy_axi_clk.clkr,
  3066. [GCC_UFS_PHY_AXI_CLK_SRC] = &gcc_ufs_phy_axi_clk_src.clkr,
  3067. [GCC_UFS_PHY_ICE_CORE_CLK] = &gcc_ufs_phy_ice_core_clk.clkr,
  3068. [GCC_UFS_PHY_ICE_CORE_CLK_SRC] = &gcc_ufs_phy_ice_core_clk_src.clkr,
  3069. [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr,
  3070. [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr,
  3071. [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr,
  3072. [GCC_UFS_PHY_RX_SYMBOL_1_CLK] = &gcc_ufs_phy_rx_symbol_1_clk.clkr,
  3073. [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr,
  3074. [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr,
  3075. [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC] =
  3076. &gcc_ufs_phy_unipro_core_clk_src.clkr,
  3077. [GCC_USB30_PRIM_MASTER_CLK] = &gcc_usb30_prim_master_clk.clkr,
  3078. [GCC_USB30_PRIM_MASTER_CLK_SRC] = &gcc_usb30_prim_master_clk_src.clkr,
  3079. [GCC_USB30_PRIM_MOCK_UTMI_CLK] = &gcc_usb30_prim_mock_utmi_clk.clkr,
  3080. [GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC] =
  3081. &gcc_usb30_prim_mock_utmi_clk_src.clkr,
  3082. [GCC_USB30_PRIM_SLEEP_CLK] = &gcc_usb30_prim_sleep_clk.clkr,
  3083. [GCC_USB30_SEC_MASTER_CLK] = &gcc_usb30_sec_master_clk.clkr,
  3084. [GCC_USB30_SEC_MASTER_CLK_SRC] = &gcc_usb30_sec_master_clk_src.clkr,
  3085. [GCC_USB30_SEC_MOCK_UTMI_CLK] = &gcc_usb30_sec_mock_utmi_clk.clkr,
  3086. [GCC_USB30_SEC_MOCK_UTMI_CLK_SRC] =
  3087. &gcc_usb30_sec_mock_utmi_clk_src.clkr,
  3088. [GCC_USB30_SEC_SLEEP_CLK] = &gcc_usb30_sec_sleep_clk.clkr,
  3089. [GCC_USB3_PRIM_CLKREF_CLK] = &gcc_usb3_prim_clkref_clk.clkr,
  3090. [GCC_USB3_PRIM_PHY_AUX_CLK] = &gcc_usb3_prim_phy_aux_clk.clkr,
  3091. [GCC_USB3_PRIM_PHY_AUX_CLK_SRC] = &gcc_usb3_prim_phy_aux_clk_src.clkr,
  3092. [GCC_USB3_PRIM_PHY_COM_AUX_CLK] = &gcc_usb3_prim_phy_com_aux_clk.clkr,
  3093. [GCC_USB3_PRIM_PHY_PIPE_CLK] = &gcc_usb3_prim_phy_pipe_clk.clkr,
  3094. [GCC_USB3_SEC_CLKREF_CLK] = &gcc_usb3_sec_clkref_clk.clkr,
  3095. [GCC_USB3_SEC_PHY_AUX_CLK] = &gcc_usb3_sec_phy_aux_clk.clkr,
  3096. [GCC_USB3_SEC_PHY_AUX_CLK_SRC] = &gcc_usb3_sec_phy_aux_clk_src.clkr,
  3097. [GCC_USB3_SEC_PHY_COM_AUX_CLK] = &gcc_usb3_sec_phy_com_aux_clk.clkr,
  3098. [GCC_USB3_SEC_PHY_PIPE_CLK] = &gcc_usb3_sec_phy_pipe_clk.clkr,
  3099. [GCC_USB_PHY_CFG_AHB2PHY_CLK] = &gcc_usb_phy_cfg_ahb2phy_clk.clkr,
  3100. [GCC_VDDA_VS_CLK] = &gcc_vdda_vs_clk.clkr,
  3101. [GCC_VDDCX_VS_CLK] = &gcc_vddcx_vs_clk.clkr,
  3102. [GCC_VDDMX_VS_CLK] = &gcc_vddmx_vs_clk.clkr,
  3103. [GCC_VIDEO_AHB_CLK] = &gcc_video_ahb_clk.clkr,
  3104. [GCC_VIDEO_AXI_CLK] = &gcc_video_axi_clk.clkr,
  3105. [GCC_VIDEO_XO_CLK] = &gcc_video_xo_clk.clkr,
  3106. [GCC_VS_CTRL_AHB_CLK] = &gcc_vs_ctrl_ahb_clk.clkr,
  3107. [GCC_VS_CTRL_CLK] = &gcc_vs_ctrl_clk.clkr,
  3108. [GCC_VS_CTRL_CLK_SRC] = &gcc_vs_ctrl_clk_src.clkr,
  3109. [GCC_VSENSOR_CLK_SRC] = &gcc_vsensor_clk_src.clkr,
  3110. [GPLL0] = &gpll0.clkr,
  3111. [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr,
  3112. [GPLL4] = &gpll4.clkr,
  3113. };
  3114. static const struct qcom_reset_map gcc_sdm845_resets[] = {
  3115. [GCC_MMSS_BCR] = { 0xb000 },
  3116. [GCC_PCIE_0_BCR] = { 0x6b000 },
  3117. [GCC_PCIE_1_BCR] = { 0x8d000 },
  3118. [GCC_PCIE_PHY_BCR] = { 0x6f000 },
  3119. [GCC_PDM_BCR] = { 0x33000 },
  3120. [GCC_PRNG_BCR] = { 0x34000 },
  3121. [GCC_QUPV3_WRAPPER_0_BCR] = { 0x17000 },
  3122. [GCC_QUPV3_WRAPPER_1_BCR] = { 0x18000 },
  3123. [GCC_QUSB2PHY_PRIM_BCR] = { 0x12000 },
  3124. [GCC_QUSB2PHY_SEC_BCR] = { 0x12004 },
  3125. [GCC_SDCC2_BCR] = { 0x14000 },
  3126. [GCC_SDCC4_BCR] = { 0x16000 },
  3127. [GCC_TSIF_BCR] = { 0x36000 },
  3128. [GCC_UFS_CARD_BCR] = { 0x75000 },
  3129. [GCC_UFS_PHY_BCR] = { 0x77000 },
  3130. [GCC_USB30_PRIM_BCR] = { 0xf000 },
  3131. [GCC_USB30_SEC_BCR] = { 0x10000 },
  3132. [GCC_USB3_PHY_PRIM_BCR] = { 0x50000 },
  3133. [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 },
  3134. [GCC_USB3_DP_PHY_PRIM_BCR] = { 0x50008 },
  3135. [GCC_USB3_PHY_SEC_BCR] = { 0x5000c },
  3136. [GCC_USB3PHY_PHY_SEC_BCR] = { 0x50010 },
  3137. [GCC_USB3_DP_PHY_SEC_BCR] = { 0x50014 },
  3138. [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 },
  3139. [GCC_PCIE_0_PHY_BCR] = { 0x6c01c },
  3140. [GCC_PCIE_1_PHY_BCR] = { 0x8e01c },
  3141. };
  3142. static struct gdsc *gcc_sdm845_gdscs[] = {
  3143. [PCIE_0_GDSC] = &pcie_0_gdsc,
  3144. [PCIE_1_GDSC] = &pcie_1_gdsc,
  3145. [UFS_CARD_GDSC] = &ufs_card_gdsc,
  3146. [UFS_PHY_GDSC] = &ufs_phy_gdsc,
  3147. [USB30_PRIM_GDSC] = &usb30_prim_gdsc,
  3148. [USB30_SEC_GDSC] = &usb30_sec_gdsc,
  3149. [HLOS1_VOTE_AGGRE_NOC_MMU_AUDIO_TBU_GDSC] =
  3150. &hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc,
  3151. [HLOS1_VOTE_AGGRE_NOC_MMU_PCIE_TBU_GDSC] =
  3152. &hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc,
  3153. [HLOS1_VOTE_AGGRE_NOC_MMU_TBU1_GDSC] =
  3154. &hlos1_vote_aggre_noc_mmu_tbu1_gdsc,
  3155. [HLOS1_VOTE_AGGRE_NOC_MMU_TBU2_GDSC] =
  3156. &hlos1_vote_aggre_noc_mmu_tbu2_gdsc,
  3157. [HLOS1_VOTE_MMNOC_MMU_TBU_HF0_GDSC] =
  3158. &hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc,
  3159. [HLOS1_VOTE_MMNOC_MMU_TBU_HF1_GDSC] =
  3160. &hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc,
  3161. [HLOS1_VOTE_MMNOC_MMU_TBU_SF_GDSC] = &hlos1_vote_mmnoc_mmu_tbu_sf_gdsc,
  3162. };
  3163. static const struct regmap_config gcc_sdm845_regmap_config = {
  3164. .reg_bits = 32,
  3165. .reg_stride = 4,
  3166. .val_bits = 32,
  3167. .max_register = 0x182090,
  3168. .fast_io = true,
  3169. };
  3170. static const struct qcom_cc_desc gcc_sdm845_desc = {
  3171. .config = &gcc_sdm845_regmap_config,
  3172. .clks = gcc_sdm845_clocks,
  3173. .num_clks = ARRAY_SIZE(gcc_sdm845_clocks),
  3174. .resets = gcc_sdm845_resets,
  3175. .num_resets = ARRAY_SIZE(gcc_sdm845_resets),
  3176. .gdscs = gcc_sdm845_gdscs,
  3177. .num_gdscs = ARRAY_SIZE(gcc_sdm845_gdscs),
  3178. };
  3179. static const struct of_device_id gcc_sdm845_match_table[] = {
  3180. { .compatible = "qcom,gcc-sdm845" },
  3181. { }
  3182. };
  3183. MODULE_DEVICE_TABLE(of, gcc_sdm845_match_table);
  3184. static int gcc_sdm845_probe(struct platform_device *pdev)
  3185. {
  3186. struct regmap *regmap;
  3187. regmap = qcom_cc_map(pdev, &gcc_sdm845_desc);
  3188. if (IS_ERR(regmap))
  3189. return PTR_ERR(regmap);
  3190. /* Disable the GPLL0 active input to MMSS and GPU via MISC registers */
  3191. regmap_update_bits(regmap, 0x09ffc, 0x3, 0x3);
  3192. regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
  3193. /* Enable CPUSS clocks */
  3194. regmap_update_bits(regmap, 0x48190, BIT(0), 0x1);
  3195. regmap_update_bits(regmap, 0x52004, BIT(22), 0x1);
  3196. return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
  3197. }
  3198. static struct platform_driver gcc_sdm845_driver = {
  3199. .probe = gcc_sdm845_probe,
  3200. .driver = {
  3201. .name = "gcc-sdm845",
  3202. .of_match_table = gcc_sdm845_match_table,
  3203. },
  3204. };
  3205. static int __init gcc_sdm845_init(void)
  3206. {
  3207. return platform_driver_register(&gcc_sdm845_driver);
  3208. }
  3209. subsys_initcall(gcc_sdm845_init);
  3210. static void __exit gcc_sdm845_exit(void)
  3211. {
  3212. platform_driver_unregister(&gcc_sdm845_driver);
  3213. }
  3214. module_exit(gcc_sdm845_exit);
  3215. MODULE_DESCRIPTION("QTI GCC SDM845 Driver");
  3216. MODULE_LICENSE("GPL v2");
  3217. MODULE_ALIAS("platform:gcc-sdm845");