gcc-msm8974.c 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769
  1. /*
  2. * Copyright (c) 2013, The Linux Foundation. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/bitops.h>
  15. #include <linux/err.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/module.h>
  18. #include <linux/of.h>
  19. #include <linux/of_device.h>
  20. #include <linux/clk-provider.h>
  21. #include <linux/regmap.h>
  22. #include <linux/reset-controller.h>
  23. #include <dt-bindings/clock/qcom,gcc-msm8974.h>
  24. #include <dt-bindings/reset/qcom,gcc-msm8974.h>
  25. #include "common.h"
  26. #include "clk-regmap.h"
  27. #include "clk-pll.h"
  28. #include "clk-rcg.h"
  29. #include "clk-branch.h"
  30. #include "reset.h"
  31. #include "gdsc.h"
  32. enum {
  33. P_XO,
  34. P_GPLL0,
  35. P_GPLL1,
  36. P_GPLL4,
  37. };
  38. static const struct parent_map gcc_xo_gpll0_map[] = {
  39. { P_XO, 0 },
  40. { P_GPLL0, 1 }
  41. };
  42. static const char * const gcc_xo_gpll0[] = {
  43. "xo",
  44. "gpll0_vote",
  45. };
  46. static const struct parent_map gcc_xo_gpll0_gpll4_map[] = {
  47. { P_XO, 0 },
  48. { P_GPLL0, 1 },
  49. { P_GPLL4, 5 }
  50. };
  51. static const char * const gcc_xo_gpll0_gpll4[] = {
  52. "xo",
  53. "gpll0_vote",
  54. "gpll4_vote",
  55. };
  56. #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
  57. static struct clk_pll gpll0 = {
  58. .l_reg = 0x0004,
  59. .m_reg = 0x0008,
  60. .n_reg = 0x000c,
  61. .config_reg = 0x0014,
  62. .mode_reg = 0x0000,
  63. .status_reg = 0x001c,
  64. .status_bit = 17,
  65. .clkr.hw.init = &(struct clk_init_data){
  66. .name = "gpll0",
  67. .parent_names = (const char *[]){ "xo" },
  68. .num_parents = 1,
  69. .ops = &clk_pll_ops,
  70. },
  71. };
  72. static struct clk_regmap gpll0_vote = {
  73. .enable_reg = 0x1480,
  74. .enable_mask = BIT(0),
  75. .hw.init = &(struct clk_init_data){
  76. .name = "gpll0_vote",
  77. .parent_names = (const char *[]){ "gpll0" },
  78. .num_parents = 1,
  79. .ops = &clk_pll_vote_ops,
  80. },
  81. };
  82. static struct clk_rcg2 config_noc_clk_src = {
  83. .cmd_rcgr = 0x0150,
  84. .hid_width = 5,
  85. .parent_map = gcc_xo_gpll0_map,
  86. .clkr.hw.init = &(struct clk_init_data){
  87. .name = "config_noc_clk_src",
  88. .parent_names = gcc_xo_gpll0,
  89. .num_parents = 2,
  90. .ops = &clk_rcg2_ops,
  91. },
  92. };
  93. static struct clk_rcg2 periph_noc_clk_src = {
  94. .cmd_rcgr = 0x0190,
  95. .hid_width = 5,
  96. .parent_map = gcc_xo_gpll0_map,
  97. .clkr.hw.init = &(struct clk_init_data){
  98. .name = "periph_noc_clk_src",
  99. .parent_names = gcc_xo_gpll0,
  100. .num_parents = 2,
  101. .ops = &clk_rcg2_ops,
  102. },
  103. };
  104. static struct clk_rcg2 system_noc_clk_src = {
  105. .cmd_rcgr = 0x0120,
  106. .hid_width = 5,
  107. .parent_map = gcc_xo_gpll0_map,
  108. .clkr.hw.init = &(struct clk_init_data){
  109. .name = "system_noc_clk_src",
  110. .parent_names = gcc_xo_gpll0,
  111. .num_parents = 2,
  112. .ops = &clk_rcg2_ops,
  113. },
  114. };
  115. static struct clk_pll gpll1 = {
  116. .l_reg = 0x0044,
  117. .m_reg = 0x0048,
  118. .n_reg = 0x004c,
  119. .config_reg = 0x0054,
  120. .mode_reg = 0x0040,
  121. .status_reg = 0x005c,
  122. .status_bit = 17,
  123. .clkr.hw.init = &(struct clk_init_data){
  124. .name = "gpll1",
  125. .parent_names = (const char *[]){ "xo" },
  126. .num_parents = 1,
  127. .ops = &clk_pll_ops,
  128. },
  129. };
  130. static struct clk_regmap gpll1_vote = {
  131. .enable_reg = 0x1480,
  132. .enable_mask = BIT(1),
  133. .hw.init = &(struct clk_init_data){
  134. .name = "gpll1_vote",
  135. .parent_names = (const char *[]){ "gpll1" },
  136. .num_parents = 1,
  137. .ops = &clk_pll_vote_ops,
  138. },
  139. };
  140. static struct clk_pll gpll4 = {
  141. .l_reg = 0x1dc4,
  142. .m_reg = 0x1dc8,
  143. .n_reg = 0x1dcc,
  144. .config_reg = 0x1dd4,
  145. .mode_reg = 0x1dc0,
  146. .status_reg = 0x1ddc,
  147. .status_bit = 17,
  148. .clkr.hw.init = &(struct clk_init_data){
  149. .name = "gpll4",
  150. .parent_names = (const char *[]){ "xo" },
  151. .num_parents = 1,
  152. .ops = &clk_pll_ops,
  153. },
  154. };
  155. static struct clk_regmap gpll4_vote = {
  156. .enable_reg = 0x1480,
  157. .enable_mask = BIT(4),
  158. .hw.init = &(struct clk_init_data){
  159. .name = "gpll4_vote",
  160. .parent_names = (const char *[]){ "gpll4" },
  161. .num_parents = 1,
  162. .ops = &clk_pll_vote_ops,
  163. },
  164. };
  165. static const struct freq_tbl ftbl_gcc_usb30_master_clk[] = {
  166. F(125000000, P_GPLL0, 1, 5, 24),
  167. { }
  168. };
  169. static struct clk_rcg2 usb30_master_clk_src = {
  170. .cmd_rcgr = 0x03d4,
  171. .mnd_width = 8,
  172. .hid_width = 5,
  173. .parent_map = gcc_xo_gpll0_map,
  174. .freq_tbl = ftbl_gcc_usb30_master_clk,
  175. .clkr.hw.init = &(struct clk_init_data){
  176. .name = "usb30_master_clk_src",
  177. .parent_names = gcc_xo_gpll0,
  178. .num_parents = 2,
  179. .ops = &clk_rcg2_ops,
  180. },
  181. };
  182. static const struct freq_tbl ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk[] = {
  183. F(19200000, P_XO, 1, 0, 0),
  184. F(37500000, P_GPLL0, 16, 0, 0),
  185. F(50000000, P_GPLL0, 12, 0, 0),
  186. { }
  187. };
  188. static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
  189. .cmd_rcgr = 0x0660,
  190. .hid_width = 5,
  191. .parent_map = gcc_xo_gpll0_map,
  192. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  193. .clkr.hw.init = &(struct clk_init_data){
  194. .name = "blsp1_qup1_i2c_apps_clk_src",
  195. .parent_names = gcc_xo_gpll0,
  196. .num_parents = 2,
  197. .ops = &clk_rcg2_ops,
  198. },
  199. };
  200. static const struct freq_tbl ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk[] = {
  201. F(960000, P_XO, 10, 1, 2),
  202. F(4800000, P_XO, 4, 0, 0),
  203. F(9600000, P_XO, 2, 0, 0),
  204. F(15000000, P_GPLL0, 10, 1, 4),
  205. F(19200000, P_XO, 1, 0, 0),
  206. F(25000000, P_GPLL0, 12, 1, 2),
  207. F(50000000, P_GPLL0, 12, 0, 0),
  208. { }
  209. };
  210. static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
  211. .cmd_rcgr = 0x064c,
  212. .mnd_width = 8,
  213. .hid_width = 5,
  214. .parent_map = gcc_xo_gpll0_map,
  215. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  216. .clkr.hw.init = &(struct clk_init_data){
  217. .name = "blsp1_qup1_spi_apps_clk_src",
  218. .parent_names = gcc_xo_gpll0,
  219. .num_parents = 2,
  220. .ops = &clk_rcg2_ops,
  221. },
  222. };
  223. static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
  224. .cmd_rcgr = 0x06e0,
  225. .hid_width = 5,
  226. .parent_map = gcc_xo_gpll0_map,
  227. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  228. .clkr.hw.init = &(struct clk_init_data){
  229. .name = "blsp1_qup2_i2c_apps_clk_src",
  230. .parent_names = gcc_xo_gpll0,
  231. .num_parents = 2,
  232. .ops = &clk_rcg2_ops,
  233. },
  234. };
  235. static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
  236. .cmd_rcgr = 0x06cc,
  237. .mnd_width = 8,
  238. .hid_width = 5,
  239. .parent_map = gcc_xo_gpll0_map,
  240. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  241. .clkr.hw.init = &(struct clk_init_data){
  242. .name = "blsp1_qup2_spi_apps_clk_src",
  243. .parent_names = gcc_xo_gpll0,
  244. .num_parents = 2,
  245. .ops = &clk_rcg2_ops,
  246. },
  247. };
  248. static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
  249. .cmd_rcgr = 0x0760,
  250. .hid_width = 5,
  251. .parent_map = gcc_xo_gpll0_map,
  252. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  253. .clkr.hw.init = &(struct clk_init_data){
  254. .name = "blsp1_qup3_i2c_apps_clk_src",
  255. .parent_names = gcc_xo_gpll0,
  256. .num_parents = 2,
  257. .ops = &clk_rcg2_ops,
  258. },
  259. };
  260. static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
  261. .cmd_rcgr = 0x074c,
  262. .mnd_width = 8,
  263. .hid_width = 5,
  264. .parent_map = gcc_xo_gpll0_map,
  265. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  266. .clkr.hw.init = &(struct clk_init_data){
  267. .name = "blsp1_qup3_spi_apps_clk_src",
  268. .parent_names = gcc_xo_gpll0,
  269. .num_parents = 2,
  270. .ops = &clk_rcg2_ops,
  271. },
  272. };
  273. static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
  274. .cmd_rcgr = 0x07e0,
  275. .hid_width = 5,
  276. .parent_map = gcc_xo_gpll0_map,
  277. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  278. .clkr.hw.init = &(struct clk_init_data){
  279. .name = "blsp1_qup4_i2c_apps_clk_src",
  280. .parent_names = gcc_xo_gpll0,
  281. .num_parents = 2,
  282. .ops = &clk_rcg2_ops,
  283. },
  284. };
  285. static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
  286. .cmd_rcgr = 0x07cc,
  287. .mnd_width = 8,
  288. .hid_width = 5,
  289. .parent_map = gcc_xo_gpll0_map,
  290. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  291. .clkr.hw.init = &(struct clk_init_data){
  292. .name = "blsp1_qup4_spi_apps_clk_src",
  293. .parent_names = gcc_xo_gpll0,
  294. .num_parents = 2,
  295. .ops = &clk_rcg2_ops,
  296. },
  297. };
  298. static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
  299. .cmd_rcgr = 0x0860,
  300. .hid_width = 5,
  301. .parent_map = gcc_xo_gpll0_map,
  302. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  303. .clkr.hw.init = &(struct clk_init_data){
  304. .name = "blsp1_qup5_i2c_apps_clk_src",
  305. .parent_names = gcc_xo_gpll0,
  306. .num_parents = 2,
  307. .ops = &clk_rcg2_ops,
  308. },
  309. };
  310. static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
  311. .cmd_rcgr = 0x084c,
  312. .mnd_width = 8,
  313. .hid_width = 5,
  314. .parent_map = gcc_xo_gpll0_map,
  315. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  316. .clkr.hw.init = &(struct clk_init_data){
  317. .name = "blsp1_qup5_spi_apps_clk_src",
  318. .parent_names = gcc_xo_gpll0,
  319. .num_parents = 2,
  320. .ops = &clk_rcg2_ops,
  321. },
  322. };
  323. static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
  324. .cmd_rcgr = 0x08e0,
  325. .hid_width = 5,
  326. .parent_map = gcc_xo_gpll0_map,
  327. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  328. .clkr.hw.init = &(struct clk_init_data){
  329. .name = "blsp1_qup6_i2c_apps_clk_src",
  330. .parent_names = gcc_xo_gpll0,
  331. .num_parents = 2,
  332. .ops = &clk_rcg2_ops,
  333. },
  334. };
  335. static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
  336. .cmd_rcgr = 0x08cc,
  337. .mnd_width = 8,
  338. .hid_width = 5,
  339. .parent_map = gcc_xo_gpll0_map,
  340. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  341. .clkr.hw.init = &(struct clk_init_data){
  342. .name = "blsp1_qup6_spi_apps_clk_src",
  343. .parent_names = gcc_xo_gpll0,
  344. .num_parents = 2,
  345. .ops = &clk_rcg2_ops,
  346. },
  347. };
  348. static const struct freq_tbl ftbl_gcc_blsp1_2_uart1_6_apps_clk[] = {
  349. F(3686400, P_GPLL0, 1, 96, 15625),
  350. F(7372800, P_GPLL0, 1, 192, 15625),
  351. F(14745600, P_GPLL0, 1, 384, 15625),
  352. F(16000000, P_GPLL0, 5, 2, 15),
  353. F(19200000, P_XO, 1, 0, 0),
  354. F(24000000, P_GPLL0, 5, 1, 5),
  355. F(32000000, P_GPLL0, 1, 4, 75),
  356. F(40000000, P_GPLL0, 15, 0, 0),
  357. F(46400000, P_GPLL0, 1, 29, 375),
  358. F(48000000, P_GPLL0, 12.5, 0, 0),
  359. F(51200000, P_GPLL0, 1, 32, 375),
  360. F(56000000, P_GPLL0, 1, 7, 75),
  361. F(58982400, P_GPLL0, 1, 1536, 15625),
  362. F(60000000, P_GPLL0, 10, 0, 0),
  363. F(63160000, P_GPLL0, 9.5, 0, 0),
  364. { }
  365. };
  366. static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
  367. .cmd_rcgr = 0x068c,
  368. .mnd_width = 16,
  369. .hid_width = 5,
  370. .parent_map = gcc_xo_gpll0_map,
  371. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  372. .clkr.hw.init = &(struct clk_init_data){
  373. .name = "blsp1_uart1_apps_clk_src",
  374. .parent_names = gcc_xo_gpll0,
  375. .num_parents = 2,
  376. .ops = &clk_rcg2_ops,
  377. },
  378. };
  379. static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
  380. .cmd_rcgr = 0x070c,
  381. .mnd_width = 16,
  382. .hid_width = 5,
  383. .parent_map = gcc_xo_gpll0_map,
  384. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  385. .clkr.hw.init = &(struct clk_init_data){
  386. .name = "blsp1_uart2_apps_clk_src",
  387. .parent_names = gcc_xo_gpll0,
  388. .num_parents = 2,
  389. .ops = &clk_rcg2_ops,
  390. },
  391. };
  392. static struct clk_rcg2 blsp1_uart3_apps_clk_src = {
  393. .cmd_rcgr = 0x078c,
  394. .mnd_width = 16,
  395. .hid_width = 5,
  396. .parent_map = gcc_xo_gpll0_map,
  397. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  398. .clkr.hw.init = &(struct clk_init_data){
  399. .name = "blsp1_uart3_apps_clk_src",
  400. .parent_names = gcc_xo_gpll0,
  401. .num_parents = 2,
  402. .ops = &clk_rcg2_ops,
  403. },
  404. };
  405. static struct clk_rcg2 blsp1_uart4_apps_clk_src = {
  406. .cmd_rcgr = 0x080c,
  407. .mnd_width = 16,
  408. .hid_width = 5,
  409. .parent_map = gcc_xo_gpll0_map,
  410. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  411. .clkr.hw.init = &(struct clk_init_data){
  412. .name = "blsp1_uart4_apps_clk_src",
  413. .parent_names = gcc_xo_gpll0,
  414. .num_parents = 2,
  415. .ops = &clk_rcg2_ops,
  416. },
  417. };
  418. static struct clk_rcg2 blsp1_uart5_apps_clk_src = {
  419. .cmd_rcgr = 0x088c,
  420. .mnd_width = 16,
  421. .hid_width = 5,
  422. .parent_map = gcc_xo_gpll0_map,
  423. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  424. .clkr.hw.init = &(struct clk_init_data){
  425. .name = "blsp1_uart5_apps_clk_src",
  426. .parent_names = gcc_xo_gpll0,
  427. .num_parents = 2,
  428. .ops = &clk_rcg2_ops,
  429. },
  430. };
  431. static struct clk_rcg2 blsp1_uart6_apps_clk_src = {
  432. .cmd_rcgr = 0x090c,
  433. .mnd_width = 16,
  434. .hid_width = 5,
  435. .parent_map = gcc_xo_gpll0_map,
  436. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  437. .clkr.hw.init = &(struct clk_init_data){
  438. .name = "blsp1_uart6_apps_clk_src",
  439. .parent_names = gcc_xo_gpll0,
  440. .num_parents = 2,
  441. .ops = &clk_rcg2_ops,
  442. },
  443. };
  444. static struct clk_rcg2 blsp2_qup1_i2c_apps_clk_src = {
  445. .cmd_rcgr = 0x09a0,
  446. .hid_width = 5,
  447. .parent_map = gcc_xo_gpll0_map,
  448. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  449. .clkr.hw.init = &(struct clk_init_data){
  450. .name = "blsp2_qup1_i2c_apps_clk_src",
  451. .parent_names = gcc_xo_gpll0,
  452. .num_parents = 2,
  453. .ops = &clk_rcg2_ops,
  454. },
  455. };
  456. static struct clk_rcg2 blsp2_qup1_spi_apps_clk_src = {
  457. .cmd_rcgr = 0x098c,
  458. .mnd_width = 8,
  459. .hid_width = 5,
  460. .parent_map = gcc_xo_gpll0_map,
  461. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  462. .clkr.hw.init = &(struct clk_init_data){
  463. .name = "blsp2_qup1_spi_apps_clk_src",
  464. .parent_names = gcc_xo_gpll0,
  465. .num_parents = 2,
  466. .ops = &clk_rcg2_ops,
  467. },
  468. };
  469. static struct clk_rcg2 blsp2_qup2_i2c_apps_clk_src = {
  470. .cmd_rcgr = 0x0a20,
  471. .hid_width = 5,
  472. .parent_map = gcc_xo_gpll0_map,
  473. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  474. .clkr.hw.init = &(struct clk_init_data){
  475. .name = "blsp2_qup2_i2c_apps_clk_src",
  476. .parent_names = gcc_xo_gpll0,
  477. .num_parents = 2,
  478. .ops = &clk_rcg2_ops,
  479. },
  480. };
  481. static struct clk_rcg2 blsp2_qup2_spi_apps_clk_src = {
  482. .cmd_rcgr = 0x0a0c,
  483. .mnd_width = 8,
  484. .hid_width = 5,
  485. .parent_map = gcc_xo_gpll0_map,
  486. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  487. .clkr.hw.init = &(struct clk_init_data){
  488. .name = "blsp2_qup2_spi_apps_clk_src",
  489. .parent_names = gcc_xo_gpll0,
  490. .num_parents = 2,
  491. .ops = &clk_rcg2_ops,
  492. },
  493. };
  494. static struct clk_rcg2 blsp2_qup3_i2c_apps_clk_src = {
  495. .cmd_rcgr = 0x0aa0,
  496. .hid_width = 5,
  497. .parent_map = gcc_xo_gpll0_map,
  498. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  499. .clkr.hw.init = &(struct clk_init_data){
  500. .name = "blsp2_qup3_i2c_apps_clk_src",
  501. .parent_names = gcc_xo_gpll0,
  502. .num_parents = 2,
  503. .ops = &clk_rcg2_ops,
  504. },
  505. };
  506. static struct clk_rcg2 blsp2_qup3_spi_apps_clk_src = {
  507. .cmd_rcgr = 0x0a8c,
  508. .mnd_width = 8,
  509. .hid_width = 5,
  510. .parent_map = gcc_xo_gpll0_map,
  511. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  512. .clkr.hw.init = &(struct clk_init_data){
  513. .name = "blsp2_qup3_spi_apps_clk_src",
  514. .parent_names = gcc_xo_gpll0,
  515. .num_parents = 2,
  516. .ops = &clk_rcg2_ops,
  517. },
  518. };
  519. static struct clk_rcg2 blsp2_qup4_i2c_apps_clk_src = {
  520. .cmd_rcgr = 0x0b20,
  521. .hid_width = 5,
  522. .parent_map = gcc_xo_gpll0_map,
  523. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  524. .clkr.hw.init = &(struct clk_init_data){
  525. .name = "blsp2_qup4_i2c_apps_clk_src",
  526. .parent_names = gcc_xo_gpll0,
  527. .num_parents = 2,
  528. .ops = &clk_rcg2_ops,
  529. },
  530. };
  531. static struct clk_rcg2 blsp2_qup4_spi_apps_clk_src = {
  532. .cmd_rcgr = 0x0b0c,
  533. .mnd_width = 8,
  534. .hid_width = 5,
  535. .parent_map = gcc_xo_gpll0_map,
  536. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  537. .clkr.hw.init = &(struct clk_init_data){
  538. .name = "blsp2_qup4_spi_apps_clk_src",
  539. .parent_names = gcc_xo_gpll0,
  540. .num_parents = 2,
  541. .ops = &clk_rcg2_ops,
  542. },
  543. };
  544. static struct clk_rcg2 blsp2_qup5_i2c_apps_clk_src = {
  545. .cmd_rcgr = 0x0ba0,
  546. .hid_width = 5,
  547. .parent_map = gcc_xo_gpll0_map,
  548. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  549. .clkr.hw.init = &(struct clk_init_data){
  550. .name = "blsp2_qup5_i2c_apps_clk_src",
  551. .parent_names = gcc_xo_gpll0,
  552. .num_parents = 2,
  553. .ops = &clk_rcg2_ops,
  554. },
  555. };
  556. static struct clk_rcg2 blsp2_qup5_spi_apps_clk_src = {
  557. .cmd_rcgr = 0x0b8c,
  558. .mnd_width = 8,
  559. .hid_width = 5,
  560. .parent_map = gcc_xo_gpll0_map,
  561. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  562. .clkr.hw.init = &(struct clk_init_data){
  563. .name = "blsp2_qup5_spi_apps_clk_src",
  564. .parent_names = gcc_xo_gpll0,
  565. .num_parents = 2,
  566. .ops = &clk_rcg2_ops,
  567. },
  568. };
  569. static struct clk_rcg2 blsp2_qup6_i2c_apps_clk_src = {
  570. .cmd_rcgr = 0x0c20,
  571. .hid_width = 5,
  572. .parent_map = gcc_xo_gpll0_map,
  573. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
  574. .clkr.hw.init = &(struct clk_init_data){
  575. .name = "blsp2_qup6_i2c_apps_clk_src",
  576. .parent_names = gcc_xo_gpll0,
  577. .num_parents = 2,
  578. .ops = &clk_rcg2_ops,
  579. },
  580. };
  581. static struct clk_rcg2 blsp2_qup6_spi_apps_clk_src = {
  582. .cmd_rcgr = 0x0c0c,
  583. .mnd_width = 8,
  584. .hid_width = 5,
  585. .parent_map = gcc_xo_gpll0_map,
  586. .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
  587. .clkr.hw.init = &(struct clk_init_data){
  588. .name = "blsp2_qup6_spi_apps_clk_src",
  589. .parent_names = gcc_xo_gpll0,
  590. .num_parents = 2,
  591. .ops = &clk_rcg2_ops,
  592. },
  593. };
  594. static struct clk_rcg2 blsp2_uart1_apps_clk_src = {
  595. .cmd_rcgr = 0x09cc,
  596. .mnd_width = 16,
  597. .hid_width = 5,
  598. .parent_map = gcc_xo_gpll0_map,
  599. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  600. .clkr.hw.init = &(struct clk_init_data){
  601. .name = "blsp2_uart1_apps_clk_src",
  602. .parent_names = gcc_xo_gpll0,
  603. .num_parents = 2,
  604. .ops = &clk_rcg2_ops,
  605. },
  606. };
  607. static struct clk_rcg2 blsp2_uart2_apps_clk_src = {
  608. .cmd_rcgr = 0x0a4c,
  609. .mnd_width = 16,
  610. .hid_width = 5,
  611. .parent_map = gcc_xo_gpll0_map,
  612. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  613. .clkr.hw.init = &(struct clk_init_data){
  614. .name = "blsp2_uart2_apps_clk_src",
  615. .parent_names = gcc_xo_gpll0,
  616. .num_parents = 2,
  617. .ops = &clk_rcg2_ops,
  618. },
  619. };
  620. static struct clk_rcg2 blsp2_uart3_apps_clk_src = {
  621. .cmd_rcgr = 0x0acc,
  622. .mnd_width = 16,
  623. .hid_width = 5,
  624. .parent_map = gcc_xo_gpll0_map,
  625. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  626. .clkr.hw.init = &(struct clk_init_data){
  627. .name = "blsp2_uart3_apps_clk_src",
  628. .parent_names = gcc_xo_gpll0,
  629. .num_parents = 2,
  630. .ops = &clk_rcg2_ops,
  631. },
  632. };
  633. static struct clk_rcg2 blsp2_uart4_apps_clk_src = {
  634. .cmd_rcgr = 0x0b4c,
  635. .mnd_width = 16,
  636. .hid_width = 5,
  637. .parent_map = gcc_xo_gpll0_map,
  638. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  639. .clkr.hw.init = &(struct clk_init_data){
  640. .name = "blsp2_uart4_apps_clk_src",
  641. .parent_names = gcc_xo_gpll0,
  642. .num_parents = 2,
  643. .ops = &clk_rcg2_ops,
  644. },
  645. };
  646. static struct clk_rcg2 blsp2_uart5_apps_clk_src = {
  647. .cmd_rcgr = 0x0bcc,
  648. .mnd_width = 16,
  649. .hid_width = 5,
  650. .parent_map = gcc_xo_gpll0_map,
  651. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  652. .clkr.hw.init = &(struct clk_init_data){
  653. .name = "blsp2_uart5_apps_clk_src",
  654. .parent_names = gcc_xo_gpll0,
  655. .num_parents = 2,
  656. .ops = &clk_rcg2_ops,
  657. },
  658. };
  659. static struct clk_rcg2 blsp2_uart6_apps_clk_src = {
  660. .cmd_rcgr = 0x0c4c,
  661. .mnd_width = 16,
  662. .hid_width = 5,
  663. .parent_map = gcc_xo_gpll0_map,
  664. .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
  665. .clkr.hw.init = &(struct clk_init_data){
  666. .name = "blsp2_uart6_apps_clk_src",
  667. .parent_names = gcc_xo_gpll0,
  668. .num_parents = 2,
  669. .ops = &clk_rcg2_ops,
  670. },
  671. };
  672. static const struct freq_tbl ftbl_gcc_ce1_clk[] = {
  673. F(50000000, P_GPLL0, 12, 0, 0),
  674. F(75000000, P_GPLL0, 8, 0, 0),
  675. F(100000000, P_GPLL0, 6, 0, 0),
  676. F(150000000, P_GPLL0, 4, 0, 0),
  677. { }
  678. };
  679. static struct clk_rcg2 ce1_clk_src = {
  680. .cmd_rcgr = 0x1050,
  681. .hid_width = 5,
  682. .parent_map = gcc_xo_gpll0_map,
  683. .freq_tbl = ftbl_gcc_ce1_clk,
  684. .clkr.hw.init = &(struct clk_init_data){
  685. .name = "ce1_clk_src",
  686. .parent_names = gcc_xo_gpll0,
  687. .num_parents = 2,
  688. .ops = &clk_rcg2_ops,
  689. },
  690. };
  691. static const struct freq_tbl ftbl_gcc_ce2_clk[] = {
  692. F(50000000, P_GPLL0, 12, 0, 0),
  693. F(75000000, P_GPLL0, 8, 0, 0),
  694. F(100000000, P_GPLL0, 6, 0, 0),
  695. F(150000000, P_GPLL0, 4, 0, 0),
  696. { }
  697. };
  698. static struct clk_rcg2 ce2_clk_src = {
  699. .cmd_rcgr = 0x1090,
  700. .hid_width = 5,
  701. .parent_map = gcc_xo_gpll0_map,
  702. .freq_tbl = ftbl_gcc_ce2_clk,
  703. .clkr.hw.init = &(struct clk_init_data){
  704. .name = "ce2_clk_src",
  705. .parent_names = gcc_xo_gpll0,
  706. .num_parents = 2,
  707. .ops = &clk_rcg2_ops,
  708. },
  709. };
  710. static const struct freq_tbl ftbl_gcc_gp_clk[] = {
  711. F(4800000, P_XO, 4, 0, 0),
  712. F(6000000, P_GPLL0, 10, 1, 10),
  713. F(6750000, P_GPLL0, 1, 1, 89),
  714. F(8000000, P_GPLL0, 15, 1, 5),
  715. F(9600000, P_XO, 2, 0, 0),
  716. F(16000000, P_GPLL0, 1, 2, 75),
  717. F(19200000, P_XO, 1, 0, 0),
  718. F(24000000, P_GPLL0, 5, 1, 5),
  719. { }
  720. };
  721. static struct clk_rcg2 gp1_clk_src = {
  722. .cmd_rcgr = 0x1904,
  723. .mnd_width = 8,
  724. .hid_width = 5,
  725. .parent_map = gcc_xo_gpll0_map,
  726. .freq_tbl = ftbl_gcc_gp_clk,
  727. .clkr.hw.init = &(struct clk_init_data){
  728. .name = "gp1_clk_src",
  729. .parent_names = gcc_xo_gpll0,
  730. .num_parents = 2,
  731. .ops = &clk_rcg2_ops,
  732. },
  733. };
  734. static struct clk_rcg2 gp2_clk_src = {
  735. .cmd_rcgr = 0x1944,
  736. .mnd_width = 8,
  737. .hid_width = 5,
  738. .parent_map = gcc_xo_gpll0_map,
  739. .freq_tbl = ftbl_gcc_gp_clk,
  740. .clkr.hw.init = &(struct clk_init_data){
  741. .name = "gp2_clk_src",
  742. .parent_names = gcc_xo_gpll0,
  743. .num_parents = 2,
  744. .ops = &clk_rcg2_ops,
  745. },
  746. };
  747. static struct clk_rcg2 gp3_clk_src = {
  748. .cmd_rcgr = 0x1984,
  749. .mnd_width = 8,
  750. .hid_width = 5,
  751. .parent_map = gcc_xo_gpll0_map,
  752. .freq_tbl = ftbl_gcc_gp_clk,
  753. .clkr.hw.init = &(struct clk_init_data){
  754. .name = "gp3_clk_src",
  755. .parent_names = gcc_xo_gpll0,
  756. .num_parents = 2,
  757. .ops = &clk_rcg2_ops,
  758. },
  759. };
  760. static const struct freq_tbl ftbl_gcc_pdm2_clk[] = {
  761. F(60000000, P_GPLL0, 10, 0, 0),
  762. { }
  763. };
  764. static struct clk_rcg2 pdm2_clk_src = {
  765. .cmd_rcgr = 0x0cd0,
  766. .hid_width = 5,
  767. .parent_map = gcc_xo_gpll0_map,
  768. .freq_tbl = ftbl_gcc_pdm2_clk,
  769. .clkr.hw.init = &(struct clk_init_data){
  770. .name = "pdm2_clk_src",
  771. .parent_names = gcc_xo_gpll0,
  772. .num_parents = 2,
  773. .ops = &clk_rcg2_ops,
  774. },
  775. };
  776. static const struct freq_tbl ftbl_gcc_sdcc1_4_apps_clk[] = {
  777. F(144000, P_XO, 16, 3, 25),
  778. F(400000, P_XO, 12, 1, 4),
  779. F(20000000, P_GPLL0, 15, 1, 2),
  780. F(25000000, P_GPLL0, 12, 1, 2),
  781. F(50000000, P_GPLL0, 12, 0, 0),
  782. F(100000000, P_GPLL0, 6, 0, 0),
  783. F(200000000, P_GPLL0, 3, 0, 0),
  784. { }
  785. };
  786. static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_pro[] = {
  787. F(144000, P_XO, 16, 3, 25),
  788. F(400000, P_XO, 12, 1, 4),
  789. F(20000000, P_GPLL0, 15, 1, 2),
  790. F(25000000, P_GPLL0, 12, 1, 2),
  791. F(50000000, P_GPLL0, 12, 0, 0),
  792. F(100000000, P_GPLL0, 6, 0, 0),
  793. F(192000000, P_GPLL4, 4, 0, 0),
  794. F(200000000, P_GPLL0, 3, 0, 0),
  795. F(384000000, P_GPLL4, 2, 0, 0),
  796. { }
  797. };
  798. static struct clk_init_data sdcc1_apps_clk_src_init = {
  799. .name = "sdcc1_apps_clk_src",
  800. .parent_names = gcc_xo_gpll0,
  801. .num_parents = 2,
  802. .ops = &clk_rcg2_ops,
  803. };
  804. static struct clk_rcg2 sdcc1_apps_clk_src = {
  805. .cmd_rcgr = 0x04d0,
  806. .mnd_width = 8,
  807. .hid_width = 5,
  808. .parent_map = gcc_xo_gpll0_map,
  809. .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
  810. .clkr.hw.init = &sdcc1_apps_clk_src_init,
  811. };
  812. static struct clk_rcg2 sdcc2_apps_clk_src = {
  813. .cmd_rcgr = 0x0510,
  814. .mnd_width = 8,
  815. .hid_width = 5,
  816. .parent_map = gcc_xo_gpll0_map,
  817. .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
  818. .clkr.hw.init = &(struct clk_init_data){
  819. .name = "sdcc2_apps_clk_src",
  820. .parent_names = gcc_xo_gpll0,
  821. .num_parents = 2,
  822. .ops = &clk_rcg2_ops,
  823. },
  824. };
  825. static struct clk_rcg2 sdcc3_apps_clk_src = {
  826. .cmd_rcgr = 0x0550,
  827. .mnd_width = 8,
  828. .hid_width = 5,
  829. .parent_map = gcc_xo_gpll0_map,
  830. .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
  831. .clkr.hw.init = &(struct clk_init_data){
  832. .name = "sdcc3_apps_clk_src",
  833. .parent_names = gcc_xo_gpll0,
  834. .num_parents = 2,
  835. .ops = &clk_rcg2_ops,
  836. },
  837. };
  838. static struct clk_rcg2 sdcc4_apps_clk_src = {
  839. .cmd_rcgr = 0x0590,
  840. .mnd_width = 8,
  841. .hid_width = 5,
  842. .parent_map = gcc_xo_gpll0_map,
  843. .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
  844. .clkr.hw.init = &(struct clk_init_data){
  845. .name = "sdcc4_apps_clk_src",
  846. .parent_names = gcc_xo_gpll0,
  847. .num_parents = 2,
  848. .ops = &clk_rcg2_ops,
  849. },
  850. };
  851. static const struct freq_tbl ftbl_gcc_tsif_ref_clk[] = {
  852. F(105000, P_XO, 2, 1, 91),
  853. { }
  854. };
  855. static struct clk_rcg2 tsif_ref_clk_src = {
  856. .cmd_rcgr = 0x0d90,
  857. .mnd_width = 8,
  858. .hid_width = 5,
  859. .parent_map = gcc_xo_gpll0_map,
  860. .freq_tbl = ftbl_gcc_tsif_ref_clk,
  861. .clkr.hw.init = &(struct clk_init_data){
  862. .name = "tsif_ref_clk_src",
  863. .parent_names = gcc_xo_gpll0,
  864. .num_parents = 2,
  865. .ops = &clk_rcg2_ops,
  866. },
  867. };
  868. static const struct freq_tbl ftbl_gcc_usb30_mock_utmi_clk[] = {
  869. F(60000000, P_GPLL0, 10, 0, 0),
  870. { }
  871. };
  872. static struct clk_rcg2 usb30_mock_utmi_clk_src = {
  873. .cmd_rcgr = 0x03e8,
  874. .hid_width = 5,
  875. .parent_map = gcc_xo_gpll0_map,
  876. .freq_tbl = ftbl_gcc_usb30_mock_utmi_clk,
  877. .clkr.hw.init = &(struct clk_init_data){
  878. .name = "usb30_mock_utmi_clk_src",
  879. .parent_names = gcc_xo_gpll0,
  880. .num_parents = 2,
  881. .ops = &clk_rcg2_ops,
  882. },
  883. };
  884. static const struct freq_tbl ftbl_gcc_usb_hs_system_clk[] = {
  885. F(60000000, P_GPLL0, 10, 0, 0),
  886. F(75000000, P_GPLL0, 8, 0, 0),
  887. { }
  888. };
  889. static struct clk_rcg2 usb_hs_system_clk_src = {
  890. .cmd_rcgr = 0x0490,
  891. .hid_width = 5,
  892. .parent_map = gcc_xo_gpll0_map,
  893. .freq_tbl = ftbl_gcc_usb_hs_system_clk,
  894. .clkr.hw.init = &(struct clk_init_data){
  895. .name = "usb_hs_system_clk_src",
  896. .parent_names = gcc_xo_gpll0,
  897. .num_parents = 2,
  898. .ops = &clk_rcg2_ops,
  899. },
  900. };
  901. static const struct freq_tbl ftbl_gcc_usb_hsic_clk[] = {
  902. F(480000000, P_GPLL1, 1, 0, 0),
  903. { }
  904. };
  905. static const struct parent_map usb_hsic_clk_src_map[] = {
  906. { P_XO, 0 },
  907. { P_GPLL1, 4 }
  908. };
  909. static struct clk_rcg2 usb_hsic_clk_src = {
  910. .cmd_rcgr = 0x0440,
  911. .hid_width = 5,
  912. .parent_map = usb_hsic_clk_src_map,
  913. .freq_tbl = ftbl_gcc_usb_hsic_clk,
  914. .clkr.hw.init = &(struct clk_init_data){
  915. .name = "usb_hsic_clk_src",
  916. .parent_names = (const char *[]){
  917. "xo",
  918. "gpll1_vote",
  919. },
  920. .num_parents = 2,
  921. .ops = &clk_rcg2_ops,
  922. },
  923. };
  924. static const struct freq_tbl ftbl_gcc_usb_hsic_io_cal_clk[] = {
  925. F(9600000, P_XO, 2, 0, 0),
  926. { }
  927. };
  928. static struct clk_rcg2 usb_hsic_io_cal_clk_src = {
  929. .cmd_rcgr = 0x0458,
  930. .hid_width = 5,
  931. .parent_map = gcc_xo_gpll0_map,
  932. .freq_tbl = ftbl_gcc_usb_hsic_io_cal_clk,
  933. .clkr.hw.init = &(struct clk_init_data){
  934. .name = "usb_hsic_io_cal_clk_src",
  935. .parent_names = gcc_xo_gpll0,
  936. .num_parents = 1,
  937. .ops = &clk_rcg2_ops,
  938. },
  939. };
  940. static const struct freq_tbl ftbl_gcc_usb_hsic_system_clk[] = {
  941. F(60000000, P_GPLL0, 10, 0, 0),
  942. F(75000000, P_GPLL0, 8, 0, 0),
  943. { }
  944. };
  945. static struct clk_rcg2 usb_hsic_system_clk_src = {
  946. .cmd_rcgr = 0x041c,
  947. .hid_width = 5,
  948. .parent_map = gcc_xo_gpll0_map,
  949. .freq_tbl = ftbl_gcc_usb_hsic_system_clk,
  950. .clkr.hw.init = &(struct clk_init_data){
  951. .name = "usb_hsic_system_clk_src",
  952. .parent_names = gcc_xo_gpll0,
  953. .num_parents = 2,
  954. .ops = &clk_rcg2_ops,
  955. },
  956. };
  957. static struct clk_regmap gcc_mmss_gpll0_clk_src = {
  958. .enable_reg = 0x1484,
  959. .enable_mask = BIT(26),
  960. .hw.init = &(struct clk_init_data){
  961. .name = "mmss_gpll0_vote",
  962. .parent_names = (const char *[]){
  963. "gpll0_vote",
  964. },
  965. .num_parents = 1,
  966. .ops = &clk_branch_simple_ops,
  967. },
  968. };
  969. static struct clk_branch gcc_bam_dma_ahb_clk = {
  970. .halt_reg = 0x0d44,
  971. .halt_check = BRANCH_HALT_VOTED,
  972. .clkr = {
  973. .enable_reg = 0x1484,
  974. .enable_mask = BIT(12),
  975. .hw.init = &(struct clk_init_data){
  976. .name = "gcc_bam_dma_ahb_clk",
  977. .parent_names = (const char *[]){
  978. "periph_noc_clk_src",
  979. },
  980. .num_parents = 1,
  981. .ops = &clk_branch2_ops,
  982. },
  983. },
  984. };
  985. static struct clk_branch gcc_blsp1_ahb_clk = {
  986. .halt_reg = 0x05c4,
  987. .halt_check = BRANCH_HALT_VOTED,
  988. .clkr = {
  989. .enable_reg = 0x1484,
  990. .enable_mask = BIT(17),
  991. .hw.init = &(struct clk_init_data){
  992. .name = "gcc_blsp1_ahb_clk",
  993. .parent_names = (const char *[]){
  994. "periph_noc_clk_src",
  995. },
  996. .num_parents = 1,
  997. .ops = &clk_branch2_ops,
  998. },
  999. },
  1000. };
  1001. static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
  1002. .halt_reg = 0x0648,
  1003. .clkr = {
  1004. .enable_reg = 0x0648,
  1005. .enable_mask = BIT(0),
  1006. .hw.init = &(struct clk_init_data){
  1007. .name = "gcc_blsp1_qup1_i2c_apps_clk",
  1008. .parent_names = (const char *[]){
  1009. "blsp1_qup1_i2c_apps_clk_src",
  1010. },
  1011. .num_parents = 1,
  1012. .flags = CLK_SET_RATE_PARENT,
  1013. .ops = &clk_branch2_ops,
  1014. },
  1015. },
  1016. };
  1017. static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
  1018. .halt_reg = 0x0644,
  1019. .clkr = {
  1020. .enable_reg = 0x0644,
  1021. .enable_mask = BIT(0),
  1022. .hw.init = &(struct clk_init_data){
  1023. .name = "gcc_blsp1_qup1_spi_apps_clk",
  1024. .parent_names = (const char *[]){
  1025. "blsp1_qup1_spi_apps_clk_src",
  1026. },
  1027. .num_parents = 1,
  1028. .flags = CLK_SET_RATE_PARENT,
  1029. .ops = &clk_branch2_ops,
  1030. },
  1031. },
  1032. };
  1033. static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
  1034. .halt_reg = 0x06c8,
  1035. .clkr = {
  1036. .enable_reg = 0x06c8,
  1037. .enable_mask = BIT(0),
  1038. .hw.init = &(struct clk_init_data){
  1039. .name = "gcc_blsp1_qup2_i2c_apps_clk",
  1040. .parent_names = (const char *[]){
  1041. "blsp1_qup2_i2c_apps_clk_src",
  1042. },
  1043. .num_parents = 1,
  1044. .flags = CLK_SET_RATE_PARENT,
  1045. .ops = &clk_branch2_ops,
  1046. },
  1047. },
  1048. };
  1049. static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
  1050. .halt_reg = 0x06c4,
  1051. .clkr = {
  1052. .enable_reg = 0x06c4,
  1053. .enable_mask = BIT(0),
  1054. .hw.init = &(struct clk_init_data){
  1055. .name = "gcc_blsp1_qup2_spi_apps_clk",
  1056. .parent_names = (const char *[]){
  1057. "blsp1_qup2_spi_apps_clk_src",
  1058. },
  1059. .num_parents = 1,
  1060. .flags = CLK_SET_RATE_PARENT,
  1061. .ops = &clk_branch2_ops,
  1062. },
  1063. },
  1064. };
  1065. static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
  1066. .halt_reg = 0x0748,
  1067. .clkr = {
  1068. .enable_reg = 0x0748,
  1069. .enable_mask = BIT(0),
  1070. .hw.init = &(struct clk_init_data){
  1071. .name = "gcc_blsp1_qup3_i2c_apps_clk",
  1072. .parent_names = (const char *[]){
  1073. "blsp1_qup3_i2c_apps_clk_src",
  1074. },
  1075. .num_parents = 1,
  1076. .flags = CLK_SET_RATE_PARENT,
  1077. .ops = &clk_branch2_ops,
  1078. },
  1079. },
  1080. };
  1081. static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = {
  1082. .halt_reg = 0x0744,
  1083. .clkr = {
  1084. .enable_reg = 0x0744,
  1085. .enable_mask = BIT(0),
  1086. .hw.init = &(struct clk_init_data){
  1087. .name = "gcc_blsp1_qup3_spi_apps_clk",
  1088. .parent_names = (const char *[]){
  1089. "blsp1_qup3_spi_apps_clk_src",
  1090. },
  1091. .num_parents = 1,
  1092. .flags = CLK_SET_RATE_PARENT,
  1093. .ops = &clk_branch2_ops,
  1094. },
  1095. },
  1096. };
  1097. static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
  1098. .halt_reg = 0x07c8,
  1099. .clkr = {
  1100. .enable_reg = 0x07c8,
  1101. .enable_mask = BIT(0),
  1102. .hw.init = &(struct clk_init_data){
  1103. .name = "gcc_blsp1_qup4_i2c_apps_clk",
  1104. .parent_names = (const char *[]){
  1105. "blsp1_qup4_i2c_apps_clk_src",
  1106. },
  1107. .num_parents = 1,
  1108. .flags = CLK_SET_RATE_PARENT,
  1109. .ops = &clk_branch2_ops,
  1110. },
  1111. },
  1112. };
  1113. static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
  1114. .halt_reg = 0x07c4,
  1115. .clkr = {
  1116. .enable_reg = 0x07c4,
  1117. .enable_mask = BIT(0),
  1118. .hw.init = &(struct clk_init_data){
  1119. .name = "gcc_blsp1_qup4_spi_apps_clk",
  1120. .parent_names = (const char *[]){
  1121. "blsp1_qup4_spi_apps_clk_src",
  1122. },
  1123. .num_parents = 1,
  1124. .flags = CLK_SET_RATE_PARENT,
  1125. .ops = &clk_branch2_ops,
  1126. },
  1127. },
  1128. };
  1129. static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
  1130. .halt_reg = 0x0848,
  1131. .clkr = {
  1132. .enable_reg = 0x0848,
  1133. .enable_mask = BIT(0),
  1134. .hw.init = &(struct clk_init_data){
  1135. .name = "gcc_blsp1_qup5_i2c_apps_clk",
  1136. .parent_names = (const char *[]){
  1137. "blsp1_qup5_i2c_apps_clk_src",
  1138. },
  1139. .num_parents = 1,
  1140. .flags = CLK_SET_RATE_PARENT,
  1141. .ops = &clk_branch2_ops,
  1142. },
  1143. },
  1144. };
  1145. static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
  1146. .halt_reg = 0x0844,
  1147. .clkr = {
  1148. .enable_reg = 0x0844,
  1149. .enable_mask = BIT(0),
  1150. .hw.init = &(struct clk_init_data){
  1151. .name = "gcc_blsp1_qup5_spi_apps_clk",
  1152. .parent_names = (const char *[]){
  1153. "blsp1_qup5_spi_apps_clk_src",
  1154. },
  1155. .num_parents = 1,
  1156. .flags = CLK_SET_RATE_PARENT,
  1157. .ops = &clk_branch2_ops,
  1158. },
  1159. },
  1160. };
  1161. static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
  1162. .halt_reg = 0x08c8,
  1163. .clkr = {
  1164. .enable_reg = 0x08c8,
  1165. .enable_mask = BIT(0),
  1166. .hw.init = &(struct clk_init_data){
  1167. .name = "gcc_blsp1_qup6_i2c_apps_clk",
  1168. .parent_names = (const char *[]){
  1169. "blsp1_qup6_i2c_apps_clk_src",
  1170. },
  1171. .num_parents = 1,
  1172. .flags = CLK_SET_RATE_PARENT,
  1173. .ops = &clk_branch2_ops,
  1174. },
  1175. },
  1176. };
  1177. static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
  1178. .halt_reg = 0x08c4,
  1179. .clkr = {
  1180. .enable_reg = 0x08c4,
  1181. .enable_mask = BIT(0),
  1182. .hw.init = &(struct clk_init_data){
  1183. .name = "gcc_blsp1_qup6_spi_apps_clk",
  1184. .parent_names = (const char *[]){
  1185. "blsp1_qup6_spi_apps_clk_src",
  1186. },
  1187. .num_parents = 1,
  1188. .flags = CLK_SET_RATE_PARENT,
  1189. .ops = &clk_branch2_ops,
  1190. },
  1191. },
  1192. };
  1193. static struct clk_branch gcc_blsp1_uart1_apps_clk = {
  1194. .halt_reg = 0x0684,
  1195. .clkr = {
  1196. .enable_reg = 0x0684,
  1197. .enable_mask = BIT(0),
  1198. .hw.init = &(struct clk_init_data){
  1199. .name = "gcc_blsp1_uart1_apps_clk",
  1200. .parent_names = (const char *[]){
  1201. "blsp1_uart1_apps_clk_src",
  1202. },
  1203. .num_parents = 1,
  1204. .flags = CLK_SET_RATE_PARENT,
  1205. .ops = &clk_branch2_ops,
  1206. },
  1207. },
  1208. };
  1209. static struct clk_branch gcc_blsp1_uart2_apps_clk = {
  1210. .halt_reg = 0x0704,
  1211. .clkr = {
  1212. .enable_reg = 0x0704,
  1213. .enable_mask = BIT(0),
  1214. .hw.init = &(struct clk_init_data){
  1215. .name = "gcc_blsp1_uart2_apps_clk",
  1216. .parent_names = (const char *[]){
  1217. "blsp1_uart2_apps_clk_src",
  1218. },
  1219. .num_parents = 1,
  1220. .flags = CLK_SET_RATE_PARENT,
  1221. .ops = &clk_branch2_ops,
  1222. },
  1223. },
  1224. };
  1225. static struct clk_branch gcc_blsp1_uart3_apps_clk = {
  1226. .halt_reg = 0x0784,
  1227. .clkr = {
  1228. .enable_reg = 0x0784,
  1229. .enable_mask = BIT(0),
  1230. .hw.init = &(struct clk_init_data){
  1231. .name = "gcc_blsp1_uart3_apps_clk",
  1232. .parent_names = (const char *[]){
  1233. "blsp1_uart3_apps_clk_src",
  1234. },
  1235. .num_parents = 1,
  1236. .flags = CLK_SET_RATE_PARENT,
  1237. .ops = &clk_branch2_ops,
  1238. },
  1239. },
  1240. };
  1241. static struct clk_branch gcc_blsp1_uart4_apps_clk = {
  1242. .halt_reg = 0x0804,
  1243. .clkr = {
  1244. .enable_reg = 0x0804,
  1245. .enable_mask = BIT(0),
  1246. .hw.init = &(struct clk_init_data){
  1247. .name = "gcc_blsp1_uart4_apps_clk",
  1248. .parent_names = (const char *[]){
  1249. "blsp1_uart4_apps_clk_src",
  1250. },
  1251. .num_parents = 1,
  1252. .flags = CLK_SET_RATE_PARENT,
  1253. .ops = &clk_branch2_ops,
  1254. },
  1255. },
  1256. };
  1257. static struct clk_branch gcc_blsp1_uart5_apps_clk = {
  1258. .halt_reg = 0x0884,
  1259. .clkr = {
  1260. .enable_reg = 0x0884,
  1261. .enable_mask = BIT(0),
  1262. .hw.init = &(struct clk_init_data){
  1263. .name = "gcc_blsp1_uart5_apps_clk",
  1264. .parent_names = (const char *[]){
  1265. "blsp1_uart5_apps_clk_src",
  1266. },
  1267. .num_parents = 1,
  1268. .flags = CLK_SET_RATE_PARENT,
  1269. .ops = &clk_branch2_ops,
  1270. },
  1271. },
  1272. };
  1273. static struct clk_branch gcc_blsp1_uart6_apps_clk = {
  1274. .halt_reg = 0x0904,
  1275. .clkr = {
  1276. .enable_reg = 0x0904,
  1277. .enable_mask = BIT(0),
  1278. .hw.init = &(struct clk_init_data){
  1279. .name = "gcc_blsp1_uart6_apps_clk",
  1280. .parent_names = (const char *[]){
  1281. "blsp1_uart6_apps_clk_src",
  1282. },
  1283. .num_parents = 1,
  1284. .flags = CLK_SET_RATE_PARENT,
  1285. .ops = &clk_branch2_ops,
  1286. },
  1287. },
  1288. };
  1289. static struct clk_branch gcc_blsp2_ahb_clk = {
  1290. .halt_reg = 0x0944,
  1291. .halt_check = BRANCH_HALT_VOTED,
  1292. .clkr = {
  1293. .enable_reg = 0x1484,
  1294. .enable_mask = BIT(15),
  1295. .hw.init = &(struct clk_init_data){
  1296. .name = "gcc_blsp2_ahb_clk",
  1297. .parent_names = (const char *[]){
  1298. "periph_noc_clk_src",
  1299. },
  1300. .num_parents = 1,
  1301. .ops = &clk_branch2_ops,
  1302. },
  1303. },
  1304. };
  1305. static struct clk_branch gcc_blsp2_qup1_i2c_apps_clk = {
  1306. .halt_reg = 0x0988,
  1307. .clkr = {
  1308. .enable_reg = 0x0988,
  1309. .enable_mask = BIT(0),
  1310. .hw.init = &(struct clk_init_data){
  1311. .name = "gcc_blsp2_qup1_i2c_apps_clk",
  1312. .parent_names = (const char *[]){
  1313. "blsp2_qup1_i2c_apps_clk_src",
  1314. },
  1315. .num_parents = 1,
  1316. .flags = CLK_SET_RATE_PARENT,
  1317. .ops = &clk_branch2_ops,
  1318. },
  1319. },
  1320. };
  1321. static struct clk_branch gcc_blsp2_qup1_spi_apps_clk = {
  1322. .halt_reg = 0x0984,
  1323. .clkr = {
  1324. .enable_reg = 0x0984,
  1325. .enable_mask = BIT(0),
  1326. .hw.init = &(struct clk_init_data){
  1327. .name = "gcc_blsp2_qup1_spi_apps_clk",
  1328. .parent_names = (const char *[]){
  1329. "blsp2_qup1_spi_apps_clk_src",
  1330. },
  1331. .num_parents = 1,
  1332. .flags = CLK_SET_RATE_PARENT,
  1333. .ops = &clk_branch2_ops,
  1334. },
  1335. },
  1336. };
  1337. static struct clk_branch gcc_blsp2_qup2_i2c_apps_clk = {
  1338. .halt_reg = 0x0a08,
  1339. .clkr = {
  1340. .enable_reg = 0x0a08,
  1341. .enable_mask = BIT(0),
  1342. .hw.init = &(struct clk_init_data){
  1343. .name = "gcc_blsp2_qup2_i2c_apps_clk",
  1344. .parent_names = (const char *[]){
  1345. "blsp2_qup2_i2c_apps_clk_src",
  1346. },
  1347. .num_parents = 1,
  1348. .flags = CLK_SET_RATE_PARENT,
  1349. .ops = &clk_branch2_ops,
  1350. },
  1351. },
  1352. };
  1353. static struct clk_branch gcc_blsp2_qup2_spi_apps_clk = {
  1354. .halt_reg = 0x0a04,
  1355. .clkr = {
  1356. .enable_reg = 0x0a04,
  1357. .enable_mask = BIT(0),
  1358. .hw.init = &(struct clk_init_data){
  1359. .name = "gcc_blsp2_qup2_spi_apps_clk",
  1360. .parent_names = (const char *[]){
  1361. "blsp2_qup2_spi_apps_clk_src",
  1362. },
  1363. .num_parents = 1,
  1364. .flags = CLK_SET_RATE_PARENT,
  1365. .ops = &clk_branch2_ops,
  1366. },
  1367. },
  1368. };
  1369. static struct clk_branch gcc_blsp2_qup3_i2c_apps_clk = {
  1370. .halt_reg = 0x0a88,
  1371. .clkr = {
  1372. .enable_reg = 0x0a88,
  1373. .enable_mask = BIT(0),
  1374. .hw.init = &(struct clk_init_data){
  1375. .name = "gcc_blsp2_qup3_i2c_apps_clk",
  1376. .parent_names = (const char *[]){
  1377. "blsp2_qup3_i2c_apps_clk_src",
  1378. },
  1379. .num_parents = 1,
  1380. .flags = CLK_SET_RATE_PARENT,
  1381. .ops = &clk_branch2_ops,
  1382. },
  1383. },
  1384. };
  1385. static struct clk_branch gcc_blsp2_qup3_spi_apps_clk = {
  1386. .halt_reg = 0x0a84,
  1387. .clkr = {
  1388. .enable_reg = 0x0a84,
  1389. .enable_mask = BIT(0),
  1390. .hw.init = &(struct clk_init_data){
  1391. .name = "gcc_blsp2_qup3_spi_apps_clk",
  1392. .parent_names = (const char *[]){
  1393. "blsp2_qup3_spi_apps_clk_src",
  1394. },
  1395. .num_parents = 1,
  1396. .flags = CLK_SET_RATE_PARENT,
  1397. .ops = &clk_branch2_ops,
  1398. },
  1399. },
  1400. };
  1401. static struct clk_branch gcc_blsp2_qup4_i2c_apps_clk = {
  1402. .halt_reg = 0x0b08,
  1403. .clkr = {
  1404. .enable_reg = 0x0b08,
  1405. .enable_mask = BIT(0),
  1406. .hw.init = &(struct clk_init_data){
  1407. .name = "gcc_blsp2_qup4_i2c_apps_clk",
  1408. .parent_names = (const char *[]){
  1409. "blsp2_qup4_i2c_apps_clk_src",
  1410. },
  1411. .num_parents = 1,
  1412. .flags = CLK_SET_RATE_PARENT,
  1413. .ops = &clk_branch2_ops,
  1414. },
  1415. },
  1416. };
  1417. static struct clk_branch gcc_blsp2_qup4_spi_apps_clk = {
  1418. .halt_reg = 0x0b04,
  1419. .clkr = {
  1420. .enable_reg = 0x0b04,
  1421. .enable_mask = BIT(0),
  1422. .hw.init = &(struct clk_init_data){
  1423. .name = "gcc_blsp2_qup4_spi_apps_clk",
  1424. .parent_names = (const char *[]){
  1425. "blsp2_qup4_spi_apps_clk_src",
  1426. },
  1427. .num_parents = 1,
  1428. .flags = CLK_SET_RATE_PARENT,
  1429. .ops = &clk_branch2_ops,
  1430. },
  1431. },
  1432. };
  1433. static struct clk_branch gcc_blsp2_qup5_i2c_apps_clk = {
  1434. .halt_reg = 0x0b88,
  1435. .clkr = {
  1436. .enable_reg = 0x0b88,
  1437. .enable_mask = BIT(0),
  1438. .hw.init = &(struct clk_init_data){
  1439. .name = "gcc_blsp2_qup5_i2c_apps_clk",
  1440. .parent_names = (const char *[]){
  1441. "blsp2_qup5_i2c_apps_clk_src",
  1442. },
  1443. .num_parents = 1,
  1444. .flags = CLK_SET_RATE_PARENT,
  1445. .ops = &clk_branch2_ops,
  1446. },
  1447. },
  1448. };
  1449. static struct clk_branch gcc_blsp2_qup5_spi_apps_clk = {
  1450. .halt_reg = 0x0b84,
  1451. .clkr = {
  1452. .enable_reg = 0x0b84,
  1453. .enable_mask = BIT(0),
  1454. .hw.init = &(struct clk_init_data){
  1455. .name = "gcc_blsp2_qup5_spi_apps_clk",
  1456. .parent_names = (const char *[]){
  1457. "blsp2_qup5_spi_apps_clk_src",
  1458. },
  1459. .num_parents = 1,
  1460. .flags = CLK_SET_RATE_PARENT,
  1461. .ops = &clk_branch2_ops,
  1462. },
  1463. },
  1464. };
  1465. static struct clk_branch gcc_blsp2_qup6_i2c_apps_clk = {
  1466. .halt_reg = 0x0c08,
  1467. .clkr = {
  1468. .enable_reg = 0x0c08,
  1469. .enable_mask = BIT(0),
  1470. .hw.init = &(struct clk_init_data){
  1471. .name = "gcc_blsp2_qup6_i2c_apps_clk",
  1472. .parent_names = (const char *[]){
  1473. "blsp2_qup6_i2c_apps_clk_src",
  1474. },
  1475. .num_parents = 1,
  1476. .flags = CLK_SET_RATE_PARENT,
  1477. .ops = &clk_branch2_ops,
  1478. },
  1479. },
  1480. };
  1481. static struct clk_branch gcc_blsp2_qup6_spi_apps_clk = {
  1482. .halt_reg = 0x0c04,
  1483. .clkr = {
  1484. .enable_reg = 0x0c04,
  1485. .enable_mask = BIT(0),
  1486. .hw.init = &(struct clk_init_data){
  1487. .name = "gcc_blsp2_qup6_spi_apps_clk",
  1488. .parent_names = (const char *[]){
  1489. "blsp2_qup6_spi_apps_clk_src",
  1490. },
  1491. .num_parents = 1,
  1492. .flags = CLK_SET_RATE_PARENT,
  1493. .ops = &clk_branch2_ops,
  1494. },
  1495. },
  1496. };
  1497. static struct clk_branch gcc_blsp2_uart1_apps_clk = {
  1498. .halt_reg = 0x09c4,
  1499. .clkr = {
  1500. .enable_reg = 0x09c4,
  1501. .enable_mask = BIT(0),
  1502. .hw.init = &(struct clk_init_data){
  1503. .name = "gcc_blsp2_uart1_apps_clk",
  1504. .parent_names = (const char *[]){
  1505. "blsp2_uart1_apps_clk_src",
  1506. },
  1507. .num_parents = 1,
  1508. .flags = CLK_SET_RATE_PARENT,
  1509. .ops = &clk_branch2_ops,
  1510. },
  1511. },
  1512. };
  1513. static struct clk_branch gcc_blsp2_uart2_apps_clk = {
  1514. .halt_reg = 0x0a44,
  1515. .clkr = {
  1516. .enable_reg = 0x0a44,
  1517. .enable_mask = BIT(0),
  1518. .hw.init = &(struct clk_init_data){
  1519. .name = "gcc_blsp2_uart2_apps_clk",
  1520. .parent_names = (const char *[]){
  1521. "blsp2_uart2_apps_clk_src",
  1522. },
  1523. .num_parents = 1,
  1524. .flags = CLK_SET_RATE_PARENT,
  1525. .ops = &clk_branch2_ops,
  1526. },
  1527. },
  1528. };
  1529. static struct clk_branch gcc_blsp2_uart3_apps_clk = {
  1530. .halt_reg = 0x0ac4,
  1531. .clkr = {
  1532. .enable_reg = 0x0ac4,
  1533. .enable_mask = BIT(0),
  1534. .hw.init = &(struct clk_init_data){
  1535. .name = "gcc_blsp2_uart3_apps_clk",
  1536. .parent_names = (const char *[]){
  1537. "blsp2_uart3_apps_clk_src",
  1538. },
  1539. .num_parents = 1,
  1540. .flags = CLK_SET_RATE_PARENT,
  1541. .ops = &clk_branch2_ops,
  1542. },
  1543. },
  1544. };
  1545. static struct clk_branch gcc_blsp2_uart4_apps_clk = {
  1546. .halt_reg = 0x0b44,
  1547. .clkr = {
  1548. .enable_reg = 0x0b44,
  1549. .enable_mask = BIT(0),
  1550. .hw.init = &(struct clk_init_data){
  1551. .name = "gcc_blsp2_uart4_apps_clk",
  1552. .parent_names = (const char *[]){
  1553. "blsp2_uart4_apps_clk_src",
  1554. },
  1555. .num_parents = 1,
  1556. .flags = CLK_SET_RATE_PARENT,
  1557. .ops = &clk_branch2_ops,
  1558. },
  1559. },
  1560. };
  1561. static struct clk_branch gcc_blsp2_uart5_apps_clk = {
  1562. .halt_reg = 0x0bc4,
  1563. .clkr = {
  1564. .enable_reg = 0x0bc4,
  1565. .enable_mask = BIT(0),
  1566. .hw.init = &(struct clk_init_data){
  1567. .name = "gcc_blsp2_uart5_apps_clk",
  1568. .parent_names = (const char *[]){
  1569. "blsp2_uart5_apps_clk_src",
  1570. },
  1571. .num_parents = 1,
  1572. .flags = CLK_SET_RATE_PARENT,
  1573. .ops = &clk_branch2_ops,
  1574. },
  1575. },
  1576. };
  1577. static struct clk_branch gcc_blsp2_uart6_apps_clk = {
  1578. .halt_reg = 0x0c44,
  1579. .clkr = {
  1580. .enable_reg = 0x0c44,
  1581. .enable_mask = BIT(0),
  1582. .hw.init = &(struct clk_init_data){
  1583. .name = "gcc_blsp2_uart6_apps_clk",
  1584. .parent_names = (const char *[]){
  1585. "blsp2_uart6_apps_clk_src",
  1586. },
  1587. .num_parents = 1,
  1588. .flags = CLK_SET_RATE_PARENT,
  1589. .ops = &clk_branch2_ops,
  1590. },
  1591. },
  1592. };
  1593. static struct clk_branch gcc_boot_rom_ahb_clk = {
  1594. .halt_reg = 0x0e04,
  1595. .halt_check = BRANCH_HALT_VOTED,
  1596. .clkr = {
  1597. .enable_reg = 0x1484,
  1598. .enable_mask = BIT(10),
  1599. .hw.init = &(struct clk_init_data){
  1600. .name = "gcc_boot_rom_ahb_clk",
  1601. .parent_names = (const char *[]){
  1602. "config_noc_clk_src",
  1603. },
  1604. .num_parents = 1,
  1605. .ops = &clk_branch2_ops,
  1606. },
  1607. },
  1608. };
  1609. static struct clk_branch gcc_ce1_ahb_clk = {
  1610. .halt_reg = 0x104c,
  1611. .halt_check = BRANCH_HALT_VOTED,
  1612. .clkr = {
  1613. .enable_reg = 0x1484,
  1614. .enable_mask = BIT(3),
  1615. .hw.init = &(struct clk_init_data){
  1616. .name = "gcc_ce1_ahb_clk",
  1617. .parent_names = (const char *[]){
  1618. "config_noc_clk_src",
  1619. },
  1620. .num_parents = 1,
  1621. .ops = &clk_branch2_ops,
  1622. },
  1623. },
  1624. };
  1625. static struct clk_branch gcc_ce1_axi_clk = {
  1626. .halt_reg = 0x1048,
  1627. .halt_check = BRANCH_HALT_VOTED,
  1628. .clkr = {
  1629. .enable_reg = 0x1484,
  1630. .enable_mask = BIT(4),
  1631. .hw.init = &(struct clk_init_data){
  1632. .name = "gcc_ce1_axi_clk",
  1633. .parent_names = (const char *[]){
  1634. "system_noc_clk_src",
  1635. },
  1636. .num_parents = 1,
  1637. .ops = &clk_branch2_ops,
  1638. },
  1639. },
  1640. };
  1641. static struct clk_branch gcc_ce1_clk = {
  1642. .halt_reg = 0x1050,
  1643. .halt_check = BRANCH_HALT_VOTED,
  1644. .clkr = {
  1645. .enable_reg = 0x1484,
  1646. .enable_mask = BIT(5),
  1647. .hw.init = &(struct clk_init_data){
  1648. .name = "gcc_ce1_clk",
  1649. .parent_names = (const char *[]){
  1650. "ce1_clk_src",
  1651. },
  1652. .num_parents = 1,
  1653. .flags = CLK_SET_RATE_PARENT,
  1654. .ops = &clk_branch2_ops,
  1655. },
  1656. },
  1657. };
  1658. static struct clk_branch gcc_ce2_ahb_clk = {
  1659. .halt_reg = 0x108c,
  1660. .halt_check = BRANCH_HALT_VOTED,
  1661. .clkr = {
  1662. .enable_reg = 0x1484,
  1663. .enable_mask = BIT(0),
  1664. .hw.init = &(struct clk_init_data){
  1665. .name = "gcc_ce2_ahb_clk",
  1666. .parent_names = (const char *[]){
  1667. "config_noc_clk_src",
  1668. },
  1669. .num_parents = 1,
  1670. .ops = &clk_branch2_ops,
  1671. },
  1672. },
  1673. };
  1674. static struct clk_branch gcc_ce2_axi_clk = {
  1675. .halt_reg = 0x1088,
  1676. .halt_check = BRANCH_HALT_VOTED,
  1677. .clkr = {
  1678. .enable_reg = 0x1484,
  1679. .enable_mask = BIT(1),
  1680. .hw.init = &(struct clk_init_data){
  1681. .name = "gcc_ce2_axi_clk",
  1682. .parent_names = (const char *[]){
  1683. "system_noc_clk_src",
  1684. },
  1685. .num_parents = 1,
  1686. .ops = &clk_branch2_ops,
  1687. },
  1688. },
  1689. };
  1690. static struct clk_branch gcc_ce2_clk = {
  1691. .halt_reg = 0x1090,
  1692. .halt_check = BRANCH_HALT_VOTED,
  1693. .clkr = {
  1694. .enable_reg = 0x1484,
  1695. .enable_mask = BIT(2),
  1696. .hw.init = &(struct clk_init_data){
  1697. .name = "gcc_ce2_clk",
  1698. .parent_names = (const char *[]){
  1699. "ce2_clk_src",
  1700. },
  1701. .num_parents = 1,
  1702. .flags = CLK_SET_RATE_PARENT,
  1703. .ops = &clk_branch2_ops,
  1704. },
  1705. },
  1706. };
  1707. static struct clk_branch gcc_gp1_clk = {
  1708. .halt_reg = 0x1900,
  1709. .clkr = {
  1710. .enable_reg = 0x1900,
  1711. .enable_mask = BIT(0),
  1712. .hw.init = &(struct clk_init_data){
  1713. .name = "gcc_gp1_clk",
  1714. .parent_names = (const char *[]){
  1715. "gp1_clk_src",
  1716. },
  1717. .num_parents = 1,
  1718. .flags = CLK_SET_RATE_PARENT,
  1719. .ops = &clk_branch2_ops,
  1720. },
  1721. },
  1722. };
  1723. static struct clk_branch gcc_gp2_clk = {
  1724. .halt_reg = 0x1940,
  1725. .clkr = {
  1726. .enable_reg = 0x1940,
  1727. .enable_mask = BIT(0),
  1728. .hw.init = &(struct clk_init_data){
  1729. .name = "gcc_gp2_clk",
  1730. .parent_names = (const char *[]){
  1731. "gp2_clk_src",
  1732. },
  1733. .num_parents = 1,
  1734. .flags = CLK_SET_RATE_PARENT,
  1735. .ops = &clk_branch2_ops,
  1736. },
  1737. },
  1738. };
  1739. static struct clk_branch gcc_gp3_clk = {
  1740. .halt_reg = 0x1980,
  1741. .clkr = {
  1742. .enable_reg = 0x1980,
  1743. .enable_mask = BIT(0),
  1744. .hw.init = &(struct clk_init_data){
  1745. .name = "gcc_gp3_clk",
  1746. .parent_names = (const char *[]){
  1747. "gp3_clk_src",
  1748. },
  1749. .num_parents = 1,
  1750. .flags = CLK_SET_RATE_PARENT,
  1751. .ops = &clk_branch2_ops,
  1752. },
  1753. },
  1754. };
  1755. static struct clk_branch gcc_lpass_q6_axi_clk = {
  1756. .halt_reg = 0x11c0,
  1757. .clkr = {
  1758. .enable_reg = 0x11c0,
  1759. .enable_mask = BIT(0),
  1760. .hw.init = &(struct clk_init_data){
  1761. .name = "gcc_lpass_q6_axi_clk",
  1762. .parent_names = (const char *[]){
  1763. "system_noc_clk_src",
  1764. },
  1765. .num_parents = 1,
  1766. .ops = &clk_branch2_ops,
  1767. },
  1768. },
  1769. };
  1770. static struct clk_branch gcc_mmss_noc_cfg_ahb_clk = {
  1771. .halt_reg = 0x024c,
  1772. .clkr = {
  1773. .enable_reg = 0x024c,
  1774. .enable_mask = BIT(0),
  1775. .hw.init = &(struct clk_init_data){
  1776. .name = "gcc_mmss_noc_cfg_ahb_clk",
  1777. .parent_names = (const char *[]){
  1778. "config_noc_clk_src",
  1779. },
  1780. .num_parents = 1,
  1781. .ops = &clk_branch2_ops,
  1782. .flags = CLK_IGNORE_UNUSED,
  1783. },
  1784. },
  1785. };
  1786. static struct clk_branch gcc_ocmem_noc_cfg_ahb_clk = {
  1787. .halt_reg = 0x0248,
  1788. .clkr = {
  1789. .enable_reg = 0x0248,
  1790. .enable_mask = BIT(0),
  1791. .hw.init = &(struct clk_init_data){
  1792. .name = "gcc_ocmem_noc_cfg_ahb_clk",
  1793. .parent_names = (const char *[]){
  1794. "config_noc_clk_src",
  1795. },
  1796. .num_parents = 1,
  1797. .ops = &clk_branch2_ops,
  1798. },
  1799. },
  1800. };
  1801. static struct clk_branch gcc_mss_cfg_ahb_clk = {
  1802. .halt_reg = 0x0280,
  1803. .clkr = {
  1804. .enable_reg = 0x0280,
  1805. .enable_mask = BIT(0),
  1806. .hw.init = &(struct clk_init_data){
  1807. .name = "gcc_mss_cfg_ahb_clk",
  1808. .parent_names = (const char *[]){
  1809. "config_noc_clk_src",
  1810. },
  1811. .num_parents = 1,
  1812. .ops = &clk_branch2_ops,
  1813. },
  1814. },
  1815. };
  1816. static struct clk_branch gcc_mss_q6_bimc_axi_clk = {
  1817. .halt_reg = 0x0284,
  1818. .clkr = {
  1819. .enable_reg = 0x0284,
  1820. .enable_mask = BIT(0),
  1821. .hw.init = &(struct clk_init_data){
  1822. .name = "gcc_mss_q6_bimc_axi_clk",
  1823. .flags = CLK_IS_ROOT,
  1824. .ops = &clk_branch2_ops,
  1825. },
  1826. },
  1827. };
  1828. static struct clk_branch gcc_pdm2_clk = {
  1829. .halt_reg = 0x0ccc,
  1830. .clkr = {
  1831. .enable_reg = 0x0ccc,
  1832. .enable_mask = BIT(0),
  1833. .hw.init = &(struct clk_init_data){
  1834. .name = "gcc_pdm2_clk",
  1835. .parent_names = (const char *[]){
  1836. "pdm2_clk_src",
  1837. },
  1838. .num_parents = 1,
  1839. .flags = CLK_SET_RATE_PARENT,
  1840. .ops = &clk_branch2_ops,
  1841. },
  1842. },
  1843. };
  1844. static struct clk_branch gcc_pdm_ahb_clk = {
  1845. .halt_reg = 0x0cc4,
  1846. .clkr = {
  1847. .enable_reg = 0x0cc4,
  1848. .enable_mask = BIT(0),
  1849. .hw.init = &(struct clk_init_data){
  1850. .name = "gcc_pdm_ahb_clk",
  1851. .parent_names = (const char *[]){
  1852. "periph_noc_clk_src",
  1853. },
  1854. .num_parents = 1,
  1855. .ops = &clk_branch2_ops,
  1856. },
  1857. },
  1858. };
  1859. static struct clk_branch gcc_prng_ahb_clk = {
  1860. .halt_reg = 0x0d04,
  1861. .halt_check = BRANCH_HALT_VOTED,
  1862. .clkr = {
  1863. .enable_reg = 0x1484,
  1864. .enable_mask = BIT(13),
  1865. .hw.init = &(struct clk_init_data){
  1866. .name = "gcc_prng_ahb_clk",
  1867. .parent_names = (const char *[]){
  1868. "periph_noc_clk_src",
  1869. },
  1870. .num_parents = 1,
  1871. .ops = &clk_branch2_ops,
  1872. },
  1873. },
  1874. };
  1875. static struct clk_branch gcc_sdcc1_ahb_clk = {
  1876. .halt_reg = 0x04c8,
  1877. .clkr = {
  1878. .enable_reg = 0x04c8,
  1879. .enable_mask = BIT(0),
  1880. .hw.init = &(struct clk_init_data){
  1881. .name = "gcc_sdcc1_ahb_clk",
  1882. .parent_names = (const char *[]){
  1883. "periph_noc_clk_src",
  1884. },
  1885. .num_parents = 1,
  1886. .ops = &clk_branch2_ops,
  1887. },
  1888. },
  1889. };
  1890. static struct clk_branch gcc_sdcc1_apps_clk = {
  1891. .halt_reg = 0x04c4,
  1892. .clkr = {
  1893. .enable_reg = 0x04c4,
  1894. .enable_mask = BIT(0),
  1895. .hw.init = &(struct clk_init_data){
  1896. .name = "gcc_sdcc1_apps_clk",
  1897. .parent_names = (const char *[]){
  1898. "sdcc1_apps_clk_src",
  1899. },
  1900. .num_parents = 1,
  1901. .flags = CLK_SET_RATE_PARENT,
  1902. .ops = &clk_branch2_ops,
  1903. },
  1904. },
  1905. };
  1906. static struct clk_branch gcc_sdcc1_cdccal_ff_clk = {
  1907. .halt_reg = 0x04e8,
  1908. .clkr = {
  1909. .enable_reg = 0x04e8,
  1910. .enable_mask = BIT(0),
  1911. .hw.init = &(struct clk_init_data){
  1912. .name = "gcc_sdcc1_cdccal_ff_clk",
  1913. .parent_names = (const char *[]){
  1914. "xo"
  1915. },
  1916. .num_parents = 1,
  1917. .ops = &clk_branch2_ops,
  1918. },
  1919. },
  1920. };
  1921. static struct clk_branch gcc_sdcc1_cdccal_sleep_clk = {
  1922. .halt_reg = 0x04e4,
  1923. .clkr = {
  1924. .enable_reg = 0x04e4,
  1925. .enable_mask = BIT(0),
  1926. .hw.init = &(struct clk_init_data){
  1927. .name = "gcc_sdcc1_cdccal_sleep_clk",
  1928. .parent_names = (const char *[]){
  1929. "sleep_clk_src"
  1930. },
  1931. .num_parents = 1,
  1932. .ops = &clk_branch2_ops,
  1933. },
  1934. },
  1935. };
  1936. static struct clk_branch gcc_sdcc2_ahb_clk = {
  1937. .halt_reg = 0x0508,
  1938. .clkr = {
  1939. .enable_reg = 0x0508,
  1940. .enable_mask = BIT(0),
  1941. .hw.init = &(struct clk_init_data){
  1942. .name = "gcc_sdcc2_ahb_clk",
  1943. .parent_names = (const char *[]){
  1944. "periph_noc_clk_src",
  1945. },
  1946. .num_parents = 1,
  1947. .ops = &clk_branch2_ops,
  1948. },
  1949. },
  1950. };
  1951. static struct clk_branch gcc_sdcc2_apps_clk = {
  1952. .halt_reg = 0x0504,
  1953. .clkr = {
  1954. .enable_reg = 0x0504,
  1955. .enable_mask = BIT(0),
  1956. .hw.init = &(struct clk_init_data){
  1957. .name = "gcc_sdcc2_apps_clk",
  1958. .parent_names = (const char *[]){
  1959. "sdcc2_apps_clk_src",
  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_sdcc3_ahb_clk = {
  1968. .halt_reg = 0x0548,
  1969. .clkr = {
  1970. .enable_reg = 0x0548,
  1971. .enable_mask = BIT(0),
  1972. .hw.init = &(struct clk_init_data){
  1973. .name = "gcc_sdcc3_ahb_clk",
  1974. .parent_names = (const char *[]){
  1975. "periph_noc_clk_src",
  1976. },
  1977. .num_parents = 1,
  1978. .ops = &clk_branch2_ops,
  1979. },
  1980. },
  1981. };
  1982. static struct clk_branch gcc_sdcc3_apps_clk = {
  1983. .halt_reg = 0x0544,
  1984. .clkr = {
  1985. .enable_reg = 0x0544,
  1986. .enable_mask = BIT(0),
  1987. .hw.init = &(struct clk_init_data){
  1988. .name = "gcc_sdcc3_apps_clk",
  1989. .parent_names = (const char *[]){
  1990. "sdcc3_apps_clk_src",
  1991. },
  1992. .num_parents = 1,
  1993. .flags = CLK_SET_RATE_PARENT,
  1994. .ops = &clk_branch2_ops,
  1995. },
  1996. },
  1997. };
  1998. static struct clk_branch gcc_sdcc4_ahb_clk = {
  1999. .halt_reg = 0x0588,
  2000. .clkr = {
  2001. .enable_reg = 0x0588,
  2002. .enable_mask = BIT(0),
  2003. .hw.init = &(struct clk_init_data){
  2004. .name = "gcc_sdcc4_ahb_clk",
  2005. .parent_names = (const char *[]){
  2006. "periph_noc_clk_src",
  2007. },
  2008. .num_parents = 1,
  2009. .ops = &clk_branch2_ops,
  2010. },
  2011. },
  2012. };
  2013. static struct clk_branch gcc_sdcc4_apps_clk = {
  2014. .halt_reg = 0x0584,
  2015. .clkr = {
  2016. .enable_reg = 0x0584,
  2017. .enable_mask = BIT(0),
  2018. .hw.init = &(struct clk_init_data){
  2019. .name = "gcc_sdcc4_apps_clk",
  2020. .parent_names = (const char *[]){
  2021. "sdcc4_apps_clk_src",
  2022. },
  2023. .num_parents = 1,
  2024. .flags = CLK_SET_RATE_PARENT,
  2025. .ops = &clk_branch2_ops,
  2026. },
  2027. },
  2028. };
  2029. static struct clk_branch gcc_sys_noc_usb3_axi_clk = {
  2030. .halt_reg = 0x0108,
  2031. .clkr = {
  2032. .enable_reg = 0x0108,
  2033. .enable_mask = BIT(0),
  2034. .hw.init = &(struct clk_init_data){
  2035. .name = "gcc_sys_noc_usb3_axi_clk",
  2036. .parent_names = (const char *[]){
  2037. "usb30_master_clk_src",
  2038. },
  2039. .num_parents = 1,
  2040. .flags = CLK_SET_RATE_PARENT,
  2041. .ops = &clk_branch2_ops,
  2042. },
  2043. },
  2044. };
  2045. static struct clk_branch gcc_tsif_ahb_clk = {
  2046. .halt_reg = 0x0d84,
  2047. .clkr = {
  2048. .enable_reg = 0x0d84,
  2049. .enable_mask = BIT(0),
  2050. .hw.init = &(struct clk_init_data){
  2051. .name = "gcc_tsif_ahb_clk",
  2052. .parent_names = (const char *[]){
  2053. "periph_noc_clk_src",
  2054. },
  2055. .num_parents = 1,
  2056. .ops = &clk_branch2_ops,
  2057. },
  2058. },
  2059. };
  2060. static struct clk_branch gcc_tsif_ref_clk = {
  2061. .halt_reg = 0x0d88,
  2062. .clkr = {
  2063. .enable_reg = 0x0d88,
  2064. .enable_mask = BIT(0),
  2065. .hw.init = &(struct clk_init_data){
  2066. .name = "gcc_tsif_ref_clk",
  2067. .parent_names = (const char *[]){
  2068. "tsif_ref_clk_src",
  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_usb2a_phy_sleep_clk = {
  2077. .halt_reg = 0x04ac,
  2078. .clkr = {
  2079. .enable_reg = 0x04ac,
  2080. .enable_mask = BIT(0),
  2081. .hw.init = &(struct clk_init_data){
  2082. .name = "gcc_usb2a_phy_sleep_clk",
  2083. .parent_names = (const char *[]){
  2084. "sleep_clk_src",
  2085. },
  2086. .num_parents = 1,
  2087. .ops = &clk_branch2_ops,
  2088. },
  2089. },
  2090. };
  2091. static struct clk_branch gcc_usb2b_phy_sleep_clk = {
  2092. .halt_reg = 0x04b4,
  2093. .clkr = {
  2094. .enable_reg = 0x04b4,
  2095. .enable_mask = BIT(0),
  2096. .hw.init = &(struct clk_init_data){
  2097. .name = "gcc_usb2b_phy_sleep_clk",
  2098. .parent_names = (const char *[]){
  2099. "sleep_clk_src",
  2100. },
  2101. .num_parents = 1,
  2102. .ops = &clk_branch2_ops,
  2103. },
  2104. },
  2105. };
  2106. static struct clk_branch gcc_usb30_master_clk = {
  2107. .halt_reg = 0x03c8,
  2108. .clkr = {
  2109. .enable_reg = 0x03c8,
  2110. .enable_mask = BIT(0),
  2111. .hw.init = &(struct clk_init_data){
  2112. .name = "gcc_usb30_master_clk",
  2113. .parent_names = (const char *[]){
  2114. "usb30_master_clk_src",
  2115. },
  2116. .num_parents = 1,
  2117. .flags = CLK_SET_RATE_PARENT,
  2118. .ops = &clk_branch2_ops,
  2119. },
  2120. },
  2121. };
  2122. static struct clk_branch gcc_usb30_mock_utmi_clk = {
  2123. .halt_reg = 0x03d0,
  2124. .clkr = {
  2125. .enable_reg = 0x03d0,
  2126. .enable_mask = BIT(0),
  2127. .hw.init = &(struct clk_init_data){
  2128. .name = "gcc_usb30_mock_utmi_clk",
  2129. .parent_names = (const char *[]){
  2130. "usb30_mock_utmi_clk_src",
  2131. },
  2132. .num_parents = 1,
  2133. .flags = CLK_SET_RATE_PARENT,
  2134. .ops = &clk_branch2_ops,
  2135. },
  2136. },
  2137. };
  2138. static struct clk_branch gcc_usb30_sleep_clk = {
  2139. .halt_reg = 0x03cc,
  2140. .clkr = {
  2141. .enable_reg = 0x03cc,
  2142. .enable_mask = BIT(0),
  2143. .hw.init = &(struct clk_init_data){
  2144. .name = "gcc_usb30_sleep_clk",
  2145. .parent_names = (const char *[]){
  2146. "sleep_clk_src",
  2147. },
  2148. .num_parents = 1,
  2149. .ops = &clk_branch2_ops,
  2150. },
  2151. },
  2152. };
  2153. static struct clk_branch gcc_usb_hs_ahb_clk = {
  2154. .halt_reg = 0x0488,
  2155. .clkr = {
  2156. .enable_reg = 0x0488,
  2157. .enable_mask = BIT(0),
  2158. .hw.init = &(struct clk_init_data){
  2159. .name = "gcc_usb_hs_ahb_clk",
  2160. .parent_names = (const char *[]){
  2161. "periph_noc_clk_src",
  2162. },
  2163. .num_parents = 1,
  2164. .ops = &clk_branch2_ops,
  2165. },
  2166. },
  2167. };
  2168. static struct clk_branch gcc_usb_hs_system_clk = {
  2169. .halt_reg = 0x0484,
  2170. .clkr = {
  2171. .enable_reg = 0x0484,
  2172. .enable_mask = BIT(0),
  2173. .hw.init = &(struct clk_init_data){
  2174. .name = "gcc_usb_hs_system_clk",
  2175. .parent_names = (const char *[]){
  2176. "usb_hs_system_clk_src",
  2177. },
  2178. .num_parents = 1,
  2179. .flags = CLK_SET_RATE_PARENT,
  2180. .ops = &clk_branch2_ops,
  2181. },
  2182. },
  2183. };
  2184. static struct clk_branch gcc_usb_hsic_ahb_clk = {
  2185. .halt_reg = 0x0408,
  2186. .clkr = {
  2187. .enable_reg = 0x0408,
  2188. .enable_mask = BIT(0),
  2189. .hw.init = &(struct clk_init_data){
  2190. .name = "gcc_usb_hsic_ahb_clk",
  2191. .parent_names = (const char *[]){
  2192. "periph_noc_clk_src",
  2193. },
  2194. .num_parents = 1,
  2195. .ops = &clk_branch2_ops,
  2196. },
  2197. },
  2198. };
  2199. static struct clk_branch gcc_usb_hsic_clk = {
  2200. .halt_reg = 0x0410,
  2201. .clkr = {
  2202. .enable_reg = 0x0410,
  2203. .enable_mask = BIT(0),
  2204. .hw.init = &(struct clk_init_data){
  2205. .name = "gcc_usb_hsic_clk",
  2206. .parent_names = (const char *[]){
  2207. "usb_hsic_clk_src",
  2208. },
  2209. .num_parents = 1,
  2210. .flags = CLK_SET_RATE_PARENT,
  2211. .ops = &clk_branch2_ops,
  2212. },
  2213. },
  2214. };
  2215. static struct clk_branch gcc_usb_hsic_io_cal_clk = {
  2216. .halt_reg = 0x0414,
  2217. .clkr = {
  2218. .enable_reg = 0x0414,
  2219. .enable_mask = BIT(0),
  2220. .hw.init = &(struct clk_init_data){
  2221. .name = "gcc_usb_hsic_io_cal_clk",
  2222. .parent_names = (const char *[]){
  2223. "usb_hsic_io_cal_clk_src",
  2224. },
  2225. .num_parents = 1,
  2226. .flags = CLK_SET_RATE_PARENT,
  2227. .ops = &clk_branch2_ops,
  2228. },
  2229. },
  2230. };
  2231. static struct clk_branch gcc_usb_hsic_io_cal_sleep_clk = {
  2232. .halt_reg = 0x0418,
  2233. .clkr = {
  2234. .enable_reg = 0x0418,
  2235. .enable_mask = BIT(0),
  2236. .hw.init = &(struct clk_init_data){
  2237. .name = "gcc_usb_hsic_io_cal_sleep_clk",
  2238. .parent_names = (const char *[]){
  2239. "sleep_clk_src",
  2240. },
  2241. .num_parents = 1,
  2242. .ops = &clk_branch2_ops,
  2243. },
  2244. },
  2245. };
  2246. static struct clk_branch gcc_usb_hsic_system_clk = {
  2247. .halt_reg = 0x040c,
  2248. .clkr = {
  2249. .enable_reg = 0x040c,
  2250. .enable_mask = BIT(0),
  2251. .hw.init = &(struct clk_init_data){
  2252. .name = "gcc_usb_hsic_system_clk",
  2253. .parent_names = (const char *[]){
  2254. "usb_hsic_system_clk_src",
  2255. },
  2256. .num_parents = 1,
  2257. .flags = CLK_SET_RATE_PARENT,
  2258. .ops = &clk_branch2_ops,
  2259. },
  2260. },
  2261. };
  2262. static struct gdsc usb_hs_hsic_gdsc = {
  2263. .gdscr = 0x404,
  2264. .pd = {
  2265. .name = "usb_hs_hsic",
  2266. },
  2267. .pwrsts = PWRSTS_OFF_ON,
  2268. };
  2269. static struct clk_regmap *gcc_msm8974_clocks[] = {
  2270. [GPLL0] = &gpll0.clkr,
  2271. [GPLL0_VOTE] = &gpll0_vote,
  2272. [CONFIG_NOC_CLK_SRC] = &config_noc_clk_src.clkr,
  2273. [PERIPH_NOC_CLK_SRC] = &periph_noc_clk_src.clkr,
  2274. [SYSTEM_NOC_CLK_SRC] = &system_noc_clk_src.clkr,
  2275. [GPLL1] = &gpll1.clkr,
  2276. [GPLL1_VOTE] = &gpll1_vote,
  2277. [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr,
  2278. [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
  2279. [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
  2280. [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
  2281. [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
  2282. [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
  2283. [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
  2284. [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
  2285. [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
  2286. [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
  2287. [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
  2288. [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
  2289. [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
  2290. [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
  2291. [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
  2292. [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
  2293. [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr,
  2294. [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr,
  2295. [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr,
  2296. [BLSP2_QUP1_I2C_APPS_CLK_SRC] = &blsp2_qup1_i2c_apps_clk_src.clkr,
  2297. [BLSP2_QUP1_SPI_APPS_CLK_SRC] = &blsp2_qup1_spi_apps_clk_src.clkr,
  2298. [BLSP2_QUP2_I2C_APPS_CLK_SRC] = &blsp2_qup2_i2c_apps_clk_src.clkr,
  2299. [BLSP2_QUP2_SPI_APPS_CLK_SRC] = &blsp2_qup2_spi_apps_clk_src.clkr,
  2300. [BLSP2_QUP3_I2C_APPS_CLK_SRC] = &blsp2_qup3_i2c_apps_clk_src.clkr,
  2301. [BLSP2_QUP3_SPI_APPS_CLK_SRC] = &blsp2_qup3_spi_apps_clk_src.clkr,
  2302. [BLSP2_QUP4_I2C_APPS_CLK_SRC] = &blsp2_qup4_i2c_apps_clk_src.clkr,
  2303. [BLSP2_QUP4_SPI_APPS_CLK_SRC] = &blsp2_qup4_spi_apps_clk_src.clkr,
  2304. [BLSP2_QUP5_I2C_APPS_CLK_SRC] = &blsp2_qup5_i2c_apps_clk_src.clkr,
  2305. [BLSP2_QUP5_SPI_APPS_CLK_SRC] = &blsp2_qup5_spi_apps_clk_src.clkr,
  2306. [BLSP2_QUP6_I2C_APPS_CLK_SRC] = &blsp2_qup6_i2c_apps_clk_src.clkr,
  2307. [BLSP2_QUP6_SPI_APPS_CLK_SRC] = &blsp2_qup6_spi_apps_clk_src.clkr,
  2308. [BLSP2_UART1_APPS_CLK_SRC] = &blsp2_uart1_apps_clk_src.clkr,
  2309. [BLSP2_UART2_APPS_CLK_SRC] = &blsp2_uart2_apps_clk_src.clkr,
  2310. [BLSP2_UART3_APPS_CLK_SRC] = &blsp2_uart3_apps_clk_src.clkr,
  2311. [BLSP2_UART4_APPS_CLK_SRC] = &blsp2_uart4_apps_clk_src.clkr,
  2312. [BLSP2_UART5_APPS_CLK_SRC] = &blsp2_uart5_apps_clk_src.clkr,
  2313. [BLSP2_UART6_APPS_CLK_SRC] = &blsp2_uart6_apps_clk_src.clkr,
  2314. [CE1_CLK_SRC] = &ce1_clk_src.clkr,
  2315. [CE2_CLK_SRC] = &ce2_clk_src.clkr,
  2316. [GP1_CLK_SRC] = &gp1_clk_src.clkr,
  2317. [GP2_CLK_SRC] = &gp2_clk_src.clkr,
  2318. [GP3_CLK_SRC] = &gp3_clk_src.clkr,
  2319. [PDM2_CLK_SRC] = &pdm2_clk_src.clkr,
  2320. [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr,
  2321. [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
  2322. [SDCC3_APPS_CLK_SRC] = &sdcc3_apps_clk_src.clkr,
  2323. [SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr,
  2324. [TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr,
  2325. [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr,
  2326. [USB_HS_SYSTEM_CLK_SRC] = &usb_hs_system_clk_src.clkr,
  2327. [USB_HSIC_CLK_SRC] = &usb_hsic_clk_src.clkr,
  2328. [USB_HSIC_IO_CAL_CLK_SRC] = &usb_hsic_io_cal_clk_src.clkr,
  2329. [USB_HSIC_SYSTEM_CLK_SRC] = &usb_hsic_system_clk_src.clkr,
  2330. [GCC_BAM_DMA_AHB_CLK] = &gcc_bam_dma_ahb_clk.clkr,
  2331. [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
  2332. [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
  2333. [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
  2334. [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
  2335. [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
  2336. [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
  2337. [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
  2338. [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
  2339. [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
  2340. [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
  2341. [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
  2342. [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
  2343. [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
  2344. [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
  2345. [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
  2346. [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
  2347. [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr,
  2348. [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr,
  2349. [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr,
  2350. [GCC_BLSP2_AHB_CLK] = &gcc_blsp2_ahb_clk.clkr,
  2351. [GCC_BLSP2_QUP1_I2C_APPS_CLK] = &gcc_blsp2_qup1_i2c_apps_clk.clkr,
  2352. [GCC_BLSP2_QUP1_SPI_APPS_CLK] = &gcc_blsp2_qup1_spi_apps_clk.clkr,
  2353. [GCC_BLSP2_QUP2_I2C_APPS_CLK] = &gcc_blsp2_qup2_i2c_apps_clk.clkr,
  2354. [GCC_BLSP2_QUP2_SPI_APPS_CLK] = &gcc_blsp2_qup2_spi_apps_clk.clkr,
  2355. [GCC_BLSP2_QUP3_I2C_APPS_CLK] = &gcc_blsp2_qup3_i2c_apps_clk.clkr,
  2356. [GCC_BLSP2_QUP3_SPI_APPS_CLK] = &gcc_blsp2_qup3_spi_apps_clk.clkr,
  2357. [GCC_BLSP2_QUP4_I2C_APPS_CLK] = &gcc_blsp2_qup4_i2c_apps_clk.clkr,
  2358. [GCC_BLSP2_QUP4_SPI_APPS_CLK] = &gcc_blsp2_qup4_spi_apps_clk.clkr,
  2359. [GCC_BLSP2_QUP5_I2C_APPS_CLK] = &gcc_blsp2_qup5_i2c_apps_clk.clkr,
  2360. [GCC_BLSP2_QUP5_SPI_APPS_CLK] = &gcc_blsp2_qup5_spi_apps_clk.clkr,
  2361. [GCC_BLSP2_QUP6_I2C_APPS_CLK] = &gcc_blsp2_qup6_i2c_apps_clk.clkr,
  2362. [GCC_BLSP2_QUP6_SPI_APPS_CLK] = &gcc_blsp2_qup6_spi_apps_clk.clkr,
  2363. [GCC_BLSP2_UART1_APPS_CLK] = &gcc_blsp2_uart1_apps_clk.clkr,
  2364. [GCC_BLSP2_UART2_APPS_CLK] = &gcc_blsp2_uart2_apps_clk.clkr,
  2365. [GCC_BLSP2_UART3_APPS_CLK] = &gcc_blsp2_uart3_apps_clk.clkr,
  2366. [GCC_BLSP2_UART4_APPS_CLK] = &gcc_blsp2_uart4_apps_clk.clkr,
  2367. [GCC_BLSP2_UART5_APPS_CLK] = &gcc_blsp2_uart5_apps_clk.clkr,
  2368. [GCC_BLSP2_UART6_APPS_CLK] = &gcc_blsp2_uart6_apps_clk.clkr,
  2369. [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
  2370. [GCC_CE1_AHB_CLK] = &gcc_ce1_ahb_clk.clkr,
  2371. [GCC_CE1_AXI_CLK] = &gcc_ce1_axi_clk.clkr,
  2372. [GCC_CE1_CLK] = &gcc_ce1_clk.clkr,
  2373. [GCC_CE2_AHB_CLK] = &gcc_ce2_ahb_clk.clkr,
  2374. [GCC_CE2_AXI_CLK] = &gcc_ce2_axi_clk.clkr,
  2375. [GCC_CE2_CLK] = &gcc_ce2_clk.clkr,
  2376. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  2377. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  2378. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  2379. [GCC_LPASS_Q6_AXI_CLK] = &gcc_lpass_q6_axi_clk.clkr,
  2380. [GCC_MMSS_NOC_CFG_AHB_CLK] = &gcc_mmss_noc_cfg_ahb_clk.clkr,
  2381. [GCC_OCMEM_NOC_CFG_AHB_CLK] = &gcc_ocmem_noc_cfg_ahb_clk.clkr,
  2382. [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
  2383. [GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr,
  2384. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  2385. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  2386. [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
  2387. [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
  2388. [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
  2389. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  2390. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  2391. [GCC_SDCC3_AHB_CLK] = &gcc_sdcc3_ahb_clk.clkr,
  2392. [GCC_SDCC3_APPS_CLK] = &gcc_sdcc3_apps_clk.clkr,
  2393. [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr,
  2394. [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr,
  2395. [GCC_SYS_NOC_USB3_AXI_CLK] = &gcc_sys_noc_usb3_axi_clk.clkr,
  2396. [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr,
  2397. [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr,
  2398. [GCC_USB2A_PHY_SLEEP_CLK] = &gcc_usb2a_phy_sleep_clk.clkr,
  2399. [GCC_USB2B_PHY_SLEEP_CLK] = &gcc_usb2b_phy_sleep_clk.clkr,
  2400. [GCC_USB30_MASTER_CLK] = &gcc_usb30_master_clk.clkr,
  2401. [GCC_USB30_MOCK_UTMI_CLK] = &gcc_usb30_mock_utmi_clk.clkr,
  2402. [GCC_USB30_SLEEP_CLK] = &gcc_usb30_sleep_clk.clkr,
  2403. [GCC_USB_HS_AHB_CLK] = &gcc_usb_hs_ahb_clk.clkr,
  2404. [GCC_USB_HS_SYSTEM_CLK] = &gcc_usb_hs_system_clk.clkr,
  2405. [GCC_USB_HSIC_AHB_CLK] = &gcc_usb_hsic_ahb_clk.clkr,
  2406. [GCC_USB_HSIC_CLK] = &gcc_usb_hsic_clk.clkr,
  2407. [GCC_USB_HSIC_IO_CAL_CLK] = &gcc_usb_hsic_io_cal_clk.clkr,
  2408. [GCC_USB_HSIC_IO_CAL_SLEEP_CLK] = &gcc_usb_hsic_io_cal_sleep_clk.clkr,
  2409. [GCC_USB_HSIC_SYSTEM_CLK] = &gcc_usb_hsic_system_clk.clkr,
  2410. [GCC_MMSS_GPLL0_CLK_SRC] = &gcc_mmss_gpll0_clk_src,
  2411. [GPLL4] = NULL,
  2412. [GPLL4_VOTE] = NULL,
  2413. [GCC_SDCC1_CDCCAL_SLEEP_CLK] = NULL,
  2414. [GCC_SDCC1_CDCCAL_FF_CLK] = NULL,
  2415. };
  2416. static const struct qcom_reset_map gcc_msm8974_resets[] = {
  2417. [GCC_SYSTEM_NOC_BCR] = { 0x0100 },
  2418. [GCC_CONFIG_NOC_BCR] = { 0x0140 },
  2419. [GCC_PERIPH_NOC_BCR] = { 0x0180 },
  2420. [GCC_IMEM_BCR] = { 0x0200 },
  2421. [GCC_MMSS_BCR] = { 0x0240 },
  2422. [GCC_QDSS_BCR] = { 0x0300 },
  2423. [GCC_USB_30_BCR] = { 0x03c0 },
  2424. [GCC_USB3_PHY_BCR] = { 0x03fc },
  2425. [GCC_USB_HS_HSIC_BCR] = { 0x0400 },
  2426. [GCC_USB_HS_BCR] = { 0x0480 },
  2427. [GCC_USB2A_PHY_BCR] = { 0x04a8 },
  2428. [GCC_USB2B_PHY_BCR] = { 0x04b0 },
  2429. [GCC_SDCC1_BCR] = { 0x04c0 },
  2430. [GCC_SDCC2_BCR] = { 0x0500 },
  2431. [GCC_SDCC3_BCR] = { 0x0540 },
  2432. [GCC_SDCC4_BCR] = { 0x0580 },
  2433. [GCC_BLSP1_BCR] = { 0x05c0 },
  2434. [GCC_BLSP1_QUP1_BCR] = { 0x0640 },
  2435. [GCC_BLSP1_UART1_BCR] = { 0x0680 },
  2436. [GCC_BLSP1_QUP2_BCR] = { 0x06c0 },
  2437. [GCC_BLSP1_UART2_BCR] = { 0x0700 },
  2438. [GCC_BLSP1_QUP3_BCR] = { 0x0740 },
  2439. [GCC_BLSP1_UART3_BCR] = { 0x0780 },
  2440. [GCC_BLSP1_QUP4_BCR] = { 0x07c0 },
  2441. [GCC_BLSP1_UART4_BCR] = { 0x0800 },
  2442. [GCC_BLSP1_QUP5_BCR] = { 0x0840 },
  2443. [GCC_BLSP1_UART5_BCR] = { 0x0880 },
  2444. [GCC_BLSP1_QUP6_BCR] = { 0x08c0 },
  2445. [GCC_BLSP1_UART6_BCR] = { 0x0900 },
  2446. [GCC_BLSP2_BCR] = { 0x0940 },
  2447. [GCC_BLSP2_QUP1_BCR] = { 0x0980 },
  2448. [GCC_BLSP2_UART1_BCR] = { 0x09c0 },
  2449. [GCC_BLSP2_QUP2_BCR] = { 0x0a00 },
  2450. [GCC_BLSP2_UART2_BCR] = { 0x0a40 },
  2451. [GCC_BLSP2_QUP3_BCR] = { 0x0a80 },
  2452. [GCC_BLSP2_UART3_BCR] = { 0x0ac0 },
  2453. [GCC_BLSP2_QUP4_BCR] = { 0x0b00 },
  2454. [GCC_BLSP2_UART4_BCR] = { 0x0b40 },
  2455. [GCC_BLSP2_QUP5_BCR] = { 0x0b80 },
  2456. [GCC_BLSP2_UART5_BCR] = { 0x0bc0 },
  2457. [GCC_BLSP2_QUP6_BCR] = { 0x0c00 },
  2458. [GCC_BLSP2_UART6_BCR] = { 0x0c40 },
  2459. [GCC_PDM_BCR] = { 0x0cc0 },
  2460. [GCC_BAM_DMA_BCR] = { 0x0d40 },
  2461. [GCC_TSIF_BCR] = { 0x0d80 },
  2462. [GCC_TCSR_BCR] = { 0x0dc0 },
  2463. [GCC_BOOT_ROM_BCR] = { 0x0e00 },
  2464. [GCC_MSG_RAM_BCR] = { 0x0e40 },
  2465. [GCC_TLMM_BCR] = { 0x0e80 },
  2466. [GCC_MPM_BCR] = { 0x0ec0 },
  2467. [GCC_SEC_CTRL_BCR] = { 0x0f40 },
  2468. [GCC_SPMI_BCR] = { 0x0fc0 },
  2469. [GCC_SPDM_BCR] = { 0x1000 },
  2470. [GCC_CE1_BCR] = { 0x1040 },
  2471. [GCC_CE2_BCR] = { 0x1080 },
  2472. [GCC_BIMC_BCR] = { 0x1100 },
  2473. [GCC_MPM_NON_AHB_RESET] = { 0x0ec4, 2 },
  2474. [GCC_MPM_AHB_RESET] = { 0x0ec4, 1 },
  2475. [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x1240 },
  2476. [GCC_SNOC_BUS_TIMEOUT2_BCR] = { 0x1248 },
  2477. [GCC_PNOC_BUS_TIMEOUT0_BCR] = { 0x1280 },
  2478. [GCC_PNOC_BUS_TIMEOUT1_BCR] = { 0x1288 },
  2479. [GCC_PNOC_BUS_TIMEOUT2_BCR] = { 0x1290 },
  2480. [GCC_PNOC_BUS_TIMEOUT3_BCR] = { 0x1298 },
  2481. [GCC_PNOC_BUS_TIMEOUT4_BCR] = { 0x12a0 },
  2482. [GCC_CNOC_BUS_TIMEOUT0_BCR] = { 0x12c0 },
  2483. [GCC_CNOC_BUS_TIMEOUT1_BCR] = { 0x12c8 },
  2484. [GCC_CNOC_BUS_TIMEOUT2_BCR] = { 0x12d0 },
  2485. [GCC_CNOC_BUS_TIMEOUT3_BCR] = { 0x12d8 },
  2486. [GCC_CNOC_BUS_TIMEOUT4_BCR] = { 0x12e0 },
  2487. [GCC_CNOC_BUS_TIMEOUT5_BCR] = { 0x12e8 },
  2488. [GCC_CNOC_BUS_TIMEOUT6_BCR] = { 0x12f0 },
  2489. [GCC_DEHR_BCR] = { 0x1300 },
  2490. [GCC_RBCPR_BCR] = { 0x1380 },
  2491. [GCC_MSS_RESTART] = { 0x1680 },
  2492. [GCC_LPASS_RESTART] = { 0x16c0 },
  2493. [GCC_WCSS_RESTART] = { 0x1700 },
  2494. [GCC_VENUS_RESTART] = { 0x1740 },
  2495. };
  2496. static struct gdsc *gcc_msm8974_gdscs[] = {
  2497. [USB_HS_HSIC_GDSC] = &usb_hs_hsic_gdsc,
  2498. };
  2499. static const struct regmap_config gcc_msm8974_regmap_config = {
  2500. .reg_bits = 32,
  2501. .reg_stride = 4,
  2502. .val_bits = 32,
  2503. .max_register = 0x1fc0,
  2504. .fast_io = true,
  2505. };
  2506. static const struct qcom_cc_desc gcc_msm8974_desc = {
  2507. .config = &gcc_msm8974_regmap_config,
  2508. .clks = gcc_msm8974_clocks,
  2509. .num_clks = ARRAY_SIZE(gcc_msm8974_clocks),
  2510. .resets = gcc_msm8974_resets,
  2511. .num_resets = ARRAY_SIZE(gcc_msm8974_resets),
  2512. .gdscs = gcc_msm8974_gdscs,
  2513. .num_gdscs = ARRAY_SIZE(gcc_msm8974_gdscs),
  2514. };
  2515. static const struct of_device_id gcc_msm8974_match_table[] = {
  2516. { .compatible = "qcom,gcc-msm8974" },
  2517. { .compatible = "qcom,gcc-msm8974pro" , .data = (void *)1UL },
  2518. { .compatible = "qcom,gcc-msm8974pro-ac", .data = (void *)1UL },
  2519. { }
  2520. };
  2521. MODULE_DEVICE_TABLE(of, gcc_msm8974_match_table);
  2522. static void msm8974_pro_clock_override(void)
  2523. {
  2524. sdcc1_apps_clk_src_init.parent_names = gcc_xo_gpll0_gpll4;
  2525. sdcc1_apps_clk_src_init.num_parents = 3;
  2526. sdcc1_apps_clk_src.freq_tbl = ftbl_gcc_sdcc1_apps_clk_pro;
  2527. sdcc1_apps_clk_src.parent_map = gcc_xo_gpll0_gpll4_map;
  2528. gcc_msm8974_clocks[GPLL4] = &gpll4.clkr;
  2529. gcc_msm8974_clocks[GPLL4_VOTE] = &gpll4_vote;
  2530. gcc_msm8974_clocks[GCC_SDCC1_CDCCAL_SLEEP_CLK] =
  2531. &gcc_sdcc1_cdccal_sleep_clk.clkr;
  2532. gcc_msm8974_clocks[GCC_SDCC1_CDCCAL_FF_CLK] =
  2533. &gcc_sdcc1_cdccal_ff_clk.clkr;
  2534. }
  2535. static int gcc_msm8974_probe(struct platform_device *pdev)
  2536. {
  2537. struct clk *clk;
  2538. struct device *dev = &pdev->dev;
  2539. bool pro;
  2540. const struct of_device_id *id;
  2541. id = of_match_device(gcc_msm8974_match_table, dev);
  2542. if (!id)
  2543. return -ENODEV;
  2544. pro = !!(id->data);
  2545. if (pro)
  2546. msm8974_pro_clock_override();
  2547. /* Temporary until RPM clocks supported */
  2548. clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000);
  2549. if (IS_ERR(clk))
  2550. return PTR_ERR(clk);
  2551. /* Should move to DT node? */
  2552. clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL,
  2553. CLK_IS_ROOT, 32768);
  2554. if (IS_ERR(clk))
  2555. return PTR_ERR(clk);
  2556. return qcom_cc_probe(pdev, &gcc_msm8974_desc);
  2557. }
  2558. static struct platform_driver gcc_msm8974_driver = {
  2559. .probe = gcc_msm8974_probe,
  2560. .driver = {
  2561. .name = "gcc-msm8974",
  2562. .of_match_table = gcc_msm8974_match_table,
  2563. },
  2564. };
  2565. static int __init gcc_msm8974_init(void)
  2566. {
  2567. return platform_driver_register(&gcc_msm8974_driver);
  2568. }
  2569. core_initcall(gcc_msm8974_init);
  2570. static void __exit gcc_msm8974_exit(void)
  2571. {
  2572. platform_driver_unregister(&gcc_msm8974_driver);
  2573. }
  2574. module_exit(gcc_msm8974_exit);
  2575. MODULE_DESCRIPTION("QCOM GCC MSM8974 Driver");
  2576. MODULE_LICENSE("GPL v2");
  2577. MODULE_ALIAS("platform:gcc-msm8974");