gcc-msm8998.c 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2016, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/bitops.h>
  7. #include <linux/err.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/module.h>
  10. #include <linux/of.h>
  11. #include <linux/of_device.h>
  12. #include <linux/clk-provider.h>
  13. #include <linux/regmap.h>
  14. #include <linux/reset-controller.h>
  15. #include <dt-bindings/clock/qcom,gcc-msm8998.h>
  16. #include "common.h"
  17. #include "clk-regmap.h"
  18. #include "clk-alpha-pll.h"
  19. #include "clk-pll.h"
  20. #include "clk-rcg.h"
  21. #include "clk-branch.h"
  22. #include "reset.h"
  23. #include "gdsc.h"
  24. enum {
  25. P_AUD_REF_CLK,
  26. P_CORE_BI_PLL_TEST_SE,
  27. P_GPLL0_OUT_MAIN,
  28. P_GPLL4_OUT_MAIN,
  29. P_PLL0_EARLY_DIV_CLK_SRC,
  30. P_SLEEP_CLK,
  31. P_XO,
  32. };
  33. static const struct parent_map gcc_parent_map_0[] = {
  34. { P_XO, 0 },
  35. { P_GPLL0_OUT_MAIN, 1 },
  36. { P_PLL0_EARLY_DIV_CLK_SRC, 6 },
  37. { P_CORE_BI_PLL_TEST_SE, 7 },
  38. };
  39. static const char * const gcc_parent_names_0[] = {
  40. "xo",
  41. "gpll0_out_main",
  42. "gpll0_out_main",
  43. "core_bi_pll_test_se",
  44. };
  45. static const struct parent_map gcc_parent_map_1[] = {
  46. { P_XO, 0 },
  47. { P_GPLL0_OUT_MAIN, 1 },
  48. { P_CORE_BI_PLL_TEST_SE, 7 },
  49. };
  50. static const char * const gcc_parent_names_1[] = {
  51. "xo",
  52. "gpll0_out_main",
  53. "core_bi_pll_test_se",
  54. };
  55. static const struct parent_map gcc_parent_map_2[] = {
  56. { P_XO, 0 },
  57. { P_GPLL0_OUT_MAIN, 1 },
  58. { P_SLEEP_CLK, 5 },
  59. { P_PLL0_EARLY_DIV_CLK_SRC, 6 },
  60. { P_CORE_BI_PLL_TEST_SE, 7 },
  61. };
  62. static const char * const gcc_parent_names_2[] = {
  63. "xo",
  64. "gpll0_out_main",
  65. "core_pi_sleep_clk",
  66. "gpll0_out_main",
  67. "core_bi_pll_test_se",
  68. };
  69. static const struct parent_map gcc_parent_map_3[] = {
  70. { P_XO, 0 },
  71. { P_SLEEP_CLK, 5 },
  72. { P_CORE_BI_PLL_TEST_SE, 7 },
  73. };
  74. static const char * const gcc_parent_names_3[] = {
  75. "xo",
  76. "core_pi_sleep_clk",
  77. "core_bi_pll_test_se",
  78. };
  79. static const struct parent_map gcc_parent_map_4[] = {
  80. { P_XO, 0 },
  81. { P_GPLL0_OUT_MAIN, 1 },
  82. { P_GPLL4_OUT_MAIN, 5 },
  83. { P_CORE_BI_PLL_TEST_SE, 7 },
  84. };
  85. static const char * const gcc_parent_names_4[] = {
  86. "xo",
  87. "gpll0_out_main",
  88. "gpll4_out_main",
  89. "core_bi_pll_test_se",
  90. };
  91. static const struct parent_map gcc_parent_map_5[] = {
  92. { P_XO, 0 },
  93. { P_GPLL0_OUT_MAIN, 1 },
  94. { P_AUD_REF_CLK, 2 },
  95. { P_CORE_BI_PLL_TEST_SE, 7 },
  96. };
  97. static const char * const gcc_parent_names_5[] = {
  98. "xo",
  99. "gpll0_out_main",
  100. "aud_ref_clk",
  101. "core_bi_pll_test_se",
  102. };
  103. static struct pll_vco fabia_vco[] = {
  104. { 250000000, 2000000000, 0 },
  105. { 125000000, 1000000000, 1 },
  106. };
  107. static struct clk_alpha_pll gpll0 = {
  108. .offset = 0x0,
  109. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  110. .vco_table = fabia_vco,
  111. .num_vco = ARRAY_SIZE(fabia_vco),
  112. .clkr = {
  113. .enable_reg = 0x52000,
  114. .enable_mask = BIT(0),
  115. .hw.init = &(struct clk_init_data){
  116. .name = "gpll0",
  117. .parent_names = (const char *[]){ "xo" },
  118. .num_parents = 1,
  119. .ops = &clk_alpha_pll_fixed_fabia_ops,
  120. }
  121. },
  122. };
  123. static struct clk_alpha_pll_postdiv gpll0_out_even = {
  124. .offset = 0x0,
  125. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  126. .clkr.hw.init = &(struct clk_init_data){
  127. .name = "gpll0_out_even",
  128. .parent_names = (const char *[]){ "gpll0" },
  129. .num_parents = 1,
  130. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  131. },
  132. };
  133. static struct clk_alpha_pll_postdiv gpll0_out_main = {
  134. .offset = 0x0,
  135. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  136. .clkr.hw.init = &(struct clk_init_data){
  137. .name = "gpll0_out_main",
  138. .parent_names = (const char *[]){ "gpll0" },
  139. .num_parents = 1,
  140. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  141. },
  142. };
  143. static struct clk_alpha_pll_postdiv gpll0_out_odd = {
  144. .offset = 0x0,
  145. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  146. .clkr.hw.init = &(struct clk_init_data){
  147. .name = "gpll0_out_odd",
  148. .parent_names = (const char *[]){ "gpll0" },
  149. .num_parents = 1,
  150. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  151. },
  152. };
  153. static struct clk_alpha_pll_postdiv gpll0_out_test = {
  154. .offset = 0x0,
  155. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  156. .clkr.hw.init = &(struct clk_init_data){
  157. .name = "gpll0_out_test",
  158. .parent_names = (const char *[]){ "gpll0" },
  159. .num_parents = 1,
  160. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  161. },
  162. };
  163. static struct clk_alpha_pll gpll1 = {
  164. .offset = 0x1000,
  165. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  166. .vco_table = fabia_vco,
  167. .num_vco = ARRAY_SIZE(fabia_vco),
  168. .clkr = {
  169. .enable_reg = 0x52000,
  170. .enable_mask = BIT(1),
  171. .hw.init = &(struct clk_init_data){
  172. .name = "gpll1",
  173. .parent_names = (const char *[]){ "xo" },
  174. .num_parents = 1,
  175. .ops = &clk_alpha_pll_fixed_fabia_ops,
  176. }
  177. },
  178. };
  179. static struct clk_alpha_pll_postdiv gpll1_out_even = {
  180. .offset = 0x1000,
  181. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  182. .clkr.hw.init = &(struct clk_init_data){
  183. .name = "gpll1_out_even",
  184. .parent_names = (const char *[]){ "gpll1" },
  185. .num_parents = 1,
  186. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  187. },
  188. };
  189. static struct clk_alpha_pll_postdiv gpll1_out_main = {
  190. .offset = 0x1000,
  191. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  192. .clkr.hw.init = &(struct clk_init_data){
  193. .name = "gpll1_out_main",
  194. .parent_names = (const char *[]){ "gpll1" },
  195. .num_parents = 1,
  196. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  197. },
  198. };
  199. static struct clk_alpha_pll_postdiv gpll1_out_odd = {
  200. .offset = 0x1000,
  201. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  202. .clkr.hw.init = &(struct clk_init_data){
  203. .name = "gpll1_out_odd",
  204. .parent_names = (const char *[]){ "gpll1" },
  205. .num_parents = 1,
  206. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  207. },
  208. };
  209. static struct clk_alpha_pll_postdiv gpll1_out_test = {
  210. .offset = 0x1000,
  211. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  212. .clkr.hw.init = &(struct clk_init_data){
  213. .name = "gpll1_out_test",
  214. .parent_names = (const char *[]){ "gpll1" },
  215. .num_parents = 1,
  216. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  217. },
  218. };
  219. static struct clk_alpha_pll gpll2 = {
  220. .offset = 0x2000,
  221. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  222. .vco_table = fabia_vco,
  223. .num_vco = ARRAY_SIZE(fabia_vco),
  224. .clkr = {
  225. .enable_reg = 0x52000,
  226. .enable_mask = BIT(2),
  227. .hw.init = &(struct clk_init_data){
  228. .name = "gpll2",
  229. .parent_names = (const char *[]){ "xo" },
  230. .num_parents = 1,
  231. .ops = &clk_alpha_pll_fixed_fabia_ops,
  232. }
  233. },
  234. };
  235. static struct clk_alpha_pll_postdiv gpll2_out_even = {
  236. .offset = 0x2000,
  237. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  238. .clkr.hw.init = &(struct clk_init_data){
  239. .name = "gpll2_out_even",
  240. .parent_names = (const char *[]){ "gpll2" },
  241. .num_parents = 1,
  242. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  243. },
  244. };
  245. static struct clk_alpha_pll_postdiv gpll2_out_main = {
  246. .offset = 0x2000,
  247. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  248. .clkr.hw.init = &(struct clk_init_data){
  249. .name = "gpll2_out_main",
  250. .parent_names = (const char *[]){ "gpll2" },
  251. .num_parents = 1,
  252. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  253. },
  254. };
  255. static struct clk_alpha_pll_postdiv gpll2_out_odd = {
  256. .offset = 0x2000,
  257. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  258. .clkr.hw.init = &(struct clk_init_data){
  259. .name = "gpll2_out_odd",
  260. .parent_names = (const char *[]){ "gpll2" },
  261. .num_parents = 1,
  262. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  263. },
  264. };
  265. static struct clk_alpha_pll_postdiv gpll2_out_test = {
  266. .offset = 0x2000,
  267. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  268. .clkr.hw.init = &(struct clk_init_data){
  269. .name = "gpll2_out_test",
  270. .parent_names = (const char *[]){ "gpll2" },
  271. .num_parents = 1,
  272. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  273. },
  274. };
  275. static struct clk_alpha_pll gpll3 = {
  276. .offset = 0x3000,
  277. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  278. .vco_table = fabia_vco,
  279. .num_vco = ARRAY_SIZE(fabia_vco),
  280. .clkr = {
  281. .enable_reg = 0x52000,
  282. .enable_mask = BIT(3),
  283. .hw.init = &(struct clk_init_data){
  284. .name = "gpll3",
  285. .parent_names = (const char *[]){ "xo" },
  286. .num_parents = 1,
  287. .ops = &clk_alpha_pll_fixed_fabia_ops,
  288. }
  289. },
  290. };
  291. static struct clk_alpha_pll_postdiv gpll3_out_even = {
  292. .offset = 0x3000,
  293. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  294. .clkr.hw.init = &(struct clk_init_data){
  295. .name = "gpll3_out_even",
  296. .parent_names = (const char *[]){ "gpll3" },
  297. .num_parents = 1,
  298. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  299. },
  300. };
  301. static struct clk_alpha_pll_postdiv gpll3_out_main = {
  302. .offset = 0x3000,
  303. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  304. .clkr.hw.init = &(struct clk_init_data){
  305. .name = "gpll3_out_main",
  306. .parent_names = (const char *[]){ "gpll3" },
  307. .num_parents = 1,
  308. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  309. },
  310. };
  311. static struct clk_alpha_pll_postdiv gpll3_out_odd = {
  312. .offset = 0x3000,
  313. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  314. .clkr.hw.init = &(struct clk_init_data){
  315. .name = "gpll3_out_odd",
  316. .parent_names = (const char *[]){ "gpll3" },
  317. .num_parents = 1,
  318. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  319. },
  320. };
  321. static struct clk_alpha_pll_postdiv gpll3_out_test = {
  322. .offset = 0x3000,
  323. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  324. .clkr.hw.init = &(struct clk_init_data){
  325. .name = "gpll3_out_test",
  326. .parent_names = (const char *[]){ "gpll3" },
  327. .num_parents = 1,
  328. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  329. },
  330. };
  331. static struct clk_alpha_pll gpll4 = {
  332. .offset = 0x77000,
  333. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  334. .vco_table = fabia_vco,
  335. .num_vco = ARRAY_SIZE(fabia_vco),
  336. .clkr = {
  337. .enable_reg = 0x52000,
  338. .enable_mask = BIT(4),
  339. .hw.init = &(struct clk_init_data){
  340. .name = "gpll4",
  341. .parent_names = (const char *[]){ "xo" },
  342. .num_parents = 1,
  343. .ops = &clk_alpha_pll_fixed_fabia_ops,
  344. }
  345. },
  346. };
  347. static struct clk_alpha_pll_postdiv gpll4_out_even = {
  348. .offset = 0x77000,
  349. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  350. .clkr.hw.init = &(struct clk_init_data){
  351. .name = "gpll4_out_even",
  352. .parent_names = (const char *[]){ "gpll4" },
  353. .num_parents = 1,
  354. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  355. },
  356. };
  357. static struct clk_alpha_pll_postdiv gpll4_out_main = {
  358. .offset = 0x77000,
  359. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  360. .clkr.hw.init = &(struct clk_init_data){
  361. .name = "gpll4_out_main",
  362. .parent_names = (const char *[]){ "gpll4" },
  363. .num_parents = 1,
  364. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  365. },
  366. };
  367. static struct clk_alpha_pll_postdiv gpll4_out_odd = {
  368. .offset = 0x77000,
  369. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  370. .clkr.hw.init = &(struct clk_init_data){
  371. .name = "gpll4_out_odd",
  372. .parent_names = (const char *[]){ "gpll4" },
  373. .num_parents = 1,
  374. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  375. },
  376. };
  377. static struct clk_alpha_pll_postdiv gpll4_out_test = {
  378. .offset = 0x77000,
  379. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  380. .clkr.hw.init = &(struct clk_init_data){
  381. .name = "gpll4_out_test",
  382. .parent_names = (const char *[]){ "gpll4" },
  383. .num_parents = 1,
  384. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  385. },
  386. };
  387. static const struct freq_tbl ftbl_blsp1_qup1_i2c_apps_clk_src[] = {
  388. F(19200000, P_XO, 1, 0, 0),
  389. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  390. { }
  391. };
  392. static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
  393. .cmd_rcgr = 0x19020,
  394. .mnd_width = 0,
  395. .hid_width = 5,
  396. .parent_map = gcc_parent_map_1,
  397. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  398. .clkr.hw.init = &(struct clk_init_data){
  399. .name = "blsp1_qup1_i2c_apps_clk_src",
  400. .parent_names = gcc_parent_names_1,
  401. .num_parents = 3,
  402. .ops = &clk_rcg2_ops,
  403. },
  404. };
  405. static const struct freq_tbl ftbl_blsp1_qup1_spi_apps_clk_src[] = {
  406. F(960000, P_XO, 10, 1, 2),
  407. F(4800000, P_XO, 4, 0, 0),
  408. F(9600000, P_XO, 2, 0, 0),
  409. F(15000000, P_GPLL0_OUT_MAIN, 10, 1, 4),
  410. F(19200000, P_XO, 1, 0, 0),
  411. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  412. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  413. { }
  414. };
  415. static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
  416. .cmd_rcgr = 0x1900c,
  417. .mnd_width = 8,
  418. .hid_width = 5,
  419. .parent_map = gcc_parent_map_0,
  420. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  421. .clkr.hw.init = &(struct clk_init_data){
  422. .name = "blsp1_qup1_spi_apps_clk_src",
  423. .parent_names = gcc_parent_names_0,
  424. .num_parents = 4,
  425. .ops = &clk_rcg2_ops,
  426. },
  427. };
  428. static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
  429. .cmd_rcgr = 0x1b020,
  430. .mnd_width = 0,
  431. .hid_width = 5,
  432. .parent_map = gcc_parent_map_1,
  433. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  434. .clkr.hw.init = &(struct clk_init_data){
  435. .name = "blsp1_qup2_i2c_apps_clk_src",
  436. .parent_names = gcc_parent_names_1,
  437. .num_parents = 3,
  438. .ops = &clk_rcg2_ops,
  439. },
  440. };
  441. static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
  442. .cmd_rcgr = 0x1b00c,
  443. .mnd_width = 8,
  444. .hid_width = 5,
  445. .parent_map = gcc_parent_map_0,
  446. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  447. .clkr.hw.init = &(struct clk_init_data){
  448. .name = "blsp1_qup2_spi_apps_clk_src",
  449. .parent_names = gcc_parent_names_0,
  450. .num_parents = 4,
  451. .ops = &clk_rcg2_ops,
  452. },
  453. };
  454. static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
  455. .cmd_rcgr = 0x1d020,
  456. .mnd_width = 0,
  457. .hid_width = 5,
  458. .parent_map = gcc_parent_map_1,
  459. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  460. .clkr.hw.init = &(struct clk_init_data){
  461. .name = "blsp1_qup3_i2c_apps_clk_src",
  462. .parent_names = gcc_parent_names_1,
  463. .num_parents = 3,
  464. .ops = &clk_rcg2_ops,
  465. },
  466. };
  467. static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
  468. .cmd_rcgr = 0x1d00c,
  469. .mnd_width = 8,
  470. .hid_width = 5,
  471. .parent_map = gcc_parent_map_0,
  472. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  473. .clkr.hw.init = &(struct clk_init_data){
  474. .name = "blsp1_qup3_spi_apps_clk_src",
  475. .parent_names = gcc_parent_names_0,
  476. .num_parents = 4,
  477. .ops = &clk_rcg2_ops,
  478. },
  479. };
  480. static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
  481. .cmd_rcgr = 0x1f020,
  482. .mnd_width = 0,
  483. .hid_width = 5,
  484. .parent_map = gcc_parent_map_1,
  485. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  486. .clkr.hw.init = &(struct clk_init_data){
  487. .name = "blsp1_qup4_i2c_apps_clk_src",
  488. .parent_names = gcc_parent_names_1,
  489. .num_parents = 3,
  490. .ops = &clk_rcg2_ops,
  491. },
  492. };
  493. static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
  494. .cmd_rcgr = 0x1f00c,
  495. .mnd_width = 8,
  496. .hid_width = 5,
  497. .parent_map = gcc_parent_map_0,
  498. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  499. .clkr.hw.init = &(struct clk_init_data){
  500. .name = "blsp1_qup4_spi_apps_clk_src",
  501. .parent_names = gcc_parent_names_0,
  502. .num_parents = 4,
  503. .ops = &clk_rcg2_ops,
  504. },
  505. };
  506. static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
  507. .cmd_rcgr = 0x21020,
  508. .mnd_width = 0,
  509. .hid_width = 5,
  510. .parent_map = gcc_parent_map_1,
  511. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  512. .clkr.hw.init = &(struct clk_init_data){
  513. .name = "blsp1_qup5_i2c_apps_clk_src",
  514. .parent_names = gcc_parent_names_1,
  515. .num_parents = 3,
  516. .ops = &clk_rcg2_ops,
  517. },
  518. };
  519. static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
  520. .cmd_rcgr = 0x2100c,
  521. .mnd_width = 8,
  522. .hid_width = 5,
  523. .parent_map = gcc_parent_map_0,
  524. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  525. .clkr.hw.init = &(struct clk_init_data){
  526. .name = "blsp1_qup5_spi_apps_clk_src",
  527. .parent_names = gcc_parent_names_0,
  528. .num_parents = 4,
  529. .ops = &clk_rcg2_ops,
  530. },
  531. };
  532. static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
  533. .cmd_rcgr = 0x23020,
  534. .mnd_width = 0,
  535. .hid_width = 5,
  536. .parent_map = gcc_parent_map_1,
  537. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  538. .clkr.hw.init = &(struct clk_init_data){
  539. .name = "blsp1_qup6_i2c_apps_clk_src",
  540. .parent_names = gcc_parent_names_1,
  541. .num_parents = 3,
  542. .ops = &clk_rcg2_ops,
  543. },
  544. };
  545. static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
  546. .cmd_rcgr = 0x2300c,
  547. .mnd_width = 8,
  548. .hid_width = 5,
  549. .parent_map = gcc_parent_map_0,
  550. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  551. .clkr.hw.init = &(struct clk_init_data){
  552. .name = "blsp1_qup6_spi_apps_clk_src",
  553. .parent_names = gcc_parent_names_0,
  554. .num_parents = 4,
  555. .ops = &clk_rcg2_ops,
  556. },
  557. };
  558. static const struct freq_tbl ftbl_blsp1_uart1_apps_clk_src[] = {
  559. F(3686400, P_GPLL0_OUT_MAIN, 1, 96, 15625),
  560. F(7372800, P_GPLL0_OUT_MAIN, 1, 192, 15625),
  561. F(14745600, P_GPLL0_OUT_MAIN, 1, 384, 15625),
  562. F(16000000, P_GPLL0_OUT_MAIN, 5, 2, 15),
  563. F(19200000, P_XO, 1, 0, 0),
  564. F(24000000, P_GPLL0_OUT_MAIN, 5, 1, 5),
  565. F(32000000, P_GPLL0_OUT_MAIN, 1, 4, 75),
  566. F(40000000, P_GPLL0_OUT_MAIN, 15, 0, 0),
  567. F(46400000, P_GPLL0_OUT_MAIN, 1, 29, 375),
  568. F(48000000, P_GPLL0_OUT_MAIN, 12.5, 0, 0),
  569. F(51200000, P_GPLL0_OUT_MAIN, 1, 32, 375),
  570. F(56000000, P_GPLL0_OUT_MAIN, 1, 7, 75),
  571. F(58982400, P_GPLL0_OUT_MAIN, 1, 1536, 15625),
  572. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  573. F(63157895, P_GPLL0_OUT_MAIN, 9.5, 0, 0),
  574. { }
  575. };
  576. static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
  577. .cmd_rcgr = 0x1a00c,
  578. .mnd_width = 16,
  579. .hid_width = 5,
  580. .parent_map = gcc_parent_map_0,
  581. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  582. .clkr.hw.init = &(struct clk_init_data){
  583. .name = "blsp1_uart1_apps_clk_src",
  584. .parent_names = gcc_parent_names_0,
  585. .num_parents = 4,
  586. .ops = &clk_rcg2_ops,
  587. },
  588. };
  589. static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
  590. .cmd_rcgr = 0x1c00c,
  591. .mnd_width = 16,
  592. .hid_width = 5,
  593. .parent_map = gcc_parent_map_0,
  594. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  595. .clkr.hw.init = &(struct clk_init_data){
  596. .name = "blsp1_uart2_apps_clk_src",
  597. .parent_names = gcc_parent_names_0,
  598. .num_parents = 4,
  599. .ops = &clk_rcg2_ops,
  600. },
  601. };
  602. static struct clk_rcg2 blsp1_uart3_apps_clk_src = {
  603. .cmd_rcgr = 0x1e00c,
  604. .mnd_width = 16,
  605. .hid_width = 5,
  606. .parent_map = gcc_parent_map_0,
  607. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  608. .clkr.hw.init = &(struct clk_init_data){
  609. .name = "blsp1_uart3_apps_clk_src",
  610. .parent_names = gcc_parent_names_0,
  611. .num_parents = 4,
  612. .ops = &clk_rcg2_ops,
  613. },
  614. };
  615. static struct clk_rcg2 blsp2_qup1_i2c_apps_clk_src = {
  616. .cmd_rcgr = 0x26020,
  617. .mnd_width = 0,
  618. .hid_width = 5,
  619. .parent_map = gcc_parent_map_1,
  620. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  621. .clkr.hw.init = &(struct clk_init_data){
  622. .name = "blsp2_qup1_i2c_apps_clk_src",
  623. .parent_names = gcc_parent_names_1,
  624. .num_parents = 3,
  625. .ops = &clk_rcg2_ops,
  626. },
  627. };
  628. static struct clk_rcg2 blsp2_qup1_spi_apps_clk_src = {
  629. .cmd_rcgr = 0x2600c,
  630. .mnd_width = 8,
  631. .hid_width = 5,
  632. .parent_map = gcc_parent_map_0,
  633. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  634. .clkr.hw.init = &(struct clk_init_data){
  635. .name = "blsp2_qup1_spi_apps_clk_src",
  636. .parent_names = gcc_parent_names_0,
  637. .num_parents = 4,
  638. .ops = &clk_rcg2_ops,
  639. },
  640. };
  641. static struct clk_rcg2 blsp2_qup2_i2c_apps_clk_src = {
  642. .cmd_rcgr = 0x28020,
  643. .mnd_width = 0,
  644. .hid_width = 5,
  645. .parent_map = gcc_parent_map_1,
  646. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  647. .clkr.hw.init = &(struct clk_init_data){
  648. .name = "blsp2_qup2_i2c_apps_clk_src",
  649. .parent_names = gcc_parent_names_1,
  650. .num_parents = 3,
  651. .ops = &clk_rcg2_ops,
  652. },
  653. };
  654. static struct clk_rcg2 blsp2_qup2_spi_apps_clk_src = {
  655. .cmd_rcgr = 0x2800c,
  656. .mnd_width = 8,
  657. .hid_width = 5,
  658. .parent_map = gcc_parent_map_0,
  659. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  660. .clkr.hw.init = &(struct clk_init_data){
  661. .name = "blsp2_qup2_spi_apps_clk_src",
  662. .parent_names = gcc_parent_names_0,
  663. .num_parents = 4,
  664. .ops = &clk_rcg2_ops,
  665. },
  666. };
  667. static struct clk_rcg2 blsp2_qup3_i2c_apps_clk_src = {
  668. .cmd_rcgr = 0x2a020,
  669. .mnd_width = 0,
  670. .hid_width = 5,
  671. .parent_map = gcc_parent_map_1,
  672. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  673. .clkr.hw.init = &(struct clk_init_data){
  674. .name = "blsp2_qup3_i2c_apps_clk_src",
  675. .parent_names = gcc_parent_names_1,
  676. .num_parents = 3,
  677. .ops = &clk_rcg2_ops,
  678. },
  679. };
  680. static struct clk_rcg2 blsp2_qup3_spi_apps_clk_src = {
  681. .cmd_rcgr = 0x2a00c,
  682. .mnd_width = 8,
  683. .hid_width = 5,
  684. .parent_map = gcc_parent_map_0,
  685. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  686. .clkr.hw.init = &(struct clk_init_data){
  687. .name = "blsp2_qup3_spi_apps_clk_src",
  688. .parent_names = gcc_parent_names_0,
  689. .num_parents = 4,
  690. .ops = &clk_rcg2_ops,
  691. },
  692. };
  693. static struct clk_rcg2 blsp2_qup4_i2c_apps_clk_src = {
  694. .cmd_rcgr = 0x2c020,
  695. .mnd_width = 0,
  696. .hid_width = 5,
  697. .parent_map = gcc_parent_map_1,
  698. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  699. .clkr.hw.init = &(struct clk_init_data){
  700. .name = "blsp2_qup4_i2c_apps_clk_src",
  701. .parent_names = gcc_parent_names_1,
  702. .num_parents = 3,
  703. .ops = &clk_rcg2_ops,
  704. },
  705. };
  706. static struct clk_rcg2 blsp2_qup4_spi_apps_clk_src = {
  707. .cmd_rcgr = 0x2c00c,
  708. .mnd_width = 8,
  709. .hid_width = 5,
  710. .parent_map = gcc_parent_map_0,
  711. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  712. .clkr.hw.init = &(struct clk_init_data){
  713. .name = "blsp2_qup4_spi_apps_clk_src",
  714. .parent_names = gcc_parent_names_0,
  715. .num_parents = 4,
  716. .ops = &clk_rcg2_ops,
  717. },
  718. };
  719. static struct clk_rcg2 blsp2_qup5_i2c_apps_clk_src = {
  720. .cmd_rcgr = 0x2e020,
  721. .mnd_width = 0,
  722. .hid_width = 5,
  723. .parent_map = gcc_parent_map_1,
  724. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  725. .clkr.hw.init = &(struct clk_init_data){
  726. .name = "blsp2_qup5_i2c_apps_clk_src",
  727. .parent_names = gcc_parent_names_1,
  728. .num_parents = 3,
  729. .ops = &clk_rcg2_ops,
  730. },
  731. };
  732. static struct clk_rcg2 blsp2_qup5_spi_apps_clk_src = {
  733. .cmd_rcgr = 0x2e00c,
  734. .mnd_width = 8,
  735. .hid_width = 5,
  736. .parent_map = gcc_parent_map_0,
  737. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  738. .clkr.hw.init = &(struct clk_init_data){
  739. .name = "blsp2_qup5_spi_apps_clk_src",
  740. .parent_names = gcc_parent_names_0,
  741. .num_parents = 4,
  742. .ops = &clk_rcg2_ops,
  743. },
  744. };
  745. static struct clk_rcg2 blsp2_qup6_i2c_apps_clk_src = {
  746. .cmd_rcgr = 0x30020,
  747. .mnd_width = 0,
  748. .hid_width = 5,
  749. .parent_map = gcc_parent_map_1,
  750. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  751. .clkr.hw.init = &(struct clk_init_data){
  752. .name = "blsp2_qup6_i2c_apps_clk_src",
  753. .parent_names = gcc_parent_names_1,
  754. .num_parents = 3,
  755. .ops = &clk_rcg2_ops,
  756. },
  757. };
  758. static struct clk_rcg2 blsp2_qup6_spi_apps_clk_src = {
  759. .cmd_rcgr = 0x3000c,
  760. .mnd_width = 8,
  761. .hid_width = 5,
  762. .parent_map = gcc_parent_map_0,
  763. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  764. .clkr.hw.init = &(struct clk_init_data){
  765. .name = "blsp2_qup6_spi_apps_clk_src",
  766. .parent_names = gcc_parent_names_0,
  767. .num_parents = 4,
  768. .ops = &clk_rcg2_ops,
  769. },
  770. };
  771. static struct clk_rcg2 blsp2_uart1_apps_clk_src = {
  772. .cmd_rcgr = 0x2700c,
  773. .mnd_width = 16,
  774. .hid_width = 5,
  775. .parent_map = gcc_parent_map_0,
  776. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  777. .clkr.hw.init = &(struct clk_init_data){
  778. .name = "blsp2_uart1_apps_clk_src",
  779. .parent_names = gcc_parent_names_0,
  780. .num_parents = 4,
  781. .ops = &clk_rcg2_ops,
  782. },
  783. };
  784. static struct clk_rcg2 blsp2_uart2_apps_clk_src = {
  785. .cmd_rcgr = 0x2900c,
  786. .mnd_width = 16,
  787. .hid_width = 5,
  788. .parent_map = gcc_parent_map_0,
  789. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  790. .clkr.hw.init = &(struct clk_init_data){
  791. .name = "blsp2_uart2_apps_clk_src",
  792. .parent_names = gcc_parent_names_0,
  793. .num_parents = 4,
  794. .ops = &clk_rcg2_ops,
  795. },
  796. };
  797. static struct clk_rcg2 blsp2_uart3_apps_clk_src = {
  798. .cmd_rcgr = 0x2b00c,
  799. .mnd_width = 16,
  800. .hid_width = 5,
  801. .parent_map = gcc_parent_map_0,
  802. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  803. .clkr.hw.init = &(struct clk_init_data){
  804. .name = "blsp2_uart3_apps_clk_src",
  805. .parent_names = gcc_parent_names_0,
  806. .num_parents = 4,
  807. .ops = &clk_rcg2_ops,
  808. },
  809. };
  810. static const struct freq_tbl ftbl_gp1_clk_src[] = {
  811. F(19200000, P_XO, 1, 0, 0),
  812. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  813. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  814. { }
  815. };
  816. static struct clk_rcg2 gp1_clk_src = {
  817. .cmd_rcgr = 0x64004,
  818. .mnd_width = 8,
  819. .hid_width = 5,
  820. .parent_map = gcc_parent_map_2,
  821. .freq_tbl = ftbl_gp1_clk_src,
  822. .clkr.hw.init = &(struct clk_init_data){
  823. .name = "gp1_clk_src",
  824. .parent_names = gcc_parent_names_2,
  825. .num_parents = 5,
  826. .ops = &clk_rcg2_ops,
  827. },
  828. };
  829. static struct clk_rcg2 gp2_clk_src = {
  830. .cmd_rcgr = 0x65004,
  831. .mnd_width = 8,
  832. .hid_width = 5,
  833. .parent_map = gcc_parent_map_2,
  834. .freq_tbl = ftbl_gp1_clk_src,
  835. .clkr.hw.init = &(struct clk_init_data){
  836. .name = "gp2_clk_src",
  837. .parent_names = gcc_parent_names_2,
  838. .num_parents = 5,
  839. .ops = &clk_rcg2_ops,
  840. },
  841. };
  842. static struct clk_rcg2 gp3_clk_src = {
  843. .cmd_rcgr = 0x66004,
  844. .mnd_width = 8,
  845. .hid_width = 5,
  846. .parent_map = gcc_parent_map_2,
  847. .freq_tbl = ftbl_gp1_clk_src,
  848. .clkr.hw.init = &(struct clk_init_data){
  849. .name = "gp3_clk_src",
  850. .parent_names = gcc_parent_names_2,
  851. .num_parents = 5,
  852. .ops = &clk_rcg2_ops,
  853. },
  854. };
  855. static const struct freq_tbl ftbl_hmss_ahb_clk_src[] = {
  856. F(19200000, P_XO, 1, 0, 0),
  857. F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0),
  858. F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
  859. { }
  860. };
  861. static struct clk_rcg2 hmss_ahb_clk_src = {
  862. .cmd_rcgr = 0x48014,
  863. .mnd_width = 0,
  864. .hid_width = 5,
  865. .parent_map = gcc_parent_map_1,
  866. .freq_tbl = ftbl_hmss_ahb_clk_src,
  867. .clkr.hw.init = &(struct clk_init_data){
  868. .name = "hmss_ahb_clk_src",
  869. .parent_names = gcc_parent_names_1,
  870. .num_parents = 3,
  871. .ops = &clk_rcg2_ops,
  872. },
  873. };
  874. static const struct freq_tbl ftbl_hmss_rbcpr_clk_src[] = {
  875. F(19200000, P_XO, 1, 0, 0),
  876. { }
  877. };
  878. static struct clk_rcg2 hmss_rbcpr_clk_src = {
  879. .cmd_rcgr = 0x48044,
  880. .mnd_width = 0,
  881. .hid_width = 5,
  882. .parent_map = gcc_parent_map_1,
  883. .freq_tbl = ftbl_hmss_rbcpr_clk_src,
  884. .clkr.hw.init = &(struct clk_init_data){
  885. .name = "hmss_rbcpr_clk_src",
  886. .parent_names = gcc_parent_names_1,
  887. .num_parents = 3,
  888. .ops = &clk_rcg2_ops,
  889. },
  890. };
  891. static const struct freq_tbl ftbl_pcie_aux_clk_src[] = {
  892. F(1010526, P_XO, 1, 1, 19),
  893. { }
  894. };
  895. static struct clk_rcg2 pcie_aux_clk_src = {
  896. .cmd_rcgr = 0x6c000,
  897. .mnd_width = 16,
  898. .hid_width = 5,
  899. .parent_map = gcc_parent_map_3,
  900. .freq_tbl = ftbl_pcie_aux_clk_src,
  901. .clkr.hw.init = &(struct clk_init_data){
  902. .name = "pcie_aux_clk_src",
  903. .parent_names = gcc_parent_names_3,
  904. .num_parents = 3,
  905. .ops = &clk_rcg2_ops,
  906. },
  907. };
  908. static const struct freq_tbl ftbl_pdm2_clk_src[] = {
  909. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  910. { }
  911. };
  912. static struct clk_rcg2 pdm2_clk_src = {
  913. .cmd_rcgr = 0x33010,
  914. .mnd_width = 0,
  915. .hid_width = 5,
  916. .parent_map = gcc_parent_map_1,
  917. .freq_tbl = ftbl_pdm2_clk_src,
  918. .clkr.hw.init = &(struct clk_init_data){
  919. .name = "pdm2_clk_src",
  920. .parent_names = gcc_parent_names_1,
  921. .num_parents = 3,
  922. .ops = &clk_rcg2_ops,
  923. },
  924. };
  925. static const struct freq_tbl ftbl_sdcc2_apps_clk_src[] = {
  926. F(144000, P_XO, 16, 3, 25),
  927. F(400000, P_XO, 12, 1, 4),
  928. F(20000000, P_GPLL0_OUT_MAIN, 15, 1, 2),
  929. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  930. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  931. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  932. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  933. { }
  934. };
  935. static struct clk_rcg2 sdcc2_apps_clk_src = {
  936. .cmd_rcgr = 0x14010,
  937. .mnd_width = 8,
  938. .hid_width = 5,
  939. .parent_map = gcc_parent_map_4,
  940. .freq_tbl = ftbl_sdcc2_apps_clk_src,
  941. .clkr.hw.init = &(struct clk_init_data){
  942. .name = "sdcc2_apps_clk_src",
  943. .parent_names = gcc_parent_names_4,
  944. .num_parents = 4,
  945. .ops = &clk_rcg2_ops,
  946. },
  947. };
  948. static const struct freq_tbl ftbl_sdcc4_apps_clk_src[] = {
  949. F(144000, P_XO, 16, 3, 25),
  950. F(400000, P_XO, 12, 1, 4),
  951. F(20000000, P_GPLL0_OUT_MAIN, 15, 1, 2),
  952. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  953. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  954. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  955. { }
  956. };
  957. static struct clk_rcg2 sdcc4_apps_clk_src = {
  958. .cmd_rcgr = 0x16010,
  959. .mnd_width = 8,
  960. .hid_width = 5,
  961. .parent_map = gcc_parent_map_1,
  962. .freq_tbl = ftbl_sdcc4_apps_clk_src,
  963. .clkr.hw.init = &(struct clk_init_data){
  964. .name = "sdcc4_apps_clk_src",
  965. .parent_names = gcc_parent_names_1,
  966. .num_parents = 3,
  967. .ops = &clk_rcg2_ops,
  968. },
  969. };
  970. static const struct freq_tbl ftbl_tsif_ref_clk_src[] = {
  971. F(105495, P_XO, 1, 1, 182),
  972. { }
  973. };
  974. static struct clk_rcg2 tsif_ref_clk_src = {
  975. .cmd_rcgr = 0x36010,
  976. .mnd_width = 8,
  977. .hid_width = 5,
  978. .parent_map = gcc_parent_map_5,
  979. .freq_tbl = ftbl_tsif_ref_clk_src,
  980. .clkr.hw.init = &(struct clk_init_data){
  981. .name = "tsif_ref_clk_src",
  982. .parent_names = gcc_parent_names_5,
  983. .num_parents = 4,
  984. .ops = &clk_rcg2_ops,
  985. },
  986. };
  987. static const struct freq_tbl ftbl_ufs_axi_clk_src[] = {
  988. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  989. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  990. F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
  991. { }
  992. };
  993. static struct clk_rcg2 ufs_axi_clk_src = {
  994. .cmd_rcgr = 0x75018,
  995. .mnd_width = 8,
  996. .hid_width = 5,
  997. .parent_map = gcc_parent_map_0,
  998. .freq_tbl = ftbl_ufs_axi_clk_src,
  999. .clkr.hw.init = &(struct clk_init_data){
  1000. .name = "ufs_axi_clk_src",
  1001. .parent_names = gcc_parent_names_0,
  1002. .num_parents = 4,
  1003. .ops = &clk_rcg2_ops,
  1004. },
  1005. };
  1006. static const struct freq_tbl ftbl_usb30_master_clk_src[] = {
  1007. F(19200000, P_XO, 1, 0, 0),
  1008. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  1009. F(120000000, P_GPLL0_OUT_MAIN, 5, 0, 0),
  1010. F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
  1011. { }
  1012. };
  1013. static struct clk_rcg2 usb30_master_clk_src = {
  1014. .cmd_rcgr = 0xf014,
  1015. .mnd_width = 8,
  1016. .hid_width = 5,
  1017. .parent_map = gcc_parent_map_0,
  1018. .freq_tbl = ftbl_usb30_master_clk_src,
  1019. .clkr.hw.init = &(struct clk_init_data){
  1020. .name = "usb30_master_clk_src",
  1021. .parent_names = gcc_parent_names_0,
  1022. .num_parents = 4,
  1023. .ops = &clk_rcg2_ops,
  1024. },
  1025. };
  1026. static struct clk_rcg2 usb30_mock_utmi_clk_src = {
  1027. .cmd_rcgr = 0xf028,
  1028. .mnd_width = 0,
  1029. .hid_width = 5,
  1030. .parent_map = gcc_parent_map_0,
  1031. .freq_tbl = ftbl_hmss_rbcpr_clk_src,
  1032. .clkr.hw.init = &(struct clk_init_data){
  1033. .name = "usb30_mock_utmi_clk_src",
  1034. .parent_names = gcc_parent_names_0,
  1035. .num_parents = 4,
  1036. .ops = &clk_rcg2_ops,
  1037. },
  1038. };
  1039. static const struct freq_tbl ftbl_usb3_phy_aux_clk_src[] = {
  1040. F(1200000, P_XO, 16, 0, 0),
  1041. { }
  1042. };
  1043. static struct clk_rcg2 usb3_phy_aux_clk_src = {
  1044. .cmd_rcgr = 0x5000c,
  1045. .mnd_width = 0,
  1046. .hid_width = 5,
  1047. .parent_map = gcc_parent_map_3,
  1048. .freq_tbl = ftbl_usb3_phy_aux_clk_src,
  1049. .clkr.hw.init = &(struct clk_init_data){
  1050. .name = "usb3_phy_aux_clk_src",
  1051. .parent_names = gcc_parent_names_3,
  1052. .num_parents = 3,
  1053. .ops = &clk_rcg2_ops,
  1054. },
  1055. };
  1056. static struct clk_branch gcc_aggre1_noc_xo_clk = {
  1057. .halt_reg = 0x8202c,
  1058. .halt_check = BRANCH_HALT,
  1059. .clkr = {
  1060. .enable_reg = 0x8202c,
  1061. .enable_mask = BIT(0),
  1062. .hw.init = &(struct clk_init_data){
  1063. .name = "gcc_aggre1_noc_xo_clk",
  1064. .ops = &clk_branch2_ops,
  1065. },
  1066. },
  1067. };
  1068. static struct clk_branch gcc_aggre1_ufs_axi_clk = {
  1069. .halt_reg = 0x82028,
  1070. .halt_check = BRANCH_HALT,
  1071. .clkr = {
  1072. .enable_reg = 0x82028,
  1073. .enable_mask = BIT(0),
  1074. .hw.init = &(struct clk_init_data){
  1075. .name = "gcc_aggre1_ufs_axi_clk",
  1076. .parent_names = (const char *[]){
  1077. "ufs_axi_clk_src",
  1078. },
  1079. .num_parents = 1,
  1080. .ops = &clk_branch2_ops,
  1081. },
  1082. },
  1083. };
  1084. static struct clk_branch gcc_aggre1_usb3_axi_clk = {
  1085. .halt_reg = 0x82024,
  1086. .halt_check = BRANCH_HALT,
  1087. .clkr = {
  1088. .enable_reg = 0x82024,
  1089. .enable_mask = BIT(0),
  1090. .hw.init = &(struct clk_init_data){
  1091. .name = "gcc_aggre1_usb3_axi_clk",
  1092. .parent_names = (const char *[]){
  1093. "usb30_master_clk_src",
  1094. },
  1095. .num_parents = 1,
  1096. .ops = &clk_branch2_ops,
  1097. },
  1098. },
  1099. };
  1100. static struct clk_branch gcc_apss_qdss_tsctr_div2_clk = {
  1101. .halt_reg = 0x48090,
  1102. .halt_check = BRANCH_HALT,
  1103. .clkr = {
  1104. .enable_reg = 0x48090,
  1105. .enable_mask = BIT(0),
  1106. .hw.init = &(struct clk_init_data){
  1107. .name = "gcc_apss_qdss_tsctr_div2_clk",
  1108. .ops = &clk_branch2_ops,
  1109. },
  1110. },
  1111. };
  1112. static struct clk_branch gcc_apss_qdss_tsctr_div8_clk = {
  1113. .halt_reg = 0x48094,
  1114. .halt_check = BRANCH_HALT,
  1115. .clkr = {
  1116. .enable_reg = 0x48094,
  1117. .enable_mask = BIT(0),
  1118. .hw.init = &(struct clk_init_data){
  1119. .name = "gcc_apss_qdss_tsctr_div8_clk",
  1120. .ops = &clk_branch2_ops,
  1121. },
  1122. },
  1123. };
  1124. static struct clk_branch gcc_bimc_hmss_axi_clk = {
  1125. .halt_reg = 0x48004,
  1126. .halt_check = BRANCH_HALT_VOTED,
  1127. .clkr = {
  1128. .enable_reg = 0x52004,
  1129. .enable_mask = BIT(22),
  1130. .hw.init = &(struct clk_init_data){
  1131. .name = "gcc_bimc_hmss_axi_clk",
  1132. .ops = &clk_branch2_ops,
  1133. },
  1134. },
  1135. };
  1136. static struct clk_branch gcc_bimc_mss_q6_axi_clk = {
  1137. .halt_reg = 0x4401c,
  1138. .halt_check = BRANCH_HALT,
  1139. .clkr = {
  1140. .enable_reg = 0x4401c,
  1141. .enable_mask = BIT(0),
  1142. .hw.init = &(struct clk_init_data){
  1143. .name = "gcc_bimc_mss_q6_axi_clk",
  1144. .ops = &clk_branch2_ops,
  1145. },
  1146. },
  1147. };
  1148. static struct clk_branch gcc_blsp1_ahb_clk = {
  1149. .halt_reg = 0x17004,
  1150. .halt_check = BRANCH_HALT_VOTED,
  1151. .clkr = {
  1152. .enable_reg = 0x52004,
  1153. .enable_mask = BIT(17),
  1154. .hw.init = &(struct clk_init_data){
  1155. .name = "gcc_blsp1_ahb_clk",
  1156. .ops = &clk_branch2_ops,
  1157. },
  1158. },
  1159. };
  1160. static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
  1161. .halt_reg = 0x19008,
  1162. .halt_check = BRANCH_HALT,
  1163. .clkr = {
  1164. .enable_reg = 0x19008,
  1165. .enable_mask = BIT(0),
  1166. .hw.init = &(struct clk_init_data){
  1167. .name = "gcc_blsp1_qup1_i2c_apps_clk",
  1168. .parent_names = (const char *[]){
  1169. "blsp1_qup1_i2c_apps_clk_src",
  1170. },
  1171. .num_parents = 1,
  1172. .ops = &clk_branch2_ops,
  1173. },
  1174. },
  1175. };
  1176. static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
  1177. .halt_reg = 0x19004,
  1178. .halt_check = BRANCH_HALT,
  1179. .clkr = {
  1180. .enable_reg = 0x19004,
  1181. .enable_mask = BIT(0),
  1182. .hw.init = &(struct clk_init_data){
  1183. .name = "gcc_blsp1_qup1_spi_apps_clk",
  1184. .parent_names = (const char *[]){
  1185. "blsp1_qup1_spi_apps_clk_src",
  1186. },
  1187. .num_parents = 1,
  1188. .ops = &clk_branch2_ops,
  1189. },
  1190. },
  1191. };
  1192. static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
  1193. .halt_reg = 0x1b008,
  1194. .halt_check = BRANCH_HALT,
  1195. .clkr = {
  1196. .enable_reg = 0x1b008,
  1197. .enable_mask = BIT(0),
  1198. .hw.init = &(struct clk_init_data){
  1199. .name = "gcc_blsp1_qup2_i2c_apps_clk",
  1200. .parent_names = (const char *[]){
  1201. "blsp1_qup2_i2c_apps_clk_src",
  1202. },
  1203. .num_parents = 1,
  1204. .ops = &clk_branch2_ops,
  1205. },
  1206. },
  1207. };
  1208. static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
  1209. .halt_reg = 0x1b004,
  1210. .halt_check = BRANCH_HALT,
  1211. .clkr = {
  1212. .enable_reg = 0x1b004,
  1213. .enable_mask = BIT(0),
  1214. .hw.init = &(struct clk_init_data){
  1215. .name = "gcc_blsp1_qup2_spi_apps_clk",
  1216. .parent_names = (const char *[]){
  1217. "blsp1_qup2_spi_apps_clk_src",
  1218. },
  1219. .num_parents = 1,
  1220. .ops = &clk_branch2_ops,
  1221. },
  1222. },
  1223. };
  1224. static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
  1225. .halt_reg = 0x1d008,
  1226. .halt_check = BRANCH_HALT,
  1227. .clkr = {
  1228. .enable_reg = 0x1d008,
  1229. .enable_mask = BIT(0),
  1230. .hw.init = &(struct clk_init_data){
  1231. .name = "gcc_blsp1_qup3_i2c_apps_clk",
  1232. .parent_names = (const char *[]){
  1233. "blsp1_qup3_i2c_apps_clk_src",
  1234. },
  1235. .num_parents = 1,
  1236. .ops = &clk_branch2_ops,
  1237. },
  1238. },
  1239. };
  1240. static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = {
  1241. .halt_reg = 0x1d004,
  1242. .halt_check = BRANCH_HALT,
  1243. .clkr = {
  1244. .enable_reg = 0x1d004,
  1245. .enable_mask = BIT(0),
  1246. .hw.init = &(struct clk_init_data){
  1247. .name = "gcc_blsp1_qup3_spi_apps_clk",
  1248. .parent_names = (const char *[]){
  1249. "blsp1_qup3_spi_apps_clk_src",
  1250. },
  1251. .num_parents = 1,
  1252. .ops = &clk_branch2_ops,
  1253. },
  1254. },
  1255. };
  1256. static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
  1257. .halt_reg = 0x1f008,
  1258. .halt_check = BRANCH_HALT,
  1259. .clkr = {
  1260. .enable_reg = 0x1f008,
  1261. .enable_mask = BIT(0),
  1262. .hw.init = &(struct clk_init_data){
  1263. .name = "gcc_blsp1_qup4_i2c_apps_clk",
  1264. .parent_names = (const char *[]){
  1265. "blsp1_qup4_i2c_apps_clk_src",
  1266. },
  1267. .num_parents = 1,
  1268. .ops = &clk_branch2_ops,
  1269. },
  1270. },
  1271. };
  1272. static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
  1273. .halt_reg = 0x1f004,
  1274. .halt_check = BRANCH_HALT,
  1275. .clkr = {
  1276. .enable_reg = 0x1f004,
  1277. .enable_mask = BIT(0),
  1278. .hw.init = &(struct clk_init_data){
  1279. .name = "gcc_blsp1_qup4_spi_apps_clk",
  1280. .parent_names = (const char *[]){
  1281. "blsp1_qup4_spi_apps_clk_src",
  1282. },
  1283. .num_parents = 1,
  1284. .ops = &clk_branch2_ops,
  1285. },
  1286. },
  1287. };
  1288. static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
  1289. .halt_reg = 0x21008,
  1290. .halt_check = BRANCH_HALT,
  1291. .clkr = {
  1292. .enable_reg = 0x21008,
  1293. .enable_mask = BIT(0),
  1294. .hw.init = &(struct clk_init_data){
  1295. .name = "gcc_blsp1_qup5_i2c_apps_clk",
  1296. .parent_names = (const char *[]){
  1297. "blsp1_qup5_i2c_apps_clk_src",
  1298. },
  1299. .num_parents = 1,
  1300. .ops = &clk_branch2_ops,
  1301. },
  1302. },
  1303. };
  1304. static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
  1305. .halt_reg = 0x21004,
  1306. .halt_check = BRANCH_HALT,
  1307. .clkr = {
  1308. .enable_reg = 0x21004,
  1309. .enable_mask = BIT(0),
  1310. .hw.init = &(struct clk_init_data){
  1311. .name = "gcc_blsp1_qup5_spi_apps_clk",
  1312. .parent_names = (const char *[]){
  1313. "blsp1_qup5_spi_apps_clk_src",
  1314. },
  1315. .num_parents = 1,
  1316. .ops = &clk_branch2_ops,
  1317. },
  1318. },
  1319. };
  1320. static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
  1321. .halt_reg = 0x23008,
  1322. .halt_check = BRANCH_HALT,
  1323. .clkr = {
  1324. .enable_reg = 0x23008,
  1325. .enable_mask = BIT(0),
  1326. .hw.init = &(struct clk_init_data){
  1327. .name = "gcc_blsp1_qup6_i2c_apps_clk",
  1328. .parent_names = (const char *[]){
  1329. "blsp1_qup6_i2c_apps_clk_src",
  1330. },
  1331. .num_parents = 1,
  1332. .ops = &clk_branch2_ops,
  1333. },
  1334. },
  1335. };
  1336. static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
  1337. .halt_reg = 0x23004,
  1338. .halt_check = BRANCH_HALT,
  1339. .clkr = {
  1340. .enable_reg = 0x23004,
  1341. .enable_mask = BIT(0),
  1342. .hw.init = &(struct clk_init_data){
  1343. .name = "gcc_blsp1_qup6_spi_apps_clk",
  1344. .parent_names = (const char *[]){
  1345. "blsp1_qup6_spi_apps_clk_src",
  1346. },
  1347. .num_parents = 1,
  1348. .ops = &clk_branch2_ops,
  1349. },
  1350. },
  1351. };
  1352. static struct clk_branch gcc_blsp1_sleep_clk = {
  1353. .halt_reg = 0x17008,
  1354. .halt_check = BRANCH_HALT_VOTED,
  1355. .clkr = {
  1356. .enable_reg = 0x52004,
  1357. .enable_mask = BIT(16),
  1358. .hw.init = &(struct clk_init_data){
  1359. .name = "gcc_blsp1_sleep_clk",
  1360. .ops = &clk_branch2_ops,
  1361. },
  1362. },
  1363. };
  1364. static struct clk_branch gcc_blsp1_uart1_apps_clk = {
  1365. .halt_reg = 0x1a004,
  1366. .halt_check = BRANCH_HALT,
  1367. .clkr = {
  1368. .enable_reg = 0x1a004,
  1369. .enable_mask = BIT(0),
  1370. .hw.init = &(struct clk_init_data){
  1371. .name = "gcc_blsp1_uart1_apps_clk",
  1372. .parent_names = (const char *[]){
  1373. "blsp1_uart1_apps_clk_src",
  1374. },
  1375. .num_parents = 1,
  1376. .ops = &clk_branch2_ops,
  1377. },
  1378. },
  1379. };
  1380. static struct clk_branch gcc_blsp1_uart2_apps_clk = {
  1381. .halt_reg = 0x1c004,
  1382. .halt_check = BRANCH_HALT,
  1383. .clkr = {
  1384. .enable_reg = 0x1c004,
  1385. .enable_mask = BIT(0),
  1386. .hw.init = &(struct clk_init_data){
  1387. .name = "gcc_blsp1_uart2_apps_clk",
  1388. .parent_names = (const char *[]){
  1389. "blsp1_uart2_apps_clk_src",
  1390. },
  1391. .num_parents = 1,
  1392. .ops = &clk_branch2_ops,
  1393. },
  1394. },
  1395. };
  1396. static struct clk_branch gcc_blsp1_uart3_apps_clk = {
  1397. .halt_reg = 0x1e004,
  1398. .halt_check = BRANCH_HALT,
  1399. .clkr = {
  1400. .enable_reg = 0x1e004,
  1401. .enable_mask = BIT(0),
  1402. .hw.init = &(struct clk_init_data){
  1403. .name = "gcc_blsp1_uart3_apps_clk",
  1404. .parent_names = (const char *[]){
  1405. "blsp1_uart3_apps_clk_src",
  1406. },
  1407. .num_parents = 1,
  1408. .ops = &clk_branch2_ops,
  1409. },
  1410. },
  1411. };
  1412. static struct clk_branch gcc_blsp2_ahb_clk = {
  1413. .halt_reg = 0x25004,
  1414. .halt_check = BRANCH_HALT_VOTED,
  1415. .clkr = {
  1416. .enable_reg = 0x52004,
  1417. .enable_mask = BIT(15),
  1418. .hw.init = &(struct clk_init_data){
  1419. .name = "gcc_blsp2_ahb_clk",
  1420. .ops = &clk_branch2_ops,
  1421. },
  1422. },
  1423. };
  1424. static struct clk_branch gcc_blsp2_qup1_i2c_apps_clk = {
  1425. .halt_reg = 0x26008,
  1426. .halt_check = BRANCH_HALT,
  1427. .clkr = {
  1428. .enable_reg = 0x26008,
  1429. .enable_mask = BIT(0),
  1430. .hw.init = &(struct clk_init_data){
  1431. .name = "gcc_blsp2_qup1_i2c_apps_clk",
  1432. .parent_names = (const char *[]){
  1433. "blsp2_qup1_i2c_apps_clk_src",
  1434. },
  1435. .num_parents = 1,
  1436. .ops = &clk_branch2_ops,
  1437. },
  1438. },
  1439. };
  1440. static struct clk_branch gcc_blsp2_qup1_spi_apps_clk = {
  1441. .halt_reg = 0x26004,
  1442. .halt_check = BRANCH_HALT,
  1443. .clkr = {
  1444. .enable_reg = 0x26004,
  1445. .enable_mask = BIT(0),
  1446. .hw.init = &(struct clk_init_data){
  1447. .name = "gcc_blsp2_qup1_spi_apps_clk",
  1448. .parent_names = (const char *[]){
  1449. "blsp2_qup1_spi_apps_clk_src",
  1450. },
  1451. .num_parents = 1,
  1452. .ops = &clk_branch2_ops,
  1453. },
  1454. },
  1455. };
  1456. static struct clk_branch gcc_blsp2_qup2_i2c_apps_clk = {
  1457. .halt_reg = 0x28008,
  1458. .halt_check = BRANCH_HALT,
  1459. .clkr = {
  1460. .enable_reg = 0x28008,
  1461. .enable_mask = BIT(0),
  1462. .hw.init = &(struct clk_init_data){
  1463. .name = "gcc_blsp2_qup2_i2c_apps_clk",
  1464. .parent_names = (const char *[]){
  1465. "blsp2_qup2_i2c_apps_clk_src",
  1466. },
  1467. .num_parents = 1,
  1468. .ops = &clk_branch2_ops,
  1469. },
  1470. },
  1471. };
  1472. static struct clk_branch gcc_blsp2_qup2_spi_apps_clk = {
  1473. .halt_reg = 0x28004,
  1474. .halt_check = BRANCH_HALT,
  1475. .clkr = {
  1476. .enable_reg = 0x28004,
  1477. .enable_mask = BIT(0),
  1478. .hw.init = &(struct clk_init_data){
  1479. .name = "gcc_blsp2_qup2_spi_apps_clk",
  1480. .parent_names = (const char *[]){
  1481. "blsp2_qup2_spi_apps_clk_src",
  1482. },
  1483. .num_parents = 1,
  1484. .ops = &clk_branch2_ops,
  1485. },
  1486. },
  1487. };
  1488. static struct clk_branch gcc_blsp2_qup3_i2c_apps_clk = {
  1489. .halt_reg = 0x2a008,
  1490. .halt_check = BRANCH_HALT,
  1491. .clkr = {
  1492. .enable_reg = 0x2a008,
  1493. .enable_mask = BIT(0),
  1494. .hw.init = &(struct clk_init_data){
  1495. .name = "gcc_blsp2_qup3_i2c_apps_clk",
  1496. .parent_names = (const char *[]){
  1497. "blsp2_qup3_i2c_apps_clk_src",
  1498. },
  1499. .num_parents = 1,
  1500. .ops = &clk_branch2_ops,
  1501. },
  1502. },
  1503. };
  1504. static struct clk_branch gcc_blsp2_qup3_spi_apps_clk = {
  1505. .halt_reg = 0x2a004,
  1506. .halt_check = BRANCH_HALT,
  1507. .clkr = {
  1508. .enable_reg = 0x2a004,
  1509. .enable_mask = BIT(0),
  1510. .hw.init = &(struct clk_init_data){
  1511. .name = "gcc_blsp2_qup3_spi_apps_clk",
  1512. .parent_names = (const char *[]){
  1513. "blsp2_qup3_spi_apps_clk_src",
  1514. },
  1515. .num_parents = 1,
  1516. .ops = &clk_branch2_ops,
  1517. },
  1518. },
  1519. };
  1520. static struct clk_branch gcc_blsp2_qup4_i2c_apps_clk = {
  1521. .halt_reg = 0x2c008,
  1522. .halt_check = BRANCH_HALT,
  1523. .clkr = {
  1524. .enable_reg = 0x2c008,
  1525. .enable_mask = BIT(0),
  1526. .hw.init = &(struct clk_init_data){
  1527. .name = "gcc_blsp2_qup4_i2c_apps_clk",
  1528. .parent_names = (const char *[]){
  1529. "blsp2_qup4_i2c_apps_clk_src",
  1530. },
  1531. .num_parents = 1,
  1532. .ops = &clk_branch2_ops,
  1533. },
  1534. },
  1535. };
  1536. static struct clk_branch gcc_blsp2_qup4_spi_apps_clk = {
  1537. .halt_reg = 0x2c004,
  1538. .halt_check = BRANCH_HALT,
  1539. .clkr = {
  1540. .enable_reg = 0x2c004,
  1541. .enable_mask = BIT(0),
  1542. .hw.init = &(struct clk_init_data){
  1543. .name = "gcc_blsp2_qup4_spi_apps_clk",
  1544. .parent_names = (const char *[]){
  1545. "blsp2_qup4_spi_apps_clk_src",
  1546. },
  1547. .num_parents = 1,
  1548. .ops = &clk_branch2_ops,
  1549. },
  1550. },
  1551. };
  1552. static struct clk_branch gcc_blsp2_qup5_i2c_apps_clk = {
  1553. .halt_reg = 0x2e008,
  1554. .halt_check = BRANCH_HALT,
  1555. .clkr = {
  1556. .enable_reg = 0x2e008,
  1557. .enable_mask = BIT(0),
  1558. .hw.init = &(struct clk_init_data){
  1559. .name = "gcc_blsp2_qup5_i2c_apps_clk",
  1560. .parent_names = (const char *[]){
  1561. "blsp2_qup5_i2c_apps_clk_src",
  1562. },
  1563. .num_parents = 1,
  1564. .ops = &clk_branch2_ops,
  1565. },
  1566. },
  1567. };
  1568. static struct clk_branch gcc_blsp2_qup5_spi_apps_clk = {
  1569. .halt_reg = 0x2e004,
  1570. .halt_check = BRANCH_HALT,
  1571. .clkr = {
  1572. .enable_reg = 0x2e004,
  1573. .enable_mask = BIT(0),
  1574. .hw.init = &(struct clk_init_data){
  1575. .name = "gcc_blsp2_qup5_spi_apps_clk",
  1576. .parent_names = (const char *[]){
  1577. "blsp2_qup5_spi_apps_clk_src",
  1578. },
  1579. .num_parents = 1,
  1580. .ops = &clk_branch2_ops,
  1581. },
  1582. },
  1583. };
  1584. static struct clk_branch gcc_blsp2_qup6_i2c_apps_clk = {
  1585. .halt_reg = 0x30008,
  1586. .halt_check = BRANCH_HALT,
  1587. .clkr = {
  1588. .enable_reg = 0x30008,
  1589. .enable_mask = BIT(0),
  1590. .hw.init = &(struct clk_init_data){
  1591. .name = "gcc_blsp2_qup6_i2c_apps_clk",
  1592. .parent_names = (const char *[]){
  1593. "blsp2_qup6_i2c_apps_clk_src",
  1594. },
  1595. .num_parents = 1,
  1596. .ops = &clk_branch2_ops,
  1597. },
  1598. },
  1599. };
  1600. static struct clk_branch gcc_blsp2_qup6_spi_apps_clk = {
  1601. .halt_reg = 0x30004,
  1602. .halt_check = BRANCH_HALT,
  1603. .clkr = {
  1604. .enable_reg = 0x30004,
  1605. .enable_mask = BIT(0),
  1606. .hw.init = &(struct clk_init_data){
  1607. .name = "gcc_blsp2_qup6_spi_apps_clk",
  1608. .parent_names = (const char *[]){
  1609. "blsp2_qup6_spi_apps_clk_src",
  1610. },
  1611. .num_parents = 1,
  1612. .ops = &clk_branch2_ops,
  1613. },
  1614. },
  1615. };
  1616. static struct clk_branch gcc_blsp2_sleep_clk = {
  1617. .halt_reg = 0x25008,
  1618. .halt_check = BRANCH_HALT_VOTED,
  1619. .clkr = {
  1620. .enable_reg = 0x52004,
  1621. .enable_mask = BIT(14),
  1622. .hw.init = &(struct clk_init_data){
  1623. .name = "gcc_blsp2_sleep_clk",
  1624. .ops = &clk_branch2_ops,
  1625. },
  1626. },
  1627. };
  1628. static struct clk_branch gcc_blsp2_uart1_apps_clk = {
  1629. .halt_reg = 0x27004,
  1630. .halt_check = BRANCH_HALT,
  1631. .clkr = {
  1632. .enable_reg = 0x27004,
  1633. .enable_mask = BIT(0),
  1634. .hw.init = &(struct clk_init_data){
  1635. .name = "gcc_blsp2_uart1_apps_clk",
  1636. .parent_names = (const char *[]){
  1637. "blsp2_uart1_apps_clk_src",
  1638. },
  1639. .num_parents = 1,
  1640. .ops = &clk_branch2_ops,
  1641. },
  1642. },
  1643. };
  1644. static struct clk_branch gcc_blsp2_uart2_apps_clk = {
  1645. .halt_reg = 0x29004,
  1646. .halt_check = BRANCH_HALT,
  1647. .clkr = {
  1648. .enable_reg = 0x29004,
  1649. .enable_mask = BIT(0),
  1650. .hw.init = &(struct clk_init_data){
  1651. .name = "gcc_blsp2_uart2_apps_clk",
  1652. .parent_names = (const char *[]){
  1653. "blsp2_uart2_apps_clk_src",
  1654. },
  1655. .num_parents = 1,
  1656. .ops = &clk_branch2_ops,
  1657. },
  1658. },
  1659. };
  1660. static struct clk_branch gcc_blsp2_uart3_apps_clk = {
  1661. .halt_reg = 0x2b004,
  1662. .halt_check = BRANCH_HALT,
  1663. .clkr = {
  1664. .enable_reg = 0x2b004,
  1665. .enable_mask = BIT(0),
  1666. .hw.init = &(struct clk_init_data){
  1667. .name = "gcc_blsp2_uart3_apps_clk",
  1668. .parent_names = (const char *[]){
  1669. "blsp2_uart3_apps_clk_src",
  1670. },
  1671. .num_parents = 1,
  1672. .ops = &clk_branch2_ops,
  1673. },
  1674. },
  1675. };
  1676. static struct clk_branch gcc_cfg_noc_usb3_axi_clk = {
  1677. .halt_reg = 0x5018,
  1678. .halt_check = BRANCH_HALT,
  1679. .clkr = {
  1680. .enable_reg = 0x5018,
  1681. .enable_mask = BIT(0),
  1682. .hw.init = &(struct clk_init_data){
  1683. .name = "gcc_cfg_noc_usb3_axi_clk",
  1684. .parent_names = (const char *[]){
  1685. "usb30_master_clk_src",
  1686. },
  1687. .num_parents = 1,
  1688. .ops = &clk_branch2_ops,
  1689. },
  1690. },
  1691. };
  1692. static struct clk_branch gcc_gp1_clk = {
  1693. .halt_reg = 0x64000,
  1694. .halt_check = BRANCH_HALT,
  1695. .clkr = {
  1696. .enable_reg = 0x64000,
  1697. .enable_mask = BIT(0),
  1698. .hw.init = &(struct clk_init_data){
  1699. .name = "gcc_gp1_clk",
  1700. .parent_names = (const char *[]){
  1701. "gp1_clk_src",
  1702. },
  1703. .num_parents = 1,
  1704. .ops = &clk_branch2_ops,
  1705. },
  1706. },
  1707. };
  1708. static struct clk_branch gcc_gp2_clk = {
  1709. .halt_reg = 0x65000,
  1710. .halt_check = BRANCH_HALT,
  1711. .clkr = {
  1712. .enable_reg = 0x65000,
  1713. .enable_mask = BIT(0),
  1714. .hw.init = &(struct clk_init_data){
  1715. .name = "gcc_gp2_clk",
  1716. .parent_names = (const char *[]){
  1717. "gp2_clk_src",
  1718. },
  1719. .num_parents = 1,
  1720. .ops = &clk_branch2_ops,
  1721. },
  1722. },
  1723. };
  1724. static struct clk_branch gcc_gp3_clk = {
  1725. .halt_reg = 0x66000,
  1726. .halt_check = BRANCH_HALT,
  1727. .clkr = {
  1728. .enable_reg = 0x66000,
  1729. .enable_mask = BIT(0),
  1730. .hw.init = &(struct clk_init_data){
  1731. .name = "gcc_gp3_clk",
  1732. .parent_names = (const char *[]){
  1733. "gp3_clk_src",
  1734. },
  1735. .num_parents = 1,
  1736. .ops = &clk_branch2_ops,
  1737. },
  1738. },
  1739. };
  1740. static struct clk_branch gcc_gpu_bimc_gfx_clk = {
  1741. .halt_reg = 0x71010,
  1742. .halt_check = BRANCH_HALT,
  1743. .clkr = {
  1744. .enable_reg = 0x71010,
  1745. .enable_mask = BIT(0),
  1746. .hw.init = &(struct clk_init_data){
  1747. .name = "gcc_gpu_bimc_gfx_clk",
  1748. .ops = &clk_branch2_ops,
  1749. },
  1750. },
  1751. };
  1752. static struct clk_branch gcc_gpu_bimc_gfx_src_clk = {
  1753. .halt_reg = 0x7100c,
  1754. .halt_check = BRANCH_HALT,
  1755. .clkr = {
  1756. .enable_reg = 0x7100c,
  1757. .enable_mask = BIT(0),
  1758. .hw.init = &(struct clk_init_data){
  1759. .name = "gcc_gpu_bimc_gfx_src_clk",
  1760. .ops = &clk_branch2_ops,
  1761. },
  1762. },
  1763. };
  1764. static struct clk_branch gcc_gpu_cfg_ahb_clk = {
  1765. .halt_reg = 0x71004,
  1766. .halt_check = BRANCH_HALT,
  1767. .clkr = {
  1768. .enable_reg = 0x71004,
  1769. .enable_mask = BIT(0),
  1770. .hw.init = &(struct clk_init_data){
  1771. .name = "gcc_gpu_cfg_ahb_clk",
  1772. .ops = &clk_branch2_ops,
  1773. },
  1774. },
  1775. };
  1776. static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = {
  1777. .halt_reg = 0x71018,
  1778. .halt_check = BRANCH_HALT,
  1779. .clkr = {
  1780. .enable_reg = 0x71018,
  1781. .enable_mask = BIT(0),
  1782. .hw.init = &(struct clk_init_data){
  1783. .name = "gcc_gpu_snoc_dvm_gfx_clk",
  1784. .ops = &clk_branch2_ops,
  1785. },
  1786. },
  1787. };
  1788. static struct clk_branch gcc_hmss_ahb_clk = {
  1789. .halt_reg = 0x48000,
  1790. .halt_check = BRANCH_HALT_VOTED,
  1791. .clkr = {
  1792. .enable_reg = 0x52004,
  1793. .enable_mask = BIT(21),
  1794. .hw.init = &(struct clk_init_data){
  1795. .name = "gcc_hmss_ahb_clk",
  1796. .parent_names = (const char *[]){
  1797. "hmss_ahb_clk_src",
  1798. },
  1799. .num_parents = 1,
  1800. .ops = &clk_branch2_ops,
  1801. },
  1802. },
  1803. };
  1804. static struct clk_branch gcc_hmss_at_clk = {
  1805. .halt_reg = 0x48010,
  1806. .halt_check = BRANCH_HALT,
  1807. .clkr = {
  1808. .enable_reg = 0x48010,
  1809. .enable_mask = BIT(0),
  1810. .hw.init = &(struct clk_init_data){
  1811. .name = "gcc_hmss_at_clk",
  1812. .ops = &clk_branch2_ops,
  1813. },
  1814. },
  1815. };
  1816. static struct clk_branch gcc_hmss_dvm_bus_clk = {
  1817. .halt_reg = 0x4808c,
  1818. .halt_check = BRANCH_HALT,
  1819. .clkr = {
  1820. .enable_reg = 0x4808c,
  1821. .enable_mask = BIT(0),
  1822. .hw.init = &(struct clk_init_data){
  1823. .name = "gcc_hmss_dvm_bus_clk",
  1824. .ops = &clk_branch2_ops,
  1825. },
  1826. },
  1827. };
  1828. static struct clk_branch gcc_hmss_rbcpr_clk = {
  1829. .halt_reg = 0x48008,
  1830. .halt_check = BRANCH_HALT,
  1831. .clkr = {
  1832. .enable_reg = 0x48008,
  1833. .enable_mask = BIT(0),
  1834. .hw.init = &(struct clk_init_data){
  1835. .name = "gcc_hmss_rbcpr_clk",
  1836. .parent_names = (const char *[]){
  1837. "hmss_rbcpr_clk_src",
  1838. },
  1839. .num_parents = 1,
  1840. .ops = &clk_branch2_ops,
  1841. },
  1842. },
  1843. };
  1844. static struct clk_branch gcc_hmss_trig_clk = {
  1845. .halt_reg = 0x4800c,
  1846. .halt_check = BRANCH_HALT,
  1847. .clkr = {
  1848. .enable_reg = 0x4800c,
  1849. .enable_mask = BIT(0),
  1850. .hw.init = &(struct clk_init_data){
  1851. .name = "gcc_hmss_trig_clk",
  1852. .ops = &clk_branch2_ops,
  1853. },
  1854. },
  1855. };
  1856. static struct clk_branch gcc_lpass_at_clk = {
  1857. .halt_reg = 0x47020,
  1858. .halt_check = BRANCH_HALT,
  1859. .clkr = {
  1860. .enable_reg = 0x47020,
  1861. .enable_mask = BIT(0),
  1862. .hw.init = &(struct clk_init_data){
  1863. .name = "gcc_lpass_at_clk",
  1864. .ops = &clk_branch2_ops,
  1865. },
  1866. },
  1867. };
  1868. static struct clk_branch gcc_lpass_trig_clk = {
  1869. .halt_reg = 0x4701c,
  1870. .halt_check = BRANCH_HALT,
  1871. .clkr = {
  1872. .enable_reg = 0x4701c,
  1873. .enable_mask = BIT(0),
  1874. .hw.init = &(struct clk_init_data){
  1875. .name = "gcc_lpass_trig_clk",
  1876. .ops = &clk_branch2_ops,
  1877. },
  1878. },
  1879. };
  1880. static struct clk_branch gcc_mmss_noc_cfg_ahb_clk = {
  1881. .halt_reg = 0x9004,
  1882. .halt_check = BRANCH_HALT,
  1883. .clkr = {
  1884. .enable_reg = 0x9004,
  1885. .enable_mask = BIT(0),
  1886. .hw.init = &(struct clk_init_data){
  1887. .name = "gcc_mmss_noc_cfg_ahb_clk",
  1888. .ops = &clk_branch2_ops,
  1889. },
  1890. },
  1891. };
  1892. static struct clk_branch gcc_mmss_qm_ahb_clk = {
  1893. .halt_reg = 0x9030,
  1894. .halt_check = BRANCH_HALT,
  1895. .clkr = {
  1896. .enable_reg = 0x9030,
  1897. .enable_mask = BIT(0),
  1898. .hw.init = &(struct clk_init_data){
  1899. .name = "gcc_mmss_qm_ahb_clk",
  1900. .ops = &clk_branch2_ops,
  1901. },
  1902. },
  1903. };
  1904. static struct clk_branch gcc_mmss_qm_core_clk = {
  1905. .halt_reg = 0x900c,
  1906. .halt_check = BRANCH_HALT,
  1907. .clkr = {
  1908. .enable_reg = 0x900c,
  1909. .enable_mask = BIT(0),
  1910. .hw.init = &(struct clk_init_data){
  1911. .name = "gcc_mmss_qm_core_clk",
  1912. .ops = &clk_branch2_ops,
  1913. },
  1914. },
  1915. };
  1916. static struct clk_branch gcc_mmss_sys_noc_axi_clk = {
  1917. .halt_reg = 0x9000,
  1918. .halt_check = BRANCH_HALT,
  1919. .clkr = {
  1920. .enable_reg = 0x9000,
  1921. .enable_mask = BIT(0),
  1922. .hw.init = &(struct clk_init_data){
  1923. .name = "gcc_mmss_sys_noc_axi_clk",
  1924. .ops = &clk_branch2_ops,
  1925. },
  1926. },
  1927. };
  1928. static struct clk_branch gcc_mss_at_clk = {
  1929. .halt_reg = 0x8a00c,
  1930. .halt_check = BRANCH_HALT,
  1931. .clkr = {
  1932. .enable_reg = 0x8a00c,
  1933. .enable_mask = BIT(0),
  1934. .hw.init = &(struct clk_init_data){
  1935. .name = "gcc_mss_at_clk",
  1936. .ops = &clk_branch2_ops,
  1937. },
  1938. },
  1939. };
  1940. static struct clk_branch gcc_pcie_0_aux_clk = {
  1941. .halt_reg = 0x6b014,
  1942. .halt_check = BRANCH_HALT,
  1943. .clkr = {
  1944. .enable_reg = 0x6b014,
  1945. .enable_mask = BIT(0),
  1946. .hw.init = &(struct clk_init_data){
  1947. .name = "gcc_pcie_0_aux_clk",
  1948. .parent_names = (const char *[]){
  1949. "pcie_aux_clk_src",
  1950. },
  1951. .num_parents = 1,
  1952. .ops = &clk_branch2_ops,
  1953. },
  1954. },
  1955. };
  1956. static struct clk_branch gcc_pcie_0_cfg_ahb_clk = {
  1957. .halt_reg = 0x6b010,
  1958. .halt_check = BRANCH_HALT,
  1959. .clkr = {
  1960. .enable_reg = 0x6b010,
  1961. .enable_mask = BIT(0),
  1962. .hw.init = &(struct clk_init_data){
  1963. .name = "gcc_pcie_0_cfg_ahb_clk",
  1964. .ops = &clk_branch2_ops,
  1965. },
  1966. },
  1967. };
  1968. static struct clk_branch gcc_pcie_0_mstr_axi_clk = {
  1969. .halt_reg = 0x6b00c,
  1970. .halt_check = BRANCH_HALT,
  1971. .clkr = {
  1972. .enable_reg = 0x6b00c,
  1973. .enable_mask = BIT(0),
  1974. .hw.init = &(struct clk_init_data){
  1975. .name = "gcc_pcie_0_mstr_axi_clk",
  1976. .ops = &clk_branch2_ops,
  1977. },
  1978. },
  1979. };
  1980. static struct clk_branch gcc_pcie_0_pipe_clk = {
  1981. .halt_reg = 0x6b018,
  1982. .halt_check = BRANCH_HALT_SKIP,
  1983. .clkr = {
  1984. .enable_reg = 0x6b018,
  1985. .enable_mask = BIT(0),
  1986. .hw.init = &(struct clk_init_data){
  1987. .name = "gcc_pcie_0_pipe_clk",
  1988. .ops = &clk_branch2_ops,
  1989. },
  1990. },
  1991. };
  1992. static struct clk_branch gcc_pcie_0_slv_axi_clk = {
  1993. .halt_reg = 0x6b008,
  1994. .halt_check = BRANCH_HALT,
  1995. .clkr = {
  1996. .enable_reg = 0x6b008,
  1997. .enable_mask = BIT(0),
  1998. .hw.init = &(struct clk_init_data){
  1999. .name = "gcc_pcie_0_slv_axi_clk",
  2000. .ops = &clk_branch2_ops,
  2001. },
  2002. },
  2003. };
  2004. static struct clk_branch gcc_pcie_phy_aux_clk = {
  2005. .halt_reg = 0x6f004,
  2006. .halt_check = BRANCH_HALT,
  2007. .clkr = {
  2008. .enable_reg = 0x6f004,
  2009. .enable_mask = BIT(0),
  2010. .hw.init = &(struct clk_init_data){
  2011. .name = "gcc_pcie_phy_aux_clk",
  2012. .parent_names = (const char *[]){
  2013. "pcie_aux_clk_src",
  2014. },
  2015. .num_parents = 1,
  2016. .ops = &clk_branch2_ops,
  2017. },
  2018. },
  2019. };
  2020. static struct clk_branch gcc_pdm2_clk = {
  2021. .halt_reg = 0x3300c,
  2022. .halt_check = BRANCH_HALT,
  2023. .clkr = {
  2024. .enable_reg = 0x3300c,
  2025. .enable_mask = BIT(0),
  2026. .hw.init = &(struct clk_init_data){
  2027. .name = "gcc_pdm2_clk",
  2028. .parent_names = (const char *[]){
  2029. "pdm2_clk_src",
  2030. },
  2031. .num_parents = 1,
  2032. .ops = &clk_branch2_ops,
  2033. },
  2034. },
  2035. };
  2036. static struct clk_branch gcc_pdm_ahb_clk = {
  2037. .halt_reg = 0x33004,
  2038. .halt_check = BRANCH_HALT,
  2039. .clkr = {
  2040. .enable_reg = 0x33004,
  2041. .enable_mask = BIT(0),
  2042. .hw.init = &(struct clk_init_data){
  2043. .name = "gcc_pdm_ahb_clk",
  2044. .ops = &clk_branch2_ops,
  2045. },
  2046. },
  2047. };
  2048. static struct clk_branch gcc_pdm_xo4_clk = {
  2049. .halt_reg = 0x33008,
  2050. .halt_check = BRANCH_HALT,
  2051. .clkr = {
  2052. .enable_reg = 0x33008,
  2053. .enable_mask = BIT(0),
  2054. .hw.init = &(struct clk_init_data){
  2055. .name = "gcc_pdm_xo4_clk",
  2056. .ops = &clk_branch2_ops,
  2057. },
  2058. },
  2059. };
  2060. static struct clk_branch gcc_prng_ahb_clk = {
  2061. .halt_reg = 0x34004,
  2062. .halt_check = BRANCH_HALT_VOTED,
  2063. .clkr = {
  2064. .enable_reg = 0x52004,
  2065. .enable_mask = BIT(13),
  2066. .hw.init = &(struct clk_init_data){
  2067. .name = "gcc_prng_ahb_clk",
  2068. .ops = &clk_branch2_ops,
  2069. },
  2070. },
  2071. };
  2072. static struct clk_branch gcc_sdcc2_ahb_clk = {
  2073. .halt_reg = 0x14008,
  2074. .halt_check = BRANCH_HALT,
  2075. .clkr = {
  2076. .enable_reg = 0x14008,
  2077. .enable_mask = BIT(0),
  2078. .hw.init = &(struct clk_init_data){
  2079. .name = "gcc_sdcc2_ahb_clk",
  2080. .ops = &clk_branch2_ops,
  2081. },
  2082. },
  2083. };
  2084. static struct clk_branch gcc_sdcc2_apps_clk = {
  2085. .halt_reg = 0x14004,
  2086. .halt_check = BRANCH_HALT,
  2087. .clkr = {
  2088. .enable_reg = 0x14004,
  2089. .enable_mask = BIT(0),
  2090. .hw.init = &(struct clk_init_data){
  2091. .name = "gcc_sdcc2_apps_clk",
  2092. .parent_names = (const char *[]){
  2093. "sdcc2_apps_clk_src",
  2094. },
  2095. .num_parents = 1,
  2096. .ops = &clk_branch2_ops,
  2097. },
  2098. },
  2099. };
  2100. static struct clk_branch gcc_sdcc4_ahb_clk = {
  2101. .halt_reg = 0x16008,
  2102. .halt_check = BRANCH_HALT,
  2103. .clkr = {
  2104. .enable_reg = 0x16008,
  2105. .enable_mask = BIT(0),
  2106. .hw.init = &(struct clk_init_data){
  2107. .name = "gcc_sdcc4_ahb_clk",
  2108. .ops = &clk_branch2_ops,
  2109. },
  2110. },
  2111. };
  2112. static struct clk_branch gcc_sdcc4_apps_clk = {
  2113. .halt_reg = 0x16004,
  2114. .halt_check = BRANCH_HALT,
  2115. .clkr = {
  2116. .enable_reg = 0x16004,
  2117. .enable_mask = BIT(0),
  2118. .hw.init = &(struct clk_init_data){
  2119. .name = "gcc_sdcc4_apps_clk",
  2120. .parent_names = (const char *[]){
  2121. "sdcc4_apps_clk_src",
  2122. },
  2123. .num_parents = 1,
  2124. .ops = &clk_branch2_ops,
  2125. },
  2126. },
  2127. };
  2128. static struct clk_branch gcc_tsif_ahb_clk = {
  2129. .halt_reg = 0x36004,
  2130. .halt_check = BRANCH_HALT,
  2131. .clkr = {
  2132. .enable_reg = 0x36004,
  2133. .enable_mask = BIT(0),
  2134. .hw.init = &(struct clk_init_data){
  2135. .name = "gcc_tsif_ahb_clk",
  2136. .ops = &clk_branch2_ops,
  2137. },
  2138. },
  2139. };
  2140. static struct clk_branch gcc_tsif_inactivity_timers_clk = {
  2141. .halt_reg = 0x3600c,
  2142. .halt_check = BRANCH_HALT,
  2143. .clkr = {
  2144. .enable_reg = 0x3600c,
  2145. .enable_mask = BIT(0),
  2146. .hw.init = &(struct clk_init_data){
  2147. .name = "gcc_tsif_inactivity_timers_clk",
  2148. .ops = &clk_branch2_ops,
  2149. },
  2150. },
  2151. };
  2152. static struct clk_branch gcc_tsif_ref_clk = {
  2153. .halt_reg = 0x36008,
  2154. .halt_check = BRANCH_HALT,
  2155. .clkr = {
  2156. .enable_reg = 0x36008,
  2157. .enable_mask = BIT(0),
  2158. .hw.init = &(struct clk_init_data){
  2159. .name = "gcc_tsif_ref_clk",
  2160. .parent_names = (const char *[]){
  2161. "tsif_ref_clk_src",
  2162. },
  2163. .num_parents = 1,
  2164. .ops = &clk_branch2_ops,
  2165. },
  2166. },
  2167. };
  2168. static struct clk_branch gcc_ufs_ahb_clk = {
  2169. .halt_reg = 0x7500c,
  2170. .halt_check = BRANCH_HALT,
  2171. .clkr = {
  2172. .enable_reg = 0x7500c,
  2173. .enable_mask = BIT(0),
  2174. .hw.init = &(struct clk_init_data){
  2175. .name = "gcc_ufs_ahb_clk",
  2176. .ops = &clk_branch2_ops,
  2177. },
  2178. },
  2179. };
  2180. static struct clk_branch gcc_ufs_axi_clk = {
  2181. .halt_reg = 0x75008,
  2182. .halt_check = BRANCH_HALT,
  2183. .clkr = {
  2184. .enable_reg = 0x75008,
  2185. .enable_mask = BIT(0),
  2186. .hw.init = &(struct clk_init_data){
  2187. .name = "gcc_ufs_axi_clk",
  2188. .parent_names = (const char *[]){
  2189. "ufs_axi_clk_src",
  2190. },
  2191. .num_parents = 1,
  2192. .ops = &clk_branch2_ops,
  2193. },
  2194. },
  2195. };
  2196. static struct clk_branch gcc_ufs_ice_core_clk = {
  2197. .halt_reg = 0x7600c,
  2198. .halt_check = BRANCH_HALT,
  2199. .clkr = {
  2200. .enable_reg = 0x7600c,
  2201. .enable_mask = BIT(0),
  2202. .hw.init = &(struct clk_init_data){
  2203. .name = "gcc_ufs_ice_core_clk",
  2204. .ops = &clk_branch2_ops,
  2205. },
  2206. },
  2207. };
  2208. static struct clk_branch gcc_ufs_phy_aux_clk = {
  2209. .halt_reg = 0x76040,
  2210. .halt_check = BRANCH_HALT,
  2211. .clkr = {
  2212. .enable_reg = 0x76040,
  2213. .enable_mask = BIT(0),
  2214. .hw.init = &(struct clk_init_data){
  2215. .name = "gcc_ufs_phy_aux_clk",
  2216. .ops = &clk_branch2_ops,
  2217. },
  2218. },
  2219. };
  2220. static struct clk_branch gcc_ufs_rx_symbol_0_clk = {
  2221. .halt_reg = 0x75014,
  2222. .halt_check = BRANCH_HALT_SKIP,
  2223. .clkr = {
  2224. .enable_reg = 0x75014,
  2225. .enable_mask = BIT(0),
  2226. .hw.init = &(struct clk_init_data){
  2227. .name = "gcc_ufs_rx_symbol_0_clk",
  2228. .ops = &clk_branch2_ops,
  2229. },
  2230. },
  2231. };
  2232. static struct clk_branch gcc_ufs_rx_symbol_1_clk = {
  2233. .halt_reg = 0x7605c,
  2234. .halt_check = BRANCH_HALT_SKIP,
  2235. .clkr = {
  2236. .enable_reg = 0x7605c,
  2237. .enable_mask = BIT(0),
  2238. .hw.init = &(struct clk_init_data){
  2239. .name = "gcc_ufs_rx_symbol_1_clk",
  2240. .ops = &clk_branch2_ops,
  2241. },
  2242. },
  2243. };
  2244. static struct clk_branch gcc_ufs_tx_symbol_0_clk = {
  2245. .halt_reg = 0x75010,
  2246. .halt_check = BRANCH_HALT_SKIP,
  2247. .clkr = {
  2248. .enable_reg = 0x75010,
  2249. .enable_mask = BIT(0),
  2250. .hw.init = &(struct clk_init_data){
  2251. .name = "gcc_ufs_tx_symbol_0_clk",
  2252. .ops = &clk_branch2_ops,
  2253. },
  2254. },
  2255. };
  2256. static struct clk_branch gcc_ufs_unipro_core_clk = {
  2257. .halt_reg = 0x76008,
  2258. .halt_check = BRANCH_HALT,
  2259. .clkr = {
  2260. .enable_reg = 0x76008,
  2261. .enable_mask = BIT(0),
  2262. .hw.init = &(struct clk_init_data){
  2263. .name = "gcc_ufs_unipro_core_clk",
  2264. .ops = &clk_branch2_ops,
  2265. },
  2266. },
  2267. };
  2268. static struct clk_branch gcc_usb30_master_clk = {
  2269. .halt_reg = 0xf008,
  2270. .halt_check = BRANCH_HALT,
  2271. .clkr = {
  2272. .enable_reg = 0xf008,
  2273. .enable_mask = BIT(0),
  2274. .hw.init = &(struct clk_init_data){
  2275. .name = "gcc_usb30_master_clk",
  2276. .parent_names = (const char *[]){
  2277. "usb30_master_clk_src",
  2278. },
  2279. .num_parents = 1,
  2280. .ops = &clk_branch2_ops,
  2281. },
  2282. },
  2283. };
  2284. static struct clk_branch gcc_usb30_mock_utmi_clk = {
  2285. .halt_reg = 0xf010,
  2286. .halt_check = BRANCH_HALT,
  2287. .clkr = {
  2288. .enable_reg = 0xf010,
  2289. .enable_mask = BIT(0),
  2290. .hw.init = &(struct clk_init_data){
  2291. .name = "gcc_usb30_mock_utmi_clk",
  2292. .parent_names = (const char *[]){
  2293. "usb30_mock_utmi_clk_src",
  2294. },
  2295. .num_parents = 1,
  2296. .ops = &clk_branch2_ops,
  2297. },
  2298. },
  2299. };
  2300. static struct clk_branch gcc_usb30_sleep_clk = {
  2301. .halt_reg = 0xf00c,
  2302. .halt_check = BRANCH_HALT,
  2303. .clkr = {
  2304. .enable_reg = 0xf00c,
  2305. .enable_mask = BIT(0),
  2306. .hw.init = &(struct clk_init_data){
  2307. .name = "gcc_usb30_sleep_clk",
  2308. .ops = &clk_branch2_ops,
  2309. },
  2310. },
  2311. };
  2312. static struct clk_branch gcc_usb3_phy_aux_clk = {
  2313. .halt_reg = 0x50000,
  2314. .halt_check = BRANCH_HALT,
  2315. .clkr = {
  2316. .enable_reg = 0x50000,
  2317. .enable_mask = BIT(0),
  2318. .hw.init = &(struct clk_init_data){
  2319. .name = "gcc_usb3_phy_aux_clk",
  2320. .parent_names = (const char *[]){
  2321. "usb3_phy_aux_clk_src",
  2322. },
  2323. .num_parents = 1,
  2324. .ops = &clk_branch2_ops,
  2325. },
  2326. },
  2327. };
  2328. static struct clk_branch gcc_usb3_phy_pipe_clk = {
  2329. .halt_reg = 0x50004,
  2330. .halt_check = BRANCH_HALT,
  2331. .clkr = {
  2332. .enable_reg = 0x50004,
  2333. .enable_mask = BIT(0),
  2334. .hw.init = &(struct clk_init_data){
  2335. .name = "gcc_usb3_phy_pipe_clk",
  2336. .ops = &clk_branch2_ops,
  2337. },
  2338. },
  2339. };
  2340. static struct clk_branch gcc_usb_phy_cfg_ahb2phy_clk = {
  2341. .halt_reg = 0x6a004,
  2342. .halt_check = BRANCH_HALT,
  2343. .clkr = {
  2344. .enable_reg = 0x6a004,
  2345. .enable_mask = BIT(0),
  2346. .hw.init = &(struct clk_init_data){
  2347. .name = "gcc_usb_phy_cfg_ahb2phy_clk",
  2348. .ops = &clk_branch2_ops,
  2349. },
  2350. },
  2351. };
  2352. static struct gdsc pcie_0_gdsc = {
  2353. .gdscr = 0x6b004,
  2354. .gds_hw_ctrl = 0x0,
  2355. .pd = {
  2356. .name = "pcie_0_gdsc",
  2357. },
  2358. .pwrsts = PWRSTS_OFF_ON,
  2359. .flags = VOTABLE,
  2360. };
  2361. static struct gdsc ufs_gdsc = {
  2362. .gdscr = 0x75004,
  2363. .gds_hw_ctrl = 0x0,
  2364. .pd = {
  2365. .name = "ufs_gdsc",
  2366. },
  2367. .pwrsts = PWRSTS_OFF_ON,
  2368. .flags = VOTABLE,
  2369. };
  2370. static struct gdsc usb_30_gdsc = {
  2371. .gdscr = 0xf004,
  2372. .gds_hw_ctrl = 0x0,
  2373. .pd = {
  2374. .name = "usb_30_gdsc",
  2375. },
  2376. .pwrsts = PWRSTS_OFF_ON,
  2377. .flags = VOTABLE,
  2378. };
  2379. static struct clk_regmap *gcc_msm8998_clocks[] = {
  2380. [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
  2381. [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
  2382. [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
  2383. [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
  2384. [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
  2385. [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
  2386. [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
  2387. [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
  2388. [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
  2389. [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
  2390. [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
  2391. [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
  2392. [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
  2393. [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
  2394. [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
  2395. [BLSP2_QUP1_I2C_APPS_CLK_SRC] = &blsp2_qup1_i2c_apps_clk_src.clkr,
  2396. [BLSP2_QUP1_SPI_APPS_CLK_SRC] = &blsp2_qup1_spi_apps_clk_src.clkr,
  2397. [BLSP2_QUP2_I2C_APPS_CLK_SRC] = &blsp2_qup2_i2c_apps_clk_src.clkr,
  2398. [BLSP2_QUP2_SPI_APPS_CLK_SRC] = &blsp2_qup2_spi_apps_clk_src.clkr,
  2399. [BLSP2_QUP3_I2C_APPS_CLK_SRC] = &blsp2_qup3_i2c_apps_clk_src.clkr,
  2400. [BLSP2_QUP3_SPI_APPS_CLK_SRC] = &blsp2_qup3_spi_apps_clk_src.clkr,
  2401. [BLSP2_QUP4_I2C_APPS_CLK_SRC] = &blsp2_qup4_i2c_apps_clk_src.clkr,
  2402. [BLSP2_QUP4_SPI_APPS_CLK_SRC] = &blsp2_qup4_spi_apps_clk_src.clkr,
  2403. [BLSP2_QUP5_I2C_APPS_CLK_SRC] = &blsp2_qup5_i2c_apps_clk_src.clkr,
  2404. [BLSP2_QUP5_SPI_APPS_CLK_SRC] = &blsp2_qup5_spi_apps_clk_src.clkr,
  2405. [BLSP2_QUP6_I2C_APPS_CLK_SRC] = &blsp2_qup6_i2c_apps_clk_src.clkr,
  2406. [BLSP2_QUP6_SPI_APPS_CLK_SRC] = &blsp2_qup6_spi_apps_clk_src.clkr,
  2407. [BLSP2_UART1_APPS_CLK_SRC] = &blsp2_uart1_apps_clk_src.clkr,
  2408. [BLSP2_UART2_APPS_CLK_SRC] = &blsp2_uart2_apps_clk_src.clkr,
  2409. [BLSP2_UART3_APPS_CLK_SRC] = &blsp2_uart3_apps_clk_src.clkr,
  2410. [GCC_AGGRE1_NOC_XO_CLK] = &gcc_aggre1_noc_xo_clk.clkr,
  2411. [GCC_AGGRE1_UFS_AXI_CLK] = &gcc_aggre1_ufs_axi_clk.clkr,
  2412. [GCC_AGGRE1_USB3_AXI_CLK] = &gcc_aggre1_usb3_axi_clk.clkr,
  2413. [GCC_APSS_QDSS_TSCTR_DIV2_CLK] = &gcc_apss_qdss_tsctr_div2_clk.clkr,
  2414. [GCC_APSS_QDSS_TSCTR_DIV8_CLK] = &gcc_apss_qdss_tsctr_div8_clk.clkr,
  2415. [GCC_BIMC_HMSS_AXI_CLK] = &gcc_bimc_hmss_axi_clk.clkr,
  2416. [GCC_BIMC_MSS_Q6_AXI_CLK] = &gcc_bimc_mss_q6_axi_clk.clkr,
  2417. [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
  2418. [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
  2419. [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
  2420. [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
  2421. [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
  2422. [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
  2423. [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
  2424. [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
  2425. [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
  2426. [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
  2427. [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
  2428. [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
  2429. [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
  2430. [GCC_BLSP1_SLEEP_CLK] = &gcc_blsp1_sleep_clk.clkr,
  2431. [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
  2432. [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
  2433. [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
  2434. [GCC_BLSP2_AHB_CLK] = &gcc_blsp2_ahb_clk.clkr,
  2435. [GCC_BLSP2_QUP1_I2C_APPS_CLK] = &gcc_blsp2_qup1_i2c_apps_clk.clkr,
  2436. [GCC_BLSP2_QUP1_SPI_APPS_CLK] = &gcc_blsp2_qup1_spi_apps_clk.clkr,
  2437. [GCC_BLSP2_QUP2_I2C_APPS_CLK] = &gcc_blsp2_qup2_i2c_apps_clk.clkr,
  2438. [GCC_BLSP2_QUP2_SPI_APPS_CLK] = &gcc_blsp2_qup2_spi_apps_clk.clkr,
  2439. [GCC_BLSP2_QUP3_I2C_APPS_CLK] = &gcc_blsp2_qup3_i2c_apps_clk.clkr,
  2440. [GCC_BLSP2_QUP3_SPI_APPS_CLK] = &gcc_blsp2_qup3_spi_apps_clk.clkr,
  2441. [GCC_BLSP2_QUP4_I2C_APPS_CLK] = &gcc_blsp2_qup4_i2c_apps_clk.clkr,
  2442. [GCC_BLSP2_QUP4_SPI_APPS_CLK] = &gcc_blsp2_qup4_spi_apps_clk.clkr,
  2443. [GCC_BLSP2_QUP5_I2C_APPS_CLK] = &gcc_blsp2_qup5_i2c_apps_clk.clkr,
  2444. [GCC_BLSP2_QUP5_SPI_APPS_CLK] = &gcc_blsp2_qup5_spi_apps_clk.clkr,
  2445. [GCC_BLSP2_QUP6_I2C_APPS_CLK] = &gcc_blsp2_qup6_i2c_apps_clk.clkr,
  2446. [GCC_BLSP2_QUP6_SPI_APPS_CLK] = &gcc_blsp2_qup6_spi_apps_clk.clkr,
  2447. [GCC_BLSP2_SLEEP_CLK] = &gcc_blsp2_sleep_clk.clkr,
  2448. [GCC_BLSP2_UART1_APPS_CLK] = &gcc_blsp2_uart1_apps_clk.clkr,
  2449. [GCC_BLSP2_UART2_APPS_CLK] = &gcc_blsp2_uart2_apps_clk.clkr,
  2450. [GCC_BLSP2_UART3_APPS_CLK] = &gcc_blsp2_uart3_apps_clk.clkr,
  2451. [GCC_CFG_NOC_USB3_AXI_CLK] = &gcc_cfg_noc_usb3_axi_clk.clkr,
  2452. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  2453. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  2454. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  2455. [GCC_GPU_BIMC_GFX_CLK] = &gcc_gpu_bimc_gfx_clk.clkr,
  2456. [GCC_GPU_BIMC_GFX_SRC_CLK] = &gcc_gpu_bimc_gfx_src_clk.clkr,
  2457. [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
  2458. [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr,
  2459. [GCC_HMSS_AHB_CLK] = &gcc_hmss_ahb_clk.clkr,
  2460. [GCC_HMSS_AT_CLK] = &gcc_hmss_at_clk.clkr,
  2461. [GCC_HMSS_DVM_BUS_CLK] = &gcc_hmss_dvm_bus_clk.clkr,
  2462. [GCC_HMSS_RBCPR_CLK] = &gcc_hmss_rbcpr_clk.clkr,
  2463. [GCC_HMSS_TRIG_CLK] = &gcc_hmss_trig_clk.clkr,
  2464. [GCC_LPASS_AT_CLK] = &gcc_lpass_at_clk.clkr,
  2465. [GCC_LPASS_TRIG_CLK] = &gcc_lpass_trig_clk.clkr,
  2466. [GCC_MMSS_NOC_CFG_AHB_CLK] = &gcc_mmss_noc_cfg_ahb_clk.clkr,
  2467. [GCC_MMSS_QM_AHB_CLK] = &gcc_mmss_qm_ahb_clk.clkr,
  2468. [GCC_MMSS_QM_CORE_CLK] = &gcc_mmss_qm_core_clk.clkr,
  2469. [GCC_MMSS_SYS_NOC_AXI_CLK] = &gcc_mmss_sys_noc_axi_clk.clkr,
  2470. [GCC_MSS_AT_CLK] = &gcc_mss_at_clk.clkr,
  2471. [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr,
  2472. [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr,
  2473. [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr,
  2474. [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr,
  2475. [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr,
  2476. [GCC_PCIE_PHY_AUX_CLK] = &gcc_pcie_phy_aux_clk.clkr,
  2477. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  2478. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  2479. [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
  2480. [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
  2481. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  2482. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  2483. [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr,
  2484. [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr,
  2485. [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr,
  2486. [GCC_TSIF_INACTIVITY_TIMERS_CLK] = &gcc_tsif_inactivity_timers_clk.clkr,
  2487. [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr,
  2488. [GCC_UFS_AHB_CLK] = &gcc_ufs_ahb_clk.clkr,
  2489. [GCC_UFS_AXI_CLK] = &gcc_ufs_axi_clk.clkr,
  2490. [GCC_UFS_ICE_CORE_CLK] = &gcc_ufs_ice_core_clk.clkr,
  2491. [GCC_UFS_PHY_AUX_CLK] = &gcc_ufs_phy_aux_clk.clkr,
  2492. [GCC_UFS_RX_SYMBOL_0_CLK] = &gcc_ufs_rx_symbol_0_clk.clkr,
  2493. [GCC_UFS_RX_SYMBOL_1_CLK] = &gcc_ufs_rx_symbol_1_clk.clkr,
  2494. [GCC_UFS_TX_SYMBOL_0_CLK] = &gcc_ufs_tx_symbol_0_clk.clkr,
  2495. [GCC_UFS_UNIPRO_CORE_CLK] = &gcc_ufs_unipro_core_clk.clkr,
  2496. [GCC_USB30_MASTER_CLK] = &gcc_usb30_master_clk.clkr,
  2497. [GCC_USB30_MOCK_UTMI_CLK] = &gcc_usb30_mock_utmi_clk.clkr,
  2498. [GCC_USB30_SLEEP_CLK] = &gcc_usb30_sleep_clk.clkr,
  2499. [GCC_USB3_PHY_AUX_CLK] = &gcc_usb3_phy_aux_clk.clkr,
  2500. [GCC_USB3_PHY_PIPE_CLK] = &gcc_usb3_phy_pipe_clk.clkr,
  2501. [GCC_USB_PHY_CFG_AHB2PHY_CLK] = &gcc_usb_phy_cfg_ahb2phy_clk.clkr,
  2502. [GP1_CLK_SRC] = &gp1_clk_src.clkr,
  2503. [GP2_CLK_SRC] = &gp2_clk_src.clkr,
  2504. [GP3_CLK_SRC] = &gp3_clk_src.clkr,
  2505. [GPLL0] = &gpll0.clkr,
  2506. [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr,
  2507. [GPLL0_OUT_MAIN] = &gpll0_out_main.clkr,
  2508. [GPLL0_OUT_ODD] = &gpll0_out_odd.clkr,
  2509. [GPLL0_OUT_TEST] = &gpll0_out_test.clkr,
  2510. [GPLL1] = &gpll1.clkr,
  2511. [GPLL1_OUT_EVEN] = &gpll1_out_even.clkr,
  2512. [GPLL1_OUT_MAIN] = &gpll1_out_main.clkr,
  2513. [GPLL1_OUT_ODD] = &gpll1_out_odd.clkr,
  2514. [GPLL1_OUT_TEST] = &gpll1_out_test.clkr,
  2515. [GPLL2] = &gpll2.clkr,
  2516. [GPLL2_OUT_EVEN] = &gpll2_out_even.clkr,
  2517. [GPLL2_OUT_MAIN] = &gpll2_out_main.clkr,
  2518. [GPLL2_OUT_ODD] = &gpll2_out_odd.clkr,
  2519. [GPLL2_OUT_TEST] = &gpll2_out_test.clkr,
  2520. [GPLL3] = &gpll3.clkr,
  2521. [GPLL3_OUT_EVEN] = &gpll3_out_even.clkr,
  2522. [GPLL3_OUT_MAIN] = &gpll3_out_main.clkr,
  2523. [GPLL3_OUT_ODD] = &gpll3_out_odd.clkr,
  2524. [GPLL3_OUT_TEST] = &gpll3_out_test.clkr,
  2525. [GPLL4] = &gpll4.clkr,
  2526. [GPLL4_OUT_EVEN] = &gpll4_out_even.clkr,
  2527. [GPLL4_OUT_MAIN] = &gpll4_out_main.clkr,
  2528. [GPLL4_OUT_ODD] = &gpll4_out_odd.clkr,
  2529. [GPLL4_OUT_TEST] = &gpll4_out_test.clkr,
  2530. [HMSS_AHB_CLK_SRC] = &hmss_ahb_clk_src.clkr,
  2531. [HMSS_RBCPR_CLK_SRC] = &hmss_rbcpr_clk_src.clkr,
  2532. [PCIE_AUX_CLK_SRC] = &pcie_aux_clk_src.clkr,
  2533. [PDM2_CLK_SRC] = &pdm2_clk_src.clkr,
  2534. [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
  2535. [SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr,
  2536. [TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr,
  2537. [UFS_AXI_CLK_SRC] = &ufs_axi_clk_src.clkr,
  2538. [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr,
  2539. [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr,
  2540. [USB3_PHY_AUX_CLK_SRC] = &usb3_phy_aux_clk_src.clkr,
  2541. };
  2542. static struct gdsc *gcc_msm8998_gdscs[] = {
  2543. [PCIE_0_GDSC] = &pcie_0_gdsc,
  2544. [UFS_GDSC] = &ufs_gdsc,
  2545. [USB_30_GDSC] = &usb_30_gdsc,
  2546. };
  2547. static const struct qcom_reset_map gcc_msm8998_resets[] = {
  2548. [GCC_BLSP1_QUP1_BCR] = { 0x19000 },
  2549. [GCC_BLSP1_QUP2_BCR] = { 0x1b000 },
  2550. [GCC_BLSP1_QUP3_BCR] = { 0x1d000 },
  2551. [GCC_BLSP1_QUP4_BCR] = { 0x1f000 },
  2552. [GCC_BLSP1_QUP5_BCR] = { 0x21000 },
  2553. [GCC_BLSP1_QUP6_BCR] = { 0x23000 },
  2554. [GCC_BLSP2_QUP1_BCR] = { 0x26000 },
  2555. [GCC_BLSP2_QUP2_BCR] = { 0x28000 },
  2556. [GCC_BLSP2_QUP3_BCR] = { 0x2a000 },
  2557. [GCC_BLSP2_QUP4_BCR] = { 0x2c000 },
  2558. [GCC_BLSP2_QUP5_BCR] = { 0x2e000 },
  2559. [GCC_BLSP2_QUP6_BCR] = { 0x30000 },
  2560. [GCC_PCIE_0_BCR] = { 0x6b000 },
  2561. [GCC_PDM_BCR] = { 0x33000 },
  2562. [GCC_SDCC2_BCR] = { 0x14000 },
  2563. [GCC_SDCC4_BCR] = { 0x16000 },
  2564. [GCC_TSIF_BCR] = { 0x36000 },
  2565. [GCC_UFS_BCR] = { 0x75000 },
  2566. [GCC_USB_30_BCR] = { 0xf000 },
  2567. };
  2568. static const struct regmap_config gcc_msm8998_regmap_config = {
  2569. .reg_bits = 32,
  2570. .reg_stride = 4,
  2571. .val_bits = 32,
  2572. .max_register = 0x8f000,
  2573. .fast_io = true,
  2574. };
  2575. static const struct qcom_cc_desc gcc_msm8998_desc = {
  2576. .config = &gcc_msm8998_regmap_config,
  2577. .clks = gcc_msm8998_clocks,
  2578. .num_clks = ARRAY_SIZE(gcc_msm8998_clocks),
  2579. .resets = gcc_msm8998_resets,
  2580. .num_resets = ARRAY_SIZE(gcc_msm8998_resets),
  2581. .gdscs = gcc_msm8998_gdscs,
  2582. .num_gdscs = ARRAY_SIZE(gcc_msm8998_gdscs),
  2583. };
  2584. static int gcc_msm8998_probe(struct platform_device *pdev)
  2585. {
  2586. struct regmap *regmap;
  2587. int ret;
  2588. regmap = qcom_cc_map(pdev, &gcc_msm8998_desc);
  2589. if (IS_ERR(regmap))
  2590. return PTR_ERR(regmap);
  2591. /*
  2592. * Set the HMSS_AHB_CLK_SLEEP_ENA bit to allow the hmss_ahb_clk to be
  2593. * turned off by hardware during certain apps low power modes.
  2594. */
  2595. ret = regmap_update_bits(regmap, 0x52008, BIT(21), BIT(21));
  2596. if (ret)
  2597. return ret;
  2598. return qcom_cc_really_probe(pdev, &gcc_msm8998_desc, regmap);
  2599. }
  2600. static const struct of_device_id gcc_msm8998_match_table[] = {
  2601. { .compatible = "qcom,gcc-msm8998" },
  2602. { }
  2603. };
  2604. MODULE_DEVICE_TABLE(of, gcc_msm8998_match_table);
  2605. static struct platform_driver gcc_msm8998_driver = {
  2606. .probe = gcc_msm8998_probe,
  2607. .driver = {
  2608. .name = "gcc-msm8998",
  2609. .of_match_table = gcc_msm8998_match_table,
  2610. },
  2611. };
  2612. static int __init gcc_msm8998_init(void)
  2613. {
  2614. return platform_driver_register(&gcc_msm8998_driver);
  2615. }
  2616. core_initcall(gcc_msm8998_init);
  2617. static void __exit gcc_msm8998_exit(void)
  2618. {
  2619. platform_driver_unregister(&gcc_msm8998_driver);
  2620. }
  2621. module_exit(gcc_msm8998_exit);
  2622. MODULE_DESCRIPTION("QCOM GCC msm8998 Driver");
  2623. MODULE_LICENSE("GPL v2");
  2624. MODULE_ALIAS("platform:gcc-msm8998");