gcc-msm8960.c 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571
  1. /*
  2. * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/bitops.h>
  15. #include <linux/err.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/module.h>
  18. #include <linux/of.h>
  19. #include <linux/of_device.h>
  20. #include <linux/clk-provider.h>
  21. #include <linux/regmap.h>
  22. #include <linux/reset-controller.h>
  23. #include <dt-bindings/clock/qcom,gcc-msm8960.h>
  24. #include <dt-bindings/reset/qcom,gcc-msm8960.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. static struct clk_pll pll3 = {
  32. .l_reg = 0x3164,
  33. .m_reg = 0x3168,
  34. .n_reg = 0x316c,
  35. .config_reg = 0x3174,
  36. .mode_reg = 0x3160,
  37. .status_reg = 0x3178,
  38. .status_bit = 16,
  39. .clkr.hw.init = &(struct clk_init_data){
  40. .name = "pll3",
  41. .parent_names = (const char *[]){ "pxo" },
  42. .num_parents = 1,
  43. .ops = &clk_pll_ops,
  44. },
  45. };
  46. static struct clk_regmap pll4_vote = {
  47. .enable_reg = 0x34c0,
  48. .enable_mask = BIT(4),
  49. .hw.init = &(struct clk_init_data){
  50. .name = "pll4_vote",
  51. .parent_names = (const char *[]){ "pll4" },
  52. .num_parents = 1,
  53. .ops = &clk_pll_vote_ops,
  54. },
  55. };
  56. static struct clk_pll pll8 = {
  57. .l_reg = 0x3144,
  58. .m_reg = 0x3148,
  59. .n_reg = 0x314c,
  60. .config_reg = 0x3154,
  61. .mode_reg = 0x3140,
  62. .status_reg = 0x3158,
  63. .status_bit = 16,
  64. .clkr.hw.init = &(struct clk_init_data){
  65. .name = "pll8",
  66. .parent_names = (const char *[]){ "pxo" },
  67. .num_parents = 1,
  68. .ops = &clk_pll_ops,
  69. },
  70. };
  71. static struct clk_regmap pll8_vote = {
  72. .enable_reg = 0x34c0,
  73. .enable_mask = BIT(8),
  74. .hw.init = &(struct clk_init_data){
  75. .name = "pll8_vote",
  76. .parent_names = (const char *[]){ "pll8" },
  77. .num_parents = 1,
  78. .ops = &clk_pll_vote_ops,
  79. },
  80. };
  81. static struct clk_pll pll14 = {
  82. .l_reg = 0x31c4,
  83. .m_reg = 0x31c8,
  84. .n_reg = 0x31cc,
  85. .config_reg = 0x31d4,
  86. .mode_reg = 0x31c0,
  87. .status_reg = 0x31d8,
  88. .status_bit = 16,
  89. .clkr.hw.init = &(struct clk_init_data){
  90. .name = "pll14",
  91. .parent_names = (const char *[]){ "pxo" },
  92. .num_parents = 1,
  93. .ops = &clk_pll_ops,
  94. },
  95. };
  96. static struct clk_regmap pll14_vote = {
  97. .enable_reg = 0x34c0,
  98. .enable_mask = BIT(14),
  99. .hw.init = &(struct clk_init_data){
  100. .name = "pll14_vote",
  101. .parent_names = (const char *[]){ "pll14" },
  102. .num_parents = 1,
  103. .ops = &clk_pll_vote_ops,
  104. },
  105. };
  106. enum {
  107. P_PXO,
  108. P_PLL8,
  109. P_PLL3,
  110. P_CXO,
  111. };
  112. static const struct parent_map gcc_pxo_pll8_map[] = {
  113. { P_PXO, 0 },
  114. { P_PLL8, 3 }
  115. };
  116. static const char * const gcc_pxo_pll8[] = {
  117. "pxo",
  118. "pll8_vote",
  119. };
  120. static const struct parent_map gcc_pxo_pll8_cxo_map[] = {
  121. { P_PXO, 0 },
  122. { P_PLL8, 3 },
  123. { P_CXO, 5 }
  124. };
  125. static const char * const gcc_pxo_pll8_cxo[] = {
  126. "pxo",
  127. "pll8_vote",
  128. "cxo",
  129. };
  130. static const struct parent_map gcc_pxo_pll8_pll3_map[] = {
  131. { P_PXO, 0 },
  132. { P_PLL8, 3 },
  133. { P_PLL3, 6 }
  134. };
  135. static const char * const gcc_pxo_pll8_pll3[] = {
  136. "pxo",
  137. "pll8_vote",
  138. "pll3",
  139. };
  140. static struct freq_tbl clk_tbl_gsbi_uart[] = {
  141. { 1843200, P_PLL8, 2, 6, 625 },
  142. { 3686400, P_PLL8, 2, 12, 625 },
  143. { 7372800, P_PLL8, 2, 24, 625 },
  144. { 14745600, P_PLL8, 2, 48, 625 },
  145. { 16000000, P_PLL8, 4, 1, 6 },
  146. { 24000000, P_PLL8, 4, 1, 4 },
  147. { 32000000, P_PLL8, 4, 1, 3 },
  148. { 40000000, P_PLL8, 1, 5, 48 },
  149. { 46400000, P_PLL8, 1, 29, 240 },
  150. { 48000000, P_PLL8, 4, 1, 2 },
  151. { 51200000, P_PLL8, 1, 2, 15 },
  152. { 56000000, P_PLL8, 1, 7, 48 },
  153. { 58982400, P_PLL8, 1, 96, 625 },
  154. { 64000000, P_PLL8, 2, 1, 3 },
  155. { }
  156. };
  157. static struct clk_rcg gsbi1_uart_src = {
  158. .ns_reg = 0x29d4,
  159. .md_reg = 0x29d0,
  160. .mn = {
  161. .mnctr_en_bit = 8,
  162. .mnctr_reset_bit = 7,
  163. .mnctr_mode_shift = 5,
  164. .n_val_shift = 16,
  165. .m_val_shift = 16,
  166. .width = 16,
  167. },
  168. .p = {
  169. .pre_div_shift = 3,
  170. .pre_div_width = 2,
  171. },
  172. .s = {
  173. .src_sel_shift = 0,
  174. .parent_map = gcc_pxo_pll8_map,
  175. },
  176. .freq_tbl = clk_tbl_gsbi_uart,
  177. .clkr = {
  178. .enable_reg = 0x29d4,
  179. .enable_mask = BIT(11),
  180. .hw.init = &(struct clk_init_data){
  181. .name = "gsbi1_uart_src",
  182. .parent_names = gcc_pxo_pll8,
  183. .num_parents = 2,
  184. .ops = &clk_rcg_ops,
  185. .flags = CLK_SET_PARENT_GATE,
  186. },
  187. },
  188. };
  189. static struct clk_branch gsbi1_uart_clk = {
  190. .halt_reg = 0x2fcc,
  191. .halt_bit = 10,
  192. .clkr = {
  193. .enable_reg = 0x29d4,
  194. .enable_mask = BIT(9),
  195. .hw.init = &(struct clk_init_data){
  196. .name = "gsbi1_uart_clk",
  197. .parent_names = (const char *[]){
  198. "gsbi1_uart_src",
  199. },
  200. .num_parents = 1,
  201. .ops = &clk_branch_ops,
  202. .flags = CLK_SET_RATE_PARENT,
  203. },
  204. },
  205. };
  206. static struct clk_rcg gsbi2_uart_src = {
  207. .ns_reg = 0x29f4,
  208. .md_reg = 0x29f0,
  209. .mn = {
  210. .mnctr_en_bit = 8,
  211. .mnctr_reset_bit = 7,
  212. .mnctr_mode_shift = 5,
  213. .n_val_shift = 16,
  214. .m_val_shift = 16,
  215. .width = 16,
  216. },
  217. .p = {
  218. .pre_div_shift = 3,
  219. .pre_div_width = 2,
  220. },
  221. .s = {
  222. .src_sel_shift = 0,
  223. .parent_map = gcc_pxo_pll8_map,
  224. },
  225. .freq_tbl = clk_tbl_gsbi_uart,
  226. .clkr = {
  227. .enable_reg = 0x29f4,
  228. .enable_mask = BIT(11),
  229. .hw.init = &(struct clk_init_data){
  230. .name = "gsbi2_uart_src",
  231. .parent_names = gcc_pxo_pll8,
  232. .num_parents = 2,
  233. .ops = &clk_rcg_ops,
  234. .flags = CLK_SET_PARENT_GATE,
  235. },
  236. },
  237. };
  238. static struct clk_branch gsbi2_uart_clk = {
  239. .halt_reg = 0x2fcc,
  240. .halt_bit = 6,
  241. .clkr = {
  242. .enable_reg = 0x29f4,
  243. .enable_mask = BIT(9),
  244. .hw.init = &(struct clk_init_data){
  245. .name = "gsbi2_uart_clk",
  246. .parent_names = (const char *[]){
  247. "gsbi2_uart_src",
  248. },
  249. .num_parents = 1,
  250. .ops = &clk_branch_ops,
  251. .flags = CLK_SET_RATE_PARENT,
  252. },
  253. },
  254. };
  255. static struct clk_rcg gsbi3_uart_src = {
  256. .ns_reg = 0x2a14,
  257. .md_reg = 0x2a10,
  258. .mn = {
  259. .mnctr_en_bit = 8,
  260. .mnctr_reset_bit = 7,
  261. .mnctr_mode_shift = 5,
  262. .n_val_shift = 16,
  263. .m_val_shift = 16,
  264. .width = 16,
  265. },
  266. .p = {
  267. .pre_div_shift = 3,
  268. .pre_div_width = 2,
  269. },
  270. .s = {
  271. .src_sel_shift = 0,
  272. .parent_map = gcc_pxo_pll8_map,
  273. },
  274. .freq_tbl = clk_tbl_gsbi_uart,
  275. .clkr = {
  276. .enable_reg = 0x2a14,
  277. .enable_mask = BIT(11),
  278. .hw.init = &(struct clk_init_data){
  279. .name = "gsbi3_uart_src",
  280. .parent_names = gcc_pxo_pll8,
  281. .num_parents = 2,
  282. .ops = &clk_rcg_ops,
  283. .flags = CLK_SET_PARENT_GATE,
  284. },
  285. },
  286. };
  287. static struct clk_branch gsbi3_uart_clk = {
  288. .halt_reg = 0x2fcc,
  289. .halt_bit = 2,
  290. .clkr = {
  291. .enable_reg = 0x2a14,
  292. .enable_mask = BIT(9),
  293. .hw.init = &(struct clk_init_data){
  294. .name = "gsbi3_uart_clk",
  295. .parent_names = (const char *[]){
  296. "gsbi3_uart_src",
  297. },
  298. .num_parents = 1,
  299. .ops = &clk_branch_ops,
  300. .flags = CLK_SET_RATE_PARENT,
  301. },
  302. },
  303. };
  304. static struct clk_rcg gsbi4_uart_src = {
  305. .ns_reg = 0x2a34,
  306. .md_reg = 0x2a30,
  307. .mn = {
  308. .mnctr_en_bit = 8,
  309. .mnctr_reset_bit = 7,
  310. .mnctr_mode_shift = 5,
  311. .n_val_shift = 16,
  312. .m_val_shift = 16,
  313. .width = 16,
  314. },
  315. .p = {
  316. .pre_div_shift = 3,
  317. .pre_div_width = 2,
  318. },
  319. .s = {
  320. .src_sel_shift = 0,
  321. .parent_map = gcc_pxo_pll8_map,
  322. },
  323. .freq_tbl = clk_tbl_gsbi_uart,
  324. .clkr = {
  325. .enable_reg = 0x2a34,
  326. .enable_mask = BIT(11),
  327. .hw.init = &(struct clk_init_data){
  328. .name = "gsbi4_uart_src",
  329. .parent_names = gcc_pxo_pll8,
  330. .num_parents = 2,
  331. .ops = &clk_rcg_ops,
  332. .flags = CLK_SET_PARENT_GATE,
  333. },
  334. },
  335. };
  336. static struct clk_branch gsbi4_uart_clk = {
  337. .halt_reg = 0x2fd0,
  338. .halt_bit = 26,
  339. .clkr = {
  340. .enable_reg = 0x2a34,
  341. .enable_mask = BIT(9),
  342. .hw.init = &(struct clk_init_data){
  343. .name = "gsbi4_uart_clk",
  344. .parent_names = (const char *[]){
  345. "gsbi4_uart_src",
  346. },
  347. .num_parents = 1,
  348. .ops = &clk_branch_ops,
  349. .flags = CLK_SET_RATE_PARENT,
  350. },
  351. },
  352. };
  353. static struct clk_rcg gsbi5_uart_src = {
  354. .ns_reg = 0x2a54,
  355. .md_reg = 0x2a50,
  356. .mn = {
  357. .mnctr_en_bit = 8,
  358. .mnctr_reset_bit = 7,
  359. .mnctr_mode_shift = 5,
  360. .n_val_shift = 16,
  361. .m_val_shift = 16,
  362. .width = 16,
  363. },
  364. .p = {
  365. .pre_div_shift = 3,
  366. .pre_div_width = 2,
  367. },
  368. .s = {
  369. .src_sel_shift = 0,
  370. .parent_map = gcc_pxo_pll8_map,
  371. },
  372. .freq_tbl = clk_tbl_gsbi_uart,
  373. .clkr = {
  374. .enable_reg = 0x2a54,
  375. .enable_mask = BIT(11),
  376. .hw.init = &(struct clk_init_data){
  377. .name = "gsbi5_uart_src",
  378. .parent_names = gcc_pxo_pll8,
  379. .num_parents = 2,
  380. .ops = &clk_rcg_ops,
  381. .flags = CLK_SET_PARENT_GATE,
  382. },
  383. },
  384. };
  385. static struct clk_branch gsbi5_uart_clk = {
  386. .halt_reg = 0x2fd0,
  387. .halt_bit = 22,
  388. .clkr = {
  389. .enable_reg = 0x2a54,
  390. .enable_mask = BIT(9),
  391. .hw.init = &(struct clk_init_data){
  392. .name = "gsbi5_uart_clk",
  393. .parent_names = (const char *[]){
  394. "gsbi5_uart_src",
  395. },
  396. .num_parents = 1,
  397. .ops = &clk_branch_ops,
  398. .flags = CLK_SET_RATE_PARENT,
  399. },
  400. },
  401. };
  402. static struct clk_rcg gsbi6_uart_src = {
  403. .ns_reg = 0x2a74,
  404. .md_reg = 0x2a70,
  405. .mn = {
  406. .mnctr_en_bit = 8,
  407. .mnctr_reset_bit = 7,
  408. .mnctr_mode_shift = 5,
  409. .n_val_shift = 16,
  410. .m_val_shift = 16,
  411. .width = 16,
  412. },
  413. .p = {
  414. .pre_div_shift = 3,
  415. .pre_div_width = 2,
  416. },
  417. .s = {
  418. .src_sel_shift = 0,
  419. .parent_map = gcc_pxo_pll8_map,
  420. },
  421. .freq_tbl = clk_tbl_gsbi_uart,
  422. .clkr = {
  423. .enable_reg = 0x2a74,
  424. .enable_mask = BIT(11),
  425. .hw.init = &(struct clk_init_data){
  426. .name = "gsbi6_uart_src",
  427. .parent_names = gcc_pxo_pll8,
  428. .num_parents = 2,
  429. .ops = &clk_rcg_ops,
  430. .flags = CLK_SET_PARENT_GATE,
  431. },
  432. },
  433. };
  434. static struct clk_branch gsbi6_uart_clk = {
  435. .halt_reg = 0x2fd0,
  436. .halt_bit = 18,
  437. .clkr = {
  438. .enable_reg = 0x2a74,
  439. .enable_mask = BIT(9),
  440. .hw.init = &(struct clk_init_data){
  441. .name = "gsbi6_uart_clk",
  442. .parent_names = (const char *[]){
  443. "gsbi6_uart_src",
  444. },
  445. .num_parents = 1,
  446. .ops = &clk_branch_ops,
  447. .flags = CLK_SET_RATE_PARENT,
  448. },
  449. },
  450. };
  451. static struct clk_rcg gsbi7_uart_src = {
  452. .ns_reg = 0x2a94,
  453. .md_reg = 0x2a90,
  454. .mn = {
  455. .mnctr_en_bit = 8,
  456. .mnctr_reset_bit = 7,
  457. .mnctr_mode_shift = 5,
  458. .n_val_shift = 16,
  459. .m_val_shift = 16,
  460. .width = 16,
  461. },
  462. .p = {
  463. .pre_div_shift = 3,
  464. .pre_div_width = 2,
  465. },
  466. .s = {
  467. .src_sel_shift = 0,
  468. .parent_map = gcc_pxo_pll8_map,
  469. },
  470. .freq_tbl = clk_tbl_gsbi_uart,
  471. .clkr = {
  472. .enable_reg = 0x2a94,
  473. .enable_mask = BIT(11),
  474. .hw.init = &(struct clk_init_data){
  475. .name = "gsbi7_uart_src",
  476. .parent_names = gcc_pxo_pll8,
  477. .num_parents = 2,
  478. .ops = &clk_rcg_ops,
  479. .flags = CLK_SET_PARENT_GATE,
  480. },
  481. },
  482. };
  483. static struct clk_branch gsbi7_uart_clk = {
  484. .halt_reg = 0x2fd0,
  485. .halt_bit = 14,
  486. .clkr = {
  487. .enable_reg = 0x2a94,
  488. .enable_mask = BIT(9),
  489. .hw.init = &(struct clk_init_data){
  490. .name = "gsbi7_uart_clk",
  491. .parent_names = (const char *[]){
  492. "gsbi7_uart_src",
  493. },
  494. .num_parents = 1,
  495. .ops = &clk_branch_ops,
  496. .flags = CLK_SET_RATE_PARENT,
  497. },
  498. },
  499. };
  500. static struct clk_rcg gsbi8_uart_src = {
  501. .ns_reg = 0x2ab4,
  502. .md_reg = 0x2ab0,
  503. .mn = {
  504. .mnctr_en_bit = 8,
  505. .mnctr_reset_bit = 7,
  506. .mnctr_mode_shift = 5,
  507. .n_val_shift = 16,
  508. .m_val_shift = 16,
  509. .width = 16,
  510. },
  511. .p = {
  512. .pre_div_shift = 3,
  513. .pre_div_width = 2,
  514. },
  515. .s = {
  516. .src_sel_shift = 0,
  517. .parent_map = gcc_pxo_pll8_map,
  518. },
  519. .freq_tbl = clk_tbl_gsbi_uart,
  520. .clkr = {
  521. .enable_reg = 0x2ab4,
  522. .enable_mask = BIT(11),
  523. .hw.init = &(struct clk_init_data){
  524. .name = "gsbi8_uart_src",
  525. .parent_names = gcc_pxo_pll8,
  526. .num_parents = 2,
  527. .ops = &clk_rcg_ops,
  528. .flags = CLK_SET_PARENT_GATE,
  529. },
  530. },
  531. };
  532. static struct clk_branch gsbi8_uart_clk = {
  533. .halt_reg = 0x2fd0,
  534. .halt_bit = 10,
  535. .clkr = {
  536. .enable_reg = 0x2ab4,
  537. .enable_mask = BIT(9),
  538. .hw.init = &(struct clk_init_data){
  539. .name = "gsbi8_uart_clk",
  540. .parent_names = (const char *[]){ "gsbi8_uart_src" },
  541. .num_parents = 1,
  542. .ops = &clk_branch_ops,
  543. .flags = CLK_SET_RATE_PARENT,
  544. },
  545. },
  546. };
  547. static struct clk_rcg gsbi9_uart_src = {
  548. .ns_reg = 0x2ad4,
  549. .md_reg = 0x2ad0,
  550. .mn = {
  551. .mnctr_en_bit = 8,
  552. .mnctr_reset_bit = 7,
  553. .mnctr_mode_shift = 5,
  554. .n_val_shift = 16,
  555. .m_val_shift = 16,
  556. .width = 16,
  557. },
  558. .p = {
  559. .pre_div_shift = 3,
  560. .pre_div_width = 2,
  561. },
  562. .s = {
  563. .src_sel_shift = 0,
  564. .parent_map = gcc_pxo_pll8_map,
  565. },
  566. .freq_tbl = clk_tbl_gsbi_uart,
  567. .clkr = {
  568. .enable_reg = 0x2ad4,
  569. .enable_mask = BIT(11),
  570. .hw.init = &(struct clk_init_data){
  571. .name = "gsbi9_uart_src",
  572. .parent_names = gcc_pxo_pll8,
  573. .num_parents = 2,
  574. .ops = &clk_rcg_ops,
  575. .flags = CLK_SET_PARENT_GATE,
  576. },
  577. },
  578. };
  579. static struct clk_branch gsbi9_uart_clk = {
  580. .halt_reg = 0x2fd0,
  581. .halt_bit = 6,
  582. .clkr = {
  583. .enable_reg = 0x2ad4,
  584. .enable_mask = BIT(9),
  585. .hw.init = &(struct clk_init_data){
  586. .name = "gsbi9_uart_clk",
  587. .parent_names = (const char *[]){ "gsbi9_uart_src" },
  588. .num_parents = 1,
  589. .ops = &clk_branch_ops,
  590. .flags = CLK_SET_RATE_PARENT,
  591. },
  592. },
  593. };
  594. static struct clk_rcg gsbi10_uart_src = {
  595. .ns_reg = 0x2af4,
  596. .md_reg = 0x2af0,
  597. .mn = {
  598. .mnctr_en_bit = 8,
  599. .mnctr_reset_bit = 7,
  600. .mnctr_mode_shift = 5,
  601. .n_val_shift = 16,
  602. .m_val_shift = 16,
  603. .width = 16,
  604. },
  605. .p = {
  606. .pre_div_shift = 3,
  607. .pre_div_width = 2,
  608. },
  609. .s = {
  610. .src_sel_shift = 0,
  611. .parent_map = gcc_pxo_pll8_map,
  612. },
  613. .freq_tbl = clk_tbl_gsbi_uart,
  614. .clkr = {
  615. .enable_reg = 0x2af4,
  616. .enable_mask = BIT(11),
  617. .hw.init = &(struct clk_init_data){
  618. .name = "gsbi10_uart_src",
  619. .parent_names = gcc_pxo_pll8,
  620. .num_parents = 2,
  621. .ops = &clk_rcg_ops,
  622. .flags = CLK_SET_PARENT_GATE,
  623. },
  624. },
  625. };
  626. static struct clk_branch gsbi10_uart_clk = {
  627. .halt_reg = 0x2fd0,
  628. .halt_bit = 2,
  629. .clkr = {
  630. .enable_reg = 0x2af4,
  631. .enable_mask = BIT(9),
  632. .hw.init = &(struct clk_init_data){
  633. .name = "gsbi10_uart_clk",
  634. .parent_names = (const char *[]){ "gsbi10_uart_src" },
  635. .num_parents = 1,
  636. .ops = &clk_branch_ops,
  637. .flags = CLK_SET_RATE_PARENT,
  638. },
  639. },
  640. };
  641. static struct clk_rcg gsbi11_uart_src = {
  642. .ns_reg = 0x2b14,
  643. .md_reg = 0x2b10,
  644. .mn = {
  645. .mnctr_en_bit = 8,
  646. .mnctr_reset_bit = 7,
  647. .mnctr_mode_shift = 5,
  648. .n_val_shift = 16,
  649. .m_val_shift = 16,
  650. .width = 16,
  651. },
  652. .p = {
  653. .pre_div_shift = 3,
  654. .pre_div_width = 2,
  655. },
  656. .s = {
  657. .src_sel_shift = 0,
  658. .parent_map = gcc_pxo_pll8_map,
  659. },
  660. .freq_tbl = clk_tbl_gsbi_uart,
  661. .clkr = {
  662. .enable_reg = 0x2b14,
  663. .enable_mask = BIT(11),
  664. .hw.init = &(struct clk_init_data){
  665. .name = "gsbi11_uart_src",
  666. .parent_names = gcc_pxo_pll8,
  667. .num_parents = 2,
  668. .ops = &clk_rcg_ops,
  669. .flags = CLK_SET_PARENT_GATE,
  670. },
  671. },
  672. };
  673. static struct clk_branch gsbi11_uart_clk = {
  674. .halt_reg = 0x2fd4,
  675. .halt_bit = 17,
  676. .clkr = {
  677. .enable_reg = 0x2b14,
  678. .enable_mask = BIT(9),
  679. .hw.init = &(struct clk_init_data){
  680. .name = "gsbi11_uart_clk",
  681. .parent_names = (const char *[]){ "gsbi11_uart_src" },
  682. .num_parents = 1,
  683. .ops = &clk_branch_ops,
  684. .flags = CLK_SET_RATE_PARENT,
  685. },
  686. },
  687. };
  688. static struct clk_rcg gsbi12_uart_src = {
  689. .ns_reg = 0x2b34,
  690. .md_reg = 0x2b30,
  691. .mn = {
  692. .mnctr_en_bit = 8,
  693. .mnctr_reset_bit = 7,
  694. .mnctr_mode_shift = 5,
  695. .n_val_shift = 16,
  696. .m_val_shift = 16,
  697. .width = 16,
  698. },
  699. .p = {
  700. .pre_div_shift = 3,
  701. .pre_div_width = 2,
  702. },
  703. .s = {
  704. .src_sel_shift = 0,
  705. .parent_map = gcc_pxo_pll8_map,
  706. },
  707. .freq_tbl = clk_tbl_gsbi_uart,
  708. .clkr = {
  709. .enable_reg = 0x2b34,
  710. .enable_mask = BIT(11),
  711. .hw.init = &(struct clk_init_data){
  712. .name = "gsbi12_uart_src",
  713. .parent_names = gcc_pxo_pll8,
  714. .num_parents = 2,
  715. .ops = &clk_rcg_ops,
  716. .flags = CLK_SET_PARENT_GATE,
  717. },
  718. },
  719. };
  720. static struct clk_branch gsbi12_uart_clk = {
  721. .halt_reg = 0x2fd4,
  722. .halt_bit = 13,
  723. .clkr = {
  724. .enable_reg = 0x2b34,
  725. .enable_mask = BIT(9),
  726. .hw.init = &(struct clk_init_data){
  727. .name = "gsbi12_uart_clk",
  728. .parent_names = (const char *[]){ "gsbi12_uart_src" },
  729. .num_parents = 1,
  730. .ops = &clk_branch_ops,
  731. .flags = CLK_SET_RATE_PARENT,
  732. },
  733. },
  734. };
  735. static struct freq_tbl clk_tbl_gsbi_qup[] = {
  736. { 1100000, P_PXO, 1, 2, 49 },
  737. { 5400000, P_PXO, 1, 1, 5 },
  738. { 10800000, P_PXO, 1, 2, 5 },
  739. { 15060000, P_PLL8, 1, 2, 51 },
  740. { 24000000, P_PLL8, 4, 1, 4 },
  741. { 25600000, P_PLL8, 1, 1, 15 },
  742. { 27000000, P_PXO, 1, 0, 0 },
  743. { 48000000, P_PLL8, 4, 1, 2 },
  744. { 51200000, P_PLL8, 1, 2, 15 },
  745. { }
  746. };
  747. static struct clk_rcg gsbi1_qup_src = {
  748. .ns_reg = 0x29cc,
  749. .md_reg = 0x29c8,
  750. .mn = {
  751. .mnctr_en_bit = 8,
  752. .mnctr_reset_bit = 7,
  753. .mnctr_mode_shift = 5,
  754. .n_val_shift = 16,
  755. .m_val_shift = 16,
  756. .width = 8,
  757. },
  758. .p = {
  759. .pre_div_shift = 3,
  760. .pre_div_width = 2,
  761. },
  762. .s = {
  763. .src_sel_shift = 0,
  764. .parent_map = gcc_pxo_pll8_map,
  765. },
  766. .freq_tbl = clk_tbl_gsbi_qup,
  767. .clkr = {
  768. .enable_reg = 0x29cc,
  769. .enable_mask = BIT(11),
  770. .hw.init = &(struct clk_init_data){
  771. .name = "gsbi1_qup_src",
  772. .parent_names = gcc_pxo_pll8,
  773. .num_parents = 2,
  774. .ops = &clk_rcg_ops,
  775. .flags = CLK_SET_PARENT_GATE,
  776. },
  777. },
  778. };
  779. static struct clk_branch gsbi1_qup_clk = {
  780. .halt_reg = 0x2fcc,
  781. .halt_bit = 9,
  782. .clkr = {
  783. .enable_reg = 0x29cc,
  784. .enable_mask = BIT(9),
  785. .hw.init = &(struct clk_init_data){
  786. .name = "gsbi1_qup_clk",
  787. .parent_names = (const char *[]){ "gsbi1_qup_src" },
  788. .num_parents = 1,
  789. .ops = &clk_branch_ops,
  790. .flags = CLK_SET_RATE_PARENT,
  791. },
  792. },
  793. };
  794. static struct clk_rcg gsbi2_qup_src = {
  795. .ns_reg = 0x29ec,
  796. .md_reg = 0x29e8,
  797. .mn = {
  798. .mnctr_en_bit = 8,
  799. .mnctr_reset_bit = 7,
  800. .mnctr_mode_shift = 5,
  801. .n_val_shift = 16,
  802. .m_val_shift = 16,
  803. .width = 8,
  804. },
  805. .p = {
  806. .pre_div_shift = 3,
  807. .pre_div_width = 2,
  808. },
  809. .s = {
  810. .src_sel_shift = 0,
  811. .parent_map = gcc_pxo_pll8_map,
  812. },
  813. .freq_tbl = clk_tbl_gsbi_qup,
  814. .clkr = {
  815. .enable_reg = 0x29ec,
  816. .enable_mask = BIT(11),
  817. .hw.init = &(struct clk_init_data){
  818. .name = "gsbi2_qup_src",
  819. .parent_names = gcc_pxo_pll8,
  820. .num_parents = 2,
  821. .ops = &clk_rcg_ops,
  822. .flags = CLK_SET_PARENT_GATE,
  823. },
  824. },
  825. };
  826. static struct clk_branch gsbi2_qup_clk = {
  827. .halt_reg = 0x2fcc,
  828. .halt_bit = 4,
  829. .clkr = {
  830. .enable_reg = 0x29ec,
  831. .enable_mask = BIT(9),
  832. .hw.init = &(struct clk_init_data){
  833. .name = "gsbi2_qup_clk",
  834. .parent_names = (const char *[]){ "gsbi2_qup_src" },
  835. .num_parents = 1,
  836. .ops = &clk_branch_ops,
  837. .flags = CLK_SET_RATE_PARENT,
  838. },
  839. },
  840. };
  841. static struct clk_rcg gsbi3_qup_src = {
  842. .ns_reg = 0x2a0c,
  843. .md_reg = 0x2a08,
  844. .mn = {
  845. .mnctr_en_bit = 8,
  846. .mnctr_reset_bit = 7,
  847. .mnctr_mode_shift = 5,
  848. .n_val_shift = 16,
  849. .m_val_shift = 16,
  850. .width = 8,
  851. },
  852. .p = {
  853. .pre_div_shift = 3,
  854. .pre_div_width = 2,
  855. },
  856. .s = {
  857. .src_sel_shift = 0,
  858. .parent_map = gcc_pxo_pll8_map,
  859. },
  860. .freq_tbl = clk_tbl_gsbi_qup,
  861. .clkr = {
  862. .enable_reg = 0x2a0c,
  863. .enable_mask = BIT(11),
  864. .hw.init = &(struct clk_init_data){
  865. .name = "gsbi3_qup_src",
  866. .parent_names = gcc_pxo_pll8,
  867. .num_parents = 2,
  868. .ops = &clk_rcg_ops,
  869. .flags = CLK_SET_PARENT_GATE,
  870. },
  871. },
  872. };
  873. static struct clk_branch gsbi3_qup_clk = {
  874. .halt_reg = 0x2fcc,
  875. .halt_bit = 0,
  876. .clkr = {
  877. .enable_reg = 0x2a0c,
  878. .enable_mask = BIT(9),
  879. .hw.init = &(struct clk_init_data){
  880. .name = "gsbi3_qup_clk",
  881. .parent_names = (const char *[]){ "gsbi3_qup_src" },
  882. .num_parents = 1,
  883. .ops = &clk_branch_ops,
  884. .flags = CLK_SET_RATE_PARENT,
  885. },
  886. },
  887. };
  888. static struct clk_rcg gsbi4_qup_src = {
  889. .ns_reg = 0x2a2c,
  890. .md_reg = 0x2a28,
  891. .mn = {
  892. .mnctr_en_bit = 8,
  893. .mnctr_reset_bit = 7,
  894. .mnctr_mode_shift = 5,
  895. .n_val_shift = 16,
  896. .m_val_shift = 16,
  897. .width = 8,
  898. },
  899. .p = {
  900. .pre_div_shift = 3,
  901. .pre_div_width = 2,
  902. },
  903. .s = {
  904. .src_sel_shift = 0,
  905. .parent_map = gcc_pxo_pll8_map,
  906. },
  907. .freq_tbl = clk_tbl_gsbi_qup,
  908. .clkr = {
  909. .enable_reg = 0x2a2c,
  910. .enable_mask = BIT(11),
  911. .hw.init = &(struct clk_init_data){
  912. .name = "gsbi4_qup_src",
  913. .parent_names = gcc_pxo_pll8,
  914. .num_parents = 2,
  915. .ops = &clk_rcg_ops,
  916. .flags = CLK_SET_PARENT_GATE,
  917. },
  918. },
  919. };
  920. static struct clk_branch gsbi4_qup_clk = {
  921. .halt_reg = 0x2fd0,
  922. .halt_bit = 24,
  923. .clkr = {
  924. .enable_reg = 0x2a2c,
  925. .enable_mask = BIT(9),
  926. .hw.init = &(struct clk_init_data){
  927. .name = "gsbi4_qup_clk",
  928. .parent_names = (const char *[]){ "gsbi4_qup_src" },
  929. .num_parents = 1,
  930. .ops = &clk_branch_ops,
  931. .flags = CLK_SET_RATE_PARENT,
  932. },
  933. },
  934. };
  935. static struct clk_rcg gsbi5_qup_src = {
  936. .ns_reg = 0x2a4c,
  937. .md_reg = 0x2a48,
  938. .mn = {
  939. .mnctr_en_bit = 8,
  940. .mnctr_reset_bit = 7,
  941. .mnctr_mode_shift = 5,
  942. .n_val_shift = 16,
  943. .m_val_shift = 16,
  944. .width = 8,
  945. },
  946. .p = {
  947. .pre_div_shift = 3,
  948. .pre_div_width = 2,
  949. },
  950. .s = {
  951. .src_sel_shift = 0,
  952. .parent_map = gcc_pxo_pll8_map,
  953. },
  954. .freq_tbl = clk_tbl_gsbi_qup,
  955. .clkr = {
  956. .enable_reg = 0x2a4c,
  957. .enable_mask = BIT(11),
  958. .hw.init = &(struct clk_init_data){
  959. .name = "gsbi5_qup_src",
  960. .parent_names = gcc_pxo_pll8,
  961. .num_parents = 2,
  962. .ops = &clk_rcg_ops,
  963. .flags = CLK_SET_PARENT_GATE,
  964. },
  965. },
  966. };
  967. static struct clk_branch gsbi5_qup_clk = {
  968. .halt_reg = 0x2fd0,
  969. .halt_bit = 20,
  970. .clkr = {
  971. .enable_reg = 0x2a4c,
  972. .enable_mask = BIT(9),
  973. .hw.init = &(struct clk_init_data){
  974. .name = "gsbi5_qup_clk",
  975. .parent_names = (const char *[]){ "gsbi5_qup_src" },
  976. .num_parents = 1,
  977. .ops = &clk_branch_ops,
  978. .flags = CLK_SET_RATE_PARENT,
  979. },
  980. },
  981. };
  982. static struct clk_rcg gsbi6_qup_src = {
  983. .ns_reg = 0x2a6c,
  984. .md_reg = 0x2a68,
  985. .mn = {
  986. .mnctr_en_bit = 8,
  987. .mnctr_reset_bit = 7,
  988. .mnctr_mode_shift = 5,
  989. .n_val_shift = 16,
  990. .m_val_shift = 16,
  991. .width = 8,
  992. },
  993. .p = {
  994. .pre_div_shift = 3,
  995. .pre_div_width = 2,
  996. },
  997. .s = {
  998. .src_sel_shift = 0,
  999. .parent_map = gcc_pxo_pll8_map,
  1000. },
  1001. .freq_tbl = clk_tbl_gsbi_qup,
  1002. .clkr = {
  1003. .enable_reg = 0x2a6c,
  1004. .enable_mask = BIT(11),
  1005. .hw.init = &(struct clk_init_data){
  1006. .name = "gsbi6_qup_src",
  1007. .parent_names = gcc_pxo_pll8,
  1008. .num_parents = 2,
  1009. .ops = &clk_rcg_ops,
  1010. .flags = CLK_SET_PARENT_GATE,
  1011. },
  1012. },
  1013. };
  1014. static struct clk_branch gsbi6_qup_clk = {
  1015. .halt_reg = 0x2fd0,
  1016. .halt_bit = 16,
  1017. .clkr = {
  1018. .enable_reg = 0x2a6c,
  1019. .enable_mask = BIT(9),
  1020. .hw.init = &(struct clk_init_data){
  1021. .name = "gsbi6_qup_clk",
  1022. .parent_names = (const char *[]){ "gsbi6_qup_src" },
  1023. .num_parents = 1,
  1024. .ops = &clk_branch_ops,
  1025. .flags = CLK_SET_RATE_PARENT,
  1026. },
  1027. },
  1028. };
  1029. static struct clk_rcg gsbi7_qup_src = {
  1030. .ns_reg = 0x2a8c,
  1031. .md_reg = 0x2a88,
  1032. .mn = {
  1033. .mnctr_en_bit = 8,
  1034. .mnctr_reset_bit = 7,
  1035. .mnctr_mode_shift = 5,
  1036. .n_val_shift = 16,
  1037. .m_val_shift = 16,
  1038. .width = 8,
  1039. },
  1040. .p = {
  1041. .pre_div_shift = 3,
  1042. .pre_div_width = 2,
  1043. },
  1044. .s = {
  1045. .src_sel_shift = 0,
  1046. .parent_map = gcc_pxo_pll8_map,
  1047. },
  1048. .freq_tbl = clk_tbl_gsbi_qup,
  1049. .clkr = {
  1050. .enable_reg = 0x2a8c,
  1051. .enable_mask = BIT(11),
  1052. .hw.init = &(struct clk_init_data){
  1053. .name = "gsbi7_qup_src",
  1054. .parent_names = gcc_pxo_pll8,
  1055. .num_parents = 2,
  1056. .ops = &clk_rcg_ops,
  1057. .flags = CLK_SET_PARENT_GATE,
  1058. },
  1059. },
  1060. };
  1061. static struct clk_branch gsbi7_qup_clk = {
  1062. .halt_reg = 0x2fd0,
  1063. .halt_bit = 12,
  1064. .clkr = {
  1065. .enable_reg = 0x2a8c,
  1066. .enable_mask = BIT(9),
  1067. .hw.init = &(struct clk_init_data){
  1068. .name = "gsbi7_qup_clk",
  1069. .parent_names = (const char *[]){ "gsbi7_qup_src" },
  1070. .num_parents = 1,
  1071. .ops = &clk_branch_ops,
  1072. .flags = CLK_SET_RATE_PARENT,
  1073. },
  1074. },
  1075. };
  1076. static struct clk_rcg gsbi8_qup_src = {
  1077. .ns_reg = 0x2aac,
  1078. .md_reg = 0x2aa8,
  1079. .mn = {
  1080. .mnctr_en_bit = 8,
  1081. .mnctr_reset_bit = 7,
  1082. .mnctr_mode_shift = 5,
  1083. .n_val_shift = 16,
  1084. .m_val_shift = 16,
  1085. .width = 8,
  1086. },
  1087. .p = {
  1088. .pre_div_shift = 3,
  1089. .pre_div_width = 2,
  1090. },
  1091. .s = {
  1092. .src_sel_shift = 0,
  1093. .parent_map = gcc_pxo_pll8_map,
  1094. },
  1095. .freq_tbl = clk_tbl_gsbi_qup,
  1096. .clkr = {
  1097. .enable_reg = 0x2aac,
  1098. .enable_mask = BIT(11),
  1099. .hw.init = &(struct clk_init_data){
  1100. .name = "gsbi8_qup_src",
  1101. .parent_names = gcc_pxo_pll8,
  1102. .num_parents = 2,
  1103. .ops = &clk_rcg_ops,
  1104. .flags = CLK_SET_PARENT_GATE,
  1105. },
  1106. },
  1107. };
  1108. static struct clk_branch gsbi8_qup_clk = {
  1109. .halt_reg = 0x2fd0,
  1110. .halt_bit = 8,
  1111. .clkr = {
  1112. .enable_reg = 0x2aac,
  1113. .enable_mask = BIT(9),
  1114. .hw.init = &(struct clk_init_data){
  1115. .name = "gsbi8_qup_clk",
  1116. .parent_names = (const char *[]){ "gsbi8_qup_src" },
  1117. .num_parents = 1,
  1118. .ops = &clk_branch_ops,
  1119. .flags = CLK_SET_RATE_PARENT,
  1120. },
  1121. },
  1122. };
  1123. static struct clk_rcg gsbi9_qup_src = {
  1124. .ns_reg = 0x2acc,
  1125. .md_reg = 0x2ac8,
  1126. .mn = {
  1127. .mnctr_en_bit = 8,
  1128. .mnctr_reset_bit = 7,
  1129. .mnctr_mode_shift = 5,
  1130. .n_val_shift = 16,
  1131. .m_val_shift = 16,
  1132. .width = 8,
  1133. },
  1134. .p = {
  1135. .pre_div_shift = 3,
  1136. .pre_div_width = 2,
  1137. },
  1138. .s = {
  1139. .src_sel_shift = 0,
  1140. .parent_map = gcc_pxo_pll8_map,
  1141. },
  1142. .freq_tbl = clk_tbl_gsbi_qup,
  1143. .clkr = {
  1144. .enable_reg = 0x2acc,
  1145. .enable_mask = BIT(11),
  1146. .hw.init = &(struct clk_init_data){
  1147. .name = "gsbi9_qup_src",
  1148. .parent_names = gcc_pxo_pll8,
  1149. .num_parents = 2,
  1150. .ops = &clk_rcg_ops,
  1151. .flags = CLK_SET_PARENT_GATE,
  1152. },
  1153. },
  1154. };
  1155. static struct clk_branch gsbi9_qup_clk = {
  1156. .halt_reg = 0x2fd0,
  1157. .halt_bit = 4,
  1158. .clkr = {
  1159. .enable_reg = 0x2acc,
  1160. .enable_mask = BIT(9),
  1161. .hw.init = &(struct clk_init_data){
  1162. .name = "gsbi9_qup_clk",
  1163. .parent_names = (const char *[]){ "gsbi9_qup_src" },
  1164. .num_parents = 1,
  1165. .ops = &clk_branch_ops,
  1166. .flags = CLK_SET_RATE_PARENT,
  1167. },
  1168. },
  1169. };
  1170. static struct clk_rcg gsbi10_qup_src = {
  1171. .ns_reg = 0x2aec,
  1172. .md_reg = 0x2ae8,
  1173. .mn = {
  1174. .mnctr_en_bit = 8,
  1175. .mnctr_reset_bit = 7,
  1176. .mnctr_mode_shift = 5,
  1177. .n_val_shift = 16,
  1178. .m_val_shift = 16,
  1179. .width = 8,
  1180. },
  1181. .p = {
  1182. .pre_div_shift = 3,
  1183. .pre_div_width = 2,
  1184. },
  1185. .s = {
  1186. .src_sel_shift = 0,
  1187. .parent_map = gcc_pxo_pll8_map,
  1188. },
  1189. .freq_tbl = clk_tbl_gsbi_qup,
  1190. .clkr = {
  1191. .enable_reg = 0x2aec,
  1192. .enable_mask = BIT(11),
  1193. .hw.init = &(struct clk_init_data){
  1194. .name = "gsbi10_qup_src",
  1195. .parent_names = gcc_pxo_pll8,
  1196. .num_parents = 2,
  1197. .ops = &clk_rcg_ops,
  1198. .flags = CLK_SET_PARENT_GATE,
  1199. },
  1200. },
  1201. };
  1202. static struct clk_branch gsbi10_qup_clk = {
  1203. .halt_reg = 0x2fd0,
  1204. .halt_bit = 0,
  1205. .clkr = {
  1206. .enable_reg = 0x2aec,
  1207. .enable_mask = BIT(9),
  1208. .hw.init = &(struct clk_init_data){
  1209. .name = "gsbi10_qup_clk",
  1210. .parent_names = (const char *[]){ "gsbi10_qup_src" },
  1211. .num_parents = 1,
  1212. .ops = &clk_branch_ops,
  1213. .flags = CLK_SET_RATE_PARENT,
  1214. },
  1215. },
  1216. };
  1217. static struct clk_rcg gsbi11_qup_src = {
  1218. .ns_reg = 0x2b0c,
  1219. .md_reg = 0x2b08,
  1220. .mn = {
  1221. .mnctr_en_bit = 8,
  1222. .mnctr_reset_bit = 7,
  1223. .mnctr_mode_shift = 5,
  1224. .n_val_shift = 16,
  1225. .m_val_shift = 16,
  1226. .width = 8,
  1227. },
  1228. .p = {
  1229. .pre_div_shift = 3,
  1230. .pre_div_width = 2,
  1231. },
  1232. .s = {
  1233. .src_sel_shift = 0,
  1234. .parent_map = gcc_pxo_pll8_map,
  1235. },
  1236. .freq_tbl = clk_tbl_gsbi_qup,
  1237. .clkr = {
  1238. .enable_reg = 0x2b0c,
  1239. .enable_mask = BIT(11),
  1240. .hw.init = &(struct clk_init_data){
  1241. .name = "gsbi11_qup_src",
  1242. .parent_names = gcc_pxo_pll8,
  1243. .num_parents = 2,
  1244. .ops = &clk_rcg_ops,
  1245. .flags = CLK_SET_PARENT_GATE,
  1246. },
  1247. },
  1248. };
  1249. static struct clk_branch gsbi11_qup_clk = {
  1250. .halt_reg = 0x2fd4,
  1251. .halt_bit = 15,
  1252. .clkr = {
  1253. .enable_reg = 0x2b0c,
  1254. .enable_mask = BIT(9),
  1255. .hw.init = &(struct clk_init_data){
  1256. .name = "gsbi11_qup_clk",
  1257. .parent_names = (const char *[]){ "gsbi11_qup_src" },
  1258. .num_parents = 1,
  1259. .ops = &clk_branch_ops,
  1260. .flags = CLK_SET_RATE_PARENT,
  1261. },
  1262. },
  1263. };
  1264. static struct clk_rcg gsbi12_qup_src = {
  1265. .ns_reg = 0x2b2c,
  1266. .md_reg = 0x2b28,
  1267. .mn = {
  1268. .mnctr_en_bit = 8,
  1269. .mnctr_reset_bit = 7,
  1270. .mnctr_mode_shift = 5,
  1271. .n_val_shift = 16,
  1272. .m_val_shift = 16,
  1273. .width = 8,
  1274. },
  1275. .p = {
  1276. .pre_div_shift = 3,
  1277. .pre_div_width = 2,
  1278. },
  1279. .s = {
  1280. .src_sel_shift = 0,
  1281. .parent_map = gcc_pxo_pll8_map,
  1282. },
  1283. .freq_tbl = clk_tbl_gsbi_qup,
  1284. .clkr = {
  1285. .enable_reg = 0x2b2c,
  1286. .enable_mask = BIT(11),
  1287. .hw.init = &(struct clk_init_data){
  1288. .name = "gsbi12_qup_src",
  1289. .parent_names = gcc_pxo_pll8,
  1290. .num_parents = 2,
  1291. .ops = &clk_rcg_ops,
  1292. .flags = CLK_SET_PARENT_GATE,
  1293. },
  1294. },
  1295. };
  1296. static struct clk_branch gsbi12_qup_clk = {
  1297. .halt_reg = 0x2fd4,
  1298. .halt_bit = 11,
  1299. .clkr = {
  1300. .enable_reg = 0x2b2c,
  1301. .enable_mask = BIT(9),
  1302. .hw.init = &(struct clk_init_data){
  1303. .name = "gsbi12_qup_clk",
  1304. .parent_names = (const char *[]){ "gsbi12_qup_src" },
  1305. .num_parents = 1,
  1306. .ops = &clk_branch_ops,
  1307. .flags = CLK_SET_RATE_PARENT,
  1308. },
  1309. },
  1310. };
  1311. static const struct freq_tbl clk_tbl_gp[] = {
  1312. { 9600000, P_CXO, 2, 0, 0 },
  1313. { 13500000, P_PXO, 2, 0, 0 },
  1314. { 19200000, P_CXO, 1, 0, 0 },
  1315. { 27000000, P_PXO, 1, 0, 0 },
  1316. { 64000000, P_PLL8, 2, 1, 3 },
  1317. { 76800000, P_PLL8, 1, 1, 5 },
  1318. { 96000000, P_PLL8, 4, 0, 0 },
  1319. { 128000000, P_PLL8, 3, 0, 0 },
  1320. { 192000000, P_PLL8, 2, 0, 0 },
  1321. { }
  1322. };
  1323. static struct clk_rcg gp0_src = {
  1324. .ns_reg = 0x2d24,
  1325. .md_reg = 0x2d00,
  1326. .mn = {
  1327. .mnctr_en_bit = 8,
  1328. .mnctr_reset_bit = 7,
  1329. .mnctr_mode_shift = 5,
  1330. .n_val_shift = 16,
  1331. .m_val_shift = 16,
  1332. .width = 8,
  1333. },
  1334. .p = {
  1335. .pre_div_shift = 3,
  1336. .pre_div_width = 2,
  1337. },
  1338. .s = {
  1339. .src_sel_shift = 0,
  1340. .parent_map = gcc_pxo_pll8_cxo_map,
  1341. },
  1342. .freq_tbl = clk_tbl_gp,
  1343. .clkr = {
  1344. .enable_reg = 0x2d24,
  1345. .enable_mask = BIT(11),
  1346. .hw.init = &(struct clk_init_data){
  1347. .name = "gp0_src",
  1348. .parent_names = gcc_pxo_pll8_cxo,
  1349. .num_parents = 3,
  1350. .ops = &clk_rcg_ops,
  1351. .flags = CLK_SET_PARENT_GATE,
  1352. },
  1353. }
  1354. };
  1355. static struct clk_branch gp0_clk = {
  1356. .halt_reg = 0x2fd8,
  1357. .halt_bit = 7,
  1358. .clkr = {
  1359. .enable_reg = 0x2d24,
  1360. .enable_mask = BIT(9),
  1361. .hw.init = &(struct clk_init_data){
  1362. .name = "gp0_clk",
  1363. .parent_names = (const char *[]){ "gp0_src" },
  1364. .num_parents = 1,
  1365. .ops = &clk_branch_ops,
  1366. .flags = CLK_SET_RATE_PARENT,
  1367. },
  1368. },
  1369. };
  1370. static struct clk_rcg gp1_src = {
  1371. .ns_reg = 0x2d44,
  1372. .md_reg = 0x2d40,
  1373. .mn = {
  1374. .mnctr_en_bit = 8,
  1375. .mnctr_reset_bit = 7,
  1376. .mnctr_mode_shift = 5,
  1377. .n_val_shift = 16,
  1378. .m_val_shift = 16,
  1379. .width = 8,
  1380. },
  1381. .p = {
  1382. .pre_div_shift = 3,
  1383. .pre_div_width = 2,
  1384. },
  1385. .s = {
  1386. .src_sel_shift = 0,
  1387. .parent_map = gcc_pxo_pll8_cxo_map,
  1388. },
  1389. .freq_tbl = clk_tbl_gp,
  1390. .clkr = {
  1391. .enable_reg = 0x2d44,
  1392. .enable_mask = BIT(11),
  1393. .hw.init = &(struct clk_init_data){
  1394. .name = "gp1_src",
  1395. .parent_names = gcc_pxo_pll8_cxo,
  1396. .num_parents = 3,
  1397. .ops = &clk_rcg_ops,
  1398. .flags = CLK_SET_RATE_GATE,
  1399. },
  1400. }
  1401. };
  1402. static struct clk_branch gp1_clk = {
  1403. .halt_reg = 0x2fd8,
  1404. .halt_bit = 6,
  1405. .clkr = {
  1406. .enable_reg = 0x2d44,
  1407. .enable_mask = BIT(9),
  1408. .hw.init = &(struct clk_init_data){
  1409. .name = "gp1_clk",
  1410. .parent_names = (const char *[]){ "gp1_src" },
  1411. .num_parents = 1,
  1412. .ops = &clk_branch_ops,
  1413. .flags = CLK_SET_RATE_PARENT,
  1414. },
  1415. },
  1416. };
  1417. static struct clk_rcg gp2_src = {
  1418. .ns_reg = 0x2d64,
  1419. .md_reg = 0x2d60,
  1420. .mn = {
  1421. .mnctr_en_bit = 8,
  1422. .mnctr_reset_bit = 7,
  1423. .mnctr_mode_shift = 5,
  1424. .n_val_shift = 16,
  1425. .m_val_shift = 16,
  1426. .width = 8,
  1427. },
  1428. .p = {
  1429. .pre_div_shift = 3,
  1430. .pre_div_width = 2,
  1431. },
  1432. .s = {
  1433. .src_sel_shift = 0,
  1434. .parent_map = gcc_pxo_pll8_cxo_map,
  1435. },
  1436. .freq_tbl = clk_tbl_gp,
  1437. .clkr = {
  1438. .enable_reg = 0x2d64,
  1439. .enable_mask = BIT(11),
  1440. .hw.init = &(struct clk_init_data){
  1441. .name = "gp2_src",
  1442. .parent_names = gcc_pxo_pll8_cxo,
  1443. .num_parents = 3,
  1444. .ops = &clk_rcg_ops,
  1445. .flags = CLK_SET_RATE_GATE,
  1446. },
  1447. }
  1448. };
  1449. static struct clk_branch gp2_clk = {
  1450. .halt_reg = 0x2fd8,
  1451. .halt_bit = 5,
  1452. .clkr = {
  1453. .enable_reg = 0x2d64,
  1454. .enable_mask = BIT(9),
  1455. .hw.init = &(struct clk_init_data){
  1456. .name = "gp2_clk",
  1457. .parent_names = (const char *[]){ "gp2_src" },
  1458. .num_parents = 1,
  1459. .ops = &clk_branch_ops,
  1460. .flags = CLK_SET_RATE_PARENT,
  1461. },
  1462. },
  1463. };
  1464. static struct clk_branch pmem_clk = {
  1465. .hwcg_reg = 0x25a0,
  1466. .hwcg_bit = 6,
  1467. .halt_reg = 0x2fc8,
  1468. .halt_bit = 20,
  1469. .clkr = {
  1470. .enable_reg = 0x25a0,
  1471. .enable_mask = BIT(4),
  1472. .hw.init = &(struct clk_init_data){
  1473. .name = "pmem_clk",
  1474. .ops = &clk_branch_ops,
  1475. .flags = CLK_IS_ROOT,
  1476. },
  1477. },
  1478. };
  1479. static struct clk_rcg prng_src = {
  1480. .ns_reg = 0x2e80,
  1481. .p = {
  1482. .pre_div_shift = 3,
  1483. .pre_div_width = 4,
  1484. },
  1485. .s = {
  1486. .src_sel_shift = 0,
  1487. .parent_map = gcc_pxo_pll8_map,
  1488. },
  1489. .clkr = {
  1490. .hw.init = &(struct clk_init_data){
  1491. .name = "prng_src",
  1492. .parent_names = gcc_pxo_pll8,
  1493. .num_parents = 2,
  1494. .ops = &clk_rcg_ops,
  1495. },
  1496. },
  1497. };
  1498. static struct clk_branch prng_clk = {
  1499. .halt_reg = 0x2fd8,
  1500. .halt_check = BRANCH_HALT_VOTED,
  1501. .halt_bit = 10,
  1502. .clkr = {
  1503. .enable_reg = 0x3080,
  1504. .enable_mask = BIT(10),
  1505. .hw.init = &(struct clk_init_data){
  1506. .name = "prng_clk",
  1507. .parent_names = (const char *[]){ "prng_src" },
  1508. .num_parents = 1,
  1509. .ops = &clk_branch_ops,
  1510. },
  1511. },
  1512. };
  1513. static const struct freq_tbl clk_tbl_sdc[] = {
  1514. { 144000, P_PXO, 3, 2, 125 },
  1515. { 400000, P_PLL8, 4, 1, 240 },
  1516. { 16000000, P_PLL8, 4, 1, 6 },
  1517. { 17070000, P_PLL8, 1, 2, 45 },
  1518. { 20210000, P_PLL8, 1, 1, 19 },
  1519. { 24000000, P_PLL8, 4, 1, 4 },
  1520. { 48000000, P_PLL8, 4, 1, 2 },
  1521. { 64000000, P_PLL8, 3, 1, 2 },
  1522. { 96000000, P_PLL8, 4, 0, 0 },
  1523. { 192000000, P_PLL8, 2, 0, 0 },
  1524. { }
  1525. };
  1526. static struct clk_rcg sdc1_src = {
  1527. .ns_reg = 0x282c,
  1528. .md_reg = 0x2828,
  1529. .mn = {
  1530. .mnctr_en_bit = 8,
  1531. .mnctr_reset_bit = 7,
  1532. .mnctr_mode_shift = 5,
  1533. .n_val_shift = 16,
  1534. .m_val_shift = 16,
  1535. .width = 8,
  1536. },
  1537. .p = {
  1538. .pre_div_shift = 3,
  1539. .pre_div_width = 2,
  1540. },
  1541. .s = {
  1542. .src_sel_shift = 0,
  1543. .parent_map = gcc_pxo_pll8_map,
  1544. },
  1545. .freq_tbl = clk_tbl_sdc,
  1546. .clkr = {
  1547. .enable_reg = 0x282c,
  1548. .enable_mask = BIT(11),
  1549. .hw.init = &(struct clk_init_data){
  1550. .name = "sdc1_src",
  1551. .parent_names = gcc_pxo_pll8,
  1552. .num_parents = 2,
  1553. .ops = &clk_rcg_ops,
  1554. .flags = CLK_SET_RATE_GATE,
  1555. },
  1556. }
  1557. };
  1558. static struct clk_branch sdc1_clk = {
  1559. .halt_reg = 0x2fc8,
  1560. .halt_bit = 6,
  1561. .clkr = {
  1562. .enable_reg = 0x282c,
  1563. .enable_mask = BIT(9),
  1564. .hw.init = &(struct clk_init_data){
  1565. .name = "sdc1_clk",
  1566. .parent_names = (const char *[]){ "sdc1_src" },
  1567. .num_parents = 1,
  1568. .ops = &clk_branch_ops,
  1569. .flags = CLK_SET_RATE_PARENT,
  1570. },
  1571. },
  1572. };
  1573. static struct clk_rcg sdc2_src = {
  1574. .ns_reg = 0x284c,
  1575. .md_reg = 0x2848,
  1576. .mn = {
  1577. .mnctr_en_bit = 8,
  1578. .mnctr_reset_bit = 7,
  1579. .mnctr_mode_shift = 5,
  1580. .n_val_shift = 16,
  1581. .m_val_shift = 16,
  1582. .width = 8,
  1583. },
  1584. .p = {
  1585. .pre_div_shift = 3,
  1586. .pre_div_width = 2,
  1587. },
  1588. .s = {
  1589. .src_sel_shift = 0,
  1590. .parent_map = gcc_pxo_pll8_map,
  1591. },
  1592. .freq_tbl = clk_tbl_sdc,
  1593. .clkr = {
  1594. .enable_reg = 0x284c,
  1595. .enable_mask = BIT(11),
  1596. .hw.init = &(struct clk_init_data){
  1597. .name = "sdc2_src",
  1598. .parent_names = gcc_pxo_pll8,
  1599. .num_parents = 2,
  1600. .ops = &clk_rcg_ops,
  1601. .flags = CLK_SET_RATE_GATE,
  1602. },
  1603. }
  1604. };
  1605. static struct clk_branch sdc2_clk = {
  1606. .halt_reg = 0x2fc8,
  1607. .halt_bit = 5,
  1608. .clkr = {
  1609. .enable_reg = 0x284c,
  1610. .enable_mask = BIT(9),
  1611. .hw.init = &(struct clk_init_data){
  1612. .name = "sdc2_clk",
  1613. .parent_names = (const char *[]){ "sdc2_src" },
  1614. .num_parents = 1,
  1615. .ops = &clk_branch_ops,
  1616. .flags = CLK_SET_RATE_PARENT,
  1617. },
  1618. },
  1619. };
  1620. static struct clk_rcg sdc3_src = {
  1621. .ns_reg = 0x286c,
  1622. .md_reg = 0x2868,
  1623. .mn = {
  1624. .mnctr_en_bit = 8,
  1625. .mnctr_reset_bit = 7,
  1626. .mnctr_mode_shift = 5,
  1627. .n_val_shift = 16,
  1628. .m_val_shift = 16,
  1629. .width = 8,
  1630. },
  1631. .p = {
  1632. .pre_div_shift = 3,
  1633. .pre_div_width = 2,
  1634. },
  1635. .s = {
  1636. .src_sel_shift = 0,
  1637. .parent_map = gcc_pxo_pll8_map,
  1638. },
  1639. .freq_tbl = clk_tbl_sdc,
  1640. .clkr = {
  1641. .enable_reg = 0x286c,
  1642. .enable_mask = BIT(11),
  1643. .hw.init = &(struct clk_init_data){
  1644. .name = "sdc3_src",
  1645. .parent_names = gcc_pxo_pll8,
  1646. .num_parents = 2,
  1647. .ops = &clk_rcg_ops,
  1648. .flags = CLK_SET_RATE_GATE,
  1649. },
  1650. }
  1651. };
  1652. static struct clk_branch sdc3_clk = {
  1653. .halt_reg = 0x2fc8,
  1654. .halt_bit = 4,
  1655. .clkr = {
  1656. .enable_reg = 0x286c,
  1657. .enable_mask = BIT(9),
  1658. .hw.init = &(struct clk_init_data){
  1659. .name = "sdc3_clk",
  1660. .parent_names = (const char *[]){ "sdc3_src" },
  1661. .num_parents = 1,
  1662. .ops = &clk_branch_ops,
  1663. .flags = CLK_SET_RATE_PARENT,
  1664. },
  1665. },
  1666. };
  1667. static struct clk_rcg sdc4_src = {
  1668. .ns_reg = 0x288c,
  1669. .md_reg = 0x2888,
  1670. .mn = {
  1671. .mnctr_en_bit = 8,
  1672. .mnctr_reset_bit = 7,
  1673. .mnctr_mode_shift = 5,
  1674. .n_val_shift = 16,
  1675. .m_val_shift = 16,
  1676. .width = 8,
  1677. },
  1678. .p = {
  1679. .pre_div_shift = 3,
  1680. .pre_div_width = 2,
  1681. },
  1682. .s = {
  1683. .src_sel_shift = 0,
  1684. .parent_map = gcc_pxo_pll8_map,
  1685. },
  1686. .freq_tbl = clk_tbl_sdc,
  1687. .clkr = {
  1688. .enable_reg = 0x288c,
  1689. .enable_mask = BIT(11),
  1690. .hw.init = &(struct clk_init_data){
  1691. .name = "sdc4_src",
  1692. .parent_names = gcc_pxo_pll8,
  1693. .num_parents = 2,
  1694. .ops = &clk_rcg_ops,
  1695. .flags = CLK_SET_RATE_GATE,
  1696. },
  1697. }
  1698. };
  1699. static struct clk_branch sdc4_clk = {
  1700. .halt_reg = 0x2fc8,
  1701. .halt_bit = 3,
  1702. .clkr = {
  1703. .enable_reg = 0x288c,
  1704. .enable_mask = BIT(9),
  1705. .hw.init = &(struct clk_init_data){
  1706. .name = "sdc4_clk",
  1707. .parent_names = (const char *[]){ "sdc4_src" },
  1708. .num_parents = 1,
  1709. .ops = &clk_branch_ops,
  1710. .flags = CLK_SET_RATE_PARENT,
  1711. },
  1712. },
  1713. };
  1714. static struct clk_rcg sdc5_src = {
  1715. .ns_reg = 0x28ac,
  1716. .md_reg = 0x28a8,
  1717. .mn = {
  1718. .mnctr_en_bit = 8,
  1719. .mnctr_reset_bit = 7,
  1720. .mnctr_mode_shift = 5,
  1721. .n_val_shift = 16,
  1722. .m_val_shift = 16,
  1723. .width = 8,
  1724. },
  1725. .p = {
  1726. .pre_div_shift = 3,
  1727. .pre_div_width = 2,
  1728. },
  1729. .s = {
  1730. .src_sel_shift = 0,
  1731. .parent_map = gcc_pxo_pll8_map,
  1732. },
  1733. .freq_tbl = clk_tbl_sdc,
  1734. .clkr = {
  1735. .enable_reg = 0x28ac,
  1736. .enable_mask = BIT(11),
  1737. .hw.init = &(struct clk_init_data){
  1738. .name = "sdc5_src",
  1739. .parent_names = gcc_pxo_pll8,
  1740. .num_parents = 2,
  1741. .ops = &clk_rcg_ops,
  1742. .flags = CLK_SET_RATE_GATE,
  1743. },
  1744. }
  1745. };
  1746. static struct clk_branch sdc5_clk = {
  1747. .halt_reg = 0x2fc8,
  1748. .halt_bit = 2,
  1749. .clkr = {
  1750. .enable_reg = 0x28ac,
  1751. .enable_mask = BIT(9),
  1752. .hw.init = &(struct clk_init_data){
  1753. .name = "sdc5_clk",
  1754. .parent_names = (const char *[]){ "sdc5_src" },
  1755. .num_parents = 1,
  1756. .ops = &clk_branch_ops,
  1757. .flags = CLK_SET_RATE_PARENT,
  1758. },
  1759. },
  1760. };
  1761. static const struct freq_tbl clk_tbl_tsif_ref[] = {
  1762. { 105000, P_PXO, 1, 1, 256 },
  1763. { }
  1764. };
  1765. static struct clk_rcg tsif_ref_src = {
  1766. .ns_reg = 0x2710,
  1767. .md_reg = 0x270c,
  1768. .mn = {
  1769. .mnctr_en_bit = 8,
  1770. .mnctr_reset_bit = 7,
  1771. .mnctr_mode_shift = 5,
  1772. .n_val_shift = 16,
  1773. .m_val_shift = 16,
  1774. .width = 16,
  1775. },
  1776. .p = {
  1777. .pre_div_shift = 3,
  1778. .pre_div_width = 2,
  1779. },
  1780. .s = {
  1781. .src_sel_shift = 0,
  1782. .parent_map = gcc_pxo_pll8_map,
  1783. },
  1784. .freq_tbl = clk_tbl_tsif_ref,
  1785. .clkr = {
  1786. .enable_reg = 0x2710,
  1787. .enable_mask = BIT(11),
  1788. .hw.init = &(struct clk_init_data){
  1789. .name = "tsif_ref_src",
  1790. .parent_names = gcc_pxo_pll8,
  1791. .num_parents = 2,
  1792. .ops = &clk_rcg_ops,
  1793. .flags = CLK_SET_RATE_GATE,
  1794. },
  1795. }
  1796. };
  1797. static struct clk_branch tsif_ref_clk = {
  1798. .halt_reg = 0x2fd4,
  1799. .halt_bit = 5,
  1800. .clkr = {
  1801. .enable_reg = 0x2710,
  1802. .enable_mask = BIT(9),
  1803. .hw.init = &(struct clk_init_data){
  1804. .name = "tsif_ref_clk",
  1805. .parent_names = (const char *[]){ "tsif_ref_src" },
  1806. .num_parents = 1,
  1807. .ops = &clk_branch_ops,
  1808. .flags = CLK_SET_RATE_PARENT,
  1809. },
  1810. },
  1811. };
  1812. static const struct freq_tbl clk_tbl_usb[] = {
  1813. { 60000000, P_PLL8, 1, 5, 32 },
  1814. { }
  1815. };
  1816. static struct clk_rcg usb_hs1_xcvr_src = {
  1817. .ns_reg = 0x290c,
  1818. .md_reg = 0x2908,
  1819. .mn = {
  1820. .mnctr_en_bit = 8,
  1821. .mnctr_reset_bit = 7,
  1822. .mnctr_mode_shift = 5,
  1823. .n_val_shift = 16,
  1824. .m_val_shift = 16,
  1825. .width = 8,
  1826. },
  1827. .p = {
  1828. .pre_div_shift = 3,
  1829. .pre_div_width = 2,
  1830. },
  1831. .s = {
  1832. .src_sel_shift = 0,
  1833. .parent_map = gcc_pxo_pll8_map,
  1834. },
  1835. .freq_tbl = clk_tbl_usb,
  1836. .clkr = {
  1837. .enable_reg = 0x290c,
  1838. .enable_mask = BIT(11),
  1839. .hw.init = &(struct clk_init_data){
  1840. .name = "usb_hs1_xcvr_src",
  1841. .parent_names = gcc_pxo_pll8,
  1842. .num_parents = 2,
  1843. .ops = &clk_rcg_ops,
  1844. .flags = CLK_SET_RATE_GATE,
  1845. },
  1846. }
  1847. };
  1848. static struct clk_branch usb_hs1_xcvr_clk = {
  1849. .halt_reg = 0x2fc8,
  1850. .halt_bit = 0,
  1851. .clkr = {
  1852. .enable_reg = 0x290c,
  1853. .enable_mask = BIT(9),
  1854. .hw.init = &(struct clk_init_data){
  1855. .name = "usb_hs1_xcvr_clk",
  1856. .parent_names = (const char *[]){ "usb_hs1_xcvr_src" },
  1857. .num_parents = 1,
  1858. .ops = &clk_branch_ops,
  1859. .flags = CLK_SET_RATE_PARENT,
  1860. },
  1861. },
  1862. };
  1863. static struct clk_rcg usb_hs3_xcvr_src = {
  1864. .ns_reg = 0x370c,
  1865. .md_reg = 0x3708,
  1866. .mn = {
  1867. .mnctr_en_bit = 8,
  1868. .mnctr_reset_bit = 7,
  1869. .mnctr_mode_shift = 5,
  1870. .n_val_shift = 16,
  1871. .m_val_shift = 16,
  1872. .width = 8,
  1873. },
  1874. .p = {
  1875. .pre_div_shift = 3,
  1876. .pre_div_width = 2,
  1877. },
  1878. .s = {
  1879. .src_sel_shift = 0,
  1880. .parent_map = gcc_pxo_pll8_map,
  1881. },
  1882. .freq_tbl = clk_tbl_usb,
  1883. .clkr = {
  1884. .enable_reg = 0x370c,
  1885. .enable_mask = BIT(11),
  1886. .hw.init = &(struct clk_init_data){
  1887. .name = "usb_hs3_xcvr_src",
  1888. .parent_names = gcc_pxo_pll8,
  1889. .num_parents = 2,
  1890. .ops = &clk_rcg_ops,
  1891. .flags = CLK_SET_RATE_GATE,
  1892. },
  1893. }
  1894. };
  1895. static struct clk_branch usb_hs3_xcvr_clk = {
  1896. .halt_reg = 0x2fc8,
  1897. .halt_bit = 30,
  1898. .clkr = {
  1899. .enable_reg = 0x370c,
  1900. .enable_mask = BIT(9),
  1901. .hw.init = &(struct clk_init_data){
  1902. .name = "usb_hs3_xcvr_clk",
  1903. .parent_names = (const char *[]){ "usb_hs3_xcvr_src" },
  1904. .num_parents = 1,
  1905. .ops = &clk_branch_ops,
  1906. .flags = CLK_SET_RATE_PARENT,
  1907. },
  1908. },
  1909. };
  1910. static struct clk_rcg usb_hs4_xcvr_src = {
  1911. .ns_reg = 0x372c,
  1912. .md_reg = 0x3728,
  1913. .mn = {
  1914. .mnctr_en_bit = 8,
  1915. .mnctr_reset_bit = 7,
  1916. .mnctr_mode_shift = 5,
  1917. .n_val_shift = 16,
  1918. .m_val_shift = 16,
  1919. .width = 8,
  1920. },
  1921. .p = {
  1922. .pre_div_shift = 3,
  1923. .pre_div_width = 2,
  1924. },
  1925. .s = {
  1926. .src_sel_shift = 0,
  1927. .parent_map = gcc_pxo_pll8_map,
  1928. },
  1929. .freq_tbl = clk_tbl_usb,
  1930. .clkr = {
  1931. .enable_reg = 0x372c,
  1932. .enable_mask = BIT(11),
  1933. .hw.init = &(struct clk_init_data){
  1934. .name = "usb_hs4_xcvr_src",
  1935. .parent_names = gcc_pxo_pll8,
  1936. .num_parents = 2,
  1937. .ops = &clk_rcg_ops,
  1938. .flags = CLK_SET_RATE_GATE,
  1939. },
  1940. }
  1941. };
  1942. static struct clk_branch usb_hs4_xcvr_clk = {
  1943. .halt_reg = 0x2fc8,
  1944. .halt_bit = 2,
  1945. .clkr = {
  1946. .enable_reg = 0x372c,
  1947. .enable_mask = BIT(9),
  1948. .hw.init = &(struct clk_init_data){
  1949. .name = "usb_hs4_xcvr_clk",
  1950. .parent_names = (const char *[]){ "usb_hs4_xcvr_src" },
  1951. .num_parents = 1,
  1952. .ops = &clk_branch_ops,
  1953. .flags = CLK_SET_RATE_PARENT,
  1954. },
  1955. },
  1956. };
  1957. static struct clk_rcg usb_hsic_xcvr_fs_src = {
  1958. .ns_reg = 0x2928,
  1959. .md_reg = 0x2924,
  1960. .mn = {
  1961. .mnctr_en_bit = 8,
  1962. .mnctr_reset_bit = 7,
  1963. .mnctr_mode_shift = 5,
  1964. .n_val_shift = 16,
  1965. .m_val_shift = 16,
  1966. .width = 8,
  1967. },
  1968. .p = {
  1969. .pre_div_shift = 3,
  1970. .pre_div_width = 2,
  1971. },
  1972. .s = {
  1973. .src_sel_shift = 0,
  1974. .parent_map = gcc_pxo_pll8_map,
  1975. },
  1976. .freq_tbl = clk_tbl_usb,
  1977. .clkr = {
  1978. .enable_reg = 0x2928,
  1979. .enable_mask = BIT(11),
  1980. .hw.init = &(struct clk_init_data){
  1981. .name = "usb_hsic_xcvr_fs_src",
  1982. .parent_names = gcc_pxo_pll8,
  1983. .num_parents = 2,
  1984. .ops = &clk_rcg_ops,
  1985. .flags = CLK_SET_RATE_GATE,
  1986. },
  1987. }
  1988. };
  1989. static const char * const usb_hsic_xcvr_fs_src_p[] = { "usb_hsic_xcvr_fs_src" };
  1990. static struct clk_branch usb_hsic_xcvr_fs_clk = {
  1991. .halt_reg = 0x2fc8,
  1992. .halt_bit = 2,
  1993. .clkr = {
  1994. .enable_reg = 0x2928,
  1995. .enable_mask = BIT(9),
  1996. .hw.init = &(struct clk_init_data){
  1997. .name = "usb_hsic_xcvr_fs_clk",
  1998. .parent_names = usb_hsic_xcvr_fs_src_p,
  1999. .num_parents = 1,
  2000. .ops = &clk_branch_ops,
  2001. .flags = CLK_SET_RATE_PARENT,
  2002. },
  2003. },
  2004. };
  2005. static struct clk_branch usb_hsic_system_clk = {
  2006. .halt_reg = 0x2fcc,
  2007. .halt_bit = 24,
  2008. .clkr = {
  2009. .enable_reg = 0x292c,
  2010. .enable_mask = BIT(4),
  2011. .hw.init = &(struct clk_init_data){
  2012. .parent_names = usb_hsic_xcvr_fs_src_p,
  2013. .num_parents = 1,
  2014. .name = "usb_hsic_system_clk",
  2015. .ops = &clk_branch_ops,
  2016. .flags = CLK_SET_RATE_PARENT,
  2017. },
  2018. },
  2019. };
  2020. static struct clk_branch usb_hsic_hsic_clk = {
  2021. .halt_reg = 0x2fcc,
  2022. .halt_bit = 19,
  2023. .clkr = {
  2024. .enable_reg = 0x2b44,
  2025. .enable_mask = BIT(0),
  2026. .hw.init = &(struct clk_init_data){
  2027. .parent_names = (const char *[]){ "pll14_vote" },
  2028. .num_parents = 1,
  2029. .name = "usb_hsic_hsic_clk",
  2030. .ops = &clk_branch_ops,
  2031. },
  2032. },
  2033. };
  2034. static struct clk_branch usb_hsic_hsio_cal_clk = {
  2035. .halt_reg = 0x2fcc,
  2036. .halt_bit = 23,
  2037. .clkr = {
  2038. .enable_reg = 0x2b48,
  2039. .enable_mask = BIT(0),
  2040. .hw.init = &(struct clk_init_data){
  2041. .name = "usb_hsic_hsio_cal_clk",
  2042. .ops = &clk_branch_ops,
  2043. .flags = CLK_IS_ROOT,
  2044. },
  2045. },
  2046. };
  2047. static struct clk_rcg usb_fs1_xcvr_fs_src = {
  2048. .ns_reg = 0x2968,
  2049. .md_reg = 0x2964,
  2050. .mn = {
  2051. .mnctr_en_bit = 8,
  2052. .mnctr_reset_bit = 7,
  2053. .mnctr_mode_shift = 5,
  2054. .n_val_shift = 16,
  2055. .m_val_shift = 16,
  2056. .width = 8,
  2057. },
  2058. .p = {
  2059. .pre_div_shift = 3,
  2060. .pre_div_width = 2,
  2061. },
  2062. .s = {
  2063. .src_sel_shift = 0,
  2064. .parent_map = gcc_pxo_pll8_map,
  2065. },
  2066. .freq_tbl = clk_tbl_usb,
  2067. .clkr = {
  2068. .enable_reg = 0x2968,
  2069. .enable_mask = BIT(11),
  2070. .hw.init = &(struct clk_init_data){
  2071. .name = "usb_fs1_xcvr_fs_src",
  2072. .parent_names = gcc_pxo_pll8,
  2073. .num_parents = 2,
  2074. .ops = &clk_rcg_ops,
  2075. .flags = CLK_SET_RATE_GATE,
  2076. },
  2077. }
  2078. };
  2079. static const char * const usb_fs1_xcvr_fs_src_p[] = { "usb_fs1_xcvr_fs_src" };
  2080. static struct clk_branch usb_fs1_xcvr_fs_clk = {
  2081. .halt_reg = 0x2fcc,
  2082. .halt_bit = 15,
  2083. .clkr = {
  2084. .enable_reg = 0x2968,
  2085. .enable_mask = BIT(9),
  2086. .hw.init = &(struct clk_init_data){
  2087. .name = "usb_fs1_xcvr_fs_clk",
  2088. .parent_names = usb_fs1_xcvr_fs_src_p,
  2089. .num_parents = 1,
  2090. .ops = &clk_branch_ops,
  2091. .flags = CLK_SET_RATE_PARENT,
  2092. },
  2093. },
  2094. };
  2095. static struct clk_branch usb_fs1_system_clk = {
  2096. .halt_reg = 0x2fcc,
  2097. .halt_bit = 16,
  2098. .clkr = {
  2099. .enable_reg = 0x296c,
  2100. .enable_mask = BIT(4),
  2101. .hw.init = &(struct clk_init_data){
  2102. .parent_names = usb_fs1_xcvr_fs_src_p,
  2103. .num_parents = 1,
  2104. .name = "usb_fs1_system_clk",
  2105. .ops = &clk_branch_ops,
  2106. .flags = CLK_SET_RATE_PARENT,
  2107. },
  2108. },
  2109. };
  2110. static struct clk_rcg usb_fs2_xcvr_fs_src = {
  2111. .ns_reg = 0x2988,
  2112. .md_reg = 0x2984,
  2113. .mn = {
  2114. .mnctr_en_bit = 8,
  2115. .mnctr_reset_bit = 7,
  2116. .mnctr_mode_shift = 5,
  2117. .n_val_shift = 16,
  2118. .m_val_shift = 16,
  2119. .width = 8,
  2120. },
  2121. .p = {
  2122. .pre_div_shift = 3,
  2123. .pre_div_width = 2,
  2124. },
  2125. .s = {
  2126. .src_sel_shift = 0,
  2127. .parent_map = gcc_pxo_pll8_map,
  2128. },
  2129. .freq_tbl = clk_tbl_usb,
  2130. .clkr = {
  2131. .enable_reg = 0x2988,
  2132. .enable_mask = BIT(11),
  2133. .hw.init = &(struct clk_init_data){
  2134. .name = "usb_fs2_xcvr_fs_src",
  2135. .parent_names = gcc_pxo_pll8,
  2136. .num_parents = 2,
  2137. .ops = &clk_rcg_ops,
  2138. .flags = CLK_SET_RATE_GATE,
  2139. },
  2140. }
  2141. };
  2142. static const char * const usb_fs2_xcvr_fs_src_p[] = { "usb_fs2_xcvr_fs_src" };
  2143. static struct clk_branch usb_fs2_xcvr_fs_clk = {
  2144. .halt_reg = 0x2fcc,
  2145. .halt_bit = 12,
  2146. .clkr = {
  2147. .enable_reg = 0x2988,
  2148. .enable_mask = BIT(9),
  2149. .hw.init = &(struct clk_init_data){
  2150. .name = "usb_fs2_xcvr_fs_clk",
  2151. .parent_names = usb_fs2_xcvr_fs_src_p,
  2152. .num_parents = 1,
  2153. .ops = &clk_branch_ops,
  2154. .flags = CLK_SET_RATE_PARENT,
  2155. },
  2156. },
  2157. };
  2158. static struct clk_branch usb_fs2_system_clk = {
  2159. .halt_reg = 0x2fcc,
  2160. .halt_bit = 13,
  2161. .clkr = {
  2162. .enable_reg = 0x298c,
  2163. .enable_mask = BIT(4),
  2164. .hw.init = &(struct clk_init_data){
  2165. .name = "usb_fs2_system_clk",
  2166. .parent_names = usb_fs2_xcvr_fs_src_p,
  2167. .num_parents = 1,
  2168. .ops = &clk_branch_ops,
  2169. .flags = CLK_SET_RATE_PARENT,
  2170. },
  2171. },
  2172. };
  2173. static struct clk_branch ce1_core_clk = {
  2174. .hwcg_reg = 0x2724,
  2175. .hwcg_bit = 6,
  2176. .halt_reg = 0x2fd4,
  2177. .halt_bit = 27,
  2178. .clkr = {
  2179. .enable_reg = 0x2724,
  2180. .enable_mask = BIT(4),
  2181. .hw.init = &(struct clk_init_data){
  2182. .name = "ce1_core_clk",
  2183. .ops = &clk_branch_ops,
  2184. .flags = CLK_IS_ROOT,
  2185. },
  2186. },
  2187. };
  2188. static struct clk_branch ce1_h_clk = {
  2189. .halt_reg = 0x2fd4,
  2190. .halt_bit = 1,
  2191. .clkr = {
  2192. .enable_reg = 0x2720,
  2193. .enable_mask = BIT(4),
  2194. .hw.init = &(struct clk_init_data){
  2195. .name = "ce1_h_clk",
  2196. .ops = &clk_branch_ops,
  2197. .flags = CLK_IS_ROOT,
  2198. },
  2199. },
  2200. };
  2201. static struct clk_branch dma_bam_h_clk = {
  2202. .hwcg_reg = 0x25c0,
  2203. .hwcg_bit = 6,
  2204. .halt_reg = 0x2fc8,
  2205. .halt_bit = 12,
  2206. .clkr = {
  2207. .enable_reg = 0x25c0,
  2208. .enable_mask = BIT(4),
  2209. .hw.init = &(struct clk_init_data){
  2210. .name = "dma_bam_h_clk",
  2211. .ops = &clk_branch_ops,
  2212. .flags = CLK_IS_ROOT,
  2213. },
  2214. },
  2215. };
  2216. static struct clk_branch gsbi1_h_clk = {
  2217. .hwcg_reg = 0x29c0,
  2218. .hwcg_bit = 6,
  2219. .halt_reg = 0x2fcc,
  2220. .halt_bit = 11,
  2221. .clkr = {
  2222. .enable_reg = 0x29c0,
  2223. .enable_mask = BIT(4),
  2224. .hw.init = &(struct clk_init_data){
  2225. .name = "gsbi1_h_clk",
  2226. .ops = &clk_branch_ops,
  2227. .flags = CLK_IS_ROOT,
  2228. },
  2229. },
  2230. };
  2231. static struct clk_branch gsbi2_h_clk = {
  2232. .hwcg_reg = 0x29e0,
  2233. .hwcg_bit = 6,
  2234. .halt_reg = 0x2fcc,
  2235. .halt_bit = 7,
  2236. .clkr = {
  2237. .enable_reg = 0x29e0,
  2238. .enable_mask = BIT(4),
  2239. .hw.init = &(struct clk_init_data){
  2240. .name = "gsbi2_h_clk",
  2241. .ops = &clk_branch_ops,
  2242. .flags = CLK_IS_ROOT,
  2243. },
  2244. },
  2245. };
  2246. static struct clk_branch gsbi3_h_clk = {
  2247. .hwcg_reg = 0x2a00,
  2248. .hwcg_bit = 6,
  2249. .halt_reg = 0x2fcc,
  2250. .halt_bit = 3,
  2251. .clkr = {
  2252. .enable_reg = 0x2a00,
  2253. .enable_mask = BIT(4),
  2254. .hw.init = &(struct clk_init_data){
  2255. .name = "gsbi3_h_clk",
  2256. .ops = &clk_branch_ops,
  2257. .flags = CLK_IS_ROOT,
  2258. },
  2259. },
  2260. };
  2261. static struct clk_branch gsbi4_h_clk = {
  2262. .hwcg_reg = 0x2a20,
  2263. .hwcg_bit = 6,
  2264. .halt_reg = 0x2fd0,
  2265. .halt_bit = 27,
  2266. .clkr = {
  2267. .enable_reg = 0x2a20,
  2268. .enable_mask = BIT(4),
  2269. .hw.init = &(struct clk_init_data){
  2270. .name = "gsbi4_h_clk",
  2271. .ops = &clk_branch_ops,
  2272. .flags = CLK_IS_ROOT,
  2273. },
  2274. },
  2275. };
  2276. static struct clk_branch gsbi5_h_clk = {
  2277. .hwcg_reg = 0x2a40,
  2278. .hwcg_bit = 6,
  2279. .halt_reg = 0x2fd0,
  2280. .halt_bit = 23,
  2281. .clkr = {
  2282. .enable_reg = 0x2a40,
  2283. .enable_mask = BIT(4),
  2284. .hw.init = &(struct clk_init_data){
  2285. .name = "gsbi5_h_clk",
  2286. .ops = &clk_branch_ops,
  2287. .flags = CLK_IS_ROOT,
  2288. },
  2289. },
  2290. };
  2291. static struct clk_branch gsbi6_h_clk = {
  2292. .hwcg_reg = 0x2a60,
  2293. .hwcg_bit = 6,
  2294. .halt_reg = 0x2fd0,
  2295. .halt_bit = 19,
  2296. .clkr = {
  2297. .enable_reg = 0x2a60,
  2298. .enable_mask = BIT(4),
  2299. .hw.init = &(struct clk_init_data){
  2300. .name = "gsbi6_h_clk",
  2301. .ops = &clk_branch_ops,
  2302. .flags = CLK_IS_ROOT,
  2303. },
  2304. },
  2305. };
  2306. static struct clk_branch gsbi7_h_clk = {
  2307. .hwcg_reg = 0x2a80,
  2308. .hwcg_bit = 6,
  2309. .halt_reg = 0x2fd0,
  2310. .halt_bit = 15,
  2311. .clkr = {
  2312. .enable_reg = 0x2a80,
  2313. .enable_mask = BIT(4),
  2314. .hw.init = &(struct clk_init_data){
  2315. .name = "gsbi7_h_clk",
  2316. .ops = &clk_branch_ops,
  2317. .flags = CLK_IS_ROOT,
  2318. },
  2319. },
  2320. };
  2321. static struct clk_branch gsbi8_h_clk = {
  2322. .hwcg_reg = 0x2aa0,
  2323. .hwcg_bit = 6,
  2324. .halt_reg = 0x2fd0,
  2325. .halt_bit = 11,
  2326. .clkr = {
  2327. .enable_reg = 0x2aa0,
  2328. .enable_mask = BIT(4),
  2329. .hw.init = &(struct clk_init_data){
  2330. .name = "gsbi8_h_clk",
  2331. .ops = &clk_branch_ops,
  2332. .flags = CLK_IS_ROOT,
  2333. },
  2334. },
  2335. };
  2336. static struct clk_branch gsbi9_h_clk = {
  2337. .hwcg_reg = 0x2ac0,
  2338. .hwcg_bit = 6,
  2339. .halt_reg = 0x2fd0,
  2340. .halt_bit = 7,
  2341. .clkr = {
  2342. .enable_reg = 0x2ac0,
  2343. .enable_mask = BIT(4),
  2344. .hw.init = &(struct clk_init_data){
  2345. .name = "gsbi9_h_clk",
  2346. .ops = &clk_branch_ops,
  2347. .flags = CLK_IS_ROOT,
  2348. },
  2349. },
  2350. };
  2351. static struct clk_branch gsbi10_h_clk = {
  2352. .hwcg_reg = 0x2ae0,
  2353. .hwcg_bit = 6,
  2354. .halt_reg = 0x2fd0,
  2355. .halt_bit = 3,
  2356. .clkr = {
  2357. .enable_reg = 0x2ae0,
  2358. .enable_mask = BIT(4),
  2359. .hw.init = &(struct clk_init_data){
  2360. .name = "gsbi10_h_clk",
  2361. .ops = &clk_branch_ops,
  2362. .flags = CLK_IS_ROOT,
  2363. },
  2364. },
  2365. };
  2366. static struct clk_branch gsbi11_h_clk = {
  2367. .hwcg_reg = 0x2b00,
  2368. .hwcg_bit = 6,
  2369. .halt_reg = 0x2fd4,
  2370. .halt_bit = 18,
  2371. .clkr = {
  2372. .enable_reg = 0x2b00,
  2373. .enable_mask = BIT(4),
  2374. .hw.init = &(struct clk_init_data){
  2375. .name = "gsbi11_h_clk",
  2376. .ops = &clk_branch_ops,
  2377. .flags = CLK_IS_ROOT,
  2378. },
  2379. },
  2380. };
  2381. static struct clk_branch gsbi12_h_clk = {
  2382. .hwcg_reg = 0x2b20,
  2383. .hwcg_bit = 6,
  2384. .halt_reg = 0x2fd4,
  2385. .halt_bit = 14,
  2386. .clkr = {
  2387. .enable_reg = 0x2b20,
  2388. .enable_mask = BIT(4),
  2389. .hw.init = &(struct clk_init_data){
  2390. .name = "gsbi12_h_clk",
  2391. .ops = &clk_branch_ops,
  2392. .flags = CLK_IS_ROOT,
  2393. },
  2394. },
  2395. };
  2396. static struct clk_branch tsif_h_clk = {
  2397. .hwcg_reg = 0x2700,
  2398. .hwcg_bit = 6,
  2399. .halt_reg = 0x2fd4,
  2400. .halt_bit = 7,
  2401. .clkr = {
  2402. .enable_reg = 0x2700,
  2403. .enable_mask = BIT(4),
  2404. .hw.init = &(struct clk_init_data){
  2405. .name = "tsif_h_clk",
  2406. .ops = &clk_branch_ops,
  2407. .flags = CLK_IS_ROOT,
  2408. },
  2409. },
  2410. };
  2411. static struct clk_branch usb_fs1_h_clk = {
  2412. .halt_reg = 0x2fcc,
  2413. .halt_bit = 17,
  2414. .clkr = {
  2415. .enable_reg = 0x2960,
  2416. .enable_mask = BIT(4),
  2417. .hw.init = &(struct clk_init_data){
  2418. .name = "usb_fs1_h_clk",
  2419. .ops = &clk_branch_ops,
  2420. .flags = CLK_IS_ROOT,
  2421. },
  2422. },
  2423. };
  2424. static struct clk_branch usb_fs2_h_clk = {
  2425. .halt_reg = 0x2fcc,
  2426. .halt_bit = 14,
  2427. .clkr = {
  2428. .enable_reg = 0x2980,
  2429. .enable_mask = BIT(4),
  2430. .hw.init = &(struct clk_init_data){
  2431. .name = "usb_fs2_h_clk",
  2432. .ops = &clk_branch_ops,
  2433. .flags = CLK_IS_ROOT,
  2434. },
  2435. },
  2436. };
  2437. static struct clk_branch usb_hs1_h_clk = {
  2438. .hwcg_reg = 0x2900,
  2439. .hwcg_bit = 6,
  2440. .halt_reg = 0x2fc8,
  2441. .halt_bit = 1,
  2442. .clkr = {
  2443. .enable_reg = 0x2900,
  2444. .enable_mask = BIT(4),
  2445. .hw.init = &(struct clk_init_data){
  2446. .name = "usb_hs1_h_clk",
  2447. .ops = &clk_branch_ops,
  2448. .flags = CLK_IS_ROOT,
  2449. },
  2450. },
  2451. };
  2452. static struct clk_branch usb_hs3_h_clk = {
  2453. .halt_reg = 0x2fc8,
  2454. .halt_bit = 31,
  2455. .clkr = {
  2456. .enable_reg = 0x3700,
  2457. .enable_mask = BIT(4),
  2458. .hw.init = &(struct clk_init_data){
  2459. .name = "usb_hs3_h_clk",
  2460. .ops = &clk_branch_ops,
  2461. .flags = CLK_IS_ROOT,
  2462. },
  2463. },
  2464. };
  2465. static struct clk_branch usb_hs4_h_clk = {
  2466. .halt_reg = 0x2fc8,
  2467. .halt_bit = 7,
  2468. .clkr = {
  2469. .enable_reg = 0x3720,
  2470. .enable_mask = BIT(4),
  2471. .hw.init = &(struct clk_init_data){
  2472. .name = "usb_hs4_h_clk",
  2473. .ops = &clk_branch_ops,
  2474. .flags = CLK_IS_ROOT,
  2475. },
  2476. },
  2477. };
  2478. static struct clk_branch usb_hsic_h_clk = {
  2479. .halt_reg = 0x2fcc,
  2480. .halt_bit = 28,
  2481. .clkr = {
  2482. .enable_reg = 0x2920,
  2483. .enable_mask = BIT(4),
  2484. .hw.init = &(struct clk_init_data){
  2485. .name = "usb_hsic_h_clk",
  2486. .ops = &clk_branch_ops,
  2487. .flags = CLK_IS_ROOT,
  2488. },
  2489. },
  2490. };
  2491. static struct clk_branch sdc1_h_clk = {
  2492. .hwcg_reg = 0x2820,
  2493. .hwcg_bit = 6,
  2494. .halt_reg = 0x2fc8,
  2495. .halt_bit = 11,
  2496. .clkr = {
  2497. .enable_reg = 0x2820,
  2498. .enable_mask = BIT(4),
  2499. .hw.init = &(struct clk_init_data){
  2500. .name = "sdc1_h_clk",
  2501. .ops = &clk_branch_ops,
  2502. .flags = CLK_IS_ROOT,
  2503. },
  2504. },
  2505. };
  2506. static struct clk_branch sdc2_h_clk = {
  2507. .hwcg_reg = 0x2840,
  2508. .hwcg_bit = 6,
  2509. .halt_reg = 0x2fc8,
  2510. .halt_bit = 10,
  2511. .clkr = {
  2512. .enable_reg = 0x2840,
  2513. .enable_mask = BIT(4),
  2514. .hw.init = &(struct clk_init_data){
  2515. .name = "sdc2_h_clk",
  2516. .ops = &clk_branch_ops,
  2517. .flags = CLK_IS_ROOT,
  2518. },
  2519. },
  2520. };
  2521. static struct clk_branch sdc3_h_clk = {
  2522. .hwcg_reg = 0x2860,
  2523. .hwcg_bit = 6,
  2524. .halt_reg = 0x2fc8,
  2525. .halt_bit = 9,
  2526. .clkr = {
  2527. .enable_reg = 0x2860,
  2528. .enable_mask = BIT(4),
  2529. .hw.init = &(struct clk_init_data){
  2530. .name = "sdc3_h_clk",
  2531. .ops = &clk_branch_ops,
  2532. .flags = CLK_IS_ROOT,
  2533. },
  2534. },
  2535. };
  2536. static struct clk_branch sdc4_h_clk = {
  2537. .hwcg_reg = 0x2880,
  2538. .hwcg_bit = 6,
  2539. .halt_reg = 0x2fc8,
  2540. .halt_bit = 8,
  2541. .clkr = {
  2542. .enable_reg = 0x2880,
  2543. .enable_mask = BIT(4),
  2544. .hw.init = &(struct clk_init_data){
  2545. .name = "sdc4_h_clk",
  2546. .ops = &clk_branch_ops,
  2547. .flags = CLK_IS_ROOT,
  2548. },
  2549. },
  2550. };
  2551. static struct clk_branch sdc5_h_clk = {
  2552. .hwcg_reg = 0x28a0,
  2553. .hwcg_bit = 6,
  2554. .halt_reg = 0x2fc8,
  2555. .halt_bit = 7,
  2556. .clkr = {
  2557. .enable_reg = 0x28a0,
  2558. .enable_mask = BIT(4),
  2559. .hw.init = &(struct clk_init_data){
  2560. .name = "sdc5_h_clk",
  2561. .ops = &clk_branch_ops,
  2562. .flags = CLK_IS_ROOT,
  2563. },
  2564. },
  2565. };
  2566. static struct clk_branch adm0_clk = {
  2567. .halt_reg = 0x2fdc,
  2568. .halt_check = BRANCH_HALT_VOTED,
  2569. .halt_bit = 14,
  2570. .clkr = {
  2571. .enable_reg = 0x3080,
  2572. .enable_mask = BIT(2),
  2573. .hw.init = &(struct clk_init_data){
  2574. .name = "adm0_clk",
  2575. .ops = &clk_branch_ops,
  2576. .flags = CLK_IS_ROOT,
  2577. },
  2578. },
  2579. };
  2580. static struct clk_branch adm0_pbus_clk = {
  2581. .hwcg_reg = 0x2208,
  2582. .hwcg_bit = 6,
  2583. .halt_reg = 0x2fdc,
  2584. .halt_check = BRANCH_HALT_VOTED,
  2585. .halt_bit = 13,
  2586. .clkr = {
  2587. .enable_reg = 0x3080,
  2588. .enable_mask = BIT(3),
  2589. .hw.init = &(struct clk_init_data){
  2590. .name = "adm0_pbus_clk",
  2591. .ops = &clk_branch_ops,
  2592. .flags = CLK_IS_ROOT,
  2593. },
  2594. },
  2595. };
  2596. static struct freq_tbl clk_tbl_ce3[] = {
  2597. { 48000000, P_PLL8, 8 },
  2598. { 100000000, P_PLL3, 12 },
  2599. { 120000000, P_PLL3, 10 },
  2600. { }
  2601. };
  2602. static struct clk_rcg ce3_src = {
  2603. .ns_reg = 0x36c0,
  2604. .p = {
  2605. .pre_div_shift = 3,
  2606. .pre_div_width = 4,
  2607. },
  2608. .s = {
  2609. .src_sel_shift = 0,
  2610. .parent_map = gcc_pxo_pll8_pll3_map,
  2611. },
  2612. .freq_tbl = clk_tbl_ce3,
  2613. .clkr = {
  2614. .enable_reg = 0x36c0,
  2615. .enable_mask = BIT(7),
  2616. .hw.init = &(struct clk_init_data){
  2617. .name = "ce3_src",
  2618. .parent_names = gcc_pxo_pll8_pll3,
  2619. .num_parents = 3,
  2620. .ops = &clk_rcg_ops,
  2621. .flags = CLK_SET_RATE_GATE,
  2622. },
  2623. },
  2624. };
  2625. static struct clk_branch ce3_core_clk = {
  2626. .halt_reg = 0x2fdc,
  2627. .halt_bit = 5,
  2628. .clkr = {
  2629. .enable_reg = 0x36cc,
  2630. .enable_mask = BIT(4),
  2631. .hw.init = &(struct clk_init_data){
  2632. .name = "ce3_core_clk",
  2633. .parent_names = (const char *[]){ "ce3_src" },
  2634. .num_parents = 1,
  2635. .ops = &clk_branch_ops,
  2636. .flags = CLK_SET_RATE_PARENT,
  2637. },
  2638. },
  2639. };
  2640. static struct clk_branch ce3_h_clk = {
  2641. .halt_reg = 0x2fc4,
  2642. .halt_bit = 16,
  2643. .clkr = {
  2644. .enable_reg = 0x36c4,
  2645. .enable_mask = BIT(4),
  2646. .hw.init = &(struct clk_init_data){
  2647. .name = "ce3_h_clk",
  2648. .parent_names = (const char *[]){ "ce3_src" },
  2649. .num_parents = 1,
  2650. .ops = &clk_branch_ops,
  2651. .flags = CLK_SET_RATE_PARENT,
  2652. },
  2653. },
  2654. };
  2655. static const struct freq_tbl clk_tbl_sata_ref[] = {
  2656. { 48000000, P_PLL8, 8, 0, 0 },
  2657. { 100000000, P_PLL3, 12, 0, 0 },
  2658. { }
  2659. };
  2660. static struct clk_rcg sata_clk_src = {
  2661. .ns_reg = 0x2c08,
  2662. .p = {
  2663. .pre_div_shift = 3,
  2664. .pre_div_width = 4,
  2665. },
  2666. .s = {
  2667. .src_sel_shift = 0,
  2668. .parent_map = gcc_pxo_pll8_pll3_map,
  2669. },
  2670. .freq_tbl = clk_tbl_sata_ref,
  2671. .clkr = {
  2672. .enable_reg = 0x2c08,
  2673. .enable_mask = BIT(7),
  2674. .hw.init = &(struct clk_init_data){
  2675. .name = "sata_clk_src",
  2676. .parent_names = gcc_pxo_pll8_pll3,
  2677. .num_parents = 3,
  2678. .ops = &clk_rcg_ops,
  2679. .flags = CLK_SET_RATE_GATE,
  2680. },
  2681. },
  2682. };
  2683. static struct clk_branch sata_rxoob_clk = {
  2684. .halt_reg = 0x2fdc,
  2685. .halt_bit = 26,
  2686. .clkr = {
  2687. .enable_reg = 0x2c0c,
  2688. .enable_mask = BIT(4),
  2689. .hw.init = &(struct clk_init_data){
  2690. .name = "sata_rxoob_clk",
  2691. .parent_names = (const char *[]){ "sata_clk_src" },
  2692. .num_parents = 1,
  2693. .ops = &clk_branch_ops,
  2694. .flags = CLK_SET_RATE_PARENT,
  2695. },
  2696. },
  2697. };
  2698. static struct clk_branch sata_pmalive_clk = {
  2699. .halt_reg = 0x2fdc,
  2700. .halt_bit = 25,
  2701. .clkr = {
  2702. .enable_reg = 0x2c10,
  2703. .enable_mask = BIT(4),
  2704. .hw.init = &(struct clk_init_data){
  2705. .name = "sata_pmalive_clk",
  2706. .parent_names = (const char *[]){ "sata_clk_src" },
  2707. .num_parents = 1,
  2708. .ops = &clk_branch_ops,
  2709. .flags = CLK_SET_RATE_PARENT,
  2710. },
  2711. },
  2712. };
  2713. static struct clk_branch sata_phy_ref_clk = {
  2714. .halt_reg = 0x2fdc,
  2715. .halt_bit = 24,
  2716. .clkr = {
  2717. .enable_reg = 0x2c14,
  2718. .enable_mask = BIT(4),
  2719. .hw.init = &(struct clk_init_data){
  2720. .name = "sata_phy_ref_clk",
  2721. .parent_names = (const char *[]){ "pxo" },
  2722. .num_parents = 1,
  2723. .ops = &clk_branch_ops,
  2724. },
  2725. },
  2726. };
  2727. static struct clk_branch sata_a_clk = {
  2728. .halt_reg = 0x2fc0,
  2729. .halt_bit = 12,
  2730. .clkr = {
  2731. .enable_reg = 0x2c20,
  2732. .enable_mask = BIT(4),
  2733. .hw.init = &(struct clk_init_data){
  2734. .name = "sata_a_clk",
  2735. .ops = &clk_branch_ops,
  2736. .flags = CLK_IS_ROOT,
  2737. },
  2738. },
  2739. };
  2740. static struct clk_branch sata_h_clk = {
  2741. .halt_reg = 0x2fdc,
  2742. .halt_bit = 27,
  2743. .clkr = {
  2744. .enable_reg = 0x2c00,
  2745. .enable_mask = BIT(4),
  2746. .hw.init = &(struct clk_init_data){
  2747. .name = "sata_h_clk",
  2748. .ops = &clk_branch_ops,
  2749. .flags = CLK_IS_ROOT,
  2750. },
  2751. },
  2752. };
  2753. static struct clk_branch sfab_sata_s_h_clk = {
  2754. .halt_reg = 0x2fc4,
  2755. .halt_bit = 14,
  2756. .clkr = {
  2757. .enable_reg = 0x2480,
  2758. .enable_mask = BIT(4),
  2759. .hw.init = &(struct clk_init_data){
  2760. .name = "sfab_sata_s_h_clk",
  2761. .ops = &clk_branch_ops,
  2762. .flags = CLK_IS_ROOT,
  2763. },
  2764. },
  2765. };
  2766. static struct clk_branch sata_phy_cfg_clk = {
  2767. .halt_reg = 0x2fcc,
  2768. .halt_bit = 12,
  2769. .clkr = {
  2770. .enable_reg = 0x2c40,
  2771. .enable_mask = BIT(4),
  2772. .hw.init = &(struct clk_init_data){
  2773. .name = "sata_phy_cfg_clk",
  2774. .ops = &clk_branch_ops,
  2775. .flags = CLK_IS_ROOT,
  2776. },
  2777. },
  2778. };
  2779. static struct clk_branch pcie_phy_ref_clk = {
  2780. .halt_reg = 0x2fdc,
  2781. .halt_bit = 29,
  2782. .clkr = {
  2783. .enable_reg = 0x22d0,
  2784. .enable_mask = BIT(4),
  2785. .hw.init = &(struct clk_init_data){
  2786. .name = "pcie_phy_ref_clk",
  2787. .ops = &clk_branch_ops,
  2788. .flags = CLK_IS_ROOT,
  2789. },
  2790. },
  2791. };
  2792. static struct clk_branch pcie_h_clk = {
  2793. .halt_reg = 0x2fd4,
  2794. .halt_bit = 8,
  2795. .clkr = {
  2796. .enable_reg = 0x22cc,
  2797. .enable_mask = BIT(4),
  2798. .hw.init = &(struct clk_init_data){
  2799. .name = "pcie_h_clk",
  2800. .ops = &clk_branch_ops,
  2801. .flags = CLK_IS_ROOT,
  2802. },
  2803. },
  2804. };
  2805. static struct clk_branch pcie_a_clk = {
  2806. .halt_reg = 0x2fc0,
  2807. .halt_bit = 13,
  2808. .clkr = {
  2809. .enable_reg = 0x22c0,
  2810. .enable_mask = BIT(4),
  2811. .hw.init = &(struct clk_init_data){
  2812. .name = "pcie_a_clk",
  2813. .ops = &clk_branch_ops,
  2814. .flags = CLK_IS_ROOT,
  2815. },
  2816. },
  2817. };
  2818. static struct clk_branch pmic_arb0_h_clk = {
  2819. .halt_reg = 0x2fd8,
  2820. .halt_check = BRANCH_HALT_VOTED,
  2821. .halt_bit = 22,
  2822. .clkr = {
  2823. .enable_reg = 0x3080,
  2824. .enable_mask = BIT(8),
  2825. .hw.init = &(struct clk_init_data){
  2826. .name = "pmic_arb0_h_clk",
  2827. .ops = &clk_branch_ops,
  2828. .flags = CLK_IS_ROOT,
  2829. },
  2830. },
  2831. };
  2832. static struct clk_branch pmic_arb1_h_clk = {
  2833. .halt_reg = 0x2fd8,
  2834. .halt_check = BRANCH_HALT_VOTED,
  2835. .halt_bit = 21,
  2836. .clkr = {
  2837. .enable_reg = 0x3080,
  2838. .enable_mask = BIT(9),
  2839. .hw.init = &(struct clk_init_data){
  2840. .name = "pmic_arb1_h_clk",
  2841. .ops = &clk_branch_ops,
  2842. .flags = CLK_IS_ROOT,
  2843. },
  2844. },
  2845. };
  2846. static struct clk_branch pmic_ssbi2_clk = {
  2847. .halt_reg = 0x2fd8,
  2848. .halt_check = BRANCH_HALT_VOTED,
  2849. .halt_bit = 23,
  2850. .clkr = {
  2851. .enable_reg = 0x3080,
  2852. .enable_mask = BIT(7),
  2853. .hw.init = &(struct clk_init_data){
  2854. .name = "pmic_ssbi2_clk",
  2855. .ops = &clk_branch_ops,
  2856. .flags = CLK_IS_ROOT,
  2857. },
  2858. },
  2859. };
  2860. static struct clk_branch rpm_msg_ram_h_clk = {
  2861. .hwcg_reg = 0x27e0,
  2862. .hwcg_bit = 6,
  2863. .halt_reg = 0x2fd8,
  2864. .halt_check = BRANCH_HALT_VOTED,
  2865. .halt_bit = 12,
  2866. .clkr = {
  2867. .enable_reg = 0x3080,
  2868. .enable_mask = BIT(6),
  2869. .hw.init = &(struct clk_init_data){
  2870. .name = "rpm_msg_ram_h_clk",
  2871. .ops = &clk_branch_ops,
  2872. .flags = CLK_IS_ROOT,
  2873. },
  2874. },
  2875. };
  2876. static struct clk_regmap *gcc_msm8960_clks[] = {
  2877. [PLL3] = &pll3.clkr,
  2878. [PLL4_VOTE] = &pll4_vote,
  2879. [PLL8] = &pll8.clkr,
  2880. [PLL8_VOTE] = &pll8_vote,
  2881. [PLL14] = &pll14.clkr,
  2882. [PLL14_VOTE] = &pll14_vote,
  2883. [GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
  2884. [GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
  2885. [GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
  2886. [GSBI2_UART_CLK] = &gsbi2_uart_clk.clkr,
  2887. [GSBI3_UART_SRC] = &gsbi3_uart_src.clkr,
  2888. [GSBI3_UART_CLK] = &gsbi3_uart_clk.clkr,
  2889. [GSBI4_UART_SRC] = &gsbi4_uart_src.clkr,
  2890. [GSBI4_UART_CLK] = &gsbi4_uart_clk.clkr,
  2891. [GSBI5_UART_SRC] = &gsbi5_uart_src.clkr,
  2892. [GSBI5_UART_CLK] = &gsbi5_uart_clk.clkr,
  2893. [GSBI6_UART_SRC] = &gsbi6_uart_src.clkr,
  2894. [GSBI6_UART_CLK] = &gsbi6_uart_clk.clkr,
  2895. [GSBI7_UART_SRC] = &gsbi7_uart_src.clkr,
  2896. [GSBI7_UART_CLK] = &gsbi7_uart_clk.clkr,
  2897. [GSBI8_UART_SRC] = &gsbi8_uart_src.clkr,
  2898. [GSBI8_UART_CLK] = &gsbi8_uart_clk.clkr,
  2899. [GSBI9_UART_SRC] = &gsbi9_uart_src.clkr,
  2900. [GSBI9_UART_CLK] = &gsbi9_uart_clk.clkr,
  2901. [GSBI10_UART_SRC] = &gsbi10_uart_src.clkr,
  2902. [GSBI10_UART_CLK] = &gsbi10_uart_clk.clkr,
  2903. [GSBI11_UART_SRC] = &gsbi11_uart_src.clkr,
  2904. [GSBI11_UART_CLK] = &gsbi11_uart_clk.clkr,
  2905. [GSBI12_UART_SRC] = &gsbi12_uart_src.clkr,
  2906. [GSBI12_UART_CLK] = &gsbi12_uart_clk.clkr,
  2907. [GSBI1_QUP_SRC] = &gsbi1_qup_src.clkr,
  2908. [GSBI1_QUP_CLK] = &gsbi1_qup_clk.clkr,
  2909. [GSBI2_QUP_SRC] = &gsbi2_qup_src.clkr,
  2910. [GSBI2_QUP_CLK] = &gsbi2_qup_clk.clkr,
  2911. [GSBI3_QUP_SRC] = &gsbi3_qup_src.clkr,
  2912. [GSBI3_QUP_CLK] = &gsbi3_qup_clk.clkr,
  2913. [GSBI4_QUP_SRC] = &gsbi4_qup_src.clkr,
  2914. [GSBI4_QUP_CLK] = &gsbi4_qup_clk.clkr,
  2915. [GSBI5_QUP_SRC] = &gsbi5_qup_src.clkr,
  2916. [GSBI5_QUP_CLK] = &gsbi5_qup_clk.clkr,
  2917. [GSBI6_QUP_SRC] = &gsbi6_qup_src.clkr,
  2918. [GSBI6_QUP_CLK] = &gsbi6_qup_clk.clkr,
  2919. [GSBI7_QUP_SRC] = &gsbi7_qup_src.clkr,
  2920. [GSBI7_QUP_CLK] = &gsbi7_qup_clk.clkr,
  2921. [GSBI8_QUP_SRC] = &gsbi8_qup_src.clkr,
  2922. [GSBI8_QUP_CLK] = &gsbi8_qup_clk.clkr,
  2923. [GSBI9_QUP_SRC] = &gsbi9_qup_src.clkr,
  2924. [GSBI9_QUP_CLK] = &gsbi9_qup_clk.clkr,
  2925. [GSBI10_QUP_SRC] = &gsbi10_qup_src.clkr,
  2926. [GSBI10_QUP_CLK] = &gsbi10_qup_clk.clkr,
  2927. [GSBI11_QUP_SRC] = &gsbi11_qup_src.clkr,
  2928. [GSBI11_QUP_CLK] = &gsbi11_qup_clk.clkr,
  2929. [GSBI12_QUP_SRC] = &gsbi12_qup_src.clkr,
  2930. [GSBI12_QUP_CLK] = &gsbi12_qup_clk.clkr,
  2931. [GP0_SRC] = &gp0_src.clkr,
  2932. [GP0_CLK] = &gp0_clk.clkr,
  2933. [GP1_SRC] = &gp1_src.clkr,
  2934. [GP1_CLK] = &gp1_clk.clkr,
  2935. [GP2_SRC] = &gp2_src.clkr,
  2936. [GP2_CLK] = &gp2_clk.clkr,
  2937. [PMEM_A_CLK] = &pmem_clk.clkr,
  2938. [PRNG_SRC] = &prng_src.clkr,
  2939. [PRNG_CLK] = &prng_clk.clkr,
  2940. [SDC1_SRC] = &sdc1_src.clkr,
  2941. [SDC1_CLK] = &sdc1_clk.clkr,
  2942. [SDC2_SRC] = &sdc2_src.clkr,
  2943. [SDC2_CLK] = &sdc2_clk.clkr,
  2944. [SDC3_SRC] = &sdc3_src.clkr,
  2945. [SDC3_CLK] = &sdc3_clk.clkr,
  2946. [SDC4_SRC] = &sdc4_src.clkr,
  2947. [SDC4_CLK] = &sdc4_clk.clkr,
  2948. [SDC5_SRC] = &sdc5_src.clkr,
  2949. [SDC5_CLK] = &sdc5_clk.clkr,
  2950. [TSIF_REF_SRC] = &tsif_ref_src.clkr,
  2951. [TSIF_REF_CLK] = &tsif_ref_clk.clkr,
  2952. [USB_HS1_XCVR_SRC] = &usb_hs1_xcvr_src.clkr,
  2953. [USB_HS1_XCVR_CLK] = &usb_hs1_xcvr_clk.clkr,
  2954. [USB_HSIC_XCVR_FS_SRC] = &usb_hsic_xcvr_fs_src.clkr,
  2955. [USB_HSIC_XCVR_FS_CLK] = &usb_hsic_xcvr_fs_clk.clkr,
  2956. [USB_HSIC_SYSTEM_CLK] = &usb_hsic_system_clk.clkr,
  2957. [USB_HSIC_HSIC_CLK] = &usb_hsic_hsic_clk.clkr,
  2958. [USB_HSIC_HSIO_CAL_CLK] = &usb_hsic_hsio_cal_clk.clkr,
  2959. [USB_FS1_XCVR_FS_SRC] = &usb_fs1_xcvr_fs_src.clkr,
  2960. [USB_FS1_XCVR_FS_CLK] = &usb_fs1_xcvr_fs_clk.clkr,
  2961. [USB_FS1_SYSTEM_CLK] = &usb_fs1_system_clk.clkr,
  2962. [USB_FS2_XCVR_FS_SRC] = &usb_fs2_xcvr_fs_src.clkr,
  2963. [USB_FS2_XCVR_FS_CLK] = &usb_fs2_xcvr_fs_clk.clkr,
  2964. [USB_FS2_SYSTEM_CLK] = &usb_fs2_system_clk.clkr,
  2965. [CE1_CORE_CLK] = &ce1_core_clk.clkr,
  2966. [CE1_H_CLK] = &ce1_h_clk.clkr,
  2967. [DMA_BAM_H_CLK] = &dma_bam_h_clk.clkr,
  2968. [GSBI1_H_CLK] = &gsbi1_h_clk.clkr,
  2969. [GSBI2_H_CLK] = &gsbi2_h_clk.clkr,
  2970. [GSBI3_H_CLK] = &gsbi3_h_clk.clkr,
  2971. [GSBI4_H_CLK] = &gsbi4_h_clk.clkr,
  2972. [GSBI5_H_CLK] = &gsbi5_h_clk.clkr,
  2973. [GSBI6_H_CLK] = &gsbi6_h_clk.clkr,
  2974. [GSBI7_H_CLK] = &gsbi7_h_clk.clkr,
  2975. [GSBI8_H_CLK] = &gsbi8_h_clk.clkr,
  2976. [GSBI9_H_CLK] = &gsbi9_h_clk.clkr,
  2977. [GSBI10_H_CLK] = &gsbi10_h_clk.clkr,
  2978. [GSBI11_H_CLK] = &gsbi11_h_clk.clkr,
  2979. [GSBI12_H_CLK] = &gsbi12_h_clk.clkr,
  2980. [TSIF_H_CLK] = &tsif_h_clk.clkr,
  2981. [USB_FS1_H_CLK] = &usb_fs1_h_clk.clkr,
  2982. [USB_FS2_H_CLK] = &usb_fs2_h_clk.clkr,
  2983. [USB_HS1_H_CLK] = &usb_hs1_h_clk.clkr,
  2984. [USB_HSIC_H_CLK] = &usb_hsic_h_clk.clkr,
  2985. [SDC1_H_CLK] = &sdc1_h_clk.clkr,
  2986. [SDC2_H_CLK] = &sdc2_h_clk.clkr,
  2987. [SDC3_H_CLK] = &sdc3_h_clk.clkr,
  2988. [SDC4_H_CLK] = &sdc4_h_clk.clkr,
  2989. [SDC5_H_CLK] = &sdc5_h_clk.clkr,
  2990. [ADM0_CLK] = &adm0_clk.clkr,
  2991. [ADM0_PBUS_CLK] = &adm0_pbus_clk.clkr,
  2992. [PMIC_ARB0_H_CLK] = &pmic_arb0_h_clk.clkr,
  2993. [PMIC_ARB1_H_CLK] = &pmic_arb1_h_clk.clkr,
  2994. [PMIC_SSBI2_CLK] = &pmic_ssbi2_clk.clkr,
  2995. [RPM_MSG_RAM_H_CLK] = &rpm_msg_ram_h_clk.clkr,
  2996. };
  2997. static const struct qcom_reset_map gcc_msm8960_resets[] = {
  2998. [SFAB_MSS_Q6_SW_RESET] = { 0x2040, 7 },
  2999. [SFAB_MSS_Q6_FW_RESET] = { 0x2044, 7 },
  3000. [QDSS_STM_RESET] = { 0x2060, 6 },
  3001. [AFAB_SMPSS_S_RESET] = { 0x20b8, 2 },
  3002. [AFAB_SMPSS_M1_RESET] = { 0x20b8, 1 },
  3003. [AFAB_SMPSS_M0_RESET] = { 0x20b8 },
  3004. [AFAB_EBI1_CH0_RESET] = { 0x20c0, 7 },
  3005. [AFAB_EBI1_CH1_RESET] = { 0x20c4, 7},
  3006. [SFAB_ADM0_M0_RESET] = { 0x21e0, 7 },
  3007. [SFAB_ADM0_M1_RESET] = { 0x21e4, 7 },
  3008. [SFAB_ADM0_M2_RESET] = { 0x21e8, 7 },
  3009. [ADM0_C2_RESET] = { 0x220c, 4},
  3010. [ADM0_C1_RESET] = { 0x220c, 3},
  3011. [ADM0_C0_RESET] = { 0x220c, 2},
  3012. [ADM0_PBUS_RESET] = { 0x220c, 1 },
  3013. [ADM0_RESET] = { 0x220c },
  3014. [QDSS_CLKS_SW_RESET] = { 0x2260, 5 },
  3015. [QDSS_POR_RESET] = { 0x2260, 4 },
  3016. [QDSS_TSCTR_RESET] = { 0x2260, 3 },
  3017. [QDSS_HRESET_RESET] = { 0x2260, 2 },
  3018. [QDSS_AXI_RESET] = { 0x2260, 1 },
  3019. [QDSS_DBG_RESET] = { 0x2260 },
  3020. [PCIE_A_RESET] = { 0x22c0, 7 },
  3021. [PCIE_AUX_RESET] = { 0x22c8, 7 },
  3022. [PCIE_H_RESET] = { 0x22d0, 7 },
  3023. [SFAB_PCIE_M_RESET] = { 0x22d4, 1 },
  3024. [SFAB_PCIE_S_RESET] = { 0x22d4 },
  3025. [SFAB_MSS_M_RESET] = { 0x2340, 7 },
  3026. [SFAB_USB3_M_RESET] = { 0x2360, 7 },
  3027. [SFAB_RIVA_M_RESET] = { 0x2380, 7 },
  3028. [SFAB_LPASS_RESET] = { 0x23a0, 7 },
  3029. [SFAB_AFAB_M_RESET] = { 0x23e0, 7 },
  3030. [AFAB_SFAB_M0_RESET] = { 0x2420, 7 },
  3031. [AFAB_SFAB_M1_RESET] = { 0x2424, 7 },
  3032. [SFAB_SATA_S_RESET] = { 0x2480, 7 },
  3033. [SFAB_DFAB_M_RESET] = { 0x2500, 7 },
  3034. [DFAB_SFAB_M_RESET] = { 0x2520, 7 },
  3035. [DFAB_SWAY0_RESET] = { 0x2540, 7 },
  3036. [DFAB_SWAY1_RESET] = { 0x2544, 7 },
  3037. [DFAB_ARB0_RESET] = { 0x2560, 7 },
  3038. [DFAB_ARB1_RESET] = { 0x2564, 7 },
  3039. [PPSS_PROC_RESET] = { 0x2594, 1 },
  3040. [PPSS_RESET] = { 0x2594},
  3041. [DMA_BAM_RESET] = { 0x25c0, 7 },
  3042. [SPS_TIC_H_RESET] = { 0x2600, 7 },
  3043. [SLIMBUS_H_RESET] = { 0x2620, 7 },
  3044. [SFAB_CFPB_M_RESET] = { 0x2680, 7 },
  3045. [SFAB_CFPB_S_RESET] = { 0x26c0, 7 },
  3046. [TSIF_H_RESET] = { 0x2700, 7 },
  3047. [CE1_H_RESET] = { 0x2720, 7 },
  3048. [CE1_CORE_RESET] = { 0x2724, 7 },
  3049. [CE1_SLEEP_RESET] = { 0x2728, 7 },
  3050. [CE2_H_RESET] = { 0x2740, 7 },
  3051. [CE2_CORE_RESET] = { 0x2744, 7 },
  3052. [SFAB_SFPB_M_RESET] = { 0x2780, 7 },
  3053. [SFAB_SFPB_S_RESET] = { 0x27a0, 7 },
  3054. [RPM_PROC_RESET] = { 0x27c0, 7 },
  3055. [PMIC_SSBI2_RESET] = { 0x280c, 12 },
  3056. [SDC1_RESET] = { 0x2830 },
  3057. [SDC2_RESET] = { 0x2850 },
  3058. [SDC3_RESET] = { 0x2870 },
  3059. [SDC4_RESET] = { 0x2890 },
  3060. [SDC5_RESET] = { 0x28b0 },
  3061. [DFAB_A2_RESET] = { 0x28c0, 7 },
  3062. [USB_HS1_RESET] = { 0x2910 },
  3063. [USB_HSIC_RESET] = { 0x2934 },
  3064. [USB_FS1_XCVR_RESET] = { 0x2974, 1 },
  3065. [USB_FS1_RESET] = { 0x2974 },
  3066. [USB_FS2_XCVR_RESET] = { 0x2994, 1 },
  3067. [USB_FS2_RESET] = { 0x2994 },
  3068. [GSBI1_RESET] = { 0x29dc },
  3069. [GSBI2_RESET] = { 0x29fc },
  3070. [GSBI3_RESET] = { 0x2a1c },
  3071. [GSBI4_RESET] = { 0x2a3c },
  3072. [GSBI5_RESET] = { 0x2a5c },
  3073. [GSBI6_RESET] = { 0x2a7c },
  3074. [GSBI7_RESET] = { 0x2a9c },
  3075. [GSBI8_RESET] = { 0x2abc },
  3076. [GSBI9_RESET] = { 0x2adc },
  3077. [GSBI10_RESET] = { 0x2afc },
  3078. [GSBI11_RESET] = { 0x2b1c },
  3079. [GSBI12_RESET] = { 0x2b3c },
  3080. [SPDM_RESET] = { 0x2b6c },
  3081. [TLMM_H_RESET] = { 0x2ba0, 7 },
  3082. [SFAB_MSS_S_RESET] = { 0x2c00, 7 },
  3083. [MSS_SLP_RESET] = { 0x2c60, 7 },
  3084. [MSS_Q6SW_JTAG_RESET] = { 0x2c68, 7 },
  3085. [MSS_Q6FW_JTAG_RESET] = { 0x2c6c, 7 },
  3086. [MSS_RESET] = { 0x2c64 },
  3087. [SATA_H_RESET] = { 0x2c80, 7 },
  3088. [SATA_RXOOB_RESE] = { 0x2c8c, 7 },
  3089. [SATA_PMALIVE_RESET] = { 0x2c90, 7 },
  3090. [SATA_SFAB_M_RESET] = { 0x2c98, 7 },
  3091. [TSSC_RESET] = { 0x2ca0, 7 },
  3092. [PDM_RESET] = { 0x2cc0, 12 },
  3093. [MPM_H_RESET] = { 0x2da0, 7 },
  3094. [MPM_RESET] = { 0x2da4 },
  3095. [SFAB_SMPSS_S_RESET] = { 0x2e00, 7 },
  3096. [PRNG_RESET] = { 0x2e80, 12 },
  3097. [RIVA_RESET] = { 0x35e0 },
  3098. };
  3099. static struct clk_regmap *gcc_apq8064_clks[] = {
  3100. [PLL3] = &pll3.clkr,
  3101. [PLL4_VOTE] = &pll4_vote,
  3102. [PLL8] = &pll8.clkr,
  3103. [PLL8_VOTE] = &pll8_vote,
  3104. [PLL14] = &pll14.clkr,
  3105. [PLL14_VOTE] = &pll14_vote,
  3106. [GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
  3107. [GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
  3108. [GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
  3109. [GSBI2_UART_CLK] = &gsbi2_uart_clk.clkr,
  3110. [GSBI3_UART_SRC] = &gsbi3_uart_src.clkr,
  3111. [GSBI3_UART_CLK] = &gsbi3_uart_clk.clkr,
  3112. [GSBI4_UART_SRC] = &gsbi4_uart_src.clkr,
  3113. [GSBI4_UART_CLK] = &gsbi4_uart_clk.clkr,
  3114. [GSBI5_UART_SRC] = &gsbi5_uart_src.clkr,
  3115. [GSBI5_UART_CLK] = &gsbi5_uart_clk.clkr,
  3116. [GSBI6_UART_SRC] = &gsbi6_uart_src.clkr,
  3117. [GSBI6_UART_CLK] = &gsbi6_uart_clk.clkr,
  3118. [GSBI7_UART_SRC] = &gsbi7_uart_src.clkr,
  3119. [GSBI7_UART_CLK] = &gsbi7_uart_clk.clkr,
  3120. [GSBI1_QUP_SRC] = &gsbi1_qup_src.clkr,
  3121. [GSBI1_QUP_CLK] = &gsbi1_qup_clk.clkr,
  3122. [GSBI2_QUP_SRC] = &gsbi2_qup_src.clkr,
  3123. [GSBI2_QUP_CLK] = &gsbi2_qup_clk.clkr,
  3124. [GSBI3_QUP_SRC] = &gsbi3_qup_src.clkr,
  3125. [GSBI3_QUP_CLK] = &gsbi3_qup_clk.clkr,
  3126. [GSBI4_QUP_SRC] = &gsbi4_qup_src.clkr,
  3127. [GSBI4_QUP_CLK] = &gsbi4_qup_clk.clkr,
  3128. [GSBI5_QUP_SRC] = &gsbi5_qup_src.clkr,
  3129. [GSBI5_QUP_CLK] = &gsbi5_qup_clk.clkr,
  3130. [GSBI6_QUP_SRC] = &gsbi6_qup_src.clkr,
  3131. [GSBI6_QUP_CLK] = &gsbi6_qup_clk.clkr,
  3132. [GSBI7_QUP_SRC] = &gsbi7_qup_src.clkr,
  3133. [GSBI7_QUP_CLK] = &gsbi7_qup_clk.clkr,
  3134. [GP0_SRC] = &gp0_src.clkr,
  3135. [GP0_CLK] = &gp0_clk.clkr,
  3136. [GP1_SRC] = &gp1_src.clkr,
  3137. [GP1_CLK] = &gp1_clk.clkr,
  3138. [GP2_SRC] = &gp2_src.clkr,
  3139. [GP2_CLK] = &gp2_clk.clkr,
  3140. [PMEM_A_CLK] = &pmem_clk.clkr,
  3141. [PRNG_SRC] = &prng_src.clkr,
  3142. [PRNG_CLK] = &prng_clk.clkr,
  3143. [SDC1_SRC] = &sdc1_src.clkr,
  3144. [SDC1_CLK] = &sdc1_clk.clkr,
  3145. [SDC2_SRC] = &sdc2_src.clkr,
  3146. [SDC2_CLK] = &sdc2_clk.clkr,
  3147. [SDC3_SRC] = &sdc3_src.clkr,
  3148. [SDC3_CLK] = &sdc3_clk.clkr,
  3149. [SDC4_SRC] = &sdc4_src.clkr,
  3150. [SDC4_CLK] = &sdc4_clk.clkr,
  3151. [TSIF_REF_SRC] = &tsif_ref_src.clkr,
  3152. [TSIF_REF_CLK] = &tsif_ref_clk.clkr,
  3153. [USB_HS1_XCVR_SRC] = &usb_hs1_xcvr_src.clkr,
  3154. [USB_HS1_XCVR_CLK] = &usb_hs1_xcvr_clk.clkr,
  3155. [USB_HS3_XCVR_SRC] = &usb_hs3_xcvr_src.clkr,
  3156. [USB_HS3_XCVR_CLK] = &usb_hs3_xcvr_clk.clkr,
  3157. [USB_HS4_XCVR_SRC] = &usb_hs4_xcvr_src.clkr,
  3158. [USB_HS4_XCVR_CLK] = &usb_hs4_xcvr_clk.clkr,
  3159. [USB_HSIC_XCVR_FS_SRC] = &usb_hsic_xcvr_fs_src.clkr,
  3160. [USB_HSIC_XCVR_FS_CLK] = &usb_hsic_xcvr_fs_clk.clkr,
  3161. [USB_HSIC_SYSTEM_CLK] = &usb_hsic_system_clk.clkr,
  3162. [USB_HSIC_HSIC_CLK] = &usb_hsic_hsic_clk.clkr,
  3163. [USB_HSIC_HSIO_CAL_CLK] = &usb_hsic_hsio_cal_clk.clkr,
  3164. [USB_FS1_XCVR_FS_SRC] = &usb_fs1_xcvr_fs_src.clkr,
  3165. [USB_FS1_XCVR_FS_CLK] = &usb_fs1_xcvr_fs_clk.clkr,
  3166. [USB_FS1_SYSTEM_CLK] = &usb_fs1_system_clk.clkr,
  3167. [SATA_H_CLK] = &sata_h_clk.clkr,
  3168. [SATA_CLK_SRC] = &sata_clk_src.clkr,
  3169. [SATA_RXOOB_CLK] = &sata_rxoob_clk.clkr,
  3170. [SATA_PMALIVE_CLK] = &sata_pmalive_clk.clkr,
  3171. [SATA_PHY_REF_CLK] = &sata_phy_ref_clk.clkr,
  3172. [SATA_PHY_CFG_CLK] = &sata_phy_cfg_clk.clkr,
  3173. [SATA_A_CLK] = &sata_a_clk.clkr,
  3174. [SFAB_SATA_S_H_CLK] = &sfab_sata_s_h_clk.clkr,
  3175. [CE3_SRC] = &ce3_src.clkr,
  3176. [CE3_CORE_CLK] = &ce3_core_clk.clkr,
  3177. [CE3_H_CLK] = &ce3_h_clk.clkr,
  3178. [DMA_BAM_H_CLK] = &dma_bam_h_clk.clkr,
  3179. [GSBI1_H_CLK] = &gsbi1_h_clk.clkr,
  3180. [GSBI2_H_CLK] = &gsbi2_h_clk.clkr,
  3181. [GSBI3_H_CLK] = &gsbi3_h_clk.clkr,
  3182. [GSBI4_H_CLK] = &gsbi4_h_clk.clkr,
  3183. [GSBI5_H_CLK] = &gsbi5_h_clk.clkr,
  3184. [GSBI6_H_CLK] = &gsbi6_h_clk.clkr,
  3185. [GSBI7_H_CLK] = &gsbi7_h_clk.clkr,
  3186. [TSIF_H_CLK] = &tsif_h_clk.clkr,
  3187. [USB_FS1_H_CLK] = &usb_fs1_h_clk.clkr,
  3188. [USB_HS1_H_CLK] = &usb_hs1_h_clk.clkr,
  3189. [USB_HSIC_H_CLK] = &usb_hsic_h_clk.clkr,
  3190. [USB_HS3_H_CLK] = &usb_hs3_h_clk.clkr,
  3191. [USB_HS4_H_CLK] = &usb_hs4_h_clk.clkr,
  3192. [SDC1_H_CLK] = &sdc1_h_clk.clkr,
  3193. [SDC2_H_CLK] = &sdc2_h_clk.clkr,
  3194. [SDC3_H_CLK] = &sdc3_h_clk.clkr,
  3195. [SDC4_H_CLK] = &sdc4_h_clk.clkr,
  3196. [ADM0_CLK] = &adm0_clk.clkr,
  3197. [ADM0_PBUS_CLK] = &adm0_pbus_clk.clkr,
  3198. [PCIE_A_CLK] = &pcie_a_clk.clkr,
  3199. [PCIE_PHY_REF_CLK] = &pcie_phy_ref_clk.clkr,
  3200. [PCIE_H_CLK] = &pcie_h_clk.clkr,
  3201. [PMIC_ARB0_H_CLK] = &pmic_arb0_h_clk.clkr,
  3202. [PMIC_ARB1_H_CLK] = &pmic_arb1_h_clk.clkr,
  3203. [PMIC_SSBI2_CLK] = &pmic_ssbi2_clk.clkr,
  3204. [RPM_MSG_RAM_H_CLK] = &rpm_msg_ram_h_clk.clkr,
  3205. };
  3206. static const struct qcom_reset_map gcc_apq8064_resets[] = {
  3207. [QDSS_STM_RESET] = { 0x2060, 6 },
  3208. [AFAB_SMPSS_S_RESET] = { 0x20b8, 2 },
  3209. [AFAB_SMPSS_M1_RESET] = { 0x20b8, 1 },
  3210. [AFAB_SMPSS_M0_RESET] = { 0x20b8 },
  3211. [AFAB_EBI1_CH0_RESET] = { 0x20c0, 7 },
  3212. [AFAB_EBI1_CH1_RESET] = { 0x20c4, 7},
  3213. [SFAB_ADM0_M0_RESET] = { 0x21e0, 7 },
  3214. [SFAB_ADM0_M1_RESET] = { 0x21e4, 7 },
  3215. [SFAB_ADM0_M2_RESET] = { 0x21e8, 7 },
  3216. [ADM0_C2_RESET] = { 0x220c, 4},
  3217. [ADM0_C1_RESET] = { 0x220c, 3},
  3218. [ADM0_C0_RESET] = { 0x220c, 2},
  3219. [ADM0_PBUS_RESET] = { 0x220c, 1 },
  3220. [ADM0_RESET] = { 0x220c },
  3221. [QDSS_CLKS_SW_RESET] = { 0x2260, 5 },
  3222. [QDSS_POR_RESET] = { 0x2260, 4 },
  3223. [QDSS_TSCTR_RESET] = { 0x2260, 3 },
  3224. [QDSS_HRESET_RESET] = { 0x2260, 2 },
  3225. [QDSS_AXI_RESET] = { 0x2260, 1 },
  3226. [QDSS_DBG_RESET] = { 0x2260 },
  3227. [SFAB_PCIE_M_RESET] = { 0x22d8, 1 },
  3228. [SFAB_PCIE_S_RESET] = { 0x22d8 },
  3229. [PCIE_EXT_PCI_RESET] = { 0x22dc, 6 },
  3230. [PCIE_PHY_RESET] = { 0x22dc, 5 },
  3231. [PCIE_PCI_RESET] = { 0x22dc, 4 },
  3232. [PCIE_POR_RESET] = { 0x22dc, 3 },
  3233. [PCIE_HCLK_RESET] = { 0x22dc, 2 },
  3234. [PCIE_ACLK_RESET] = { 0x22dc },
  3235. [SFAB_USB3_M_RESET] = { 0x2360, 7 },
  3236. [SFAB_RIVA_M_RESET] = { 0x2380, 7 },
  3237. [SFAB_LPASS_RESET] = { 0x23a0, 7 },
  3238. [SFAB_AFAB_M_RESET] = { 0x23e0, 7 },
  3239. [AFAB_SFAB_M0_RESET] = { 0x2420, 7 },
  3240. [AFAB_SFAB_M1_RESET] = { 0x2424, 7 },
  3241. [SFAB_SATA_S_RESET] = { 0x2480, 7 },
  3242. [SFAB_DFAB_M_RESET] = { 0x2500, 7 },
  3243. [DFAB_SFAB_M_RESET] = { 0x2520, 7 },
  3244. [DFAB_SWAY0_RESET] = { 0x2540, 7 },
  3245. [DFAB_SWAY1_RESET] = { 0x2544, 7 },
  3246. [DFAB_ARB0_RESET] = { 0x2560, 7 },
  3247. [DFAB_ARB1_RESET] = { 0x2564, 7 },
  3248. [PPSS_PROC_RESET] = { 0x2594, 1 },
  3249. [PPSS_RESET] = { 0x2594},
  3250. [DMA_BAM_RESET] = { 0x25c0, 7 },
  3251. [SPS_TIC_H_RESET] = { 0x2600, 7 },
  3252. [SFAB_CFPB_M_RESET] = { 0x2680, 7 },
  3253. [SFAB_CFPB_S_RESET] = { 0x26c0, 7 },
  3254. [TSIF_H_RESET] = { 0x2700, 7 },
  3255. [CE1_H_RESET] = { 0x2720, 7 },
  3256. [CE1_CORE_RESET] = { 0x2724, 7 },
  3257. [CE1_SLEEP_RESET] = { 0x2728, 7 },
  3258. [CE2_H_RESET] = { 0x2740, 7 },
  3259. [CE2_CORE_RESET] = { 0x2744, 7 },
  3260. [SFAB_SFPB_M_RESET] = { 0x2780, 7 },
  3261. [SFAB_SFPB_S_RESET] = { 0x27a0, 7 },
  3262. [RPM_PROC_RESET] = { 0x27c0, 7 },
  3263. [PMIC_SSBI2_RESET] = { 0x280c, 12 },
  3264. [SDC1_RESET] = { 0x2830 },
  3265. [SDC2_RESET] = { 0x2850 },
  3266. [SDC3_RESET] = { 0x2870 },
  3267. [SDC4_RESET] = { 0x2890 },
  3268. [USB_HS1_RESET] = { 0x2910 },
  3269. [USB_HSIC_RESET] = { 0x2934 },
  3270. [USB_FS1_XCVR_RESET] = { 0x2974, 1 },
  3271. [USB_FS1_RESET] = { 0x2974 },
  3272. [GSBI1_RESET] = { 0x29dc },
  3273. [GSBI2_RESET] = { 0x29fc },
  3274. [GSBI3_RESET] = { 0x2a1c },
  3275. [GSBI4_RESET] = { 0x2a3c },
  3276. [GSBI5_RESET] = { 0x2a5c },
  3277. [GSBI6_RESET] = { 0x2a7c },
  3278. [GSBI7_RESET] = { 0x2a9c },
  3279. [SPDM_RESET] = { 0x2b6c },
  3280. [TLMM_H_RESET] = { 0x2ba0, 7 },
  3281. [SATA_SFAB_M_RESET] = { 0x2c18 },
  3282. [SATA_RESET] = { 0x2c1c },
  3283. [GSS_SLP_RESET] = { 0x2c60, 7 },
  3284. [GSS_RESET] = { 0x2c64 },
  3285. [TSSC_RESET] = { 0x2ca0, 7 },
  3286. [PDM_RESET] = { 0x2cc0, 12 },
  3287. [MPM_H_RESET] = { 0x2da0, 7 },
  3288. [MPM_RESET] = { 0x2da4 },
  3289. [SFAB_SMPSS_S_RESET] = { 0x2e00, 7 },
  3290. [PRNG_RESET] = { 0x2e80, 12 },
  3291. [RIVA_RESET] = { 0x35e0 },
  3292. [CE3_H_RESET] = { 0x36c4, 7 },
  3293. [SFAB_CE3_M_RESET] = { 0x36c8, 1 },
  3294. [SFAB_CE3_S_RESET] = { 0x36c8 },
  3295. [CE3_RESET] = { 0x36cc, 7 },
  3296. [CE3_SLEEP_RESET] = { 0x36d0, 7 },
  3297. [USB_HS3_RESET] = { 0x3710 },
  3298. [USB_HS4_RESET] = { 0x3730 },
  3299. };
  3300. static const struct regmap_config gcc_msm8960_regmap_config = {
  3301. .reg_bits = 32,
  3302. .reg_stride = 4,
  3303. .val_bits = 32,
  3304. .max_register = 0x3660,
  3305. .fast_io = true,
  3306. };
  3307. static const struct regmap_config gcc_apq8064_regmap_config = {
  3308. .reg_bits = 32,
  3309. .reg_stride = 4,
  3310. .val_bits = 32,
  3311. .max_register = 0x3880,
  3312. .fast_io = true,
  3313. };
  3314. static const struct qcom_cc_desc gcc_msm8960_desc = {
  3315. .config = &gcc_msm8960_regmap_config,
  3316. .clks = gcc_msm8960_clks,
  3317. .num_clks = ARRAY_SIZE(gcc_msm8960_clks),
  3318. .resets = gcc_msm8960_resets,
  3319. .num_resets = ARRAY_SIZE(gcc_msm8960_resets),
  3320. };
  3321. static const struct qcom_cc_desc gcc_apq8064_desc = {
  3322. .config = &gcc_apq8064_regmap_config,
  3323. .clks = gcc_apq8064_clks,
  3324. .num_clks = ARRAY_SIZE(gcc_apq8064_clks),
  3325. .resets = gcc_apq8064_resets,
  3326. .num_resets = ARRAY_SIZE(gcc_apq8064_resets),
  3327. };
  3328. static const struct of_device_id gcc_msm8960_match_table[] = {
  3329. { .compatible = "qcom,gcc-msm8960", .data = &gcc_msm8960_desc },
  3330. { .compatible = "qcom,gcc-apq8064", .data = &gcc_apq8064_desc },
  3331. { }
  3332. };
  3333. MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table);
  3334. static int gcc_msm8960_probe(struct platform_device *pdev)
  3335. {
  3336. struct clk *clk;
  3337. struct device *dev = &pdev->dev;
  3338. const struct of_device_id *match;
  3339. struct platform_device *tsens;
  3340. int ret;
  3341. match = of_match_device(gcc_msm8960_match_table, &pdev->dev);
  3342. if (!match)
  3343. return -EINVAL;
  3344. /* Temporary until RPM clocks supported */
  3345. clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000);
  3346. if (IS_ERR(clk))
  3347. return PTR_ERR(clk);
  3348. clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 27000000);
  3349. if (IS_ERR(clk))
  3350. return PTR_ERR(clk);
  3351. ret = qcom_cc_probe(pdev, match->data);
  3352. if (ret)
  3353. return ret;
  3354. tsens = platform_device_register_data(&pdev->dev, "qcom-tsens", -1,
  3355. NULL, 0);
  3356. if (IS_ERR(tsens))
  3357. return PTR_ERR(tsens);
  3358. platform_set_drvdata(pdev, tsens);
  3359. return 0;
  3360. }
  3361. static int gcc_msm8960_remove(struct platform_device *pdev)
  3362. {
  3363. struct platform_device *tsens = platform_get_drvdata(pdev);
  3364. platform_device_unregister(tsens);
  3365. return 0;
  3366. }
  3367. static struct platform_driver gcc_msm8960_driver = {
  3368. .probe = gcc_msm8960_probe,
  3369. .remove = gcc_msm8960_remove,
  3370. .driver = {
  3371. .name = "gcc-msm8960",
  3372. .of_match_table = gcc_msm8960_match_table,
  3373. },
  3374. };
  3375. static int __init gcc_msm8960_init(void)
  3376. {
  3377. return platform_driver_register(&gcc_msm8960_driver);
  3378. }
  3379. core_initcall(gcc_msm8960_init);
  3380. static void __exit gcc_msm8960_exit(void)
  3381. {
  3382. platform_driver_unregister(&gcc_msm8960_driver);
  3383. }
  3384. module_exit(gcc_msm8960_exit);
  3385. MODULE_DESCRIPTION("QCOM GCC MSM8960 Driver");
  3386. MODULE_LICENSE("GPL v2");
  3387. MODULE_ALIAS("platform:gcc-msm8960");