gcc-msm8916.c 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400
  1. /*
  2. * Copyright 2015 Linaro Limited
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/bitops.h>
  15. #include <linux/err.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/module.h>
  18. #include <linux/of.h>
  19. #include <linux/of_device.h>
  20. #include <linux/clk-provider.h>
  21. #include <linux/regmap.h>
  22. #include <linux/reset-controller.h>
  23. #include <dt-bindings/clock/qcom,gcc-msm8916.h>
  24. #include <dt-bindings/reset/qcom,gcc-msm8916.h>
  25. #include "common.h"
  26. #include "clk-regmap.h"
  27. #include "clk-pll.h"
  28. #include "clk-rcg.h"
  29. #include "clk-branch.h"
  30. #include "reset.h"
  31. #include "gdsc.h"
  32. enum {
  33. P_XO,
  34. P_GPLL0,
  35. P_GPLL0_AUX,
  36. P_BIMC,
  37. P_GPLL1,
  38. P_GPLL1_AUX,
  39. P_GPLL2,
  40. P_GPLL2_AUX,
  41. P_SLEEP_CLK,
  42. P_DSI0_PHYPLL_BYTE,
  43. P_DSI0_PHYPLL_DSI,
  44. P_EXT_PRI_I2S,
  45. P_EXT_SEC_I2S,
  46. P_EXT_MCLK,
  47. };
  48. static const struct parent_map gcc_xo_gpll0_map[] = {
  49. { P_XO, 0 },
  50. { P_GPLL0, 1 },
  51. };
  52. static const char * const gcc_xo_gpll0[] = {
  53. "xo",
  54. "gpll0_vote",
  55. };
  56. static const struct parent_map gcc_xo_gpll0_bimc_map[] = {
  57. { P_XO, 0 },
  58. { P_GPLL0, 1 },
  59. { P_BIMC, 2 },
  60. };
  61. static const char * const gcc_xo_gpll0_bimc[] = {
  62. "xo",
  63. "gpll0_vote",
  64. "bimc_pll_vote",
  65. };
  66. static const struct parent_map gcc_xo_gpll0a_gpll1_gpll2a_map[] = {
  67. { P_XO, 0 },
  68. { P_GPLL0_AUX, 3 },
  69. { P_GPLL1, 1 },
  70. { P_GPLL2_AUX, 2 },
  71. };
  72. static const char * const gcc_xo_gpll0a_gpll1_gpll2a[] = {
  73. "xo",
  74. "gpll0_vote",
  75. "gpll1_vote",
  76. "gpll2_vote",
  77. };
  78. static const struct parent_map gcc_xo_gpll0_gpll2_map[] = {
  79. { P_XO, 0 },
  80. { P_GPLL0, 1 },
  81. { P_GPLL2, 2 },
  82. };
  83. static const char * const gcc_xo_gpll0_gpll2[] = {
  84. "xo",
  85. "gpll0_vote",
  86. "gpll2_vote",
  87. };
  88. static const struct parent_map gcc_xo_gpll0a_map[] = {
  89. { P_XO, 0 },
  90. { P_GPLL0_AUX, 2 },
  91. };
  92. static const char * const gcc_xo_gpll0a[] = {
  93. "xo",
  94. "gpll0_vote",
  95. };
  96. static const struct parent_map gcc_xo_gpll0_gpll1a_sleep_map[] = {
  97. { P_XO, 0 },
  98. { P_GPLL0, 1 },
  99. { P_GPLL1_AUX, 2 },
  100. { P_SLEEP_CLK, 6 },
  101. };
  102. static const char * const gcc_xo_gpll0_gpll1a_sleep[] = {
  103. "xo",
  104. "gpll0_vote",
  105. "gpll1_vote",
  106. "sleep_clk",
  107. };
  108. static const struct parent_map gcc_xo_gpll0_gpll1a_map[] = {
  109. { P_XO, 0 },
  110. { P_GPLL0, 1 },
  111. { P_GPLL1_AUX, 2 },
  112. };
  113. static const char * const gcc_xo_gpll0_gpll1a[] = {
  114. "xo",
  115. "gpll0_vote",
  116. "gpll1_vote",
  117. };
  118. static const struct parent_map gcc_xo_dsibyte_map[] = {
  119. { P_XO, 0, },
  120. { P_DSI0_PHYPLL_BYTE, 2 },
  121. };
  122. static const char * const gcc_xo_dsibyte[] = {
  123. "xo",
  124. "dsi0pllbyte",
  125. };
  126. static const struct parent_map gcc_xo_gpll0a_dsibyte_map[] = {
  127. { P_XO, 0 },
  128. { P_GPLL0_AUX, 2 },
  129. { P_DSI0_PHYPLL_BYTE, 1 },
  130. };
  131. static const char * const gcc_xo_gpll0a_dsibyte[] = {
  132. "xo",
  133. "gpll0_vote",
  134. "dsi0pllbyte",
  135. };
  136. static const struct parent_map gcc_xo_gpll0_dsiphy_map[] = {
  137. { P_XO, 0 },
  138. { P_GPLL0, 1 },
  139. { P_DSI0_PHYPLL_DSI, 2 },
  140. };
  141. static const char * const gcc_xo_gpll0_dsiphy[] = {
  142. "xo",
  143. "gpll0_vote",
  144. "dsi0pll",
  145. };
  146. static const struct parent_map gcc_xo_gpll0a_dsiphy_map[] = {
  147. { P_XO, 0 },
  148. { P_GPLL0_AUX, 2 },
  149. { P_DSI0_PHYPLL_DSI, 1 },
  150. };
  151. static const char * const gcc_xo_gpll0a_dsiphy[] = {
  152. "xo",
  153. "gpll0_vote",
  154. "dsi0pll",
  155. };
  156. static const struct parent_map gcc_xo_gpll0a_gpll1_gpll2_map[] = {
  157. { P_XO, 0 },
  158. { P_GPLL0_AUX, 1 },
  159. { P_GPLL1, 3 },
  160. { P_GPLL2, 2 },
  161. };
  162. static const char * const gcc_xo_gpll0a_gpll1_gpll2[] = {
  163. "xo",
  164. "gpll0_vote",
  165. "gpll1_vote",
  166. "gpll2_vote",
  167. };
  168. static const struct parent_map gcc_xo_gpll0_gpll1_sleep_map[] = {
  169. { P_XO, 0 },
  170. { P_GPLL0, 1 },
  171. { P_GPLL1, 2 },
  172. { P_SLEEP_CLK, 6 }
  173. };
  174. static const char * const gcc_xo_gpll0_gpll1_sleep[] = {
  175. "xo",
  176. "gpll0_vote",
  177. "gpll1_vote",
  178. "sleep_clk",
  179. };
  180. static const struct parent_map gcc_xo_gpll1_epi2s_emclk_sleep_map[] = {
  181. { P_XO, 0 },
  182. { P_GPLL1, 1 },
  183. { P_EXT_PRI_I2S, 2 },
  184. { P_EXT_MCLK, 3 },
  185. { P_SLEEP_CLK, 6 }
  186. };
  187. static const char * const gcc_xo_gpll1_epi2s_emclk_sleep[] = {
  188. "xo",
  189. "gpll1_vote",
  190. "ext_pri_i2s",
  191. "ext_mclk",
  192. "sleep_clk",
  193. };
  194. static const struct parent_map gcc_xo_gpll1_esi2s_emclk_sleep_map[] = {
  195. { P_XO, 0 },
  196. { P_GPLL1, 1 },
  197. { P_EXT_SEC_I2S, 2 },
  198. { P_EXT_MCLK, 3 },
  199. { P_SLEEP_CLK, 6 }
  200. };
  201. static const char * const gcc_xo_gpll1_esi2s_emclk_sleep[] = {
  202. "xo",
  203. "gpll1_vote",
  204. "ext_sec_i2s",
  205. "ext_mclk",
  206. "sleep_clk",
  207. };
  208. static const struct parent_map gcc_xo_sleep_map[] = {
  209. { P_XO, 0 },
  210. { P_SLEEP_CLK, 6 }
  211. };
  212. static const char * const gcc_xo_sleep[] = {
  213. "xo",
  214. "sleep_clk",
  215. };
  216. static const struct parent_map gcc_xo_gpll1_emclk_sleep_map[] = {
  217. { P_XO, 0 },
  218. { P_GPLL1, 1 },
  219. { P_EXT_MCLK, 2 },
  220. { P_SLEEP_CLK, 6 }
  221. };
  222. static const char * const gcc_xo_gpll1_emclk_sleep[] = {
  223. "xo",
  224. "gpll1_vote",
  225. "ext_mclk",
  226. "sleep_clk",
  227. };
  228. #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
  229. static struct clk_pll gpll0 = {
  230. .l_reg = 0x21004,
  231. .m_reg = 0x21008,
  232. .n_reg = 0x2100c,
  233. .config_reg = 0x21014,
  234. .mode_reg = 0x21000,
  235. .status_reg = 0x2101c,
  236. .status_bit = 17,
  237. .clkr.hw.init = &(struct clk_init_data){
  238. .name = "gpll0",
  239. .parent_names = (const char *[]){ "xo" },
  240. .num_parents = 1,
  241. .ops = &clk_pll_ops,
  242. },
  243. };
  244. static struct clk_regmap gpll0_vote = {
  245. .enable_reg = 0x45000,
  246. .enable_mask = BIT(0),
  247. .hw.init = &(struct clk_init_data){
  248. .name = "gpll0_vote",
  249. .parent_names = (const char *[]){ "gpll0" },
  250. .num_parents = 1,
  251. .ops = &clk_pll_vote_ops,
  252. },
  253. };
  254. static struct clk_pll gpll1 = {
  255. .l_reg = 0x20004,
  256. .m_reg = 0x20008,
  257. .n_reg = 0x2000c,
  258. .config_reg = 0x20014,
  259. .mode_reg = 0x20000,
  260. .status_reg = 0x2001c,
  261. .status_bit = 17,
  262. .clkr.hw.init = &(struct clk_init_data){
  263. .name = "gpll1",
  264. .parent_names = (const char *[]){ "xo" },
  265. .num_parents = 1,
  266. .ops = &clk_pll_ops,
  267. },
  268. };
  269. static struct clk_regmap gpll1_vote = {
  270. .enable_reg = 0x45000,
  271. .enable_mask = BIT(1),
  272. .hw.init = &(struct clk_init_data){
  273. .name = "gpll1_vote",
  274. .parent_names = (const char *[]){ "gpll1" },
  275. .num_parents = 1,
  276. .ops = &clk_pll_vote_ops,
  277. },
  278. };
  279. static struct clk_pll gpll2 = {
  280. .l_reg = 0x4a004,
  281. .m_reg = 0x4a008,
  282. .n_reg = 0x4a00c,
  283. .config_reg = 0x4a014,
  284. .mode_reg = 0x4a000,
  285. .status_reg = 0x4a01c,
  286. .status_bit = 17,
  287. .clkr.hw.init = &(struct clk_init_data){
  288. .name = "gpll2",
  289. .parent_names = (const char *[]){ "xo" },
  290. .num_parents = 1,
  291. .ops = &clk_pll_ops,
  292. },
  293. };
  294. static struct clk_regmap gpll2_vote = {
  295. .enable_reg = 0x45000,
  296. .enable_mask = BIT(2),
  297. .hw.init = &(struct clk_init_data){
  298. .name = "gpll2_vote",
  299. .parent_names = (const char *[]){ "gpll2" },
  300. .num_parents = 1,
  301. .ops = &clk_pll_vote_ops,
  302. },
  303. };
  304. static struct clk_pll bimc_pll = {
  305. .l_reg = 0x23004,
  306. .m_reg = 0x23008,
  307. .n_reg = 0x2300c,
  308. .config_reg = 0x23014,
  309. .mode_reg = 0x23000,
  310. .status_reg = 0x2301c,
  311. .status_bit = 17,
  312. .clkr.hw.init = &(struct clk_init_data){
  313. .name = "bimc_pll",
  314. .parent_names = (const char *[]){ "xo" },
  315. .num_parents = 1,
  316. .ops = &clk_pll_ops,
  317. },
  318. };
  319. static struct clk_regmap bimc_pll_vote = {
  320. .enable_reg = 0x45000,
  321. .enable_mask = BIT(3),
  322. .hw.init = &(struct clk_init_data){
  323. .name = "bimc_pll_vote",
  324. .parent_names = (const char *[]){ "bimc_pll" },
  325. .num_parents = 1,
  326. .ops = &clk_pll_vote_ops,
  327. },
  328. };
  329. static struct clk_rcg2 pcnoc_bfdcd_clk_src = {
  330. .cmd_rcgr = 0x27000,
  331. .hid_width = 5,
  332. .parent_map = gcc_xo_gpll0_bimc_map,
  333. .clkr.hw.init = &(struct clk_init_data){
  334. .name = "pcnoc_bfdcd_clk_src",
  335. .parent_names = gcc_xo_gpll0_bimc,
  336. .num_parents = 3,
  337. .ops = &clk_rcg2_ops,
  338. },
  339. };
  340. static struct clk_rcg2 system_noc_bfdcd_clk_src = {
  341. .cmd_rcgr = 0x26004,
  342. .hid_width = 5,
  343. .parent_map = gcc_xo_gpll0_bimc_map,
  344. .clkr.hw.init = &(struct clk_init_data){
  345. .name = "system_noc_bfdcd_clk_src",
  346. .parent_names = gcc_xo_gpll0_bimc,
  347. .num_parents = 3,
  348. .ops = &clk_rcg2_ops,
  349. },
  350. };
  351. static const struct freq_tbl ftbl_gcc_camss_ahb_clk[] = {
  352. F(40000000, P_GPLL0, 10, 1, 2),
  353. F(80000000, P_GPLL0, 10, 0, 0),
  354. { }
  355. };
  356. static struct clk_rcg2 camss_ahb_clk_src = {
  357. .cmd_rcgr = 0x5a000,
  358. .mnd_width = 8,
  359. .hid_width = 5,
  360. .parent_map = gcc_xo_gpll0_map,
  361. .freq_tbl = ftbl_gcc_camss_ahb_clk,
  362. .clkr.hw.init = &(struct clk_init_data){
  363. .name = "camss_ahb_clk_src",
  364. .parent_names = gcc_xo_gpll0,
  365. .num_parents = 2,
  366. .ops = &clk_rcg2_ops,
  367. },
  368. };
  369. static const struct freq_tbl ftbl_apss_ahb_clk[] = {
  370. F(19200000, P_XO, 1, 0, 0),
  371. F(50000000, P_GPLL0, 16, 0, 0),
  372. F(100000000, P_GPLL0, 8, 0, 0),
  373. F(133330000, P_GPLL0, 6, 0, 0),
  374. { }
  375. };
  376. static struct clk_rcg2 apss_ahb_clk_src = {
  377. .cmd_rcgr = 0x46000,
  378. .hid_width = 5,
  379. .parent_map = gcc_xo_gpll0_map,
  380. .freq_tbl = ftbl_apss_ahb_clk,
  381. .clkr.hw.init = &(struct clk_init_data){
  382. .name = "apss_ahb_clk_src",
  383. .parent_names = gcc_xo_gpll0,
  384. .num_parents = 2,
  385. .ops = &clk_rcg2_ops,
  386. },
  387. };
  388. static const struct freq_tbl ftbl_gcc_camss_csi0_1_clk[] = {
  389. F(100000000, P_GPLL0, 8, 0, 0),
  390. F(200000000, P_GPLL0, 4, 0, 0),
  391. { }
  392. };
  393. static struct clk_rcg2 csi0_clk_src = {
  394. .cmd_rcgr = 0x4e020,
  395. .hid_width = 5,
  396. .parent_map = gcc_xo_gpll0_map,
  397. .freq_tbl = ftbl_gcc_camss_csi0_1_clk,
  398. .clkr.hw.init = &(struct clk_init_data){
  399. .name = "csi0_clk_src",
  400. .parent_names = gcc_xo_gpll0,
  401. .num_parents = 2,
  402. .ops = &clk_rcg2_ops,
  403. },
  404. };
  405. static struct clk_rcg2 csi1_clk_src = {
  406. .cmd_rcgr = 0x4f020,
  407. .hid_width = 5,
  408. .parent_map = gcc_xo_gpll0_map,
  409. .freq_tbl = ftbl_gcc_camss_csi0_1_clk,
  410. .clkr.hw.init = &(struct clk_init_data){
  411. .name = "csi1_clk_src",
  412. .parent_names = gcc_xo_gpll0,
  413. .num_parents = 2,
  414. .ops = &clk_rcg2_ops,
  415. },
  416. };
  417. static const struct freq_tbl ftbl_gcc_oxili_gfx3d_clk[] = {
  418. F(19200000, P_XO, 1, 0, 0),
  419. F(50000000, P_GPLL0_AUX, 16, 0, 0),
  420. F(80000000, P_GPLL0_AUX, 10, 0, 0),
  421. F(100000000, P_GPLL0_AUX, 8, 0, 0),
  422. F(160000000, P_GPLL0_AUX, 5, 0, 0),
  423. F(177780000, P_GPLL0_AUX, 4.5, 0, 0),
  424. F(200000000, P_GPLL0_AUX, 4, 0, 0),
  425. F(266670000, P_GPLL0_AUX, 3, 0, 0),
  426. F(294912000, P_GPLL1, 3, 0, 0),
  427. F(310000000, P_GPLL2, 3, 0, 0),
  428. F(400000000, P_GPLL0_AUX, 2, 0, 0),
  429. { }
  430. };
  431. static struct clk_rcg2 gfx3d_clk_src = {
  432. .cmd_rcgr = 0x59000,
  433. .hid_width = 5,
  434. .parent_map = gcc_xo_gpll0a_gpll1_gpll2a_map,
  435. .freq_tbl = ftbl_gcc_oxili_gfx3d_clk,
  436. .clkr.hw.init = &(struct clk_init_data){
  437. .name = "gfx3d_clk_src",
  438. .parent_names = gcc_xo_gpll0a_gpll1_gpll2a,
  439. .num_parents = 4,
  440. .ops = &clk_rcg2_ops,
  441. },
  442. };
  443. static const struct freq_tbl ftbl_gcc_camss_vfe0_clk[] = {
  444. F(50000000, P_GPLL0, 16, 0, 0),
  445. F(80000000, P_GPLL0, 10, 0, 0),
  446. F(100000000, P_GPLL0, 8, 0, 0),
  447. F(160000000, P_GPLL0, 5, 0, 0),
  448. F(177780000, P_GPLL0, 4.5, 0, 0),
  449. F(200000000, P_GPLL0, 4, 0, 0),
  450. F(266670000, P_GPLL0, 3, 0, 0),
  451. F(320000000, P_GPLL0, 2.5, 0, 0),
  452. F(400000000, P_GPLL0, 2, 0, 0),
  453. F(465000000, P_GPLL2, 2, 0, 0),
  454. { }
  455. };
  456. static struct clk_rcg2 vfe0_clk_src = {
  457. .cmd_rcgr = 0x58000,
  458. .hid_width = 5,
  459. .parent_map = gcc_xo_gpll0_gpll2_map,
  460. .freq_tbl = ftbl_gcc_camss_vfe0_clk,
  461. .clkr.hw.init = &(struct clk_init_data){
  462. .name = "vfe0_clk_src",
  463. .parent_names = gcc_xo_gpll0_gpll2,
  464. .num_parents = 3,
  465. .ops = &clk_rcg2_ops,
  466. },
  467. };
  468. static const struct freq_tbl ftbl_gcc_blsp1_qup1_6_i2c_apps_clk[] = {
  469. F(19200000, P_XO, 1, 0, 0),
  470. F(50000000, P_GPLL0, 16, 0, 0),
  471. { }
  472. };
  473. static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
  474. .cmd_rcgr = 0x0200c,
  475. .hid_width = 5,
  476. .parent_map = gcc_xo_gpll0_map,
  477. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  478. .clkr.hw.init = &(struct clk_init_data){
  479. .name = "blsp1_qup1_i2c_apps_clk_src",
  480. .parent_names = gcc_xo_gpll0,
  481. .num_parents = 2,
  482. .ops = &clk_rcg2_ops,
  483. },
  484. };
  485. static const struct freq_tbl ftbl_gcc_blsp1_qup1_6_spi_apps_clk[] = {
  486. F(960000, P_XO, 10, 1, 2),
  487. F(4800000, P_XO, 4, 0, 0),
  488. F(9600000, P_XO, 2, 0, 0),
  489. F(16000000, P_GPLL0, 10, 1, 5),
  490. F(19200000, P_XO, 1, 0, 0),
  491. F(25000000, P_GPLL0, 16, 1, 2),
  492. F(50000000, P_GPLL0, 16, 0, 0),
  493. { }
  494. };
  495. static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
  496. .cmd_rcgr = 0x02024,
  497. .mnd_width = 8,
  498. .hid_width = 5,
  499. .parent_map = gcc_xo_gpll0_map,
  500. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  501. .clkr.hw.init = &(struct clk_init_data){
  502. .name = "blsp1_qup1_spi_apps_clk_src",
  503. .parent_names = gcc_xo_gpll0,
  504. .num_parents = 2,
  505. .ops = &clk_rcg2_ops,
  506. },
  507. };
  508. static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
  509. .cmd_rcgr = 0x03000,
  510. .hid_width = 5,
  511. .parent_map = gcc_xo_gpll0_map,
  512. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  513. .clkr.hw.init = &(struct clk_init_data){
  514. .name = "blsp1_qup2_i2c_apps_clk_src",
  515. .parent_names = gcc_xo_gpll0,
  516. .num_parents = 2,
  517. .ops = &clk_rcg2_ops,
  518. },
  519. };
  520. static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
  521. .cmd_rcgr = 0x03014,
  522. .mnd_width = 8,
  523. .hid_width = 5,
  524. .parent_map = gcc_xo_gpll0_map,
  525. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  526. .clkr.hw.init = &(struct clk_init_data){
  527. .name = "blsp1_qup2_spi_apps_clk_src",
  528. .parent_names = gcc_xo_gpll0,
  529. .num_parents = 2,
  530. .ops = &clk_rcg2_ops,
  531. },
  532. };
  533. static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
  534. .cmd_rcgr = 0x04000,
  535. .hid_width = 5,
  536. .parent_map = gcc_xo_gpll0_map,
  537. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  538. .clkr.hw.init = &(struct clk_init_data){
  539. .name = "blsp1_qup3_i2c_apps_clk_src",
  540. .parent_names = gcc_xo_gpll0,
  541. .num_parents = 2,
  542. .ops = &clk_rcg2_ops,
  543. },
  544. };
  545. static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
  546. .cmd_rcgr = 0x04024,
  547. .mnd_width = 8,
  548. .hid_width = 5,
  549. .parent_map = gcc_xo_gpll0_map,
  550. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  551. .clkr.hw.init = &(struct clk_init_data){
  552. .name = "blsp1_qup3_spi_apps_clk_src",
  553. .parent_names = gcc_xo_gpll0,
  554. .num_parents = 2,
  555. .ops = &clk_rcg2_ops,
  556. },
  557. };
  558. static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
  559. .cmd_rcgr = 0x05000,
  560. .hid_width = 5,
  561. .parent_map = gcc_xo_gpll0_map,
  562. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  563. .clkr.hw.init = &(struct clk_init_data){
  564. .name = "blsp1_qup4_i2c_apps_clk_src",
  565. .parent_names = gcc_xo_gpll0,
  566. .num_parents = 2,
  567. .ops = &clk_rcg2_ops,
  568. },
  569. };
  570. static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
  571. .cmd_rcgr = 0x05024,
  572. .mnd_width = 8,
  573. .hid_width = 5,
  574. .parent_map = gcc_xo_gpll0_map,
  575. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  576. .clkr.hw.init = &(struct clk_init_data){
  577. .name = "blsp1_qup4_spi_apps_clk_src",
  578. .parent_names = gcc_xo_gpll0,
  579. .num_parents = 2,
  580. .ops = &clk_rcg2_ops,
  581. },
  582. };
  583. static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
  584. .cmd_rcgr = 0x06000,
  585. .hid_width = 5,
  586. .parent_map = gcc_xo_gpll0_map,
  587. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  588. .clkr.hw.init = &(struct clk_init_data){
  589. .name = "blsp1_qup5_i2c_apps_clk_src",
  590. .parent_names = gcc_xo_gpll0,
  591. .num_parents = 2,
  592. .ops = &clk_rcg2_ops,
  593. },
  594. };
  595. static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
  596. .cmd_rcgr = 0x06024,
  597. .mnd_width = 8,
  598. .hid_width = 5,
  599. .parent_map = gcc_xo_gpll0_map,
  600. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  601. .clkr.hw.init = &(struct clk_init_data){
  602. .name = "blsp1_qup5_spi_apps_clk_src",
  603. .parent_names = gcc_xo_gpll0,
  604. .num_parents = 2,
  605. .ops = &clk_rcg2_ops,
  606. },
  607. };
  608. static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
  609. .cmd_rcgr = 0x07000,
  610. .hid_width = 5,
  611. .parent_map = gcc_xo_gpll0_map,
  612. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  613. .clkr.hw.init = &(struct clk_init_data){
  614. .name = "blsp1_qup6_i2c_apps_clk_src",
  615. .parent_names = gcc_xo_gpll0,
  616. .num_parents = 2,
  617. .ops = &clk_rcg2_ops,
  618. },
  619. };
  620. static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
  621. .cmd_rcgr = 0x07024,
  622. .mnd_width = 8,
  623. .hid_width = 5,
  624. .parent_map = gcc_xo_gpll0_map,
  625. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  626. .clkr.hw.init = &(struct clk_init_data){
  627. .name = "blsp1_qup6_spi_apps_clk_src",
  628. .parent_names = gcc_xo_gpll0,
  629. .num_parents = 2,
  630. .ops = &clk_rcg2_ops,
  631. },
  632. };
  633. static const struct freq_tbl ftbl_gcc_blsp1_uart1_6_apps_clk[] = {
  634. F(3686400, P_GPLL0, 1, 72, 15625),
  635. F(7372800, P_GPLL0, 1, 144, 15625),
  636. F(14745600, P_GPLL0, 1, 288, 15625),
  637. F(16000000, P_GPLL0, 10, 1, 5),
  638. F(19200000, P_XO, 1, 0, 0),
  639. F(24000000, P_GPLL0, 1, 3, 100),
  640. F(25000000, P_GPLL0, 16, 1, 2),
  641. F(32000000, P_GPLL0, 1, 1, 25),
  642. F(40000000, P_GPLL0, 1, 1, 20),
  643. F(46400000, P_GPLL0, 1, 29, 500),
  644. F(48000000, P_GPLL0, 1, 3, 50),
  645. F(51200000, P_GPLL0, 1, 8, 125),
  646. F(56000000, P_GPLL0, 1, 7, 100),
  647. F(58982400, P_GPLL0, 1, 1152, 15625),
  648. F(60000000, P_GPLL0, 1, 3, 40),
  649. { }
  650. };
  651. static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
  652. .cmd_rcgr = 0x02044,
  653. .mnd_width = 16,
  654. .hid_width = 5,
  655. .parent_map = gcc_xo_gpll0_map,
  656. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  657. .clkr.hw.init = &(struct clk_init_data){
  658. .name = "blsp1_uart1_apps_clk_src",
  659. .parent_names = gcc_xo_gpll0,
  660. .num_parents = 2,
  661. .ops = &clk_rcg2_ops,
  662. },
  663. };
  664. static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
  665. .cmd_rcgr = 0x03034,
  666. .mnd_width = 16,
  667. .hid_width = 5,
  668. .parent_map = gcc_xo_gpll0_map,
  669. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  670. .clkr.hw.init = &(struct clk_init_data){
  671. .name = "blsp1_uart2_apps_clk_src",
  672. .parent_names = gcc_xo_gpll0,
  673. .num_parents = 2,
  674. .ops = &clk_rcg2_ops,
  675. },
  676. };
  677. static const struct freq_tbl ftbl_gcc_camss_cci_clk[] = {
  678. F(19200000, P_XO, 1, 0, 0),
  679. { }
  680. };
  681. static struct clk_rcg2 cci_clk_src = {
  682. .cmd_rcgr = 0x51000,
  683. .mnd_width = 8,
  684. .hid_width = 5,
  685. .parent_map = gcc_xo_gpll0a_map,
  686. .freq_tbl = ftbl_gcc_camss_cci_clk,
  687. .clkr.hw.init = &(struct clk_init_data){
  688. .name = "cci_clk_src",
  689. .parent_names = gcc_xo_gpll0a,
  690. .num_parents = 2,
  691. .ops = &clk_rcg2_ops,
  692. },
  693. };
  694. static const struct freq_tbl ftbl_gcc_camss_gp0_1_clk[] = {
  695. F(100000000, P_GPLL0, 8, 0, 0),
  696. F(200000000, P_GPLL0, 4, 0, 0),
  697. { }
  698. };
  699. static struct clk_rcg2 camss_gp0_clk_src = {
  700. .cmd_rcgr = 0x54000,
  701. .mnd_width = 8,
  702. .hid_width = 5,
  703. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  704. .freq_tbl = ftbl_gcc_camss_gp0_1_clk,
  705. .clkr.hw.init = &(struct clk_init_data){
  706. .name = "camss_gp0_clk_src",
  707. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  708. .num_parents = 4,
  709. .ops = &clk_rcg2_ops,
  710. },
  711. };
  712. static struct clk_rcg2 camss_gp1_clk_src = {
  713. .cmd_rcgr = 0x55000,
  714. .mnd_width = 8,
  715. .hid_width = 5,
  716. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  717. .freq_tbl = ftbl_gcc_camss_gp0_1_clk,
  718. .clkr.hw.init = &(struct clk_init_data){
  719. .name = "camss_gp1_clk_src",
  720. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  721. .num_parents = 4,
  722. .ops = &clk_rcg2_ops,
  723. },
  724. };
  725. static const struct freq_tbl ftbl_gcc_camss_jpeg0_clk[] = {
  726. F(133330000, P_GPLL0, 6, 0, 0),
  727. F(266670000, P_GPLL0, 3, 0, 0),
  728. F(320000000, P_GPLL0, 2.5, 0, 0),
  729. { }
  730. };
  731. static struct clk_rcg2 jpeg0_clk_src = {
  732. .cmd_rcgr = 0x57000,
  733. .hid_width = 5,
  734. .parent_map = gcc_xo_gpll0_map,
  735. .freq_tbl = ftbl_gcc_camss_jpeg0_clk,
  736. .clkr.hw.init = &(struct clk_init_data){
  737. .name = "jpeg0_clk_src",
  738. .parent_names = gcc_xo_gpll0,
  739. .num_parents = 2,
  740. .ops = &clk_rcg2_ops,
  741. },
  742. };
  743. static const struct freq_tbl ftbl_gcc_camss_mclk0_1_clk[] = {
  744. F(9600000, P_XO, 2, 0, 0),
  745. F(23880000, P_GPLL0, 1, 2, 67),
  746. F(66670000, P_GPLL0, 12, 0, 0),
  747. { }
  748. };
  749. static struct clk_rcg2 mclk0_clk_src = {
  750. .cmd_rcgr = 0x52000,
  751. .mnd_width = 8,
  752. .hid_width = 5,
  753. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  754. .freq_tbl = ftbl_gcc_camss_mclk0_1_clk,
  755. .clkr.hw.init = &(struct clk_init_data){
  756. .name = "mclk0_clk_src",
  757. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  758. .num_parents = 4,
  759. .ops = &clk_rcg2_ops,
  760. },
  761. };
  762. static struct clk_rcg2 mclk1_clk_src = {
  763. .cmd_rcgr = 0x53000,
  764. .mnd_width = 8,
  765. .hid_width = 5,
  766. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  767. .freq_tbl = ftbl_gcc_camss_mclk0_1_clk,
  768. .clkr.hw.init = &(struct clk_init_data){
  769. .name = "mclk1_clk_src",
  770. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  771. .num_parents = 4,
  772. .ops = &clk_rcg2_ops,
  773. },
  774. };
  775. static const struct freq_tbl ftbl_gcc_camss_csi0_1phytimer_clk[] = {
  776. F(100000000, P_GPLL0, 8, 0, 0),
  777. F(200000000, P_GPLL0, 4, 0, 0),
  778. { }
  779. };
  780. static struct clk_rcg2 csi0phytimer_clk_src = {
  781. .cmd_rcgr = 0x4e000,
  782. .hid_width = 5,
  783. .parent_map = gcc_xo_gpll0_gpll1a_map,
  784. .freq_tbl = ftbl_gcc_camss_csi0_1phytimer_clk,
  785. .clkr.hw.init = &(struct clk_init_data){
  786. .name = "csi0phytimer_clk_src",
  787. .parent_names = gcc_xo_gpll0_gpll1a,
  788. .num_parents = 3,
  789. .ops = &clk_rcg2_ops,
  790. },
  791. };
  792. static struct clk_rcg2 csi1phytimer_clk_src = {
  793. .cmd_rcgr = 0x4f000,
  794. .hid_width = 5,
  795. .parent_map = gcc_xo_gpll0_gpll1a_map,
  796. .freq_tbl = ftbl_gcc_camss_csi0_1phytimer_clk,
  797. .clkr.hw.init = &(struct clk_init_data){
  798. .name = "csi1phytimer_clk_src",
  799. .parent_names = gcc_xo_gpll0_gpll1a,
  800. .num_parents = 3,
  801. .ops = &clk_rcg2_ops,
  802. },
  803. };
  804. static const struct freq_tbl ftbl_gcc_camss_cpp_clk[] = {
  805. F(160000000, P_GPLL0, 5, 0, 0),
  806. F(320000000, P_GPLL0, 2.5, 0, 0),
  807. F(465000000, P_GPLL2, 2, 0, 0),
  808. { }
  809. };
  810. static struct clk_rcg2 cpp_clk_src = {
  811. .cmd_rcgr = 0x58018,
  812. .hid_width = 5,
  813. .parent_map = gcc_xo_gpll0_gpll2_map,
  814. .freq_tbl = ftbl_gcc_camss_cpp_clk,
  815. .clkr.hw.init = &(struct clk_init_data){
  816. .name = "cpp_clk_src",
  817. .parent_names = gcc_xo_gpll0_gpll2,
  818. .num_parents = 3,
  819. .ops = &clk_rcg2_ops,
  820. },
  821. };
  822. static const struct freq_tbl ftbl_gcc_crypto_clk[] = {
  823. F(50000000, P_GPLL0, 16, 0, 0),
  824. F(80000000, P_GPLL0, 10, 0, 0),
  825. F(100000000, P_GPLL0, 8, 0, 0),
  826. F(160000000, P_GPLL0, 5, 0, 0),
  827. { }
  828. };
  829. static struct clk_rcg2 crypto_clk_src = {
  830. .cmd_rcgr = 0x16004,
  831. .hid_width = 5,
  832. .parent_map = gcc_xo_gpll0_map,
  833. .freq_tbl = ftbl_gcc_crypto_clk,
  834. .clkr.hw.init = &(struct clk_init_data){
  835. .name = "crypto_clk_src",
  836. .parent_names = gcc_xo_gpll0,
  837. .num_parents = 2,
  838. .ops = &clk_rcg2_ops,
  839. },
  840. };
  841. static const struct freq_tbl ftbl_gcc_gp1_3_clk[] = {
  842. F(19200000, P_XO, 1, 0, 0),
  843. { }
  844. };
  845. static struct clk_rcg2 gp1_clk_src = {
  846. .cmd_rcgr = 0x08004,
  847. .mnd_width = 8,
  848. .hid_width = 5,
  849. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  850. .freq_tbl = ftbl_gcc_gp1_3_clk,
  851. .clkr.hw.init = &(struct clk_init_data){
  852. .name = "gp1_clk_src",
  853. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  854. .num_parents = 3,
  855. .ops = &clk_rcg2_ops,
  856. },
  857. };
  858. static struct clk_rcg2 gp2_clk_src = {
  859. .cmd_rcgr = 0x09004,
  860. .mnd_width = 8,
  861. .hid_width = 5,
  862. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  863. .freq_tbl = ftbl_gcc_gp1_3_clk,
  864. .clkr.hw.init = &(struct clk_init_data){
  865. .name = "gp2_clk_src",
  866. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  867. .num_parents = 3,
  868. .ops = &clk_rcg2_ops,
  869. },
  870. };
  871. static struct clk_rcg2 gp3_clk_src = {
  872. .cmd_rcgr = 0x0a004,
  873. .mnd_width = 8,
  874. .hid_width = 5,
  875. .parent_map = gcc_xo_gpll0_gpll1a_sleep_map,
  876. .freq_tbl = ftbl_gcc_gp1_3_clk,
  877. .clkr.hw.init = &(struct clk_init_data){
  878. .name = "gp3_clk_src",
  879. .parent_names = gcc_xo_gpll0_gpll1a_sleep,
  880. .num_parents = 3,
  881. .ops = &clk_rcg2_ops,
  882. },
  883. };
  884. static struct clk_rcg2 byte0_clk_src = {
  885. .cmd_rcgr = 0x4d044,
  886. .hid_width = 5,
  887. .parent_map = gcc_xo_gpll0a_dsibyte_map,
  888. .clkr.hw.init = &(struct clk_init_data){
  889. .name = "byte0_clk_src",
  890. .parent_names = gcc_xo_gpll0a_dsibyte,
  891. .num_parents = 3,
  892. .ops = &clk_byte2_ops,
  893. .flags = CLK_SET_RATE_PARENT,
  894. },
  895. };
  896. static const struct freq_tbl ftbl_gcc_mdss_esc0_clk[] = {
  897. F(19200000, P_XO, 1, 0, 0),
  898. { }
  899. };
  900. static struct clk_rcg2 esc0_clk_src = {
  901. .cmd_rcgr = 0x4d05c,
  902. .hid_width = 5,
  903. .parent_map = gcc_xo_dsibyte_map,
  904. .freq_tbl = ftbl_gcc_mdss_esc0_clk,
  905. .clkr.hw.init = &(struct clk_init_data){
  906. .name = "esc0_clk_src",
  907. .parent_names = gcc_xo_dsibyte,
  908. .num_parents = 2,
  909. .ops = &clk_rcg2_ops,
  910. },
  911. };
  912. static const struct freq_tbl ftbl_gcc_mdss_mdp_clk[] = {
  913. F(50000000, P_GPLL0, 16, 0, 0),
  914. F(80000000, P_GPLL0, 10, 0, 0),
  915. F(100000000, P_GPLL0, 8, 0, 0),
  916. F(160000000, P_GPLL0, 5, 0, 0),
  917. F(177780000, P_GPLL0, 4.5, 0, 0),
  918. F(200000000, P_GPLL0, 4, 0, 0),
  919. F(266670000, P_GPLL0, 3, 0, 0),
  920. F(320000000, P_GPLL0, 2.5, 0, 0),
  921. { }
  922. };
  923. static struct clk_rcg2 mdp_clk_src = {
  924. .cmd_rcgr = 0x4d014,
  925. .hid_width = 5,
  926. .parent_map = gcc_xo_gpll0_dsiphy_map,
  927. .freq_tbl = ftbl_gcc_mdss_mdp_clk,
  928. .clkr.hw.init = &(struct clk_init_data){
  929. .name = "mdp_clk_src",
  930. .parent_names = gcc_xo_gpll0_dsiphy,
  931. .num_parents = 3,
  932. .ops = &clk_rcg2_ops,
  933. },
  934. };
  935. static struct clk_rcg2 pclk0_clk_src = {
  936. .cmd_rcgr = 0x4d000,
  937. .mnd_width = 8,
  938. .hid_width = 5,
  939. .parent_map = gcc_xo_gpll0a_dsiphy_map,
  940. .clkr.hw.init = &(struct clk_init_data){
  941. .name = "pclk0_clk_src",
  942. .parent_names = gcc_xo_gpll0a_dsiphy,
  943. .num_parents = 3,
  944. .ops = &clk_pixel_ops,
  945. .flags = CLK_SET_RATE_PARENT,
  946. },
  947. };
  948. static const struct freq_tbl ftbl_gcc_mdss_vsync_clk[] = {
  949. F(19200000, P_XO, 1, 0, 0),
  950. { }
  951. };
  952. static struct clk_rcg2 vsync_clk_src = {
  953. .cmd_rcgr = 0x4d02c,
  954. .hid_width = 5,
  955. .parent_map = gcc_xo_gpll0a_map,
  956. .freq_tbl = ftbl_gcc_mdss_vsync_clk,
  957. .clkr.hw.init = &(struct clk_init_data){
  958. .name = "vsync_clk_src",
  959. .parent_names = gcc_xo_gpll0a,
  960. .num_parents = 2,
  961. .ops = &clk_rcg2_ops,
  962. },
  963. };
  964. static const struct freq_tbl ftbl_gcc_pdm2_clk[] = {
  965. F(64000000, P_GPLL0, 12.5, 0, 0),
  966. { }
  967. };
  968. static struct clk_rcg2 pdm2_clk_src = {
  969. .cmd_rcgr = 0x44010,
  970. .hid_width = 5,
  971. .parent_map = gcc_xo_gpll0_map,
  972. .freq_tbl = ftbl_gcc_pdm2_clk,
  973. .clkr.hw.init = &(struct clk_init_data){
  974. .name = "pdm2_clk_src",
  975. .parent_names = gcc_xo_gpll0,
  976. .num_parents = 2,
  977. .ops = &clk_rcg2_ops,
  978. },
  979. };
  980. static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk[] = {
  981. F(144000, P_XO, 16, 3, 25),
  982. F(400000, P_XO, 12, 1, 4),
  983. F(20000000, P_GPLL0, 10, 1, 4),
  984. F(25000000, P_GPLL0, 16, 1, 2),
  985. F(50000000, P_GPLL0, 16, 0, 0),
  986. F(100000000, P_GPLL0, 8, 0, 0),
  987. F(177770000, P_GPLL0, 4.5, 0, 0),
  988. { }
  989. };
  990. static struct clk_rcg2 sdcc1_apps_clk_src = {
  991. .cmd_rcgr = 0x42004,
  992. .mnd_width = 8,
  993. .hid_width = 5,
  994. .parent_map = gcc_xo_gpll0_map,
  995. .freq_tbl = ftbl_gcc_sdcc1_apps_clk,
  996. .clkr.hw.init = &(struct clk_init_data){
  997. .name = "sdcc1_apps_clk_src",
  998. .parent_names = gcc_xo_gpll0,
  999. .num_parents = 2,
  1000. .ops = &clk_rcg2_ops,
  1001. },
  1002. };
  1003. static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk[] = {
  1004. F(144000, P_XO, 16, 3, 25),
  1005. F(400000, P_XO, 12, 1, 4),
  1006. F(20000000, P_GPLL0, 10, 1, 4),
  1007. F(25000000, P_GPLL0, 16, 1, 2),
  1008. F(50000000, P_GPLL0, 16, 0, 0),
  1009. F(100000000, P_GPLL0, 8, 0, 0),
  1010. F(200000000, P_GPLL0, 4, 0, 0),
  1011. { }
  1012. };
  1013. static struct clk_rcg2 sdcc2_apps_clk_src = {
  1014. .cmd_rcgr = 0x43004,
  1015. .mnd_width = 8,
  1016. .hid_width = 5,
  1017. .parent_map = gcc_xo_gpll0_map,
  1018. .freq_tbl = ftbl_gcc_sdcc2_apps_clk,
  1019. .clkr.hw.init = &(struct clk_init_data){
  1020. .name = "sdcc2_apps_clk_src",
  1021. .parent_names = gcc_xo_gpll0,
  1022. .num_parents = 2,
  1023. .ops = &clk_rcg2_ops,
  1024. },
  1025. };
  1026. static const struct freq_tbl ftbl_gcc_apss_tcu_clk[] = {
  1027. F(155000000, P_GPLL2, 6, 0, 0),
  1028. F(310000000, P_GPLL2, 3, 0, 0),
  1029. F(400000000, P_GPLL0, 2, 0, 0),
  1030. { }
  1031. };
  1032. static struct clk_rcg2 apss_tcu_clk_src = {
  1033. .cmd_rcgr = 0x1207c,
  1034. .hid_width = 5,
  1035. .parent_map = gcc_xo_gpll0a_gpll1_gpll2_map,
  1036. .freq_tbl = ftbl_gcc_apss_tcu_clk,
  1037. .clkr.hw.init = &(struct clk_init_data){
  1038. .name = "apss_tcu_clk_src",
  1039. .parent_names = gcc_xo_gpll0a_gpll1_gpll2,
  1040. .num_parents = 4,
  1041. .ops = &clk_rcg2_ops,
  1042. },
  1043. };
  1044. static const struct freq_tbl ftbl_gcc_bimc_gpu_clk[] = {
  1045. F(19200000, P_XO, 1, 0, 0),
  1046. F(100000000, P_GPLL0, 8, 0, 0),
  1047. F(200000000, P_GPLL0, 4, 0, 0),
  1048. F(266500000, P_BIMC, 4, 0, 0),
  1049. F(400000000, P_GPLL0, 2, 0, 0),
  1050. F(533000000, P_BIMC, 2, 0, 0),
  1051. { }
  1052. };
  1053. static struct clk_rcg2 bimc_gpu_clk_src = {
  1054. .cmd_rcgr = 0x31028,
  1055. .hid_width = 5,
  1056. .parent_map = gcc_xo_gpll0_bimc_map,
  1057. .freq_tbl = ftbl_gcc_bimc_gpu_clk,
  1058. .clkr.hw.init = &(struct clk_init_data){
  1059. .name = "bimc_gpu_clk_src",
  1060. .parent_names = gcc_xo_gpll0_bimc,
  1061. .num_parents = 3,
  1062. .flags = CLK_GET_RATE_NOCACHE,
  1063. .ops = &clk_rcg2_shared_ops,
  1064. },
  1065. };
  1066. static const struct freq_tbl ftbl_gcc_usb_hs_system_clk[] = {
  1067. F(80000000, P_GPLL0, 10, 0, 0),
  1068. { }
  1069. };
  1070. static struct clk_rcg2 usb_hs_system_clk_src = {
  1071. .cmd_rcgr = 0x41010,
  1072. .hid_width = 5,
  1073. .parent_map = gcc_xo_gpll0_map,
  1074. .freq_tbl = ftbl_gcc_usb_hs_system_clk,
  1075. .clkr.hw.init = &(struct clk_init_data){
  1076. .name = "usb_hs_system_clk_src",
  1077. .parent_names = gcc_xo_gpll0,
  1078. .num_parents = 2,
  1079. .ops = &clk_rcg2_ops,
  1080. },
  1081. };
  1082. static const struct freq_tbl ftbl_gcc_ultaudio_ahb_clk[] = {
  1083. F(3200000, P_XO, 6, 0, 0),
  1084. F(6400000, P_XO, 3, 0, 0),
  1085. F(9600000, P_XO, 2, 0, 0),
  1086. F(19200000, P_XO, 1, 0, 0),
  1087. F(40000000, P_GPLL0, 10, 1, 2),
  1088. F(66670000, P_GPLL0, 12, 0, 0),
  1089. F(80000000, P_GPLL0, 10, 0, 0),
  1090. F(100000000, P_GPLL0, 8, 0, 0),
  1091. { }
  1092. };
  1093. static struct clk_rcg2 ultaudio_ahbfabric_clk_src = {
  1094. .cmd_rcgr = 0x1c010,
  1095. .hid_width = 5,
  1096. .mnd_width = 8,
  1097. .parent_map = gcc_xo_gpll0_gpll1_sleep_map,
  1098. .freq_tbl = ftbl_gcc_ultaudio_ahb_clk,
  1099. .clkr.hw.init = &(struct clk_init_data){
  1100. .name = "ultaudio_ahbfabric_clk_src",
  1101. .parent_names = gcc_xo_gpll0_gpll1_sleep,
  1102. .num_parents = 4,
  1103. .ops = &clk_rcg2_ops,
  1104. },
  1105. };
  1106. static struct clk_branch gcc_ultaudio_ahbfabric_ixfabric_clk = {
  1107. .halt_reg = 0x1c028,
  1108. .clkr = {
  1109. .enable_reg = 0x1c028,
  1110. .enable_mask = BIT(0),
  1111. .hw.init = &(struct clk_init_data){
  1112. .name = "gcc_ultaudio_ahbfabric_ixfabric_clk",
  1113. .parent_names = (const char *[]){
  1114. "ultaudio_ahbfabric_clk_src",
  1115. },
  1116. .num_parents = 1,
  1117. .flags = CLK_SET_RATE_PARENT,
  1118. .ops = &clk_branch2_ops,
  1119. },
  1120. },
  1121. };
  1122. static struct clk_branch gcc_ultaudio_ahbfabric_ixfabric_lpm_clk = {
  1123. .halt_reg = 0x1c024,
  1124. .clkr = {
  1125. .enable_reg = 0x1c024,
  1126. .enable_mask = BIT(0),
  1127. .hw.init = &(struct clk_init_data){
  1128. .name = "gcc_ultaudio_ahbfabric_ixfabric_lpm_clk",
  1129. .parent_names = (const char *[]){
  1130. "ultaudio_ahbfabric_clk_src",
  1131. },
  1132. .num_parents = 1,
  1133. .flags = CLK_SET_RATE_PARENT,
  1134. .ops = &clk_branch2_ops,
  1135. },
  1136. },
  1137. };
  1138. static const struct freq_tbl ftbl_gcc_ultaudio_lpaif_i2s_clk[] = {
  1139. F(256000, P_XO, 5, 1, 15),
  1140. F(512000, P_XO, 5, 2, 15),
  1141. F(705600, P_GPLL1, 16, 1, 80),
  1142. F(768000, P_XO, 5, 1, 5),
  1143. F(800000, P_XO, 5, 5, 24),
  1144. F(1024000, P_GPLL1, 14, 1, 63),
  1145. F(1152000, P_XO, 1, 3, 50),
  1146. F(1411200, P_GPLL1, 16, 1, 40),
  1147. F(1536000, P_XO, 1, 2, 25),
  1148. F(1600000, P_XO, 12, 0, 0),
  1149. F(2048000, P_GPLL1, 9, 1, 49),
  1150. F(2400000, P_XO, 8, 0, 0),
  1151. F(2822400, P_GPLL1, 16, 1, 20),
  1152. F(3072000, P_GPLL1, 14, 1, 21),
  1153. F(4096000, P_GPLL1, 9, 2, 49),
  1154. F(4800000, P_XO, 4, 0, 0),
  1155. F(5644800, P_GPLL1, 16, 1, 10),
  1156. F(6144000, P_GPLL1, 7, 1, 21),
  1157. F(8192000, P_GPLL1, 9, 4, 49),
  1158. F(9600000, P_XO, 2, 0, 0),
  1159. F(11289600, P_GPLL1, 16, 1, 5),
  1160. F(12288000, P_GPLL1, 7, 2, 21),
  1161. { }
  1162. };
  1163. static struct clk_rcg2 ultaudio_lpaif_pri_i2s_clk_src = {
  1164. .cmd_rcgr = 0x1c054,
  1165. .hid_width = 5,
  1166. .mnd_width = 8,
  1167. .parent_map = gcc_xo_gpll1_epi2s_emclk_sleep_map,
  1168. .freq_tbl = ftbl_gcc_ultaudio_lpaif_i2s_clk,
  1169. .clkr.hw.init = &(struct clk_init_data){
  1170. .name = "ultaudio_lpaif_pri_i2s_clk_src",
  1171. .parent_names = gcc_xo_gpll1_epi2s_emclk_sleep,
  1172. .num_parents = 5,
  1173. .ops = &clk_rcg2_ops,
  1174. },
  1175. };
  1176. static struct clk_branch gcc_ultaudio_lpaif_pri_i2s_clk = {
  1177. .halt_reg = 0x1c068,
  1178. .clkr = {
  1179. .enable_reg = 0x1c068,
  1180. .enable_mask = BIT(0),
  1181. .hw.init = &(struct clk_init_data){
  1182. .name = "gcc_ultaudio_lpaif_pri_i2s_clk",
  1183. .parent_names = (const char *[]){
  1184. "ultaudio_lpaif_pri_i2s_clk_src",
  1185. },
  1186. .num_parents = 1,
  1187. .flags = CLK_SET_RATE_PARENT,
  1188. .ops = &clk_branch2_ops,
  1189. },
  1190. },
  1191. };
  1192. static struct clk_rcg2 ultaudio_lpaif_sec_i2s_clk_src = {
  1193. .cmd_rcgr = 0x1c06c,
  1194. .hid_width = 5,
  1195. .mnd_width = 8,
  1196. .parent_map = gcc_xo_gpll1_esi2s_emclk_sleep_map,
  1197. .freq_tbl = ftbl_gcc_ultaudio_lpaif_i2s_clk,
  1198. .clkr.hw.init = &(struct clk_init_data){
  1199. .name = "ultaudio_lpaif_sec_i2s_clk_src",
  1200. .parent_names = gcc_xo_gpll1_esi2s_emclk_sleep,
  1201. .num_parents = 5,
  1202. .ops = &clk_rcg2_ops,
  1203. },
  1204. };
  1205. static struct clk_branch gcc_ultaudio_lpaif_sec_i2s_clk = {
  1206. .halt_reg = 0x1c080,
  1207. .clkr = {
  1208. .enable_reg = 0x1c080,
  1209. .enable_mask = BIT(0),
  1210. .hw.init = &(struct clk_init_data){
  1211. .name = "gcc_ultaudio_lpaif_sec_i2s_clk",
  1212. .parent_names = (const char *[]){
  1213. "ultaudio_lpaif_sec_i2s_clk_src",
  1214. },
  1215. .num_parents = 1,
  1216. .flags = CLK_SET_RATE_PARENT,
  1217. .ops = &clk_branch2_ops,
  1218. },
  1219. },
  1220. };
  1221. static struct clk_rcg2 ultaudio_lpaif_aux_i2s_clk_src = {
  1222. .cmd_rcgr = 0x1c084,
  1223. .hid_width = 5,
  1224. .mnd_width = 8,
  1225. .parent_map = gcc_xo_gpll1_emclk_sleep_map,
  1226. .freq_tbl = ftbl_gcc_ultaudio_lpaif_i2s_clk,
  1227. .clkr.hw.init = &(struct clk_init_data){
  1228. .name = "ultaudio_lpaif_aux_i2s_clk_src",
  1229. .parent_names = gcc_xo_gpll1_esi2s_emclk_sleep,
  1230. .num_parents = 5,
  1231. .ops = &clk_rcg2_ops,
  1232. },
  1233. };
  1234. static struct clk_branch gcc_ultaudio_lpaif_aux_i2s_clk = {
  1235. .halt_reg = 0x1c098,
  1236. .clkr = {
  1237. .enable_reg = 0x1c098,
  1238. .enable_mask = BIT(0),
  1239. .hw.init = &(struct clk_init_data){
  1240. .name = "gcc_ultaudio_lpaif_aux_i2s_clk",
  1241. .parent_names = (const char *[]){
  1242. "ultaudio_lpaif_aux_i2s_clk_src",
  1243. },
  1244. .num_parents = 1,
  1245. .flags = CLK_SET_RATE_PARENT,
  1246. .ops = &clk_branch2_ops,
  1247. },
  1248. },
  1249. };
  1250. static const struct freq_tbl ftbl_gcc_ultaudio_xo_clk[] = {
  1251. F(19200000, P_XO, 1, 0, 0),
  1252. { }
  1253. };
  1254. static struct clk_rcg2 ultaudio_xo_clk_src = {
  1255. .cmd_rcgr = 0x1c034,
  1256. .hid_width = 5,
  1257. .parent_map = gcc_xo_sleep_map,
  1258. .freq_tbl = ftbl_gcc_ultaudio_xo_clk,
  1259. .clkr.hw.init = &(struct clk_init_data){
  1260. .name = "ultaudio_xo_clk_src",
  1261. .parent_names = gcc_xo_sleep,
  1262. .num_parents = 2,
  1263. .ops = &clk_rcg2_ops,
  1264. },
  1265. };
  1266. static struct clk_branch gcc_ultaudio_avsync_xo_clk = {
  1267. .halt_reg = 0x1c04c,
  1268. .clkr = {
  1269. .enable_reg = 0x1c04c,
  1270. .enable_mask = BIT(0),
  1271. .hw.init = &(struct clk_init_data){
  1272. .name = "gcc_ultaudio_avsync_xo_clk",
  1273. .parent_names = (const char *[]){
  1274. "ultaudio_xo_clk_src",
  1275. },
  1276. .num_parents = 1,
  1277. .flags = CLK_SET_RATE_PARENT,
  1278. .ops = &clk_branch2_ops,
  1279. },
  1280. },
  1281. };
  1282. static struct clk_branch gcc_ultaudio_stc_xo_clk = {
  1283. .halt_reg = 0x1c050,
  1284. .clkr = {
  1285. .enable_reg = 0x1c050,
  1286. .enable_mask = BIT(0),
  1287. .hw.init = &(struct clk_init_data){
  1288. .name = "gcc_ultaudio_stc_xo_clk",
  1289. .parent_names = (const char *[]){
  1290. "ultaudio_xo_clk_src",
  1291. },
  1292. .num_parents = 1,
  1293. .flags = CLK_SET_RATE_PARENT,
  1294. .ops = &clk_branch2_ops,
  1295. },
  1296. },
  1297. };
  1298. static const struct freq_tbl ftbl_codec_clk[] = {
  1299. F(19200000, P_XO, 1, 0, 0),
  1300. F(11289600, P_EXT_MCLK, 1, 0, 0),
  1301. { }
  1302. };
  1303. static struct clk_rcg2 codec_digcodec_clk_src = {
  1304. .cmd_rcgr = 0x1c09c,
  1305. .mnd_width = 8,
  1306. .hid_width = 5,
  1307. .parent_map = gcc_xo_gpll1_emclk_sleep_map,
  1308. .freq_tbl = ftbl_codec_clk,
  1309. .clkr.hw.init = &(struct clk_init_data){
  1310. .name = "codec_digcodec_clk_src",
  1311. .parent_names = gcc_xo_gpll1_emclk_sleep,
  1312. .num_parents = 4,
  1313. .ops = &clk_rcg2_ops,
  1314. },
  1315. };
  1316. static struct clk_branch gcc_codec_digcodec_clk = {
  1317. .halt_reg = 0x1c0b0,
  1318. .clkr = {
  1319. .enable_reg = 0x1c0b0,
  1320. .enable_mask = BIT(0),
  1321. .hw.init = &(struct clk_init_data){
  1322. .name = "gcc_ultaudio_codec_digcodec_clk",
  1323. .parent_names = (const char *[]){
  1324. "codec_digcodec_clk_src",
  1325. },
  1326. .num_parents = 1,
  1327. .flags = CLK_SET_RATE_PARENT,
  1328. .ops = &clk_branch2_ops,
  1329. },
  1330. },
  1331. };
  1332. static struct clk_branch gcc_ultaudio_pcnoc_mport_clk = {
  1333. .halt_reg = 0x1c000,
  1334. .clkr = {
  1335. .enable_reg = 0x1c000,
  1336. .enable_mask = BIT(0),
  1337. .hw.init = &(struct clk_init_data){
  1338. .name = "gcc_ultaudio_pcnoc_mport_clk",
  1339. .parent_names = (const char *[]){
  1340. "pcnoc_bfdcd_clk_src",
  1341. },
  1342. .num_parents = 1,
  1343. .ops = &clk_branch2_ops,
  1344. },
  1345. },
  1346. };
  1347. static struct clk_branch gcc_ultaudio_pcnoc_sway_clk = {
  1348. .halt_reg = 0x1c004,
  1349. .clkr = {
  1350. .enable_reg = 0x1c004,
  1351. .enable_mask = BIT(0),
  1352. .hw.init = &(struct clk_init_data){
  1353. .name = "gcc_ultaudio_pcnoc_sway_clk",
  1354. .parent_names = (const char *[]){
  1355. "pcnoc_bfdcd_clk_src",
  1356. },
  1357. .num_parents = 1,
  1358. .ops = &clk_branch2_ops,
  1359. },
  1360. },
  1361. };
  1362. static const struct freq_tbl ftbl_gcc_venus0_vcodec0_clk[] = {
  1363. F(100000000, P_GPLL0, 8, 0, 0),
  1364. F(160000000, P_GPLL0, 5, 0, 0),
  1365. F(228570000, P_GPLL0, 3.5, 0, 0),
  1366. { }
  1367. };
  1368. static struct clk_rcg2 vcodec0_clk_src = {
  1369. .cmd_rcgr = 0x4C000,
  1370. .mnd_width = 8,
  1371. .hid_width = 5,
  1372. .parent_map = gcc_xo_gpll0_map,
  1373. .freq_tbl = ftbl_gcc_venus0_vcodec0_clk,
  1374. .clkr.hw.init = &(struct clk_init_data){
  1375. .name = "vcodec0_clk_src",
  1376. .parent_names = gcc_xo_gpll0,
  1377. .num_parents = 2,
  1378. .ops = &clk_rcg2_ops,
  1379. },
  1380. };
  1381. static struct clk_branch gcc_blsp1_ahb_clk = {
  1382. .halt_reg = 0x01008,
  1383. .halt_check = BRANCH_HALT_VOTED,
  1384. .clkr = {
  1385. .enable_reg = 0x45004,
  1386. .enable_mask = BIT(10),
  1387. .hw.init = &(struct clk_init_data){
  1388. .name = "gcc_blsp1_ahb_clk",
  1389. .parent_names = (const char *[]){
  1390. "pcnoc_bfdcd_clk_src",
  1391. },
  1392. .num_parents = 1,
  1393. .ops = &clk_branch2_ops,
  1394. },
  1395. },
  1396. };
  1397. static struct clk_branch gcc_blsp1_sleep_clk = {
  1398. .halt_reg = 0x01004,
  1399. .clkr = {
  1400. .enable_reg = 0x01004,
  1401. .enable_mask = BIT(0),
  1402. .hw.init = &(struct clk_init_data){
  1403. .name = "gcc_blsp1_sleep_clk",
  1404. .parent_names = (const char *[]){
  1405. "sleep_clk_src",
  1406. },
  1407. .num_parents = 1,
  1408. .flags = CLK_SET_RATE_PARENT,
  1409. .ops = &clk_branch2_ops,
  1410. },
  1411. },
  1412. };
  1413. static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
  1414. .halt_reg = 0x02008,
  1415. .clkr = {
  1416. .enable_reg = 0x02008,
  1417. .enable_mask = BIT(0),
  1418. .hw.init = &(struct clk_init_data){
  1419. .name = "gcc_blsp1_qup1_i2c_apps_clk",
  1420. .parent_names = (const char *[]){
  1421. "blsp1_qup1_i2c_apps_clk_src",
  1422. },
  1423. .num_parents = 1,
  1424. .flags = CLK_SET_RATE_PARENT,
  1425. .ops = &clk_branch2_ops,
  1426. },
  1427. },
  1428. };
  1429. static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
  1430. .halt_reg = 0x02004,
  1431. .clkr = {
  1432. .enable_reg = 0x02004,
  1433. .enable_mask = BIT(0),
  1434. .hw.init = &(struct clk_init_data){
  1435. .name = "gcc_blsp1_qup1_spi_apps_clk",
  1436. .parent_names = (const char *[]){
  1437. "blsp1_qup1_spi_apps_clk_src",
  1438. },
  1439. .num_parents = 1,
  1440. .flags = CLK_SET_RATE_PARENT,
  1441. .ops = &clk_branch2_ops,
  1442. },
  1443. },
  1444. };
  1445. static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
  1446. .halt_reg = 0x03010,
  1447. .clkr = {
  1448. .enable_reg = 0x03010,
  1449. .enable_mask = BIT(0),
  1450. .hw.init = &(struct clk_init_data){
  1451. .name = "gcc_blsp1_qup2_i2c_apps_clk",
  1452. .parent_names = (const char *[]){
  1453. "blsp1_qup2_i2c_apps_clk_src",
  1454. },
  1455. .num_parents = 1,
  1456. .flags = CLK_SET_RATE_PARENT,
  1457. .ops = &clk_branch2_ops,
  1458. },
  1459. },
  1460. };
  1461. static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
  1462. .halt_reg = 0x0300c,
  1463. .clkr = {
  1464. .enable_reg = 0x0300c,
  1465. .enable_mask = BIT(0),
  1466. .hw.init = &(struct clk_init_data){
  1467. .name = "gcc_blsp1_qup2_spi_apps_clk",
  1468. .parent_names = (const char *[]){
  1469. "blsp1_qup2_spi_apps_clk_src",
  1470. },
  1471. .num_parents = 1,
  1472. .flags = CLK_SET_RATE_PARENT,
  1473. .ops = &clk_branch2_ops,
  1474. },
  1475. },
  1476. };
  1477. static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
  1478. .halt_reg = 0x04020,
  1479. .clkr = {
  1480. .enable_reg = 0x04020,
  1481. .enable_mask = BIT(0),
  1482. .hw.init = &(struct clk_init_data){
  1483. .name = "gcc_blsp1_qup3_i2c_apps_clk",
  1484. .parent_names = (const char *[]){
  1485. "blsp1_qup3_i2c_apps_clk_src",
  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_qup3_spi_apps_clk = {
  1494. .halt_reg = 0x0401c,
  1495. .clkr = {
  1496. .enable_reg = 0x0401c,
  1497. .enable_mask = BIT(0),
  1498. .hw.init = &(struct clk_init_data){
  1499. .name = "gcc_blsp1_qup3_spi_apps_clk",
  1500. .parent_names = (const char *[]){
  1501. "blsp1_qup3_spi_apps_clk_src",
  1502. },
  1503. .num_parents = 1,
  1504. .flags = CLK_SET_RATE_PARENT,
  1505. .ops = &clk_branch2_ops,
  1506. },
  1507. },
  1508. };
  1509. static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
  1510. .halt_reg = 0x05020,
  1511. .clkr = {
  1512. .enable_reg = 0x05020,
  1513. .enable_mask = BIT(0),
  1514. .hw.init = &(struct clk_init_data){
  1515. .name = "gcc_blsp1_qup4_i2c_apps_clk",
  1516. .parent_names = (const char *[]){
  1517. "blsp1_qup4_i2c_apps_clk_src",
  1518. },
  1519. .num_parents = 1,
  1520. .flags = CLK_SET_RATE_PARENT,
  1521. .ops = &clk_branch2_ops,
  1522. },
  1523. },
  1524. };
  1525. static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
  1526. .halt_reg = 0x0501c,
  1527. .clkr = {
  1528. .enable_reg = 0x0501c,
  1529. .enable_mask = BIT(0),
  1530. .hw.init = &(struct clk_init_data){
  1531. .name = "gcc_blsp1_qup4_spi_apps_clk",
  1532. .parent_names = (const char *[]){
  1533. "blsp1_qup4_spi_apps_clk_src",
  1534. },
  1535. .num_parents = 1,
  1536. .flags = CLK_SET_RATE_PARENT,
  1537. .ops = &clk_branch2_ops,
  1538. },
  1539. },
  1540. };
  1541. static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
  1542. .halt_reg = 0x06020,
  1543. .clkr = {
  1544. .enable_reg = 0x06020,
  1545. .enable_mask = BIT(0),
  1546. .hw.init = &(struct clk_init_data){
  1547. .name = "gcc_blsp1_qup5_i2c_apps_clk",
  1548. .parent_names = (const char *[]){
  1549. "blsp1_qup5_i2c_apps_clk_src",
  1550. },
  1551. .num_parents = 1,
  1552. .flags = CLK_SET_RATE_PARENT,
  1553. .ops = &clk_branch2_ops,
  1554. },
  1555. },
  1556. };
  1557. static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
  1558. .halt_reg = 0x0601c,
  1559. .clkr = {
  1560. .enable_reg = 0x0601c,
  1561. .enable_mask = BIT(0),
  1562. .hw.init = &(struct clk_init_data){
  1563. .name = "gcc_blsp1_qup5_spi_apps_clk",
  1564. .parent_names = (const char *[]){
  1565. "blsp1_qup5_spi_apps_clk_src",
  1566. },
  1567. .num_parents = 1,
  1568. .flags = CLK_SET_RATE_PARENT,
  1569. .ops = &clk_branch2_ops,
  1570. },
  1571. },
  1572. };
  1573. static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
  1574. .halt_reg = 0x07020,
  1575. .clkr = {
  1576. .enable_reg = 0x07020,
  1577. .enable_mask = BIT(0),
  1578. .hw.init = &(struct clk_init_data){
  1579. .name = "gcc_blsp1_qup6_i2c_apps_clk",
  1580. .parent_names = (const char *[]){
  1581. "blsp1_qup6_i2c_apps_clk_src",
  1582. },
  1583. .num_parents = 1,
  1584. .flags = CLK_SET_RATE_PARENT,
  1585. .ops = &clk_branch2_ops,
  1586. },
  1587. },
  1588. };
  1589. static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
  1590. .halt_reg = 0x0701c,
  1591. .clkr = {
  1592. .enable_reg = 0x0701c,
  1593. .enable_mask = BIT(0),
  1594. .hw.init = &(struct clk_init_data){
  1595. .name = "gcc_blsp1_qup6_spi_apps_clk",
  1596. .parent_names = (const char *[]){
  1597. "blsp1_qup6_spi_apps_clk_src",
  1598. },
  1599. .num_parents = 1,
  1600. .flags = CLK_SET_RATE_PARENT,
  1601. .ops = &clk_branch2_ops,
  1602. },
  1603. },
  1604. };
  1605. static struct clk_branch gcc_blsp1_uart1_apps_clk = {
  1606. .halt_reg = 0x0203c,
  1607. .clkr = {
  1608. .enable_reg = 0x0203c,
  1609. .enable_mask = BIT(0),
  1610. .hw.init = &(struct clk_init_data){
  1611. .name = "gcc_blsp1_uart1_apps_clk",
  1612. .parent_names = (const char *[]){
  1613. "blsp1_uart1_apps_clk_src",
  1614. },
  1615. .num_parents = 1,
  1616. .flags = CLK_SET_RATE_PARENT,
  1617. .ops = &clk_branch2_ops,
  1618. },
  1619. },
  1620. };
  1621. static struct clk_branch gcc_blsp1_uart2_apps_clk = {
  1622. .halt_reg = 0x0302c,
  1623. .clkr = {
  1624. .enable_reg = 0x0302c,
  1625. .enable_mask = BIT(0),
  1626. .hw.init = &(struct clk_init_data){
  1627. .name = "gcc_blsp1_uart2_apps_clk",
  1628. .parent_names = (const char *[]){
  1629. "blsp1_uart2_apps_clk_src",
  1630. },
  1631. .num_parents = 1,
  1632. .flags = CLK_SET_RATE_PARENT,
  1633. .ops = &clk_branch2_ops,
  1634. },
  1635. },
  1636. };
  1637. static struct clk_branch gcc_boot_rom_ahb_clk = {
  1638. .halt_reg = 0x1300c,
  1639. .halt_check = BRANCH_HALT_VOTED,
  1640. .clkr = {
  1641. .enable_reg = 0x45004,
  1642. .enable_mask = BIT(7),
  1643. .hw.init = &(struct clk_init_data){
  1644. .name = "gcc_boot_rom_ahb_clk",
  1645. .parent_names = (const char *[]){
  1646. "pcnoc_bfdcd_clk_src",
  1647. },
  1648. .num_parents = 1,
  1649. .ops = &clk_branch2_ops,
  1650. },
  1651. },
  1652. };
  1653. static struct clk_branch gcc_camss_cci_ahb_clk = {
  1654. .halt_reg = 0x5101c,
  1655. .clkr = {
  1656. .enable_reg = 0x5101c,
  1657. .enable_mask = BIT(0),
  1658. .hw.init = &(struct clk_init_data){
  1659. .name = "gcc_camss_cci_ahb_clk",
  1660. .parent_names = (const char *[]){
  1661. "camss_ahb_clk_src",
  1662. },
  1663. .num_parents = 1,
  1664. .flags = CLK_SET_RATE_PARENT,
  1665. .ops = &clk_branch2_ops,
  1666. },
  1667. },
  1668. };
  1669. static struct clk_branch gcc_camss_cci_clk = {
  1670. .halt_reg = 0x51018,
  1671. .clkr = {
  1672. .enable_reg = 0x51018,
  1673. .enable_mask = BIT(0),
  1674. .hw.init = &(struct clk_init_data){
  1675. .name = "gcc_camss_cci_clk",
  1676. .parent_names = (const char *[]){
  1677. "cci_clk_src",
  1678. },
  1679. .num_parents = 1,
  1680. .flags = CLK_SET_RATE_PARENT,
  1681. .ops = &clk_branch2_ops,
  1682. },
  1683. },
  1684. };
  1685. static struct clk_branch gcc_camss_csi0_ahb_clk = {
  1686. .halt_reg = 0x4e040,
  1687. .clkr = {
  1688. .enable_reg = 0x4e040,
  1689. .enable_mask = BIT(0),
  1690. .hw.init = &(struct clk_init_data){
  1691. .name = "gcc_camss_csi0_ahb_clk",
  1692. .parent_names = (const char *[]){
  1693. "camss_ahb_clk_src",
  1694. },
  1695. .num_parents = 1,
  1696. .flags = CLK_SET_RATE_PARENT,
  1697. .ops = &clk_branch2_ops,
  1698. },
  1699. },
  1700. };
  1701. static struct clk_branch gcc_camss_csi0_clk = {
  1702. .halt_reg = 0x4e03c,
  1703. .clkr = {
  1704. .enable_reg = 0x4e03c,
  1705. .enable_mask = BIT(0),
  1706. .hw.init = &(struct clk_init_data){
  1707. .name = "gcc_camss_csi0_clk",
  1708. .parent_names = (const char *[]){
  1709. "csi0_clk_src",
  1710. },
  1711. .num_parents = 1,
  1712. .flags = CLK_SET_RATE_PARENT,
  1713. .ops = &clk_branch2_ops,
  1714. },
  1715. },
  1716. };
  1717. static struct clk_branch gcc_camss_csi0phy_clk = {
  1718. .halt_reg = 0x4e048,
  1719. .clkr = {
  1720. .enable_reg = 0x4e048,
  1721. .enable_mask = BIT(0),
  1722. .hw.init = &(struct clk_init_data){
  1723. .name = "gcc_camss_csi0phy_clk",
  1724. .parent_names = (const char *[]){
  1725. "csi0_clk_src",
  1726. },
  1727. .num_parents = 1,
  1728. .flags = CLK_SET_RATE_PARENT,
  1729. .ops = &clk_branch2_ops,
  1730. },
  1731. },
  1732. };
  1733. static struct clk_branch gcc_camss_csi0pix_clk = {
  1734. .halt_reg = 0x4e058,
  1735. .clkr = {
  1736. .enable_reg = 0x4e058,
  1737. .enable_mask = BIT(0),
  1738. .hw.init = &(struct clk_init_data){
  1739. .name = "gcc_camss_csi0pix_clk",
  1740. .parent_names = (const char *[]){
  1741. "csi0_clk_src",
  1742. },
  1743. .num_parents = 1,
  1744. .flags = CLK_SET_RATE_PARENT,
  1745. .ops = &clk_branch2_ops,
  1746. },
  1747. },
  1748. };
  1749. static struct clk_branch gcc_camss_csi0rdi_clk = {
  1750. .halt_reg = 0x4e050,
  1751. .clkr = {
  1752. .enable_reg = 0x4e050,
  1753. .enable_mask = BIT(0),
  1754. .hw.init = &(struct clk_init_data){
  1755. .name = "gcc_camss_csi0rdi_clk",
  1756. .parent_names = (const char *[]){
  1757. "csi0_clk_src",
  1758. },
  1759. .num_parents = 1,
  1760. .flags = CLK_SET_RATE_PARENT,
  1761. .ops = &clk_branch2_ops,
  1762. },
  1763. },
  1764. };
  1765. static struct clk_branch gcc_camss_csi1_ahb_clk = {
  1766. .halt_reg = 0x4f040,
  1767. .clkr = {
  1768. .enable_reg = 0x4f040,
  1769. .enable_mask = BIT(0),
  1770. .hw.init = &(struct clk_init_data){
  1771. .name = "gcc_camss_csi1_ahb_clk",
  1772. .parent_names = (const char *[]){
  1773. "camss_ahb_clk_src",
  1774. },
  1775. .num_parents = 1,
  1776. .flags = CLK_SET_RATE_PARENT,
  1777. .ops = &clk_branch2_ops,
  1778. },
  1779. },
  1780. };
  1781. static struct clk_branch gcc_camss_csi1_clk = {
  1782. .halt_reg = 0x4f03c,
  1783. .clkr = {
  1784. .enable_reg = 0x4f03c,
  1785. .enable_mask = BIT(0),
  1786. .hw.init = &(struct clk_init_data){
  1787. .name = "gcc_camss_csi1_clk",
  1788. .parent_names = (const char *[]){
  1789. "csi1_clk_src",
  1790. },
  1791. .num_parents = 1,
  1792. .flags = CLK_SET_RATE_PARENT,
  1793. .ops = &clk_branch2_ops,
  1794. },
  1795. },
  1796. };
  1797. static struct clk_branch gcc_camss_csi1phy_clk = {
  1798. .halt_reg = 0x4f048,
  1799. .clkr = {
  1800. .enable_reg = 0x4f048,
  1801. .enable_mask = BIT(0),
  1802. .hw.init = &(struct clk_init_data){
  1803. .name = "gcc_camss_csi1phy_clk",
  1804. .parent_names = (const char *[]){
  1805. "csi1_clk_src",
  1806. },
  1807. .num_parents = 1,
  1808. .flags = CLK_SET_RATE_PARENT,
  1809. .ops = &clk_branch2_ops,
  1810. },
  1811. },
  1812. };
  1813. static struct clk_branch gcc_camss_csi1pix_clk = {
  1814. .halt_reg = 0x4f058,
  1815. .clkr = {
  1816. .enable_reg = 0x4f058,
  1817. .enable_mask = BIT(0),
  1818. .hw.init = &(struct clk_init_data){
  1819. .name = "gcc_camss_csi1pix_clk",
  1820. .parent_names = (const char *[]){
  1821. "csi1_clk_src",
  1822. },
  1823. .num_parents = 1,
  1824. .flags = CLK_SET_RATE_PARENT,
  1825. .ops = &clk_branch2_ops,
  1826. },
  1827. },
  1828. };
  1829. static struct clk_branch gcc_camss_csi1rdi_clk = {
  1830. .halt_reg = 0x4f050,
  1831. .clkr = {
  1832. .enable_reg = 0x4f050,
  1833. .enable_mask = BIT(0),
  1834. .hw.init = &(struct clk_init_data){
  1835. .name = "gcc_camss_csi1rdi_clk",
  1836. .parent_names = (const char *[]){
  1837. "csi1_clk_src",
  1838. },
  1839. .num_parents = 1,
  1840. .flags = CLK_SET_RATE_PARENT,
  1841. .ops = &clk_branch2_ops,
  1842. },
  1843. },
  1844. };
  1845. static struct clk_branch gcc_camss_csi_vfe0_clk = {
  1846. .halt_reg = 0x58050,
  1847. .clkr = {
  1848. .enable_reg = 0x58050,
  1849. .enable_mask = BIT(0),
  1850. .hw.init = &(struct clk_init_data){
  1851. .name = "gcc_camss_csi_vfe0_clk",
  1852. .parent_names = (const char *[]){
  1853. "vfe0_clk_src",
  1854. },
  1855. .num_parents = 1,
  1856. .flags = CLK_SET_RATE_PARENT,
  1857. .ops = &clk_branch2_ops,
  1858. },
  1859. },
  1860. };
  1861. static struct clk_branch gcc_camss_gp0_clk = {
  1862. .halt_reg = 0x54018,
  1863. .clkr = {
  1864. .enable_reg = 0x54018,
  1865. .enable_mask = BIT(0),
  1866. .hw.init = &(struct clk_init_data){
  1867. .name = "gcc_camss_gp0_clk",
  1868. .parent_names = (const char *[]){
  1869. "camss_gp0_clk_src",
  1870. },
  1871. .num_parents = 1,
  1872. .flags = CLK_SET_RATE_PARENT,
  1873. .ops = &clk_branch2_ops,
  1874. },
  1875. },
  1876. };
  1877. static struct clk_branch gcc_camss_gp1_clk = {
  1878. .halt_reg = 0x55018,
  1879. .clkr = {
  1880. .enable_reg = 0x55018,
  1881. .enable_mask = BIT(0),
  1882. .hw.init = &(struct clk_init_data){
  1883. .name = "gcc_camss_gp1_clk",
  1884. .parent_names = (const char *[]){
  1885. "camss_gp1_clk_src",
  1886. },
  1887. .num_parents = 1,
  1888. .flags = CLK_SET_RATE_PARENT,
  1889. .ops = &clk_branch2_ops,
  1890. },
  1891. },
  1892. };
  1893. static struct clk_branch gcc_camss_ispif_ahb_clk = {
  1894. .halt_reg = 0x50004,
  1895. .clkr = {
  1896. .enable_reg = 0x50004,
  1897. .enable_mask = BIT(0),
  1898. .hw.init = &(struct clk_init_data){
  1899. .name = "gcc_camss_ispif_ahb_clk",
  1900. .parent_names = (const char *[]){
  1901. "camss_ahb_clk_src",
  1902. },
  1903. .num_parents = 1,
  1904. .flags = CLK_SET_RATE_PARENT,
  1905. .ops = &clk_branch2_ops,
  1906. },
  1907. },
  1908. };
  1909. static struct clk_branch gcc_camss_jpeg0_clk = {
  1910. .halt_reg = 0x57020,
  1911. .clkr = {
  1912. .enable_reg = 0x57020,
  1913. .enable_mask = BIT(0),
  1914. .hw.init = &(struct clk_init_data){
  1915. .name = "gcc_camss_jpeg0_clk",
  1916. .parent_names = (const char *[]){
  1917. "jpeg0_clk_src",
  1918. },
  1919. .num_parents = 1,
  1920. .flags = CLK_SET_RATE_PARENT,
  1921. .ops = &clk_branch2_ops,
  1922. },
  1923. },
  1924. };
  1925. static struct clk_branch gcc_camss_jpeg_ahb_clk = {
  1926. .halt_reg = 0x57024,
  1927. .clkr = {
  1928. .enable_reg = 0x57024,
  1929. .enable_mask = BIT(0),
  1930. .hw.init = &(struct clk_init_data){
  1931. .name = "gcc_camss_jpeg_ahb_clk",
  1932. .parent_names = (const char *[]){
  1933. "camss_ahb_clk_src",
  1934. },
  1935. .num_parents = 1,
  1936. .flags = CLK_SET_RATE_PARENT,
  1937. .ops = &clk_branch2_ops,
  1938. },
  1939. },
  1940. };
  1941. static struct clk_branch gcc_camss_jpeg_axi_clk = {
  1942. .halt_reg = 0x57028,
  1943. .clkr = {
  1944. .enable_reg = 0x57028,
  1945. .enable_mask = BIT(0),
  1946. .hw.init = &(struct clk_init_data){
  1947. .name = "gcc_camss_jpeg_axi_clk",
  1948. .parent_names = (const char *[]){
  1949. "system_noc_bfdcd_clk_src",
  1950. },
  1951. .num_parents = 1,
  1952. .flags = CLK_SET_RATE_PARENT,
  1953. .ops = &clk_branch2_ops,
  1954. },
  1955. },
  1956. };
  1957. static struct clk_branch gcc_camss_mclk0_clk = {
  1958. .halt_reg = 0x52018,
  1959. .clkr = {
  1960. .enable_reg = 0x52018,
  1961. .enable_mask = BIT(0),
  1962. .hw.init = &(struct clk_init_data){
  1963. .name = "gcc_camss_mclk0_clk",
  1964. .parent_names = (const char *[]){
  1965. "mclk0_clk_src",
  1966. },
  1967. .num_parents = 1,
  1968. .flags = CLK_SET_RATE_PARENT,
  1969. .ops = &clk_branch2_ops,
  1970. },
  1971. },
  1972. };
  1973. static struct clk_branch gcc_camss_mclk1_clk = {
  1974. .halt_reg = 0x53018,
  1975. .clkr = {
  1976. .enable_reg = 0x53018,
  1977. .enable_mask = BIT(0),
  1978. .hw.init = &(struct clk_init_data){
  1979. .name = "gcc_camss_mclk1_clk",
  1980. .parent_names = (const char *[]){
  1981. "mclk1_clk_src",
  1982. },
  1983. .num_parents = 1,
  1984. .flags = CLK_SET_RATE_PARENT,
  1985. .ops = &clk_branch2_ops,
  1986. },
  1987. },
  1988. };
  1989. static struct clk_branch gcc_camss_micro_ahb_clk = {
  1990. .halt_reg = 0x5600c,
  1991. .clkr = {
  1992. .enable_reg = 0x5600c,
  1993. .enable_mask = BIT(0),
  1994. .hw.init = &(struct clk_init_data){
  1995. .name = "gcc_camss_micro_ahb_clk",
  1996. .parent_names = (const char *[]){
  1997. "camss_ahb_clk_src",
  1998. },
  1999. .num_parents = 1,
  2000. .flags = CLK_SET_RATE_PARENT,
  2001. .ops = &clk_branch2_ops,
  2002. },
  2003. },
  2004. };
  2005. static struct clk_branch gcc_camss_csi0phytimer_clk = {
  2006. .halt_reg = 0x4e01c,
  2007. .clkr = {
  2008. .enable_reg = 0x4e01c,
  2009. .enable_mask = BIT(0),
  2010. .hw.init = &(struct clk_init_data){
  2011. .name = "gcc_camss_csi0phytimer_clk",
  2012. .parent_names = (const char *[]){
  2013. "csi0phytimer_clk_src",
  2014. },
  2015. .num_parents = 1,
  2016. .flags = CLK_SET_RATE_PARENT,
  2017. .ops = &clk_branch2_ops,
  2018. },
  2019. },
  2020. };
  2021. static struct clk_branch gcc_camss_csi1phytimer_clk = {
  2022. .halt_reg = 0x4f01c,
  2023. .clkr = {
  2024. .enable_reg = 0x4f01c,
  2025. .enable_mask = BIT(0),
  2026. .hw.init = &(struct clk_init_data){
  2027. .name = "gcc_camss_csi1phytimer_clk",
  2028. .parent_names = (const char *[]){
  2029. "csi1phytimer_clk_src",
  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_camss_ahb_clk = {
  2038. .halt_reg = 0x5a014,
  2039. .clkr = {
  2040. .enable_reg = 0x5a014,
  2041. .enable_mask = BIT(0),
  2042. .hw.init = &(struct clk_init_data){
  2043. .name = "gcc_camss_ahb_clk",
  2044. .parent_names = (const char *[]){
  2045. "camss_ahb_clk_src",
  2046. },
  2047. .num_parents = 1,
  2048. .flags = CLK_SET_RATE_PARENT,
  2049. .ops = &clk_branch2_ops,
  2050. },
  2051. },
  2052. };
  2053. static struct clk_branch gcc_camss_top_ahb_clk = {
  2054. .halt_reg = 0x56004,
  2055. .clkr = {
  2056. .enable_reg = 0x56004,
  2057. .enable_mask = BIT(0),
  2058. .hw.init = &(struct clk_init_data){
  2059. .name = "gcc_camss_top_ahb_clk",
  2060. .parent_names = (const char *[]){
  2061. "pcnoc_bfdcd_clk_src",
  2062. },
  2063. .num_parents = 1,
  2064. .flags = CLK_SET_RATE_PARENT,
  2065. .ops = &clk_branch2_ops,
  2066. },
  2067. },
  2068. };
  2069. static struct clk_branch gcc_camss_cpp_ahb_clk = {
  2070. .halt_reg = 0x58040,
  2071. .clkr = {
  2072. .enable_reg = 0x58040,
  2073. .enable_mask = BIT(0),
  2074. .hw.init = &(struct clk_init_data){
  2075. .name = "gcc_camss_cpp_ahb_clk",
  2076. .parent_names = (const char *[]){
  2077. "camss_ahb_clk_src",
  2078. },
  2079. .num_parents = 1,
  2080. .flags = CLK_SET_RATE_PARENT,
  2081. .ops = &clk_branch2_ops,
  2082. },
  2083. },
  2084. };
  2085. static struct clk_branch gcc_camss_cpp_clk = {
  2086. .halt_reg = 0x5803c,
  2087. .clkr = {
  2088. .enable_reg = 0x5803c,
  2089. .enable_mask = BIT(0),
  2090. .hw.init = &(struct clk_init_data){
  2091. .name = "gcc_camss_cpp_clk",
  2092. .parent_names = (const char *[]){
  2093. "cpp_clk_src",
  2094. },
  2095. .num_parents = 1,
  2096. .flags = CLK_SET_RATE_PARENT,
  2097. .ops = &clk_branch2_ops,
  2098. },
  2099. },
  2100. };
  2101. static struct clk_branch gcc_camss_vfe0_clk = {
  2102. .halt_reg = 0x58038,
  2103. .clkr = {
  2104. .enable_reg = 0x58038,
  2105. .enable_mask = BIT(0),
  2106. .hw.init = &(struct clk_init_data){
  2107. .name = "gcc_camss_vfe0_clk",
  2108. .parent_names = (const char *[]){
  2109. "vfe0_clk_src",
  2110. },
  2111. .num_parents = 1,
  2112. .flags = CLK_SET_RATE_PARENT,
  2113. .ops = &clk_branch2_ops,
  2114. },
  2115. },
  2116. };
  2117. static struct clk_branch gcc_camss_vfe_ahb_clk = {
  2118. .halt_reg = 0x58044,
  2119. .clkr = {
  2120. .enable_reg = 0x58044,
  2121. .enable_mask = BIT(0),
  2122. .hw.init = &(struct clk_init_data){
  2123. .name = "gcc_camss_vfe_ahb_clk",
  2124. .parent_names = (const char *[]){
  2125. "camss_ahb_clk_src",
  2126. },
  2127. .num_parents = 1,
  2128. .flags = CLK_SET_RATE_PARENT,
  2129. .ops = &clk_branch2_ops,
  2130. },
  2131. },
  2132. };
  2133. static struct clk_branch gcc_camss_vfe_axi_clk = {
  2134. .halt_reg = 0x58048,
  2135. .clkr = {
  2136. .enable_reg = 0x58048,
  2137. .enable_mask = BIT(0),
  2138. .hw.init = &(struct clk_init_data){
  2139. .name = "gcc_camss_vfe_axi_clk",
  2140. .parent_names = (const char *[]){
  2141. "system_noc_bfdcd_clk_src",
  2142. },
  2143. .num_parents = 1,
  2144. .flags = CLK_SET_RATE_PARENT,
  2145. .ops = &clk_branch2_ops,
  2146. },
  2147. },
  2148. };
  2149. static struct clk_branch gcc_crypto_ahb_clk = {
  2150. .halt_reg = 0x16024,
  2151. .halt_check = BRANCH_HALT_VOTED,
  2152. .clkr = {
  2153. .enable_reg = 0x45004,
  2154. .enable_mask = BIT(0),
  2155. .hw.init = &(struct clk_init_data){
  2156. .name = "gcc_crypto_ahb_clk",
  2157. .parent_names = (const char *[]){
  2158. "pcnoc_bfdcd_clk_src",
  2159. },
  2160. .num_parents = 1,
  2161. .flags = CLK_SET_RATE_PARENT,
  2162. .ops = &clk_branch2_ops,
  2163. },
  2164. },
  2165. };
  2166. static struct clk_branch gcc_crypto_axi_clk = {
  2167. .halt_reg = 0x16020,
  2168. .halt_check = BRANCH_HALT_VOTED,
  2169. .clkr = {
  2170. .enable_reg = 0x45004,
  2171. .enable_mask = BIT(1),
  2172. .hw.init = &(struct clk_init_data){
  2173. .name = "gcc_crypto_axi_clk",
  2174. .parent_names = (const char *[]){
  2175. "pcnoc_bfdcd_clk_src",
  2176. },
  2177. .num_parents = 1,
  2178. .flags = CLK_SET_RATE_PARENT,
  2179. .ops = &clk_branch2_ops,
  2180. },
  2181. },
  2182. };
  2183. static struct clk_branch gcc_crypto_clk = {
  2184. .halt_reg = 0x1601c,
  2185. .halt_check = BRANCH_HALT_VOTED,
  2186. .clkr = {
  2187. .enable_reg = 0x45004,
  2188. .enable_mask = BIT(2),
  2189. .hw.init = &(struct clk_init_data){
  2190. .name = "gcc_crypto_clk",
  2191. .parent_names = (const char *[]){
  2192. "crypto_clk_src",
  2193. },
  2194. .num_parents = 1,
  2195. .flags = CLK_SET_RATE_PARENT,
  2196. .ops = &clk_branch2_ops,
  2197. },
  2198. },
  2199. };
  2200. static struct clk_branch gcc_oxili_gmem_clk = {
  2201. .halt_reg = 0x59024,
  2202. .clkr = {
  2203. .enable_reg = 0x59024,
  2204. .enable_mask = BIT(0),
  2205. .hw.init = &(struct clk_init_data){
  2206. .name = "gcc_oxili_gmem_clk",
  2207. .parent_names = (const char *[]){
  2208. "gfx3d_clk_src",
  2209. },
  2210. .num_parents = 1,
  2211. .flags = CLK_SET_RATE_PARENT,
  2212. .ops = &clk_branch2_ops,
  2213. },
  2214. },
  2215. };
  2216. static struct clk_branch gcc_gp1_clk = {
  2217. .halt_reg = 0x08000,
  2218. .clkr = {
  2219. .enable_reg = 0x08000,
  2220. .enable_mask = BIT(0),
  2221. .hw.init = &(struct clk_init_data){
  2222. .name = "gcc_gp1_clk",
  2223. .parent_names = (const char *[]){
  2224. "gp1_clk_src",
  2225. },
  2226. .num_parents = 1,
  2227. .flags = CLK_SET_RATE_PARENT,
  2228. .ops = &clk_branch2_ops,
  2229. },
  2230. },
  2231. };
  2232. static struct clk_branch gcc_gp2_clk = {
  2233. .halt_reg = 0x09000,
  2234. .clkr = {
  2235. .enable_reg = 0x09000,
  2236. .enable_mask = BIT(0),
  2237. .hw.init = &(struct clk_init_data){
  2238. .name = "gcc_gp2_clk",
  2239. .parent_names = (const char *[]){
  2240. "gp2_clk_src",
  2241. },
  2242. .num_parents = 1,
  2243. .flags = CLK_SET_RATE_PARENT,
  2244. .ops = &clk_branch2_ops,
  2245. },
  2246. },
  2247. };
  2248. static struct clk_branch gcc_gp3_clk = {
  2249. .halt_reg = 0x0a000,
  2250. .clkr = {
  2251. .enable_reg = 0x0a000,
  2252. .enable_mask = BIT(0),
  2253. .hw.init = &(struct clk_init_data){
  2254. .name = "gcc_gp3_clk",
  2255. .parent_names = (const char *[]){
  2256. "gp3_clk_src",
  2257. },
  2258. .num_parents = 1,
  2259. .flags = CLK_SET_RATE_PARENT,
  2260. .ops = &clk_branch2_ops,
  2261. },
  2262. },
  2263. };
  2264. static struct clk_branch gcc_mdss_ahb_clk = {
  2265. .halt_reg = 0x4d07c,
  2266. .clkr = {
  2267. .enable_reg = 0x4d07c,
  2268. .enable_mask = BIT(0),
  2269. .hw.init = &(struct clk_init_data){
  2270. .name = "gcc_mdss_ahb_clk",
  2271. .parent_names = (const char *[]){
  2272. "pcnoc_bfdcd_clk_src",
  2273. },
  2274. .num_parents = 1,
  2275. .flags = CLK_SET_RATE_PARENT,
  2276. .ops = &clk_branch2_ops,
  2277. },
  2278. },
  2279. };
  2280. static struct clk_branch gcc_mdss_axi_clk = {
  2281. .halt_reg = 0x4d080,
  2282. .clkr = {
  2283. .enable_reg = 0x4d080,
  2284. .enable_mask = BIT(0),
  2285. .hw.init = &(struct clk_init_data){
  2286. .name = "gcc_mdss_axi_clk",
  2287. .parent_names = (const char *[]){
  2288. "system_noc_bfdcd_clk_src",
  2289. },
  2290. .num_parents = 1,
  2291. .flags = CLK_SET_RATE_PARENT,
  2292. .ops = &clk_branch2_ops,
  2293. },
  2294. },
  2295. };
  2296. static struct clk_branch gcc_mdss_byte0_clk = {
  2297. .halt_reg = 0x4d094,
  2298. .clkr = {
  2299. .enable_reg = 0x4d094,
  2300. .enable_mask = BIT(0),
  2301. .hw.init = &(struct clk_init_data){
  2302. .name = "gcc_mdss_byte0_clk",
  2303. .parent_names = (const char *[]){
  2304. "byte0_clk_src",
  2305. },
  2306. .num_parents = 1,
  2307. .flags = CLK_SET_RATE_PARENT,
  2308. .ops = &clk_branch2_ops,
  2309. },
  2310. },
  2311. };
  2312. static struct clk_branch gcc_mdss_esc0_clk = {
  2313. .halt_reg = 0x4d098,
  2314. .clkr = {
  2315. .enable_reg = 0x4d098,
  2316. .enable_mask = BIT(0),
  2317. .hw.init = &(struct clk_init_data){
  2318. .name = "gcc_mdss_esc0_clk",
  2319. .parent_names = (const char *[]){
  2320. "esc0_clk_src",
  2321. },
  2322. .num_parents = 1,
  2323. .flags = CLK_SET_RATE_PARENT,
  2324. .ops = &clk_branch2_ops,
  2325. },
  2326. },
  2327. };
  2328. static struct clk_branch gcc_mdss_mdp_clk = {
  2329. .halt_reg = 0x4D088,
  2330. .clkr = {
  2331. .enable_reg = 0x4D088,
  2332. .enable_mask = BIT(0),
  2333. .hw.init = &(struct clk_init_data){
  2334. .name = "gcc_mdss_mdp_clk",
  2335. .parent_names = (const char *[]){
  2336. "mdp_clk_src",
  2337. },
  2338. .num_parents = 1,
  2339. .flags = CLK_SET_RATE_PARENT,
  2340. .ops = &clk_branch2_ops,
  2341. },
  2342. },
  2343. };
  2344. static struct clk_branch gcc_mdss_pclk0_clk = {
  2345. .halt_reg = 0x4d084,
  2346. .clkr = {
  2347. .enable_reg = 0x4d084,
  2348. .enable_mask = BIT(0),
  2349. .hw.init = &(struct clk_init_data){
  2350. .name = "gcc_mdss_pclk0_clk",
  2351. .parent_names = (const char *[]){
  2352. "pclk0_clk_src",
  2353. },
  2354. .num_parents = 1,
  2355. .flags = CLK_SET_RATE_PARENT,
  2356. .ops = &clk_branch2_ops,
  2357. },
  2358. },
  2359. };
  2360. static struct clk_branch gcc_mdss_vsync_clk = {
  2361. .halt_reg = 0x4d090,
  2362. .clkr = {
  2363. .enable_reg = 0x4d090,
  2364. .enable_mask = BIT(0),
  2365. .hw.init = &(struct clk_init_data){
  2366. .name = "gcc_mdss_vsync_clk",
  2367. .parent_names = (const char *[]){
  2368. "vsync_clk_src",
  2369. },
  2370. .num_parents = 1,
  2371. .flags = CLK_SET_RATE_PARENT,
  2372. .ops = &clk_branch2_ops,
  2373. },
  2374. },
  2375. };
  2376. static struct clk_branch gcc_mss_cfg_ahb_clk = {
  2377. .halt_reg = 0x49000,
  2378. .clkr = {
  2379. .enable_reg = 0x49000,
  2380. .enable_mask = BIT(0),
  2381. .hw.init = &(struct clk_init_data){
  2382. .name = "gcc_mss_cfg_ahb_clk",
  2383. .parent_names = (const char *[]){
  2384. "pcnoc_bfdcd_clk_src",
  2385. },
  2386. .num_parents = 1,
  2387. .flags = CLK_SET_RATE_PARENT,
  2388. .ops = &clk_branch2_ops,
  2389. },
  2390. },
  2391. };
  2392. static struct clk_branch gcc_oxili_ahb_clk = {
  2393. .halt_reg = 0x59028,
  2394. .clkr = {
  2395. .enable_reg = 0x59028,
  2396. .enable_mask = BIT(0),
  2397. .hw.init = &(struct clk_init_data){
  2398. .name = "gcc_oxili_ahb_clk",
  2399. .parent_names = (const char *[]){
  2400. "pcnoc_bfdcd_clk_src",
  2401. },
  2402. .num_parents = 1,
  2403. .flags = CLK_SET_RATE_PARENT,
  2404. .ops = &clk_branch2_ops,
  2405. },
  2406. },
  2407. };
  2408. static struct clk_branch gcc_oxili_gfx3d_clk = {
  2409. .halt_reg = 0x59020,
  2410. .clkr = {
  2411. .enable_reg = 0x59020,
  2412. .enable_mask = BIT(0),
  2413. .hw.init = &(struct clk_init_data){
  2414. .name = "gcc_oxili_gfx3d_clk",
  2415. .parent_names = (const char *[]){
  2416. "gfx3d_clk_src",
  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_pdm2_clk = {
  2425. .halt_reg = 0x4400c,
  2426. .clkr = {
  2427. .enable_reg = 0x4400c,
  2428. .enable_mask = BIT(0),
  2429. .hw.init = &(struct clk_init_data){
  2430. .name = "gcc_pdm2_clk",
  2431. .parent_names = (const char *[]){
  2432. "pdm2_clk_src",
  2433. },
  2434. .num_parents = 1,
  2435. .flags = CLK_SET_RATE_PARENT,
  2436. .ops = &clk_branch2_ops,
  2437. },
  2438. },
  2439. };
  2440. static struct clk_branch gcc_pdm_ahb_clk = {
  2441. .halt_reg = 0x44004,
  2442. .clkr = {
  2443. .enable_reg = 0x44004,
  2444. .enable_mask = BIT(0),
  2445. .hw.init = &(struct clk_init_data){
  2446. .name = "gcc_pdm_ahb_clk",
  2447. .parent_names = (const char *[]){
  2448. "pcnoc_bfdcd_clk_src",
  2449. },
  2450. .num_parents = 1,
  2451. .flags = CLK_SET_RATE_PARENT,
  2452. .ops = &clk_branch2_ops,
  2453. },
  2454. },
  2455. };
  2456. static struct clk_branch gcc_prng_ahb_clk = {
  2457. .halt_reg = 0x13004,
  2458. .halt_check = BRANCH_HALT_VOTED,
  2459. .clkr = {
  2460. .enable_reg = 0x45004,
  2461. .enable_mask = BIT(8),
  2462. .hw.init = &(struct clk_init_data){
  2463. .name = "gcc_prng_ahb_clk",
  2464. .parent_names = (const char *[]){
  2465. "pcnoc_bfdcd_clk_src",
  2466. },
  2467. .num_parents = 1,
  2468. .ops = &clk_branch2_ops,
  2469. },
  2470. },
  2471. };
  2472. static struct clk_branch gcc_sdcc1_ahb_clk = {
  2473. .halt_reg = 0x4201c,
  2474. .clkr = {
  2475. .enable_reg = 0x4201c,
  2476. .enable_mask = BIT(0),
  2477. .hw.init = &(struct clk_init_data){
  2478. .name = "gcc_sdcc1_ahb_clk",
  2479. .parent_names = (const char *[]){
  2480. "pcnoc_bfdcd_clk_src",
  2481. },
  2482. .num_parents = 1,
  2483. .flags = CLK_SET_RATE_PARENT,
  2484. .ops = &clk_branch2_ops,
  2485. },
  2486. },
  2487. };
  2488. static struct clk_branch gcc_sdcc1_apps_clk = {
  2489. .halt_reg = 0x42018,
  2490. .clkr = {
  2491. .enable_reg = 0x42018,
  2492. .enable_mask = BIT(0),
  2493. .hw.init = &(struct clk_init_data){
  2494. .name = "gcc_sdcc1_apps_clk",
  2495. .parent_names = (const char *[]){
  2496. "sdcc1_apps_clk_src",
  2497. },
  2498. .num_parents = 1,
  2499. .flags = CLK_SET_RATE_PARENT,
  2500. .ops = &clk_branch2_ops,
  2501. },
  2502. },
  2503. };
  2504. static struct clk_branch gcc_sdcc2_ahb_clk = {
  2505. .halt_reg = 0x4301c,
  2506. .clkr = {
  2507. .enable_reg = 0x4301c,
  2508. .enable_mask = BIT(0),
  2509. .hw.init = &(struct clk_init_data){
  2510. .name = "gcc_sdcc2_ahb_clk",
  2511. .parent_names = (const char *[]){
  2512. "pcnoc_bfdcd_clk_src",
  2513. },
  2514. .num_parents = 1,
  2515. .flags = CLK_SET_RATE_PARENT,
  2516. .ops = &clk_branch2_ops,
  2517. },
  2518. },
  2519. };
  2520. static struct clk_branch gcc_sdcc2_apps_clk = {
  2521. .halt_reg = 0x43018,
  2522. .clkr = {
  2523. .enable_reg = 0x43018,
  2524. .enable_mask = BIT(0),
  2525. .hw.init = &(struct clk_init_data){
  2526. .name = "gcc_sdcc2_apps_clk",
  2527. .parent_names = (const char *[]){
  2528. "sdcc2_apps_clk_src",
  2529. },
  2530. .num_parents = 1,
  2531. .flags = CLK_SET_RATE_PARENT,
  2532. .ops = &clk_branch2_ops,
  2533. },
  2534. },
  2535. };
  2536. static struct clk_rcg2 bimc_ddr_clk_src = {
  2537. .cmd_rcgr = 0x32004,
  2538. .hid_width = 5,
  2539. .parent_map = gcc_xo_gpll0_bimc_map,
  2540. .clkr.hw.init = &(struct clk_init_data){
  2541. .name = "bimc_ddr_clk_src",
  2542. .parent_names = gcc_xo_gpll0_bimc,
  2543. .num_parents = 3,
  2544. .ops = &clk_rcg2_ops,
  2545. .flags = CLK_GET_RATE_NOCACHE,
  2546. },
  2547. };
  2548. static struct clk_branch gcc_apss_tcu_clk = {
  2549. .halt_reg = 0x12018,
  2550. .clkr = {
  2551. .enable_reg = 0x4500c,
  2552. .enable_mask = BIT(1),
  2553. .hw.init = &(struct clk_init_data){
  2554. .name = "gcc_apss_tcu_clk",
  2555. .parent_names = (const char *[]){
  2556. "bimc_ddr_clk_src",
  2557. },
  2558. .num_parents = 1,
  2559. .ops = &clk_branch2_ops,
  2560. },
  2561. },
  2562. };
  2563. static struct clk_branch gcc_gfx_tcu_clk = {
  2564. .halt_reg = 0x12020,
  2565. .clkr = {
  2566. .enable_reg = 0x4500c,
  2567. .enable_mask = BIT(2),
  2568. .hw.init = &(struct clk_init_data){
  2569. .name = "gcc_gfx_tcu_clk",
  2570. .parent_names = (const char *[]){
  2571. "bimc_ddr_clk_src",
  2572. },
  2573. .num_parents = 1,
  2574. .ops = &clk_branch2_ops,
  2575. },
  2576. },
  2577. };
  2578. static struct clk_branch gcc_gtcu_ahb_clk = {
  2579. .halt_reg = 0x12044,
  2580. .clkr = {
  2581. .enable_reg = 0x4500c,
  2582. .enable_mask = BIT(13),
  2583. .hw.init = &(struct clk_init_data){
  2584. .name = "gcc_gtcu_ahb_clk",
  2585. .parent_names = (const char *[]){
  2586. "pcnoc_bfdcd_clk_src",
  2587. },
  2588. .num_parents = 1,
  2589. .flags = CLK_SET_RATE_PARENT,
  2590. .ops = &clk_branch2_ops,
  2591. },
  2592. },
  2593. };
  2594. static struct clk_branch gcc_bimc_gfx_clk = {
  2595. .halt_reg = 0x31024,
  2596. .clkr = {
  2597. .enable_reg = 0x31024,
  2598. .enable_mask = BIT(0),
  2599. .hw.init = &(struct clk_init_data){
  2600. .name = "gcc_bimc_gfx_clk",
  2601. .parent_names = (const char *[]){
  2602. "bimc_gpu_clk_src",
  2603. },
  2604. .num_parents = 1,
  2605. .flags = CLK_SET_RATE_PARENT,
  2606. .ops = &clk_branch2_ops,
  2607. },
  2608. },
  2609. };
  2610. static struct clk_branch gcc_bimc_gpu_clk = {
  2611. .halt_reg = 0x31040,
  2612. .clkr = {
  2613. .enable_reg = 0x31040,
  2614. .enable_mask = BIT(0),
  2615. .hw.init = &(struct clk_init_data){
  2616. .name = "gcc_bimc_gpu_clk",
  2617. .parent_names = (const char *[]){
  2618. "bimc_gpu_clk_src",
  2619. },
  2620. .num_parents = 1,
  2621. .flags = CLK_SET_RATE_PARENT,
  2622. .ops = &clk_branch2_ops,
  2623. },
  2624. },
  2625. };
  2626. static struct clk_branch gcc_jpeg_tbu_clk = {
  2627. .halt_reg = 0x12034,
  2628. .clkr = {
  2629. .enable_reg = 0x4500c,
  2630. .enable_mask = BIT(10),
  2631. .hw.init = &(struct clk_init_data){
  2632. .name = "gcc_jpeg_tbu_clk",
  2633. .parent_names = (const char *[]){
  2634. "system_noc_bfdcd_clk_src",
  2635. },
  2636. .num_parents = 1,
  2637. .flags = CLK_SET_RATE_PARENT,
  2638. .ops = &clk_branch2_ops,
  2639. },
  2640. },
  2641. };
  2642. static struct clk_branch gcc_mdp_tbu_clk = {
  2643. .halt_reg = 0x1201c,
  2644. .clkr = {
  2645. .enable_reg = 0x4500c,
  2646. .enable_mask = BIT(4),
  2647. .hw.init = &(struct clk_init_data){
  2648. .name = "gcc_mdp_tbu_clk",
  2649. .parent_names = (const char *[]){
  2650. "system_noc_bfdcd_clk_src",
  2651. },
  2652. .num_parents = 1,
  2653. .flags = CLK_SET_RATE_PARENT,
  2654. .ops = &clk_branch2_ops,
  2655. },
  2656. },
  2657. };
  2658. static struct clk_branch gcc_smmu_cfg_clk = {
  2659. .halt_reg = 0x12038,
  2660. .clkr = {
  2661. .enable_reg = 0x4500c,
  2662. .enable_mask = BIT(12),
  2663. .hw.init = &(struct clk_init_data){
  2664. .name = "gcc_smmu_cfg_clk",
  2665. .parent_names = (const char *[]){
  2666. "pcnoc_bfdcd_clk_src",
  2667. },
  2668. .num_parents = 1,
  2669. .flags = CLK_SET_RATE_PARENT,
  2670. .ops = &clk_branch2_ops,
  2671. },
  2672. },
  2673. };
  2674. static struct clk_branch gcc_venus_tbu_clk = {
  2675. .halt_reg = 0x12014,
  2676. .clkr = {
  2677. .enable_reg = 0x4500c,
  2678. .enable_mask = BIT(5),
  2679. .hw.init = &(struct clk_init_data){
  2680. .name = "gcc_venus_tbu_clk",
  2681. .parent_names = (const char *[]){
  2682. "system_noc_bfdcd_clk_src",
  2683. },
  2684. .num_parents = 1,
  2685. .flags = CLK_SET_RATE_PARENT,
  2686. .ops = &clk_branch2_ops,
  2687. },
  2688. },
  2689. };
  2690. static struct clk_branch gcc_vfe_tbu_clk = {
  2691. .halt_reg = 0x1203c,
  2692. .clkr = {
  2693. .enable_reg = 0x4500c,
  2694. .enable_mask = BIT(9),
  2695. .hw.init = &(struct clk_init_data){
  2696. .name = "gcc_vfe_tbu_clk",
  2697. .parent_names = (const char *[]){
  2698. "system_noc_bfdcd_clk_src",
  2699. },
  2700. .num_parents = 1,
  2701. .flags = CLK_SET_RATE_PARENT,
  2702. .ops = &clk_branch2_ops,
  2703. },
  2704. },
  2705. };
  2706. static struct clk_branch gcc_usb2a_phy_sleep_clk = {
  2707. .halt_reg = 0x4102c,
  2708. .clkr = {
  2709. .enable_reg = 0x4102c,
  2710. .enable_mask = BIT(0),
  2711. .hw.init = &(struct clk_init_data){
  2712. .name = "gcc_usb2a_phy_sleep_clk",
  2713. .parent_names = (const char *[]){
  2714. "sleep_clk_src",
  2715. },
  2716. .num_parents = 1,
  2717. .flags = CLK_SET_RATE_PARENT,
  2718. .ops = &clk_branch2_ops,
  2719. },
  2720. },
  2721. };
  2722. static struct clk_branch gcc_usb_hs_ahb_clk = {
  2723. .halt_reg = 0x41008,
  2724. .clkr = {
  2725. .enable_reg = 0x41008,
  2726. .enable_mask = BIT(0),
  2727. .hw.init = &(struct clk_init_data){
  2728. .name = "gcc_usb_hs_ahb_clk",
  2729. .parent_names = (const char *[]){
  2730. "pcnoc_bfdcd_clk_src",
  2731. },
  2732. .num_parents = 1,
  2733. .flags = CLK_SET_RATE_PARENT,
  2734. .ops = &clk_branch2_ops,
  2735. },
  2736. },
  2737. };
  2738. static struct clk_branch gcc_usb_hs_system_clk = {
  2739. .halt_reg = 0x41004,
  2740. .clkr = {
  2741. .enable_reg = 0x41004,
  2742. .enable_mask = BIT(0),
  2743. .hw.init = &(struct clk_init_data){
  2744. .name = "gcc_usb_hs_system_clk",
  2745. .parent_names = (const char *[]){
  2746. "usb_hs_system_clk_src",
  2747. },
  2748. .num_parents = 1,
  2749. .flags = CLK_SET_RATE_PARENT,
  2750. .ops = &clk_branch2_ops,
  2751. },
  2752. },
  2753. };
  2754. static struct clk_branch gcc_venus0_ahb_clk = {
  2755. .halt_reg = 0x4c020,
  2756. .clkr = {
  2757. .enable_reg = 0x4c020,
  2758. .enable_mask = BIT(0),
  2759. .hw.init = &(struct clk_init_data){
  2760. .name = "gcc_venus0_ahb_clk",
  2761. .parent_names = (const char *[]){
  2762. "pcnoc_bfdcd_clk_src",
  2763. },
  2764. .num_parents = 1,
  2765. .flags = CLK_SET_RATE_PARENT,
  2766. .ops = &clk_branch2_ops,
  2767. },
  2768. },
  2769. };
  2770. static struct clk_branch gcc_venus0_axi_clk = {
  2771. .halt_reg = 0x4c024,
  2772. .clkr = {
  2773. .enable_reg = 0x4c024,
  2774. .enable_mask = BIT(0),
  2775. .hw.init = &(struct clk_init_data){
  2776. .name = "gcc_venus0_axi_clk",
  2777. .parent_names = (const char *[]){
  2778. "system_noc_bfdcd_clk_src",
  2779. },
  2780. .num_parents = 1,
  2781. .flags = CLK_SET_RATE_PARENT,
  2782. .ops = &clk_branch2_ops,
  2783. },
  2784. },
  2785. };
  2786. static struct clk_branch gcc_venus0_vcodec0_clk = {
  2787. .halt_reg = 0x4c01c,
  2788. .clkr = {
  2789. .enable_reg = 0x4c01c,
  2790. .enable_mask = BIT(0),
  2791. .hw.init = &(struct clk_init_data){
  2792. .name = "gcc_venus0_vcodec0_clk",
  2793. .parent_names = (const char *[]){
  2794. "vcodec0_clk_src",
  2795. },
  2796. .num_parents = 1,
  2797. .flags = CLK_SET_RATE_PARENT,
  2798. .ops = &clk_branch2_ops,
  2799. },
  2800. },
  2801. };
  2802. static struct gdsc venus_gdsc = {
  2803. .gdscr = 0x4c018,
  2804. .pd = {
  2805. .name = "venus",
  2806. },
  2807. .pwrsts = PWRSTS_OFF_ON,
  2808. };
  2809. static struct gdsc mdss_gdsc = {
  2810. .gdscr = 0x4d078,
  2811. .pd = {
  2812. .name = "mdss",
  2813. },
  2814. .pwrsts = PWRSTS_OFF_ON,
  2815. };
  2816. static struct gdsc jpeg_gdsc = {
  2817. .gdscr = 0x5701c,
  2818. .pd = {
  2819. .name = "jpeg",
  2820. },
  2821. .pwrsts = PWRSTS_OFF_ON,
  2822. };
  2823. static struct gdsc vfe_gdsc = {
  2824. .gdscr = 0x58034,
  2825. .pd = {
  2826. .name = "vfe",
  2827. },
  2828. .pwrsts = PWRSTS_OFF_ON,
  2829. };
  2830. static struct gdsc oxili_gdsc = {
  2831. .gdscr = 0x5901c,
  2832. .pd = {
  2833. .name = "oxili",
  2834. },
  2835. .pwrsts = PWRSTS_OFF_ON,
  2836. };
  2837. static struct clk_regmap *gcc_msm8916_clocks[] = {
  2838. [GPLL0] = &gpll0.clkr,
  2839. [GPLL0_VOTE] = &gpll0_vote,
  2840. [BIMC_PLL] = &bimc_pll.clkr,
  2841. [BIMC_PLL_VOTE] = &bimc_pll_vote,
  2842. [GPLL1] = &gpll1.clkr,
  2843. [GPLL1_VOTE] = &gpll1_vote,
  2844. [GPLL2] = &gpll2.clkr,
  2845. [GPLL2_VOTE] = &gpll2_vote,
  2846. [PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
  2847. [SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
  2848. [CAMSS_AHB_CLK_SRC] = &camss_ahb_clk_src.clkr,
  2849. [APSS_AHB_CLK_SRC] = &apss_ahb_clk_src.clkr,
  2850. [CSI0_CLK_SRC] = &csi0_clk_src.clkr,
  2851. [CSI1_CLK_SRC] = &csi1_clk_src.clkr,
  2852. [GFX3D_CLK_SRC] = &gfx3d_clk_src.clkr,
  2853. [VFE0_CLK_SRC] = &vfe0_clk_src.clkr,
  2854. [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
  2855. [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
  2856. [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
  2857. [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
  2858. [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
  2859. [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
  2860. [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
  2861. [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
  2862. [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
  2863. [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
  2864. [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
  2865. [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
  2866. [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
  2867. [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
  2868. [CCI_CLK_SRC] = &cci_clk_src.clkr,
  2869. [CAMSS_GP0_CLK_SRC] = &camss_gp0_clk_src.clkr,
  2870. [CAMSS_GP1_CLK_SRC] = &camss_gp1_clk_src.clkr,
  2871. [JPEG0_CLK_SRC] = &jpeg0_clk_src.clkr,
  2872. [MCLK0_CLK_SRC] = &mclk0_clk_src.clkr,
  2873. [MCLK1_CLK_SRC] = &mclk1_clk_src.clkr,
  2874. [CSI0PHYTIMER_CLK_SRC] = &csi0phytimer_clk_src.clkr,
  2875. [CSI1PHYTIMER_CLK_SRC] = &csi1phytimer_clk_src.clkr,
  2876. [CPP_CLK_SRC] = &cpp_clk_src.clkr,
  2877. [CRYPTO_CLK_SRC] = &crypto_clk_src.clkr,
  2878. [GP1_CLK_SRC] = &gp1_clk_src.clkr,
  2879. [GP2_CLK_SRC] = &gp2_clk_src.clkr,
  2880. [GP3_CLK_SRC] = &gp3_clk_src.clkr,
  2881. [BYTE0_CLK_SRC] = &byte0_clk_src.clkr,
  2882. [ESC0_CLK_SRC] = &esc0_clk_src.clkr,
  2883. [MDP_CLK_SRC] = &mdp_clk_src.clkr,
  2884. [PCLK0_CLK_SRC] = &pclk0_clk_src.clkr,
  2885. [VSYNC_CLK_SRC] = &vsync_clk_src.clkr,
  2886. [PDM2_CLK_SRC] = &pdm2_clk_src.clkr,
  2887. [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr,
  2888. [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
  2889. [APSS_TCU_CLK_SRC] = &apss_tcu_clk_src.clkr,
  2890. [USB_HS_SYSTEM_CLK_SRC] = &usb_hs_system_clk_src.clkr,
  2891. [VCODEC0_CLK_SRC] = &vcodec0_clk_src.clkr,
  2892. [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
  2893. [GCC_BLSP1_SLEEP_CLK] = &gcc_blsp1_sleep_clk.clkr,
  2894. [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
  2895. [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
  2896. [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
  2897. [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
  2898. [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
  2899. [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
  2900. [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
  2901. [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
  2902. [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
  2903. [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
  2904. [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
  2905. [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
  2906. [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
  2907. [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
  2908. [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
  2909. [GCC_CAMSS_CCI_AHB_CLK] = &gcc_camss_cci_ahb_clk.clkr,
  2910. [GCC_CAMSS_CCI_CLK] = &gcc_camss_cci_clk.clkr,
  2911. [GCC_CAMSS_CSI0_AHB_CLK] = &gcc_camss_csi0_ahb_clk.clkr,
  2912. [GCC_CAMSS_CSI0_CLK] = &gcc_camss_csi0_clk.clkr,
  2913. [GCC_CAMSS_CSI0PHY_CLK] = &gcc_camss_csi0phy_clk.clkr,
  2914. [GCC_CAMSS_CSI0PIX_CLK] = &gcc_camss_csi0pix_clk.clkr,
  2915. [GCC_CAMSS_CSI0RDI_CLK] = &gcc_camss_csi0rdi_clk.clkr,
  2916. [GCC_CAMSS_CSI1_AHB_CLK] = &gcc_camss_csi1_ahb_clk.clkr,
  2917. [GCC_CAMSS_CSI1_CLK] = &gcc_camss_csi1_clk.clkr,
  2918. [GCC_CAMSS_CSI1PHY_CLK] = &gcc_camss_csi1phy_clk.clkr,
  2919. [GCC_CAMSS_CSI1PIX_CLK] = &gcc_camss_csi1pix_clk.clkr,
  2920. [GCC_CAMSS_CSI1RDI_CLK] = &gcc_camss_csi1rdi_clk.clkr,
  2921. [GCC_CAMSS_CSI_VFE0_CLK] = &gcc_camss_csi_vfe0_clk.clkr,
  2922. [GCC_CAMSS_GP0_CLK] = &gcc_camss_gp0_clk.clkr,
  2923. [GCC_CAMSS_GP1_CLK] = &gcc_camss_gp1_clk.clkr,
  2924. [GCC_CAMSS_ISPIF_AHB_CLK] = &gcc_camss_ispif_ahb_clk.clkr,
  2925. [GCC_CAMSS_JPEG0_CLK] = &gcc_camss_jpeg0_clk.clkr,
  2926. [GCC_CAMSS_JPEG_AHB_CLK] = &gcc_camss_jpeg_ahb_clk.clkr,
  2927. [GCC_CAMSS_JPEG_AXI_CLK] = &gcc_camss_jpeg_axi_clk.clkr,
  2928. [GCC_CAMSS_MCLK0_CLK] = &gcc_camss_mclk0_clk.clkr,
  2929. [GCC_CAMSS_MCLK1_CLK] = &gcc_camss_mclk1_clk.clkr,
  2930. [GCC_CAMSS_MICRO_AHB_CLK] = &gcc_camss_micro_ahb_clk.clkr,
  2931. [GCC_CAMSS_CSI0PHYTIMER_CLK] = &gcc_camss_csi0phytimer_clk.clkr,
  2932. [GCC_CAMSS_CSI1PHYTIMER_CLK] = &gcc_camss_csi1phytimer_clk.clkr,
  2933. [GCC_CAMSS_AHB_CLK] = &gcc_camss_ahb_clk.clkr,
  2934. [GCC_CAMSS_TOP_AHB_CLK] = &gcc_camss_top_ahb_clk.clkr,
  2935. [GCC_CAMSS_CPP_AHB_CLK] = &gcc_camss_cpp_ahb_clk.clkr,
  2936. [GCC_CAMSS_CPP_CLK] = &gcc_camss_cpp_clk.clkr,
  2937. [GCC_CAMSS_VFE0_CLK] = &gcc_camss_vfe0_clk.clkr,
  2938. [GCC_CAMSS_VFE_AHB_CLK] = &gcc_camss_vfe_ahb_clk.clkr,
  2939. [GCC_CAMSS_VFE_AXI_CLK] = &gcc_camss_vfe_axi_clk.clkr,
  2940. [GCC_CRYPTO_AHB_CLK] = &gcc_crypto_ahb_clk.clkr,
  2941. [GCC_CRYPTO_AXI_CLK] = &gcc_crypto_axi_clk.clkr,
  2942. [GCC_CRYPTO_CLK] = &gcc_crypto_clk.clkr,
  2943. [GCC_OXILI_GMEM_CLK] = &gcc_oxili_gmem_clk.clkr,
  2944. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  2945. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  2946. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  2947. [GCC_MDSS_AHB_CLK] = &gcc_mdss_ahb_clk.clkr,
  2948. [GCC_MDSS_AXI_CLK] = &gcc_mdss_axi_clk.clkr,
  2949. [GCC_MDSS_BYTE0_CLK] = &gcc_mdss_byte0_clk.clkr,
  2950. [GCC_MDSS_ESC0_CLK] = &gcc_mdss_esc0_clk.clkr,
  2951. [GCC_MDSS_MDP_CLK] = &gcc_mdss_mdp_clk.clkr,
  2952. [GCC_MDSS_PCLK0_CLK] = &gcc_mdss_pclk0_clk.clkr,
  2953. [GCC_MDSS_VSYNC_CLK] = &gcc_mdss_vsync_clk.clkr,
  2954. [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
  2955. [GCC_OXILI_AHB_CLK] = &gcc_oxili_ahb_clk.clkr,
  2956. [GCC_OXILI_GFX3D_CLK] = &gcc_oxili_gfx3d_clk.clkr,
  2957. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  2958. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  2959. [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
  2960. [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
  2961. [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
  2962. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  2963. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  2964. [GCC_GTCU_AHB_CLK] = &gcc_gtcu_ahb_clk.clkr,
  2965. [GCC_JPEG_TBU_CLK] = &gcc_jpeg_tbu_clk.clkr,
  2966. [GCC_MDP_TBU_CLK] = &gcc_mdp_tbu_clk.clkr,
  2967. [GCC_SMMU_CFG_CLK] = &gcc_smmu_cfg_clk.clkr,
  2968. [GCC_VENUS_TBU_CLK] = &gcc_venus_tbu_clk.clkr,
  2969. [GCC_VFE_TBU_CLK] = &gcc_vfe_tbu_clk.clkr,
  2970. [GCC_USB2A_PHY_SLEEP_CLK] = &gcc_usb2a_phy_sleep_clk.clkr,
  2971. [GCC_USB_HS_AHB_CLK] = &gcc_usb_hs_ahb_clk.clkr,
  2972. [GCC_USB_HS_SYSTEM_CLK] = &gcc_usb_hs_system_clk.clkr,
  2973. [GCC_VENUS0_AHB_CLK] = &gcc_venus0_ahb_clk.clkr,
  2974. [GCC_VENUS0_AXI_CLK] = &gcc_venus0_axi_clk.clkr,
  2975. [GCC_VENUS0_VCODEC0_CLK] = &gcc_venus0_vcodec0_clk.clkr,
  2976. [BIMC_DDR_CLK_SRC] = &bimc_ddr_clk_src.clkr,
  2977. [GCC_APSS_TCU_CLK] = &gcc_apss_tcu_clk.clkr,
  2978. [GCC_GFX_TCU_CLK] = &gcc_gfx_tcu_clk.clkr,
  2979. [BIMC_GPU_CLK_SRC] = &bimc_gpu_clk_src.clkr,
  2980. [GCC_BIMC_GFX_CLK] = &gcc_bimc_gfx_clk.clkr,
  2981. [GCC_BIMC_GPU_CLK] = &gcc_bimc_gpu_clk.clkr,
  2982. [ULTAUDIO_AHBFABRIC_CLK_SRC] = &ultaudio_ahbfabric_clk_src.clkr,
  2983. [ULTAUDIO_LPAIF_PRI_I2S_CLK_SRC] = &ultaudio_lpaif_pri_i2s_clk_src.clkr,
  2984. [ULTAUDIO_LPAIF_SEC_I2S_CLK_SRC] = &ultaudio_lpaif_sec_i2s_clk_src.clkr,
  2985. [ULTAUDIO_LPAIF_AUX_I2S_CLK_SRC] = &ultaudio_lpaif_aux_i2s_clk_src.clkr,
  2986. [ULTAUDIO_XO_CLK_SRC] = &ultaudio_xo_clk_src.clkr,
  2987. [CODEC_DIGCODEC_CLK_SRC] = &codec_digcodec_clk_src.clkr,
  2988. [GCC_ULTAUDIO_PCNOC_MPORT_CLK] = &gcc_ultaudio_pcnoc_mport_clk.clkr,
  2989. [GCC_ULTAUDIO_PCNOC_SWAY_CLK] = &gcc_ultaudio_pcnoc_sway_clk.clkr,
  2990. [GCC_ULTAUDIO_AVSYNC_XO_CLK] = &gcc_ultaudio_avsync_xo_clk.clkr,
  2991. [GCC_ULTAUDIO_STC_XO_CLK] = &gcc_ultaudio_stc_xo_clk.clkr,
  2992. [GCC_ULTAUDIO_AHBFABRIC_IXFABRIC_CLK] = &gcc_ultaudio_ahbfabric_ixfabric_clk.clkr,
  2993. [GCC_ULTAUDIO_AHBFABRIC_IXFABRIC_LPM_CLK] = &gcc_ultaudio_ahbfabric_ixfabric_lpm_clk.clkr,
  2994. [GCC_ULTAUDIO_LPAIF_PRI_I2S_CLK] = &gcc_ultaudio_lpaif_pri_i2s_clk.clkr,
  2995. [GCC_ULTAUDIO_LPAIF_SEC_I2S_CLK] = &gcc_ultaudio_lpaif_sec_i2s_clk.clkr,
  2996. [GCC_ULTAUDIO_LPAIF_AUX_I2S_CLK] = &gcc_ultaudio_lpaif_aux_i2s_clk.clkr,
  2997. [GCC_CODEC_DIGCODEC_CLK] = &gcc_codec_digcodec_clk.clkr,
  2998. };
  2999. static struct gdsc *gcc_msm8916_gdscs[] = {
  3000. [VENUS_GDSC] = &venus_gdsc,
  3001. [MDSS_GDSC] = &mdss_gdsc,
  3002. [JPEG_GDSC] = &jpeg_gdsc,
  3003. [VFE_GDSC] = &vfe_gdsc,
  3004. [OXILI_GDSC] = &oxili_gdsc,
  3005. };
  3006. static const struct qcom_reset_map gcc_msm8916_resets[] = {
  3007. [GCC_BLSP1_BCR] = { 0x01000 },
  3008. [GCC_BLSP1_QUP1_BCR] = { 0x02000 },
  3009. [GCC_BLSP1_UART1_BCR] = { 0x02038 },
  3010. [GCC_BLSP1_QUP2_BCR] = { 0x03008 },
  3011. [GCC_BLSP1_UART2_BCR] = { 0x03028 },
  3012. [GCC_BLSP1_QUP3_BCR] = { 0x04018 },
  3013. [GCC_BLSP1_QUP4_BCR] = { 0x05018 },
  3014. [GCC_BLSP1_QUP5_BCR] = { 0x06018 },
  3015. [GCC_BLSP1_QUP6_BCR] = { 0x07018 },
  3016. [GCC_IMEM_BCR] = { 0x0e000 },
  3017. [GCC_SMMU_BCR] = { 0x12000 },
  3018. [GCC_APSS_TCU_BCR] = { 0x12050 },
  3019. [GCC_SMMU_XPU_BCR] = { 0x12054 },
  3020. [GCC_PCNOC_TBU_BCR] = { 0x12058 },
  3021. [GCC_PRNG_BCR] = { 0x13000 },
  3022. [GCC_BOOT_ROM_BCR] = { 0x13008 },
  3023. [GCC_CRYPTO_BCR] = { 0x16000 },
  3024. [GCC_SEC_CTRL_BCR] = { 0x1a000 },
  3025. [GCC_AUDIO_CORE_BCR] = { 0x1c008 },
  3026. [GCC_ULT_AUDIO_BCR] = { 0x1c0b4 },
  3027. [GCC_DEHR_BCR] = { 0x1f000 },
  3028. [GCC_SYSTEM_NOC_BCR] = { 0x26000 },
  3029. [GCC_PCNOC_BCR] = { 0x27018 },
  3030. [GCC_TCSR_BCR] = { 0x28000 },
  3031. [GCC_QDSS_BCR] = { 0x29000 },
  3032. [GCC_DCD_BCR] = { 0x2a000 },
  3033. [GCC_MSG_RAM_BCR] = { 0x2b000 },
  3034. [GCC_MPM_BCR] = { 0x2c000 },
  3035. [GCC_SPMI_BCR] = { 0x2e000 },
  3036. [GCC_SPDM_BCR] = { 0x2f000 },
  3037. [GCC_MM_SPDM_BCR] = { 0x2f024 },
  3038. [GCC_BIMC_BCR] = { 0x31000 },
  3039. [GCC_RBCPR_BCR] = { 0x33000 },
  3040. [GCC_TLMM_BCR] = { 0x34000 },
  3041. [GCC_USB_HS_BCR] = { 0x41000 },
  3042. [GCC_USB2A_PHY_BCR] = { 0x41028 },
  3043. [GCC_SDCC1_BCR] = { 0x42000 },
  3044. [GCC_SDCC2_BCR] = { 0x43000 },
  3045. [GCC_PDM_BCR] = { 0x44000 },
  3046. [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x47000 },
  3047. [GCC_PCNOC_BUS_TIMEOUT0_BCR] = { 0x48000 },
  3048. [GCC_PCNOC_BUS_TIMEOUT1_BCR] = { 0x48008 },
  3049. [GCC_PCNOC_BUS_TIMEOUT2_BCR] = { 0x48010 },
  3050. [GCC_PCNOC_BUS_TIMEOUT3_BCR] = { 0x48018 },
  3051. [GCC_PCNOC_BUS_TIMEOUT4_BCR] = { 0x48020 },
  3052. [GCC_PCNOC_BUS_TIMEOUT5_BCR] = { 0x48028 },
  3053. [GCC_PCNOC_BUS_TIMEOUT6_BCR] = { 0x48030 },
  3054. [GCC_PCNOC_BUS_TIMEOUT7_BCR] = { 0x48038 },
  3055. [GCC_PCNOC_BUS_TIMEOUT8_BCR] = { 0x48040 },
  3056. [GCC_PCNOC_BUS_TIMEOUT9_BCR] = { 0x48048 },
  3057. [GCC_MMSS_BCR] = { 0x4b000 },
  3058. [GCC_VENUS0_BCR] = { 0x4c014 },
  3059. [GCC_MDSS_BCR] = { 0x4d074 },
  3060. [GCC_CAMSS_PHY0_BCR] = { 0x4e018 },
  3061. [GCC_CAMSS_CSI0_BCR] = { 0x4e038 },
  3062. [GCC_CAMSS_CSI0PHY_BCR] = { 0x4e044 },
  3063. [GCC_CAMSS_CSI0RDI_BCR] = { 0x4e04c },
  3064. [GCC_CAMSS_CSI0PIX_BCR] = { 0x4e054 },
  3065. [GCC_CAMSS_PHY1_BCR] = { 0x4f018 },
  3066. [GCC_CAMSS_CSI1_BCR] = { 0x4f038 },
  3067. [GCC_CAMSS_CSI1PHY_BCR] = { 0x4f044 },
  3068. [GCC_CAMSS_CSI1RDI_BCR] = { 0x4f04c },
  3069. [GCC_CAMSS_CSI1PIX_BCR] = { 0x4f054 },
  3070. [GCC_CAMSS_ISPIF_BCR] = { 0x50000 },
  3071. [GCC_CAMSS_CCI_BCR] = { 0x51014 },
  3072. [GCC_CAMSS_MCLK0_BCR] = { 0x52014 },
  3073. [GCC_CAMSS_MCLK1_BCR] = { 0x53014 },
  3074. [GCC_CAMSS_GP0_BCR] = { 0x54014 },
  3075. [GCC_CAMSS_GP1_BCR] = { 0x55014 },
  3076. [GCC_CAMSS_TOP_BCR] = { 0x56000 },
  3077. [GCC_CAMSS_MICRO_BCR] = { 0x56008 },
  3078. [GCC_CAMSS_JPEG_BCR] = { 0x57018 },
  3079. [GCC_CAMSS_VFE_BCR] = { 0x58030 },
  3080. [GCC_CAMSS_CSI_VFE0_BCR] = { 0x5804c },
  3081. [GCC_OXILI_BCR] = { 0x59018 },
  3082. [GCC_GMEM_BCR] = { 0x5902c },
  3083. [GCC_CAMSS_AHB_BCR] = { 0x5a018 },
  3084. [GCC_MDP_TBU_BCR] = { 0x62000 },
  3085. [GCC_GFX_TBU_BCR] = { 0x63000 },
  3086. [GCC_GFX_TCU_BCR] = { 0x64000 },
  3087. [GCC_MSS_TBU_AXI_BCR] = { 0x65000 },
  3088. [GCC_MSS_TBU_GSS_AXI_BCR] = { 0x66000 },
  3089. [GCC_MSS_TBU_Q6_AXI_BCR] = { 0x67000 },
  3090. [GCC_GTCU_AHB_BCR] = { 0x68000 },
  3091. [GCC_SMMU_CFG_BCR] = { 0x69000 },
  3092. [GCC_VFE_TBU_BCR] = { 0x6a000 },
  3093. [GCC_VENUS_TBU_BCR] = { 0x6b000 },
  3094. [GCC_JPEG_TBU_BCR] = { 0x6c000 },
  3095. [GCC_PRONTO_TBU_BCR] = { 0x6d000 },
  3096. [GCC_SMMU_CATS_BCR] = { 0x7c000 },
  3097. };
  3098. static const struct regmap_config gcc_msm8916_regmap_config = {
  3099. .reg_bits = 32,
  3100. .reg_stride = 4,
  3101. .val_bits = 32,
  3102. .max_register = 0x80000,
  3103. .fast_io = true,
  3104. };
  3105. static const struct qcom_cc_desc gcc_msm8916_desc = {
  3106. .config = &gcc_msm8916_regmap_config,
  3107. .clks = gcc_msm8916_clocks,
  3108. .num_clks = ARRAY_SIZE(gcc_msm8916_clocks),
  3109. .resets = gcc_msm8916_resets,
  3110. .num_resets = ARRAY_SIZE(gcc_msm8916_resets),
  3111. .gdscs = gcc_msm8916_gdscs,
  3112. .num_gdscs = ARRAY_SIZE(gcc_msm8916_gdscs),
  3113. };
  3114. static const struct of_device_id gcc_msm8916_match_table[] = {
  3115. { .compatible = "qcom,gcc-msm8916" },
  3116. { }
  3117. };
  3118. MODULE_DEVICE_TABLE(of, gcc_msm8916_match_table);
  3119. static int gcc_msm8916_probe(struct platform_device *pdev)
  3120. {
  3121. struct clk *clk;
  3122. struct device *dev = &pdev->dev;
  3123. /* Temporary until RPM clocks supported */
  3124. clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000);
  3125. if (IS_ERR(clk))
  3126. return PTR_ERR(clk);
  3127. clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL,
  3128. CLK_IS_ROOT, 32768);
  3129. if (IS_ERR(clk))
  3130. return PTR_ERR(clk);
  3131. return qcom_cc_probe(pdev, &gcc_msm8916_desc);
  3132. }
  3133. static struct platform_driver gcc_msm8916_driver = {
  3134. .probe = gcc_msm8916_probe,
  3135. .driver = {
  3136. .name = "gcc-msm8916",
  3137. .of_match_table = gcc_msm8916_match_table,
  3138. },
  3139. };
  3140. static int __init gcc_msm8916_init(void)
  3141. {
  3142. return platform_driver_register(&gcc_msm8916_driver);
  3143. }
  3144. core_initcall(gcc_msm8916_init);
  3145. static void __exit gcc_msm8916_exit(void)
  3146. {
  3147. platform_driver_unregister(&gcc_msm8916_driver);
  3148. }
  3149. module_exit(gcc_msm8916_exit);
  3150. MODULE_DESCRIPTION("Qualcomm GCC MSM8916 Driver");
  3151. MODULE_LICENSE("GPL v2");
  3152. MODULE_ALIAS("platform:gcc-msm8916");