gcc-msm8998.c 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388
  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/clk-provider.h>
  12. #include <linux/regmap.h>
  13. #include <linux/reset-controller.h>
  14. #include <dt-bindings/clock/qcom,gcc-msm8998.h>
  15. #include "common.h"
  16. #include "clk-regmap.h"
  17. #include "clk-alpha-pll.h"
  18. #include "clk-pll.h"
  19. #include "clk-rcg.h"
  20. #include "clk-branch.h"
  21. #include "reset.h"
  22. #include "gdsc.h"
  23. #define GCC_MMSS_MISC 0x0902C
  24. #define GCC_GPU_MISC 0x71028
  25. static const struct pll_vco fabia_vco[] = {
  26. { 250000000, 2000000000, 0 },
  27. { 125000000, 1000000000, 1 },
  28. };
  29. static struct clk_alpha_pll gpll0 = {
  30. .offset = 0x0,
  31. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  32. .vco_table = fabia_vco,
  33. .num_vco = ARRAY_SIZE(fabia_vco),
  34. .clkr = {
  35. .enable_reg = 0x52000,
  36. .enable_mask = BIT(0),
  37. .hw.init = &(struct clk_init_data){
  38. .name = "gpll0",
  39. .parent_data = (const struct clk_parent_data []) {
  40. { .fw_name = "xo" },
  41. },
  42. .num_parents = 1,
  43. .ops = &clk_alpha_pll_fixed_fabia_ops,
  44. }
  45. },
  46. };
  47. static struct clk_alpha_pll_postdiv gpll0_out_even = {
  48. .offset = 0x0,
  49. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  50. .clkr.hw.init = &(struct clk_init_data){
  51. .name = "gpll0_out_even",
  52. .parent_hws = (const struct clk_hw*[]) {
  53. &gpll0.clkr.hw,
  54. },
  55. .num_parents = 1,
  56. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  57. },
  58. };
  59. static struct clk_alpha_pll_postdiv gpll0_out_main = {
  60. .offset = 0x0,
  61. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  62. .clkr.hw.init = &(struct clk_init_data){
  63. .name = "gpll0_out_main",
  64. .parent_hws = (const struct clk_hw*[]) {
  65. &gpll0.clkr.hw,
  66. },
  67. .num_parents = 1,
  68. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  69. },
  70. };
  71. static struct clk_alpha_pll_postdiv gpll0_out_odd = {
  72. .offset = 0x0,
  73. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  74. .clkr.hw.init = &(struct clk_init_data){
  75. .name = "gpll0_out_odd",
  76. .parent_hws = (const struct clk_hw*[]) {
  77. &gpll0.clkr.hw,
  78. },
  79. .num_parents = 1,
  80. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  81. },
  82. };
  83. static struct clk_alpha_pll_postdiv gpll0_out_test = {
  84. .offset = 0x0,
  85. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  86. .clkr.hw.init = &(struct clk_init_data){
  87. .name = "gpll0_out_test",
  88. .parent_hws = (const struct clk_hw*[]) {
  89. &gpll0.clkr.hw,
  90. },
  91. .num_parents = 1,
  92. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  93. },
  94. };
  95. static struct clk_alpha_pll gpll1 = {
  96. .offset = 0x1000,
  97. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  98. .vco_table = fabia_vco,
  99. .num_vco = ARRAY_SIZE(fabia_vco),
  100. .clkr = {
  101. .enable_reg = 0x52000,
  102. .enable_mask = BIT(1),
  103. .hw.init = &(struct clk_init_data){
  104. .name = "gpll1",
  105. .parent_data = (const struct clk_parent_data []) {
  106. { .fw_name = "xo" },
  107. },
  108. .num_parents = 1,
  109. .ops = &clk_alpha_pll_fixed_fabia_ops,
  110. }
  111. },
  112. };
  113. static struct clk_alpha_pll_postdiv gpll1_out_even = {
  114. .offset = 0x1000,
  115. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  116. .clkr.hw.init = &(struct clk_init_data){
  117. .name = "gpll1_out_even",
  118. .parent_hws = (const struct clk_hw*[]) {
  119. &gpll1.clkr.hw,
  120. },
  121. .num_parents = 1,
  122. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  123. },
  124. };
  125. static struct clk_alpha_pll_postdiv gpll1_out_main = {
  126. .offset = 0x1000,
  127. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  128. .clkr.hw.init = &(struct clk_init_data){
  129. .name = "gpll1_out_main",
  130. .parent_hws = (const struct clk_hw*[]) {
  131. &gpll1.clkr.hw,
  132. },
  133. .num_parents = 1,
  134. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  135. },
  136. };
  137. static struct clk_alpha_pll_postdiv gpll1_out_odd = {
  138. .offset = 0x1000,
  139. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  140. .clkr.hw.init = &(struct clk_init_data){
  141. .name = "gpll1_out_odd",
  142. .parent_hws = (const struct clk_hw*[]) {
  143. &gpll1.clkr.hw,
  144. },
  145. .num_parents = 1,
  146. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  147. },
  148. };
  149. static struct clk_alpha_pll_postdiv gpll1_out_test = {
  150. .offset = 0x1000,
  151. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  152. .clkr.hw.init = &(struct clk_init_data){
  153. .name = "gpll1_out_test",
  154. .parent_hws = (const struct clk_hw*[]) {
  155. &gpll1.clkr.hw,
  156. },
  157. .num_parents = 1,
  158. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  159. },
  160. };
  161. static struct clk_alpha_pll gpll2 = {
  162. .offset = 0x2000,
  163. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  164. .vco_table = fabia_vco,
  165. .num_vco = ARRAY_SIZE(fabia_vco),
  166. .clkr = {
  167. .enable_reg = 0x52000,
  168. .enable_mask = BIT(2),
  169. .hw.init = &(struct clk_init_data){
  170. .name = "gpll2",
  171. .parent_data = (const struct clk_parent_data []) {
  172. { .fw_name = "xo" },
  173. },
  174. .num_parents = 1,
  175. .ops = &clk_alpha_pll_fixed_fabia_ops,
  176. }
  177. },
  178. };
  179. static struct clk_alpha_pll_postdiv gpll2_out_even = {
  180. .offset = 0x2000,
  181. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  182. .clkr.hw.init = &(struct clk_init_data){
  183. .name = "gpll2_out_even",
  184. .parent_hws = (const struct clk_hw*[]) {
  185. &gpll2.clkr.hw,
  186. },
  187. .num_parents = 1,
  188. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  189. },
  190. };
  191. static struct clk_alpha_pll_postdiv gpll2_out_main = {
  192. .offset = 0x2000,
  193. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  194. .clkr.hw.init = &(struct clk_init_data){
  195. .name = "gpll2_out_main",
  196. .parent_hws = (const struct clk_hw*[]) {
  197. &gpll2.clkr.hw,
  198. },
  199. .num_parents = 1,
  200. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  201. },
  202. };
  203. static struct clk_alpha_pll_postdiv gpll2_out_odd = {
  204. .offset = 0x2000,
  205. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  206. .clkr.hw.init = &(struct clk_init_data){
  207. .name = "gpll2_out_odd",
  208. .parent_hws = (const struct clk_hw*[]) {
  209. &gpll2.clkr.hw,
  210. },
  211. .num_parents = 1,
  212. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  213. },
  214. };
  215. static struct clk_alpha_pll_postdiv gpll2_out_test = {
  216. .offset = 0x2000,
  217. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  218. .clkr.hw.init = &(struct clk_init_data){
  219. .name = "gpll2_out_test",
  220. .parent_hws = (const struct clk_hw*[]) {
  221. &gpll2.clkr.hw,
  222. },
  223. .num_parents = 1,
  224. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  225. },
  226. };
  227. static struct clk_alpha_pll gpll3 = {
  228. .offset = 0x3000,
  229. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  230. .vco_table = fabia_vco,
  231. .num_vco = ARRAY_SIZE(fabia_vco),
  232. .clkr = {
  233. .enable_reg = 0x52000,
  234. .enable_mask = BIT(3),
  235. .hw.init = &(struct clk_init_data){
  236. .name = "gpll3",
  237. .parent_data = (const struct clk_parent_data []) {
  238. { .fw_name = "xo" },
  239. },
  240. .num_parents = 1,
  241. .ops = &clk_alpha_pll_fixed_fabia_ops,
  242. }
  243. },
  244. };
  245. static struct clk_alpha_pll_postdiv gpll3_out_even = {
  246. .offset = 0x3000,
  247. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  248. .clkr.hw.init = &(struct clk_init_data){
  249. .name = "gpll3_out_even",
  250. .parent_hws = (const struct clk_hw*[]) {
  251. &gpll3.clkr.hw,
  252. },
  253. .num_parents = 1,
  254. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  255. },
  256. };
  257. static struct clk_alpha_pll_postdiv gpll3_out_main = {
  258. .offset = 0x3000,
  259. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  260. .clkr.hw.init = &(struct clk_init_data){
  261. .name = "gpll3_out_main",
  262. .parent_hws = (const struct clk_hw*[]) {
  263. &gpll3.clkr.hw,
  264. },
  265. .num_parents = 1,
  266. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  267. },
  268. };
  269. static struct clk_alpha_pll_postdiv gpll3_out_odd = {
  270. .offset = 0x3000,
  271. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  272. .clkr.hw.init = &(struct clk_init_data){
  273. .name = "gpll3_out_odd",
  274. .parent_hws = (const struct clk_hw*[]) {
  275. &gpll3.clkr.hw,
  276. },
  277. .num_parents = 1,
  278. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  279. },
  280. };
  281. static struct clk_alpha_pll_postdiv gpll3_out_test = {
  282. .offset = 0x3000,
  283. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  284. .clkr.hw.init = &(struct clk_init_data){
  285. .name = "gpll3_out_test",
  286. .parent_hws = (const struct clk_hw*[]) {
  287. &gpll3.clkr.hw,
  288. },
  289. .num_parents = 1,
  290. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  291. },
  292. };
  293. static struct clk_alpha_pll gpll4 = {
  294. .offset = 0x77000,
  295. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  296. .vco_table = fabia_vco,
  297. .num_vco = ARRAY_SIZE(fabia_vco),
  298. .clkr = {
  299. .enable_reg = 0x52000,
  300. .enable_mask = BIT(4),
  301. .hw.init = &(struct clk_init_data){
  302. .name = "gpll4",
  303. .parent_data = (const struct clk_parent_data []) {
  304. { .fw_name = "xo" },
  305. },
  306. .num_parents = 1,
  307. .ops = &clk_alpha_pll_fixed_fabia_ops,
  308. }
  309. },
  310. };
  311. static struct clk_alpha_pll_postdiv gpll4_out_even = {
  312. .offset = 0x77000,
  313. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  314. .clkr.hw.init = &(struct clk_init_data){
  315. .name = "gpll4_out_even",
  316. .parent_hws = (const struct clk_hw*[]) {
  317. &gpll4.clkr.hw,
  318. },
  319. .num_parents = 1,
  320. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  321. },
  322. };
  323. static struct clk_alpha_pll_postdiv gpll4_out_main = {
  324. .offset = 0x77000,
  325. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  326. .clkr.hw.init = &(struct clk_init_data){
  327. .name = "gpll4_out_main",
  328. .parent_hws = (const struct clk_hw*[]) {
  329. &gpll4.clkr.hw,
  330. },
  331. .num_parents = 1,
  332. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  333. },
  334. };
  335. static struct clk_alpha_pll_postdiv gpll4_out_odd = {
  336. .offset = 0x77000,
  337. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
  338. .clkr.hw.init = &(struct clk_init_data){
  339. .name = "gpll4_out_odd",
  340. .parent_hws = (const struct clk_hw*[]) {
  341. &gpll4.clkr.hw,
  342. },
  343. .num_parents = 1,
  344. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  345. },
  346. };
  347. static struct clk_alpha_pll_postdiv gpll4_out_test = {
  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_test",
  352. .parent_hws = (const struct clk_hw*[]) {
  353. &gpll4.clkr.hw,
  354. },
  355. .num_parents = 1,
  356. .ops = &clk_alpha_pll_postdiv_fabia_ops,
  357. },
  358. };
  359. enum {
  360. P_AUD_REF_CLK,
  361. P_GPLL0_OUT_MAIN,
  362. P_GPLL4_OUT_MAIN,
  363. P_PLL0_EARLY_DIV_CLK_SRC,
  364. P_SLEEP_CLK,
  365. P_XO,
  366. };
  367. static const struct parent_map gcc_parent_map_0[] = {
  368. { P_XO, 0 },
  369. { P_GPLL0_OUT_MAIN, 1 },
  370. { P_PLL0_EARLY_DIV_CLK_SRC, 6 },
  371. };
  372. static const struct clk_parent_data gcc_parent_data_0[] = {
  373. { .fw_name = "xo" },
  374. { .hw = &gpll0_out_main.clkr.hw },
  375. { .hw = &gpll0_out_main.clkr.hw },
  376. };
  377. static const struct parent_map gcc_parent_map_1[] = {
  378. { P_XO, 0 },
  379. { P_GPLL0_OUT_MAIN, 1 },
  380. };
  381. static const struct clk_parent_data gcc_parent_data_1[] = {
  382. { .fw_name = "xo" },
  383. { .hw = &gpll0_out_main.clkr.hw },
  384. };
  385. static const struct parent_map gcc_parent_map_2[] = {
  386. { P_XO, 0 },
  387. { P_GPLL0_OUT_MAIN, 1 },
  388. { P_SLEEP_CLK, 5 },
  389. { P_PLL0_EARLY_DIV_CLK_SRC, 6 },
  390. };
  391. static const struct clk_parent_data gcc_parent_data_2[] = {
  392. { .fw_name = "xo" },
  393. { .hw = &gpll0_out_main.clkr.hw },
  394. { .fw_name = "sleep_clk" },
  395. { .hw = &gpll0_out_main.clkr.hw },
  396. };
  397. static const struct parent_map gcc_parent_map_3[] = {
  398. { P_XO, 0 },
  399. { P_SLEEP_CLK, 5 },
  400. };
  401. static const struct clk_parent_data gcc_parent_data_3[] = {
  402. { .fw_name = "xo" },
  403. { .fw_name = "sleep_clk" },
  404. };
  405. static const struct parent_map gcc_parent_map_4[] = {
  406. { P_XO, 0 },
  407. { P_GPLL0_OUT_MAIN, 1 },
  408. { P_GPLL4_OUT_MAIN, 5 },
  409. };
  410. static const struct clk_parent_data gcc_parent_data_4[] = {
  411. { .fw_name = "xo" },
  412. { .hw = &gpll0_out_main.clkr.hw },
  413. { .hw = &gpll4_out_main.clkr.hw },
  414. };
  415. static const struct parent_map gcc_parent_map_5[] = {
  416. { P_XO, 0 },
  417. { P_GPLL0_OUT_MAIN, 1 },
  418. { P_AUD_REF_CLK, 2 },
  419. };
  420. static const struct clk_parent_data gcc_parent_data_5[] = {
  421. { .fw_name = "xo" },
  422. { .hw = &gpll0_out_main.clkr.hw },
  423. { .fw_name = "aud_ref_clk" },
  424. };
  425. static const struct freq_tbl ftbl_blsp1_qup1_i2c_apps_clk_src[] = {
  426. F(19200000, P_XO, 1, 0, 0),
  427. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  428. { }
  429. };
  430. static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
  431. .cmd_rcgr = 0x19020,
  432. .mnd_width = 0,
  433. .hid_width = 5,
  434. .parent_map = gcc_parent_map_1,
  435. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  436. .clkr.hw.init = &(struct clk_init_data){
  437. .name = "blsp1_qup1_i2c_apps_clk_src",
  438. .parent_data = gcc_parent_data_1,
  439. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  440. .ops = &clk_rcg2_ops,
  441. },
  442. };
  443. static const struct freq_tbl ftbl_blsp1_qup1_spi_apps_clk_src[] = {
  444. F(960000, P_XO, 10, 1, 2),
  445. F(4800000, P_XO, 4, 0, 0),
  446. F(9600000, P_XO, 2, 0, 0),
  447. F(15000000, P_GPLL0_OUT_MAIN, 10, 1, 4),
  448. F(19200000, P_XO, 1, 0, 0),
  449. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  450. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  451. { }
  452. };
  453. static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
  454. .cmd_rcgr = 0x1900c,
  455. .mnd_width = 8,
  456. .hid_width = 5,
  457. .parent_map = gcc_parent_map_0,
  458. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  459. .clkr.hw.init = &(struct clk_init_data){
  460. .name = "blsp1_qup1_spi_apps_clk_src",
  461. .parent_data = gcc_parent_data_0,
  462. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  463. .ops = &clk_rcg2_ops,
  464. },
  465. };
  466. static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
  467. .cmd_rcgr = 0x1b020,
  468. .mnd_width = 0,
  469. .hid_width = 5,
  470. .parent_map = gcc_parent_map_1,
  471. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  472. .clkr.hw.init = &(struct clk_init_data){
  473. .name = "blsp1_qup2_i2c_apps_clk_src",
  474. .parent_data = gcc_parent_data_1,
  475. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  476. .ops = &clk_rcg2_ops,
  477. },
  478. };
  479. static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
  480. .cmd_rcgr = 0x1b00c,
  481. .mnd_width = 8,
  482. .hid_width = 5,
  483. .parent_map = gcc_parent_map_0,
  484. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  485. .clkr.hw.init = &(struct clk_init_data){
  486. .name = "blsp1_qup2_spi_apps_clk_src",
  487. .parent_data = gcc_parent_data_0,
  488. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  489. .ops = &clk_rcg2_ops,
  490. },
  491. };
  492. static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
  493. .cmd_rcgr = 0x1d020,
  494. .mnd_width = 0,
  495. .hid_width = 5,
  496. .parent_map = gcc_parent_map_1,
  497. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  498. .clkr.hw.init = &(struct clk_init_data){
  499. .name = "blsp1_qup3_i2c_apps_clk_src",
  500. .parent_data = gcc_parent_data_1,
  501. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  502. .ops = &clk_rcg2_ops,
  503. },
  504. };
  505. static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
  506. .cmd_rcgr = 0x1d00c,
  507. .mnd_width = 8,
  508. .hid_width = 5,
  509. .parent_map = gcc_parent_map_0,
  510. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  511. .clkr.hw.init = &(struct clk_init_data){
  512. .name = "blsp1_qup3_spi_apps_clk_src",
  513. .parent_data = gcc_parent_data_0,
  514. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  515. .ops = &clk_rcg2_ops,
  516. },
  517. };
  518. static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
  519. .cmd_rcgr = 0x1f020,
  520. .mnd_width = 0,
  521. .hid_width = 5,
  522. .parent_map = gcc_parent_map_1,
  523. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  524. .clkr.hw.init = &(struct clk_init_data){
  525. .name = "blsp1_qup4_i2c_apps_clk_src",
  526. .parent_data = gcc_parent_data_1,
  527. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  528. .ops = &clk_rcg2_ops,
  529. },
  530. };
  531. static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
  532. .cmd_rcgr = 0x1f00c,
  533. .mnd_width = 8,
  534. .hid_width = 5,
  535. .parent_map = gcc_parent_map_0,
  536. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  537. .clkr.hw.init = &(struct clk_init_data){
  538. .name = "blsp1_qup4_spi_apps_clk_src",
  539. .parent_data = gcc_parent_data_0,
  540. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  541. .ops = &clk_rcg2_ops,
  542. },
  543. };
  544. static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
  545. .cmd_rcgr = 0x21020,
  546. .mnd_width = 0,
  547. .hid_width = 5,
  548. .parent_map = gcc_parent_map_1,
  549. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  550. .clkr.hw.init = &(struct clk_init_data){
  551. .name = "blsp1_qup5_i2c_apps_clk_src",
  552. .parent_data = gcc_parent_data_1,
  553. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  554. .ops = &clk_rcg2_ops,
  555. },
  556. };
  557. static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
  558. .cmd_rcgr = 0x2100c,
  559. .mnd_width = 8,
  560. .hid_width = 5,
  561. .parent_map = gcc_parent_map_0,
  562. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  563. .clkr.hw.init = &(struct clk_init_data){
  564. .name = "blsp1_qup5_spi_apps_clk_src",
  565. .parent_data = gcc_parent_data_0,
  566. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  567. .ops = &clk_rcg2_ops,
  568. },
  569. };
  570. static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
  571. .cmd_rcgr = 0x23020,
  572. .mnd_width = 0,
  573. .hid_width = 5,
  574. .parent_map = gcc_parent_map_1,
  575. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  576. .clkr.hw.init = &(struct clk_init_data){
  577. .name = "blsp1_qup6_i2c_apps_clk_src",
  578. .parent_data = gcc_parent_data_1,
  579. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  580. .ops = &clk_rcg2_ops,
  581. },
  582. };
  583. static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
  584. .cmd_rcgr = 0x2300c,
  585. .mnd_width = 8,
  586. .hid_width = 5,
  587. .parent_map = gcc_parent_map_0,
  588. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  589. .clkr.hw.init = &(struct clk_init_data){
  590. .name = "blsp1_qup6_spi_apps_clk_src",
  591. .parent_data = gcc_parent_data_0,
  592. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  593. .ops = &clk_rcg2_ops,
  594. },
  595. };
  596. static const struct freq_tbl ftbl_blsp1_uart1_apps_clk_src[] = {
  597. F(3686400, P_GPLL0_OUT_MAIN, 1, 96, 15625),
  598. F(7372800, P_GPLL0_OUT_MAIN, 1, 192, 15625),
  599. F(14745600, P_GPLL0_OUT_MAIN, 1, 384, 15625),
  600. F(16000000, P_GPLL0_OUT_MAIN, 5, 2, 15),
  601. F(19200000, P_XO, 1, 0, 0),
  602. F(24000000, P_GPLL0_OUT_MAIN, 5, 1, 5),
  603. F(32000000, P_GPLL0_OUT_MAIN, 1, 4, 75),
  604. F(40000000, P_GPLL0_OUT_MAIN, 15, 0, 0),
  605. F(46400000, P_GPLL0_OUT_MAIN, 1, 29, 375),
  606. F(48000000, P_GPLL0_OUT_MAIN, 12.5, 0, 0),
  607. F(51200000, P_GPLL0_OUT_MAIN, 1, 32, 375),
  608. F(56000000, P_GPLL0_OUT_MAIN, 1, 7, 75),
  609. F(58982400, P_GPLL0_OUT_MAIN, 1, 1536, 15625),
  610. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  611. F(63157895, P_GPLL0_OUT_MAIN, 9.5, 0, 0),
  612. { }
  613. };
  614. static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
  615. .cmd_rcgr = 0x1a00c,
  616. .mnd_width = 16,
  617. .hid_width = 5,
  618. .parent_map = gcc_parent_map_0,
  619. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  620. .clkr.hw.init = &(struct clk_init_data){
  621. .name = "blsp1_uart1_apps_clk_src",
  622. .parent_data = gcc_parent_data_0,
  623. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  624. .ops = &clk_rcg2_ops,
  625. },
  626. };
  627. static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
  628. .cmd_rcgr = 0x1c00c,
  629. .mnd_width = 16,
  630. .hid_width = 5,
  631. .parent_map = gcc_parent_map_0,
  632. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  633. .clkr.hw.init = &(struct clk_init_data){
  634. .name = "blsp1_uart2_apps_clk_src",
  635. .parent_data = gcc_parent_data_0,
  636. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  637. .ops = &clk_rcg2_ops,
  638. },
  639. };
  640. static struct clk_rcg2 blsp1_uart3_apps_clk_src = {
  641. .cmd_rcgr = 0x1e00c,
  642. .mnd_width = 16,
  643. .hid_width = 5,
  644. .parent_map = gcc_parent_map_0,
  645. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  646. .clkr.hw.init = &(struct clk_init_data){
  647. .name = "blsp1_uart3_apps_clk_src",
  648. .parent_data = gcc_parent_data_0,
  649. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  650. .ops = &clk_rcg2_ops,
  651. },
  652. };
  653. static struct clk_rcg2 blsp2_qup1_i2c_apps_clk_src = {
  654. .cmd_rcgr = 0x26020,
  655. .mnd_width = 0,
  656. .hid_width = 5,
  657. .parent_map = gcc_parent_map_1,
  658. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  659. .clkr.hw.init = &(struct clk_init_data){
  660. .name = "blsp2_qup1_i2c_apps_clk_src",
  661. .parent_data = gcc_parent_data_1,
  662. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  663. .ops = &clk_rcg2_ops,
  664. },
  665. };
  666. static struct clk_rcg2 blsp2_qup1_spi_apps_clk_src = {
  667. .cmd_rcgr = 0x2600c,
  668. .mnd_width = 8,
  669. .hid_width = 5,
  670. .parent_map = gcc_parent_map_0,
  671. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  672. .clkr.hw.init = &(struct clk_init_data){
  673. .name = "blsp2_qup1_spi_apps_clk_src",
  674. .parent_data = gcc_parent_data_0,
  675. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  676. .ops = &clk_rcg2_ops,
  677. },
  678. };
  679. static struct clk_rcg2 blsp2_qup2_i2c_apps_clk_src = {
  680. .cmd_rcgr = 0x28020,
  681. .mnd_width = 0,
  682. .hid_width = 5,
  683. .parent_map = gcc_parent_map_1,
  684. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  685. .clkr.hw.init = &(struct clk_init_data){
  686. .name = "blsp2_qup2_i2c_apps_clk_src",
  687. .parent_data = gcc_parent_data_1,
  688. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  689. .ops = &clk_rcg2_ops,
  690. },
  691. };
  692. static struct clk_rcg2 blsp2_qup2_spi_apps_clk_src = {
  693. .cmd_rcgr = 0x2800c,
  694. .mnd_width = 8,
  695. .hid_width = 5,
  696. .parent_map = gcc_parent_map_0,
  697. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  698. .clkr.hw.init = &(struct clk_init_data){
  699. .name = "blsp2_qup2_spi_apps_clk_src",
  700. .parent_data = gcc_parent_data_0,
  701. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  702. .ops = &clk_rcg2_ops,
  703. },
  704. };
  705. static struct clk_rcg2 blsp2_qup3_i2c_apps_clk_src = {
  706. .cmd_rcgr = 0x2a020,
  707. .mnd_width = 0,
  708. .hid_width = 5,
  709. .parent_map = gcc_parent_map_1,
  710. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  711. .clkr.hw.init = &(struct clk_init_data){
  712. .name = "blsp2_qup3_i2c_apps_clk_src",
  713. .parent_data = gcc_parent_data_1,
  714. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  715. .ops = &clk_rcg2_ops,
  716. },
  717. };
  718. static struct clk_rcg2 blsp2_qup3_spi_apps_clk_src = {
  719. .cmd_rcgr = 0x2a00c,
  720. .mnd_width = 8,
  721. .hid_width = 5,
  722. .parent_map = gcc_parent_map_0,
  723. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  724. .clkr.hw.init = &(struct clk_init_data){
  725. .name = "blsp2_qup3_spi_apps_clk_src",
  726. .parent_data = gcc_parent_data_0,
  727. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  728. .ops = &clk_rcg2_ops,
  729. },
  730. };
  731. static struct clk_rcg2 blsp2_qup4_i2c_apps_clk_src = {
  732. .cmd_rcgr = 0x2c020,
  733. .mnd_width = 0,
  734. .hid_width = 5,
  735. .parent_map = gcc_parent_map_1,
  736. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  737. .clkr.hw.init = &(struct clk_init_data){
  738. .name = "blsp2_qup4_i2c_apps_clk_src",
  739. .parent_data = gcc_parent_data_1,
  740. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  741. .ops = &clk_rcg2_ops,
  742. },
  743. };
  744. static struct clk_rcg2 blsp2_qup4_spi_apps_clk_src = {
  745. .cmd_rcgr = 0x2c00c,
  746. .mnd_width = 8,
  747. .hid_width = 5,
  748. .parent_map = gcc_parent_map_0,
  749. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  750. .clkr.hw.init = &(struct clk_init_data){
  751. .name = "blsp2_qup4_spi_apps_clk_src",
  752. .parent_data = gcc_parent_data_0,
  753. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  754. .ops = &clk_rcg2_ops,
  755. },
  756. };
  757. static struct clk_rcg2 blsp2_qup5_i2c_apps_clk_src = {
  758. .cmd_rcgr = 0x2e020,
  759. .mnd_width = 0,
  760. .hid_width = 5,
  761. .parent_map = gcc_parent_map_1,
  762. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  763. .clkr.hw.init = &(struct clk_init_data){
  764. .name = "blsp2_qup5_i2c_apps_clk_src",
  765. .parent_data = gcc_parent_data_1,
  766. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  767. .ops = &clk_rcg2_ops,
  768. },
  769. };
  770. static struct clk_rcg2 blsp2_qup5_spi_apps_clk_src = {
  771. .cmd_rcgr = 0x2e00c,
  772. .mnd_width = 8,
  773. .hid_width = 5,
  774. .parent_map = gcc_parent_map_0,
  775. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  776. .clkr.hw.init = &(struct clk_init_data){
  777. .name = "blsp2_qup5_spi_apps_clk_src",
  778. .parent_data = gcc_parent_data_0,
  779. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  780. .ops = &clk_rcg2_ops,
  781. },
  782. };
  783. static struct clk_rcg2 blsp2_qup6_i2c_apps_clk_src = {
  784. .cmd_rcgr = 0x30020,
  785. .mnd_width = 0,
  786. .hid_width = 5,
  787. .parent_map = gcc_parent_map_1,
  788. .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src,
  789. .clkr.hw.init = &(struct clk_init_data){
  790. .name = "blsp2_qup6_i2c_apps_clk_src",
  791. .parent_data = gcc_parent_data_1,
  792. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  793. .ops = &clk_rcg2_ops,
  794. },
  795. };
  796. static struct clk_rcg2 blsp2_qup6_spi_apps_clk_src = {
  797. .cmd_rcgr = 0x3000c,
  798. .mnd_width = 8,
  799. .hid_width = 5,
  800. .parent_map = gcc_parent_map_0,
  801. .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src,
  802. .clkr.hw.init = &(struct clk_init_data){
  803. .name = "blsp2_qup6_spi_apps_clk_src",
  804. .parent_data = gcc_parent_data_0,
  805. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  806. .ops = &clk_rcg2_ops,
  807. },
  808. };
  809. static struct clk_rcg2 blsp2_uart1_apps_clk_src = {
  810. .cmd_rcgr = 0x2700c,
  811. .mnd_width = 16,
  812. .hid_width = 5,
  813. .parent_map = gcc_parent_map_0,
  814. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  815. .clkr.hw.init = &(struct clk_init_data){
  816. .name = "blsp2_uart1_apps_clk_src",
  817. .parent_data = gcc_parent_data_0,
  818. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  819. .ops = &clk_rcg2_ops,
  820. },
  821. };
  822. static struct clk_rcg2 blsp2_uart2_apps_clk_src = {
  823. .cmd_rcgr = 0x2900c,
  824. .mnd_width = 16,
  825. .hid_width = 5,
  826. .parent_map = gcc_parent_map_0,
  827. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  828. .clkr.hw.init = &(struct clk_init_data){
  829. .name = "blsp2_uart2_apps_clk_src",
  830. .parent_data = gcc_parent_data_0,
  831. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  832. .ops = &clk_rcg2_ops,
  833. },
  834. };
  835. static struct clk_rcg2 blsp2_uart3_apps_clk_src = {
  836. .cmd_rcgr = 0x2b00c,
  837. .mnd_width = 16,
  838. .hid_width = 5,
  839. .parent_map = gcc_parent_map_0,
  840. .freq_tbl = ftbl_blsp1_uart1_apps_clk_src,
  841. .clkr.hw.init = &(struct clk_init_data){
  842. .name = "blsp2_uart3_apps_clk_src",
  843. .parent_data = gcc_parent_data_0,
  844. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  845. .ops = &clk_rcg2_ops,
  846. },
  847. };
  848. static const struct freq_tbl ftbl_gp1_clk_src[] = {
  849. F(19200000, P_XO, 1, 0, 0),
  850. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  851. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  852. { }
  853. };
  854. static struct clk_rcg2 gp1_clk_src = {
  855. .cmd_rcgr = 0x64004,
  856. .mnd_width = 8,
  857. .hid_width = 5,
  858. .parent_map = gcc_parent_map_2,
  859. .freq_tbl = ftbl_gp1_clk_src,
  860. .clkr.hw.init = &(struct clk_init_data){
  861. .name = "gp1_clk_src",
  862. .parent_data = gcc_parent_data_2,
  863. .num_parents = ARRAY_SIZE(gcc_parent_data_2),
  864. .ops = &clk_rcg2_ops,
  865. },
  866. };
  867. static struct clk_rcg2 gp2_clk_src = {
  868. .cmd_rcgr = 0x65004,
  869. .mnd_width = 8,
  870. .hid_width = 5,
  871. .parent_map = gcc_parent_map_2,
  872. .freq_tbl = ftbl_gp1_clk_src,
  873. .clkr.hw.init = &(struct clk_init_data){
  874. .name = "gp2_clk_src",
  875. .parent_data = gcc_parent_data_2,
  876. .num_parents = ARRAY_SIZE(gcc_parent_data_2),
  877. .ops = &clk_rcg2_ops,
  878. },
  879. };
  880. static struct clk_rcg2 gp3_clk_src = {
  881. .cmd_rcgr = 0x66004,
  882. .mnd_width = 8,
  883. .hid_width = 5,
  884. .parent_map = gcc_parent_map_2,
  885. .freq_tbl = ftbl_gp1_clk_src,
  886. .clkr.hw.init = &(struct clk_init_data){
  887. .name = "gp3_clk_src",
  888. .parent_data = gcc_parent_data_2,
  889. .num_parents = ARRAY_SIZE(gcc_parent_data_2),
  890. .ops = &clk_rcg2_ops,
  891. },
  892. };
  893. static const struct freq_tbl ftbl_hmss_ahb_clk_src[] = {
  894. F(19200000, P_XO, 1, 0, 0),
  895. F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0),
  896. F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
  897. { }
  898. };
  899. static struct clk_rcg2 hmss_ahb_clk_src = {
  900. .cmd_rcgr = 0x48014,
  901. .mnd_width = 0,
  902. .hid_width = 5,
  903. .parent_map = gcc_parent_map_1,
  904. .freq_tbl = ftbl_hmss_ahb_clk_src,
  905. .clkr.hw.init = &(struct clk_init_data){
  906. .name = "hmss_ahb_clk_src",
  907. .parent_data = gcc_parent_data_1,
  908. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  909. .ops = &clk_rcg2_ops,
  910. },
  911. };
  912. static const struct freq_tbl ftbl_hmss_rbcpr_clk_src[] = {
  913. F(19200000, P_XO, 1, 0, 0),
  914. { }
  915. };
  916. static struct clk_rcg2 hmss_rbcpr_clk_src = {
  917. .cmd_rcgr = 0x48044,
  918. .mnd_width = 0,
  919. .hid_width = 5,
  920. .parent_map = gcc_parent_map_1,
  921. .freq_tbl = ftbl_hmss_rbcpr_clk_src,
  922. .clkr.hw.init = &(struct clk_init_data){
  923. .name = "hmss_rbcpr_clk_src",
  924. .parent_data = gcc_parent_data_1,
  925. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  926. .ops = &clk_rcg2_ops,
  927. },
  928. };
  929. static const struct freq_tbl ftbl_pcie_aux_clk_src[] = {
  930. F(1010526, P_XO, 1, 1, 19),
  931. { }
  932. };
  933. static struct clk_rcg2 pcie_aux_clk_src = {
  934. .cmd_rcgr = 0x6c000,
  935. .mnd_width = 16,
  936. .hid_width = 5,
  937. .parent_map = gcc_parent_map_3,
  938. .freq_tbl = ftbl_pcie_aux_clk_src,
  939. .clkr.hw.init = &(struct clk_init_data){
  940. .name = "pcie_aux_clk_src",
  941. .parent_data = gcc_parent_data_3,
  942. .num_parents = ARRAY_SIZE(gcc_parent_data_3),
  943. .ops = &clk_rcg2_ops,
  944. },
  945. };
  946. static const struct freq_tbl ftbl_pdm2_clk_src[] = {
  947. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  948. { }
  949. };
  950. static struct clk_rcg2 pdm2_clk_src = {
  951. .cmd_rcgr = 0x33010,
  952. .mnd_width = 0,
  953. .hid_width = 5,
  954. .parent_map = gcc_parent_map_1,
  955. .freq_tbl = ftbl_pdm2_clk_src,
  956. .clkr.hw.init = &(struct clk_init_data){
  957. .name = "pdm2_clk_src",
  958. .parent_data = gcc_parent_data_1,
  959. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  960. .ops = &clk_rcg2_ops,
  961. },
  962. };
  963. static const struct freq_tbl ftbl_sdcc2_apps_clk_src[] = {
  964. F(144000, P_XO, 16, 3, 25),
  965. F(400000, P_XO, 12, 1, 4),
  966. F(20000000, P_GPLL0_OUT_MAIN, 15, 1, 2),
  967. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  968. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  969. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  970. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  971. { }
  972. };
  973. static struct clk_rcg2 sdcc2_apps_clk_src = {
  974. .cmd_rcgr = 0x14010,
  975. .mnd_width = 8,
  976. .hid_width = 5,
  977. .parent_map = gcc_parent_map_4,
  978. .freq_tbl = ftbl_sdcc2_apps_clk_src,
  979. .clkr.hw.init = &(struct clk_init_data){
  980. .name = "sdcc2_apps_clk_src",
  981. .parent_data = gcc_parent_data_4,
  982. .num_parents = ARRAY_SIZE(gcc_parent_data_4),
  983. .ops = &clk_rcg2_floor_ops,
  984. },
  985. };
  986. static const struct freq_tbl ftbl_sdcc4_apps_clk_src[] = {
  987. F(144000, P_XO, 16, 3, 25),
  988. F(400000, P_XO, 12, 1, 4),
  989. F(20000000, P_GPLL0_OUT_MAIN, 15, 1, 2),
  990. F(25000000, P_GPLL0_OUT_MAIN, 12, 1, 2),
  991. F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
  992. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  993. { }
  994. };
  995. static struct clk_rcg2 sdcc4_apps_clk_src = {
  996. .cmd_rcgr = 0x16010,
  997. .mnd_width = 8,
  998. .hid_width = 5,
  999. .parent_map = gcc_parent_map_1,
  1000. .freq_tbl = ftbl_sdcc4_apps_clk_src,
  1001. .clkr.hw.init = &(struct clk_init_data){
  1002. .name = "sdcc4_apps_clk_src",
  1003. .parent_data = gcc_parent_data_1,
  1004. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  1005. .ops = &clk_rcg2_floor_ops,
  1006. },
  1007. };
  1008. static const struct freq_tbl ftbl_tsif_ref_clk_src[] = {
  1009. F(105495, P_XO, 1, 1, 182),
  1010. { }
  1011. };
  1012. static struct clk_rcg2 tsif_ref_clk_src = {
  1013. .cmd_rcgr = 0x36010,
  1014. .mnd_width = 8,
  1015. .hid_width = 5,
  1016. .parent_map = gcc_parent_map_5,
  1017. .freq_tbl = ftbl_tsif_ref_clk_src,
  1018. .clkr.hw.init = &(struct clk_init_data){
  1019. .name = "tsif_ref_clk_src",
  1020. .parent_data = gcc_parent_data_5,
  1021. .num_parents = ARRAY_SIZE(gcc_parent_data_5),
  1022. .ops = &clk_rcg2_ops,
  1023. },
  1024. };
  1025. static const struct freq_tbl ftbl_ufs_axi_clk_src[] = {
  1026. F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
  1027. F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
  1028. F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
  1029. { }
  1030. };
  1031. static struct clk_rcg2 ufs_axi_clk_src = {
  1032. .cmd_rcgr = 0x75018,
  1033. .mnd_width = 8,
  1034. .hid_width = 5,
  1035. .parent_map = gcc_parent_map_0,
  1036. .freq_tbl = ftbl_ufs_axi_clk_src,
  1037. .clkr.hw.init = &(struct clk_init_data){
  1038. .name = "ufs_axi_clk_src",
  1039. .parent_data = gcc_parent_data_0,
  1040. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  1041. .ops = &clk_rcg2_ops,
  1042. },
  1043. };
  1044. static const struct freq_tbl ftbl_ufs_unipro_core_clk_src[] = {
  1045. F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0),
  1046. F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
  1047. F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
  1048. { }
  1049. };
  1050. static struct clk_rcg2 ufs_unipro_core_clk_src = {
  1051. .cmd_rcgr = 0x76028,
  1052. .mnd_width = 8,
  1053. .hid_width = 5,
  1054. .parent_map = gcc_parent_map_0,
  1055. .freq_tbl = ftbl_ufs_unipro_core_clk_src,
  1056. .clkr.hw.init = &(struct clk_init_data){
  1057. .name = "ufs_unipro_core_clk_src",
  1058. .parent_data = gcc_parent_data_0,
  1059. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  1060. .ops = &clk_rcg2_ops,
  1061. },
  1062. };
  1063. static const struct freq_tbl ftbl_usb30_master_clk_src[] = {
  1064. F(19200000, P_XO, 1, 0, 0),
  1065. F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
  1066. F(120000000, P_GPLL0_OUT_MAIN, 5, 0, 0),
  1067. F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
  1068. { }
  1069. };
  1070. static struct clk_rcg2 usb30_master_clk_src = {
  1071. .cmd_rcgr = 0xf014,
  1072. .mnd_width = 8,
  1073. .hid_width = 5,
  1074. .parent_map = gcc_parent_map_0,
  1075. .freq_tbl = ftbl_usb30_master_clk_src,
  1076. .clkr.hw.init = &(struct clk_init_data){
  1077. .name = "usb30_master_clk_src",
  1078. .parent_data = gcc_parent_data_0,
  1079. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  1080. .ops = &clk_rcg2_ops,
  1081. },
  1082. };
  1083. static struct clk_rcg2 usb30_mock_utmi_clk_src = {
  1084. .cmd_rcgr = 0xf028,
  1085. .mnd_width = 0,
  1086. .hid_width = 5,
  1087. .parent_map = gcc_parent_map_0,
  1088. .freq_tbl = ftbl_hmss_rbcpr_clk_src,
  1089. .clkr.hw.init = &(struct clk_init_data){
  1090. .name = "usb30_mock_utmi_clk_src",
  1091. .parent_data = gcc_parent_data_0,
  1092. .num_parents = ARRAY_SIZE(gcc_parent_data_0),
  1093. .ops = &clk_rcg2_ops,
  1094. },
  1095. };
  1096. static const struct freq_tbl ftbl_usb3_phy_aux_clk_src[] = {
  1097. F(1200000, P_XO, 16, 0, 0),
  1098. { }
  1099. };
  1100. static struct clk_rcg2 usb3_phy_aux_clk_src = {
  1101. .cmd_rcgr = 0x5000c,
  1102. .mnd_width = 0,
  1103. .hid_width = 5,
  1104. .parent_map = gcc_parent_map_3,
  1105. .freq_tbl = ftbl_usb3_phy_aux_clk_src,
  1106. .clkr.hw.init = &(struct clk_init_data){
  1107. .name = "usb3_phy_aux_clk_src",
  1108. .parent_data = gcc_parent_data_3,
  1109. .num_parents = ARRAY_SIZE(gcc_parent_data_3),
  1110. .ops = &clk_rcg2_ops,
  1111. },
  1112. };
  1113. static struct clk_branch gcc_aggre1_noc_xo_clk = {
  1114. .halt_reg = 0x8202c,
  1115. .halt_check = BRANCH_HALT,
  1116. .clkr = {
  1117. .enable_reg = 0x8202c,
  1118. .enable_mask = BIT(0),
  1119. .hw.init = &(struct clk_init_data){
  1120. .name = "gcc_aggre1_noc_xo_clk",
  1121. .ops = &clk_branch2_ops,
  1122. },
  1123. },
  1124. };
  1125. static struct clk_branch gcc_aggre1_ufs_axi_clk = {
  1126. .halt_reg = 0x82028,
  1127. .halt_check = BRANCH_HALT,
  1128. .clkr = {
  1129. .enable_reg = 0x82028,
  1130. .enable_mask = BIT(0),
  1131. .hw.init = &(struct clk_init_data){
  1132. .name = "gcc_aggre1_ufs_axi_clk",
  1133. .parent_hws = (const struct clk_hw *[]) {
  1134. &ufs_axi_clk_src.clkr.hw,
  1135. },
  1136. .num_parents = 1,
  1137. .flags = CLK_SET_RATE_PARENT,
  1138. .ops = &clk_branch2_ops,
  1139. },
  1140. },
  1141. };
  1142. static struct clk_branch gcc_aggre1_usb3_axi_clk = {
  1143. .halt_reg = 0x82024,
  1144. .halt_check = BRANCH_HALT,
  1145. .clkr = {
  1146. .enable_reg = 0x82024,
  1147. .enable_mask = BIT(0),
  1148. .hw.init = &(struct clk_init_data){
  1149. .name = "gcc_aggre1_usb3_axi_clk",
  1150. .parent_hws = (const struct clk_hw *[]) {
  1151. &usb30_master_clk_src.clkr.hw,
  1152. },
  1153. .num_parents = 1,
  1154. .flags = CLK_SET_RATE_PARENT,
  1155. .ops = &clk_branch2_ops,
  1156. },
  1157. },
  1158. };
  1159. static struct clk_branch gcc_apss_qdss_tsctr_div2_clk = {
  1160. .halt_reg = 0x48090,
  1161. .halt_check = BRANCH_HALT,
  1162. .clkr = {
  1163. .enable_reg = 0x48090,
  1164. .enable_mask = BIT(0),
  1165. .hw.init = &(struct clk_init_data){
  1166. .name = "gcc_apss_qdss_tsctr_div2_clk",
  1167. .ops = &clk_branch2_ops,
  1168. },
  1169. },
  1170. };
  1171. static struct clk_branch gcc_apss_qdss_tsctr_div8_clk = {
  1172. .halt_reg = 0x48094,
  1173. .halt_check = BRANCH_HALT,
  1174. .clkr = {
  1175. .enable_reg = 0x48094,
  1176. .enable_mask = BIT(0),
  1177. .hw.init = &(struct clk_init_data){
  1178. .name = "gcc_apss_qdss_tsctr_div8_clk",
  1179. .ops = &clk_branch2_ops,
  1180. },
  1181. },
  1182. };
  1183. static struct clk_branch gcc_bimc_hmss_axi_clk = {
  1184. .halt_reg = 0x48004,
  1185. .halt_check = BRANCH_HALT_VOTED,
  1186. .clkr = {
  1187. .enable_reg = 0x52004,
  1188. .enable_mask = BIT(22),
  1189. .hw.init = &(struct clk_init_data){
  1190. .name = "gcc_bimc_hmss_axi_clk",
  1191. .ops = &clk_branch2_ops,
  1192. },
  1193. },
  1194. };
  1195. static struct clk_branch gcc_bimc_mss_q6_axi_clk = {
  1196. .halt_reg = 0x4401c,
  1197. .halt_check = BRANCH_HALT,
  1198. .clkr = {
  1199. .enable_reg = 0x4401c,
  1200. .enable_mask = BIT(0),
  1201. .hw.init = &(struct clk_init_data){
  1202. .name = "gcc_bimc_mss_q6_axi_clk",
  1203. .ops = &clk_branch2_ops,
  1204. },
  1205. },
  1206. };
  1207. static struct clk_branch gcc_mss_cfg_ahb_clk = {
  1208. .halt_reg = 0x8a000,
  1209. .halt_check = BRANCH_HALT,
  1210. .clkr = {
  1211. .enable_reg = 0x8a000,
  1212. .enable_mask = BIT(0),
  1213. .hw.init = &(struct clk_init_data){
  1214. .name = "gcc_mss_cfg_ahb_clk",
  1215. .ops = &clk_branch2_ops,
  1216. },
  1217. },
  1218. };
  1219. static struct clk_branch gcc_mss_snoc_axi_clk = {
  1220. .halt_reg = 0x8a03c,
  1221. .halt_check = BRANCH_HALT,
  1222. .clkr = {
  1223. .enable_reg = 0x8a03c,
  1224. .enable_mask = BIT(0),
  1225. .hw.init = &(struct clk_init_data){
  1226. .name = "gcc_mss_snoc_axi_clk",
  1227. .ops = &clk_branch2_ops,
  1228. },
  1229. },
  1230. };
  1231. static struct clk_branch gcc_mss_mnoc_bimc_axi_clk = {
  1232. .halt_reg = 0x8a004,
  1233. .halt_check = BRANCH_HALT,
  1234. .clkr = {
  1235. .enable_reg = 0x8a004,
  1236. .enable_mask = BIT(0),
  1237. .hw.init = &(struct clk_init_data){
  1238. .name = "gcc_mss_mnoc_bimc_axi_clk",
  1239. .ops = &clk_branch2_ops,
  1240. },
  1241. },
  1242. };
  1243. static struct clk_branch gcc_boot_rom_ahb_clk = {
  1244. .halt_reg = 0x38004,
  1245. .halt_check = BRANCH_HALT_VOTED,
  1246. .hwcg_reg = 0x38004,
  1247. .hwcg_bit = 1,
  1248. .clkr = {
  1249. .enable_reg = 0x52004,
  1250. .enable_mask = BIT(10),
  1251. .hw.init = &(struct clk_init_data){
  1252. .name = "gcc_boot_rom_ahb_clk",
  1253. .ops = &clk_branch2_ops,
  1254. },
  1255. },
  1256. };
  1257. static struct clk_branch gcc_mmss_gpll0_div_clk = {
  1258. .halt_check = BRANCH_HALT_DELAY,
  1259. .clkr = {
  1260. .enable_reg = 0x5200c,
  1261. .enable_mask = BIT(0),
  1262. .hw.init = &(struct clk_init_data){
  1263. .name = "gcc_mmss_gpll0_div_clk",
  1264. .parent_hws = (const struct clk_hw *[]) {
  1265. &gpll0_out_main.clkr.hw,
  1266. },
  1267. .num_parents = 1,
  1268. .ops = &clk_branch2_ops,
  1269. },
  1270. },
  1271. };
  1272. static struct clk_branch gcc_mmss_gpll0_clk = {
  1273. .halt_check = BRANCH_HALT_DELAY,
  1274. .clkr = {
  1275. .enable_reg = 0x5200c,
  1276. .enable_mask = BIT(1),
  1277. .hw.init = &(struct clk_init_data){
  1278. .name = "gcc_mmss_gpll0_clk",
  1279. .parent_hws = (const struct clk_hw *[]) {
  1280. &gpll0_out_main.clkr.hw,
  1281. },
  1282. .num_parents = 1,
  1283. .ops = &clk_branch2_ops,
  1284. },
  1285. },
  1286. };
  1287. static struct clk_branch gcc_mss_gpll0_div_clk_src = {
  1288. .halt_check = BRANCH_HALT_DELAY,
  1289. .clkr = {
  1290. .enable_reg = 0x5200c,
  1291. .enable_mask = BIT(2),
  1292. .hw.init = &(struct clk_init_data){
  1293. .name = "gcc_mss_gpll0_div_clk_src",
  1294. .ops = &clk_branch2_ops,
  1295. },
  1296. },
  1297. };
  1298. static struct clk_branch gcc_gpu_gpll0_div_clk = {
  1299. .halt_check = BRANCH_HALT_DELAY,
  1300. .clkr = {
  1301. .enable_reg = 0x5200c,
  1302. .enable_mask = BIT(3),
  1303. .hw.init = &(struct clk_init_data){
  1304. .name = "gcc_gpu_gpll0_div_clk",
  1305. .parent_hws = (const struct clk_hw *[]) {
  1306. &gpll0_out_main.clkr.hw,
  1307. },
  1308. .num_parents = 1,
  1309. .ops = &clk_branch2_ops,
  1310. },
  1311. },
  1312. };
  1313. static struct clk_branch gcc_gpu_gpll0_clk = {
  1314. .halt_check = BRANCH_HALT_DELAY,
  1315. .clkr = {
  1316. .enable_reg = 0x5200c,
  1317. .enable_mask = BIT(4),
  1318. .hw.init = &(struct clk_init_data){
  1319. .name = "gcc_gpu_gpll0_clk",
  1320. .parent_hws = (const struct clk_hw *[]) {
  1321. &gpll0_out_main.clkr.hw,
  1322. },
  1323. .num_parents = 1,
  1324. .ops = &clk_branch2_ops,
  1325. },
  1326. },
  1327. };
  1328. static struct clk_branch gcc_blsp1_ahb_clk = {
  1329. .halt_reg = 0x17004,
  1330. .halt_check = BRANCH_HALT_VOTED,
  1331. .clkr = {
  1332. .enable_reg = 0x52004,
  1333. .enable_mask = BIT(17),
  1334. .hw.init = &(struct clk_init_data){
  1335. .name = "gcc_blsp1_ahb_clk",
  1336. .ops = &clk_branch2_ops,
  1337. },
  1338. },
  1339. };
  1340. static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
  1341. .halt_reg = 0x19008,
  1342. .halt_check = BRANCH_HALT,
  1343. .clkr = {
  1344. .enable_reg = 0x19008,
  1345. .enable_mask = BIT(0),
  1346. .hw.init = &(struct clk_init_data){
  1347. .name = "gcc_blsp1_qup1_i2c_apps_clk",
  1348. .parent_hws = (const struct clk_hw *[]) {
  1349. &blsp1_qup1_i2c_apps_clk_src.clkr.hw,
  1350. },
  1351. .num_parents = 1,
  1352. .flags = CLK_SET_RATE_PARENT,
  1353. .ops = &clk_branch2_ops,
  1354. },
  1355. },
  1356. };
  1357. static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
  1358. .halt_reg = 0x19004,
  1359. .halt_check = BRANCH_HALT,
  1360. .clkr = {
  1361. .enable_reg = 0x19004,
  1362. .enable_mask = BIT(0),
  1363. .hw.init = &(struct clk_init_data){
  1364. .name = "gcc_blsp1_qup1_spi_apps_clk",
  1365. .parent_hws = (const struct clk_hw *[]) {
  1366. &blsp1_qup1_spi_apps_clk_src.clkr.hw,
  1367. },
  1368. .num_parents = 1,
  1369. .flags = CLK_SET_RATE_PARENT,
  1370. .ops = &clk_branch2_ops,
  1371. },
  1372. },
  1373. };
  1374. static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
  1375. .halt_reg = 0x1b008,
  1376. .halt_check = BRANCH_HALT,
  1377. .clkr = {
  1378. .enable_reg = 0x1b008,
  1379. .enable_mask = BIT(0),
  1380. .hw.init = &(struct clk_init_data){
  1381. .name = "gcc_blsp1_qup2_i2c_apps_clk",
  1382. .parent_hws = (const struct clk_hw *[]) {
  1383. &blsp1_qup2_i2c_apps_clk_src.clkr.hw,
  1384. },
  1385. .num_parents = 1,
  1386. .flags = CLK_SET_RATE_PARENT,
  1387. .ops = &clk_branch2_ops,
  1388. },
  1389. },
  1390. };
  1391. static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
  1392. .halt_reg = 0x1b004,
  1393. .halt_check = BRANCH_HALT,
  1394. .clkr = {
  1395. .enable_reg = 0x1b004,
  1396. .enable_mask = BIT(0),
  1397. .hw.init = &(struct clk_init_data){
  1398. .name = "gcc_blsp1_qup2_spi_apps_clk",
  1399. .parent_hws = (const struct clk_hw *[]) {
  1400. &blsp1_qup2_spi_apps_clk_src.clkr.hw,
  1401. },
  1402. .num_parents = 1,
  1403. .flags = CLK_SET_RATE_PARENT,
  1404. .ops = &clk_branch2_ops,
  1405. },
  1406. },
  1407. };
  1408. static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
  1409. .halt_reg = 0x1d008,
  1410. .halt_check = BRANCH_HALT,
  1411. .clkr = {
  1412. .enable_reg = 0x1d008,
  1413. .enable_mask = BIT(0),
  1414. .hw.init = &(struct clk_init_data){
  1415. .name = "gcc_blsp1_qup3_i2c_apps_clk",
  1416. .parent_hws = (const struct clk_hw *[]) {
  1417. &blsp1_qup3_i2c_apps_clk_src.clkr.hw,
  1418. },
  1419. .num_parents = 1,
  1420. .flags = CLK_SET_RATE_PARENT,
  1421. .ops = &clk_branch2_ops,
  1422. },
  1423. },
  1424. };
  1425. static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = {
  1426. .halt_reg = 0x1d004,
  1427. .halt_check = BRANCH_HALT,
  1428. .clkr = {
  1429. .enable_reg = 0x1d004,
  1430. .enable_mask = BIT(0),
  1431. .hw.init = &(struct clk_init_data){
  1432. .name = "gcc_blsp1_qup3_spi_apps_clk",
  1433. .parent_hws = (const struct clk_hw *[]) {
  1434. &blsp1_qup3_spi_apps_clk_src.clkr.hw,
  1435. },
  1436. .num_parents = 1,
  1437. .flags = CLK_SET_RATE_PARENT,
  1438. .ops = &clk_branch2_ops,
  1439. },
  1440. },
  1441. };
  1442. static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
  1443. .halt_reg = 0x1f008,
  1444. .halt_check = BRANCH_HALT,
  1445. .clkr = {
  1446. .enable_reg = 0x1f008,
  1447. .enable_mask = BIT(0),
  1448. .hw.init = &(struct clk_init_data){
  1449. .name = "gcc_blsp1_qup4_i2c_apps_clk",
  1450. .parent_hws = (const struct clk_hw *[]) {
  1451. &blsp1_qup4_i2c_apps_clk_src.clkr.hw,
  1452. },
  1453. .num_parents = 1,
  1454. .flags = CLK_SET_RATE_PARENT,
  1455. .ops = &clk_branch2_ops,
  1456. },
  1457. },
  1458. };
  1459. static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
  1460. .halt_reg = 0x1f004,
  1461. .halt_check = BRANCH_HALT,
  1462. .clkr = {
  1463. .enable_reg = 0x1f004,
  1464. .enable_mask = BIT(0),
  1465. .hw.init = &(struct clk_init_data){
  1466. .name = "gcc_blsp1_qup4_spi_apps_clk",
  1467. .parent_hws = (const struct clk_hw *[]) {
  1468. &blsp1_qup4_spi_apps_clk_src.clkr.hw,
  1469. },
  1470. .num_parents = 1,
  1471. .flags = CLK_SET_RATE_PARENT,
  1472. .ops = &clk_branch2_ops,
  1473. },
  1474. },
  1475. };
  1476. static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
  1477. .halt_reg = 0x21008,
  1478. .halt_check = BRANCH_HALT,
  1479. .clkr = {
  1480. .enable_reg = 0x21008,
  1481. .enable_mask = BIT(0),
  1482. .hw.init = &(struct clk_init_data){
  1483. .name = "gcc_blsp1_qup5_i2c_apps_clk",
  1484. .parent_hws = (const struct clk_hw *[]) {
  1485. &blsp1_qup5_i2c_apps_clk_src.clkr.hw,
  1486. },
  1487. .num_parents = 1,
  1488. .flags = CLK_SET_RATE_PARENT,
  1489. .ops = &clk_branch2_ops,
  1490. },
  1491. },
  1492. };
  1493. static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
  1494. .halt_reg = 0x21004,
  1495. .halt_check = BRANCH_HALT,
  1496. .clkr = {
  1497. .enable_reg = 0x21004,
  1498. .enable_mask = BIT(0),
  1499. .hw.init = &(struct clk_init_data){
  1500. .name = "gcc_blsp1_qup5_spi_apps_clk",
  1501. .parent_hws = (const struct clk_hw *[]) {
  1502. &blsp1_qup5_spi_apps_clk_src.clkr.hw,
  1503. },
  1504. .num_parents = 1,
  1505. .flags = CLK_SET_RATE_PARENT,
  1506. .ops = &clk_branch2_ops,
  1507. },
  1508. },
  1509. };
  1510. static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
  1511. .halt_reg = 0x23008,
  1512. .halt_check = BRANCH_HALT,
  1513. .clkr = {
  1514. .enable_reg = 0x23008,
  1515. .enable_mask = BIT(0),
  1516. .hw.init = &(struct clk_init_data){
  1517. .name = "gcc_blsp1_qup6_i2c_apps_clk",
  1518. .parent_hws = (const struct clk_hw *[]) {
  1519. &blsp1_qup6_i2c_apps_clk_src.clkr.hw,
  1520. },
  1521. .num_parents = 1,
  1522. .flags = CLK_SET_RATE_PARENT,
  1523. .ops = &clk_branch2_ops,
  1524. },
  1525. },
  1526. };
  1527. static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
  1528. .halt_reg = 0x23004,
  1529. .halt_check = BRANCH_HALT,
  1530. .clkr = {
  1531. .enable_reg = 0x23004,
  1532. .enable_mask = BIT(0),
  1533. .hw.init = &(struct clk_init_data){
  1534. .name = "gcc_blsp1_qup6_spi_apps_clk",
  1535. .parent_hws = (const struct clk_hw *[]) {
  1536. &blsp1_qup6_spi_apps_clk_src.clkr.hw,
  1537. },
  1538. .num_parents = 1,
  1539. .flags = CLK_SET_RATE_PARENT,
  1540. .ops = &clk_branch2_ops,
  1541. },
  1542. },
  1543. };
  1544. static struct clk_branch gcc_blsp1_sleep_clk = {
  1545. .halt_reg = 0x17008,
  1546. .halt_check = BRANCH_HALT_VOTED,
  1547. .clkr = {
  1548. .enable_reg = 0x52004,
  1549. .enable_mask = BIT(16),
  1550. .hw.init = &(struct clk_init_data){
  1551. .name = "gcc_blsp1_sleep_clk",
  1552. .ops = &clk_branch2_ops,
  1553. },
  1554. },
  1555. };
  1556. static struct clk_branch gcc_blsp1_uart1_apps_clk = {
  1557. .halt_reg = 0x1a004,
  1558. .halt_check = BRANCH_HALT,
  1559. .clkr = {
  1560. .enable_reg = 0x1a004,
  1561. .enable_mask = BIT(0),
  1562. .hw.init = &(struct clk_init_data){
  1563. .name = "gcc_blsp1_uart1_apps_clk",
  1564. .parent_hws = (const struct clk_hw *[]) {
  1565. &blsp1_uart1_apps_clk_src.clkr.hw,
  1566. },
  1567. .num_parents = 1,
  1568. .flags = CLK_SET_RATE_PARENT,
  1569. .ops = &clk_branch2_ops,
  1570. },
  1571. },
  1572. };
  1573. static struct clk_branch gcc_blsp1_uart2_apps_clk = {
  1574. .halt_reg = 0x1c004,
  1575. .halt_check = BRANCH_HALT,
  1576. .clkr = {
  1577. .enable_reg = 0x1c004,
  1578. .enable_mask = BIT(0),
  1579. .hw.init = &(struct clk_init_data){
  1580. .name = "gcc_blsp1_uart2_apps_clk",
  1581. .parent_hws = (const struct clk_hw *[]) {
  1582. &blsp1_uart2_apps_clk_src.clkr.hw,
  1583. },
  1584. .num_parents = 1,
  1585. .flags = CLK_SET_RATE_PARENT,
  1586. .ops = &clk_branch2_ops,
  1587. },
  1588. },
  1589. };
  1590. static struct clk_branch gcc_blsp1_uart3_apps_clk = {
  1591. .halt_reg = 0x1e004,
  1592. .halt_check = BRANCH_HALT,
  1593. .clkr = {
  1594. .enable_reg = 0x1e004,
  1595. .enable_mask = BIT(0),
  1596. .hw.init = &(struct clk_init_data){
  1597. .name = "gcc_blsp1_uart3_apps_clk",
  1598. .parent_hws = (const struct clk_hw *[]) {
  1599. &blsp1_uart3_apps_clk_src.clkr.hw,
  1600. },
  1601. .num_parents = 1,
  1602. .flags = CLK_SET_RATE_PARENT,
  1603. .ops = &clk_branch2_ops,
  1604. },
  1605. },
  1606. };
  1607. static struct clk_branch gcc_blsp2_ahb_clk = {
  1608. .halt_reg = 0x25004,
  1609. .halt_check = BRANCH_HALT_VOTED,
  1610. .clkr = {
  1611. .enable_reg = 0x52004,
  1612. .enable_mask = BIT(15),
  1613. .hw.init = &(struct clk_init_data){
  1614. .name = "gcc_blsp2_ahb_clk",
  1615. .ops = &clk_branch2_ops,
  1616. },
  1617. },
  1618. };
  1619. static struct clk_branch gcc_blsp2_qup1_i2c_apps_clk = {
  1620. .halt_reg = 0x26008,
  1621. .halt_check = BRANCH_HALT,
  1622. .clkr = {
  1623. .enable_reg = 0x26008,
  1624. .enable_mask = BIT(0),
  1625. .hw.init = &(struct clk_init_data){
  1626. .name = "gcc_blsp2_qup1_i2c_apps_clk",
  1627. .parent_hws = (const struct clk_hw *[]) {
  1628. &blsp2_qup1_i2c_apps_clk_src.clkr.hw,
  1629. },
  1630. .num_parents = 1,
  1631. .flags = CLK_SET_RATE_PARENT,
  1632. .ops = &clk_branch2_ops,
  1633. },
  1634. },
  1635. };
  1636. static struct clk_branch gcc_blsp2_qup1_spi_apps_clk = {
  1637. .halt_reg = 0x26004,
  1638. .halt_check = BRANCH_HALT,
  1639. .clkr = {
  1640. .enable_reg = 0x26004,
  1641. .enable_mask = BIT(0),
  1642. .hw.init = &(struct clk_init_data){
  1643. .name = "gcc_blsp2_qup1_spi_apps_clk",
  1644. .parent_hws = (const struct clk_hw *[]) {
  1645. &blsp2_qup1_spi_apps_clk_src.clkr.hw,
  1646. },
  1647. .num_parents = 1,
  1648. .flags = CLK_SET_RATE_PARENT,
  1649. .ops = &clk_branch2_ops,
  1650. },
  1651. },
  1652. };
  1653. static struct clk_branch gcc_blsp2_qup2_i2c_apps_clk = {
  1654. .halt_reg = 0x28008,
  1655. .halt_check = BRANCH_HALT,
  1656. .clkr = {
  1657. .enable_reg = 0x28008,
  1658. .enable_mask = BIT(0),
  1659. .hw.init = &(struct clk_init_data){
  1660. .name = "gcc_blsp2_qup2_i2c_apps_clk",
  1661. .parent_hws = (const struct clk_hw *[]) {
  1662. &blsp2_qup2_i2c_apps_clk_src.clkr.hw,
  1663. },
  1664. .num_parents = 1,
  1665. .flags = CLK_SET_RATE_PARENT,
  1666. .ops = &clk_branch2_ops,
  1667. },
  1668. },
  1669. };
  1670. static struct clk_branch gcc_blsp2_qup2_spi_apps_clk = {
  1671. .halt_reg = 0x28004,
  1672. .halt_check = BRANCH_HALT,
  1673. .clkr = {
  1674. .enable_reg = 0x28004,
  1675. .enable_mask = BIT(0),
  1676. .hw.init = &(struct clk_init_data){
  1677. .name = "gcc_blsp2_qup2_spi_apps_clk",
  1678. .parent_hws = (const struct clk_hw *[]) {
  1679. &blsp2_qup2_spi_apps_clk_src.clkr.hw,
  1680. },
  1681. .num_parents = 1,
  1682. .flags = CLK_SET_RATE_PARENT,
  1683. .ops = &clk_branch2_ops,
  1684. },
  1685. },
  1686. };
  1687. static struct clk_branch gcc_blsp2_qup3_i2c_apps_clk = {
  1688. .halt_reg = 0x2a008,
  1689. .halt_check = BRANCH_HALT,
  1690. .clkr = {
  1691. .enable_reg = 0x2a008,
  1692. .enable_mask = BIT(0),
  1693. .hw.init = &(struct clk_init_data){
  1694. .name = "gcc_blsp2_qup3_i2c_apps_clk",
  1695. .parent_hws = (const struct clk_hw *[]) {
  1696. &blsp2_qup3_i2c_apps_clk_src.clkr.hw,
  1697. },
  1698. .num_parents = 1,
  1699. .flags = CLK_SET_RATE_PARENT,
  1700. .ops = &clk_branch2_ops,
  1701. },
  1702. },
  1703. };
  1704. static struct clk_branch gcc_blsp2_qup3_spi_apps_clk = {
  1705. .halt_reg = 0x2a004,
  1706. .halt_check = BRANCH_HALT,
  1707. .clkr = {
  1708. .enable_reg = 0x2a004,
  1709. .enable_mask = BIT(0),
  1710. .hw.init = &(struct clk_init_data){
  1711. .name = "gcc_blsp2_qup3_spi_apps_clk",
  1712. .parent_hws = (const struct clk_hw *[]) {
  1713. &blsp2_qup3_spi_apps_clk_src.clkr.hw,
  1714. },
  1715. .num_parents = 1,
  1716. .flags = CLK_SET_RATE_PARENT,
  1717. .ops = &clk_branch2_ops,
  1718. },
  1719. },
  1720. };
  1721. static struct clk_branch gcc_blsp2_qup4_i2c_apps_clk = {
  1722. .halt_reg = 0x2c008,
  1723. .halt_check = BRANCH_HALT,
  1724. .clkr = {
  1725. .enable_reg = 0x2c008,
  1726. .enable_mask = BIT(0),
  1727. .hw.init = &(struct clk_init_data){
  1728. .name = "gcc_blsp2_qup4_i2c_apps_clk",
  1729. .parent_hws = (const struct clk_hw *[]) {
  1730. &blsp2_qup4_i2c_apps_clk_src.clkr.hw,
  1731. },
  1732. .num_parents = 1,
  1733. .flags = CLK_SET_RATE_PARENT,
  1734. .ops = &clk_branch2_ops,
  1735. },
  1736. },
  1737. };
  1738. static struct clk_branch gcc_blsp2_qup4_spi_apps_clk = {
  1739. .halt_reg = 0x2c004,
  1740. .halt_check = BRANCH_HALT,
  1741. .clkr = {
  1742. .enable_reg = 0x2c004,
  1743. .enable_mask = BIT(0),
  1744. .hw.init = &(struct clk_init_data){
  1745. .name = "gcc_blsp2_qup4_spi_apps_clk",
  1746. .parent_hws = (const struct clk_hw *[]) {
  1747. &blsp2_qup4_spi_apps_clk_src.clkr.hw,
  1748. },
  1749. .num_parents = 1,
  1750. .flags = CLK_SET_RATE_PARENT,
  1751. .ops = &clk_branch2_ops,
  1752. },
  1753. },
  1754. };
  1755. static struct clk_branch gcc_blsp2_qup5_i2c_apps_clk = {
  1756. .halt_reg = 0x2e008,
  1757. .halt_check = BRANCH_HALT,
  1758. .clkr = {
  1759. .enable_reg = 0x2e008,
  1760. .enable_mask = BIT(0),
  1761. .hw.init = &(struct clk_init_data){
  1762. .name = "gcc_blsp2_qup5_i2c_apps_clk",
  1763. .parent_hws = (const struct clk_hw *[]) {
  1764. &blsp2_qup5_i2c_apps_clk_src.clkr.hw,
  1765. },
  1766. .num_parents = 1,
  1767. .flags = CLK_SET_RATE_PARENT,
  1768. .ops = &clk_branch2_ops,
  1769. },
  1770. },
  1771. };
  1772. static struct clk_branch gcc_blsp2_qup5_spi_apps_clk = {
  1773. .halt_reg = 0x2e004,
  1774. .halt_check = BRANCH_HALT,
  1775. .clkr = {
  1776. .enable_reg = 0x2e004,
  1777. .enable_mask = BIT(0),
  1778. .hw.init = &(struct clk_init_data){
  1779. .name = "gcc_blsp2_qup5_spi_apps_clk",
  1780. .parent_hws = (const struct clk_hw *[]) {
  1781. &blsp2_qup5_spi_apps_clk_src.clkr.hw,
  1782. },
  1783. .num_parents = 1,
  1784. .flags = CLK_SET_RATE_PARENT,
  1785. .ops = &clk_branch2_ops,
  1786. },
  1787. },
  1788. };
  1789. static struct clk_branch gcc_blsp2_qup6_i2c_apps_clk = {
  1790. .halt_reg = 0x30008,
  1791. .halt_check = BRANCH_HALT,
  1792. .clkr = {
  1793. .enable_reg = 0x30008,
  1794. .enable_mask = BIT(0),
  1795. .hw.init = &(struct clk_init_data){
  1796. .name = "gcc_blsp2_qup6_i2c_apps_clk",
  1797. .parent_hws = (const struct clk_hw *[]) {
  1798. &blsp2_qup6_i2c_apps_clk_src.clkr.hw,
  1799. },
  1800. .num_parents = 1,
  1801. .flags = CLK_SET_RATE_PARENT,
  1802. .ops = &clk_branch2_ops,
  1803. },
  1804. },
  1805. };
  1806. static struct clk_branch gcc_blsp2_qup6_spi_apps_clk = {
  1807. .halt_reg = 0x30004,
  1808. .halt_check = BRANCH_HALT,
  1809. .clkr = {
  1810. .enable_reg = 0x30004,
  1811. .enable_mask = BIT(0),
  1812. .hw.init = &(struct clk_init_data){
  1813. .name = "gcc_blsp2_qup6_spi_apps_clk",
  1814. .parent_hws = (const struct clk_hw *[]) {
  1815. &blsp2_qup6_spi_apps_clk_src.clkr.hw,
  1816. },
  1817. .num_parents = 1,
  1818. .flags = CLK_SET_RATE_PARENT,
  1819. .ops = &clk_branch2_ops,
  1820. },
  1821. },
  1822. };
  1823. static struct clk_branch gcc_blsp2_sleep_clk = {
  1824. .halt_reg = 0x25008,
  1825. .halt_check = BRANCH_HALT_VOTED,
  1826. .clkr = {
  1827. .enable_reg = 0x52004,
  1828. .enable_mask = BIT(14),
  1829. .hw.init = &(struct clk_init_data){
  1830. .name = "gcc_blsp2_sleep_clk",
  1831. .ops = &clk_branch2_ops,
  1832. },
  1833. },
  1834. };
  1835. static struct clk_branch gcc_blsp2_uart1_apps_clk = {
  1836. .halt_reg = 0x27004,
  1837. .halt_check = BRANCH_HALT,
  1838. .clkr = {
  1839. .enable_reg = 0x27004,
  1840. .enable_mask = BIT(0),
  1841. .hw.init = &(struct clk_init_data){
  1842. .name = "gcc_blsp2_uart1_apps_clk",
  1843. .parent_hws = (const struct clk_hw *[]) {
  1844. &blsp2_uart1_apps_clk_src.clkr.hw,
  1845. },
  1846. .num_parents = 1,
  1847. .flags = CLK_SET_RATE_PARENT,
  1848. .ops = &clk_branch2_ops,
  1849. },
  1850. },
  1851. };
  1852. static struct clk_branch gcc_blsp2_uart2_apps_clk = {
  1853. .halt_reg = 0x29004,
  1854. .halt_check = BRANCH_HALT,
  1855. .clkr = {
  1856. .enable_reg = 0x29004,
  1857. .enable_mask = BIT(0),
  1858. .hw.init = &(struct clk_init_data){
  1859. .name = "gcc_blsp2_uart2_apps_clk",
  1860. .parent_hws = (const struct clk_hw *[]) {
  1861. &blsp2_uart2_apps_clk_src.clkr.hw,
  1862. },
  1863. .num_parents = 1,
  1864. .flags = CLK_SET_RATE_PARENT,
  1865. .ops = &clk_branch2_ops,
  1866. },
  1867. },
  1868. };
  1869. static struct clk_branch gcc_blsp2_uart3_apps_clk = {
  1870. .halt_reg = 0x2b004,
  1871. .halt_check = BRANCH_HALT,
  1872. .clkr = {
  1873. .enable_reg = 0x2b004,
  1874. .enable_mask = BIT(0),
  1875. .hw.init = &(struct clk_init_data){
  1876. .name = "gcc_blsp2_uart3_apps_clk",
  1877. .parent_hws = (const struct clk_hw *[]) {
  1878. &blsp2_uart3_apps_clk_src.clkr.hw,
  1879. },
  1880. .num_parents = 1,
  1881. .flags = CLK_SET_RATE_PARENT,
  1882. .ops = &clk_branch2_ops,
  1883. },
  1884. },
  1885. };
  1886. static struct clk_branch gcc_cfg_noc_usb3_axi_clk = {
  1887. .halt_reg = 0x5018,
  1888. .halt_check = BRANCH_HALT,
  1889. .clkr = {
  1890. .enable_reg = 0x5018,
  1891. .enable_mask = BIT(0),
  1892. .hw.init = &(struct clk_init_data){
  1893. .name = "gcc_cfg_noc_usb3_axi_clk",
  1894. .parent_hws = (const struct clk_hw *[]) {
  1895. &usb30_master_clk_src.clkr.hw,
  1896. },
  1897. .num_parents = 1,
  1898. .flags = CLK_SET_RATE_PARENT,
  1899. .ops = &clk_branch2_ops,
  1900. },
  1901. },
  1902. };
  1903. static struct clk_branch gcc_gp1_clk = {
  1904. .halt_reg = 0x64000,
  1905. .halt_check = BRANCH_HALT,
  1906. .clkr = {
  1907. .enable_reg = 0x64000,
  1908. .enable_mask = BIT(0),
  1909. .hw.init = &(struct clk_init_data){
  1910. .name = "gcc_gp1_clk",
  1911. .parent_hws = (const struct clk_hw *[]) {
  1912. &gp1_clk_src.clkr.hw,
  1913. },
  1914. .num_parents = 1,
  1915. .flags = CLK_SET_RATE_PARENT,
  1916. .ops = &clk_branch2_ops,
  1917. },
  1918. },
  1919. };
  1920. static struct clk_branch gcc_gp2_clk = {
  1921. .halt_reg = 0x65000,
  1922. .halt_check = BRANCH_HALT,
  1923. .clkr = {
  1924. .enable_reg = 0x65000,
  1925. .enable_mask = BIT(0),
  1926. .hw.init = &(struct clk_init_data){
  1927. .name = "gcc_gp2_clk",
  1928. .parent_hws = (const struct clk_hw *[]) {
  1929. &gp2_clk_src.clkr.hw,
  1930. },
  1931. .num_parents = 1,
  1932. .flags = CLK_SET_RATE_PARENT,
  1933. .ops = &clk_branch2_ops,
  1934. },
  1935. },
  1936. };
  1937. static struct clk_branch gcc_gp3_clk = {
  1938. .halt_reg = 0x66000,
  1939. .halt_check = BRANCH_HALT,
  1940. .clkr = {
  1941. .enable_reg = 0x66000,
  1942. .enable_mask = BIT(0),
  1943. .hw.init = &(struct clk_init_data){
  1944. .name = "gcc_gp3_clk",
  1945. .parent_hws = (const struct clk_hw *[]) {
  1946. &gp3_clk_src.clkr.hw,
  1947. },
  1948. .num_parents = 1,
  1949. .flags = CLK_SET_RATE_PARENT,
  1950. .ops = &clk_branch2_ops,
  1951. },
  1952. },
  1953. };
  1954. static struct clk_branch gcc_bimc_gfx_clk = {
  1955. .halt_reg = 0x46040,
  1956. .halt_check = BRANCH_HALT_SKIP,
  1957. .clkr = {
  1958. .enable_reg = 0x46040,
  1959. .enable_mask = BIT(0),
  1960. .hw.init = &(struct clk_init_data){
  1961. .name = "gcc_bimc_gfx_clk",
  1962. .ops = &clk_branch2_ops,
  1963. },
  1964. },
  1965. };
  1966. static struct clk_branch gcc_gpu_bimc_gfx_clk = {
  1967. .halt_reg = 0x71010,
  1968. .halt_check = BRANCH_HALT_SKIP,
  1969. .clkr = {
  1970. .enable_reg = 0x71010,
  1971. .enable_mask = BIT(0),
  1972. .hw.init = &(struct clk_init_data){
  1973. .name = "gcc_gpu_bimc_gfx_clk",
  1974. .ops = &clk_branch2_ops,
  1975. },
  1976. },
  1977. };
  1978. static struct clk_branch gcc_gpu_bimc_gfx_src_clk = {
  1979. .halt_reg = 0x7100c,
  1980. .halt_check = BRANCH_HALT,
  1981. .clkr = {
  1982. .enable_reg = 0x7100c,
  1983. .enable_mask = BIT(0),
  1984. .hw.init = &(struct clk_init_data){
  1985. .name = "gcc_gpu_bimc_gfx_src_clk",
  1986. .ops = &clk_branch2_ops,
  1987. },
  1988. },
  1989. };
  1990. static struct clk_branch gcc_gpu_cfg_ahb_clk = {
  1991. .halt_reg = 0x71004,
  1992. .halt_check = BRANCH_HALT_SKIP,
  1993. .clkr = {
  1994. .enable_reg = 0x71004,
  1995. .enable_mask = BIT(0),
  1996. .hw.init = &(struct clk_init_data){
  1997. .name = "gcc_gpu_cfg_ahb_clk",
  1998. .ops = &clk_branch2_ops,
  1999. /*
  2000. * The GPU IOMMU depends on this clock and hypervisor
  2001. * will crash the SoC if this clock goes down, due to
  2002. * secure contexts protection.
  2003. */
  2004. .flags = CLK_IS_CRITICAL,
  2005. },
  2006. },
  2007. };
  2008. static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = {
  2009. .halt_reg = 0x71018,
  2010. .halt_check = BRANCH_HALT,
  2011. .clkr = {
  2012. .enable_reg = 0x71018,
  2013. .enable_mask = BIT(0),
  2014. .hw.init = &(struct clk_init_data){
  2015. .name = "gcc_gpu_snoc_dvm_gfx_clk",
  2016. .ops = &clk_branch2_ops,
  2017. },
  2018. },
  2019. };
  2020. static struct clk_branch gcc_hmss_ahb_clk = {
  2021. .halt_reg = 0x48000,
  2022. .halt_check = BRANCH_HALT_VOTED,
  2023. .clkr = {
  2024. .enable_reg = 0x52004,
  2025. .enable_mask = BIT(21),
  2026. .hw.init = &(struct clk_init_data){
  2027. .name = "gcc_hmss_ahb_clk",
  2028. .parent_hws = (const struct clk_hw *[]) {
  2029. &hmss_ahb_clk_src.clkr.hw,
  2030. },
  2031. .num_parents = 1,
  2032. .flags = CLK_SET_RATE_PARENT,
  2033. .ops = &clk_branch2_ops,
  2034. },
  2035. },
  2036. };
  2037. static struct clk_branch gcc_hmss_at_clk = {
  2038. .halt_reg = 0x48010,
  2039. .halt_check = BRANCH_HALT,
  2040. .clkr = {
  2041. .enable_reg = 0x48010,
  2042. .enable_mask = BIT(0),
  2043. .hw.init = &(struct clk_init_data){
  2044. .name = "gcc_hmss_at_clk",
  2045. .ops = &clk_branch2_ops,
  2046. },
  2047. },
  2048. };
  2049. static struct clk_branch gcc_hmss_rbcpr_clk = {
  2050. .halt_reg = 0x48008,
  2051. .halt_check = BRANCH_HALT,
  2052. .clkr = {
  2053. .enable_reg = 0x48008,
  2054. .enable_mask = BIT(0),
  2055. .hw.init = &(struct clk_init_data){
  2056. .name = "gcc_hmss_rbcpr_clk",
  2057. .parent_hws = (const struct clk_hw *[]) {
  2058. &hmss_rbcpr_clk_src.clkr.hw,
  2059. },
  2060. .num_parents = 1,
  2061. .flags = CLK_SET_RATE_PARENT,
  2062. .ops = &clk_branch2_ops,
  2063. },
  2064. },
  2065. };
  2066. static struct clk_branch gcc_hmss_trig_clk = {
  2067. .halt_reg = 0x4800c,
  2068. .halt_check = BRANCH_HALT,
  2069. .clkr = {
  2070. .enable_reg = 0x4800c,
  2071. .enable_mask = BIT(0),
  2072. .hw.init = &(struct clk_init_data){
  2073. .name = "gcc_hmss_trig_clk",
  2074. .ops = &clk_branch2_ops,
  2075. },
  2076. },
  2077. };
  2078. static const struct freq_tbl ftbl_hmss_gpll0_clk_src[] = {
  2079. F( 300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
  2080. F( 600000000, P_GPLL0_OUT_MAIN, 1, 0, 0),
  2081. { }
  2082. };
  2083. static struct clk_rcg2 hmss_gpll0_clk_src = {
  2084. .cmd_rcgr = 0x4805c,
  2085. .hid_width = 5,
  2086. .parent_map = gcc_parent_map_1,
  2087. .freq_tbl = ftbl_hmss_gpll0_clk_src,
  2088. .clkr.hw.init = &(struct clk_init_data) {
  2089. .name = "hmss_gpll0_clk_src",
  2090. .parent_data = gcc_parent_data_1,
  2091. .num_parents = ARRAY_SIZE(gcc_parent_data_1),
  2092. .ops = &clk_rcg2_ops,
  2093. },
  2094. };
  2095. static struct clk_branch gcc_mmss_noc_cfg_ahb_clk = {
  2096. .halt_reg = 0x9004,
  2097. .halt_check = BRANCH_HALT,
  2098. .clkr = {
  2099. .enable_reg = 0x9004,
  2100. .enable_mask = BIT(0),
  2101. .hw.init = &(struct clk_init_data){
  2102. .name = "gcc_mmss_noc_cfg_ahb_clk",
  2103. .ops = &clk_branch2_ops,
  2104. /*
  2105. * Any access to mmss depends on this clock.
  2106. * Gating this clock has been shown to crash the system
  2107. * when mmssnoc_axi_rpm_clk is inited in rpmcc.
  2108. */
  2109. .flags = CLK_IS_CRITICAL,
  2110. },
  2111. },
  2112. };
  2113. static struct clk_branch gcc_mmss_qm_ahb_clk = {
  2114. .halt_reg = 0x9030,
  2115. .halt_check = BRANCH_HALT,
  2116. .clkr = {
  2117. .enable_reg = 0x9030,
  2118. .enable_mask = BIT(0),
  2119. .hw.init = &(struct clk_init_data){
  2120. .name = "gcc_mmss_qm_ahb_clk",
  2121. .ops = &clk_branch2_ops,
  2122. },
  2123. },
  2124. };
  2125. static struct clk_branch gcc_mmss_qm_core_clk = {
  2126. .halt_reg = 0x900c,
  2127. .halt_check = BRANCH_HALT,
  2128. .clkr = {
  2129. .enable_reg = 0x900c,
  2130. .enable_mask = BIT(0),
  2131. .hw.init = &(struct clk_init_data){
  2132. .name = "gcc_mmss_qm_core_clk",
  2133. .ops = &clk_branch2_ops,
  2134. },
  2135. },
  2136. };
  2137. static struct clk_branch gcc_mmss_sys_noc_axi_clk = {
  2138. .halt_reg = 0x9000,
  2139. .halt_check = BRANCH_HALT,
  2140. .clkr = {
  2141. .enable_reg = 0x9000,
  2142. .enable_mask = BIT(0),
  2143. .hw.init = &(struct clk_init_data){
  2144. .name = "gcc_mmss_sys_noc_axi_clk",
  2145. .ops = &clk_branch2_ops,
  2146. },
  2147. },
  2148. };
  2149. static struct clk_branch gcc_mss_at_clk = {
  2150. .halt_reg = 0x8a00c,
  2151. .halt_check = BRANCH_HALT,
  2152. .clkr = {
  2153. .enable_reg = 0x8a00c,
  2154. .enable_mask = BIT(0),
  2155. .hw.init = &(struct clk_init_data){
  2156. .name = "gcc_mss_at_clk",
  2157. .ops = &clk_branch2_ops,
  2158. },
  2159. },
  2160. };
  2161. static struct clk_branch gcc_pcie_0_aux_clk = {
  2162. .halt_reg = 0x6b014,
  2163. .halt_check = BRANCH_HALT,
  2164. .clkr = {
  2165. .enable_reg = 0x6b014,
  2166. .enable_mask = BIT(0),
  2167. .hw.init = &(struct clk_init_data){
  2168. .name = "gcc_pcie_0_aux_clk",
  2169. .parent_hws = (const struct clk_hw *[]) {
  2170. &pcie_aux_clk_src.clkr.hw,
  2171. },
  2172. .num_parents = 1,
  2173. .flags = CLK_SET_RATE_PARENT,
  2174. .ops = &clk_branch2_ops,
  2175. },
  2176. },
  2177. };
  2178. static struct clk_branch gcc_pcie_0_cfg_ahb_clk = {
  2179. .halt_reg = 0x6b010,
  2180. .halt_check = BRANCH_HALT,
  2181. .clkr = {
  2182. .enable_reg = 0x6b010,
  2183. .enable_mask = BIT(0),
  2184. .hw.init = &(struct clk_init_data){
  2185. .name = "gcc_pcie_0_cfg_ahb_clk",
  2186. .ops = &clk_branch2_ops,
  2187. },
  2188. },
  2189. };
  2190. static struct clk_branch gcc_pcie_0_mstr_axi_clk = {
  2191. .halt_reg = 0x6b00c,
  2192. .halt_check = BRANCH_HALT,
  2193. .clkr = {
  2194. .enable_reg = 0x6b00c,
  2195. .enable_mask = BIT(0),
  2196. .hw.init = &(struct clk_init_data){
  2197. .name = "gcc_pcie_0_mstr_axi_clk",
  2198. .ops = &clk_branch2_ops,
  2199. },
  2200. },
  2201. };
  2202. static struct clk_branch gcc_pcie_0_pipe_clk = {
  2203. .halt_reg = 0x6b018,
  2204. .halt_check = BRANCH_HALT_SKIP,
  2205. .clkr = {
  2206. .enable_reg = 0x6b018,
  2207. .enable_mask = BIT(0),
  2208. .hw.init = &(struct clk_init_data){
  2209. .name = "gcc_pcie_0_pipe_clk",
  2210. .ops = &clk_branch2_ops,
  2211. },
  2212. },
  2213. };
  2214. static struct clk_branch gcc_pcie_0_slv_axi_clk = {
  2215. .halt_reg = 0x6b008,
  2216. .halt_check = BRANCH_HALT,
  2217. .clkr = {
  2218. .enable_reg = 0x6b008,
  2219. .enable_mask = BIT(0),
  2220. .hw.init = &(struct clk_init_data){
  2221. .name = "gcc_pcie_0_slv_axi_clk",
  2222. .ops = &clk_branch2_ops,
  2223. },
  2224. },
  2225. };
  2226. static struct clk_branch gcc_pcie_phy_aux_clk = {
  2227. .halt_reg = 0x6f004,
  2228. .halt_check = BRANCH_HALT,
  2229. .clkr = {
  2230. .enable_reg = 0x6f004,
  2231. .enable_mask = BIT(0),
  2232. .hw.init = &(struct clk_init_data){
  2233. .name = "gcc_pcie_phy_aux_clk",
  2234. .parent_hws = (const struct clk_hw *[]) {
  2235. &pcie_aux_clk_src.clkr.hw,
  2236. },
  2237. .num_parents = 1,
  2238. .flags = CLK_SET_RATE_PARENT,
  2239. .ops = &clk_branch2_ops,
  2240. },
  2241. },
  2242. };
  2243. static struct clk_branch gcc_pdm2_clk = {
  2244. .halt_reg = 0x3300c,
  2245. .halt_check = BRANCH_HALT,
  2246. .clkr = {
  2247. .enable_reg = 0x3300c,
  2248. .enable_mask = BIT(0),
  2249. .hw.init = &(struct clk_init_data){
  2250. .name = "gcc_pdm2_clk",
  2251. .parent_hws = (const struct clk_hw *[]) {
  2252. &pdm2_clk_src.clkr.hw,
  2253. },
  2254. .num_parents = 1,
  2255. .flags = CLK_SET_RATE_PARENT,
  2256. .ops = &clk_branch2_ops,
  2257. },
  2258. },
  2259. };
  2260. static struct clk_branch gcc_pdm_ahb_clk = {
  2261. .halt_reg = 0x33004,
  2262. .halt_check = BRANCH_HALT,
  2263. .clkr = {
  2264. .enable_reg = 0x33004,
  2265. .enable_mask = BIT(0),
  2266. .hw.init = &(struct clk_init_data){
  2267. .name = "gcc_pdm_ahb_clk",
  2268. .ops = &clk_branch2_ops,
  2269. },
  2270. },
  2271. };
  2272. static struct clk_branch gcc_pdm_xo4_clk = {
  2273. .halt_reg = 0x33008,
  2274. .halt_check = BRANCH_HALT,
  2275. .clkr = {
  2276. .enable_reg = 0x33008,
  2277. .enable_mask = BIT(0),
  2278. .hw.init = &(struct clk_init_data){
  2279. .name = "gcc_pdm_xo4_clk",
  2280. .ops = &clk_branch2_ops,
  2281. },
  2282. },
  2283. };
  2284. static struct clk_branch gcc_prng_ahb_clk = {
  2285. .halt_reg = 0x34004,
  2286. .halt_check = BRANCH_HALT_VOTED,
  2287. .clkr = {
  2288. .enable_reg = 0x52004,
  2289. .enable_mask = BIT(13),
  2290. .hw.init = &(struct clk_init_data){
  2291. .name = "gcc_prng_ahb_clk",
  2292. .ops = &clk_branch2_ops,
  2293. },
  2294. },
  2295. };
  2296. static struct clk_branch gcc_sdcc2_ahb_clk = {
  2297. .halt_reg = 0x14008,
  2298. .halt_check = BRANCH_HALT,
  2299. .clkr = {
  2300. .enable_reg = 0x14008,
  2301. .enable_mask = BIT(0),
  2302. .hw.init = &(struct clk_init_data){
  2303. .name = "gcc_sdcc2_ahb_clk",
  2304. .ops = &clk_branch2_ops,
  2305. },
  2306. },
  2307. };
  2308. static struct clk_branch gcc_sdcc2_apps_clk = {
  2309. .halt_reg = 0x14004,
  2310. .halt_check = BRANCH_HALT,
  2311. .clkr = {
  2312. .enable_reg = 0x14004,
  2313. .enable_mask = BIT(0),
  2314. .hw.init = &(struct clk_init_data){
  2315. .name = "gcc_sdcc2_apps_clk",
  2316. .parent_hws = (const struct clk_hw *[]) {
  2317. &sdcc2_apps_clk_src.clkr.hw,
  2318. },
  2319. .num_parents = 1,
  2320. .flags = CLK_SET_RATE_PARENT,
  2321. .ops = &clk_branch2_ops,
  2322. },
  2323. },
  2324. };
  2325. static struct clk_branch gcc_sdcc4_ahb_clk = {
  2326. .halt_reg = 0x16008,
  2327. .halt_check = BRANCH_HALT,
  2328. .clkr = {
  2329. .enable_reg = 0x16008,
  2330. .enable_mask = BIT(0),
  2331. .hw.init = &(struct clk_init_data){
  2332. .name = "gcc_sdcc4_ahb_clk",
  2333. .ops = &clk_branch2_ops,
  2334. },
  2335. },
  2336. };
  2337. static struct clk_branch gcc_sdcc4_apps_clk = {
  2338. .halt_reg = 0x16004,
  2339. .halt_check = BRANCH_HALT,
  2340. .clkr = {
  2341. .enable_reg = 0x16004,
  2342. .enable_mask = BIT(0),
  2343. .hw.init = &(struct clk_init_data){
  2344. .name = "gcc_sdcc4_apps_clk",
  2345. .parent_hws = (const struct clk_hw *[]) {
  2346. &sdcc4_apps_clk_src.clkr.hw,
  2347. },
  2348. .num_parents = 1,
  2349. .flags = CLK_SET_RATE_PARENT,
  2350. .ops = &clk_branch2_ops,
  2351. },
  2352. },
  2353. };
  2354. static struct clk_branch gcc_tsif_ahb_clk = {
  2355. .halt_reg = 0x36004,
  2356. .halt_check = BRANCH_HALT,
  2357. .clkr = {
  2358. .enable_reg = 0x36004,
  2359. .enable_mask = BIT(0),
  2360. .hw.init = &(struct clk_init_data){
  2361. .name = "gcc_tsif_ahb_clk",
  2362. .ops = &clk_branch2_ops,
  2363. },
  2364. },
  2365. };
  2366. static struct clk_branch gcc_tsif_inactivity_timers_clk = {
  2367. .halt_reg = 0x3600c,
  2368. .halt_check = BRANCH_HALT,
  2369. .clkr = {
  2370. .enable_reg = 0x3600c,
  2371. .enable_mask = BIT(0),
  2372. .hw.init = &(struct clk_init_data){
  2373. .name = "gcc_tsif_inactivity_timers_clk",
  2374. .ops = &clk_branch2_ops,
  2375. },
  2376. },
  2377. };
  2378. static struct clk_branch gcc_tsif_ref_clk = {
  2379. .halt_reg = 0x36008,
  2380. .halt_check = BRANCH_HALT,
  2381. .clkr = {
  2382. .enable_reg = 0x36008,
  2383. .enable_mask = BIT(0),
  2384. .hw.init = &(struct clk_init_data){
  2385. .name = "gcc_tsif_ref_clk",
  2386. .parent_hws = (const struct clk_hw *[]) {
  2387. &tsif_ref_clk_src.clkr.hw,
  2388. },
  2389. .num_parents = 1,
  2390. .flags = CLK_SET_RATE_PARENT,
  2391. .ops = &clk_branch2_ops,
  2392. },
  2393. },
  2394. };
  2395. static struct clk_branch gcc_ufs_ahb_clk = {
  2396. .halt_reg = 0x7500c,
  2397. .halt_check = BRANCH_HALT,
  2398. .clkr = {
  2399. .enable_reg = 0x7500c,
  2400. .enable_mask = BIT(0),
  2401. .hw.init = &(struct clk_init_data){
  2402. .name = "gcc_ufs_ahb_clk",
  2403. .ops = &clk_branch2_ops,
  2404. },
  2405. },
  2406. };
  2407. static struct clk_branch gcc_ufs_axi_clk = {
  2408. .halt_reg = 0x75008,
  2409. .halt_check = BRANCH_HALT,
  2410. .clkr = {
  2411. .enable_reg = 0x75008,
  2412. .enable_mask = BIT(0),
  2413. .hw.init = &(struct clk_init_data){
  2414. .name = "gcc_ufs_axi_clk",
  2415. .parent_hws = (const struct clk_hw *[]) {
  2416. &ufs_axi_clk_src.clkr.hw,
  2417. },
  2418. .num_parents = 1,
  2419. .flags = CLK_SET_RATE_PARENT,
  2420. .ops = &clk_branch2_ops,
  2421. },
  2422. },
  2423. };
  2424. static struct clk_branch gcc_ufs_ice_core_clk = {
  2425. .halt_reg = 0x7600c,
  2426. .halt_check = BRANCH_HALT,
  2427. .clkr = {
  2428. .enable_reg = 0x7600c,
  2429. .enable_mask = BIT(0),
  2430. .hw.init = &(struct clk_init_data){
  2431. .name = "gcc_ufs_ice_core_clk",
  2432. .ops = &clk_branch2_ops,
  2433. },
  2434. },
  2435. };
  2436. static struct clk_branch gcc_ufs_phy_aux_clk = {
  2437. .halt_reg = 0x76040,
  2438. .halt_check = BRANCH_HALT,
  2439. .clkr = {
  2440. .enable_reg = 0x76040,
  2441. .enable_mask = BIT(0),
  2442. .hw.init = &(struct clk_init_data){
  2443. .name = "gcc_ufs_phy_aux_clk",
  2444. .ops = &clk_branch2_ops,
  2445. },
  2446. },
  2447. };
  2448. static struct clk_branch gcc_ufs_rx_symbol_0_clk = {
  2449. .halt_reg = 0x75014,
  2450. .halt_check = BRANCH_HALT_SKIP,
  2451. .clkr = {
  2452. .enable_reg = 0x75014,
  2453. .enable_mask = BIT(0),
  2454. .hw.init = &(struct clk_init_data){
  2455. .name = "gcc_ufs_rx_symbol_0_clk",
  2456. .ops = &clk_branch2_ops,
  2457. },
  2458. },
  2459. };
  2460. static struct clk_branch gcc_ufs_rx_symbol_1_clk = {
  2461. .halt_reg = 0x7605c,
  2462. .halt_check = BRANCH_HALT_SKIP,
  2463. .clkr = {
  2464. .enable_reg = 0x7605c,
  2465. .enable_mask = BIT(0),
  2466. .hw.init = &(struct clk_init_data){
  2467. .name = "gcc_ufs_rx_symbol_1_clk",
  2468. .ops = &clk_branch2_ops,
  2469. },
  2470. },
  2471. };
  2472. static struct clk_branch gcc_ufs_tx_symbol_0_clk = {
  2473. .halt_reg = 0x75010,
  2474. .halt_check = BRANCH_HALT_SKIP,
  2475. .clkr = {
  2476. .enable_reg = 0x75010,
  2477. .enable_mask = BIT(0),
  2478. .hw.init = &(struct clk_init_data){
  2479. .name = "gcc_ufs_tx_symbol_0_clk",
  2480. .ops = &clk_branch2_ops,
  2481. },
  2482. },
  2483. };
  2484. static struct clk_branch gcc_ufs_unipro_core_clk = {
  2485. .halt_reg = 0x76008,
  2486. .halt_check = BRANCH_HALT,
  2487. .clkr = {
  2488. .enable_reg = 0x76008,
  2489. .enable_mask = BIT(0),
  2490. .hw.init = &(struct clk_init_data){
  2491. .name = "gcc_ufs_unipro_core_clk",
  2492. .parent_hws = (const struct clk_hw *[]) {
  2493. &ufs_unipro_core_clk_src.clkr.hw,
  2494. },
  2495. .num_parents = 1,
  2496. .flags = CLK_SET_RATE_PARENT,
  2497. .ops = &clk_branch2_ops,
  2498. },
  2499. },
  2500. };
  2501. static struct clk_branch gcc_usb30_master_clk = {
  2502. .halt_reg = 0xf008,
  2503. .halt_check = BRANCH_HALT,
  2504. .clkr = {
  2505. .enable_reg = 0xf008,
  2506. .enable_mask = BIT(0),
  2507. .hw.init = &(struct clk_init_data){
  2508. .name = "gcc_usb30_master_clk",
  2509. .parent_hws = (const struct clk_hw *[]) {
  2510. &usb30_master_clk_src.clkr.hw,
  2511. },
  2512. .num_parents = 1,
  2513. .flags = CLK_SET_RATE_PARENT,
  2514. .ops = &clk_branch2_ops,
  2515. },
  2516. },
  2517. };
  2518. static struct clk_branch gcc_usb30_mock_utmi_clk = {
  2519. .halt_reg = 0xf010,
  2520. .halt_check = BRANCH_HALT,
  2521. .clkr = {
  2522. .enable_reg = 0xf010,
  2523. .enable_mask = BIT(0),
  2524. .hw.init = &(struct clk_init_data){
  2525. .name = "gcc_usb30_mock_utmi_clk",
  2526. .parent_hws = (const struct clk_hw *[]) {
  2527. &usb30_mock_utmi_clk_src.clkr.hw,
  2528. },
  2529. .num_parents = 1,
  2530. .flags = CLK_SET_RATE_PARENT,
  2531. .ops = &clk_branch2_ops,
  2532. },
  2533. },
  2534. };
  2535. static struct clk_branch gcc_usb30_sleep_clk = {
  2536. .halt_reg = 0xf00c,
  2537. .halt_check = BRANCH_HALT,
  2538. .clkr = {
  2539. .enable_reg = 0xf00c,
  2540. .enable_mask = BIT(0),
  2541. .hw.init = &(struct clk_init_data){
  2542. .name = "gcc_usb30_sleep_clk",
  2543. .ops = &clk_branch2_ops,
  2544. },
  2545. },
  2546. };
  2547. static struct clk_branch gcc_usb3_phy_aux_clk = {
  2548. .halt_reg = 0x50000,
  2549. .halt_check = BRANCH_HALT,
  2550. .clkr = {
  2551. .enable_reg = 0x50000,
  2552. .enable_mask = BIT(0),
  2553. .hw.init = &(struct clk_init_data){
  2554. .name = "gcc_usb3_phy_aux_clk",
  2555. .parent_hws = (const struct clk_hw *[]) {
  2556. &usb3_phy_aux_clk_src.clkr.hw,
  2557. },
  2558. .num_parents = 1,
  2559. .flags = CLK_SET_RATE_PARENT,
  2560. .ops = &clk_branch2_ops,
  2561. },
  2562. },
  2563. };
  2564. static struct clk_branch gcc_usb3_phy_pipe_clk = {
  2565. .halt_reg = 0x50004,
  2566. .halt_check = BRANCH_HALT_SKIP,
  2567. .clkr = {
  2568. .enable_reg = 0x50004,
  2569. .enable_mask = BIT(0),
  2570. .hw.init = &(struct clk_init_data){
  2571. .name = "gcc_usb3_phy_pipe_clk",
  2572. .ops = &clk_branch2_ops,
  2573. },
  2574. },
  2575. };
  2576. static struct clk_branch gcc_usb_phy_cfg_ahb2phy_clk = {
  2577. .halt_reg = 0x6a004,
  2578. .halt_check = BRANCH_HALT,
  2579. .clkr = {
  2580. .enable_reg = 0x6a004,
  2581. .enable_mask = BIT(0),
  2582. .hw.init = &(struct clk_init_data){
  2583. .name = "gcc_usb_phy_cfg_ahb2phy_clk",
  2584. .ops = &clk_branch2_ops,
  2585. },
  2586. },
  2587. };
  2588. static struct clk_branch gcc_hdmi_clkref_clk = {
  2589. .halt_reg = 0x88000,
  2590. .clkr = {
  2591. .enable_reg = 0x88000,
  2592. .enable_mask = BIT(0),
  2593. .hw.init = &(struct clk_init_data){
  2594. .name = "gcc_hdmi_clkref_clk",
  2595. .parent_data = (const struct clk_parent_data []) {
  2596. { .fw_name = "xo" },
  2597. },
  2598. .num_parents = 1,
  2599. .ops = &clk_branch2_ops,
  2600. },
  2601. },
  2602. };
  2603. static struct clk_branch gcc_ufs_clkref_clk = {
  2604. .halt_reg = 0x88004,
  2605. .clkr = {
  2606. .enable_reg = 0x88004,
  2607. .enable_mask = BIT(0),
  2608. .hw.init = &(struct clk_init_data){
  2609. .name = "gcc_ufs_clkref_clk",
  2610. .parent_data = (const struct clk_parent_data []) {
  2611. { .fw_name = "xo" },
  2612. },
  2613. .num_parents = 1,
  2614. .ops = &clk_branch2_ops,
  2615. },
  2616. },
  2617. };
  2618. static struct clk_branch gcc_usb3_clkref_clk = {
  2619. .halt_reg = 0x88008,
  2620. .clkr = {
  2621. .enable_reg = 0x88008,
  2622. .enable_mask = BIT(0),
  2623. .hw.init = &(struct clk_init_data){
  2624. .name = "gcc_usb3_clkref_clk",
  2625. .parent_data = (const struct clk_parent_data []) {
  2626. { .fw_name = "xo" },
  2627. },
  2628. .num_parents = 1,
  2629. .ops = &clk_branch2_ops,
  2630. },
  2631. },
  2632. };
  2633. static struct clk_branch gcc_pcie_clkref_clk = {
  2634. .halt_reg = 0x8800c,
  2635. .clkr = {
  2636. .enable_reg = 0x8800c,
  2637. .enable_mask = BIT(0),
  2638. .hw.init = &(struct clk_init_data){
  2639. .name = "gcc_pcie_clkref_clk",
  2640. .parent_data = (const struct clk_parent_data []) {
  2641. { .fw_name = "xo" },
  2642. },
  2643. .num_parents = 1,
  2644. .ops = &clk_branch2_ops,
  2645. },
  2646. },
  2647. };
  2648. static struct clk_branch gcc_rx1_usb2_clkref_clk = {
  2649. .halt_reg = 0x88014,
  2650. .clkr = {
  2651. .enable_reg = 0x88014,
  2652. .enable_mask = BIT(0),
  2653. .hw.init = &(struct clk_init_data){
  2654. .name = "gcc_rx1_usb2_clkref_clk",
  2655. .parent_data = (const struct clk_parent_data []) {
  2656. { .fw_name = "xo" },
  2657. },
  2658. .num_parents = 1,
  2659. .ops = &clk_branch2_ops,
  2660. },
  2661. },
  2662. };
  2663. static struct clk_branch gcc_im_sleep_clk = {
  2664. .halt_reg = 0x4300c,
  2665. .halt_check = BRANCH_HALT,
  2666. .clkr = {
  2667. .enable_reg = 0x4300c,
  2668. .enable_mask = BIT(0),
  2669. .hw.init = &(const struct clk_init_data){
  2670. .name = "gcc_im_sleep_clk",
  2671. .ops = &clk_branch2_ops,
  2672. },
  2673. },
  2674. };
  2675. static struct clk_branch aggre2_snoc_north_axi_clk = {
  2676. .halt_reg = 0x83010,
  2677. .halt_check = BRANCH_HALT,
  2678. .clkr = {
  2679. .enable_reg = 0x83010,
  2680. .enable_mask = BIT(0),
  2681. .hw.init = &(const struct clk_init_data){
  2682. .name = "aggre2_snoc_north_axi_clk",
  2683. .ops = &clk_branch2_ops,
  2684. },
  2685. },
  2686. };
  2687. static struct clk_branch ssc_xo_clk = {
  2688. .halt_reg = 0x63018,
  2689. .halt_check = BRANCH_HALT,
  2690. .clkr = {
  2691. .enable_reg = 0x63018,
  2692. .enable_mask = BIT(0),
  2693. .hw.init = &(const struct clk_init_data){
  2694. .name = "ssc_xo_clk",
  2695. .ops = &clk_branch2_ops,
  2696. },
  2697. },
  2698. };
  2699. static struct clk_branch ssc_cnoc_ahbs_clk = {
  2700. .halt_reg = 0x6300c,
  2701. .halt_check = BRANCH_HALT,
  2702. .clkr = {
  2703. .enable_reg = 0x6300c,
  2704. .enable_mask = BIT(0),
  2705. .hw.init = &(const struct clk_init_data){
  2706. .name = "ssc_cnoc_ahbs_clk",
  2707. .ops = &clk_branch2_ops,
  2708. },
  2709. },
  2710. };
  2711. static struct clk_branch hlos1_vote_lpass_core_smmu_clk = {
  2712. .halt_reg = 0x7D010,
  2713. .clkr = {
  2714. .enable_reg = 0x7D010,
  2715. .enable_mask = BIT(0),
  2716. .hw.init = &(struct clk_init_data) {
  2717. .name = "hlos1_vote_lpass_core_smmu_clk",
  2718. .ops = &clk_branch2_ops,
  2719. },
  2720. },
  2721. };
  2722. static struct clk_branch hlos1_vote_lpass_adsp_smmu_clk = {
  2723. .halt_reg = 0x7D014,
  2724. .clkr = {
  2725. .enable_reg = 0x7D014,
  2726. .enable_mask = BIT(0),
  2727. .hw.init = &(struct clk_init_data) {
  2728. .name = "hlos1_vote_lpass_adsp_smmu_clk",
  2729. .ops = &clk_branch2_ops,
  2730. },
  2731. },
  2732. };
  2733. static struct clk_branch gcc_mss_q6_bimc_axi_clk = {
  2734. .halt_reg = 0x8A040,
  2735. .clkr = {
  2736. .enable_reg = 0x8A040,
  2737. .enable_mask = BIT(0),
  2738. .hw.init = &(struct clk_init_data) {
  2739. .name = "gcc_mss_q6_bimc_axi_clk",
  2740. .flags = CLK_IS_CRITICAL,
  2741. .ops = &clk_branch2_ops,
  2742. },
  2743. },
  2744. };
  2745. static struct gdsc pcie_0_gdsc = {
  2746. .gdscr = 0x6b004,
  2747. .gds_hw_ctrl = 0x0,
  2748. .pd = {
  2749. .name = "pcie_0_gdsc",
  2750. },
  2751. .pwrsts = PWRSTS_OFF_ON,
  2752. .flags = VOTABLE,
  2753. };
  2754. static struct gdsc ufs_gdsc = {
  2755. .gdscr = 0x75004,
  2756. .gds_hw_ctrl = 0x0,
  2757. .pd = {
  2758. .name = "ufs_gdsc",
  2759. },
  2760. .pwrsts = PWRSTS_OFF_ON,
  2761. .flags = VOTABLE,
  2762. };
  2763. static struct gdsc usb_30_gdsc = {
  2764. .gdscr = 0xf004,
  2765. .gds_hw_ctrl = 0x0,
  2766. .pd = {
  2767. .name = "usb_30_gdsc",
  2768. },
  2769. /* TODO: Change to OFF_ON when USB drivers get proper suspend support */
  2770. .pwrsts = PWRSTS_RET_ON,
  2771. .flags = VOTABLE,
  2772. };
  2773. static struct gdsc hlos1_vote_lpass_adsp = {
  2774. .gdscr = 0x7d034,
  2775. .gds_hw_ctrl = 0x0,
  2776. .pd = {
  2777. .name = "lpass_adsp_gdsc",
  2778. },
  2779. .pwrsts = PWRSTS_OFF_ON,
  2780. .flags = VOTABLE,
  2781. };
  2782. static struct gdsc hlos1_vote_lpass_core = {
  2783. .gdscr = 0x7d038,
  2784. .gds_hw_ctrl = 0x0,
  2785. .pd = {
  2786. .name = "lpass_core_gdsc",
  2787. },
  2788. .pwrsts = PWRSTS_OFF_ON,
  2789. .flags = ALWAYS_ON,
  2790. };
  2791. static struct clk_regmap *gcc_msm8998_clocks[] = {
  2792. [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
  2793. [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
  2794. [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
  2795. [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
  2796. [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
  2797. [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
  2798. [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
  2799. [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
  2800. [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
  2801. [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
  2802. [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
  2803. [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
  2804. [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
  2805. [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
  2806. [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
  2807. [BLSP2_QUP1_I2C_APPS_CLK_SRC] = &blsp2_qup1_i2c_apps_clk_src.clkr,
  2808. [BLSP2_QUP1_SPI_APPS_CLK_SRC] = &blsp2_qup1_spi_apps_clk_src.clkr,
  2809. [BLSP2_QUP2_I2C_APPS_CLK_SRC] = &blsp2_qup2_i2c_apps_clk_src.clkr,
  2810. [BLSP2_QUP2_SPI_APPS_CLK_SRC] = &blsp2_qup2_spi_apps_clk_src.clkr,
  2811. [BLSP2_QUP3_I2C_APPS_CLK_SRC] = &blsp2_qup3_i2c_apps_clk_src.clkr,
  2812. [BLSP2_QUP3_SPI_APPS_CLK_SRC] = &blsp2_qup3_spi_apps_clk_src.clkr,
  2813. [BLSP2_QUP4_I2C_APPS_CLK_SRC] = &blsp2_qup4_i2c_apps_clk_src.clkr,
  2814. [BLSP2_QUP4_SPI_APPS_CLK_SRC] = &blsp2_qup4_spi_apps_clk_src.clkr,
  2815. [BLSP2_QUP5_I2C_APPS_CLK_SRC] = &blsp2_qup5_i2c_apps_clk_src.clkr,
  2816. [BLSP2_QUP5_SPI_APPS_CLK_SRC] = &blsp2_qup5_spi_apps_clk_src.clkr,
  2817. [BLSP2_QUP6_I2C_APPS_CLK_SRC] = &blsp2_qup6_i2c_apps_clk_src.clkr,
  2818. [BLSP2_QUP6_SPI_APPS_CLK_SRC] = &blsp2_qup6_spi_apps_clk_src.clkr,
  2819. [BLSP2_UART1_APPS_CLK_SRC] = &blsp2_uart1_apps_clk_src.clkr,
  2820. [BLSP2_UART2_APPS_CLK_SRC] = &blsp2_uart2_apps_clk_src.clkr,
  2821. [BLSP2_UART3_APPS_CLK_SRC] = &blsp2_uart3_apps_clk_src.clkr,
  2822. [GCC_AGGRE1_NOC_XO_CLK] = &gcc_aggre1_noc_xo_clk.clkr,
  2823. [GCC_AGGRE1_UFS_AXI_CLK] = &gcc_aggre1_ufs_axi_clk.clkr,
  2824. [GCC_AGGRE1_USB3_AXI_CLK] = &gcc_aggre1_usb3_axi_clk.clkr,
  2825. [GCC_APSS_QDSS_TSCTR_DIV2_CLK] = &gcc_apss_qdss_tsctr_div2_clk.clkr,
  2826. [GCC_APSS_QDSS_TSCTR_DIV8_CLK] = &gcc_apss_qdss_tsctr_div8_clk.clkr,
  2827. [GCC_BIMC_HMSS_AXI_CLK] = &gcc_bimc_hmss_axi_clk.clkr,
  2828. [GCC_BIMC_MSS_Q6_AXI_CLK] = &gcc_bimc_mss_q6_axi_clk.clkr,
  2829. [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
  2830. [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
  2831. [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
  2832. [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
  2833. [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
  2834. [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
  2835. [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
  2836. [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
  2837. [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
  2838. [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
  2839. [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
  2840. [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
  2841. [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
  2842. [GCC_BLSP1_SLEEP_CLK] = &gcc_blsp1_sleep_clk.clkr,
  2843. [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
  2844. [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
  2845. [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
  2846. [GCC_BLSP2_AHB_CLK] = &gcc_blsp2_ahb_clk.clkr,
  2847. [GCC_BLSP2_QUP1_I2C_APPS_CLK] = &gcc_blsp2_qup1_i2c_apps_clk.clkr,
  2848. [GCC_BLSP2_QUP1_SPI_APPS_CLK] = &gcc_blsp2_qup1_spi_apps_clk.clkr,
  2849. [GCC_BLSP2_QUP2_I2C_APPS_CLK] = &gcc_blsp2_qup2_i2c_apps_clk.clkr,
  2850. [GCC_BLSP2_QUP2_SPI_APPS_CLK] = &gcc_blsp2_qup2_spi_apps_clk.clkr,
  2851. [GCC_BLSP2_QUP3_I2C_APPS_CLK] = &gcc_blsp2_qup3_i2c_apps_clk.clkr,
  2852. [GCC_BLSP2_QUP3_SPI_APPS_CLK] = &gcc_blsp2_qup3_spi_apps_clk.clkr,
  2853. [GCC_BLSP2_QUP4_I2C_APPS_CLK] = &gcc_blsp2_qup4_i2c_apps_clk.clkr,
  2854. [GCC_BLSP2_QUP4_SPI_APPS_CLK] = &gcc_blsp2_qup4_spi_apps_clk.clkr,
  2855. [GCC_BLSP2_QUP5_I2C_APPS_CLK] = &gcc_blsp2_qup5_i2c_apps_clk.clkr,
  2856. [GCC_BLSP2_QUP5_SPI_APPS_CLK] = &gcc_blsp2_qup5_spi_apps_clk.clkr,
  2857. [GCC_BLSP2_QUP6_I2C_APPS_CLK] = &gcc_blsp2_qup6_i2c_apps_clk.clkr,
  2858. [GCC_BLSP2_QUP6_SPI_APPS_CLK] = &gcc_blsp2_qup6_spi_apps_clk.clkr,
  2859. [GCC_BLSP2_SLEEP_CLK] = &gcc_blsp2_sleep_clk.clkr,
  2860. [GCC_BLSP2_UART1_APPS_CLK] = &gcc_blsp2_uart1_apps_clk.clkr,
  2861. [GCC_BLSP2_UART2_APPS_CLK] = &gcc_blsp2_uart2_apps_clk.clkr,
  2862. [GCC_BLSP2_UART3_APPS_CLK] = &gcc_blsp2_uart3_apps_clk.clkr,
  2863. [GCC_CFG_NOC_USB3_AXI_CLK] = &gcc_cfg_noc_usb3_axi_clk.clkr,
  2864. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  2865. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  2866. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  2867. [GCC_BIMC_GFX_CLK] = &gcc_bimc_gfx_clk.clkr,
  2868. [GCC_GPU_BIMC_GFX_CLK] = &gcc_gpu_bimc_gfx_clk.clkr,
  2869. [GCC_GPU_BIMC_GFX_SRC_CLK] = &gcc_gpu_bimc_gfx_src_clk.clkr,
  2870. [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
  2871. [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr,
  2872. [GCC_HMSS_AHB_CLK] = &gcc_hmss_ahb_clk.clkr,
  2873. [GCC_HMSS_AT_CLK] = &gcc_hmss_at_clk.clkr,
  2874. [GCC_HMSS_RBCPR_CLK] = &gcc_hmss_rbcpr_clk.clkr,
  2875. [GCC_HMSS_TRIG_CLK] = &gcc_hmss_trig_clk.clkr,
  2876. [GCC_MMSS_NOC_CFG_AHB_CLK] = &gcc_mmss_noc_cfg_ahb_clk.clkr,
  2877. [GCC_MMSS_QM_AHB_CLK] = &gcc_mmss_qm_ahb_clk.clkr,
  2878. [GCC_MMSS_QM_CORE_CLK] = &gcc_mmss_qm_core_clk.clkr,
  2879. [GCC_MMSS_SYS_NOC_AXI_CLK] = &gcc_mmss_sys_noc_axi_clk.clkr,
  2880. [GCC_MSS_AT_CLK] = &gcc_mss_at_clk.clkr,
  2881. [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr,
  2882. [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr,
  2883. [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr,
  2884. [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr,
  2885. [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr,
  2886. [GCC_PCIE_PHY_AUX_CLK] = &gcc_pcie_phy_aux_clk.clkr,
  2887. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  2888. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  2889. [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
  2890. [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
  2891. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  2892. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  2893. [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr,
  2894. [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr,
  2895. [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr,
  2896. [GCC_TSIF_INACTIVITY_TIMERS_CLK] = &gcc_tsif_inactivity_timers_clk.clkr,
  2897. [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr,
  2898. [GCC_UFS_AHB_CLK] = &gcc_ufs_ahb_clk.clkr,
  2899. [GCC_UFS_AXI_CLK] = &gcc_ufs_axi_clk.clkr,
  2900. [GCC_UFS_ICE_CORE_CLK] = &gcc_ufs_ice_core_clk.clkr,
  2901. [GCC_UFS_PHY_AUX_CLK] = &gcc_ufs_phy_aux_clk.clkr,
  2902. [GCC_UFS_RX_SYMBOL_0_CLK] = &gcc_ufs_rx_symbol_0_clk.clkr,
  2903. [GCC_UFS_RX_SYMBOL_1_CLK] = &gcc_ufs_rx_symbol_1_clk.clkr,
  2904. [GCC_UFS_TX_SYMBOL_0_CLK] = &gcc_ufs_tx_symbol_0_clk.clkr,
  2905. [GCC_UFS_UNIPRO_CORE_CLK] = &gcc_ufs_unipro_core_clk.clkr,
  2906. [GCC_USB30_MASTER_CLK] = &gcc_usb30_master_clk.clkr,
  2907. [GCC_USB30_MOCK_UTMI_CLK] = &gcc_usb30_mock_utmi_clk.clkr,
  2908. [GCC_USB30_SLEEP_CLK] = &gcc_usb30_sleep_clk.clkr,
  2909. [GCC_USB3_PHY_AUX_CLK] = &gcc_usb3_phy_aux_clk.clkr,
  2910. [GCC_USB3_PHY_PIPE_CLK] = &gcc_usb3_phy_pipe_clk.clkr,
  2911. [GCC_USB_PHY_CFG_AHB2PHY_CLK] = &gcc_usb_phy_cfg_ahb2phy_clk.clkr,
  2912. [GP1_CLK_SRC] = &gp1_clk_src.clkr,
  2913. [GP2_CLK_SRC] = &gp2_clk_src.clkr,
  2914. [GP3_CLK_SRC] = &gp3_clk_src.clkr,
  2915. [GPLL0] = &gpll0.clkr,
  2916. [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr,
  2917. [GPLL0_OUT_MAIN] = &gpll0_out_main.clkr,
  2918. [GPLL0_OUT_ODD] = &gpll0_out_odd.clkr,
  2919. [GPLL0_OUT_TEST] = &gpll0_out_test.clkr,
  2920. [GPLL1] = &gpll1.clkr,
  2921. [GPLL1_OUT_EVEN] = &gpll1_out_even.clkr,
  2922. [GPLL1_OUT_MAIN] = &gpll1_out_main.clkr,
  2923. [GPLL1_OUT_ODD] = &gpll1_out_odd.clkr,
  2924. [GPLL1_OUT_TEST] = &gpll1_out_test.clkr,
  2925. [GPLL2] = &gpll2.clkr,
  2926. [GPLL2_OUT_EVEN] = &gpll2_out_even.clkr,
  2927. [GPLL2_OUT_MAIN] = &gpll2_out_main.clkr,
  2928. [GPLL2_OUT_ODD] = &gpll2_out_odd.clkr,
  2929. [GPLL2_OUT_TEST] = &gpll2_out_test.clkr,
  2930. [GPLL3] = &gpll3.clkr,
  2931. [GPLL3_OUT_EVEN] = &gpll3_out_even.clkr,
  2932. [GPLL3_OUT_MAIN] = &gpll3_out_main.clkr,
  2933. [GPLL3_OUT_ODD] = &gpll3_out_odd.clkr,
  2934. [GPLL3_OUT_TEST] = &gpll3_out_test.clkr,
  2935. [GPLL4] = &gpll4.clkr,
  2936. [GPLL4_OUT_EVEN] = &gpll4_out_even.clkr,
  2937. [GPLL4_OUT_MAIN] = &gpll4_out_main.clkr,
  2938. [GPLL4_OUT_ODD] = &gpll4_out_odd.clkr,
  2939. [GPLL4_OUT_TEST] = &gpll4_out_test.clkr,
  2940. [HMSS_AHB_CLK_SRC] = &hmss_ahb_clk_src.clkr,
  2941. [HMSS_RBCPR_CLK_SRC] = &hmss_rbcpr_clk_src.clkr,
  2942. [PCIE_AUX_CLK_SRC] = &pcie_aux_clk_src.clkr,
  2943. [PDM2_CLK_SRC] = &pdm2_clk_src.clkr,
  2944. [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
  2945. [SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr,
  2946. [TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr,
  2947. [UFS_AXI_CLK_SRC] = &ufs_axi_clk_src.clkr,
  2948. [UFS_UNIPRO_CORE_CLK_SRC] = &ufs_unipro_core_clk_src.clkr,
  2949. [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr,
  2950. [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr,
  2951. [USB3_PHY_AUX_CLK_SRC] = &usb3_phy_aux_clk_src.clkr,
  2952. [GCC_HDMI_CLKREF_CLK] = &gcc_hdmi_clkref_clk.clkr,
  2953. [GCC_UFS_CLKREF_CLK] = &gcc_ufs_clkref_clk.clkr,
  2954. [GCC_USB3_CLKREF_CLK] = &gcc_usb3_clkref_clk.clkr,
  2955. [GCC_PCIE_CLKREF_CLK] = &gcc_pcie_clkref_clk.clkr,
  2956. [GCC_RX1_USB2_CLKREF_CLK] = &gcc_rx1_usb2_clkref_clk.clkr,
  2957. [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
  2958. [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
  2959. [GCC_MSS_GPLL0_DIV_CLK_SRC] = &gcc_mss_gpll0_div_clk_src.clkr,
  2960. [GCC_MSS_SNOC_AXI_CLK] = &gcc_mss_snoc_axi_clk.clkr,
  2961. [GCC_MSS_MNOC_BIMC_AXI_CLK] = &gcc_mss_mnoc_bimc_axi_clk.clkr,
  2962. [GCC_MMSS_GPLL0_CLK] = &gcc_mmss_gpll0_clk.clkr,
  2963. [HMSS_GPLL0_CLK_SRC] = &hmss_gpll0_clk_src.clkr,
  2964. [GCC_IM_SLEEP] = &gcc_im_sleep_clk.clkr,
  2965. [AGGRE2_SNOC_NORTH_AXI] = &aggre2_snoc_north_axi_clk.clkr,
  2966. [SSC_XO] = &ssc_xo_clk.clkr,
  2967. [SSC_CNOC_AHBS_CLK] = &ssc_cnoc_ahbs_clk.clkr,
  2968. [GCC_MMSS_GPLL0_DIV_CLK] = &gcc_mmss_gpll0_div_clk.clkr,
  2969. [GCC_GPU_GPLL0_DIV_CLK] = &gcc_gpu_gpll0_div_clk.clkr,
  2970. [GCC_GPU_GPLL0_CLK] = &gcc_gpu_gpll0_clk.clkr,
  2971. [HLOS1_VOTE_LPASS_CORE_SMMU_CLK] = &hlos1_vote_lpass_core_smmu_clk.clkr,
  2972. [HLOS1_VOTE_LPASS_ADSP_SMMU_CLK] = &hlos1_vote_lpass_adsp_smmu_clk.clkr,
  2973. [GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr,
  2974. };
  2975. static struct gdsc *gcc_msm8998_gdscs[] = {
  2976. [PCIE_0_GDSC] = &pcie_0_gdsc,
  2977. [UFS_GDSC] = &ufs_gdsc,
  2978. [USB_30_GDSC] = &usb_30_gdsc,
  2979. [LPASS_ADSP_GDSC] = &hlos1_vote_lpass_adsp,
  2980. [LPASS_CORE_GDSC] = &hlos1_vote_lpass_core,
  2981. };
  2982. static const struct qcom_reset_map gcc_msm8998_resets[] = {
  2983. [GCC_BLSP1_QUP1_BCR] = { 0x19000 },
  2984. [GCC_BLSP1_QUP2_BCR] = { 0x1b000 },
  2985. [GCC_BLSP1_QUP3_BCR] = { 0x1d000 },
  2986. [GCC_BLSP1_QUP4_BCR] = { 0x1f000 },
  2987. [GCC_BLSP1_QUP5_BCR] = { 0x21000 },
  2988. [GCC_BLSP1_QUP6_BCR] = { 0x23000 },
  2989. [GCC_BLSP2_QUP1_BCR] = { 0x26000 },
  2990. [GCC_BLSP2_QUP2_BCR] = { 0x28000 },
  2991. [GCC_BLSP2_QUP3_BCR] = { 0x2a000 },
  2992. [GCC_BLSP2_QUP4_BCR] = { 0x2c000 },
  2993. [GCC_BLSP2_QUP5_BCR] = { 0x2e000 },
  2994. [GCC_BLSP2_QUP6_BCR] = { 0x30000 },
  2995. [GCC_PCIE_0_BCR] = { 0x6b000 },
  2996. [GCC_PDM_BCR] = { 0x33000 },
  2997. [GCC_SDCC2_BCR] = { 0x14000 },
  2998. [GCC_SDCC4_BCR] = { 0x16000 },
  2999. [GCC_TSIF_BCR] = { 0x36000 },
  3000. [GCC_UFS_BCR] = { 0x75000 },
  3001. [GCC_USB_30_BCR] = { 0xf000 },
  3002. [GCC_SYSTEM_NOC_BCR] = { 0x4000 },
  3003. [GCC_CONFIG_NOC_BCR] = { 0x5000 },
  3004. [GCC_AHB2PHY_EAST_BCR] = { 0x7000 },
  3005. [GCC_IMEM_BCR] = { 0x8000 },
  3006. [GCC_PIMEM_BCR] = { 0xa000 },
  3007. [GCC_MMSS_BCR] = { 0xb000 },
  3008. [GCC_QDSS_BCR] = { 0xc000 },
  3009. [GCC_WCSS_BCR] = { 0x11000 },
  3010. [GCC_QUSB2PHY_PRIM_BCR] = { 0x12000 },
  3011. [GCC_QUSB2PHY_SEC_BCR] = { 0x12004 },
  3012. [GCC_BLSP1_BCR] = { 0x17000 },
  3013. [GCC_BLSP1_UART1_BCR] = { 0x1a000 },
  3014. [GCC_BLSP1_UART2_BCR] = { 0x1c000 },
  3015. [GCC_BLSP1_UART3_BCR] = { 0x1e000 },
  3016. [GCC_CM_PHY_REFGEN1_BCR] = { 0x22000 },
  3017. [GCC_CM_PHY_REFGEN2_BCR] = { 0x24000 },
  3018. [GCC_BLSP2_BCR] = { 0x25000 },
  3019. [GCC_BLSP2_UART1_BCR] = { 0x27000 },
  3020. [GCC_BLSP2_UART2_BCR] = { 0x29000 },
  3021. [GCC_BLSP2_UART3_BCR] = { 0x2b000 },
  3022. [GCC_SRAM_SENSOR_BCR] = { 0x2d000 },
  3023. [GCC_PRNG_BCR] = { 0x34000 },
  3024. [GCC_TSIF_0_RESET] = { 0x36024 },
  3025. [GCC_TSIF_1_RESET] = { 0x36028 },
  3026. [GCC_TCSR_BCR] = { 0x37000 },
  3027. [GCC_BOOT_ROM_BCR] = { 0x38000 },
  3028. [GCC_MSG_RAM_BCR] = { 0x39000 },
  3029. [GCC_TLMM_BCR] = { 0x3a000 },
  3030. [GCC_MPM_BCR] = { 0x3b000 },
  3031. [GCC_SEC_CTRL_BCR] = { 0x3d000 },
  3032. [GCC_SPMI_BCR] = { 0x3f000 },
  3033. [GCC_SPDM_BCR] = { 0x40000 },
  3034. [GCC_CE1_BCR] = { 0x41000 },
  3035. [GCC_BIMC_BCR] = { 0x44000 },
  3036. [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x49000 },
  3037. [GCC_SNOC_BUS_TIMEOUT1_BCR] = { 0x49008 },
  3038. [GCC_SNOC_BUS_TIMEOUT3_BCR] = { 0x49010 },
  3039. [GCC_SNOC_BUS_TIMEOUT_EXTREF_BCR] = { 0x49018 },
  3040. [GCC_PNOC_BUS_TIMEOUT0_BCR] = { 0x4a000 },
  3041. [GCC_CNOC_PERIPH_BUS_TIMEOUT1_BCR] = { 0x4a004 },
  3042. [GCC_CNOC_PERIPH_BUS_TIMEOUT2_BCR] = { 0x4a00c },
  3043. [GCC_CNOC_BUS_TIMEOUT0_BCR] = { 0x4b000 },
  3044. [GCC_CNOC_BUS_TIMEOUT1_BCR] = { 0x4b008 },
  3045. [GCC_CNOC_BUS_TIMEOUT2_BCR] = { 0x4b010 },
  3046. [GCC_CNOC_BUS_TIMEOUT3_BCR] = { 0x4b018 },
  3047. [GCC_CNOC_BUS_TIMEOUT4_BCR] = { 0x4b020 },
  3048. [GCC_CNOC_BUS_TIMEOUT5_BCR] = { 0x4b028 },
  3049. [GCC_CNOC_BUS_TIMEOUT6_BCR] = { 0x4b030 },
  3050. [GCC_CNOC_BUS_TIMEOUT7_BCR] = { 0x4b038 },
  3051. [GCC_APB2JTAG_BCR] = { 0x4c000 },
  3052. [GCC_RBCPR_CX_BCR] = { 0x4e000 },
  3053. [GCC_RBCPR_MX_BCR] = { 0x4f000 },
  3054. [GCC_USB3_PHY_BCR] = { 0x50020 },
  3055. [GCC_USB3PHY_PHY_BCR] = { 0x50024 },
  3056. [GCC_USB3_DP_PHY_BCR] = { 0x50028 },
  3057. [GCC_SSC_BCR] = { 0x63000 },
  3058. [GCC_SSC_RESET] = { 0x63020 },
  3059. [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 },
  3060. [GCC_PCIE_0_LINK_DOWN_BCR] = { 0x6c014 },
  3061. [GCC_PCIE_0_PHY_BCR] = { 0x6c01c },
  3062. [GCC_PCIE_0_NOCSR_COM_PHY_BCR] = { 0x6c020 },
  3063. [GCC_PCIE_PHY_BCR] = { 0x6f000 },
  3064. [GCC_PCIE_PHY_NOCSR_COM_PHY_BCR] = { 0x6f00c },
  3065. [GCC_PCIE_PHY_CFG_AHB_BCR] = { 0x6f010 },
  3066. [GCC_PCIE_PHY_COM_BCR] = { 0x6f014 },
  3067. [GCC_GPU_BCR] = { 0x71000 },
  3068. [GCC_SPSS_BCR] = { 0x72000 },
  3069. [GCC_OBT_ODT_BCR] = { 0x73000 },
  3070. [GCC_MSS_RESTART] = { 0x79000 },
  3071. [GCC_VS_BCR] = { 0x7a000 },
  3072. [GCC_MSS_VS_RESET] = { 0x7a100 },
  3073. [GCC_GPU_VS_RESET] = { 0x7a104 },
  3074. [GCC_APC0_VS_RESET] = { 0x7a108 },
  3075. [GCC_APC1_VS_RESET] = { 0x7a10c },
  3076. [GCC_CNOC_BUS_TIMEOUT8_BCR] = { 0x80000 },
  3077. [GCC_CNOC_BUS_TIMEOUT9_BCR] = { 0x80008 },
  3078. [GCC_CNOC_BUS_TIMEOUT10_BCR] = { 0x80010 },
  3079. [GCC_CNOC_BUS_TIMEOUT11_BCR] = { 0x80018 },
  3080. [GCC_CNOC_BUS_TIMEOUT12_BCR] = { 0x80020 },
  3081. [GCC_CNOC_BUS_TIMEOUT13_BCR] = { 0x80028 },
  3082. [GCC_CNOC_BUS_TIMEOUT14_BCR] = { 0x80030 },
  3083. [GCC_CNOC_BUS_TIMEOUT_EXTREF_BCR] = { 0x80038 },
  3084. [GCC_AGGRE1_NOC_BCR] = { 0x82000 },
  3085. [GCC_AGGRE2_NOC_BCR] = { 0x83000 },
  3086. [GCC_DCC_BCR] = { 0x84000 },
  3087. [GCC_QREFS_VBG_CAL_BCR] = { 0x88028 },
  3088. [GCC_IPA_BCR] = { 0x89000 },
  3089. [GCC_GLM_BCR] = { 0x8b000 },
  3090. [GCC_SKL_BCR] = { 0x8c000 },
  3091. [GCC_MSMPU_BCR] = { 0x8d000 },
  3092. };
  3093. static const struct regmap_config gcc_msm8998_regmap_config = {
  3094. .reg_bits = 32,
  3095. .reg_stride = 4,
  3096. .val_bits = 32,
  3097. .max_register = 0x8f000,
  3098. .fast_io = true,
  3099. };
  3100. static const struct qcom_cc_desc gcc_msm8998_desc = {
  3101. .config = &gcc_msm8998_regmap_config,
  3102. .clks = gcc_msm8998_clocks,
  3103. .num_clks = ARRAY_SIZE(gcc_msm8998_clocks),
  3104. .resets = gcc_msm8998_resets,
  3105. .num_resets = ARRAY_SIZE(gcc_msm8998_resets),
  3106. .gdscs = gcc_msm8998_gdscs,
  3107. .num_gdscs = ARRAY_SIZE(gcc_msm8998_gdscs),
  3108. };
  3109. static int gcc_msm8998_probe(struct platform_device *pdev)
  3110. {
  3111. struct regmap *regmap;
  3112. int ret;
  3113. regmap = qcom_cc_map(pdev, &gcc_msm8998_desc);
  3114. if (IS_ERR(regmap))
  3115. return PTR_ERR(regmap);
  3116. /*
  3117. * Set the HMSS_AHB_CLK_SLEEP_ENA bit to allow the hmss_ahb_clk to be
  3118. * turned off by hardware during certain apps low power modes.
  3119. */
  3120. ret = regmap_update_bits(regmap, 0x52008, BIT(21), BIT(21));
  3121. if (ret)
  3122. return ret;
  3123. /* Disable the GPLL0 active input to MMSS and GPU via MISC registers */
  3124. regmap_write(regmap, GCC_MMSS_MISC, 0x10003);
  3125. regmap_write(regmap, GCC_GPU_MISC, 0x10003);
  3126. return qcom_cc_really_probe(&pdev->dev, &gcc_msm8998_desc, regmap);
  3127. }
  3128. static const struct of_device_id gcc_msm8998_match_table[] = {
  3129. { .compatible = "qcom,gcc-msm8998" },
  3130. { }
  3131. };
  3132. MODULE_DEVICE_TABLE(of, gcc_msm8998_match_table);
  3133. static struct platform_driver gcc_msm8998_driver = {
  3134. .probe = gcc_msm8998_probe,
  3135. .driver = {
  3136. .name = "gcc-msm8998",
  3137. .of_match_table = gcc_msm8998_match_table,
  3138. },
  3139. };
  3140. static int __init gcc_msm8998_init(void)
  3141. {
  3142. return platform_driver_register(&gcc_msm8998_driver);
  3143. }
  3144. core_initcall(gcc_msm8998_init);
  3145. static void __exit gcc_msm8998_exit(void)
  3146. {
  3147. platform_driver_unregister(&gcc_msm8998_driver);
  3148. }
  3149. module_exit(gcc_msm8998_exit);
  3150. MODULE_DESCRIPTION("QCOM GCC msm8998 Driver");
  3151. MODULE_LICENSE("GPL v2");
  3152. MODULE_ALIAS("platform:gcc-msm8998");