gcc-milos.c 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com>
  5. */
  6. #include <linux/clk-provider.h>
  7. #include <linux/mod_devicetable.h>
  8. #include <linux/module.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/regmap.h>
  11. #include <dt-bindings/clock/qcom,milos-gcc.h>
  12. #include "clk-alpha-pll.h"
  13. #include "clk-branch.h"
  14. #include "clk-rcg.h"
  15. #include "clk-regmap-divider.h"
  16. #include "clk-regmap-mux.h"
  17. #include "gdsc.h"
  18. #include "reset.h"
  19. /* Need to match the order of clocks in DT binding */
  20. enum {
  21. DT_BI_TCXO,
  22. DT_SLEEP_CLK,
  23. DT_PCIE_0_PIPE,
  24. DT_PCIE_1_PIPE,
  25. DT_UFS_PHY_RX_SYMBOL_0,
  26. DT_UFS_PHY_RX_SYMBOL_1,
  27. DT_UFS_PHY_TX_SYMBOL_0,
  28. DT_USB3_PHY_WRAPPER_GCC_USB30_PIPE,
  29. };
  30. enum {
  31. P_BI_TCXO,
  32. P_GCC_GPLL0_OUT_EVEN,
  33. P_GCC_GPLL0_OUT_MAIN,
  34. P_GCC_GPLL0_OUT_ODD,
  35. P_GCC_GPLL2_OUT_MAIN,
  36. P_GCC_GPLL4_OUT_MAIN,
  37. P_GCC_GPLL6_OUT_MAIN,
  38. P_GCC_GPLL7_OUT_MAIN,
  39. P_GCC_GPLL9_OUT_MAIN,
  40. P_PCIE_0_PIPE_CLK,
  41. P_PCIE_1_PIPE_CLK,
  42. P_SLEEP_CLK,
  43. P_UFS_PHY_RX_SYMBOL_0_CLK,
  44. P_UFS_PHY_RX_SYMBOL_1_CLK,
  45. P_UFS_PHY_TX_SYMBOL_0_CLK,
  46. P_USB3_PHY_WRAPPER_GCC_USB30_PIPE_CLK,
  47. };
  48. static struct clk_alpha_pll gcc_gpll0 = {
  49. .offset = 0x0,
  50. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  51. .clkr = {
  52. .enable_reg = 0x52020,
  53. .enable_mask = BIT(0),
  54. .hw.init = &(const struct clk_init_data) {
  55. .name = "gcc_gpll0",
  56. .parent_data = &(const struct clk_parent_data) {
  57. .index = DT_BI_TCXO,
  58. },
  59. .num_parents = 1,
  60. .ops = &clk_alpha_pll_fixed_lucid_ole_ops,
  61. },
  62. },
  63. };
  64. static const struct clk_div_table post_div_table_gcc_gpll0_out_even[] = {
  65. { 0x1, 2 },
  66. { }
  67. };
  68. static struct clk_alpha_pll_postdiv gcc_gpll0_out_even = {
  69. .offset = 0x0,
  70. .post_div_shift = 10,
  71. .post_div_table = post_div_table_gcc_gpll0_out_even,
  72. .num_post_div = ARRAY_SIZE(post_div_table_gcc_gpll0_out_even),
  73. .width = 4,
  74. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  75. .clkr.hw.init = &(const struct clk_init_data) {
  76. .name = "gcc_gpll0_out_even",
  77. .parent_hws = (const struct clk_hw*[]) {
  78. &gcc_gpll0.clkr.hw,
  79. },
  80. .num_parents = 1,
  81. .ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
  82. },
  83. };
  84. static struct clk_alpha_pll gcc_gpll2 = {
  85. .offset = 0x2000,
  86. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  87. .clkr = {
  88. .enable_reg = 0x52020,
  89. .enable_mask = BIT(2),
  90. .hw.init = &(const struct clk_init_data) {
  91. .name = "gcc_gpll2",
  92. .parent_data = &(const struct clk_parent_data) {
  93. .index = DT_BI_TCXO,
  94. },
  95. .num_parents = 1,
  96. .ops = &clk_alpha_pll_fixed_lucid_ole_ops,
  97. },
  98. },
  99. };
  100. static struct clk_alpha_pll gcc_gpll4 = {
  101. .offset = 0x4000,
  102. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  103. .clkr = {
  104. .enable_reg = 0x52020,
  105. .enable_mask = BIT(4),
  106. .hw.init = &(const struct clk_init_data) {
  107. .name = "gcc_gpll4",
  108. .parent_data = &(const struct clk_parent_data) {
  109. .index = DT_BI_TCXO,
  110. },
  111. .num_parents = 1,
  112. .ops = &clk_alpha_pll_fixed_lucid_ole_ops,
  113. },
  114. },
  115. };
  116. static struct clk_alpha_pll gcc_gpll6 = {
  117. .offset = 0x6000,
  118. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  119. .clkr = {
  120. .enable_reg = 0x52020,
  121. .enable_mask = BIT(6),
  122. .hw.init = &(const struct clk_init_data) {
  123. .name = "gcc_gpll6",
  124. .parent_data = &(const struct clk_parent_data) {
  125. .index = DT_BI_TCXO,
  126. },
  127. .num_parents = 1,
  128. .ops = &clk_alpha_pll_fixed_lucid_ole_ops,
  129. },
  130. },
  131. };
  132. static struct clk_alpha_pll gcc_gpll7 = {
  133. .offset = 0x7000,
  134. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  135. .clkr = {
  136. .enable_reg = 0x52020,
  137. .enable_mask = BIT(7),
  138. .hw.init = &(const struct clk_init_data) {
  139. .name = "gcc_gpll7",
  140. .parent_data = &(const struct clk_parent_data) {
  141. .index = DT_BI_TCXO,
  142. },
  143. .num_parents = 1,
  144. .ops = &clk_alpha_pll_fixed_lucid_ole_ops,
  145. },
  146. },
  147. };
  148. static struct clk_alpha_pll gcc_gpll9 = {
  149. .offset = 0x9000,
  150. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  151. .clkr = {
  152. .enable_reg = 0x52020,
  153. .enable_mask = BIT(9),
  154. .hw.init = &(const struct clk_init_data) {
  155. .name = "gcc_gpll9",
  156. .parent_data = &(const struct clk_parent_data) {
  157. .index = DT_BI_TCXO,
  158. },
  159. .num_parents = 1,
  160. .ops = &clk_alpha_pll_fixed_lucid_ole_ops,
  161. },
  162. },
  163. };
  164. static const struct parent_map gcc_parent_map_0[] = {
  165. { P_BI_TCXO, 0 },
  166. { P_GCC_GPLL0_OUT_MAIN, 1 },
  167. { P_GCC_GPLL0_OUT_EVEN, 6 },
  168. };
  169. static const struct clk_parent_data gcc_parent_data_0[] = {
  170. { .index = DT_BI_TCXO },
  171. { .hw = &gcc_gpll0.clkr.hw },
  172. { .hw = &gcc_gpll0_out_even.clkr.hw },
  173. };
  174. static const struct parent_map gcc_parent_map_1[] = {
  175. { P_BI_TCXO, 0 },
  176. { P_GCC_GPLL0_OUT_MAIN, 1 },
  177. { P_SLEEP_CLK, 5 },
  178. { P_GCC_GPLL0_OUT_EVEN, 6 },
  179. };
  180. static const struct clk_parent_data gcc_parent_data_1[] = {
  181. { .index = DT_BI_TCXO },
  182. { .hw = &gcc_gpll0.clkr.hw },
  183. { .index = DT_SLEEP_CLK },
  184. { .hw = &gcc_gpll0_out_even.clkr.hw },
  185. };
  186. static const struct parent_map gcc_parent_map_2[] = {
  187. { P_BI_TCXO, 0 },
  188. { P_GCC_GPLL0_OUT_MAIN, 1 },
  189. { P_GCC_GPLL4_OUT_MAIN, 5 },
  190. { P_GCC_GPLL0_OUT_EVEN, 6 },
  191. };
  192. static const struct clk_parent_data gcc_parent_data_2[] = {
  193. { .index = DT_BI_TCXO },
  194. { .hw = &gcc_gpll0.clkr.hw },
  195. { .hw = &gcc_gpll4.clkr.hw },
  196. { .hw = &gcc_gpll0_out_even.clkr.hw },
  197. };
  198. static const struct parent_map gcc_parent_map_3[] = {
  199. { P_BI_TCXO, 0 },
  200. { P_SLEEP_CLK, 5 },
  201. };
  202. static const struct clk_parent_data gcc_parent_data_3[] = {
  203. { .index = DT_BI_TCXO },
  204. { .index = DT_SLEEP_CLK },
  205. };
  206. static const struct parent_map gcc_parent_map_4[] = {
  207. { P_BI_TCXO, 0 },
  208. { P_GCC_GPLL0_OUT_MAIN, 1 },
  209. { P_GCC_GPLL6_OUT_MAIN, 2 },
  210. { P_GCC_GPLL7_OUT_MAIN, 3 },
  211. { P_GCC_GPLL0_OUT_EVEN, 6 },
  212. };
  213. static const struct clk_parent_data gcc_parent_data_4[] = {
  214. { .index = DT_BI_TCXO },
  215. { .hw = &gcc_gpll0.clkr.hw },
  216. { .hw = &gcc_gpll6.clkr.hw },
  217. { .hw = &gcc_gpll7.clkr.hw },
  218. { .hw = &gcc_gpll0_out_even.clkr.hw },
  219. };
  220. static const struct parent_map gcc_parent_map_5[] = {
  221. { P_BI_TCXO, 0 },
  222. };
  223. static const struct clk_parent_data gcc_parent_data_5[] = {
  224. { .index = DT_BI_TCXO },
  225. };
  226. static const struct parent_map gcc_parent_map_6[] = {
  227. { P_PCIE_0_PIPE_CLK, 0 },
  228. { P_BI_TCXO, 2 },
  229. };
  230. static const struct clk_parent_data gcc_parent_data_6[] = {
  231. { .index = DT_PCIE_0_PIPE },
  232. { .index = DT_BI_TCXO },
  233. };
  234. static const struct parent_map gcc_parent_map_7[] = {
  235. { P_PCIE_1_PIPE_CLK, 0 },
  236. { P_BI_TCXO, 2 },
  237. };
  238. static const struct clk_parent_data gcc_parent_data_7[] = {
  239. { .index = DT_PCIE_1_PIPE },
  240. { .index = DT_BI_TCXO },
  241. };
  242. static const struct parent_map gcc_parent_map_8[] = {
  243. { P_BI_TCXO, 0 },
  244. { P_GCC_GPLL0_OUT_MAIN, 1 },
  245. { P_GCC_GPLL7_OUT_MAIN, 2 },
  246. { P_GCC_GPLL0_OUT_EVEN, 6 },
  247. };
  248. static const struct clk_parent_data gcc_parent_data_8[] = {
  249. { .index = DT_BI_TCXO },
  250. { .hw = &gcc_gpll0.clkr.hw },
  251. { .hw = &gcc_gpll7.clkr.hw },
  252. { .hw = &gcc_gpll0_out_even.clkr.hw },
  253. };
  254. static const struct parent_map gcc_parent_map_9[] = {
  255. { P_BI_TCXO, 0 },
  256. { P_GCC_GPLL0_OUT_MAIN, 1 },
  257. { P_GCC_GPLL6_OUT_MAIN, 2 },
  258. { P_GCC_GPLL0_OUT_ODD, 3 },
  259. { P_GCC_GPLL2_OUT_MAIN, 4 },
  260. { P_GCC_GPLL0_OUT_EVEN, 6 },
  261. };
  262. static const struct clk_parent_data gcc_parent_data_9[] = {
  263. { .index = DT_BI_TCXO },
  264. { .hw = &gcc_gpll0.clkr.hw },
  265. { .hw = &gcc_gpll6.clkr.hw },
  266. { .hw = &gcc_gpll0.clkr.hw },
  267. { .hw = &gcc_gpll2.clkr.hw },
  268. { .hw = &gcc_gpll0_out_even.clkr.hw },
  269. };
  270. static const struct parent_map gcc_parent_map_10[] = {
  271. { P_BI_TCXO, 0 },
  272. { P_GCC_GPLL0_OUT_MAIN, 1 },
  273. { P_GCC_GPLL6_OUT_MAIN, 2 },
  274. { P_GCC_GPLL0_OUT_ODD, 3 },
  275. { P_GCC_GPLL0_OUT_EVEN, 6 },
  276. };
  277. static const struct clk_parent_data gcc_parent_data_10[] = {
  278. { .index = DT_BI_TCXO },
  279. { .hw = &gcc_gpll0.clkr.hw },
  280. { .hw = &gcc_gpll6.clkr.hw },
  281. { .hw = &gcc_gpll0.clkr.hw },
  282. { .hw = &gcc_gpll0_out_even.clkr.hw },
  283. };
  284. static const struct parent_map gcc_parent_map_11[] = {
  285. { P_BI_TCXO, 0 },
  286. { P_GCC_GPLL0_OUT_MAIN, 1 },
  287. { P_GCC_GPLL9_OUT_MAIN, 2 },
  288. { P_GCC_GPLL4_OUT_MAIN, 5 },
  289. { P_GCC_GPLL0_OUT_EVEN, 6 },
  290. };
  291. static const struct clk_parent_data gcc_parent_data_11[] = {
  292. { .index = DT_BI_TCXO },
  293. { .hw = &gcc_gpll0.clkr.hw },
  294. { .hw = &gcc_gpll9.clkr.hw },
  295. { .hw = &gcc_gpll4.clkr.hw },
  296. { .hw = &gcc_gpll0_out_even.clkr.hw },
  297. };
  298. static const struct parent_map gcc_parent_map_12[] = {
  299. { P_UFS_PHY_RX_SYMBOL_0_CLK, 0 },
  300. { P_BI_TCXO, 2 },
  301. };
  302. static const struct clk_parent_data gcc_parent_data_12[] = {
  303. { .index = DT_UFS_PHY_RX_SYMBOL_0 },
  304. { .index = DT_BI_TCXO },
  305. };
  306. static const struct parent_map gcc_parent_map_13[] = {
  307. { P_UFS_PHY_RX_SYMBOL_1_CLK, 0 },
  308. { P_BI_TCXO, 2 },
  309. };
  310. static const struct clk_parent_data gcc_parent_data_13[] = {
  311. { .index = DT_UFS_PHY_RX_SYMBOL_1 },
  312. { .index = DT_BI_TCXO },
  313. };
  314. static const struct parent_map gcc_parent_map_14[] = {
  315. { P_UFS_PHY_TX_SYMBOL_0_CLK, 0 },
  316. { P_BI_TCXO, 2 },
  317. };
  318. static const struct clk_parent_data gcc_parent_data_14[] = {
  319. { .index = DT_UFS_PHY_TX_SYMBOL_0 },
  320. { .index = DT_BI_TCXO },
  321. };
  322. static const struct parent_map gcc_parent_map_15[] = {
  323. { P_USB3_PHY_WRAPPER_GCC_USB30_PIPE_CLK, 0 },
  324. { P_BI_TCXO, 2 },
  325. };
  326. static const struct clk_parent_data gcc_parent_data_15[] = {
  327. { .index = DT_USB3_PHY_WRAPPER_GCC_USB30_PIPE },
  328. { .index = DT_BI_TCXO },
  329. };
  330. static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = {
  331. .reg = 0x6b070,
  332. .shift = 0,
  333. .width = 2,
  334. .parent_map = gcc_parent_map_6,
  335. .clkr = {
  336. .hw.init = &(const struct clk_init_data) {
  337. .name = "gcc_pcie_0_pipe_clk_src",
  338. .parent_data = gcc_parent_data_6,
  339. .num_parents = ARRAY_SIZE(gcc_parent_data_6),
  340. .ops = &clk_regmap_mux_closest_ops,
  341. },
  342. },
  343. };
  344. static struct clk_regmap_mux gcc_pcie_1_pipe_clk_src = {
  345. .reg = 0x9006c,
  346. .shift = 0,
  347. .width = 2,
  348. .parent_map = gcc_parent_map_7,
  349. .clkr = {
  350. .hw.init = &(const struct clk_init_data) {
  351. .name = "gcc_pcie_1_pipe_clk_src",
  352. .parent_data = gcc_parent_data_7,
  353. .num_parents = ARRAY_SIZE(gcc_parent_data_7),
  354. .ops = &clk_regmap_mux_closest_ops,
  355. },
  356. },
  357. };
  358. static struct clk_regmap_mux gcc_ufs_phy_rx_symbol_0_clk_src = {
  359. .reg = 0x77064,
  360. .shift = 0,
  361. .width = 2,
  362. .parent_map = gcc_parent_map_12,
  363. .clkr = {
  364. .hw.init = &(const struct clk_init_data) {
  365. .name = "gcc_ufs_phy_rx_symbol_0_clk_src",
  366. .parent_data = gcc_parent_data_12,
  367. .num_parents = ARRAY_SIZE(gcc_parent_data_12),
  368. .ops = &clk_regmap_mux_closest_ops,
  369. },
  370. },
  371. };
  372. static struct clk_regmap_mux gcc_ufs_phy_rx_symbol_1_clk_src = {
  373. .reg = 0x770e0,
  374. .shift = 0,
  375. .width = 2,
  376. .parent_map = gcc_parent_map_13,
  377. .clkr = {
  378. .hw.init = &(const struct clk_init_data) {
  379. .name = "gcc_ufs_phy_rx_symbol_1_clk_src",
  380. .parent_data = gcc_parent_data_13,
  381. .num_parents = ARRAY_SIZE(gcc_parent_data_13),
  382. .ops = &clk_regmap_mux_closest_ops,
  383. },
  384. },
  385. };
  386. static struct clk_regmap_mux gcc_ufs_phy_tx_symbol_0_clk_src = {
  387. .reg = 0x77054,
  388. .shift = 0,
  389. .width = 2,
  390. .parent_map = gcc_parent_map_14,
  391. .clkr = {
  392. .hw.init = &(const struct clk_init_data) {
  393. .name = "gcc_ufs_phy_tx_symbol_0_clk_src",
  394. .parent_data = gcc_parent_data_14,
  395. .num_parents = ARRAY_SIZE(gcc_parent_data_14),
  396. .ops = &clk_regmap_mux_closest_ops,
  397. },
  398. },
  399. };
  400. static struct clk_regmap_mux gcc_usb3_prim_phy_pipe_clk_src = {
  401. .reg = 0x3906c,
  402. .shift = 0,
  403. .width = 2,
  404. .parent_map = gcc_parent_map_15,
  405. .clkr = {
  406. .hw.init = &(const struct clk_init_data) {
  407. .name = "gcc_usb3_prim_phy_pipe_clk_src",
  408. .parent_data = gcc_parent_data_15,
  409. .num_parents = ARRAY_SIZE(gcc_parent_data_15),
  410. .ops = &clk_regmap_mux_closest_ops,
  411. },
  412. },
  413. };
  414. static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = {
  415. F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
  416. F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0),
  417. F(200000000, P_GCC_GPLL0_OUT_MAIN, 3, 0, 0),
  418. { }
  419. };
  420. static struct clk_rcg2 gcc_gp1_clk_src = {
  421. .cmd_rcgr = 0x64004,
  422. .mnd_width = 16,
  423. .hid_width = 5,
  424. .parent_map = gcc_parent_map_1,
  425. .freq_tbl = ftbl_gcc_gp1_clk_src,
  426. .clkr.hw.init = &(const struct clk_init_data) {
  427. .name = "gcc_gp1_clk_src",
  428. .parent_data = gcc_parent_data_1,
  429. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  430. .ops = &clk_rcg2_shared_ops,
  431. },
  432. };
  433. static struct clk_rcg2 gcc_gp2_clk_src = {
  434. .cmd_rcgr = 0x65004,
  435. .mnd_width = 16,
  436. .hid_width = 5,
  437. .parent_map = gcc_parent_map_1,
  438. .freq_tbl = ftbl_gcc_gp1_clk_src,
  439. .clkr.hw.init = &(const struct clk_init_data) {
  440. .name = "gcc_gp2_clk_src",
  441. .parent_data = gcc_parent_data_1,
  442. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  443. .ops = &clk_rcg2_shared_ops,
  444. },
  445. };
  446. static struct clk_rcg2 gcc_gp3_clk_src = {
  447. .cmd_rcgr = 0x66004,
  448. .mnd_width = 16,
  449. .hid_width = 5,
  450. .parent_map = gcc_parent_map_1,
  451. .freq_tbl = ftbl_gcc_gp1_clk_src,
  452. .clkr.hw.init = &(const struct clk_init_data) {
  453. .name = "gcc_gp3_clk_src",
  454. .parent_data = gcc_parent_data_1,
  455. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  456. .ops = &clk_rcg2_shared_ops,
  457. },
  458. };
  459. static const struct freq_tbl ftbl_gcc_pcie_0_aux_clk_src[] = {
  460. F(19200000, P_BI_TCXO, 1, 0, 0),
  461. { }
  462. };
  463. static struct clk_rcg2 gcc_pcie_0_aux_clk_src = {
  464. .cmd_rcgr = 0x6b074,
  465. .mnd_width = 16,
  466. .hid_width = 5,
  467. .parent_map = gcc_parent_map_3,
  468. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  469. .clkr.hw.init = &(const struct clk_init_data) {
  470. .name = "gcc_pcie_0_aux_clk_src",
  471. .parent_data = gcc_parent_data_3,
  472. .num_parents = ARRAY_SIZE(gcc_parent_data_3),
  473. .ops = &clk_rcg2_shared_ops,
  474. },
  475. };
  476. static const struct freq_tbl ftbl_gcc_pcie_0_phy_rchng_clk_src[] = {
  477. F(19200000, P_BI_TCXO, 1, 0, 0),
  478. F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
  479. { }
  480. };
  481. static struct clk_rcg2 gcc_pcie_0_phy_rchng_clk_src = {
  482. .cmd_rcgr = 0x6b058,
  483. .mnd_width = 0,
  484. .hid_width = 5,
  485. .parent_map = gcc_parent_map_0,
  486. .freq_tbl = ftbl_gcc_pcie_0_phy_rchng_clk_src,
  487. .clkr.hw.init = &(const struct clk_init_data) {
  488. .name = "gcc_pcie_0_phy_rchng_clk_src",
  489. .parent_data = gcc_parent_data_0,
  490. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  491. .ops = &clk_rcg2_shared_ops,
  492. },
  493. };
  494. static struct clk_rcg2 gcc_pcie_1_aux_clk_src = {
  495. .cmd_rcgr = 0x90070,
  496. .mnd_width = 16,
  497. .hid_width = 5,
  498. .parent_map = gcc_parent_map_3,
  499. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  500. .clkr.hw.init = &(const struct clk_init_data) {
  501. .name = "gcc_pcie_1_aux_clk_src",
  502. .parent_data = gcc_parent_data_3,
  503. .num_parents = ARRAY_SIZE(gcc_parent_data_3),
  504. .ops = &clk_rcg2_shared_ops,
  505. },
  506. };
  507. static struct clk_rcg2 gcc_pcie_1_phy_rchng_clk_src = {
  508. .cmd_rcgr = 0x90054,
  509. .mnd_width = 0,
  510. .hid_width = 5,
  511. .parent_map = gcc_parent_map_0,
  512. .freq_tbl = ftbl_gcc_pcie_0_phy_rchng_clk_src,
  513. .clkr.hw.init = &(const struct clk_init_data) {
  514. .name = "gcc_pcie_1_phy_rchng_clk_src",
  515. .parent_data = gcc_parent_data_0,
  516. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  517. .ops = &clk_rcg2_shared_ops,
  518. },
  519. };
  520. static const struct freq_tbl ftbl_gcc_pdm2_clk_src[] = {
  521. F(60000000, P_GCC_GPLL0_OUT_MAIN, 10, 0, 0),
  522. { }
  523. };
  524. static struct clk_rcg2 gcc_pdm2_clk_src = {
  525. .cmd_rcgr = 0x33010,
  526. .mnd_width = 0,
  527. .hid_width = 5,
  528. .parent_map = gcc_parent_map_0,
  529. .freq_tbl = ftbl_gcc_pdm2_clk_src,
  530. .clkr.hw.init = &(const struct clk_init_data) {
  531. .name = "gcc_pdm2_clk_src",
  532. .parent_data = gcc_parent_data_0,
  533. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  534. .ops = &clk_rcg2_shared_ops,
  535. },
  536. };
  537. static const struct freq_tbl ftbl_gcc_qupv3_wrap0_qspi_ref_clk_src[] = {
  538. F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625),
  539. F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625),
  540. F(19200000, P_BI_TCXO, 1, 0, 0),
  541. F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625),
  542. F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75),
  543. F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25),
  544. F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375),
  545. F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75),
  546. F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
  547. F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15),
  548. F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25),
  549. F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0),
  550. F(102400000, P_GCC_GPLL0_OUT_EVEN, 1, 128, 375),
  551. F(112000000, P_GCC_GPLL0_OUT_EVEN, 1, 28, 75),
  552. F(117964800, P_GCC_GPLL0_OUT_EVEN, 1, 6144, 15625),
  553. F(120000000, P_GCC_GPLL0_OUT_MAIN, 5, 0, 0),
  554. F(150000000, P_GCC_GPLL0_OUT_EVEN, 2, 0, 0),
  555. F(200000000, P_GCC_GPLL0_OUT_MAIN, 3, 0, 0),
  556. { }
  557. };
  558. static struct clk_init_data gcc_qupv3_wrap0_qspi_ref_clk_src_init = {
  559. .name = "gcc_qupv3_wrap0_qspi_ref_clk_src",
  560. .parent_data = gcc_parent_data_0,
  561. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  562. .ops = &clk_rcg2_ops,
  563. };
  564. static struct clk_rcg2 gcc_qupv3_wrap0_qspi_ref_clk_src = {
  565. .cmd_rcgr = 0x18768,
  566. .mnd_width = 16,
  567. .hid_width = 5,
  568. .parent_map = gcc_parent_map_0,
  569. .freq_tbl = ftbl_gcc_qupv3_wrap0_qspi_ref_clk_src,
  570. .clkr.hw.init = &gcc_qupv3_wrap0_qspi_ref_clk_src_init,
  571. };
  572. static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = {
  573. F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625),
  574. F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625),
  575. F(19200000, P_BI_TCXO, 1, 0, 0),
  576. F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625),
  577. F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75),
  578. F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25),
  579. F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375),
  580. F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75),
  581. F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
  582. F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15),
  583. F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25),
  584. F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0),
  585. F(102400000, P_GCC_GPLL0_OUT_EVEN, 1, 128, 375),
  586. F(112000000, P_GCC_GPLL0_OUT_EVEN, 1, 28, 75),
  587. F(117964800, P_GCC_GPLL0_OUT_EVEN, 1, 6144, 15625),
  588. F(120000000, P_GCC_GPLL0_OUT_MAIN, 5, 0, 0),
  589. { }
  590. };
  591. static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = {
  592. .name = "gcc_qupv3_wrap0_s0_clk_src",
  593. .parent_data = gcc_parent_data_0,
  594. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  595. .ops = &clk_rcg2_ops,
  596. };
  597. static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
  598. .cmd_rcgr = 0x18010,
  599. .mnd_width = 16,
  600. .hid_width = 5,
  601. .parent_map = gcc_parent_map_0,
  602. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  603. .clkr.hw.init = &gcc_qupv3_wrap0_s0_clk_src_init,
  604. };
  605. static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = {
  606. .name = "gcc_qupv3_wrap0_s1_clk_src",
  607. .parent_data = gcc_parent_data_0,
  608. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  609. .ops = &clk_rcg2_ops,
  610. };
  611. static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
  612. .cmd_rcgr = 0x18148,
  613. .mnd_width = 16,
  614. .hid_width = 5,
  615. .parent_map = gcc_parent_map_0,
  616. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  617. .clkr.hw.init = &gcc_qupv3_wrap0_s1_clk_src_init,
  618. };
  619. static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s3_clk_src[] = {
  620. F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625),
  621. F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625),
  622. F(19200000, P_BI_TCXO, 1, 0, 0),
  623. F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625),
  624. F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75),
  625. F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25),
  626. F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375),
  627. F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75),
  628. F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
  629. F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15),
  630. F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25),
  631. F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0),
  632. { }
  633. };
  634. static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = {
  635. .name = "gcc_qupv3_wrap0_s3_clk_src",
  636. .parent_data = gcc_parent_data_0,
  637. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  638. .ops = &clk_rcg2_ops,
  639. };
  640. static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
  641. .cmd_rcgr = 0x18290,
  642. .mnd_width = 16,
  643. .hid_width = 5,
  644. .parent_map = gcc_parent_map_0,
  645. .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src,
  646. .clkr.hw.init = &gcc_qupv3_wrap0_s3_clk_src_init,
  647. };
  648. static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s4_clk_src[] = {
  649. F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625),
  650. F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625),
  651. F(19200000, P_BI_TCXO, 1, 0, 0),
  652. F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625),
  653. F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75),
  654. F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25),
  655. F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375),
  656. F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75),
  657. F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15),
  658. F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25),
  659. F(128000000, P_GCC_GPLL6_OUT_MAIN, 3, 0, 0),
  660. { }
  661. };
  662. static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = {
  663. .name = "gcc_qupv3_wrap0_s4_clk_src",
  664. .parent_data = gcc_parent_data_4,
  665. .num_parents = ARRAY_SIZE(gcc_parent_data_4),
  666. .ops = &clk_rcg2_ops,
  667. };
  668. static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
  669. .cmd_rcgr = 0x183c8,
  670. .mnd_width = 16,
  671. .hid_width = 5,
  672. .parent_map = gcc_parent_map_4,
  673. .freq_tbl = ftbl_gcc_qupv3_wrap0_s4_clk_src,
  674. .clkr.hw.init = &gcc_qupv3_wrap0_s4_clk_src_init,
  675. };
  676. static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = {
  677. .name = "gcc_qupv3_wrap0_s5_clk_src",
  678. .parent_data = gcc_parent_data_0,
  679. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  680. .ops = &clk_rcg2_ops,
  681. };
  682. static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
  683. .cmd_rcgr = 0x18500,
  684. .mnd_width = 16,
  685. .hid_width = 5,
  686. .parent_map = gcc_parent_map_0,
  687. .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src,
  688. .clkr.hw.init = &gcc_qupv3_wrap0_s5_clk_src_init,
  689. };
  690. static struct clk_init_data gcc_qupv3_wrap0_s6_clk_src_init = {
  691. .name = "gcc_qupv3_wrap0_s6_clk_src",
  692. .parent_data = gcc_parent_data_0,
  693. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  694. .ops = &clk_rcg2_ops,
  695. };
  696. static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
  697. .cmd_rcgr = 0x18638,
  698. .mnd_width = 16,
  699. .hid_width = 5,
  700. .parent_map = gcc_parent_map_0,
  701. .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src,
  702. .clkr.hw.init = &gcc_qupv3_wrap0_s6_clk_src_init,
  703. };
  704. static struct clk_init_data gcc_qupv3_wrap1_qspi_ref_clk_src_init = {
  705. .name = "gcc_qupv3_wrap1_qspi_ref_clk_src",
  706. .parent_data = gcc_parent_data_0,
  707. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  708. .ops = &clk_rcg2_ops,
  709. };
  710. static struct clk_rcg2 gcc_qupv3_wrap1_qspi_ref_clk_src = {
  711. .cmd_rcgr = 0x1e768,
  712. .mnd_width = 16,
  713. .hid_width = 5,
  714. .parent_map = gcc_parent_map_0,
  715. .freq_tbl = ftbl_gcc_qupv3_wrap0_qspi_ref_clk_src,
  716. .clkr.hw.init = &gcc_qupv3_wrap1_qspi_ref_clk_src_init,
  717. };
  718. static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = {
  719. .name = "gcc_qupv3_wrap1_s0_clk_src",
  720. .parent_data = gcc_parent_data_0,
  721. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  722. .ops = &clk_rcg2_ops,
  723. };
  724. static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
  725. .cmd_rcgr = 0x1e010,
  726. .mnd_width = 16,
  727. .hid_width = 5,
  728. .parent_map = gcc_parent_map_0,
  729. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  730. .clkr.hw.init = &gcc_qupv3_wrap1_s0_clk_src_init,
  731. };
  732. static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = {
  733. .name = "gcc_qupv3_wrap1_s1_clk_src",
  734. .parent_data = gcc_parent_data_0,
  735. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  736. .ops = &clk_rcg2_ops,
  737. };
  738. static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
  739. .cmd_rcgr = 0x1e148,
  740. .mnd_width = 16,
  741. .hid_width = 5,
  742. .parent_map = gcc_parent_map_0,
  743. .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
  744. .clkr.hw.init = &gcc_qupv3_wrap1_s1_clk_src_init,
  745. };
  746. static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = {
  747. .name = "gcc_qupv3_wrap1_s3_clk_src",
  748. .parent_data = gcc_parent_data_0,
  749. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  750. .ops = &clk_rcg2_ops,
  751. };
  752. static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
  753. .cmd_rcgr = 0x1e290,
  754. .mnd_width = 16,
  755. .hid_width = 5,
  756. .parent_map = gcc_parent_map_0,
  757. .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src,
  758. .clkr.hw.init = &gcc_qupv3_wrap1_s3_clk_src_init,
  759. };
  760. static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = {
  761. .name = "gcc_qupv3_wrap1_s4_clk_src",
  762. .parent_data = gcc_parent_data_4,
  763. .num_parents = ARRAY_SIZE(gcc_parent_data_4),
  764. .ops = &clk_rcg2_ops,
  765. };
  766. static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
  767. .cmd_rcgr = 0x1e3c8,
  768. .mnd_width = 16,
  769. .hid_width = 5,
  770. .parent_map = gcc_parent_map_4,
  771. .freq_tbl = ftbl_gcc_qupv3_wrap0_s4_clk_src,
  772. .clkr.hw.init = &gcc_qupv3_wrap1_s4_clk_src_init,
  773. };
  774. static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = {
  775. .name = "gcc_qupv3_wrap1_s5_clk_src",
  776. .parent_data = gcc_parent_data_0,
  777. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  778. .ops = &clk_rcg2_ops,
  779. };
  780. static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
  781. .cmd_rcgr = 0x1e500,
  782. .mnd_width = 16,
  783. .hid_width = 5,
  784. .parent_map = gcc_parent_map_0,
  785. .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src,
  786. .clkr.hw.init = &gcc_qupv3_wrap1_s5_clk_src_init,
  787. };
  788. static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = {
  789. .name = "gcc_qupv3_wrap1_s6_clk_src",
  790. .parent_data = gcc_parent_data_8,
  791. .num_parents = ARRAY_SIZE(gcc_parent_data_8),
  792. .ops = &clk_rcg2_ops,
  793. };
  794. static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
  795. .cmd_rcgr = 0x1e638,
  796. .mnd_width = 16,
  797. .hid_width = 5,
  798. .parent_map = gcc_parent_map_8,
  799. .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src,
  800. .clkr.hw.init = &gcc_qupv3_wrap1_s6_clk_src_init,
  801. };
  802. static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_src[] = {
  803. F(144000, P_BI_TCXO, 16, 3, 25),
  804. F(400000, P_BI_TCXO, 12, 1, 4),
  805. F(20000000, P_GCC_GPLL0_OUT_EVEN, 5, 1, 3),
  806. F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
  807. F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
  808. F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
  809. F(192000000, P_GCC_GPLL6_OUT_MAIN, 2, 0, 0),
  810. F(384000000, P_GCC_GPLL6_OUT_MAIN, 1, 0, 0),
  811. { }
  812. };
  813. static struct clk_rcg2 gcc_sdcc1_apps_clk_src = {
  814. .cmd_rcgr = 0xa3014,
  815. .mnd_width = 8,
  816. .hid_width = 5,
  817. .parent_map = gcc_parent_map_9,
  818. .freq_tbl = ftbl_gcc_sdcc1_apps_clk_src,
  819. .clkr.hw.init = &(const struct clk_init_data) {
  820. .name = "gcc_sdcc1_apps_clk_src",
  821. .parent_data = gcc_parent_data_9,
  822. .num_parents = ARRAY_SIZE(gcc_parent_data_9),
  823. .ops = &clk_rcg2_shared_floor_ops,
  824. },
  825. };
  826. static const struct freq_tbl ftbl_gcc_sdcc1_ice_core_clk_src[] = {
  827. F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
  828. F(150000000, P_GCC_GPLL0_OUT_EVEN, 2, 0, 0),
  829. F(300000000, P_GCC_GPLL0_OUT_EVEN, 1, 0, 0),
  830. { }
  831. };
  832. static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = {
  833. .cmd_rcgr = 0xa3038,
  834. .mnd_width = 0,
  835. .hid_width = 5,
  836. .parent_map = gcc_parent_map_10,
  837. .freq_tbl = ftbl_gcc_sdcc1_ice_core_clk_src,
  838. .clkr.hw.init = &(const struct clk_init_data) {
  839. .name = "gcc_sdcc1_ice_core_clk_src",
  840. .parent_data = gcc_parent_data_10,
  841. .num_parents = ARRAY_SIZE(gcc_parent_data_10),
  842. .ops = &clk_rcg2_shared_floor_ops,
  843. },
  844. };
  845. static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
  846. F(400000, P_BI_TCXO, 12, 1, 4),
  847. F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
  848. F(37500000, P_GCC_GPLL0_OUT_EVEN, 8, 0, 0),
  849. F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
  850. F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
  851. F(202000000, P_GCC_GPLL9_OUT_MAIN, 4, 0, 0),
  852. { }
  853. };
  854. static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
  855. .cmd_rcgr = 0x14018,
  856. .mnd_width = 8,
  857. .hid_width = 5,
  858. .parent_map = gcc_parent_map_11,
  859. .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src,
  860. .clkr.hw.init = &(const struct clk_init_data) {
  861. .name = "gcc_sdcc2_apps_clk_src",
  862. .parent_data = gcc_parent_data_11,
  863. .num_parents = ARRAY_SIZE(gcc_parent_data_11),
  864. .ops = &clk_rcg2_shared_floor_ops,
  865. },
  866. };
  867. static const struct freq_tbl ftbl_gcc_ufs_phy_axi_clk_src[] = {
  868. F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
  869. F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
  870. F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
  871. F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0),
  872. F(300000000, P_GCC_GPLL0_OUT_MAIN, 2, 0, 0),
  873. { }
  874. };
  875. static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = {
  876. .cmd_rcgr = 0x77030,
  877. .mnd_width = 8,
  878. .hid_width = 5,
  879. .parent_map = gcc_parent_map_2,
  880. .freq_tbl = ftbl_gcc_ufs_phy_axi_clk_src,
  881. .clkr.hw.init = &(const struct clk_init_data) {
  882. .name = "gcc_ufs_phy_axi_clk_src",
  883. .parent_data = gcc_parent_data_2,
  884. .num_parents = ARRAY_SIZE(gcc_parent_data_2),
  885. .ops = &clk_rcg2_shared_ops,
  886. },
  887. };
  888. static const struct freq_tbl ftbl_gcc_ufs_phy_ice_core_clk_src[] = {
  889. F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
  890. F(201500000, P_GCC_GPLL4_OUT_MAIN, 4, 0, 0),
  891. F(403000000, P_GCC_GPLL4_OUT_MAIN, 2, 0, 0),
  892. { }
  893. };
  894. static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = {
  895. .cmd_rcgr = 0x77080,
  896. .mnd_width = 0,
  897. .hid_width = 5,
  898. .parent_map = gcc_parent_map_2,
  899. .freq_tbl = ftbl_gcc_ufs_phy_ice_core_clk_src,
  900. .clkr.hw.init = &(const struct clk_init_data) {
  901. .name = "gcc_ufs_phy_ice_core_clk_src",
  902. .parent_data = gcc_parent_data_2,
  903. .num_parents = ARRAY_SIZE(gcc_parent_data_2),
  904. .ops = &clk_rcg2_shared_ops,
  905. },
  906. };
  907. static const struct freq_tbl ftbl_gcc_ufs_phy_phy_aux_clk_src[] = {
  908. F(9600000, P_BI_TCXO, 2, 0, 0),
  909. F(19200000, P_BI_TCXO, 1, 0, 0),
  910. { }
  911. };
  912. static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = {
  913. .cmd_rcgr = 0x770b4,
  914. .mnd_width = 0,
  915. .hid_width = 5,
  916. .parent_map = gcc_parent_map_5,
  917. .freq_tbl = ftbl_gcc_ufs_phy_phy_aux_clk_src,
  918. .clkr.hw.init = &(const struct clk_init_data) {
  919. .name = "gcc_ufs_phy_phy_aux_clk_src",
  920. .parent_data = gcc_parent_data_5,
  921. .num_parents = ARRAY_SIZE(gcc_parent_data_5),
  922. .ops = &clk_rcg2_shared_ops,
  923. },
  924. };
  925. static const struct freq_tbl ftbl_gcc_ufs_phy_unipro_core_clk_src[] = {
  926. F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
  927. F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0),
  928. F(300000000, P_GCC_GPLL0_OUT_MAIN, 2, 0, 0),
  929. { }
  930. };
  931. static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = {
  932. .cmd_rcgr = 0x77098,
  933. .mnd_width = 0,
  934. .hid_width = 5,
  935. .parent_map = gcc_parent_map_2,
  936. .freq_tbl = ftbl_gcc_ufs_phy_unipro_core_clk_src,
  937. .clkr.hw.init = &(const struct clk_init_data) {
  938. .name = "gcc_ufs_phy_unipro_core_clk_src",
  939. .parent_data = gcc_parent_data_2,
  940. .num_parents = ARRAY_SIZE(gcc_parent_data_2),
  941. .ops = &clk_rcg2_shared_ops,
  942. },
  943. };
  944. static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = {
  945. F(66666667, P_GCC_GPLL0_OUT_EVEN, 4.5, 0, 0),
  946. F(133333333, P_GCC_GPLL0_OUT_MAIN, 4.5, 0, 0),
  947. F(200000000, P_GCC_GPLL0_OUT_MAIN, 3, 0, 0),
  948. F(240000000, P_GCC_GPLL0_OUT_MAIN, 2.5, 0, 0),
  949. { }
  950. };
  951. static struct clk_rcg2 gcc_usb30_prim_master_clk_src = {
  952. .cmd_rcgr = 0x3902c,
  953. .mnd_width = 8,
  954. .hid_width = 5,
  955. .parent_map = gcc_parent_map_0,
  956. .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src,
  957. .clkr.hw.init = &(const struct clk_init_data) {
  958. .name = "gcc_usb30_prim_master_clk_src",
  959. .parent_data = gcc_parent_data_0,
  960. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  961. .ops = &clk_rcg2_shared_ops,
  962. },
  963. };
  964. static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = {
  965. .cmd_rcgr = 0x39044,
  966. .mnd_width = 0,
  967. .hid_width = 5,
  968. .parent_map = gcc_parent_map_0,
  969. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  970. .clkr.hw.init = &(const struct clk_init_data) {
  971. .name = "gcc_usb30_prim_mock_utmi_clk_src",
  972. .parent_data = gcc_parent_data_0,
  973. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  974. .ops = &clk_rcg2_shared_ops,
  975. },
  976. };
  977. static struct clk_rcg2 gcc_usb3_prim_phy_aux_clk_src = {
  978. .cmd_rcgr = 0x39070,
  979. .mnd_width = 0,
  980. .hid_width = 5,
  981. .parent_map = gcc_parent_map_3,
  982. .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
  983. .clkr.hw.init = &(const struct clk_init_data) {
  984. .name = "gcc_usb3_prim_phy_aux_clk_src",
  985. .parent_data = gcc_parent_data_3,
  986. .num_parents = ARRAY_SIZE(gcc_parent_data_3),
  987. .ops = &clk_rcg2_shared_ops,
  988. },
  989. };
  990. static struct clk_regmap_div gcc_pcie_0_pipe_div2_clk_src = {
  991. .reg = 0x6b094,
  992. .shift = 0,
  993. .width = 4,
  994. .clkr.hw.init = &(const struct clk_init_data) {
  995. .name = "gcc_pcie_0_pipe_div2_clk_src",
  996. .parent_hws = (const struct clk_hw*[]) {
  997. &gcc_pcie_0_pipe_clk_src.clkr.hw,
  998. },
  999. .num_parents = 1,
  1000. .flags = CLK_SET_RATE_PARENT,
  1001. .ops = &clk_regmap_div_ro_ops,
  1002. },
  1003. };
  1004. static struct clk_regmap_div gcc_pcie_1_pipe_div2_clk_src = {
  1005. .reg = 0x90090,
  1006. .shift = 0,
  1007. .width = 4,
  1008. .clkr.hw.init = &(const struct clk_init_data) {
  1009. .name = "gcc_pcie_1_pipe_div2_clk_src",
  1010. .parent_hws = (const struct clk_hw*[]) {
  1011. &gcc_pcie_1_pipe_clk_src.clkr.hw,
  1012. },
  1013. .num_parents = 1,
  1014. .flags = CLK_SET_RATE_PARENT,
  1015. .ops = &clk_regmap_div_ro_ops,
  1016. },
  1017. };
  1018. static struct clk_regmap_div gcc_qupv3_wrap0_s2_clk_src = {
  1019. .reg = 0x18280,
  1020. .shift = 0,
  1021. .width = 4,
  1022. .clkr.hw.init = &(const struct clk_init_data) {
  1023. .name = "gcc_qupv3_wrap0_s2_clk_src",
  1024. .parent_hws = (const struct clk_hw*[]) {
  1025. &gcc_qupv3_wrap0_qspi_ref_clk_src.clkr.hw,
  1026. },
  1027. .num_parents = 1,
  1028. .flags = CLK_SET_RATE_PARENT,
  1029. .ops = &clk_regmap_div_ro_ops,
  1030. },
  1031. };
  1032. static struct clk_regmap_div gcc_qupv3_wrap1_s2_clk_src = {
  1033. .reg = 0x1e280,
  1034. .shift = 0,
  1035. .width = 4,
  1036. .clkr.hw.init = &(const struct clk_init_data) {
  1037. .name = "gcc_qupv3_wrap1_s2_clk_src",
  1038. .parent_hws = (const struct clk_hw*[]) {
  1039. &gcc_qupv3_wrap1_qspi_ref_clk_src.clkr.hw,
  1040. },
  1041. .num_parents = 1,
  1042. .flags = CLK_SET_RATE_PARENT,
  1043. .ops = &clk_regmap_div_ro_ops,
  1044. },
  1045. };
  1046. static struct clk_regmap_div gcc_usb30_prim_mock_utmi_postdiv_clk_src = {
  1047. .reg = 0x3905c,
  1048. .shift = 0,
  1049. .width = 4,
  1050. .clkr.hw.init = &(const struct clk_init_data) {
  1051. .name = "gcc_usb30_prim_mock_utmi_postdiv_clk_src",
  1052. .parent_hws = (const struct clk_hw*[]) {
  1053. &gcc_usb30_prim_mock_utmi_clk_src.clkr.hw,
  1054. },
  1055. .num_parents = 1,
  1056. .flags = CLK_SET_RATE_PARENT,
  1057. .ops = &clk_regmap_div_ro_ops,
  1058. },
  1059. };
  1060. static struct clk_branch gcc_aggre_noc_pcie_axi_clk = {
  1061. .halt_reg = 0x1005c,
  1062. .halt_check = BRANCH_HALT_SKIP,
  1063. .hwcg_reg = 0x1005c,
  1064. .hwcg_bit = 1,
  1065. .clkr = {
  1066. .enable_reg = 0x52000,
  1067. .enable_mask = BIT(12),
  1068. .hw.init = &(const struct clk_init_data) {
  1069. .name = "gcc_aggre_noc_pcie_axi_clk",
  1070. .ops = &clk_branch2_ops,
  1071. },
  1072. },
  1073. };
  1074. static struct clk_branch gcc_aggre_ufs_phy_axi_clk = {
  1075. .halt_reg = 0x770e4,
  1076. .halt_check = BRANCH_HALT_VOTED,
  1077. .hwcg_reg = 0x770e4,
  1078. .hwcg_bit = 1,
  1079. .clkr = {
  1080. .enable_reg = 0x770e4,
  1081. .enable_mask = BIT(0),
  1082. .hw.init = &(const struct clk_init_data) {
  1083. .name = "gcc_aggre_ufs_phy_axi_clk",
  1084. .parent_hws = (const struct clk_hw*[]) {
  1085. &gcc_ufs_phy_axi_clk_src.clkr.hw,
  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_aggre_ufs_phy_axi_hw_ctl_clk = {
  1094. .halt_reg = 0x770e4,
  1095. .halt_check = BRANCH_HALT_VOTED,
  1096. .hwcg_reg = 0x770e4,
  1097. .hwcg_bit = 1,
  1098. .clkr = {
  1099. .enable_reg = 0x770e4,
  1100. .enable_mask = BIT(1),
  1101. .hw.init = &(const struct clk_init_data) {
  1102. .name = "gcc_aggre_ufs_phy_axi_hw_ctl_clk",
  1103. .parent_hws = (const struct clk_hw*[]) {
  1104. &gcc_ufs_phy_axi_clk_src.clkr.hw,
  1105. },
  1106. .num_parents = 1,
  1107. .flags = CLK_SET_RATE_PARENT,
  1108. .ops = &clk_branch2_ops,
  1109. },
  1110. },
  1111. };
  1112. static struct clk_branch gcc_aggre_usb3_prim_axi_clk = {
  1113. .halt_reg = 0x39090,
  1114. .halt_check = BRANCH_HALT_VOTED,
  1115. .hwcg_reg = 0x39090,
  1116. .hwcg_bit = 1,
  1117. .clkr = {
  1118. .enable_reg = 0x39090,
  1119. .enable_mask = BIT(0),
  1120. .hw.init = &(const struct clk_init_data) {
  1121. .name = "gcc_aggre_usb3_prim_axi_clk",
  1122. .parent_hws = (const struct clk_hw*[]) {
  1123. &gcc_usb30_prim_master_clk_src.clkr.hw,
  1124. },
  1125. .num_parents = 1,
  1126. .flags = CLK_SET_RATE_PARENT,
  1127. .ops = &clk_branch2_ops,
  1128. },
  1129. },
  1130. };
  1131. static struct clk_branch gcc_boot_rom_ahb_clk = {
  1132. .halt_reg = 0x38004,
  1133. .halt_check = BRANCH_HALT_VOTED,
  1134. .hwcg_reg = 0x38004,
  1135. .hwcg_bit = 1,
  1136. .clkr = {
  1137. .enable_reg = 0x52000,
  1138. .enable_mask = BIT(10),
  1139. .hw.init = &(const struct clk_init_data) {
  1140. .name = "gcc_boot_rom_ahb_clk",
  1141. .ops = &clk_branch2_ops,
  1142. },
  1143. },
  1144. };
  1145. static struct clk_branch gcc_camera_hf_axi_clk = {
  1146. .halt_reg = 0x26010,
  1147. .halt_check = BRANCH_HALT_SKIP,
  1148. .hwcg_reg = 0x26010,
  1149. .hwcg_bit = 1,
  1150. .clkr = {
  1151. .enable_reg = 0x26010,
  1152. .enable_mask = BIT(0),
  1153. .hw.init = &(const struct clk_init_data) {
  1154. .name = "gcc_camera_hf_axi_clk",
  1155. .ops = &clk_branch2_ops,
  1156. },
  1157. },
  1158. };
  1159. static struct clk_branch gcc_camera_sf_axi_clk = {
  1160. .halt_reg = 0x26014,
  1161. .halt_check = BRANCH_HALT_SKIP,
  1162. .hwcg_reg = 0x26014,
  1163. .hwcg_bit = 1,
  1164. .clkr = {
  1165. .enable_reg = 0x26014,
  1166. .enable_mask = BIT(0),
  1167. .hw.init = &(const struct clk_init_data) {
  1168. .name = "gcc_camera_sf_axi_clk",
  1169. .ops = &clk_branch2_ops,
  1170. },
  1171. },
  1172. };
  1173. static struct clk_branch gcc_cfg_noc_pcie_anoc_ahb_clk = {
  1174. .halt_reg = 0x10050,
  1175. .halt_check = BRANCH_HALT_SKIP,
  1176. .hwcg_reg = 0x10050,
  1177. .hwcg_bit = 1,
  1178. .clkr = {
  1179. .enable_reg = 0x52000,
  1180. .enable_mask = BIT(20),
  1181. .hw.init = &(const struct clk_init_data) {
  1182. .name = "gcc_cfg_noc_pcie_anoc_ahb_clk",
  1183. .ops = &clk_branch2_ops,
  1184. },
  1185. },
  1186. };
  1187. static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = {
  1188. .halt_reg = 0x3908c,
  1189. .halt_check = BRANCH_HALT_VOTED,
  1190. .clkr = {
  1191. .enable_reg = 0x3908c,
  1192. .enable_mask = BIT(0),
  1193. .hw.init = &(const struct clk_init_data) {
  1194. .name = "gcc_cfg_noc_usb3_prim_axi_clk",
  1195. .parent_hws = (const struct clk_hw*[]) {
  1196. &gcc_usb30_prim_master_clk_src.clkr.hw,
  1197. },
  1198. .num_parents = 1,
  1199. .flags = CLK_SET_RATE_PARENT,
  1200. .ops = &clk_branch2_ops,
  1201. },
  1202. },
  1203. };
  1204. static struct clk_branch gcc_cnoc_pcie_sf_axi_clk = {
  1205. .halt_reg = 0x10058,
  1206. .halt_check = BRANCH_HALT_VOTED,
  1207. .hwcg_reg = 0x10058,
  1208. .hwcg_bit = 1,
  1209. .clkr = {
  1210. .enable_reg = 0x52008,
  1211. .enable_mask = BIT(6),
  1212. .hw.init = &(const struct clk_init_data) {
  1213. .name = "gcc_cnoc_pcie_sf_axi_clk",
  1214. .ops = &clk_branch2_ops,
  1215. },
  1216. },
  1217. };
  1218. static struct clk_branch gcc_ddrss_gpu_axi_clk = {
  1219. .halt_reg = 0x7115c,
  1220. .halt_check = BRANCH_HALT_SKIP,
  1221. .hwcg_reg = 0x7115c,
  1222. .hwcg_bit = 1,
  1223. .clkr = {
  1224. .enable_reg = 0x7115c,
  1225. .enable_mask = BIT(0),
  1226. .hw.init = &(const struct clk_init_data) {
  1227. .name = "gcc_ddrss_gpu_axi_clk",
  1228. .ops = &clk_branch2_aon_ops,
  1229. },
  1230. },
  1231. };
  1232. static struct clk_branch gcc_ddrss_pcie_sf_qtb_clk = {
  1233. .halt_reg = 0x1006c,
  1234. .halt_check = BRANCH_HALT_SKIP,
  1235. .hwcg_reg = 0x1006c,
  1236. .hwcg_bit = 1,
  1237. .clkr = {
  1238. .enable_reg = 0x52000,
  1239. .enable_mask = BIT(19),
  1240. .hw.init = &(const struct clk_init_data) {
  1241. .name = "gcc_ddrss_pcie_sf_qtb_clk",
  1242. .ops = &clk_branch2_ops,
  1243. },
  1244. },
  1245. };
  1246. static struct clk_branch gcc_disp_gpll0_div_clk_src = {
  1247. .halt_check = BRANCH_HALT_DELAY,
  1248. .clkr = {
  1249. .enable_reg = 0x52000,
  1250. .enable_mask = BIT(23),
  1251. .hw.init = &(const struct clk_init_data) {
  1252. .name = "gcc_disp_gpll0_div_clk_src",
  1253. .parent_hws = (const struct clk_hw*[]) {
  1254. &gcc_gpll0_out_even.clkr.hw,
  1255. },
  1256. .num_parents = 1,
  1257. .flags = CLK_SET_RATE_PARENT,
  1258. .ops = &clk_branch2_ops,
  1259. },
  1260. },
  1261. };
  1262. static struct clk_branch gcc_disp_hf_axi_clk = {
  1263. .halt_reg = 0x2700c,
  1264. .halt_check = BRANCH_HALT_SKIP,
  1265. .hwcg_reg = 0x2700c,
  1266. .hwcg_bit = 1,
  1267. .clkr = {
  1268. .enable_reg = 0x2700c,
  1269. .enable_mask = BIT(0),
  1270. .hw.init = &(const struct clk_init_data) {
  1271. .name = "gcc_disp_hf_axi_clk",
  1272. .ops = &clk_branch2_ops,
  1273. },
  1274. },
  1275. };
  1276. static struct clk_branch gcc_gp1_clk = {
  1277. .halt_reg = 0x64000,
  1278. .halt_check = BRANCH_HALT,
  1279. .clkr = {
  1280. .enable_reg = 0x64000,
  1281. .enable_mask = BIT(0),
  1282. .hw.init = &(const struct clk_init_data) {
  1283. .name = "gcc_gp1_clk",
  1284. .parent_hws = (const struct clk_hw*[]) {
  1285. &gcc_gp1_clk_src.clkr.hw,
  1286. },
  1287. .num_parents = 1,
  1288. .flags = CLK_SET_RATE_PARENT,
  1289. .ops = &clk_branch2_ops,
  1290. },
  1291. },
  1292. };
  1293. static struct clk_branch gcc_gp2_clk = {
  1294. .halt_reg = 0x65000,
  1295. .halt_check = BRANCH_HALT,
  1296. .clkr = {
  1297. .enable_reg = 0x65000,
  1298. .enable_mask = BIT(0),
  1299. .hw.init = &(const struct clk_init_data) {
  1300. .name = "gcc_gp2_clk",
  1301. .parent_hws = (const struct clk_hw*[]) {
  1302. &gcc_gp2_clk_src.clkr.hw,
  1303. },
  1304. .num_parents = 1,
  1305. .flags = CLK_SET_RATE_PARENT,
  1306. .ops = &clk_branch2_ops,
  1307. },
  1308. },
  1309. };
  1310. static struct clk_branch gcc_gp3_clk = {
  1311. .halt_reg = 0x66000,
  1312. .halt_check = BRANCH_HALT,
  1313. .clkr = {
  1314. .enable_reg = 0x66000,
  1315. .enable_mask = BIT(0),
  1316. .hw.init = &(const struct clk_init_data) {
  1317. .name = "gcc_gp3_clk",
  1318. .parent_hws = (const struct clk_hw*[]) {
  1319. &gcc_gp3_clk_src.clkr.hw,
  1320. },
  1321. .num_parents = 1,
  1322. .flags = CLK_SET_RATE_PARENT,
  1323. .ops = &clk_branch2_ops,
  1324. },
  1325. },
  1326. };
  1327. static struct clk_branch gcc_gpu_gpll0_clk_src = {
  1328. .halt_check = BRANCH_HALT_DELAY,
  1329. .clkr = {
  1330. .enable_reg = 0x52000,
  1331. .enable_mask = BIT(15),
  1332. .hw.init = &(const struct clk_init_data) {
  1333. .name = "gcc_gpu_gpll0_clk_src",
  1334. .parent_hws = (const struct clk_hw*[]) {
  1335. &gcc_gpll0.clkr.hw,
  1336. },
  1337. .num_parents = 1,
  1338. .flags = CLK_SET_RATE_PARENT,
  1339. .ops = &clk_branch2_ops,
  1340. },
  1341. },
  1342. };
  1343. static struct clk_branch gcc_gpu_gpll0_div_clk_src = {
  1344. .halt_check = BRANCH_HALT_DELAY,
  1345. .clkr = {
  1346. .enable_reg = 0x52000,
  1347. .enable_mask = BIT(16),
  1348. .hw.init = &(const struct clk_init_data) {
  1349. .name = "gcc_gpu_gpll0_div_clk_src",
  1350. .parent_hws = (const struct clk_hw*[]) {
  1351. &gcc_gpll0_out_even.clkr.hw,
  1352. },
  1353. .num_parents = 1,
  1354. .flags = CLK_SET_RATE_PARENT,
  1355. .ops = &clk_branch2_ops,
  1356. },
  1357. },
  1358. };
  1359. static struct clk_branch gcc_gpu_memnoc_gfx_clk = {
  1360. .halt_reg = 0x71010,
  1361. .halt_check = BRANCH_HALT_VOTED,
  1362. .hwcg_reg = 0x71010,
  1363. .hwcg_bit = 1,
  1364. .clkr = {
  1365. .enable_reg = 0x71010,
  1366. .enable_mask = BIT(0),
  1367. .hw.init = &(const struct clk_init_data) {
  1368. .name = "gcc_gpu_memnoc_gfx_clk",
  1369. .ops = &clk_branch2_ops,
  1370. },
  1371. },
  1372. };
  1373. static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = {
  1374. .halt_reg = 0x71018,
  1375. .halt_check = BRANCH_HALT_DELAY,
  1376. .clkr = {
  1377. .enable_reg = 0x71018,
  1378. .enable_mask = BIT(0),
  1379. .hw.init = &(const struct clk_init_data) {
  1380. .name = "gcc_gpu_snoc_dvm_gfx_clk",
  1381. .ops = &clk_branch2_ops,
  1382. },
  1383. },
  1384. };
  1385. static struct clk_branch gcc_pcie_0_aux_clk = {
  1386. .halt_reg = 0x6b03c,
  1387. .halt_check = BRANCH_HALT_VOTED,
  1388. .clkr = {
  1389. .enable_reg = 0x52008,
  1390. .enable_mask = BIT(3),
  1391. .hw.init = &(const struct clk_init_data) {
  1392. .name = "gcc_pcie_0_aux_clk",
  1393. .parent_hws = (const struct clk_hw*[]) {
  1394. &gcc_pcie_0_aux_clk_src.clkr.hw,
  1395. },
  1396. .num_parents = 1,
  1397. .flags = CLK_SET_RATE_PARENT,
  1398. .ops = &clk_branch2_ops,
  1399. },
  1400. },
  1401. };
  1402. static struct clk_branch gcc_pcie_0_cfg_ahb_clk = {
  1403. .halt_reg = 0x6b038,
  1404. .halt_check = BRANCH_HALT_VOTED,
  1405. .hwcg_reg = 0x6b038,
  1406. .hwcg_bit = 1,
  1407. .clkr = {
  1408. .enable_reg = 0x52008,
  1409. .enable_mask = BIT(2),
  1410. .hw.init = &(const struct clk_init_data) {
  1411. .name = "gcc_pcie_0_cfg_ahb_clk",
  1412. .ops = &clk_branch2_ops,
  1413. },
  1414. },
  1415. };
  1416. static struct clk_branch gcc_pcie_0_mstr_axi_clk = {
  1417. .halt_reg = 0x6b02c,
  1418. .halt_check = BRANCH_HALT_SKIP,
  1419. .hwcg_reg = 0x6b02c,
  1420. .hwcg_bit = 1,
  1421. .clkr = {
  1422. .enable_reg = 0x52008,
  1423. .enable_mask = BIT(1),
  1424. .hw.init = &(const struct clk_init_data) {
  1425. .name = "gcc_pcie_0_mstr_axi_clk",
  1426. .ops = &clk_branch2_ops,
  1427. },
  1428. },
  1429. };
  1430. static struct clk_branch gcc_pcie_0_phy_rchng_clk = {
  1431. .halt_reg = 0x6b054,
  1432. .halt_check = BRANCH_HALT_VOTED,
  1433. .clkr = {
  1434. .enable_reg = 0x52000,
  1435. .enable_mask = BIT(22),
  1436. .hw.init = &(const struct clk_init_data) {
  1437. .name = "gcc_pcie_0_phy_rchng_clk",
  1438. .parent_hws = (const struct clk_hw*[]) {
  1439. &gcc_pcie_0_phy_rchng_clk_src.clkr.hw,
  1440. },
  1441. .num_parents = 1,
  1442. .flags = CLK_SET_RATE_PARENT,
  1443. .ops = &clk_branch2_ops,
  1444. },
  1445. },
  1446. };
  1447. static struct clk_branch gcc_pcie_0_pipe_clk = {
  1448. .halt_reg = 0x6b048,
  1449. .halt_check = BRANCH_HALT_SKIP,
  1450. .clkr = {
  1451. .enable_reg = 0x52008,
  1452. .enable_mask = BIT(4),
  1453. .hw.init = &(const struct clk_init_data) {
  1454. .name = "gcc_pcie_0_pipe_clk",
  1455. .parent_hws = (const struct clk_hw*[]) {
  1456. &gcc_pcie_0_pipe_clk_src.clkr.hw,
  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_pipe_div2_clk = {
  1465. .halt_reg = 0x6b098,
  1466. .halt_check = BRANCH_HALT_SKIP,
  1467. .clkr = {
  1468. .enable_reg = 0x52018,
  1469. .enable_mask = BIT(13),
  1470. .hw.init = &(const struct clk_init_data) {
  1471. .name = "gcc_pcie_0_pipe_div2_clk",
  1472. .parent_hws = (const struct clk_hw*[]) {
  1473. &gcc_pcie_0_pipe_div2_clk_src.clkr.hw,
  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_slv_axi_clk = {
  1482. .halt_reg = 0x6b020,
  1483. .halt_check = BRANCH_HALT_VOTED,
  1484. .hwcg_reg = 0x6b020,
  1485. .hwcg_bit = 1,
  1486. .clkr = {
  1487. .enable_reg = 0x52008,
  1488. .enable_mask = BIT(0),
  1489. .hw.init = &(const struct clk_init_data) {
  1490. .name = "gcc_pcie_0_slv_axi_clk",
  1491. .ops = &clk_branch2_ops,
  1492. },
  1493. },
  1494. };
  1495. static struct clk_branch gcc_pcie_0_slv_q2a_axi_clk = {
  1496. .halt_reg = 0x6b01c,
  1497. .halt_check = BRANCH_HALT_VOTED,
  1498. .clkr = {
  1499. .enable_reg = 0x52008,
  1500. .enable_mask = BIT(5),
  1501. .hw.init = &(const struct clk_init_data) {
  1502. .name = "gcc_pcie_0_slv_q2a_axi_clk",
  1503. .ops = &clk_branch2_ops,
  1504. },
  1505. },
  1506. };
  1507. static struct clk_branch gcc_pcie_1_aux_clk = {
  1508. .halt_reg = 0x90038,
  1509. .halt_check = BRANCH_HALT_VOTED,
  1510. .clkr = {
  1511. .enable_reg = 0x52000,
  1512. .enable_mask = BIT(29),
  1513. .hw.init = &(const struct clk_init_data) {
  1514. .name = "gcc_pcie_1_aux_clk",
  1515. .parent_hws = (const struct clk_hw*[]) {
  1516. &gcc_pcie_1_aux_clk_src.clkr.hw,
  1517. },
  1518. .num_parents = 1,
  1519. .flags = CLK_SET_RATE_PARENT,
  1520. .ops = &clk_branch2_ops,
  1521. },
  1522. },
  1523. };
  1524. static struct clk_branch gcc_pcie_1_cfg_ahb_clk = {
  1525. .halt_reg = 0x90034,
  1526. .halt_check = BRANCH_HALT_VOTED,
  1527. .hwcg_reg = 0x90034,
  1528. .hwcg_bit = 1,
  1529. .clkr = {
  1530. .enable_reg = 0x52000,
  1531. .enable_mask = BIT(28),
  1532. .hw.init = &(const struct clk_init_data) {
  1533. .name = "gcc_pcie_1_cfg_ahb_clk",
  1534. .ops = &clk_branch2_ops,
  1535. },
  1536. },
  1537. };
  1538. static struct clk_branch gcc_pcie_1_mstr_axi_clk = {
  1539. .halt_reg = 0x90028,
  1540. .halt_check = BRANCH_HALT_SKIP,
  1541. .hwcg_reg = 0x90028,
  1542. .hwcg_bit = 1,
  1543. .clkr = {
  1544. .enable_reg = 0x52000,
  1545. .enable_mask = BIT(27),
  1546. .hw.init = &(const struct clk_init_data) {
  1547. .name = "gcc_pcie_1_mstr_axi_clk",
  1548. .ops = &clk_branch2_ops,
  1549. },
  1550. },
  1551. };
  1552. static struct clk_branch gcc_pcie_1_phy_rchng_clk = {
  1553. .halt_reg = 0x90050,
  1554. .halt_check = BRANCH_HALT_VOTED,
  1555. .clkr = {
  1556. .enable_reg = 0x52008,
  1557. .enable_mask = BIT(8),
  1558. .hw.init = &(const struct clk_init_data) {
  1559. .name = "gcc_pcie_1_phy_rchng_clk",
  1560. .parent_hws = (const struct clk_hw*[]) {
  1561. &gcc_pcie_1_phy_rchng_clk_src.clkr.hw,
  1562. },
  1563. .num_parents = 1,
  1564. .flags = CLK_SET_RATE_PARENT,
  1565. .ops = &clk_branch2_ops,
  1566. },
  1567. },
  1568. };
  1569. static struct clk_branch gcc_pcie_1_pipe_clk = {
  1570. .halt_reg = 0x90044,
  1571. .halt_check = BRANCH_HALT_SKIP,
  1572. .clkr = {
  1573. .enable_reg = 0x52008,
  1574. .enable_mask = BIT(7),
  1575. .hw.init = &(const struct clk_init_data) {
  1576. .name = "gcc_pcie_1_pipe_clk",
  1577. .parent_hws = (const struct clk_hw*[]) {
  1578. &gcc_pcie_1_pipe_clk_src.clkr.hw,
  1579. },
  1580. .num_parents = 1,
  1581. .flags = CLK_SET_RATE_PARENT,
  1582. .ops = &clk_branch2_ops,
  1583. },
  1584. },
  1585. };
  1586. static struct clk_branch gcc_pcie_1_pipe_div2_clk = {
  1587. .halt_reg = 0x90094,
  1588. .halt_check = BRANCH_HALT_SKIP,
  1589. .clkr = {
  1590. .enable_reg = 0x52018,
  1591. .enable_mask = BIT(15),
  1592. .hw.init = &(const struct clk_init_data) {
  1593. .name = "gcc_pcie_1_pipe_div2_clk",
  1594. .parent_hws = (const struct clk_hw*[]) {
  1595. &gcc_pcie_1_pipe_div2_clk_src.clkr.hw,
  1596. },
  1597. .num_parents = 1,
  1598. .flags = CLK_SET_RATE_PARENT,
  1599. .ops = &clk_branch2_ops,
  1600. },
  1601. },
  1602. };
  1603. static struct clk_branch gcc_pcie_1_slv_axi_clk = {
  1604. .halt_reg = 0x9001c,
  1605. .halt_check = BRANCH_HALT_VOTED,
  1606. .hwcg_reg = 0x9001c,
  1607. .hwcg_bit = 1,
  1608. .clkr = {
  1609. .enable_reg = 0x52000,
  1610. .enable_mask = BIT(26),
  1611. .hw.init = &(const struct clk_init_data) {
  1612. .name = "gcc_pcie_1_slv_axi_clk",
  1613. .ops = &clk_branch2_ops,
  1614. },
  1615. },
  1616. };
  1617. static struct clk_branch gcc_pcie_1_slv_q2a_axi_clk = {
  1618. .halt_reg = 0x90018,
  1619. .halt_check = BRANCH_HALT_VOTED,
  1620. .clkr = {
  1621. .enable_reg = 0x52000,
  1622. .enable_mask = BIT(25),
  1623. .hw.init = &(const struct clk_init_data) {
  1624. .name = "gcc_pcie_1_slv_q2a_axi_clk",
  1625. .ops = &clk_branch2_ops,
  1626. },
  1627. },
  1628. };
  1629. static struct clk_branch gcc_pcie_rscc_cfg_ahb_clk = {
  1630. .halt_reg = 0x11004,
  1631. .halt_check = BRANCH_HALT_VOTED,
  1632. .hwcg_reg = 0x11004,
  1633. .hwcg_bit = 1,
  1634. .clkr = {
  1635. .enable_reg = 0x52010,
  1636. .enable_mask = BIT(20),
  1637. .hw.init = &(const struct clk_init_data) {
  1638. .name = "gcc_pcie_rscc_cfg_ahb_clk",
  1639. .ops = &clk_branch2_ops,
  1640. },
  1641. },
  1642. };
  1643. static struct clk_branch gcc_pcie_rscc_xo_clk = {
  1644. .halt_reg = 0x11008,
  1645. .halt_check = BRANCH_HALT_VOTED,
  1646. .clkr = {
  1647. .enable_reg = 0x52010,
  1648. .enable_mask = BIT(21),
  1649. .hw.init = &(const struct clk_init_data) {
  1650. .name = "gcc_pcie_rscc_xo_clk",
  1651. .ops = &clk_branch2_ops,
  1652. },
  1653. },
  1654. };
  1655. static struct clk_branch gcc_pdm2_clk = {
  1656. .halt_reg = 0x3300c,
  1657. .halt_check = BRANCH_HALT,
  1658. .clkr = {
  1659. .enable_reg = 0x3300c,
  1660. .enable_mask = BIT(0),
  1661. .hw.init = &(const struct clk_init_data) {
  1662. .name = "gcc_pdm2_clk",
  1663. .parent_hws = (const struct clk_hw*[]) {
  1664. &gcc_pdm2_clk_src.clkr.hw,
  1665. },
  1666. .num_parents = 1,
  1667. .flags = CLK_SET_RATE_PARENT,
  1668. .ops = &clk_branch2_ops,
  1669. },
  1670. },
  1671. };
  1672. static struct clk_branch gcc_pdm_ahb_clk = {
  1673. .halt_reg = 0x33004,
  1674. .halt_check = BRANCH_HALT_VOTED,
  1675. .hwcg_reg = 0x33004,
  1676. .hwcg_bit = 1,
  1677. .clkr = {
  1678. .enable_reg = 0x33004,
  1679. .enable_mask = BIT(0),
  1680. .hw.init = &(const struct clk_init_data) {
  1681. .name = "gcc_pdm_ahb_clk",
  1682. .ops = &clk_branch2_ops,
  1683. },
  1684. },
  1685. };
  1686. static struct clk_branch gcc_pdm_xo4_clk = {
  1687. .halt_reg = 0x33008,
  1688. .halt_check = BRANCH_HALT,
  1689. .clkr = {
  1690. .enable_reg = 0x33008,
  1691. .enable_mask = BIT(0),
  1692. .hw.init = &(const struct clk_init_data) {
  1693. .name = "gcc_pdm_xo4_clk",
  1694. .ops = &clk_branch2_ops,
  1695. },
  1696. },
  1697. };
  1698. static struct clk_branch gcc_qmip_camera_nrt_ahb_clk = {
  1699. .halt_reg = 0x26008,
  1700. .halt_check = BRANCH_HALT_VOTED,
  1701. .hwcg_reg = 0x26008,
  1702. .hwcg_bit = 1,
  1703. .clkr = {
  1704. .enable_reg = 0x26008,
  1705. .enable_mask = BIT(0),
  1706. .hw.init = &(const struct clk_init_data) {
  1707. .name = "gcc_qmip_camera_nrt_ahb_clk",
  1708. .ops = &clk_branch2_ops,
  1709. },
  1710. },
  1711. };
  1712. static struct clk_branch gcc_qmip_camera_rt_ahb_clk = {
  1713. .halt_reg = 0x2600c,
  1714. .halt_check = BRANCH_HALT_VOTED,
  1715. .hwcg_reg = 0x2600c,
  1716. .hwcg_bit = 1,
  1717. .clkr = {
  1718. .enable_reg = 0x2600c,
  1719. .enable_mask = BIT(0),
  1720. .hw.init = &(const struct clk_init_data) {
  1721. .name = "gcc_qmip_camera_rt_ahb_clk",
  1722. .ops = &clk_branch2_ops,
  1723. },
  1724. },
  1725. };
  1726. static struct clk_branch gcc_qmip_disp_ahb_clk = {
  1727. .halt_reg = 0x27008,
  1728. .halt_check = BRANCH_HALT_VOTED,
  1729. .hwcg_reg = 0x27008,
  1730. .hwcg_bit = 1,
  1731. .clkr = {
  1732. .enable_reg = 0x27008,
  1733. .enable_mask = BIT(0),
  1734. .hw.init = &(const struct clk_init_data) {
  1735. .name = "gcc_qmip_disp_ahb_clk",
  1736. .ops = &clk_branch2_ops,
  1737. },
  1738. },
  1739. };
  1740. static struct clk_branch gcc_qmip_gpu_ahb_clk = {
  1741. .halt_reg = 0x71008,
  1742. .halt_check = BRANCH_HALT_VOTED,
  1743. .hwcg_reg = 0x71008,
  1744. .hwcg_bit = 1,
  1745. .clkr = {
  1746. .enable_reg = 0x71008,
  1747. .enable_mask = BIT(0),
  1748. .hw.init = &(const struct clk_init_data) {
  1749. .name = "gcc_qmip_gpu_ahb_clk",
  1750. .ops = &clk_branch2_ops,
  1751. },
  1752. },
  1753. };
  1754. static struct clk_branch gcc_qmip_pcie_ahb_clk = {
  1755. .halt_reg = 0x6b018,
  1756. .halt_check = BRANCH_HALT_VOTED,
  1757. .hwcg_reg = 0x6b018,
  1758. .hwcg_bit = 1,
  1759. .clkr = {
  1760. .enable_reg = 0x52000,
  1761. .enable_mask = BIT(11),
  1762. .hw.init = &(const struct clk_init_data) {
  1763. .name = "gcc_qmip_pcie_ahb_clk",
  1764. .ops = &clk_branch2_ops,
  1765. },
  1766. },
  1767. };
  1768. static struct clk_branch gcc_qmip_video_cv_cpu_ahb_clk = {
  1769. .halt_reg = 0x32014,
  1770. .halt_check = BRANCH_HALT_VOTED,
  1771. .hwcg_reg = 0x32014,
  1772. .hwcg_bit = 1,
  1773. .clkr = {
  1774. .enable_reg = 0x32014,
  1775. .enable_mask = BIT(0),
  1776. .hw.init = &(const struct clk_init_data) {
  1777. .name = "gcc_qmip_video_cv_cpu_ahb_clk",
  1778. .ops = &clk_branch2_ops,
  1779. },
  1780. },
  1781. };
  1782. static struct clk_branch gcc_qmip_video_cvp_ahb_clk = {
  1783. .halt_reg = 0x32008,
  1784. .halt_check = BRANCH_HALT_VOTED,
  1785. .hwcg_reg = 0x32008,
  1786. .hwcg_bit = 1,
  1787. .clkr = {
  1788. .enable_reg = 0x32008,
  1789. .enable_mask = BIT(0),
  1790. .hw.init = &(const struct clk_init_data) {
  1791. .name = "gcc_qmip_video_cvp_ahb_clk",
  1792. .ops = &clk_branch2_ops,
  1793. },
  1794. },
  1795. };
  1796. static struct clk_branch gcc_qmip_video_v_cpu_ahb_clk = {
  1797. .halt_reg = 0x32010,
  1798. .halt_check = BRANCH_HALT_VOTED,
  1799. .hwcg_reg = 0x32010,
  1800. .hwcg_bit = 1,
  1801. .clkr = {
  1802. .enable_reg = 0x32010,
  1803. .enable_mask = BIT(0),
  1804. .hw.init = &(const struct clk_init_data) {
  1805. .name = "gcc_qmip_video_v_cpu_ahb_clk",
  1806. .ops = &clk_branch2_ops,
  1807. },
  1808. },
  1809. };
  1810. static struct clk_branch gcc_qmip_video_vcodec_ahb_clk = {
  1811. .halt_reg = 0x3200c,
  1812. .halt_check = BRANCH_HALT_VOTED,
  1813. .hwcg_reg = 0x3200c,
  1814. .hwcg_bit = 1,
  1815. .clkr = {
  1816. .enable_reg = 0x3200c,
  1817. .enable_mask = BIT(0),
  1818. .hw.init = &(const struct clk_init_data) {
  1819. .name = "gcc_qmip_video_vcodec_ahb_clk",
  1820. .ops = &clk_branch2_ops,
  1821. },
  1822. },
  1823. };
  1824. static struct clk_branch gcc_qupv3_wrap0_core_2x_clk = {
  1825. .halt_reg = 0x23018,
  1826. .halt_check = BRANCH_HALT_VOTED,
  1827. .clkr = {
  1828. .enable_reg = 0x52008,
  1829. .enable_mask = BIT(18),
  1830. .hw.init = &(const struct clk_init_data) {
  1831. .name = "gcc_qupv3_wrap0_core_2x_clk",
  1832. .ops = &clk_branch2_ops,
  1833. },
  1834. },
  1835. };
  1836. static struct clk_branch gcc_qupv3_wrap0_core_clk = {
  1837. .halt_reg = 0x23008,
  1838. .halt_check = BRANCH_HALT_VOTED,
  1839. .clkr = {
  1840. .enable_reg = 0x52008,
  1841. .enable_mask = BIT(19),
  1842. .hw.init = &(const struct clk_init_data) {
  1843. .name = "gcc_qupv3_wrap0_core_clk",
  1844. .ops = &clk_branch2_ops,
  1845. },
  1846. },
  1847. };
  1848. static struct clk_branch gcc_qupv3_wrap0_qspi_ref_clk = {
  1849. .halt_reg = 0x18764,
  1850. .halt_check = BRANCH_HALT_VOTED,
  1851. .clkr = {
  1852. .enable_reg = 0x52010,
  1853. .enable_mask = BIT(29),
  1854. .hw.init = &(const struct clk_init_data) {
  1855. .name = "gcc_qupv3_wrap0_qspi_ref_clk",
  1856. .parent_hws = (const struct clk_hw*[]) {
  1857. &gcc_qupv3_wrap0_qspi_ref_clk_src.clkr.hw,
  1858. },
  1859. .num_parents = 1,
  1860. .flags = CLK_SET_RATE_PARENT,
  1861. .ops = &clk_branch2_ops,
  1862. },
  1863. },
  1864. };
  1865. static struct clk_branch gcc_qupv3_wrap0_s0_clk = {
  1866. .halt_reg = 0x18004,
  1867. .halt_check = BRANCH_HALT_VOTED,
  1868. .clkr = {
  1869. .enable_reg = 0x52008,
  1870. .enable_mask = BIT(22),
  1871. .hw.init = &(const struct clk_init_data) {
  1872. .name = "gcc_qupv3_wrap0_s0_clk",
  1873. .parent_hws = (const struct clk_hw*[]) {
  1874. &gcc_qupv3_wrap0_s0_clk_src.clkr.hw,
  1875. },
  1876. .num_parents = 1,
  1877. .flags = CLK_SET_RATE_PARENT,
  1878. .ops = &clk_branch2_ops,
  1879. },
  1880. },
  1881. };
  1882. static struct clk_branch gcc_qupv3_wrap0_s1_clk = {
  1883. .halt_reg = 0x1813c,
  1884. .halt_check = BRANCH_HALT_VOTED,
  1885. .clkr = {
  1886. .enable_reg = 0x52008,
  1887. .enable_mask = BIT(23),
  1888. .hw.init = &(const struct clk_init_data) {
  1889. .name = "gcc_qupv3_wrap0_s1_clk",
  1890. .parent_hws = (const struct clk_hw*[]) {
  1891. &gcc_qupv3_wrap0_s1_clk_src.clkr.hw,
  1892. },
  1893. .num_parents = 1,
  1894. .flags = CLK_SET_RATE_PARENT,
  1895. .ops = &clk_branch2_ops,
  1896. },
  1897. },
  1898. };
  1899. static struct clk_branch gcc_qupv3_wrap0_s2_clk = {
  1900. .halt_reg = 0x18274,
  1901. .halt_check = BRANCH_HALT_VOTED,
  1902. .clkr = {
  1903. .enable_reg = 0x52008,
  1904. .enable_mask = BIT(24),
  1905. .hw.init = &(const struct clk_init_data) {
  1906. .name = "gcc_qupv3_wrap0_s2_clk",
  1907. .parent_hws = (const struct clk_hw*[]) {
  1908. &gcc_qupv3_wrap0_s2_clk_src.clkr.hw,
  1909. },
  1910. .num_parents = 1,
  1911. .flags = CLK_SET_RATE_PARENT,
  1912. .ops = &clk_branch2_ops,
  1913. },
  1914. },
  1915. };
  1916. static struct clk_branch gcc_qupv3_wrap0_s3_clk = {
  1917. .halt_reg = 0x18284,
  1918. .halt_check = BRANCH_HALT_VOTED,
  1919. .clkr = {
  1920. .enable_reg = 0x52008,
  1921. .enable_mask = BIT(25),
  1922. .hw.init = &(const struct clk_init_data) {
  1923. .name = "gcc_qupv3_wrap0_s3_clk",
  1924. .parent_hws = (const struct clk_hw*[]) {
  1925. &gcc_qupv3_wrap0_s3_clk_src.clkr.hw,
  1926. },
  1927. .num_parents = 1,
  1928. .flags = CLK_SET_RATE_PARENT,
  1929. .ops = &clk_branch2_ops,
  1930. },
  1931. },
  1932. };
  1933. static struct clk_branch gcc_qupv3_wrap0_s4_clk = {
  1934. .halt_reg = 0x183bc,
  1935. .halt_check = BRANCH_HALT_VOTED,
  1936. .clkr = {
  1937. .enable_reg = 0x52008,
  1938. .enable_mask = BIT(26),
  1939. .hw.init = &(const struct clk_init_data) {
  1940. .name = "gcc_qupv3_wrap0_s4_clk",
  1941. .parent_hws = (const struct clk_hw*[]) {
  1942. &gcc_qupv3_wrap0_s4_clk_src.clkr.hw,
  1943. },
  1944. .num_parents = 1,
  1945. .flags = CLK_SET_RATE_PARENT,
  1946. .ops = &clk_branch2_ops,
  1947. },
  1948. },
  1949. };
  1950. static struct clk_branch gcc_qupv3_wrap0_s5_clk = {
  1951. .halt_reg = 0x184f4,
  1952. .halt_check = BRANCH_HALT_VOTED,
  1953. .clkr = {
  1954. .enable_reg = 0x52008,
  1955. .enable_mask = BIT(27),
  1956. .hw.init = &(const struct clk_init_data) {
  1957. .name = "gcc_qupv3_wrap0_s5_clk",
  1958. .parent_hws = (const struct clk_hw*[]) {
  1959. &gcc_qupv3_wrap0_s5_clk_src.clkr.hw,
  1960. },
  1961. .num_parents = 1,
  1962. .flags = CLK_SET_RATE_PARENT,
  1963. .ops = &clk_branch2_ops,
  1964. },
  1965. },
  1966. };
  1967. static struct clk_branch gcc_qupv3_wrap0_s6_clk = {
  1968. .halt_reg = 0x1862c,
  1969. .halt_check = BRANCH_HALT_VOTED,
  1970. .clkr = {
  1971. .enable_reg = 0x52008,
  1972. .enable_mask = BIT(28),
  1973. .hw.init = &(const struct clk_init_data) {
  1974. .name = "gcc_qupv3_wrap0_s6_clk",
  1975. .parent_hws = (const struct clk_hw*[]) {
  1976. &gcc_qupv3_wrap0_s6_clk_src.clkr.hw,
  1977. },
  1978. .num_parents = 1,
  1979. .flags = CLK_SET_RATE_PARENT,
  1980. .ops = &clk_branch2_ops,
  1981. },
  1982. },
  1983. };
  1984. static struct clk_branch gcc_qupv3_wrap1_core_2x_clk = {
  1985. .halt_reg = 0x23168,
  1986. .halt_check = BRANCH_HALT_VOTED,
  1987. .clkr = {
  1988. .enable_reg = 0x52010,
  1989. .enable_mask = BIT(3),
  1990. .hw.init = &(const struct clk_init_data) {
  1991. .name = "gcc_qupv3_wrap1_core_2x_clk",
  1992. .ops = &clk_branch2_ops,
  1993. },
  1994. },
  1995. };
  1996. static struct clk_branch gcc_qupv3_wrap1_core_clk = {
  1997. .halt_reg = 0x23158,
  1998. .halt_check = BRANCH_HALT_VOTED,
  1999. .clkr = {
  2000. .enable_reg = 0x52010,
  2001. .enable_mask = BIT(0),
  2002. .hw.init = &(const struct clk_init_data) {
  2003. .name = "gcc_qupv3_wrap1_core_clk",
  2004. .ops = &clk_branch2_ops,
  2005. },
  2006. },
  2007. };
  2008. static struct clk_branch gcc_qupv3_wrap1_qspi_ref_clk = {
  2009. .halt_reg = 0x1e764,
  2010. .halt_check = BRANCH_HALT_VOTED,
  2011. .clkr = {
  2012. .enable_reg = 0x52010,
  2013. .enable_mask = BIT(30),
  2014. .hw.init = &(const struct clk_init_data) {
  2015. .name = "gcc_qupv3_wrap1_qspi_ref_clk",
  2016. .parent_hws = (const struct clk_hw*[]) {
  2017. &gcc_qupv3_wrap1_qspi_ref_clk_src.clkr.hw,
  2018. },
  2019. .num_parents = 1,
  2020. .flags = CLK_SET_RATE_PARENT,
  2021. .ops = &clk_branch2_ops,
  2022. },
  2023. },
  2024. };
  2025. static struct clk_branch gcc_qupv3_wrap1_s0_clk = {
  2026. .halt_reg = 0x1e004,
  2027. .halt_check = BRANCH_HALT_VOTED,
  2028. .clkr = {
  2029. .enable_reg = 0x52010,
  2030. .enable_mask = BIT(4),
  2031. .hw.init = &(const struct clk_init_data) {
  2032. .name = "gcc_qupv3_wrap1_s0_clk",
  2033. .parent_hws = (const struct clk_hw*[]) {
  2034. &gcc_qupv3_wrap1_s0_clk_src.clkr.hw,
  2035. },
  2036. .num_parents = 1,
  2037. .flags = CLK_SET_RATE_PARENT,
  2038. .ops = &clk_branch2_ops,
  2039. },
  2040. },
  2041. };
  2042. static struct clk_branch gcc_qupv3_wrap1_s1_clk = {
  2043. .halt_reg = 0x1e13c,
  2044. .halt_check = BRANCH_HALT_VOTED,
  2045. .clkr = {
  2046. .enable_reg = 0x52010,
  2047. .enable_mask = BIT(5),
  2048. .hw.init = &(const struct clk_init_data) {
  2049. .name = "gcc_qupv3_wrap1_s1_clk",
  2050. .parent_hws = (const struct clk_hw*[]) {
  2051. &gcc_qupv3_wrap1_s1_clk_src.clkr.hw,
  2052. },
  2053. .num_parents = 1,
  2054. .flags = CLK_SET_RATE_PARENT,
  2055. .ops = &clk_branch2_ops,
  2056. },
  2057. },
  2058. };
  2059. static struct clk_branch gcc_qupv3_wrap1_s2_clk = {
  2060. .halt_reg = 0x1e274,
  2061. .halt_check = BRANCH_HALT_VOTED,
  2062. .clkr = {
  2063. .enable_reg = 0x52010,
  2064. .enable_mask = BIT(6),
  2065. .hw.init = &(const struct clk_init_data) {
  2066. .name = "gcc_qupv3_wrap1_s2_clk",
  2067. .parent_hws = (const struct clk_hw*[]) {
  2068. &gcc_qupv3_wrap1_s2_clk_src.clkr.hw,
  2069. },
  2070. .num_parents = 1,
  2071. .flags = CLK_SET_RATE_PARENT,
  2072. .ops = &clk_branch2_ops,
  2073. },
  2074. },
  2075. };
  2076. static struct clk_branch gcc_qupv3_wrap1_s3_clk = {
  2077. .halt_reg = 0x1e284,
  2078. .halt_check = BRANCH_HALT_VOTED,
  2079. .clkr = {
  2080. .enable_reg = 0x52010,
  2081. .enable_mask = BIT(7),
  2082. .hw.init = &(const struct clk_init_data) {
  2083. .name = "gcc_qupv3_wrap1_s3_clk",
  2084. .parent_hws = (const struct clk_hw*[]) {
  2085. &gcc_qupv3_wrap1_s3_clk_src.clkr.hw,
  2086. },
  2087. .num_parents = 1,
  2088. .flags = CLK_SET_RATE_PARENT,
  2089. .ops = &clk_branch2_ops,
  2090. },
  2091. },
  2092. };
  2093. static struct clk_branch gcc_qupv3_wrap1_s4_clk = {
  2094. .halt_reg = 0x1e3bc,
  2095. .halt_check = BRANCH_HALT_VOTED,
  2096. .clkr = {
  2097. .enable_reg = 0x52010,
  2098. .enable_mask = BIT(8),
  2099. .hw.init = &(const struct clk_init_data) {
  2100. .name = "gcc_qupv3_wrap1_s4_clk",
  2101. .parent_hws = (const struct clk_hw*[]) {
  2102. &gcc_qupv3_wrap1_s4_clk_src.clkr.hw,
  2103. },
  2104. .num_parents = 1,
  2105. .flags = CLK_SET_RATE_PARENT,
  2106. .ops = &clk_branch2_ops,
  2107. },
  2108. },
  2109. };
  2110. static struct clk_branch gcc_qupv3_wrap1_s5_clk = {
  2111. .halt_reg = 0x1e4f4,
  2112. .halt_check = BRANCH_HALT_VOTED,
  2113. .clkr = {
  2114. .enable_reg = 0x52010,
  2115. .enable_mask = BIT(9),
  2116. .hw.init = &(const struct clk_init_data) {
  2117. .name = "gcc_qupv3_wrap1_s5_clk",
  2118. .parent_hws = (const struct clk_hw*[]) {
  2119. &gcc_qupv3_wrap1_s5_clk_src.clkr.hw,
  2120. },
  2121. .num_parents = 1,
  2122. .flags = CLK_SET_RATE_PARENT,
  2123. .ops = &clk_branch2_ops,
  2124. },
  2125. },
  2126. };
  2127. static struct clk_branch gcc_qupv3_wrap1_s6_clk = {
  2128. .halt_reg = 0x1e62c,
  2129. .halt_check = BRANCH_HALT_VOTED,
  2130. .clkr = {
  2131. .enable_reg = 0x52010,
  2132. .enable_mask = BIT(10),
  2133. .hw.init = &(const struct clk_init_data) {
  2134. .name = "gcc_qupv3_wrap1_s6_clk",
  2135. .parent_hws = (const struct clk_hw*[]) {
  2136. &gcc_qupv3_wrap1_s6_clk_src.clkr.hw,
  2137. },
  2138. .num_parents = 1,
  2139. .flags = CLK_SET_RATE_PARENT,
  2140. .ops = &clk_branch2_ops,
  2141. },
  2142. },
  2143. };
  2144. static struct clk_branch gcc_qupv3_wrap_0_m_ahb_clk = {
  2145. .halt_reg = 0x23000,
  2146. .halt_check = BRANCH_HALT_VOTED,
  2147. .clkr = {
  2148. .enable_reg = 0x52008,
  2149. .enable_mask = BIT(20),
  2150. .hw.init = &(const struct clk_init_data) {
  2151. .name = "gcc_qupv3_wrap_0_m_ahb_clk",
  2152. .ops = &clk_branch2_ops,
  2153. },
  2154. },
  2155. };
  2156. static struct clk_branch gcc_qupv3_wrap_0_s_ahb_clk = {
  2157. .halt_reg = 0x23004,
  2158. .halt_check = BRANCH_HALT_VOTED,
  2159. .hwcg_reg = 0x23004,
  2160. .hwcg_bit = 1,
  2161. .clkr = {
  2162. .enable_reg = 0x52008,
  2163. .enable_mask = BIT(21),
  2164. .hw.init = &(const struct clk_init_data) {
  2165. .name = "gcc_qupv3_wrap_0_s_ahb_clk",
  2166. .ops = &clk_branch2_ops,
  2167. },
  2168. },
  2169. };
  2170. static struct clk_branch gcc_qupv3_wrap_1_m_ahb_clk = {
  2171. .halt_reg = 0x23150,
  2172. .halt_check = BRANCH_HALT_VOTED,
  2173. .clkr = {
  2174. .enable_reg = 0x52010,
  2175. .enable_mask = BIT(2),
  2176. .hw.init = &(const struct clk_init_data) {
  2177. .name = "gcc_qupv3_wrap_1_m_ahb_clk",
  2178. .ops = &clk_branch2_ops,
  2179. },
  2180. },
  2181. };
  2182. static struct clk_branch gcc_qupv3_wrap_1_s_ahb_clk = {
  2183. .halt_reg = 0x23154,
  2184. .halt_check = BRANCH_HALT_VOTED,
  2185. .hwcg_reg = 0x23154,
  2186. .hwcg_bit = 1,
  2187. .clkr = {
  2188. .enable_reg = 0x52010,
  2189. .enable_mask = BIT(1),
  2190. .hw.init = &(const struct clk_init_data) {
  2191. .name = "gcc_qupv3_wrap_1_s_ahb_clk",
  2192. .ops = &clk_branch2_ops,
  2193. },
  2194. },
  2195. };
  2196. static struct clk_branch gcc_sdcc1_ahb_clk = {
  2197. .halt_reg = 0xa3004,
  2198. .halt_check = BRANCH_HALT,
  2199. .clkr = {
  2200. .enable_reg = 0xa3004,
  2201. .enable_mask = BIT(0),
  2202. .hw.init = &(const struct clk_init_data) {
  2203. .name = "gcc_sdcc1_ahb_clk",
  2204. .ops = &clk_branch2_ops,
  2205. },
  2206. },
  2207. };
  2208. static struct clk_branch gcc_sdcc1_apps_clk = {
  2209. .halt_reg = 0xa3008,
  2210. .halt_check = BRANCH_HALT,
  2211. .clkr = {
  2212. .enable_reg = 0xa3008,
  2213. .enable_mask = BIT(0),
  2214. .hw.init = &(const struct clk_init_data) {
  2215. .name = "gcc_sdcc1_apps_clk",
  2216. .parent_hws = (const struct clk_hw*[]) {
  2217. &gcc_sdcc1_apps_clk_src.clkr.hw,
  2218. },
  2219. .num_parents = 1,
  2220. .flags = CLK_SET_RATE_PARENT,
  2221. .ops = &clk_branch2_ops,
  2222. },
  2223. },
  2224. };
  2225. static struct clk_branch gcc_sdcc1_ice_core_clk = {
  2226. .halt_reg = 0xa302c,
  2227. .halt_check = BRANCH_HALT_VOTED,
  2228. .hwcg_reg = 0xa302c,
  2229. .hwcg_bit = 1,
  2230. .clkr = {
  2231. .enable_reg = 0xa302c,
  2232. .enable_mask = BIT(0),
  2233. .hw.init = &(const struct clk_init_data) {
  2234. .name = "gcc_sdcc1_ice_core_clk",
  2235. .parent_hws = (const struct clk_hw*[]) {
  2236. &gcc_sdcc1_ice_core_clk_src.clkr.hw,
  2237. },
  2238. .num_parents = 1,
  2239. .flags = CLK_SET_RATE_PARENT,
  2240. .ops = &clk_branch2_ops,
  2241. },
  2242. },
  2243. };
  2244. static struct clk_branch gcc_sdcc2_ahb_clk = {
  2245. .halt_reg = 0x14010,
  2246. .halt_check = BRANCH_HALT,
  2247. .clkr = {
  2248. .enable_reg = 0x14010,
  2249. .enable_mask = BIT(0),
  2250. .hw.init = &(const struct clk_init_data) {
  2251. .name = "gcc_sdcc2_ahb_clk",
  2252. .ops = &clk_branch2_ops,
  2253. },
  2254. },
  2255. };
  2256. static struct clk_branch gcc_sdcc2_apps_clk = {
  2257. .halt_reg = 0x14004,
  2258. .halt_check = BRANCH_HALT,
  2259. .clkr = {
  2260. .enable_reg = 0x14004,
  2261. .enable_mask = BIT(0),
  2262. .hw.init = &(const struct clk_init_data) {
  2263. .name = "gcc_sdcc2_apps_clk",
  2264. .parent_hws = (const struct clk_hw*[]) {
  2265. &gcc_sdcc2_apps_clk_src.clkr.hw,
  2266. },
  2267. .num_parents = 1,
  2268. .flags = CLK_SET_RATE_PARENT,
  2269. .ops = &clk_branch2_ops,
  2270. },
  2271. },
  2272. };
  2273. static struct clk_branch gcc_ufs_phy_ahb_clk = {
  2274. .halt_reg = 0x77024,
  2275. .halt_check = BRANCH_HALT_VOTED,
  2276. .hwcg_reg = 0x77024,
  2277. .hwcg_bit = 1,
  2278. .clkr = {
  2279. .enable_reg = 0x77024,
  2280. .enable_mask = BIT(0),
  2281. .hw.init = &(const struct clk_init_data) {
  2282. .name = "gcc_ufs_phy_ahb_clk",
  2283. .ops = &clk_branch2_ops,
  2284. },
  2285. },
  2286. };
  2287. static struct clk_branch gcc_ufs_phy_axi_clk = {
  2288. .halt_reg = 0x77018,
  2289. .halt_check = BRANCH_HALT_VOTED,
  2290. .hwcg_reg = 0x77018,
  2291. .hwcg_bit = 1,
  2292. .clkr = {
  2293. .enable_reg = 0x77018,
  2294. .enable_mask = BIT(0),
  2295. .hw.init = &(const struct clk_init_data) {
  2296. .name = "gcc_ufs_phy_axi_clk",
  2297. .parent_hws = (const struct clk_hw*[]) {
  2298. &gcc_ufs_phy_axi_clk_src.clkr.hw,
  2299. },
  2300. .num_parents = 1,
  2301. .flags = CLK_SET_RATE_PARENT,
  2302. .ops = &clk_branch2_ops,
  2303. },
  2304. },
  2305. };
  2306. static struct clk_branch gcc_ufs_phy_axi_hw_ctl_clk = {
  2307. .halt_reg = 0x77018,
  2308. .halt_check = BRANCH_HALT_VOTED,
  2309. .hwcg_reg = 0x77018,
  2310. .hwcg_bit = 1,
  2311. .clkr = {
  2312. .enable_reg = 0x77018,
  2313. .enable_mask = BIT(1),
  2314. .hw.init = &(const struct clk_init_data) {
  2315. .name = "gcc_ufs_phy_axi_hw_ctl_clk",
  2316. .parent_hws = (const struct clk_hw*[]) {
  2317. &gcc_ufs_phy_axi_clk_src.clkr.hw,
  2318. },
  2319. .num_parents = 1,
  2320. .flags = CLK_SET_RATE_PARENT,
  2321. .ops = &clk_branch2_ops,
  2322. },
  2323. },
  2324. };
  2325. static struct clk_branch gcc_ufs_phy_ice_core_clk = {
  2326. .halt_reg = 0x77074,
  2327. .halt_check = BRANCH_HALT_VOTED,
  2328. .hwcg_reg = 0x77074,
  2329. .hwcg_bit = 1,
  2330. .clkr = {
  2331. .enable_reg = 0x77074,
  2332. .enable_mask = BIT(0),
  2333. .hw.init = &(const struct clk_init_data) {
  2334. .name = "gcc_ufs_phy_ice_core_clk",
  2335. .parent_hws = (const struct clk_hw*[]) {
  2336. &gcc_ufs_phy_ice_core_clk_src.clkr.hw,
  2337. },
  2338. .num_parents = 1,
  2339. .flags = CLK_SET_RATE_PARENT,
  2340. .ops = &clk_branch2_ops,
  2341. },
  2342. },
  2343. };
  2344. static struct clk_branch gcc_ufs_phy_ice_core_hw_ctl_clk = {
  2345. .halt_reg = 0x77074,
  2346. .halt_check = BRANCH_HALT_VOTED,
  2347. .hwcg_reg = 0x77074,
  2348. .hwcg_bit = 1,
  2349. .clkr = {
  2350. .enable_reg = 0x77074,
  2351. .enable_mask = BIT(1),
  2352. .hw.init = &(const struct clk_init_data) {
  2353. .name = "gcc_ufs_phy_ice_core_hw_ctl_clk",
  2354. .parent_hws = (const struct clk_hw*[]) {
  2355. &gcc_ufs_phy_ice_core_clk_src.clkr.hw,
  2356. },
  2357. .num_parents = 1,
  2358. .flags = CLK_SET_RATE_PARENT,
  2359. .ops = &clk_branch2_ops,
  2360. },
  2361. },
  2362. };
  2363. static struct clk_branch gcc_ufs_phy_phy_aux_clk = {
  2364. .halt_reg = 0x770b0,
  2365. .halt_check = BRANCH_HALT_VOTED,
  2366. .hwcg_reg = 0x770b0,
  2367. .hwcg_bit = 1,
  2368. .clkr = {
  2369. .enable_reg = 0x770b0,
  2370. .enable_mask = BIT(0),
  2371. .hw.init = &(const struct clk_init_data) {
  2372. .name = "gcc_ufs_phy_phy_aux_clk",
  2373. .parent_hws = (const struct clk_hw*[]) {
  2374. &gcc_ufs_phy_phy_aux_clk_src.clkr.hw,
  2375. },
  2376. .num_parents = 1,
  2377. .flags = CLK_SET_RATE_PARENT,
  2378. .ops = &clk_branch2_ops,
  2379. },
  2380. },
  2381. };
  2382. static struct clk_branch gcc_ufs_phy_phy_aux_hw_ctl_clk = {
  2383. .halt_reg = 0x770b0,
  2384. .halt_check = BRANCH_HALT_VOTED,
  2385. .hwcg_reg = 0x770b0,
  2386. .hwcg_bit = 1,
  2387. .clkr = {
  2388. .enable_reg = 0x770b0,
  2389. .enable_mask = BIT(1),
  2390. .hw.init = &(const struct clk_init_data) {
  2391. .name = "gcc_ufs_phy_phy_aux_hw_ctl_clk",
  2392. .parent_hws = (const struct clk_hw*[]) {
  2393. &gcc_ufs_phy_phy_aux_clk_src.clkr.hw,
  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_rx_symbol_0_clk = {
  2402. .halt_reg = 0x7702c,
  2403. .halt_check = BRANCH_HALT_DELAY,
  2404. .clkr = {
  2405. .enable_reg = 0x7702c,
  2406. .enable_mask = BIT(0),
  2407. .hw.init = &(const struct clk_init_data) {
  2408. .name = "gcc_ufs_phy_rx_symbol_0_clk",
  2409. .parent_hws = (const struct clk_hw*[]) {
  2410. &gcc_ufs_phy_rx_symbol_0_clk_src.clkr.hw,
  2411. },
  2412. .num_parents = 1,
  2413. .flags = CLK_SET_RATE_PARENT,
  2414. .ops = &clk_branch2_ops,
  2415. },
  2416. },
  2417. };
  2418. static struct clk_branch gcc_ufs_phy_rx_symbol_1_clk = {
  2419. .halt_reg = 0x770cc,
  2420. .halt_check = BRANCH_HALT_DELAY,
  2421. .clkr = {
  2422. .enable_reg = 0x770cc,
  2423. .enable_mask = BIT(0),
  2424. .hw.init = &(const struct clk_init_data) {
  2425. .name = "gcc_ufs_phy_rx_symbol_1_clk",
  2426. .parent_hws = (const struct clk_hw*[]) {
  2427. &gcc_ufs_phy_rx_symbol_1_clk_src.clkr.hw,
  2428. },
  2429. .num_parents = 1,
  2430. .flags = CLK_SET_RATE_PARENT,
  2431. .ops = &clk_branch2_ops,
  2432. },
  2433. },
  2434. };
  2435. static struct clk_branch gcc_ufs_phy_tx_symbol_0_clk = {
  2436. .halt_reg = 0x77028,
  2437. .halt_check = BRANCH_HALT_DELAY,
  2438. .clkr = {
  2439. .enable_reg = 0x77028,
  2440. .enable_mask = BIT(0),
  2441. .hw.init = &(const struct clk_init_data) {
  2442. .name = "gcc_ufs_phy_tx_symbol_0_clk",
  2443. .parent_hws = (const struct clk_hw*[]) {
  2444. &gcc_ufs_phy_tx_symbol_0_clk_src.clkr.hw,
  2445. },
  2446. .num_parents = 1,
  2447. .flags = CLK_SET_RATE_PARENT,
  2448. .ops = &clk_branch2_ops,
  2449. },
  2450. },
  2451. };
  2452. static struct clk_branch gcc_ufs_phy_unipro_core_clk = {
  2453. .halt_reg = 0x77068,
  2454. .halt_check = BRANCH_HALT_VOTED,
  2455. .hwcg_reg = 0x77068,
  2456. .hwcg_bit = 1,
  2457. .clkr = {
  2458. .enable_reg = 0x77068,
  2459. .enable_mask = BIT(0),
  2460. .hw.init = &(const struct clk_init_data) {
  2461. .name = "gcc_ufs_phy_unipro_core_clk",
  2462. .parent_hws = (const struct clk_hw*[]) {
  2463. &gcc_ufs_phy_unipro_core_clk_src.clkr.hw,
  2464. },
  2465. .num_parents = 1,
  2466. .flags = CLK_SET_RATE_PARENT,
  2467. .ops = &clk_branch2_ops,
  2468. },
  2469. },
  2470. };
  2471. static struct clk_branch gcc_ufs_phy_unipro_core_hw_ctl_clk = {
  2472. .halt_reg = 0x77068,
  2473. .halt_check = BRANCH_HALT_VOTED,
  2474. .hwcg_reg = 0x77068,
  2475. .hwcg_bit = 1,
  2476. .clkr = {
  2477. .enable_reg = 0x77068,
  2478. .enable_mask = BIT(1),
  2479. .hw.init = &(const struct clk_init_data) {
  2480. .name = "gcc_ufs_phy_unipro_core_hw_ctl_clk",
  2481. .parent_hws = (const struct clk_hw*[]) {
  2482. &gcc_ufs_phy_unipro_core_clk_src.clkr.hw,
  2483. },
  2484. .num_parents = 1,
  2485. .flags = CLK_SET_RATE_PARENT,
  2486. .ops = &clk_branch2_ops,
  2487. },
  2488. },
  2489. };
  2490. static struct clk_branch gcc_usb30_prim_atb_clk = {
  2491. .halt_reg = 0x39088,
  2492. .halt_check = BRANCH_HALT_VOTED,
  2493. .clkr = {
  2494. .enable_reg = 0x39088,
  2495. .enable_mask = BIT(0),
  2496. .hw.init = &(const struct clk_init_data) {
  2497. .name = "gcc_usb30_prim_atb_clk",
  2498. .parent_hws = (const struct clk_hw*[]) {
  2499. &gcc_usb30_prim_master_clk_src.clkr.hw,
  2500. },
  2501. .num_parents = 1,
  2502. .flags = CLK_SET_RATE_PARENT,
  2503. .ops = &clk_branch2_ops,
  2504. },
  2505. },
  2506. };
  2507. static struct clk_branch gcc_usb30_prim_master_clk = {
  2508. .halt_reg = 0x39018,
  2509. .halt_check = BRANCH_HALT,
  2510. .clkr = {
  2511. .enable_reg = 0x39018,
  2512. .enable_mask = BIT(0),
  2513. .hw.init = &(const struct clk_init_data) {
  2514. .name = "gcc_usb30_prim_master_clk",
  2515. .parent_hws = (const struct clk_hw*[]) {
  2516. &gcc_usb30_prim_master_clk_src.clkr.hw,
  2517. },
  2518. .num_parents = 1,
  2519. .flags = CLK_SET_RATE_PARENT,
  2520. .ops = &clk_branch2_ops,
  2521. },
  2522. },
  2523. };
  2524. static struct clk_branch gcc_usb30_prim_mock_utmi_clk = {
  2525. .halt_reg = 0x39028,
  2526. .halt_check = BRANCH_HALT,
  2527. .clkr = {
  2528. .enable_reg = 0x39028,
  2529. .enable_mask = BIT(0),
  2530. .hw.init = &(const struct clk_init_data) {
  2531. .name = "gcc_usb30_prim_mock_utmi_clk",
  2532. .parent_hws = (const struct clk_hw*[]) {
  2533. &gcc_usb30_prim_mock_utmi_postdiv_clk_src.clkr.hw,
  2534. },
  2535. .num_parents = 1,
  2536. .flags = CLK_SET_RATE_PARENT,
  2537. .ops = &clk_branch2_ops,
  2538. },
  2539. },
  2540. };
  2541. static struct clk_branch gcc_usb30_prim_sleep_clk = {
  2542. .halt_reg = 0x39024,
  2543. .halt_check = BRANCH_HALT,
  2544. .clkr = {
  2545. .enable_reg = 0x39024,
  2546. .enable_mask = BIT(0),
  2547. .hw.init = &(const struct clk_init_data) {
  2548. .name = "gcc_usb30_prim_sleep_clk",
  2549. .ops = &clk_branch2_ops,
  2550. },
  2551. },
  2552. };
  2553. static struct clk_branch gcc_usb3_prim_phy_aux_clk = {
  2554. .halt_reg = 0x39060,
  2555. .halt_check = BRANCH_HALT,
  2556. .clkr = {
  2557. .enable_reg = 0x39060,
  2558. .enable_mask = BIT(0),
  2559. .hw.init = &(const struct clk_init_data) {
  2560. .name = "gcc_usb3_prim_phy_aux_clk",
  2561. .parent_hws = (const struct clk_hw*[]) {
  2562. &gcc_usb3_prim_phy_aux_clk_src.clkr.hw,
  2563. },
  2564. .num_parents = 1,
  2565. .flags = CLK_SET_RATE_PARENT,
  2566. .ops = &clk_branch2_ops,
  2567. },
  2568. },
  2569. };
  2570. static struct clk_branch gcc_usb3_prim_phy_com_aux_clk = {
  2571. .halt_reg = 0x39064,
  2572. .halt_check = BRANCH_HALT,
  2573. .clkr = {
  2574. .enable_reg = 0x39064,
  2575. .enable_mask = BIT(0),
  2576. .hw.init = &(const struct clk_init_data) {
  2577. .name = "gcc_usb3_prim_phy_com_aux_clk",
  2578. .parent_hws = (const struct clk_hw*[]) {
  2579. &gcc_usb3_prim_phy_aux_clk_src.clkr.hw,
  2580. },
  2581. .num_parents = 1,
  2582. .flags = CLK_SET_RATE_PARENT,
  2583. .ops = &clk_branch2_ops,
  2584. },
  2585. },
  2586. };
  2587. static struct clk_branch gcc_usb3_prim_phy_pipe_clk = {
  2588. .halt_reg = 0x39068,
  2589. .halt_check = BRANCH_HALT_DELAY,
  2590. .hwcg_reg = 0x39068,
  2591. .hwcg_bit = 1,
  2592. .clkr = {
  2593. .enable_reg = 0x39068,
  2594. .enable_mask = BIT(0),
  2595. .hw.init = &(const struct clk_init_data) {
  2596. .name = "gcc_usb3_prim_phy_pipe_clk",
  2597. .parent_hws = (const struct clk_hw*[]) {
  2598. &gcc_usb3_prim_phy_pipe_clk_src.clkr.hw,
  2599. },
  2600. .num_parents = 1,
  2601. .flags = CLK_SET_RATE_PARENT,
  2602. .ops = &clk_branch2_ops,
  2603. },
  2604. },
  2605. };
  2606. static struct clk_branch gcc_video_axi0_clk = {
  2607. .halt_reg = 0x32018,
  2608. .halt_check = BRANCH_HALT_SKIP,
  2609. .hwcg_reg = 0x32018,
  2610. .hwcg_bit = 1,
  2611. .clkr = {
  2612. .enable_reg = 0x32018,
  2613. .enable_mask = BIT(0),
  2614. .hw.init = &(const struct clk_init_data) {
  2615. .name = "gcc_video_axi0_clk",
  2616. .ops = &clk_branch2_ops,
  2617. },
  2618. },
  2619. };
  2620. static struct gdsc pcie_0_gdsc = {
  2621. .gdscr = 0x6b004,
  2622. .collapse_ctrl = 0x5214c,
  2623. .collapse_mask = BIT(0),
  2624. .en_rest_wait_val = 0x2,
  2625. .en_few_wait_val = 0x2,
  2626. .clk_dis_wait_val = 0xf,
  2627. .pd = {
  2628. .name = "pcie_0_gdsc",
  2629. },
  2630. .pwrsts = PWRSTS_OFF_ON,
  2631. .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2632. };
  2633. static struct gdsc pcie_0_phy_gdsc = {
  2634. .gdscr = 0x6c000,
  2635. .collapse_ctrl = 0x5214c,
  2636. .collapse_mask = BIT(1),
  2637. .en_rest_wait_val = 0x2,
  2638. .en_few_wait_val = 0x2,
  2639. .clk_dis_wait_val = 0x2,
  2640. .pd = {
  2641. .name = "pcie_0_phy_gdsc",
  2642. },
  2643. .pwrsts = PWRSTS_OFF_ON,
  2644. .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2645. };
  2646. static struct gdsc pcie_1_gdsc = {
  2647. .gdscr = 0x90004,
  2648. .collapse_ctrl = 0x5214c,
  2649. .collapse_mask = BIT(3),
  2650. .en_rest_wait_val = 0x2,
  2651. .en_few_wait_val = 0x2,
  2652. .clk_dis_wait_val = 0xf,
  2653. .pd = {
  2654. .name = "pcie_1_gdsc",
  2655. },
  2656. .pwrsts = PWRSTS_OFF_ON,
  2657. .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2658. };
  2659. static struct gdsc pcie_1_phy_gdsc = {
  2660. .gdscr = 0xa2000,
  2661. .collapse_ctrl = 0x5214c,
  2662. .collapse_mask = BIT(4),
  2663. .en_rest_wait_val = 0x2,
  2664. .en_few_wait_val = 0x2,
  2665. .clk_dis_wait_val = 0x2,
  2666. .pd = {
  2667. .name = "pcie_1_phy_gdsc",
  2668. },
  2669. .pwrsts = PWRSTS_OFF_ON,
  2670. .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2671. };
  2672. static struct gdsc ufs_phy_gdsc = {
  2673. .gdscr = 0x77004,
  2674. .en_rest_wait_val = 0x2,
  2675. .en_few_wait_val = 0x2,
  2676. .clk_dis_wait_val = 0xf,
  2677. .pd = {
  2678. .name = "ufs_phy_gdsc",
  2679. },
  2680. .pwrsts = PWRSTS_OFF_ON,
  2681. .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2682. };
  2683. static struct gdsc ufs_mem_phy_gdsc = {
  2684. .gdscr = 0x9e000,
  2685. .en_rest_wait_val = 0x2,
  2686. .en_few_wait_val = 0x2,
  2687. .clk_dis_wait_val = 0x2,
  2688. .pd = {
  2689. .name = "ufs_mem_phy_gdsc",
  2690. },
  2691. .pwrsts = PWRSTS_OFF_ON,
  2692. .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2693. };
  2694. static struct gdsc usb30_prim_gdsc = {
  2695. .gdscr = 0x39004,
  2696. .en_rest_wait_val = 0x2,
  2697. .en_few_wait_val = 0x2,
  2698. .clk_dis_wait_val = 0xf,
  2699. .pd = {
  2700. .name = "usb30_prim_gdsc",
  2701. },
  2702. .pwrsts = PWRSTS_RET_ON,
  2703. .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2704. };
  2705. static struct gdsc usb3_phy_gdsc = {
  2706. .gdscr = 0x5000c,
  2707. .en_rest_wait_val = 0x2,
  2708. .en_few_wait_val = 0x2,
  2709. .clk_dis_wait_val = 0x2,
  2710. .pd = {
  2711. .name = "usb3_phy_gdsc",
  2712. },
  2713. .pwrsts = PWRSTS_RET_ON,
  2714. .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
  2715. };
  2716. static struct clk_regmap *gcc_milos_clocks[] = {
  2717. [GCC_AGGRE_NOC_PCIE_AXI_CLK] = &gcc_aggre_noc_pcie_axi_clk.clkr,
  2718. [GCC_AGGRE_UFS_PHY_AXI_CLK] = &gcc_aggre_ufs_phy_axi_clk.clkr,
  2719. [GCC_AGGRE_UFS_PHY_AXI_HW_CTL_CLK] = &gcc_aggre_ufs_phy_axi_hw_ctl_clk.clkr,
  2720. [GCC_AGGRE_USB3_PRIM_AXI_CLK] = &gcc_aggre_usb3_prim_axi_clk.clkr,
  2721. [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
  2722. [GCC_CAMERA_HF_AXI_CLK] = &gcc_camera_hf_axi_clk.clkr,
  2723. [GCC_CAMERA_SF_AXI_CLK] = &gcc_camera_sf_axi_clk.clkr,
  2724. [GCC_CFG_NOC_PCIE_ANOC_AHB_CLK] = &gcc_cfg_noc_pcie_anoc_ahb_clk.clkr,
  2725. [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr,
  2726. [GCC_CNOC_PCIE_SF_AXI_CLK] = &gcc_cnoc_pcie_sf_axi_clk.clkr,
  2727. [GCC_DDRSS_GPU_AXI_CLK] = &gcc_ddrss_gpu_axi_clk.clkr,
  2728. [GCC_DDRSS_PCIE_SF_QTB_CLK] = &gcc_ddrss_pcie_sf_qtb_clk.clkr,
  2729. [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr,
  2730. [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr,
  2731. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  2732. [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr,
  2733. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  2734. [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr,
  2735. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  2736. [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr,
  2737. [GCC_GPLL0] = &gcc_gpll0.clkr,
  2738. [GCC_GPLL0_OUT_EVEN] = &gcc_gpll0_out_even.clkr,
  2739. [GCC_GPLL2] = &gcc_gpll2.clkr,
  2740. [GCC_GPLL4] = &gcc_gpll4.clkr,
  2741. [GCC_GPLL6] = &gcc_gpll6.clkr,
  2742. [GCC_GPLL7] = &gcc_gpll7.clkr,
  2743. [GCC_GPLL9] = &gcc_gpll9.clkr,
  2744. [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr,
  2745. [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr,
  2746. [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr,
  2747. [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr,
  2748. [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr,
  2749. [GCC_PCIE_0_AUX_CLK_SRC] = &gcc_pcie_0_aux_clk_src.clkr,
  2750. [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr,
  2751. [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr,
  2752. [GCC_PCIE_0_PHY_RCHNG_CLK] = &gcc_pcie_0_phy_rchng_clk.clkr,
  2753. [GCC_PCIE_0_PHY_RCHNG_CLK_SRC] = &gcc_pcie_0_phy_rchng_clk_src.clkr,
  2754. [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr,
  2755. [GCC_PCIE_0_PIPE_CLK_SRC] = &gcc_pcie_0_pipe_clk_src.clkr,
  2756. [GCC_PCIE_0_PIPE_DIV2_CLK] = &gcc_pcie_0_pipe_div2_clk.clkr,
  2757. [GCC_PCIE_0_PIPE_DIV2_CLK_SRC] = &gcc_pcie_0_pipe_div2_clk_src.clkr,
  2758. [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr,
  2759. [GCC_PCIE_0_SLV_Q2A_AXI_CLK] = &gcc_pcie_0_slv_q2a_axi_clk.clkr,
  2760. [GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr,
  2761. [GCC_PCIE_1_AUX_CLK_SRC] = &gcc_pcie_1_aux_clk_src.clkr,
  2762. [GCC_PCIE_1_CFG_AHB_CLK] = &gcc_pcie_1_cfg_ahb_clk.clkr,
  2763. [GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr,
  2764. [GCC_PCIE_1_PHY_RCHNG_CLK] = &gcc_pcie_1_phy_rchng_clk.clkr,
  2765. [GCC_PCIE_1_PHY_RCHNG_CLK_SRC] = &gcc_pcie_1_phy_rchng_clk_src.clkr,
  2766. [GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr,
  2767. [GCC_PCIE_1_PIPE_CLK_SRC] = &gcc_pcie_1_pipe_clk_src.clkr,
  2768. [GCC_PCIE_1_PIPE_DIV2_CLK] = &gcc_pcie_1_pipe_div2_clk.clkr,
  2769. [GCC_PCIE_1_PIPE_DIV2_CLK_SRC] = &gcc_pcie_1_pipe_div2_clk_src.clkr,
  2770. [GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr,
  2771. [GCC_PCIE_1_SLV_Q2A_AXI_CLK] = &gcc_pcie_1_slv_q2a_axi_clk.clkr,
  2772. [GCC_PCIE_RSCC_CFG_AHB_CLK] = &gcc_pcie_rscc_cfg_ahb_clk.clkr,
  2773. [GCC_PCIE_RSCC_XO_CLK] = &gcc_pcie_rscc_xo_clk.clkr,
  2774. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  2775. [GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
  2776. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  2777. [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
  2778. [GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr,
  2779. [GCC_QMIP_CAMERA_RT_AHB_CLK] = &gcc_qmip_camera_rt_ahb_clk.clkr,
  2780. [GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr,
  2781. [GCC_QMIP_GPU_AHB_CLK] = &gcc_qmip_gpu_ahb_clk.clkr,
  2782. [GCC_QMIP_PCIE_AHB_CLK] = &gcc_qmip_pcie_ahb_clk.clkr,
  2783. [GCC_QMIP_VIDEO_CV_CPU_AHB_CLK] = &gcc_qmip_video_cv_cpu_ahb_clk.clkr,
  2784. [GCC_QMIP_VIDEO_CVP_AHB_CLK] = &gcc_qmip_video_cvp_ahb_clk.clkr,
  2785. [GCC_QMIP_VIDEO_V_CPU_AHB_CLK] = &gcc_qmip_video_v_cpu_ahb_clk.clkr,
  2786. [GCC_QMIP_VIDEO_VCODEC_AHB_CLK] = &gcc_qmip_video_vcodec_ahb_clk.clkr,
  2787. [GCC_QUPV3_WRAP0_CORE_2X_CLK] = &gcc_qupv3_wrap0_core_2x_clk.clkr,
  2788. [GCC_QUPV3_WRAP0_CORE_CLK] = &gcc_qupv3_wrap0_core_clk.clkr,
  2789. [GCC_QUPV3_WRAP0_QSPI_REF_CLK] = &gcc_qupv3_wrap0_qspi_ref_clk.clkr,
  2790. [GCC_QUPV3_WRAP0_QSPI_REF_CLK_SRC] = &gcc_qupv3_wrap0_qspi_ref_clk_src.clkr,
  2791. [GCC_QUPV3_WRAP0_S0_CLK] = &gcc_qupv3_wrap0_s0_clk.clkr,
  2792. [GCC_QUPV3_WRAP0_S0_CLK_SRC] = &gcc_qupv3_wrap0_s0_clk_src.clkr,
  2793. [GCC_QUPV3_WRAP0_S1_CLK] = &gcc_qupv3_wrap0_s1_clk.clkr,
  2794. [GCC_QUPV3_WRAP0_S1_CLK_SRC] = &gcc_qupv3_wrap0_s1_clk_src.clkr,
  2795. [GCC_QUPV3_WRAP0_S2_CLK] = &gcc_qupv3_wrap0_s2_clk.clkr,
  2796. [GCC_QUPV3_WRAP0_S2_CLK_SRC] = &gcc_qupv3_wrap0_s2_clk_src.clkr,
  2797. [GCC_QUPV3_WRAP0_S3_CLK] = &gcc_qupv3_wrap0_s3_clk.clkr,
  2798. [GCC_QUPV3_WRAP0_S3_CLK_SRC] = &gcc_qupv3_wrap0_s3_clk_src.clkr,
  2799. [GCC_QUPV3_WRAP0_S4_CLK] = &gcc_qupv3_wrap0_s4_clk.clkr,
  2800. [GCC_QUPV3_WRAP0_S4_CLK_SRC] = &gcc_qupv3_wrap0_s4_clk_src.clkr,
  2801. [GCC_QUPV3_WRAP0_S5_CLK] = &gcc_qupv3_wrap0_s5_clk.clkr,
  2802. [GCC_QUPV3_WRAP0_S5_CLK_SRC] = &gcc_qupv3_wrap0_s5_clk_src.clkr,
  2803. [GCC_QUPV3_WRAP0_S6_CLK] = &gcc_qupv3_wrap0_s6_clk.clkr,
  2804. [GCC_QUPV3_WRAP0_S6_CLK_SRC] = &gcc_qupv3_wrap0_s6_clk_src.clkr,
  2805. [GCC_QUPV3_WRAP1_CORE_2X_CLK] = &gcc_qupv3_wrap1_core_2x_clk.clkr,
  2806. [GCC_QUPV3_WRAP1_CORE_CLK] = &gcc_qupv3_wrap1_core_clk.clkr,
  2807. [GCC_QUPV3_WRAP1_QSPI_REF_CLK] = &gcc_qupv3_wrap1_qspi_ref_clk.clkr,
  2808. [GCC_QUPV3_WRAP1_QSPI_REF_CLK_SRC] = &gcc_qupv3_wrap1_qspi_ref_clk_src.clkr,
  2809. [GCC_QUPV3_WRAP1_S0_CLK] = &gcc_qupv3_wrap1_s0_clk.clkr,
  2810. [GCC_QUPV3_WRAP1_S0_CLK_SRC] = &gcc_qupv3_wrap1_s0_clk_src.clkr,
  2811. [GCC_QUPV3_WRAP1_S1_CLK] = &gcc_qupv3_wrap1_s1_clk.clkr,
  2812. [GCC_QUPV3_WRAP1_S1_CLK_SRC] = &gcc_qupv3_wrap1_s1_clk_src.clkr,
  2813. [GCC_QUPV3_WRAP1_S2_CLK] = &gcc_qupv3_wrap1_s2_clk.clkr,
  2814. [GCC_QUPV3_WRAP1_S2_CLK_SRC] = &gcc_qupv3_wrap1_s2_clk_src.clkr,
  2815. [GCC_QUPV3_WRAP1_S3_CLK] = &gcc_qupv3_wrap1_s3_clk.clkr,
  2816. [GCC_QUPV3_WRAP1_S3_CLK_SRC] = &gcc_qupv3_wrap1_s3_clk_src.clkr,
  2817. [GCC_QUPV3_WRAP1_S4_CLK] = &gcc_qupv3_wrap1_s4_clk.clkr,
  2818. [GCC_QUPV3_WRAP1_S4_CLK_SRC] = &gcc_qupv3_wrap1_s4_clk_src.clkr,
  2819. [GCC_QUPV3_WRAP1_S5_CLK] = &gcc_qupv3_wrap1_s5_clk.clkr,
  2820. [GCC_QUPV3_WRAP1_S5_CLK_SRC] = &gcc_qupv3_wrap1_s5_clk_src.clkr,
  2821. [GCC_QUPV3_WRAP1_S6_CLK] = &gcc_qupv3_wrap1_s6_clk.clkr,
  2822. [GCC_QUPV3_WRAP1_S6_CLK_SRC] = &gcc_qupv3_wrap1_s6_clk_src.clkr,
  2823. [GCC_QUPV3_WRAP_0_M_AHB_CLK] = &gcc_qupv3_wrap_0_m_ahb_clk.clkr,
  2824. [GCC_QUPV3_WRAP_0_S_AHB_CLK] = &gcc_qupv3_wrap_0_s_ahb_clk.clkr,
  2825. [GCC_QUPV3_WRAP_1_M_AHB_CLK] = &gcc_qupv3_wrap_1_m_ahb_clk.clkr,
  2826. [GCC_QUPV3_WRAP_1_S_AHB_CLK] = &gcc_qupv3_wrap_1_s_ahb_clk.clkr,
  2827. [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
  2828. [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
  2829. [GCC_SDCC1_APPS_CLK_SRC] = &gcc_sdcc1_apps_clk_src.clkr,
  2830. [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr,
  2831. [GCC_SDCC1_ICE_CORE_CLK_SRC] = &gcc_sdcc1_ice_core_clk_src.clkr,
  2832. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  2833. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  2834. [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr,
  2835. [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr,
  2836. [GCC_UFS_PHY_AXI_CLK] = &gcc_ufs_phy_axi_clk.clkr,
  2837. [GCC_UFS_PHY_AXI_CLK_SRC] = &gcc_ufs_phy_axi_clk_src.clkr,
  2838. [GCC_UFS_PHY_AXI_HW_CTL_CLK] = &gcc_ufs_phy_axi_hw_ctl_clk.clkr,
  2839. [GCC_UFS_PHY_ICE_CORE_CLK] = &gcc_ufs_phy_ice_core_clk.clkr,
  2840. [GCC_UFS_PHY_ICE_CORE_CLK_SRC] = &gcc_ufs_phy_ice_core_clk_src.clkr,
  2841. [GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK] = &gcc_ufs_phy_ice_core_hw_ctl_clk.clkr,
  2842. [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr,
  2843. [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr,
  2844. [GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK] = &gcc_ufs_phy_phy_aux_hw_ctl_clk.clkr,
  2845. [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr,
  2846. [GCC_UFS_PHY_RX_SYMBOL_0_CLK_SRC] = &gcc_ufs_phy_rx_symbol_0_clk_src.clkr,
  2847. [GCC_UFS_PHY_RX_SYMBOL_1_CLK] = &gcc_ufs_phy_rx_symbol_1_clk.clkr,
  2848. [GCC_UFS_PHY_RX_SYMBOL_1_CLK_SRC] = &gcc_ufs_phy_rx_symbol_1_clk_src.clkr,
  2849. [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr,
  2850. [GCC_UFS_PHY_TX_SYMBOL_0_CLK_SRC] = &gcc_ufs_phy_tx_symbol_0_clk_src.clkr,
  2851. [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr,
  2852. [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC] = &gcc_ufs_phy_unipro_core_clk_src.clkr,
  2853. [GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK] = &gcc_ufs_phy_unipro_core_hw_ctl_clk.clkr,
  2854. [GCC_USB30_PRIM_ATB_CLK] = &gcc_usb30_prim_atb_clk.clkr,
  2855. [GCC_USB30_PRIM_MASTER_CLK] = &gcc_usb30_prim_master_clk.clkr,
  2856. [GCC_USB30_PRIM_MASTER_CLK_SRC] = &gcc_usb30_prim_master_clk_src.clkr,
  2857. [GCC_USB30_PRIM_MOCK_UTMI_CLK] = &gcc_usb30_prim_mock_utmi_clk.clkr,
  2858. [GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC] = &gcc_usb30_prim_mock_utmi_clk_src.clkr,
  2859. [GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC] = &gcc_usb30_prim_mock_utmi_postdiv_clk_src.clkr,
  2860. [GCC_USB30_PRIM_SLEEP_CLK] = &gcc_usb30_prim_sleep_clk.clkr,
  2861. [GCC_USB3_PRIM_PHY_AUX_CLK] = &gcc_usb3_prim_phy_aux_clk.clkr,
  2862. [GCC_USB3_PRIM_PHY_AUX_CLK_SRC] = &gcc_usb3_prim_phy_aux_clk_src.clkr,
  2863. [GCC_USB3_PRIM_PHY_COM_AUX_CLK] = &gcc_usb3_prim_phy_com_aux_clk.clkr,
  2864. [GCC_USB3_PRIM_PHY_PIPE_CLK] = &gcc_usb3_prim_phy_pipe_clk.clkr,
  2865. [GCC_USB3_PRIM_PHY_PIPE_CLK_SRC] = &gcc_usb3_prim_phy_pipe_clk_src.clkr,
  2866. [GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr,
  2867. };
  2868. static const struct qcom_reset_map gcc_milos_resets[] = {
  2869. [GCC_CAMERA_BCR] = { 0x26000 },
  2870. [GCC_DISPLAY_BCR] = { 0x27000 },
  2871. [GCC_GPU_BCR] = { 0x71000 },
  2872. [GCC_PCIE_0_BCR] = { 0x6b000 },
  2873. [GCC_PCIE_0_LINK_DOWN_BCR] = { 0x6c014 },
  2874. [GCC_PCIE_0_NOCSR_COM_PHY_BCR] = { 0x6c020 },
  2875. [GCC_PCIE_0_PHY_BCR] = { 0x6c01c },
  2876. [GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR] = { 0x6c028 },
  2877. [GCC_PCIE_1_BCR] = { 0x90000 },
  2878. [GCC_PCIE_1_LINK_DOWN_BCR] = { 0x8e014 },
  2879. [GCC_PCIE_1_NOCSR_COM_PHY_BCR] = { 0x8e020 },
  2880. [GCC_PCIE_1_PHY_BCR] = { 0x8e01c },
  2881. [GCC_PCIE_1_PHY_NOCSR_COM_PHY_BCR] = { 0x8e024 },
  2882. [GCC_PCIE_RSCC_BCR] = { 0x11000 },
  2883. [GCC_PDM_BCR] = { 0x33000 },
  2884. [GCC_QUPV3_WRAPPER_0_BCR] = { 0x18000 },
  2885. [GCC_QUPV3_WRAPPER_1_BCR] = { 0x1e000 },
  2886. [GCC_QUSB2PHY_PRIM_BCR] = { 0x12000 },
  2887. [GCC_QUSB2PHY_SEC_BCR] = { 0x12004 },
  2888. [GCC_SDCC1_BCR] = { 0xa3000 },
  2889. [GCC_SDCC2_BCR] = { 0x14000 },
  2890. [GCC_UFS_PHY_BCR] = { 0x77000 },
  2891. [GCC_USB30_PRIM_BCR] = { 0x39000 },
  2892. [GCC_USB3_DP_PHY_PRIM_BCR] = { 0x50008 },
  2893. [GCC_USB3_PHY_PRIM_BCR] = { 0x50000 },
  2894. [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 },
  2895. [GCC_VIDEO_AXI0_CLK_ARES] = { 0x32018, 2 },
  2896. [GCC_VIDEO_BCR] = { 0x32000 },
  2897. };
  2898. static const struct clk_rcg_dfs_data gcc_milos_dfs_clocks[] = {
  2899. DEFINE_RCG_DFS(gcc_qupv3_wrap0_qspi_ref_clk_src),
  2900. DEFINE_RCG_DFS(gcc_qupv3_wrap0_s0_clk_src),
  2901. DEFINE_RCG_DFS(gcc_qupv3_wrap0_s1_clk_src),
  2902. DEFINE_RCG_DFS(gcc_qupv3_wrap0_s3_clk_src),
  2903. DEFINE_RCG_DFS(gcc_qupv3_wrap0_s4_clk_src),
  2904. DEFINE_RCG_DFS(gcc_qupv3_wrap0_s5_clk_src),
  2905. DEFINE_RCG_DFS(gcc_qupv3_wrap0_s6_clk_src),
  2906. DEFINE_RCG_DFS(gcc_qupv3_wrap1_qspi_ref_clk_src),
  2907. DEFINE_RCG_DFS(gcc_qupv3_wrap1_s0_clk_src),
  2908. DEFINE_RCG_DFS(gcc_qupv3_wrap1_s1_clk_src),
  2909. DEFINE_RCG_DFS(gcc_qupv3_wrap1_s3_clk_src),
  2910. DEFINE_RCG_DFS(gcc_qupv3_wrap1_s4_clk_src),
  2911. DEFINE_RCG_DFS(gcc_qupv3_wrap1_s5_clk_src),
  2912. DEFINE_RCG_DFS(gcc_qupv3_wrap1_s6_clk_src),
  2913. };
  2914. static struct gdsc *gcc_milos_gdscs[] = {
  2915. [PCIE_0_GDSC] = &pcie_0_gdsc,
  2916. [PCIE_0_PHY_GDSC] = &pcie_0_phy_gdsc,
  2917. [PCIE_1_GDSC] = &pcie_1_gdsc,
  2918. [PCIE_1_PHY_GDSC] = &pcie_1_phy_gdsc,
  2919. [UFS_PHY_GDSC] = &ufs_phy_gdsc,
  2920. [UFS_MEM_PHY_GDSC] = &ufs_mem_phy_gdsc,
  2921. [USB30_PRIM_GDSC] = &usb30_prim_gdsc,
  2922. [USB3_PHY_GDSC] = &usb3_phy_gdsc,
  2923. };
  2924. static u32 gcc_milos_critical_cbcrs[] = {
  2925. 0x26004, /* GCC_CAMERA_AHB_CLK */
  2926. 0x26018, /* GCC_CAMERA_HF_XO_CLK */
  2927. 0x2601c, /* GCC_CAMERA_SF_XO_CLK */
  2928. 0x27004, /* GCC_DISP_AHB_CLK */
  2929. 0x27018, /* GCC_DISP_XO_CLK */
  2930. 0x71004, /* GCC_GPU_CFG_AHB_CLK */
  2931. 0x32004, /* GCC_VIDEO_AHB_CLK */
  2932. 0x32024, /* GCC_VIDEO_XO_CLK */
  2933. };
  2934. static const struct regmap_config gcc_milos_regmap_config = {
  2935. .reg_bits = 32,
  2936. .reg_stride = 4,
  2937. .val_bits = 32,
  2938. .max_register = 0x1f41f0,
  2939. .fast_io = true,
  2940. };
  2941. static struct qcom_cc_driver_data gcc_milos_driver_data = {
  2942. .clk_cbcrs = gcc_milos_critical_cbcrs,
  2943. .num_clk_cbcrs = ARRAY_SIZE(gcc_milos_critical_cbcrs),
  2944. .dfs_rcgs = gcc_milos_dfs_clocks,
  2945. .num_dfs_rcgs = ARRAY_SIZE(gcc_milos_dfs_clocks),
  2946. };
  2947. static const struct qcom_cc_desc gcc_milos_desc = {
  2948. .config = &gcc_milos_regmap_config,
  2949. .clks = gcc_milos_clocks,
  2950. .num_clks = ARRAY_SIZE(gcc_milos_clocks),
  2951. .resets = gcc_milos_resets,
  2952. .num_resets = ARRAY_SIZE(gcc_milos_resets),
  2953. .gdscs = gcc_milos_gdscs,
  2954. .num_gdscs = ARRAY_SIZE(gcc_milos_gdscs),
  2955. .use_rpm = true,
  2956. .driver_data = &gcc_milos_driver_data,
  2957. };
  2958. static const struct of_device_id gcc_milos_match_table[] = {
  2959. { .compatible = "qcom,milos-gcc" },
  2960. { }
  2961. };
  2962. MODULE_DEVICE_TABLE(of, gcc_milos_match_table);
  2963. static int gcc_milos_probe(struct platform_device *pdev)
  2964. {
  2965. return qcom_cc_probe(pdev, &gcc_milos_desc);
  2966. }
  2967. static struct platform_driver gcc_milos_driver = {
  2968. .probe = gcc_milos_probe,
  2969. .driver = {
  2970. .name = "gcc-milos",
  2971. .of_match_table = gcc_milos_match_table,
  2972. },
  2973. };
  2974. static int __init gcc_milos_init(void)
  2975. {
  2976. return platform_driver_register(&gcc_milos_driver);
  2977. }
  2978. subsys_initcall(gcc_milos_init);
  2979. static void __exit gcc_milos_exit(void)
  2980. {
  2981. platform_driver_unregister(&gcc_milos_driver);
  2982. }
  2983. module_exit(gcc_milos_exit);
  2984. MODULE_DESCRIPTION("QTI GCC Milos Driver");
  2985. MODULE_LICENSE("GPL");