gcc-msm8660.c 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760
  1. /*
  2. * Copyright (c) 2013, The Linux Foundation. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/bitops.h>
  15. #include <linux/err.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/module.h>
  18. #include <linux/of.h>
  19. #include <linux/of_device.h>
  20. #include <linux/clk-provider.h>
  21. #include <linux/regmap.h>
  22. #include <linux/reset-controller.h>
  23. #include <dt-bindings/clock/qcom,gcc-msm8660.h>
  24. #include <dt-bindings/reset/qcom,gcc-msm8660.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 pll8 = {
  32. .l_reg = 0x3144,
  33. .m_reg = 0x3148,
  34. .n_reg = 0x314c,
  35. .config_reg = 0x3154,
  36. .mode_reg = 0x3140,
  37. .status_reg = 0x3158,
  38. .status_bit = 16,
  39. .clkr.hw.init = &(struct clk_init_data){
  40. .name = "pll8",
  41. .parent_names = (const char *[]){ "pxo" },
  42. .num_parents = 1,
  43. .ops = &clk_pll_ops,
  44. },
  45. };
  46. static struct clk_regmap pll8_vote = {
  47. .enable_reg = 0x34c0,
  48. .enable_mask = BIT(8),
  49. .hw.init = &(struct clk_init_data){
  50. .name = "pll8_vote",
  51. .parent_names = (const char *[]){ "pll8" },
  52. .num_parents = 1,
  53. .ops = &clk_pll_vote_ops,
  54. },
  55. };
  56. enum {
  57. P_PXO,
  58. P_PLL8,
  59. P_CXO,
  60. };
  61. static const struct parent_map gcc_pxo_pll8_map[] = {
  62. { P_PXO, 0 },
  63. { P_PLL8, 3 }
  64. };
  65. static const char * const gcc_pxo_pll8[] = {
  66. "pxo",
  67. "pll8_vote",
  68. };
  69. static const struct parent_map gcc_pxo_pll8_cxo_map[] = {
  70. { P_PXO, 0 },
  71. { P_PLL8, 3 },
  72. { P_CXO, 5 }
  73. };
  74. static const char * const gcc_pxo_pll8_cxo[] = {
  75. "pxo",
  76. "pll8_vote",
  77. "cxo",
  78. };
  79. static struct freq_tbl clk_tbl_gsbi_uart[] = {
  80. { 1843200, P_PLL8, 2, 6, 625 },
  81. { 3686400, P_PLL8, 2, 12, 625 },
  82. { 7372800, P_PLL8, 2, 24, 625 },
  83. { 14745600, P_PLL8, 2, 48, 625 },
  84. { 16000000, P_PLL8, 4, 1, 6 },
  85. { 24000000, P_PLL8, 4, 1, 4 },
  86. { 32000000, P_PLL8, 4, 1, 3 },
  87. { 40000000, P_PLL8, 1, 5, 48 },
  88. { 46400000, P_PLL8, 1, 29, 240 },
  89. { 48000000, P_PLL8, 4, 1, 2 },
  90. { 51200000, P_PLL8, 1, 2, 15 },
  91. { 56000000, P_PLL8, 1, 7, 48 },
  92. { 58982400, P_PLL8, 1, 96, 625 },
  93. { 64000000, P_PLL8, 2, 1, 3 },
  94. { }
  95. };
  96. static struct clk_rcg gsbi1_uart_src = {
  97. .ns_reg = 0x29d4,
  98. .md_reg = 0x29d0,
  99. .mn = {
  100. .mnctr_en_bit = 8,
  101. .mnctr_reset_bit = 7,
  102. .mnctr_mode_shift = 5,
  103. .n_val_shift = 16,
  104. .m_val_shift = 16,
  105. .width = 16,
  106. },
  107. .p = {
  108. .pre_div_shift = 3,
  109. .pre_div_width = 2,
  110. },
  111. .s = {
  112. .src_sel_shift = 0,
  113. .parent_map = gcc_pxo_pll8_map,
  114. },
  115. .freq_tbl = clk_tbl_gsbi_uart,
  116. .clkr = {
  117. .enable_reg = 0x29d4,
  118. .enable_mask = BIT(11),
  119. .hw.init = &(struct clk_init_data){
  120. .name = "gsbi1_uart_src",
  121. .parent_names = gcc_pxo_pll8,
  122. .num_parents = 2,
  123. .ops = &clk_rcg_ops,
  124. .flags = CLK_SET_PARENT_GATE,
  125. },
  126. },
  127. };
  128. static struct clk_branch gsbi1_uart_clk = {
  129. .halt_reg = 0x2fcc,
  130. .halt_bit = 10,
  131. .clkr = {
  132. .enable_reg = 0x29d4,
  133. .enable_mask = BIT(9),
  134. .hw.init = &(struct clk_init_data){
  135. .name = "gsbi1_uart_clk",
  136. .parent_names = (const char *[]){
  137. "gsbi1_uart_src",
  138. },
  139. .num_parents = 1,
  140. .ops = &clk_branch_ops,
  141. .flags = CLK_SET_RATE_PARENT,
  142. },
  143. },
  144. };
  145. static struct clk_rcg gsbi2_uart_src = {
  146. .ns_reg = 0x29f4,
  147. .md_reg = 0x29f0,
  148. .mn = {
  149. .mnctr_en_bit = 8,
  150. .mnctr_reset_bit = 7,
  151. .mnctr_mode_shift = 5,
  152. .n_val_shift = 16,
  153. .m_val_shift = 16,
  154. .width = 16,
  155. },
  156. .p = {
  157. .pre_div_shift = 3,
  158. .pre_div_width = 2,
  159. },
  160. .s = {
  161. .src_sel_shift = 0,
  162. .parent_map = gcc_pxo_pll8_map,
  163. },
  164. .freq_tbl = clk_tbl_gsbi_uart,
  165. .clkr = {
  166. .enable_reg = 0x29f4,
  167. .enable_mask = BIT(11),
  168. .hw.init = &(struct clk_init_data){
  169. .name = "gsbi2_uart_src",
  170. .parent_names = gcc_pxo_pll8,
  171. .num_parents = 2,
  172. .ops = &clk_rcg_ops,
  173. .flags = CLK_SET_PARENT_GATE,
  174. },
  175. },
  176. };
  177. static struct clk_branch gsbi2_uart_clk = {
  178. .halt_reg = 0x2fcc,
  179. .halt_bit = 6,
  180. .clkr = {
  181. .enable_reg = 0x29f4,
  182. .enable_mask = BIT(9),
  183. .hw.init = &(struct clk_init_data){
  184. .name = "gsbi2_uart_clk",
  185. .parent_names = (const char *[]){
  186. "gsbi2_uart_src",
  187. },
  188. .num_parents = 1,
  189. .ops = &clk_branch_ops,
  190. .flags = CLK_SET_RATE_PARENT,
  191. },
  192. },
  193. };
  194. static struct clk_rcg gsbi3_uart_src = {
  195. .ns_reg = 0x2a14,
  196. .md_reg = 0x2a10,
  197. .mn = {
  198. .mnctr_en_bit = 8,
  199. .mnctr_reset_bit = 7,
  200. .mnctr_mode_shift = 5,
  201. .n_val_shift = 16,
  202. .m_val_shift = 16,
  203. .width = 16,
  204. },
  205. .p = {
  206. .pre_div_shift = 3,
  207. .pre_div_width = 2,
  208. },
  209. .s = {
  210. .src_sel_shift = 0,
  211. .parent_map = gcc_pxo_pll8_map,
  212. },
  213. .freq_tbl = clk_tbl_gsbi_uart,
  214. .clkr = {
  215. .enable_reg = 0x2a14,
  216. .enable_mask = BIT(11),
  217. .hw.init = &(struct clk_init_data){
  218. .name = "gsbi3_uart_src",
  219. .parent_names = gcc_pxo_pll8,
  220. .num_parents = 2,
  221. .ops = &clk_rcg_ops,
  222. .flags = CLK_SET_PARENT_GATE,
  223. },
  224. },
  225. };
  226. static struct clk_branch gsbi3_uart_clk = {
  227. .halt_reg = 0x2fcc,
  228. .halt_bit = 2,
  229. .clkr = {
  230. .enable_reg = 0x2a14,
  231. .enable_mask = BIT(9),
  232. .hw.init = &(struct clk_init_data){
  233. .name = "gsbi3_uart_clk",
  234. .parent_names = (const char *[]){
  235. "gsbi3_uart_src",
  236. },
  237. .num_parents = 1,
  238. .ops = &clk_branch_ops,
  239. .flags = CLK_SET_RATE_PARENT,
  240. },
  241. },
  242. };
  243. static struct clk_rcg gsbi4_uart_src = {
  244. .ns_reg = 0x2a34,
  245. .md_reg = 0x2a30,
  246. .mn = {
  247. .mnctr_en_bit = 8,
  248. .mnctr_reset_bit = 7,
  249. .mnctr_mode_shift = 5,
  250. .n_val_shift = 16,
  251. .m_val_shift = 16,
  252. .width = 16,
  253. },
  254. .p = {
  255. .pre_div_shift = 3,
  256. .pre_div_width = 2,
  257. },
  258. .s = {
  259. .src_sel_shift = 0,
  260. .parent_map = gcc_pxo_pll8_map,
  261. },
  262. .freq_tbl = clk_tbl_gsbi_uart,
  263. .clkr = {
  264. .enable_reg = 0x2a34,
  265. .enable_mask = BIT(11),
  266. .hw.init = &(struct clk_init_data){
  267. .name = "gsbi4_uart_src",
  268. .parent_names = gcc_pxo_pll8,
  269. .num_parents = 2,
  270. .ops = &clk_rcg_ops,
  271. .flags = CLK_SET_PARENT_GATE,
  272. },
  273. },
  274. };
  275. static struct clk_branch gsbi4_uart_clk = {
  276. .halt_reg = 0x2fd0,
  277. .halt_bit = 26,
  278. .clkr = {
  279. .enable_reg = 0x2a34,
  280. .enable_mask = BIT(9),
  281. .hw.init = &(struct clk_init_data){
  282. .name = "gsbi4_uart_clk",
  283. .parent_names = (const char *[]){
  284. "gsbi4_uart_src",
  285. },
  286. .num_parents = 1,
  287. .ops = &clk_branch_ops,
  288. .flags = CLK_SET_RATE_PARENT,
  289. },
  290. },
  291. };
  292. static struct clk_rcg gsbi5_uart_src = {
  293. .ns_reg = 0x2a54,
  294. .md_reg = 0x2a50,
  295. .mn = {
  296. .mnctr_en_bit = 8,
  297. .mnctr_reset_bit = 7,
  298. .mnctr_mode_shift = 5,
  299. .n_val_shift = 16,
  300. .m_val_shift = 16,
  301. .width = 16,
  302. },
  303. .p = {
  304. .pre_div_shift = 3,
  305. .pre_div_width = 2,
  306. },
  307. .s = {
  308. .src_sel_shift = 0,
  309. .parent_map = gcc_pxo_pll8_map,
  310. },
  311. .freq_tbl = clk_tbl_gsbi_uart,
  312. .clkr = {
  313. .enable_reg = 0x2a54,
  314. .enable_mask = BIT(11),
  315. .hw.init = &(struct clk_init_data){
  316. .name = "gsbi5_uart_src",
  317. .parent_names = gcc_pxo_pll8,
  318. .num_parents = 2,
  319. .ops = &clk_rcg_ops,
  320. .flags = CLK_SET_PARENT_GATE,
  321. },
  322. },
  323. };
  324. static struct clk_branch gsbi5_uart_clk = {
  325. .halt_reg = 0x2fd0,
  326. .halt_bit = 22,
  327. .clkr = {
  328. .enable_reg = 0x2a54,
  329. .enable_mask = BIT(9),
  330. .hw.init = &(struct clk_init_data){
  331. .name = "gsbi5_uart_clk",
  332. .parent_names = (const char *[]){
  333. "gsbi5_uart_src",
  334. },
  335. .num_parents = 1,
  336. .ops = &clk_branch_ops,
  337. .flags = CLK_SET_RATE_PARENT,
  338. },
  339. },
  340. };
  341. static struct clk_rcg gsbi6_uart_src = {
  342. .ns_reg = 0x2a74,
  343. .md_reg = 0x2a70,
  344. .mn = {
  345. .mnctr_en_bit = 8,
  346. .mnctr_reset_bit = 7,
  347. .mnctr_mode_shift = 5,
  348. .n_val_shift = 16,
  349. .m_val_shift = 16,
  350. .width = 16,
  351. },
  352. .p = {
  353. .pre_div_shift = 3,
  354. .pre_div_width = 2,
  355. },
  356. .s = {
  357. .src_sel_shift = 0,
  358. .parent_map = gcc_pxo_pll8_map,
  359. },
  360. .freq_tbl = clk_tbl_gsbi_uart,
  361. .clkr = {
  362. .enable_reg = 0x2a74,
  363. .enable_mask = BIT(11),
  364. .hw.init = &(struct clk_init_data){
  365. .name = "gsbi6_uart_src",
  366. .parent_names = gcc_pxo_pll8,
  367. .num_parents = 2,
  368. .ops = &clk_rcg_ops,
  369. .flags = CLK_SET_PARENT_GATE,
  370. },
  371. },
  372. };
  373. static struct clk_branch gsbi6_uart_clk = {
  374. .halt_reg = 0x2fd0,
  375. .halt_bit = 18,
  376. .clkr = {
  377. .enable_reg = 0x2a74,
  378. .enable_mask = BIT(9),
  379. .hw.init = &(struct clk_init_data){
  380. .name = "gsbi6_uart_clk",
  381. .parent_names = (const char *[]){
  382. "gsbi6_uart_src",
  383. },
  384. .num_parents = 1,
  385. .ops = &clk_branch_ops,
  386. .flags = CLK_SET_RATE_PARENT,
  387. },
  388. },
  389. };
  390. static struct clk_rcg gsbi7_uart_src = {
  391. .ns_reg = 0x2a94,
  392. .md_reg = 0x2a90,
  393. .mn = {
  394. .mnctr_en_bit = 8,
  395. .mnctr_reset_bit = 7,
  396. .mnctr_mode_shift = 5,
  397. .n_val_shift = 16,
  398. .m_val_shift = 16,
  399. .width = 16,
  400. },
  401. .p = {
  402. .pre_div_shift = 3,
  403. .pre_div_width = 2,
  404. },
  405. .s = {
  406. .src_sel_shift = 0,
  407. .parent_map = gcc_pxo_pll8_map,
  408. },
  409. .freq_tbl = clk_tbl_gsbi_uart,
  410. .clkr = {
  411. .enable_reg = 0x2a94,
  412. .enable_mask = BIT(11),
  413. .hw.init = &(struct clk_init_data){
  414. .name = "gsbi7_uart_src",
  415. .parent_names = gcc_pxo_pll8,
  416. .num_parents = 2,
  417. .ops = &clk_rcg_ops,
  418. .flags = CLK_SET_PARENT_GATE,
  419. },
  420. },
  421. };
  422. static struct clk_branch gsbi7_uart_clk = {
  423. .halt_reg = 0x2fd0,
  424. .halt_bit = 14,
  425. .clkr = {
  426. .enable_reg = 0x2a94,
  427. .enable_mask = BIT(9),
  428. .hw.init = &(struct clk_init_data){
  429. .name = "gsbi7_uart_clk",
  430. .parent_names = (const char *[]){
  431. "gsbi7_uart_src",
  432. },
  433. .num_parents = 1,
  434. .ops = &clk_branch_ops,
  435. .flags = CLK_SET_RATE_PARENT,
  436. },
  437. },
  438. };
  439. static struct clk_rcg gsbi8_uart_src = {
  440. .ns_reg = 0x2ab4,
  441. .md_reg = 0x2ab0,
  442. .mn = {
  443. .mnctr_en_bit = 8,
  444. .mnctr_reset_bit = 7,
  445. .mnctr_mode_shift = 5,
  446. .n_val_shift = 16,
  447. .m_val_shift = 16,
  448. .width = 16,
  449. },
  450. .p = {
  451. .pre_div_shift = 3,
  452. .pre_div_width = 2,
  453. },
  454. .s = {
  455. .src_sel_shift = 0,
  456. .parent_map = gcc_pxo_pll8_map,
  457. },
  458. .freq_tbl = clk_tbl_gsbi_uart,
  459. .clkr = {
  460. .enable_reg = 0x2ab4,
  461. .enable_mask = BIT(11),
  462. .hw.init = &(struct clk_init_data){
  463. .name = "gsbi8_uart_src",
  464. .parent_names = gcc_pxo_pll8,
  465. .num_parents = 2,
  466. .ops = &clk_rcg_ops,
  467. .flags = CLK_SET_PARENT_GATE,
  468. },
  469. },
  470. };
  471. static struct clk_branch gsbi8_uart_clk = {
  472. .halt_reg = 0x2fd0,
  473. .halt_bit = 10,
  474. .clkr = {
  475. .enable_reg = 0x2ab4,
  476. .enable_mask = BIT(9),
  477. .hw.init = &(struct clk_init_data){
  478. .name = "gsbi8_uart_clk",
  479. .parent_names = (const char *[]){ "gsbi8_uart_src" },
  480. .num_parents = 1,
  481. .ops = &clk_branch_ops,
  482. .flags = CLK_SET_RATE_PARENT,
  483. },
  484. },
  485. };
  486. static struct clk_rcg gsbi9_uart_src = {
  487. .ns_reg = 0x2ad4,
  488. .md_reg = 0x2ad0,
  489. .mn = {
  490. .mnctr_en_bit = 8,
  491. .mnctr_reset_bit = 7,
  492. .mnctr_mode_shift = 5,
  493. .n_val_shift = 16,
  494. .m_val_shift = 16,
  495. .width = 16,
  496. },
  497. .p = {
  498. .pre_div_shift = 3,
  499. .pre_div_width = 2,
  500. },
  501. .s = {
  502. .src_sel_shift = 0,
  503. .parent_map = gcc_pxo_pll8_map,
  504. },
  505. .freq_tbl = clk_tbl_gsbi_uart,
  506. .clkr = {
  507. .enable_reg = 0x2ad4,
  508. .enable_mask = BIT(11),
  509. .hw.init = &(struct clk_init_data){
  510. .name = "gsbi9_uart_src",
  511. .parent_names = gcc_pxo_pll8,
  512. .num_parents = 2,
  513. .ops = &clk_rcg_ops,
  514. .flags = CLK_SET_PARENT_GATE,
  515. },
  516. },
  517. };
  518. static struct clk_branch gsbi9_uart_clk = {
  519. .halt_reg = 0x2fd0,
  520. .halt_bit = 6,
  521. .clkr = {
  522. .enable_reg = 0x2ad4,
  523. .enable_mask = BIT(9),
  524. .hw.init = &(struct clk_init_data){
  525. .name = "gsbi9_uart_clk",
  526. .parent_names = (const char *[]){ "gsbi9_uart_src" },
  527. .num_parents = 1,
  528. .ops = &clk_branch_ops,
  529. .flags = CLK_SET_RATE_PARENT,
  530. },
  531. },
  532. };
  533. static struct clk_rcg gsbi10_uart_src = {
  534. .ns_reg = 0x2af4,
  535. .md_reg = 0x2af0,
  536. .mn = {
  537. .mnctr_en_bit = 8,
  538. .mnctr_reset_bit = 7,
  539. .mnctr_mode_shift = 5,
  540. .n_val_shift = 16,
  541. .m_val_shift = 16,
  542. .width = 16,
  543. },
  544. .p = {
  545. .pre_div_shift = 3,
  546. .pre_div_width = 2,
  547. },
  548. .s = {
  549. .src_sel_shift = 0,
  550. .parent_map = gcc_pxo_pll8_map,
  551. },
  552. .freq_tbl = clk_tbl_gsbi_uart,
  553. .clkr = {
  554. .enable_reg = 0x2af4,
  555. .enable_mask = BIT(11),
  556. .hw.init = &(struct clk_init_data){
  557. .name = "gsbi10_uart_src",
  558. .parent_names = gcc_pxo_pll8,
  559. .num_parents = 2,
  560. .ops = &clk_rcg_ops,
  561. .flags = CLK_SET_PARENT_GATE,
  562. },
  563. },
  564. };
  565. static struct clk_branch gsbi10_uart_clk = {
  566. .halt_reg = 0x2fd0,
  567. .halt_bit = 2,
  568. .clkr = {
  569. .enable_reg = 0x2af4,
  570. .enable_mask = BIT(9),
  571. .hw.init = &(struct clk_init_data){
  572. .name = "gsbi10_uart_clk",
  573. .parent_names = (const char *[]){ "gsbi10_uart_src" },
  574. .num_parents = 1,
  575. .ops = &clk_branch_ops,
  576. .flags = CLK_SET_RATE_PARENT,
  577. },
  578. },
  579. };
  580. static struct clk_rcg gsbi11_uart_src = {
  581. .ns_reg = 0x2b14,
  582. .md_reg = 0x2b10,
  583. .mn = {
  584. .mnctr_en_bit = 8,
  585. .mnctr_reset_bit = 7,
  586. .mnctr_mode_shift = 5,
  587. .n_val_shift = 16,
  588. .m_val_shift = 16,
  589. .width = 16,
  590. },
  591. .p = {
  592. .pre_div_shift = 3,
  593. .pre_div_width = 2,
  594. },
  595. .s = {
  596. .src_sel_shift = 0,
  597. .parent_map = gcc_pxo_pll8_map,
  598. },
  599. .freq_tbl = clk_tbl_gsbi_uart,
  600. .clkr = {
  601. .enable_reg = 0x2b14,
  602. .enable_mask = BIT(11),
  603. .hw.init = &(struct clk_init_data){
  604. .name = "gsbi11_uart_src",
  605. .parent_names = gcc_pxo_pll8,
  606. .num_parents = 2,
  607. .ops = &clk_rcg_ops,
  608. .flags = CLK_SET_PARENT_GATE,
  609. },
  610. },
  611. };
  612. static struct clk_branch gsbi11_uart_clk = {
  613. .halt_reg = 0x2fd4,
  614. .halt_bit = 17,
  615. .clkr = {
  616. .enable_reg = 0x2b14,
  617. .enable_mask = BIT(9),
  618. .hw.init = &(struct clk_init_data){
  619. .name = "gsbi11_uart_clk",
  620. .parent_names = (const char *[]){ "gsbi11_uart_src" },
  621. .num_parents = 1,
  622. .ops = &clk_branch_ops,
  623. .flags = CLK_SET_RATE_PARENT,
  624. },
  625. },
  626. };
  627. static struct clk_rcg gsbi12_uart_src = {
  628. .ns_reg = 0x2b34,
  629. .md_reg = 0x2b30,
  630. .mn = {
  631. .mnctr_en_bit = 8,
  632. .mnctr_reset_bit = 7,
  633. .mnctr_mode_shift = 5,
  634. .n_val_shift = 16,
  635. .m_val_shift = 16,
  636. .width = 16,
  637. },
  638. .p = {
  639. .pre_div_shift = 3,
  640. .pre_div_width = 2,
  641. },
  642. .s = {
  643. .src_sel_shift = 0,
  644. .parent_map = gcc_pxo_pll8_map,
  645. },
  646. .freq_tbl = clk_tbl_gsbi_uart,
  647. .clkr = {
  648. .enable_reg = 0x2b34,
  649. .enable_mask = BIT(11),
  650. .hw.init = &(struct clk_init_data){
  651. .name = "gsbi12_uart_src",
  652. .parent_names = gcc_pxo_pll8,
  653. .num_parents = 2,
  654. .ops = &clk_rcg_ops,
  655. .flags = CLK_SET_PARENT_GATE,
  656. },
  657. },
  658. };
  659. static struct clk_branch gsbi12_uart_clk = {
  660. .halt_reg = 0x2fd4,
  661. .halt_bit = 13,
  662. .clkr = {
  663. .enable_reg = 0x2b34,
  664. .enable_mask = BIT(9),
  665. .hw.init = &(struct clk_init_data){
  666. .name = "gsbi12_uart_clk",
  667. .parent_names = (const char *[]){ "gsbi12_uart_src" },
  668. .num_parents = 1,
  669. .ops = &clk_branch_ops,
  670. .flags = CLK_SET_RATE_PARENT,
  671. },
  672. },
  673. };
  674. static struct freq_tbl clk_tbl_gsbi_qup[] = {
  675. { 1100000, P_PXO, 1, 2, 49 },
  676. { 5400000, P_PXO, 1, 1, 5 },
  677. { 10800000, P_PXO, 1, 2, 5 },
  678. { 15060000, P_PLL8, 1, 2, 51 },
  679. { 24000000, P_PLL8, 4, 1, 4 },
  680. { 25600000, P_PLL8, 1, 1, 15 },
  681. { 27000000, P_PXO, 1, 0, 0 },
  682. { 48000000, P_PLL8, 4, 1, 2 },
  683. { 51200000, P_PLL8, 1, 2, 15 },
  684. { }
  685. };
  686. static struct clk_rcg gsbi1_qup_src = {
  687. .ns_reg = 0x29cc,
  688. .md_reg = 0x29c8,
  689. .mn = {
  690. .mnctr_en_bit = 8,
  691. .mnctr_reset_bit = 7,
  692. .mnctr_mode_shift = 5,
  693. .n_val_shift = 16,
  694. .m_val_shift = 16,
  695. .width = 8,
  696. },
  697. .p = {
  698. .pre_div_shift = 3,
  699. .pre_div_width = 2,
  700. },
  701. .s = {
  702. .src_sel_shift = 0,
  703. .parent_map = gcc_pxo_pll8_map,
  704. },
  705. .freq_tbl = clk_tbl_gsbi_qup,
  706. .clkr = {
  707. .enable_reg = 0x29cc,
  708. .enable_mask = BIT(11),
  709. .hw.init = &(struct clk_init_data){
  710. .name = "gsbi1_qup_src",
  711. .parent_names = gcc_pxo_pll8,
  712. .num_parents = 2,
  713. .ops = &clk_rcg_ops,
  714. .flags = CLK_SET_PARENT_GATE,
  715. },
  716. },
  717. };
  718. static struct clk_branch gsbi1_qup_clk = {
  719. .halt_reg = 0x2fcc,
  720. .halt_bit = 9,
  721. .clkr = {
  722. .enable_reg = 0x29cc,
  723. .enable_mask = BIT(9),
  724. .hw.init = &(struct clk_init_data){
  725. .name = "gsbi1_qup_clk",
  726. .parent_names = (const char *[]){ "gsbi1_qup_src" },
  727. .num_parents = 1,
  728. .ops = &clk_branch_ops,
  729. .flags = CLK_SET_RATE_PARENT,
  730. },
  731. },
  732. };
  733. static struct clk_rcg gsbi2_qup_src = {
  734. .ns_reg = 0x29ec,
  735. .md_reg = 0x29e8,
  736. .mn = {
  737. .mnctr_en_bit = 8,
  738. .mnctr_reset_bit = 7,
  739. .mnctr_mode_shift = 5,
  740. .n_val_shift = 16,
  741. .m_val_shift = 16,
  742. .width = 8,
  743. },
  744. .p = {
  745. .pre_div_shift = 3,
  746. .pre_div_width = 2,
  747. },
  748. .s = {
  749. .src_sel_shift = 0,
  750. .parent_map = gcc_pxo_pll8_map,
  751. },
  752. .freq_tbl = clk_tbl_gsbi_qup,
  753. .clkr = {
  754. .enable_reg = 0x29ec,
  755. .enable_mask = BIT(11),
  756. .hw.init = &(struct clk_init_data){
  757. .name = "gsbi2_qup_src",
  758. .parent_names = gcc_pxo_pll8,
  759. .num_parents = 2,
  760. .ops = &clk_rcg_ops,
  761. .flags = CLK_SET_PARENT_GATE,
  762. },
  763. },
  764. };
  765. static struct clk_branch gsbi2_qup_clk = {
  766. .halt_reg = 0x2fcc,
  767. .halt_bit = 4,
  768. .clkr = {
  769. .enable_reg = 0x29ec,
  770. .enable_mask = BIT(9),
  771. .hw.init = &(struct clk_init_data){
  772. .name = "gsbi2_qup_clk",
  773. .parent_names = (const char *[]){ "gsbi2_qup_src" },
  774. .num_parents = 1,
  775. .ops = &clk_branch_ops,
  776. .flags = CLK_SET_RATE_PARENT,
  777. },
  778. },
  779. };
  780. static struct clk_rcg gsbi3_qup_src = {
  781. .ns_reg = 0x2a0c,
  782. .md_reg = 0x2a08,
  783. .mn = {
  784. .mnctr_en_bit = 8,
  785. .mnctr_reset_bit = 7,
  786. .mnctr_mode_shift = 5,
  787. .n_val_shift = 16,
  788. .m_val_shift = 16,
  789. .width = 8,
  790. },
  791. .p = {
  792. .pre_div_shift = 3,
  793. .pre_div_width = 2,
  794. },
  795. .s = {
  796. .src_sel_shift = 0,
  797. .parent_map = gcc_pxo_pll8_map,
  798. },
  799. .freq_tbl = clk_tbl_gsbi_qup,
  800. .clkr = {
  801. .enable_reg = 0x2a0c,
  802. .enable_mask = BIT(11),
  803. .hw.init = &(struct clk_init_data){
  804. .name = "gsbi3_qup_src",
  805. .parent_names = gcc_pxo_pll8,
  806. .num_parents = 2,
  807. .ops = &clk_rcg_ops,
  808. .flags = CLK_SET_PARENT_GATE,
  809. },
  810. },
  811. };
  812. static struct clk_branch gsbi3_qup_clk = {
  813. .halt_reg = 0x2fcc,
  814. .halt_bit = 0,
  815. .clkr = {
  816. .enable_reg = 0x2a0c,
  817. .enable_mask = BIT(9),
  818. .hw.init = &(struct clk_init_data){
  819. .name = "gsbi3_qup_clk",
  820. .parent_names = (const char *[]){ "gsbi3_qup_src" },
  821. .num_parents = 1,
  822. .ops = &clk_branch_ops,
  823. .flags = CLK_SET_RATE_PARENT,
  824. },
  825. },
  826. };
  827. static struct clk_rcg gsbi4_qup_src = {
  828. .ns_reg = 0x2a2c,
  829. .md_reg = 0x2a28,
  830. .mn = {
  831. .mnctr_en_bit = 8,
  832. .mnctr_reset_bit = 7,
  833. .mnctr_mode_shift = 5,
  834. .n_val_shift = 16,
  835. .m_val_shift = 16,
  836. .width = 8,
  837. },
  838. .p = {
  839. .pre_div_shift = 3,
  840. .pre_div_width = 2,
  841. },
  842. .s = {
  843. .src_sel_shift = 0,
  844. .parent_map = gcc_pxo_pll8_map,
  845. },
  846. .freq_tbl = clk_tbl_gsbi_qup,
  847. .clkr = {
  848. .enable_reg = 0x2a2c,
  849. .enable_mask = BIT(11),
  850. .hw.init = &(struct clk_init_data){
  851. .name = "gsbi4_qup_src",
  852. .parent_names = gcc_pxo_pll8,
  853. .num_parents = 2,
  854. .ops = &clk_rcg_ops,
  855. .flags = CLK_SET_PARENT_GATE,
  856. },
  857. },
  858. };
  859. static struct clk_branch gsbi4_qup_clk = {
  860. .halt_reg = 0x2fd0,
  861. .halt_bit = 24,
  862. .clkr = {
  863. .enable_reg = 0x2a2c,
  864. .enable_mask = BIT(9),
  865. .hw.init = &(struct clk_init_data){
  866. .name = "gsbi4_qup_clk",
  867. .parent_names = (const char *[]){ "gsbi4_qup_src" },
  868. .num_parents = 1,
  869. .ops = &clk_branch_ops,
  870. .flags = CLK_SET_RATE_PARENT,
  871. },
  872. },
  873. };
  874. static struct clk_rcg gsbi5_qup_src = {
  875. .ns_reg = 0x2a4c,
  876. .md_reg = 0x2a48,
  877. .mn = {
  878. .mnctr_en_bit = 8,
  879. .mnctr_reset_bit = 7,
  880. .mnctr_mode_shift = 5,
  881. .n_val_shift = 16,
  882. .m_val_shift = 16,
  883. .width = 8,
  884. },
  885. .p = {
  886. .pre_div_shift = 3,
  887. .pre_div_width = 2,
  888. },
  889. .s = {
  890. .src_sel_shift = 0,
  891. .parent_map = gcc_pxo_pll8_map,
  892. },
  893. .freq_tbl = clk_tbl_gsbi_qup,
  894. .clkr = {
  895. .enable_reg = 0x2a4c,
  896. .enable_mask = BIT(11),
  897. .hw.init = &(struct clk_init_data){
  898. .name = "gsbi5_qup_src",
  899. .parent_names = gcc_pxo_pll8,
  900. .num_parents = 2,
  901. .ops = &clk_rcg_ops,
  902. .flags = CLK_SET_PARENT_GATE,
  903. },
  904. },
  905. };
  906. static struct clk_branch gsbi5_qup_clk = {
  907. .halt_reg = 0x2fd0,
  908. .halt_bit = 20,
  909. .clkr = {
  910. .enable_reg = 0x2a4c,
  911. .enable_mask = BIT(9),
  912. .hw.init = &(struct clk_init_data){
  913. .name = "gsbi5_qup_clk",
  914. .parent_names = (const char *[]){ "gsbi5_qup_src" },
  915. .num_parents = 1,
  916. .ops = &clk_branch_ops,
  917. .flags = CLK_SET_RATE_PARENT,
  918. },
  919. },
  920. };
  921. static struct clk_rcg gsbi6_qup_src = {
  922. .ns_reg = 0x2a6c,
  923. .md_reg = 0x2a68,
  924. .mn = {
  925. .mnctr_en_bit = 8,
  926. .mnctr_reset_bit = 7,
  927. .mnctr_mode_shift = 5,
  928. .n_val_shift = 16,
  929. .m_val_shift = 16,
  930. .width = 8,
  931. },
  932. .p = {
  933. .pre_div_shift = 3,
  934. .pre_div_width = 2,
  935. },
  936. .s = {
  937. .src_sel_shift = 0,
  938. .parent_map = gcc_pxo_pll8_map,
  939. },
  940. .freq_tbl = clk_tbl_gsbi_qup,
  941. .clkr = {
  942. .enable_reg = 0x2a6c,
  943. .enable_mask = BIT(11),
  944. .hw.init = &(struct clk_init_data){
  945. .name = "gsbi6_qup_src",
  946. .parent_names = gcc_pxo_pll8,
  947. .num_parents = 2,
  948. .ops = &clk_rcg_ops,
  949. .flags = CLK_SET_PARENT_GATE,
  950. },
  951. },
  952. };
  953. static struct clk_branch gsbi6_qup_clk = {
  954. .halt_reg = 0x2fd0,
  955. .halt_bit = 16,
  956. .clkr = {
  957. .enable_reg = 0x2a6c,
  958. .enable_mask = BIT(9),
  959. .hw.init = &(struct clk_init_data){
  960. .name = "gsbi6_qup_clk",
  961. .parent_names = (const char *[]){ "gsbi6_qup_src" },
  962. .num_parents = 1,
  963. .ops = &clk_branch_ops,
  964. .flags = CLK_SET_RATE_PARENT,
  965. },
  966. },
  967. };
  968. static struct clk_rcg gsbi7_qup_src = {
  969. .ns_reg = 0x2a8c,
  970. .md_reg = 0x2a88,
  971. .mn = {
  972. .mnctr_en_bit = 8,
  973. .mnctr_reset_bit = 7,
  974. .mnctr_mode_shift = 5,
  975. .n_val_shift = 16,
  976. .m_val_shift = 16,
  977. .width = 8,
  978. },
  979. .p = {
  980. .pre_div_shift = 3,
  981. .pre_div_width = 2,
  982. },
  983. .s = {
  984. .src_sel_shift = 0,
  985. .parent_map = gcc_pxo_pll8_map,
  986. },
  987. .freq_tbl = clk_tbl_gsbi_qup,
  988. .clkr = {
  989. .enable_reg = 0x2a8c,
  990. .enable_mask = BIT(11),
  991. .hw.init = &(struct clk_init_data){
  992. .name = "gsbi7_qup_src",
  993. .parent_names = gcc_pxo_pll8,
  994. .num_parents = 2,
  995. .ops = &clk_rcg_ops,
  996. .flags = CLK_SET_PARENT_GATE,
  997. },
  998. },
  999. };
  1000. static struct clk_branch gsbi7_qup_clk = {
  1001. .halt_reg = 0x2fd0,
  1002. .halt_bit = 12,
  1003. .clkr = {
  1004. .enable_reg = 0x2a8c,
  1005. .enable_mask = BIT(9),
  1006. .hw.init = &(struct clk_init_data){
  1007. .name = "gsbi7_qup_clk",
  1008. .parent_names = (const char *[]){ "gsbi7_qup_src" },
  1009. .num_parents = 1,
  1010. .ops = &clk_branch_ops,
  1011. .flags = CLK_SET_RATE_PARENT,
  1012. },
  1013. },
  1014. };
  1015. static struct clk_rcg gsbi8_qup_src = {
  1016. .ns_reg = 0x2aac,
  1017. .md_reg = 0x2aa8,
  1018. .mn = {
  1019. .mnctr_en_bit = 8,
  1020. .mnctr_reset_bit = 7,
  1021. .mnctr_mode_shift = 5,
  1022. .n_val_shift = 16,
  1023. .m_val_shift = 16,
  1024. .width = 8,
  1025. },
  1026. .p = {
  1027. .pre_div_shift = 3,
  1028. .pre_div_width = 2,
  1029. },
  1030. .s = {
  1031. .src_sel_shift = 0,
  1032. .parent_map = gcc_pxo_pll8_map,
  1033. },
  1034. .freq_tbl = clk_tbl_gsbi_qup,
  1035. .clkr = {
  1036. .enable_reg = 0x2aac,
  1037. .enable_mask = BIT(11),
  1038. .hw.init = &(struct clk_init_data){
  1039. .name = "gsbi8_qup_src",
  1040. .parent_names = gcc_pxo_pll8,
  1041. .num_parents = 2,
  1042. .ops = &clk_rcg_ops,
  1043. .flags = CLK_SET_PARENT_GATE,
  1044. },
  1045. },
  1046. };
  1047. static struct clk_branch gsbi8_qup_clk = {
  1048. .halt_reg = 0x2fd0,
  1049. .halt_bit = 8,
  1050. .clkr = {
  1051. .enable_reg = 0x2aac,
  1052. .enable_mask = BIT(9),
  1053. .hw.init = &(struct clk_init_data){
  1054. .name = "gsbi8_qup_clk",
  1055. .parent_names = (const char *[]){ "gsbi8_qup_src" },
  1056. .num_parents = 1,
  1057. .ops = &clk_branch_ops,
  1058. .flags = CLK_SET_RATE_PARENT,
  1059. },
  1060. },
  1061. };
  1062. static struct clk_rcg gsbi9_qup_src = {
  1063. .ns_reg = 0x2acc,
  1064. .md_reg = 0x2ac8,
  1065. .mn = {
  1066. .mnctr_en_bit = 8,
  1067. .mnctr_reset_bit = 7,
  1068. .mnctr_mode_shift = 5,
  1069. .n_val_shift = 16,
  1070. .m_val_shift = 16,
  1071. .width = 8,
  1072. },
  1073. .p = {
  1074. .pre_div_shift = 3,
  1075. .pre_div_width = 2,
  1076. },
  1077. .s = {
  1078. .src_sel_shift = 0,
  1079. .parent_map = gcc_pxo_pll8_map,
  1080. },
  1081. .freq_tbl = clk_tbl_gsbi_qup,
  1082. .clkr = {
  1083. .enable_reg = 0x2acc,
  1084. .enable_mask = BIT(11),
  1085. .hw.init = &(struct clk_init_data){
  1086. .name = "gsbi9_qup_src",
  1087. .parent_names = gcc_pxo_pll8,
  1088. .num_parents = 2,
  1089. .ops = &clk_rcg_ops,
  1090. .flags = CLK_SET_PARENT_GATE,
  1091. },
  1092. },
  1093. };
  1094. static struct clk_branch gsbi9_qup_clk = {
  1095. .halt_reg = 0x2fd0,
  1096. .halt_bit = 4,
  1097. .clkr = {
  1098. .enable_reg = 0x2acc,
  1099. .enable_mask = BIT(9),
  1100. .hw.init = &(struct clk_init_data){
  1101. .name = "gsbi9_qup_clk",
  1102. .parent_names = (const char *[]){ "gsbi9_qup_src" },
  1103. .num_parents = 1,
  1104. .ops = &clk_branch_ops,
  1105. .flags = CLK_SET_RATE_PARENT,
  1106. },
  1107. },
  1108. };
  1109. static struct clk_rcg gsbi10_qup_src = {
  1110. .ns_reg = 0x2aec,
  1111. .md_reg = 0x2ae8,
  1112. .mn = {
  1113. .mnctr_en_bit = 8,
  1114. .mnctr_reset_bit = 7,
  1115. .mnctr_mode_shift = 5,
  1116. .n_val_shift = 16,
  1117. .m_val_shift = 16,
  1118. .width = 8,
  1119. },
  1120. .p = {
  1121. .pre_div_shift = 3,
  1122. .pre_div_width = 2,
  1123. },
  1124. .s = {
  1125. .src_sel_shift = 0,
  1126. .parent_map = gcc_pxo_pll8_map,
  1127. },
  1128. .freq_tbl = clk_tbl_gsbi_qup,
  1129. .clkr = {
  1130. .enable_reg = 0x2aec,
  1131. .enable_mask = BIT(11),
  1132. .hw.init = &(struct clk_init_data){
  1133. .name = "gsbi10_qup_src",
  1134. .parent_names = gcc_pxo_pll8,
  1135. .num_parents = 2,
  1136. .ops = &clk_rcg_ops,
  1137. .flags = CLK_SET_PARENT_GATE,
  1138. },
  1139. },
  1140. };
  1141. static struct clk_branch gsbi10_qup_clk = {
  1142. .halt_reg = 0x2fd0,
  1143. .halt_bit = 0,
  1144. .clkr = {
  1145. .enable_reg = 0x2aec,
  1146. .enable_mask = BIT(9),
  1147. .hw.init = &(struct clk_init_data){
  1148. .name = "gsbi10_qup_clk",
  1149. .parent_names = (const char *[]){ "gsbi10_qup_src" },
  1150. .num_parents = 1,
  1151. .ops = &clk_branch_ops,
  1152. .flags = CLK_SET_RATE_PARENT,
  1153. },
  1154. },
  1155. };
  1156. static struct clk_rcg gsbi11_qup_src = {
  1157. .ns_reg = 0x2b0c,
  1158. .md_reg = 0x2b08,
  1159. .mn = {
  1160. .mnctr_en_bit = 8,
  1161. .mnctr_reset_bit = 7,
  1162. .mnctr_mode_shift = 5,
  1163. .n_val_shift = 16,
  1164. .m_val_shift = 16,
  1165. .width = 8,
  1166. },
  1167. .p = {
  1168. .pre_div_shift = 3,
  1169. .pre_div_width = 2,
  1170. },
  1171. .s = {
  1172. .src_sel_shift = 0,
  1173. .parent_map = gcc_pxo_pll8_map,
  1174. },
  1175. .freq_tbl = clk_tbl_gsbi_qup,
  1176. .clkr = {
  1177. .enable_reg = 0x2b0c,
  1178. .enable_mask = BIT(11),
  1179. .hw.init = &(struct clk_init_data){
  1180. .name = "gsbi11_qup_src",
  1181. .parent_names = gcc_pxo_pll8,
  1182. .num_parents = 2,
  1183. .ops = &clk_rcg_ops,
  1184. .flags = CLK_SET_PARENT_GATE,
  1185. },
  1186. },
  1187. };
  1188. static struct clk_branch gsbi11_qup_clk = {
  1189. .halt_reg = 0x2fd4,
  1190. .halt_bit = 15,
  1191. .clkr = {
  1192. .enable_reg = 0x2b0c,
  1193. .enable_mask = BIT(9),
  1194. .hw.init = &(struct clk_init_data){
  1195. .name = "gsbi11_qup_clk",
  1196. .parent_names = (const char *[]){ "gsbi11_qup_src" },
  1197. .num_parents = 1,
  1198. .ops = &clk_branch_ops,
  1199. .flags = CLK_SET_RATE_PARENT,
  1200. },
  1201. },
  1202. };
  1203. static struct clk_rcg gsbi12_qup_src = {
  1204. .ns_reg = 0x2b2c,
  1205. .md_reg = 0x2b28,
  1206. .mn = {
  1207. .mnctr_en_bit = 8,
  1208. .mnctr_reset_bit = 7,
  1209. .mnctr_mode_shift = 5,
  1210. .n_val_shift = 16,
  1211. .m_val_shift = 16,
  1212. .width = 8,
  1213. },
  1214. .p = {
  1215. .pre_div_shift = 3,
  1216. .pre_div_width = 2,
  1217. },
  1218. .s = {
  1219. .src_sel_shift = 0,
  1220. .parent_map = gcc_pxo_pll8_map,
  1221. },
  1222. .freq_tbl = clk_tbl_gsbi_qup,
  1223. .clkr = {
  1224. .enable_reg = 0x2b2c,
  1225. .enable_mask = BIT(11),
  1226. .hw.init = &(struct clk_init_data){
  1227. .name = "gsbi12_qup_src",
  1228. .parent_names = gcc_pxo_pll8,
  1229. .num_parents = 2,
  1230. .ops = &clk_rcg_ops,
  1231. .flags = CLK_SET_PARENT_GATE,
  1232. },
  1233. },
  1234. };
  1235. static struct clk_branch gsbi12_qup_clk = {
  1236. .halt_reg = 0x2fd4,
  1237. .halt_bit = 11,
  1238. .clkr = {
  1239. .enable_reg = 0x2b2c,
  1240. .enable_mask = BIT(9),
  1241. .hw.init = &(struct clk_init_data){
  1242. .name = "gsbi12_qup_clk",
  1243. .parent_names = (const char *[]){ "gsbi12_qup_src" },
  1244. .num_parents = 1,
  1245. .ops = &clk_branch_ops,
  1246. .flags = CLK_SET_RATE_PARENT,
  1247. },
  1248. },
  1249. };
  1250. static const struct freq_tbl clk_tbl_gp[] = {
  1251. { 9600000, P_CXO, 2, 0, 0 },
  1252. { 13500000, P_PXO, 2, 0, 0 },
  1253. { 19200000, P_CXO, 1, 0, 0 },
  1254. { 27000000, P_PXO, 1, 0, 0 },
  1255. { 64000000, P_PLL8, 2, 1, 3 },
  1256. { 76800000, P_PLL8, 1, 1, 5 },
  1257. { 96000000, P_PLL8, 4, 0, 0 },
  1258. { 128000000, P_PLL8, 3, 0, 0 },
  1259. { 192000000, P_PLL8, 2, 0, 0 },
  1260. { }
  1261. };
  1262. static struct clk_rcg gp0_src = {
  1263. .ns_reg = 0x2d24,
  1264. .md_reg = 0x2d00,
  1265. .mn = {
  1266. .mnctr_en_bit = 8,
  1267. .mnctr_reset_bit = 7,
  1268. .mnctr_mode_shift = 5,
  1269. .n_val_shift = 16,
  1270. .m_val_shift = 16,
  1271. .width = 8,
  1272. },
  1273. .p = {
  1274. .pre_div_shift = 3,
  1275. .pre_div_width = 2,
  1276. },
  1277. .s = {
  1278. .src_sel_shift = 0,
  1279. .parent_map = gcc_pxo_pll8_cxo_map,
  1280. },
  1281. .freq_tbl = clk_tbl_gp,
  1282. .clkr = {
  1283. .enable_reg = 0x2d24,
  1284. .enable_mask = BIT(11),
  1285. .hw.init = &(struct clk_init_data){
  1286. .name = "gp0_src",
  1287. .parent_names = gcc_pxo_pll8_cxo,
  1288. .num_parents = 3,
  1289. .ops = &clk_rcg_ops,
  1290. .flags = CLK_SET_PARENT_GATE,
  1291. },
  1292. }
  1293. };
  1294. static struct clk_branch gp0_clk = {
  1295. .halt_reg = 0x2fd8,
  1296. .halt_bit = 7,
  1297. .clkr = {
  1298. .enable_reg = 0x2d24,
  1299. .enable_mask = BIT(9),
  1300. .hw.init = &(struct clk_init_data){
  1301. .name = "gp0_clk",
  1302. .parent_names = (const char *[]){ "gp0_src" },
  1303. .num_parents = 1,
  1304. .ops = &clk_branch_ops,
  1305. .flags = CLK_SET_RATE_PARENT,
  1306. },
  1307. },
  1308. };
  1309. static struct clk_rcg gp1_src = {
  1310. .ns_reg = 0x2d44,
  1311. .md_reg = 0x2d40,
  1312. .mn = {
  1313. .mnctr_en_bit = 8,
  1314. .mnctr_reset_bit = 7,
  1315. .mnctr_mode_shift = 5,
  1316. .n_val_shift = 16,
  1317. .m_val_shift = 16,
  1318. .width = 8,
  1319. },
  1320. .p = {
  1321. .pre_div_shift = 3,
  1322. .pre_div_width = 2,
  1323. },
  1324. .s = {
  1325. .src_sel_shift = 0,
  1326. .parent_map = gcc_pxo_pll8_cxo_map,
  1327. },
  1328. .freq_tbl = clk_tbl_gp,
  1329. .clkr = {
  1330. .enable_reg = 0x2d44,
  1331. .enable_mask = BIT(11),
  1332. .hw.init = &(struct clk_init_data){
  1333. .name = "gp1_src",
  1334. .parent_names = gcc_pxo_pll8_cxo,
  1335. .num_parents = 3,
  1336. .ops = &clk_rcg_ops,
  1337. .flags = CLK_SET_RATE_GATE,
  1338. },
  1339. }
  1340. };
  1341. static struct clk_branch gp1_clk = {
  1342. .halt_reg = 0x2fd8,
  1343. .halt_bit = 6,
  1344. .clkr = {
  1345. .enable_reg = 0x2d44,
  1346. .enable_mask = BIT(9),
  1347. .hw.init = &(struct clk_init_data){
  1348. .name = "gp1_clk",
  1349. .parent_names = (const char *[]){ "gp1_src" },
  1350. .num_parents = 1,
  1351. .ops = &clk_branch_ops,
  1352. .flags = CLK_SET_RATE_PARENT,
  1353. },
  1354. },
  1355. };
  1356. static struct clk_rcg gp2_src = {
  1357. .ns_reg = 0x2d64,
  1358. .md_reg = 0x2d60,
  1359. .mn = {
  1360. .mnctr_en_bit = 8,
  1361. .mnctr_reset_bit = 7,
  1362. .mnctr_mode_shift = 5,
  1363. .n_val_shift = 16,
  1364. .m_val_shift = 16,
  1365. .width = 8,
  1366. },
  1367. .p = {
  1368. .pre_div_shift = 3,
  1369. .pre_div_width = 2,
  1370. },
  1371. .s = {
  1372. .src_sel_shift = 0,
  1373. .parent_map = gcc_pxo_pll8_cxo_map,
  1374. },
  1375. .freq_tbl = clk_tbl_gp,
  1376. .clkr = {
  1377. .enable_reg = 0x2d64,
  1378. .enable_mask = BIT(11),
  1379. .hw.init = &(struct clk_init_data){
  1380. .name = "gp2_src",
  1381. .parent_names = gcc_pxo_pll8_cxo,
  1382. .num_parents = 3,
  1383. .ops = &clk_rcg_ops,
  1384. .flags = CLK_SET_RATE_GATE,
  1385. },
  1386. }
  1387. };
  1388. static struct clk_branch gp2_clk = {
  1389. .halt_reg = 0x2fd8,
  1390. .halt_bit = 5,
  1391. .clkr = {
  1392. .enable_reg = 0x2d64,
  1393. .enable_mask = BIT(9),
  1394. .hw.init = &(struct clk_init_data){
  1395. .name = "gp2_clk",
  1396. .parent_names = (const char *[]){ "gp2_src" },
  1397. .num_parents = 1,
  1398. .ops = &clk_branch_ops,
  1399. .flags = CLK_SET_RATE_PARENT,
  1400. },
  1401. },
  1402. };
  1403. static struct clk_branch pmem_clk = {
  1404. .hwcg_reg = 0x25a0,
  1405. .hwcg_bit = 6,
  1406. .halt_reg = 0x2fc8,
  1407. .halt_bit = 20,
  1408. .clkr = {
  1409. .enable_reg = 0x25a0,
  1410. .enable_mask = BIT(4),
  1411. .hw.init = &(struct clk_init_data){
  1412. .name = "pmem_clk",
  1413. .ops = &clk_branch_ops,
  1414. .flags = CLK_IS_ROOT,
  1415. },
  1416. },
  1417. };
  1418. static struct clk_rcg prng_src = {
  1419. .ns_reg = 0x2e80,
  1420. .p = {
  1421. .pre_div_shift = 3,
  1422. .pre_div_width = 4,
  1423. },
  1424. .s = {
  1425. .src_sel_shift = 0,
  1426. .parent_map = gcc_pxo_pll8_map,
  1427. },
  1428. .clkr.hw = {
  1429. .init = &(struct clk_init_data){
  1430. .name = "prng_src",
  1431. .parent_names = gcc_pxo_pll8,
  1432. .num_parents = 2,
  1433. .ops = &clk_rcg_ops,
  1434. },
  1435. },
  1436. };
  1437. static struct clk_branch prng_clk = {
  1438. .halt_reg = 0x2fd8,
  1439. .halt_check = BRANCH_HALT_VOTED,
  1440. .halt_bit = 10,
  1441. .clkr = {
  1442. .enable_reg = 0x3080,
  1443. .enable_mask = BIT(10),
  1444. .hw.init = &(struct clk_init_data){
  1445. .name = "prng_clk",
  1446. .parent_names = (const char *[]){ "prng_src" },
  1447. .num_parents = 1,
  1448. .ops = &clk_branch_ops,
  1449. },
  1450. },
  1451. };
  1452. static const struct freq_tbl clk_tbl_sdc[] = {
  1453. { 144000, P_PXO, 3, 2, 125 },
  1454. { 400000, P_PLL8, 4, 1, 240 },
  1455. { 16000000, P_PLL8, 4, 1, 6 },
  1456. { 17070000, P_PLL8, 1, 2, 45 },
  1457. { 20210000, P_PLL8, 1, 1, 19 },
  1458. { 24000000, P_PLL8, 4, 1, 4 },
  1459. { 48000000, P_PLL8, 4, 1, 2 },
  1460. { }
  1461. };
  1462. static struct clk_rcg sdc1_src = {
  1463. .ns_reg = 0x282c,
  1464. .md_reg = 0x2828,
  1465. .mn = {
  1466. .mnctr_en_bit = 8,
  1467. .mnctr_reset_bit = 7,
  1468. .mnctr_mode_shift = 5,
  1469. .n_val_shift = 16,
  1470. .m_val_shift = 16,
  1471. .width = 8,
  1472. },
  1473. .p = {
  1474. .pre_div_shift = 3,
  1475. .pre_div_width = 2,
  1476. },
  1477. .s = {
  1478. .src_sel_shift = 0,
  1479. .parent_map = gcc_pxo_pll8_map,
  1480. },
  1481. .freq_tbl = clk_tbl_sdc,
  1482. .clkr = {
  1483. .enable_reg = 0x282c,
  1484. .enable_mask = BIT(11),
  1485. .hw.init = &(struct clk_init_data){
  1486. .name = "sdc1_src",
  1487. .parent_names = gcc_pxo_pll8,
  1488. .num_parents = 2,
  1489. .ops = &clk_rcg_ops,
  1490. .flags = CLK_SET_RATE_GATE,
  1491. },
  1492. }
  1493. };
  1494. static struct clk_branch sdc1_clk = {
  1495. .halt_reg = 0x2fc8,
  1496. .halt_bit = 6,
  1497. .clkr = {
  1498. .enable_reg = 0x282c,
  1499. .enable_mask = BIT(9),
  1500. .hw.init = &(struct clk_init_data){
  1501. .name = "sdc1_clk",
  1502. .parent_names = (const char *[]){ "sdc1_src" },
  1503. .num_parents = 1,
  1504. .ops = &clk_branch_ops,
  1505. .flags = CLK_SET_RATE_PARENT,
  1506. },
  1507. },
  1508. };
  1509. static struct clk_rcg sdc2_src = {
  1510. .ns_reg = 0x284c,
  1511. .md_reg = 0x2848,
  1512. .mn = {
  1513. .mnctr_en_bit = 8,
  1514. .mnctr_reset_bit = 7,
  1515. .mnctr_mode_shift = 5,
  1516. .n_val_shift = 16,
  1517. .m_val_shift = 16,
  1518. .width = 8,
  1519. },
  1520. .p = {
  1521. .pre_div_shift = 3,
  1522. .pre_div_width = 2,
  1523. },
  1524. .s = {
  1525. .src_sel_shift = 0,
  1526. .parent_map = gcc_pxo_pll8_map,
  1527. },
  1528. .freq_tbl = clk_tbl_sdc,
  1529. .clkr = {
  1530. .enable_reg = 0x284c,
  1531. .enable_mask = BIT(11),
  1532. .hw.init = &(struct clk_init_data){
  1533. .name = "sdc2_src",
  1534. .parent_names = gcc_pxo_pll8,
  1535. .num_parents = 2,
  1536. .ops = &clk_rcg_ops,
  1537. .flags = CLK_SET_RATE_GATE,
  1538. },
  1539. }
  1540. };
  1541. static struct clk_branch sdc2_clk = {
  1542. .halt_reg = 0x2fc8,
  1543. .halt_bit = 5,
  1544. .clkr = {
  1545. .enable_reg = 0x284c,
  1546. .enable_mask = BIT(9),
  1547. .hw.init = &(struct clk_init_data){
  1548. .name = "sdc2_clk",
  1549. .parent_names = (const char *[]){ "sdc2_src" },
  1550. .num_parents = 1,
  1551. .ops = &clk_branch_ops,
  1552. .flags = CLK_SET_RATE_PARENT,
  1553. },
  1554. },
  1555. };
  1556. static struct clk_rcg sdc3_src = {
  1557. .ns_reg = 0x286c,
  1558. .md_reg = 0x2868,
  1559. .mn = {
  1560. .mnctr_en_bit = 8,
  1561. .mnctr_reset_bit = 7,
  1562. .mnctr_mode_shift = 5,
  1563. .n_val_shift = 16,
  1564. .m_val_shift = 16,
  1565. .width = 8,
  1566. },
  1567. .p = {
  1568. .pre_div_shift = 3,
  1569. .pre_div_width = 2,
  1570. },
  1571. .s = {
  1572. .src_sel_shift = 0,
  1573. .parent_map = gcc_pxo_pll8_map,
  1574. },
  1575. .freq_tbl = clk_tbl_sdc,
  1576. .clkr = {
  1577. .enable_reg = 0x286c,
  1578. .enable_mask = BIT(11),
  1579. .hw.init = &(struct clk_init_data){
  1580. .name = "sdc3_src",
  1581. .parent_names = gcc_pxo_pll8,
  1582. .num_parents = 2,
  1583. .ops = &clk_rcg_ops,
  1584. .flags = CLK_SET_RATE_GATE,
  1585. },
  1586. }
  1587. };
  1588. static struct clk_branch sdc3_clk = {
  1589. .halt_reg = 0x2fc8,
  1590. .halt_bit = 4,
  1591. .clkr = {
  1592. .enable_reg = 0x286c,
  1593. .enable_mask = BIT(9),
  1594. .hw.init = &(struct clk_init_data){
  1595. .name = "sdc3_clk",
  1596. .parent_names = (const char *[]){ "sdc3_src" },
  1597. .num_parents = 1,
  1598. .ops = &clk_branch_ops,
  1599. .flags = CLK_SET_RATE_PARENT,
  1600. },
  1601. },
  1602. };
  1603. static struct clk_rcg sdc4_src = {
  1604. .ns_reg = 0x288c,
  1605. .md_reg = 0x2888,
  1606. .mn = {
  1607. .mnctr_en_bit = 8,
  1608. .mnctr_reset_bit = 7,
  1609. .mnctr_mode_shift = 5,
  1610. .n_val_shift = 16,
  1611. .m_val_shift = 16,
  1612. .width = 8,
  1613. },
  1614. .p = {
  1615. .pre_div_shift = 3,
  1616. .pre_div_width = 2,
  1617. },
  1618. .s = {
  1619. .src_sel_shift = 0,
  1620. .parent_map = gcc_pxo_pll8_map,
  1621. },
  1622. .freq_tbl = clk_tbl_sdc,
  1623. .clkr = {
  1624. .enable_reg = 0x288c,
  1625. .enable_mask = BIT(11),
  1626. .hw.init = &(struct clk_init_data){
  1627. .name = "sdc4_src",
  1628. .parent_names = gcc_pxo_pll8,
  1629. .num_parents = 2,
  1630. .ops = &clk_rcg_ops,
  1631. .flags = CLK_SET_RATE_GATE,
  1632. },
  1633. }
  1634. };
  1635. static struct clk_branch sdc4_clk = {
  1636. .halt_reg = 0x2fc8,
  1637. .halt_bit = 3,
  1638. .clkr = {
  1639. .enable_reg = 0x288c,
  1640. .enable_mask = BIT(9),
  1641. .hw.init = &(struct clk_init_data){
  1642. .name = "sdc4_clk",
  1643. .parent_names = (const char *[]){ "sdc4_src" },
  1644. .num_parents = 1,
  1645. .ops = &clk_branch_ops,
  1646. .flags = CLK_SET_RATE_PARENT,
  1647. },
  1648. },
  1649. };
  1650. static struct clk_rcg sdc5_src = {
  1651. .ns_reg = 0x28ac,
  1652. .md_reg = 0x28a8,
  1653. .mn = {
  1654. .mnctr_en_bit = 8,
  1655. .mnctr_reset_bit = 7,
  1656. .mnctr_mode_shift = 5,
  1657. .n_val_shift = 16,
  1658. .m_val_shift = 16,
  1659. .width = 8,
  1660. },
  1661. .p = {
  1662. .pre_div_shift = 3,
  1663. .pre_div_width = 2,
  1664. },
  1665. .s = {
  1666. .src_sel_shift = 0,
  1667. .parent_map = gcc_pxo_pll8_map,
  1668. },
  1669. .freq_tbl = clk_tbl_sdc,
  1670. .clkr = {
  1671. .enable_reg = 0x28ac,
  1672. .enable_mask = BIT(11),
  1673. .hw.init = &(struct clk_init_data){
  1674. .name = "sdc5_src",
  1675. .parent_names = gcc_pxo_pll8,
  1676. .num_parents = 2,
  1677. .ops = &clk_rcg_ops,
  1678. .flags = CLK_SET_RATE_GATE,
  1679. },
  1680. }
  1681. };
  1682. static struct clk_branch sdc5_clk = {
  1683. .halt_reg = 0x2fc8,
  1684. .halt_bit = 2,
  1685. .clkr = {
  1686. .enable_reg = 0x28ac,
  1687. .enable_mask = BIT(9),
  1688. .hw.init = &(struct clk_init_data){
  1689. .name = "sdc5_clk",
  1690. .parent_names = (const char *[]){ "sdc5_src" },
  1691. .num_parents = 1,
  1692. .ops = &clk_branch_ops,
  1693. .flags = CLK_SET_RATE_PARENT,
  1694. },
  1695. },
  1696. };
  1697. static const struct freq_tbl clk_tbl_tsif_ref[] = {
  1698. { 105000, P_PXO, 1, 1, 256 },
  1699. { }
  1700. };
  1701. static struct clk_rcg tsif_ref_src = {
  1702. .ns_reg = 0x2710,
  1703. .md_reg = 0x270c,
  1704. .mn = {
  1705. .mnctr_en_bit = 8,
  1706. .mnctr_reset_bit = 7,
  1707. .mnctr_mode_shift = 5,
  1708. .n_val_shift = 16,
  1709. .m_val_shift = 16,
  1710. .width = 16,
  1711. },
  1712. .p = {
  1713. .pre_div_shift = 3,
  1714. .pre_div_width = 2,
  1715. },
  1716. .s = {
  1717. .src_sel_shift = 0,
  1718. .parent_map = gcc_pxo_pll8_map,
  1719. },
  1720. .freq_tbl = clk_tbl_tsif_ref,
  1721. .clkr = {
  1722. .enable_reg = 0x2710,
  1723. .enable_mask = BIT(11),
  1724. .hw.init = &(struct clk_init_data){
  1725. .name = "tsif_ref_src",
  1726. .parent_names = gcc_pxo_pll8,
  1727. .num_parents = 2,
  1728. .ops = &clk_rcg_ops,
  1729. .flags = CLK_SET_RATE_GATE,
  1730. },
  1731. }
  1732. };
  1733. static struct clk_branch tsif_ref_clk = {
  1734. .halt_reg = 0x2fd4,
  1735. .halt_bit = 5,
  1736. .clkr = {
  1737. .enable_reg = 0x2710,
  1738. .enable_mask = BIT(9),
  1739. .hw.init = &(struct clk_init_data){
  1740. .name = "tsif_ref_clk",
  1741. .parent_names = (const char *[]){ "tsif_ref_src" },
  1742. .num_parents = 1,
  1743. .ops = &clk_branch_ops,
  1744. .flags = CLK_SET_RATE_PARENT,
  1745. },
  1746. },
  1747. };
  1748. static const struct freq_tbl clk_tbl_usb[] = {
  1749. { 60000000, P_PLL8, 1, 5, 32 },
  1750. { }
  1751. };
  1752. static struct clk_rcg usb_hs1_xcvr_src = {
  1753. .ns_reg = 0x290c,
  1754. .md_reg = 0x2908,
  1755. .mn = {
  1756. .mnctr_en_bit = 8,
  1757. .mnctr_reset_bit = 7,
  1758. .mnctr_mode_shift = 5,
  1759. .n_val_shift = 16,
  1760. .m_val_shift = 16,
  1761. .width = 8,
  1762. },
  1763. .p = {
  1764. .pre_div_shift = 3,
  1765. .pre_div_width = 2,
  1766. },
  1767. .s = {
  1768. .src_sel_shift = 0,
  1769. .parent_map = gcc_pxo_pll8_map,
  1770. },
  1771. .freq_tbl = clk_tbl_usb,
  1772. .clkr = {
  1773. .enable_reg = 0x290c,
  1774. .enable_mask = BIT(11),
  1775. .hw.init = &(struct clk_init_data){
  1776. .name = "usb_hs1_xcvr_src",
  1777. .parent_names = gcc_pxo_pll8,
  1778. .num_parents = 2,
  1779. .ops = &clk_rcg_ops,
  1780. .flags = CLK_SET_RATE_GATE,
  1781. },
  1782. }
  1783. };
  1784. static struct clk_branch usb_hs1_xcvr_clk = {
  1785. .halt_reg = 0x2fc8,
  1786. .halt_bit = 0,
  1787. .clkr = {
  1788. .enable_reg = 0x290c,
  1789. .enable_mask = BIT(9),
  1790. .hw.init = &(struct clk_init_data){
  1791. .name = "usb_hs1_xcvr_clk",
  1792. .parent_names = (const char *[]){ "usb_hs1_xcvr_src" },
  1793. .num_parents = 1,
  1794. .ops = &clk_branch_ops,
  1795. .flags = CLK_SET_RATE_PARENT,
  1796. },
  1797. },
  1798. };
  1799. static struct clk_rcg usb_fs1_xcvr_fs_src = {
  1800. .ns_reg = 0x2968,
  1801. .md_reg = 0x2964,
  1802. .mn = {
  1803. .mnctr_en_bit = 8,
  1804. .mnctr_reset_bit = 7,
  1805. .mnctr_mode_shift = 5,
  1806. .n_val_shift = 16,
  1807. .m_val_shift = 16,
  1808. .width = 8,
  1809. },
  1810. .p = {
  1811. .pre_div_shift = 3,
  1812. .pre_div_width = 2,
  1813. },
  1814. .s = {
  1815. .src_sel_shift = 0,
  1816. .parent_map = gcc_pxo_pll8_map,
  1817. },
  1818. .freq_tbl = clk_tbl_usb,
  1819. .clkr = {
  1820. .enable_reg = 0x2968,
  1821. .enable_mask = BIT(11),
  1822. .hw.init = &(struct clk_init_data){
  1823. .name = "usb_fs1_xcvr_fs_src",
  1824. .parent_names = gcc_pxo_pll8,
  1825. .num_parents = 2,
  1826. .ops = &clk_rcg_ops,
  1827. .flags = CLK_SET_RATE_GATE,
  1828. },
  1829. }
  1830. };
  1831. static const char * const usb_fs1_xcvr_fs_src_p[] = { "usb_fs1_xcvr_fs_src" };
  1832. static struct clk_branch usb_fs1_xcvr_fs_clk = {
  1833. .halt_reg = 0x2fcc,
  1834. .halt_bit = 15,
  1835. .clkr = {
  1836. .enable_reg = 0x2968,
  1837. .enable_mask = BIT(9),
  1838. .hw.init = &(struct clk_init_data){
  1839. .name = "usb_fs1_xcvr_fs_clk",
  1840. .parent_names = usb_fs1_xcvr_fs_src_p,
  1841. .num_parents = 1,
  1842. .ops = &clk_branch_ops,
  1843. .flags = CLK_SET_RATE_PARENT,
  1844. },
  1845. },
  1846. };
  1847. static struct clk_branch usb_fs1_system_clk = {
  1848. .halt_reg = 0x2fcc,
  1849. .halt_bit = 16,
  1850. .clkr = {
  1851. .enable_reg = 0x296c,
  1852. .enable_mask = BIT(4),
  1853. .hw.init = &(struct clk_init_data){
  1854. .parent_names = usb_fs1_xcvr_fs_src_p,
  1855. .num_parents = 1,
  1856. .name = "usb_fs1_system_clk",
  1857. .ops = &clk_branch_ops,
  1858. .flags = CLK_SET_RATE_PARENT,
  1859. },
  1860. },
  1861. };
  1862. static struct clk_rcg usb_fs2_xcvr_fs_src = {
  1863. .ns_reg = 0x2988,
  1864. .md_reg = 0x2984,
  1865. .mn = {
  1866. .mnctr_en_bit = 8,
  1867. .mnctr_reset_bit = 7,
  1868. .mnctr_mode_shift = 5,
  1869. .n_val_shift = 16,
  1870. .m_val_shift = 16,
  1871. .width = 8,
  1872. },
  1873. .p = {
  1874. .pre_div_shift = 3,
  1875. .pre_div_width = 2,
  1876. },
  1877. .s = {
  1878. .src_sel_shift = 0,
  1879. .parent_map = gcc_pxo_pll8_map,
  1880. },
  1881. .freq_tbl = clk_tbl_usb,
  1882. .clkr = {
  1883. .enable_reg = 0x2988,
  1884. .enable_mask = BIT(11),
  1885. .hw.init = &(struct clk_init_data){
  1886. .name = "usb_fs2_xcvr_fs_src",
  1887. .parent_names = gcc_pxo_pll8,
  1888. .num_parents = 2,
  1889. .ops = &clk_rcg_ops,
  1890. .flags = CLK_SET_RATE_GATE,
  1891. },
  1892. }
  1893. };
  1894. static const char * const usb_fs2_xcvr_fs_src_p[] = { "usb_fs2_xcvr_fs_src" };
  1895. static struct clk_branch usb_fs2_xcvr_fs_clk = {
  1896. .halt_reg = 0x2fcc,
  1897. .halt_bit = 12,
  1898. .clkr = {
  1899. .enable_reg = 0x2988,
  1900. .enable_mask = BIT(9),
  1901. .hw.init = &(struct clk_init_data){
  1902. .name = "usb_fs2_xcvr_fs_clk",
  1903. .parent_names = usb_fs2_xcvr_fs_src_p,
  1904. .num_parents = 1,
  1905. .ops = &clk_branch_ops,
  1906. .flags = CLK_SET_RATE_PARENT,
  1907. },
  1908. },
  1909. };
  1910. static struct clk_branch usb_fs2_system_clk = {
  1911. .halt_reg = 0x2fcc,
  1912. .halt_bit = 13,
  1913. .clkr = {
  1914. .enable_reg = 0x298c,
  1915. .enable_mask = BIT(4),
  1916. .hw.init = &(struct clk_init_data){
  1917. .name = "usb_fs2_system_clk",
  1918. .parent_names = usb_fs2_xcvr_fs_src_p,
  1919. .num_parents = 1,
  1920. .ops = &clk_branch_ops,
  1921. .flags = CLK_SET_RATE_PARENT,
  1922. },
  1923. },
  1924. };
  1925. static struct clk_branch gsbi1_h_clk = {
  1926. .halt_reg = 0x2fcc,
  1927. .halt_bit = 11,
  1928. .clkr = {
  1929. .enable_reg = 0x29c0,
  1930. .enable_mask = BIT(4),
  1931. .hw.init = &(struct clk_init_data){
  1932. .name = "gsbi1_h_clk",
  1933. .ops = &clk_branch_ops,
  1934. .flags = CLK_IS_ROOT,
  1935. },
  1936. },
  1937. };
  1938. static struct clk_branch gsbi2_h_clk = {
  1939. .halt_reg = 0x2fcc,
  1940. .halt_bit = 7,
  1941. .clkr = {
  1942. .enable_reg = 0x29e0,
  1943. .enable_mask = BIT(4),
  1944. .hw.init = &(struct clk_init_data){
  1945. .name = "gsbi2_h_clk",
  1946. .ops = &clk_branch_ops,
  1947. .flags = CLK_IS_ROOT,
  1948. },
  1949. },
  1950. };
  1951. static struct clk_branch gsbi3_h_clk = {
  1952. .halt_reg = 0x2fcc,
  1953. .halt_bit = 3,
  1954. .clkr = {
  1955. .enable_reg = 0x2a00,
  1956. .enable_mask = BIT(4),
  1957. .hw.init = &(struct clk_init_data){
  1958. .name = "gsbi3_h_clk",
  1959. .ops = &clk_branch_ops,
  1960. .flags = CLK_IS_ROOT,
  1961. },
  1962. },
  1963. };
  1964. static struct clk_branch gsbi4_h_clk = {
  1965. .halt_reg = 0x2fd0,
  1966. .halt_bit = 27,
  1967. .clkr = {
  1968. .enable_reg = 0x2a20,
  1969. .enable_mask = BIT(4),
  1970. .hw.init = &(struct clk_init_data){
  1971. .name = "gsbi4_h_clk",
  1972. .ops = &clk_branch_ops,
  1973. .flags = CLK_IS_ROOT,
  1974. },
  1975. },
  1976. };
  1977. static struct clk_branch gsbi5_h_clk = {
  1978. .halt_reg = 0x2fd0,
  1979. .halt_bit = 23,
  1980. .clkr = {
  1981. .enable_reg = 0x2a40,
  1982. .enable_mask = BIT(4),
  1983. .hw.init = &(struct clk_init_data){
  1984. .name = "gsbi5_h_clk",
  1985. .ops = &clk_branch_ops,
  1986. .flags = CLK_IS_ROOT,
  1987. },
  1988. },
  1989. };
  1990. static struct clk_branch gsbi6_h_clk = {
  1991. .halt_reg = 0x2fd0,
  1992. .halt_bit = 19,
  1993. .clkr = {
  1994. .enable_reg = 0x2a60,
  1995. .enable_mask = BIT(4),
  1996. .hw.init = &(struct clk_init_data){
  1997. .name = "gsbi6_h_clk",
  1998. .ops = &clk_branch_ops,
  1999. .flags = CLK_IS_ROOT,
  2000. },
  2001. },
  2002. };
  2003. static struct clk_branch gsbi7_h_clk = {
  2004. .halt_reg = 0x2fd0,
  2005. .halt_bit = 15,
  2006. .clkr = {
  2007. .enable_reg = 0x2a80,
  2008. .enable_mask = BIT(4),
  2009. .hw.init = &(struct clk_init_data){
  2010. .name = "gsbi7_h_clk",
  2011. .ops = &clk_branch_ops,
  2012. .flags = CLK_IS_ROOT,
  2013. },
  2014. },
  2015. };
  2016. static struct clk_branch gsbi8_h_clk = {
  2017. .halt_reg = 0x2fd0,
  2018. .halt_bit = 11,
  2019. .clkr = {
  2020. .enable_reg = 0x2aa0,
  2021. .enable_mask = BIT(4),
  2022. .hw.init = &(struct clk_init_data){
  2023. .name = "gsbi8_h_clk",
  2024. .ops = &clk_branch_ops,
  2025. .flags = CLK_IS_ROOT,
  2026. },
  2027. },
  2028. };
  2029. static struct clk_branch gsbi9_h_clk = {
  2030. .halt_reg = 0x2fd0,
  2031. .halt_bit = 7,
  2032. .clkr = {
  2033. .enable_reg = 0x2ac0,
  2034. .enable_mask = BIT(4),
  2035. .hw.init = &(struct clk_init_data){
  2036. .name = "gsbi9_h_clk",
  2037. .ops = &clk_branch_ops,
  2038. .flags = CLK_IS_ROOT,
  2039. },
  2040. },
  2041. };
  2042. static struct clk_branch gsbi10_h_clk = {
  2043. .halt_reg = 0x2fd0,
  2044. .halt_bit = 3,
  2045. .clkr = {
  2046. .enable_reg = 0x2ae0,
  2047. .enable_mask = BIT(4),
  2048. .hw.init = &(struct clk_init_data){
  2049. .name = "gsbi10_h_clk",
  2050. .ops = &clk_branch_ops,
  2051. .flags = CLK_IS_ROOT,
  2052. },
  2053. },
  2054. };
  2055. static struct clk_branch gsbi11_h_clk = {
  2056. .halt_reg = 0x2fd4,
  2057. .halt_bit = 18,
  2058. .clkr = {
  2059. .enable_reg = 0x2b00,
  2060. .enable_mask = BIT(4),
  2061. .hw.init = &(struct clk_init_data){
  2062. .name = "gsbi11_h_clk",
  2063. .ops = &clk_branch_ops,
  2064. .flags = CLK_IS_ROOT,
  2065. },
  2066. },
  2067. };
  2068. static struct clk_branch gsbi12_h_clk = {
  2069. .halt_reg = 0x2fd4,
  2070. .halt_bit = 14,
  2071. .clkr = {
  2072. .enable_reg = 0x2b20,
  2073. .enable_mask = BIT(4),
  2074. .hw.init = &(struct clk_init_data){
  2075. .name = "gsbi12_h_clk",
  2076. .ops = &clk_branch_ops,
  2077. .flags = CLK_IS_ROOT,
  2078. },
  2079. },
  2080. };
  2081. static struct clk_branch tsif_h_clk = {
  2082. .halt_reg = 0x2fd4,
  2083. .halt_bit = 7,
  2084. .clkr = {
  2085. .enable_reg = 0x2700,
  2086. .enable_mask = BIT(4),
  2087. .hw.init = &(struct clk_init_data){
  2088. .name = "tsif_h_clk",
  2089. .ops = &clk_branch_ops,
  2090. .flags = CLK_IS_ROOT,
  2091. },
  2092. },
  2093. };
  2094. static struct clk_branch usb_fs1_h_clk = {
  2095. .halt_reg = 0x2fcc,
  2096. .halt_bit = 17,
  2097. .clkr = {
  2098. .enable_reg = 0x2960,
  2099. .enable_mask = BIT(4),
  2100. .hw.init = &(struct clk_init_data){
  2101. .name = "usb_fs1_h_clk",
  2102. .ops = &clk_branch_ops,
  2103. .flags = CLK_IS_ROOT,
  2104. },
  2105. },
  2106. };
  2107. static struct clk_branch usb_fs2_h_clk = {
  2108. .halt_reg = 0x2fcc,
  2109. .halt_bit = 14,
  2110. .clkr = {
  2111. .enable_reg = 0x2980,
  2112. .enable_mask = BIT(4),
  2113. .hw.init = &(struct clk_init_data){
  2114. .name = "usb_fs2_h_clk",
  2115. .ops = &clk_branch_ops,
  2116. .flags = CLK_IS_ROOT,
  2117. },
  2118. },
  2119. };
  2120. static struct clk_branch usb_hs1_h_clk = {
  2121. .halt_reg = 0x2fc8,
  2122. .halt_bit = 1,
  2123. .clkr = {
  2124. .enable_reg = 0x2900,
  2125. .enable_mask = BIT(4),
  2126. .hw.init = &(struct clk_init_data){
  2127. .name = "usb_hs1_h_clk",
  2128. .ops = &clk_branch_ops,
  2129. .flags = CLK_IS_ROOT,
  2130. },
  2131. },
  2132. };
  2133. static struct clk_branch sdc1_h_clk = {
  2134. .halt_reg = 0x2fc8,
  2135. .halt_bit = 11,
  2136. .clkr = {
  2137. .enable_reg = 0x2820,
  2138. .enable_mask = BIT(4),
  2139. .hw.init = &(struct clk_init_data){
  2140. .name = "sdc1_h_clk",
  2141. .ops = &clk_branch_ops,
  2142. .flags = CLK_IS_ROOT,
  2143. },
  2144. },
  2145. };
  2146. static struct clk_branch sdc2_h_clk = {
  2147. .halt_reg = 0x2fc8,
  2148. .halt_bit = 10,
  2149. .clkr = {
  2150. .enable_reg = 0x2840,
  2151. .enable_mask = BIT(4),
  2152. .hw.init = &(struct clk_init_data){
  2153. .name = "sdc2_h_clk",
  2154. .ops = &clk_branch_ops,
  2155. .flags = CLK_IS_ROOT,
  2156. },
  2157. },
  2158. };
  2159. static struct clk_branch sdc3_h_clk = {
  2160. .halt_reg = 0x2fc8,
  2161. .halt_bit = 9,
  2162. .clkr = {
  2163. .enable_reg = 0x2860,
  2164. .enable_mask = BIT(4),
  2165. .hw.init = &(struct clk_init_data){
  2166. .name = "sdc3_h_clk",
  2167. .ops = &clk_branch_ops,
  2168. .flags = CLK_IS_ROOT,
  2169. },
  2170. },
  2171. };
  2172. static struct clk_branch sdc4_h_clk = {
  2173. .halt_reg = 0x2fc8,
  2174. .halt_bit = 8,
  2175. .clkr = {
  2176. .enable_reg = 0x2880,
  2177. .enable_mask = BIT(4),
  2178. .hw.init = &(struct clk_init_data){
  2179. .name = "sdc4_h_clk",
  2180. .ops = &clk_branch_ops,
  2181. .flags = CLK_IS_ROOT,
  2182. },
  2183. },
  2184. };
  2185. static struct clk_branch sdc5_h_clk = {
  2186. .halt_reg = 0x2fc8,
  2187. .halt_bit = 7,
  2188. .clkr = {
  2189. .enable_reg = 0x28a0,
  2190. .enable_mask = BIT(4),
  2191. .hw.init = &(struct clk_init_data){
  2192. .name = "sdc5_h_clk",
  2193. .ops = &clk_branch_ops,
  2194. .flags = CLK_IS_ROOT,
  2195. },
  2196. },
  2197. };
  2198. static struct clk_branch adm0_clk = {
  2199. .halt_reg = 0x2fdc,
  2200. .halt_check = BRANCH_HALT_VOTED,
  2201. .halt_bit = 14,
  2202. .clkr = {
  2203. .enable_reg = 0x3080,
  2204. .enable_mask = BIT(2),
  2205. .hw.init = &(struct clk_init_data){
  2206. .name = "adm0_clk",
  2207. .ops = &clk_branch_ops,
  2208. .flags = CLK_IS_ROOT,
  2209. },
  2210. },
  2211. };
  2212. static struct clk_branch adm0_pbus_clk = {
  2213. .halt_reg = 0x2fdc,
  2214. .halt_check = BRANCH_HALT_VOTED,
  2215. .halt_bit = 13,
  2216. .clkr = {
  2217. .enable_reg = 0x3080,
  2218. .enable_mask = BIT(3),
  2219. .hw.init = &(struct clk_init_data){
  2220. .name = "adm0_pbus_clk",
  2221. .ops = &clk_branch_ops,
  2222. .flags = CLK_IS_ROOT,
  2223. },
  2224. },
  2225. };
  2226. static struct clk_branch adm1_clk = {
  2227. .halt_reg = 0x2fdc,
  2228. .halt_bit = 12,
  2229. .halt_check = BRANCH_HALT_VOTED,
  2230. .clkr = {
  2231. .enable_reg = 0x3080,
  2232. .enable_mask = BIT(4),
  2233. .hw.init = &(struct clk_init_data){
  2234. .name = "adm1_clk",
  2235. .ops = &clk_branch_ops,
  2236. .flags = CLK_IS_ROOT,
  2237. },
  2238. },
  2239. };
  2240. static struct clk_branch adm1_pbus_clk = {
  2241. .halt_reg = 0x2fdc,
  2242. .halt_bit = 11,
  2243. .halt_check = BRANCH_HALT_VOTED,
  2244. .clkr = {
  2245. .enable_reg = 0x3080,
  2246. .enable_mask = BIT(5),
  2247. .hw.init = &(struct clk_init_data){
  2248. .name = "adm1_pbus_clk",
  2249. .ops = &clk_branch_ops,
  2250. .flags = CLK_IS_ROOT,
  2251. },
  2252. },
  2253. };
  2254. static struct clk_branch modem_ahb1_h_clk = {
  2255. .halt_reg = 0x2fdc,
  2256. .halt_bit = 8,
  2257. .halt_check = BRANCH_HALT_VOTED,
  2258. .clkr = {
  2259. .enable_reg = 0x3080,
  2260. .enable_mask = BIT(0),
  2261. .hw.init = &(struct clk_init_data){
  2262. .name = "modem_ahb1_h_clk",
  2263. .ops = &clk_branch_ops,
  2264. .flags = CLK_IS_ROOT,
  2265. },
  2266. },
  2267. };
  2268. static struct clk_branch modem_ahb2_h_clk = {
  2269. .halt_reg = 0x2fdc,
  2270. .halt_bit = 7,
  2271. .halt_check = BRANCH_HALT_VOTED,
  2272. .clkr = {
  2273. .enable_reg = 0x3080,
  2274. .enable_mask = BIT(1),
  2275. .hw.init = &(struct clk_init_data){
  2276. .name = "modem_ahb2_h_clk",
  2277. .ops = &clk_branch_ops,
  2278. .flags = CLK_IS_ROOT,
  2279. },
  2280. },
  2281. };
  2282. static struct clk_branch pmic_arb0_h_clk = {
  2283. .halt_reg = 0x2fd8,
  2284. .halt_check = BRANCH_HALT_VOTED,
  2285. .halt_bit = 22,
  2286. .clkr = {
  2287. .enable_reg = 0x3080,
  2288. .enable_mask = BIT(8),
  2289. .hw.init = &(struct clk_init_data){
  2290. .name = "pmic_arb0_h_clk",
  2291. .ops = &clk_branch_ops,
  2292. .flags = CLK_IS_ROOT,
  2293. },
  2294. },
  2295. };
  2296. static struct clk_branch pmic_arb1_h_clk = {
  2297. .halt_reg = 0x2fd8,
  2298. .halt_check = BRANCH_HALT_VOTED,
  2299. .halt_bit = 21,
  2300. .clkr = {
  2301. .enable_reg = 0x3080,
  2302. .enable_mask = BIT(9),
  2303. .hw.init = &(struct clk_init_data){
  2304. .name = "pmic_arb1_h_clk",
  2305. .ops = &clk_branch_ops,
  2306. .flags = CLK_IS_ROOT,
  2307. },
  2308. },
  2309. };
  2310. static struct clk_branch pmic_ssbi2_clk = {
  2311. .halt_reg = 0x2fd8,
  2312. .halt_check = BRANCH_HALT_VOTED,
  2313. .halt_bit = 23,
  2314. .clkr = {
  2315. .enable_reg = 0x3080,
  2316. .enable_mask = BIT(7),
  2317. .hw.init = &(struct clk_init_data){
  2318. .name = "pmic_ssbi2_clk",
  2319. .ops = &clk_branch_ops,
  2320. .flags = CLK_IS_ROOT,
  2321. },
  2322. },
  2323. };
  2324. static struct clk_branch rpm_msg_ram_h_clk = {
  2325. .hwcg_reg = 0x27e0,
  2326. .hwcg_bit = 6,
  2327. .halt_reg = 0x2fd8,
  2328. .halt_check = BRANCH_HALT_VOTED,
  2329. .halt_bit = 12,
  2330. .clkr = {
  2331. .enable_reg = 0x3080,
  2332. .enable_mask = BIT(6),
  2333. .hw.init = &(struct clk_init_data){
  2334. .name = "rpm_msg_ram_h_clk",
  2335. .ops = &clk_branch_ops,
  2336. .flags = CLK_IS_ROOT,
  2337. },
  2338. },
  2339. };
  2340. static struct clk_regmap *gcc_msm8660_clks[] = {
  2341. [PLL8] = &pll8.clkr,
  2342. [PLL8_VOTE] = &pll8_vote,
  2343. [GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
  2344. [GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
  2345. [GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
  2346. [GSBI2_UART_CLK] = &gsbi2_uart_clk.clkr,
  2347. [GSBI3_UART_SRC] = &gsbi3_uart_src.clkr,
  2348. [GSBI3_UART_CLK] = &gsbi3_uart_clk.clkr,
  2349. [GSBI4_UART_SRC] = &gsbi4_uart_src.clkr,
  2350. [GSBI4_UART_CLK] = &gsbi4_uart_clk.clkr,
  2351. [GSBI5_UART_SRC] = &gsbi5_uart_src.clkr,
  2352. [GSBI5_UART_CLK] = &gsbi5_uart_clk.clkr,
  2353. [GSBI6_UART_SRC] = &gsbi6_uart_src.clkr,
  2354. [GSBI6_UART_CLK] = &gsbi6_uart_clk.clkr,
  2355. [GSBI7_UART_SRC] = &gsbi7_uart_src.clkr,
  2356. [GSBI7_UART_CLK] = &gsbi7_uart_clk.clkr,
  2357. [GSBI8_UART_SRC] = &gsbi8_uart_src.clkr,
  2358. [GSBI8_UART_CLK] = &gsbi8_uart_clk.clkr,
  2359. [GSBI9_UART_SRC] = &gsbi9_uart_src.clkr,
  2360. [GSBI9_UART_CLK] = &gsbi9_uart_clk.clkr,
  2361. [GSBI10_UART_SRC] = &gsbi10_uart_src.clkr,
  2362. [GSBI10_UART_CLK] = &gsbi10_uart_clk.clkr,
  2363. [GSBI11_UART_SRC] = &gsbi11_uart_src.clkr,
  2364. [GSBI11_UART_CLK] = &gsbi11_uart_clk.clkr,
  2365. [GSBI12_UART_SRC] = &gsbi12_uart_src.clkr,
  2366. [GSBI12_UART_CLK] = &gsbi12_uart_clk.clkr,
  2367. [GSBI1_QUP_SRC] = &gsbi1_qup_src.clkr,
  2368. [GSBI1_QUP_CLK] = &gsbi1_qup_clk.clkr,
  2369. [GSBI2_QUP_SRC] = &gsbi2_qup_src.clkr,
  2370. [GSBI2_QUP_CLK] = &gsbi2_qup_clk.clkr,
  2371. [GSBI3_QUP_SRC] = &gsbi3_qup_src.clkr,
  2372. [GSBI3_QUP_CLK] = &gsbi3_qup_clk.clkr,
  2373. [GSBI4_QUP_SRC] = &gsbi4_qup_src.clkr,
  2374. [GSBI4_QUP_CLK] = &gsbi4_qup_clk.clkr,
  2375. [GSBI5_QUP_SRC] = &gsbi5_qup_src.clkr,
  2376. [GSBI5_QUP_CLK] = &gsbi5_qup_clk.clkr,
  2377. [GSBI6_QUP_SRC] = &gsbi6_qup_src.clkr,
  2378. [GSBI6_QUP_CLK] = &gsbi6_qup_clk.clkr,
  2379. [GSBI7_QUP_SRC] = &gsbi7_qup_src.clkr,
  2380. [GSBI7_QUP_CLK] = &gsbi7_qup_clk.clkr,
  2381. [GSBI8_QUP_SRC] = &gsbi8_qup_src.clkr,
  2382. [GSBI8_QUP_CLK] = &gsbi8_qup_clk.clkr,
  2383. [GSBI9_QUP_SRC] = &gsbi9_qup_src.clkr,
  2384. [GSBI9_QUP_CLK] = &gsbi9_qup_clk.clkr,
  2385. [GSBI10_QUP_SRC] = &gsbi10_qup_src.clkr,
  2386. [GSBI10_QUP_CLK] = &gsbi10_qup_clk.clkr,
  2387. [GSBI11_QUP_SRC] = &gsbi11_qup_src.clkr,
  2388. [GSBI11_QUP_CLK] = &gsbi11_qup_clk.clkr,
  2389. [GSBI12_QUP_SRC] = &gsbi12_qup_src.clkr,
  2390. [GSBI12_QUP_CLK] = &gsbi12_qup_clk.clkr,
  2391. [GP0_SRC] = &gp0_src.clkr,
  2392. [GP0_CLK] = &gp0_clk.clkr,
  2393. [GP1_SRC] = &gp1_src.clkr,
  2394. [GP1_CLK] = &gp1_clk.clkr,
  2395. [GP2_SRC] = &gp2_src.clkr,
  2396. [GP2_CLK] = &gp2_clk.clkr,
  2397. [PMEM_CLK] = &pmem_clk.clkr,
  2398. [PRNG_SRC] = &prng_src.clkr,
  2399. [PRNG_CLK] = &prng_clk.clkr,
  2400. [SDC1_SRC] = &sdc1_src.clkr,
  2401. [SDC1_CLK] = &sdc1_clk.clkr,
  2402. [SDC2_SRC] = &sdc2_src.clkr,
  2403. [SDC2_CLK] = &sdc2_clk.clkr,
  2404. [SDC3_SRC] = &sdc3_src.clkr,
  2405. [SDC3_CLK] = &sdc3_clk.clkr,
  2406. [SDC4_SRC] = &sdc4_src.clkr,
  2407. [SDC4_CLK] = &sdc4_clk.clkr,
  2408. [SDC5_SRC] = &sdc5_src.clkr,
  2409. [SDC5_CLK] = &sdc5_clk.clkr,
  2410. [TSIF_REF_SRC] = &tsif_ref_src.clkr,
  2411. [TSIF_REF_CLK] = &tsif_ref_clk.clkr,
  2412. [USB_HS1_XCVR_SRC] = &usb_hs1_xcvr_src.clkr,
  2413. [USB_HS1_XCVR_CLK] = &usb_hs1_xcvr_clk.clkr,
  2414. [USB_FS1_XCVR_FS_SRC] = &usb_fs1_xcvr_fs_src.clkr,
  2415. [USB_FS1_XCVR_FS_CLK] = &usb_fs1_xcvr_fs_clk.clkr,
  2416. [USB_FS1_SYSTEM_CLK] = &usb_fs1_system_clk.clkr,
  2417. [USB_FS2_XCVR_FS_SRC] = &usb_fs2_xcvr_fs_src.clkr,
  2418. [USB_FS2_XCVR_FS_CLK] = &usb_fs2_xcvr_fs_clk.clkr,
  2419. [USB_FS2_SYSTEM_CLK] = &usb_fs2_system_clk.clkr,
  2420. [GSBI1_H_CLK] = &gsbi1_h_clk.clkr,
  2421. [GSBI2_H_CLK] = &gsbi2_h_clk.clkr,
  2422. [GSBI3_H_CLK] = &gsbi3_h_clk.clkr,
  2423. [GSBI4_H_CLK] = &gsbi4_h_clk.clkr,
  2424. [GSBI5_H_CLK] = &gsbi5_h_clk.clkr,
  2425. [GSBI6_H_CLK] = &gsbi6_h_clk.clkr,
  2426. [GSBI7_H_CLK] = &gsbi7_h_clk.clkr,
  2427. [GSBI8_H_CLK] = &gsbi8_h_clk.clkr,
  2428. [GSBI9_H_CLK] = &gsbi9_h_clk.clkr,
  2429. [GSBI10_H_CLK] = &gsbi10_h_clk.clkr,
  2430. [GSBI11_H_CLK] = &gsbi11_h_clk.clkr,
  2431. [GSBI12_H_CLK] = &gsbi12_h_clk.clkr,
  2432. [TSIF_H_CLK] = &tsif_h_clk.clkr,
  2433. [USB_FS1_H_CLK] = &usb_fs1_h_clk.clkr,
  2434. [USB_FS2_H_CLK] = &usb_fs2_h_clk.clkr,
  2435. [USB_HS1_H_CLK] = &usb_hs1_h_clk.clkr,
  2436. [SDC1_H_CLK] = &sdc1_h_clk.clkr,
  2437. [SDC2_H_CLK] = &sdc2_h_clk.clkr,
  2438. [SDC3_H_CLK] = &sdc3_h_clk.clkr,
  2439. [SDC4_H_CLK] = &sdc4_h_clk.clkr,
  2440. [SDC5_H_CLK] = &sdc5_h_clk.clkr,
  2441. [ADM0_CLK] = &adm0_clk.clkr,
  2442. [ADM0_PBUS_CLK] = &adm0_pbus_clk.clkr,
  2443. [ADM1_CLK] = &adm1_clk.clkr,
  2444. [ADM1_PBUS_CLK] = &adm1_pbus_clk.clkr,
  2445. [MODEM_AHB1_H_CLK] = &modem_ahb1_h_clk.clkr,
  2446. [MODEM_AHB2_H_CLK] = &modem_ahb2_h_clk.clkr,
  2447. [PMIC_ARB0_H_CLK] = &pmic_arb0_h_clk.clkr,
  2448. [PMIC_ARB1_H_CLK] = &pmic_arb1_h_clk.clkr,
  2449. [PMIC_SSBI2_CLK] = &pmic_ssbi2_clk.clkr,
  2450. [RPM_MSG_RAM_H_CLK] = &rpm_msg_ram_h_clk.clkr,
  2451. };
  2452. static const struct qcom_reset_map gcc_msm8660_resets[] = {
  2453. [AFAB_CORE_RESET] = { 0x2080, 7 },
  2454. [SCSS_SYS_RESET] = { 0x20b4, 1 },
  2455. [SCSS_SYS_POR_RESET] = { 0x20b4 },
  2456. [AFAB_SMPSS_S_RESET] = { 0x20b8, 2 },
  2457. [AFAB_SMPSS_M1_RESET] = { 0x20b8, 1 },
  2458. [AFAB_SMPSS_M0_RESET] = { 0x20b8 },
  2459. [AFAB_EBI1_S_RESET] = { 0x20c0, 7 },
  2460. [SFAB_CORE_RESET] = { 0x2120, 7 },
  2461. [SFAB_ADM0_M0_RESET] = { 0x21e0, 7 },
  2462. [SFAB_ADM0_M1_RESET] = { 0x21e4, 7 },
  2463. [SFAB_ADM0_M2_RESET] = { 0x21e4, 7 },
  2464. [ADM0_C2_RESET] = { 0x220c, 4 },
  2465. [ADM0_C1_RESET] = { 0x220c, 3 },
  2466. [ADM0_C0_RESET] = { 0x220c, 2 },
  2467. [ADM0_PBUS_RESET] = { 0x220c, 1 },
  2468. [ADM0_RESET] = { 0x220c },
  2469. [SFAB_ADM1_M0_RESET] = { 0x2220, 7 },
  2470. [SFAB_ADM1_M1_RESET] = { 0x2224, 7 },
  2471. [SFAB_ADM1_M2_RESET] = { 0x2228, 7 },
  2472. [MMFAB_ADM1_M3_RESET] = { 0x2240, 7 },
  2473. [ADM1_C3_RESET] = { 0x226c, 5 },
  2474. [ADM1_C2_RESET] = { 0x226c, 4 },
  2475. [ADM1_C1_RESET] = { 0x226c, 3 },
  2476. [ADM1_C0_RESET] = { 0x226c, 2 },
  2477. [ADM1_PBUS_RESET] = { 0x226c, 1 },
  2478. [ADM1_RESET] = { 0x226c },
  2479. [IMEM0_RESET] = { 0x2280, 7 },
  2480. [SFAB_LPASS_Q6_RESET] = { 0x23a0, 7 },
  2481. [SFAB_AFAB_M_RESET] = { 0x23e0, 7 },
  2482. [AFAB_SFAB_M0_RESET] = { 0x2420, 7 },
  2483. [AFAB_SFAB_M1_RESET] = { 0x2424, 7 },
  2484. [DFAB_CORE_RESET] = { 0x24ac, 7 },
  2485. [SFAB_DFAB_M_RESET] = { 0x2500, 7 },
  2486. [DFAB_SFAB_M_RESET] = { 0x2520, 7 },
  2487. [DFAB_SWAY0_RESET] = { 0x2540, 7 },
  2488. [DFAB_SWAY1_RESET] = { 0x2544, 7 },
  2489. [DFAB_ARB0_RESET] = { 0x2560, 7 },
  2490. [DFAB_ARB1_RESET] = { 0x2564, 7 },
  2491. [PPSS_PROC_RESET] = { 0x2594, 1 },
  2492. [PPSS_RESET] = { 0x2594 },
  2493. [PMEM_RESET] = { 0x25a0, 7 },
  2494. [DMA_BAM_RESET] = { 0x25c0, 7 },
  2495. [SIC_RESET] = { 0x25e0, 7 },
  2496. [SPS_TIC_RESET] = { 0x2600, 7 },
  2497. [CFBP0_RESET] = { 0x2650, 7 },
  2498. [CFBP1_RESET] = { 0x2654, 7 },
  2499. [CFBP2_RESET] = { 0x2658, 7 },
  2500. [EBI2_RESET] = { 0x2664, 7 },
  2501. [SFAB_CFPB_M_RESET] = { 0x2680, 7 },
  2502. [CFPB_MASTER_RESET] = { 0x26a0, 7 },
  2503. [SFAB_CFPB_S_RESET] = { 0x26c0, 7 },
  2504. [CFPB_SPLITTER_RESET] = { 0x26e0, 7 },
  2505. [TSIF_RESET] = { 0x2700, 7 },
  2506. [CE1_RESET] = { 0x2720, 7 },
  2507. [CE2_RESET] = { 0x2740, 7 },
  2508. [SFAB_SFPB_M_RESET] = { 0x2780, 7 },
  2509. [SFAB_SFPB_S_RESET] = { 0x27a0, 7 },
  2510. [RPM_PROC_RESET] = { 0x27c0, 7 },
  2511. [RPM_BUS_RESET] = { 0x27c4, 7 },
  2512. [RPM_MSG_RAM_RESET] = { 0x27e0, 7 },
  2513. [PMIC_ARB0_RESET] = { 0x2800, 7 },
  2514. [PMIC_ARB1_RESET] = { 0x2804, 7 },
  2515. [PMIC_SSBI2_RESET] = { 0x280c, 12 },
  2516. [SDC1_RESET] = { 0x2830 },
  2517. [SDC2_RESET] = { 0x2850 },
  2518. [SDC3_RESET] = { 0x2870 },
  2519. [SDC4_RESET] = { 0x2890 },
  2520. [SDC5_RESET] = { 0x28b0 },
  2521. [USB_HS1_RESET] = { 0x2910 },
  2522. [USB_HS2_XCVR_RESET] = { 0x2934, 1 },
  2523. [USB_HS2_RESET] = { 0x2934 },
  2524. [USB_FS1_XCVR_RESET] = { 0x2974, 1 },
  2525. [USB_FS1_RESET] = { 0x2974 },
  2526. [USB_FS2_XCVR_RESET] = { 0x2994, 1 },
  2527. [USB_FS2_RESET] = { 0x2994 },
  2528. [GSBI1_RESET] = { 0x29dc },
  2529. [GSBI2_RESET] = { 0x29fc },
  2530. [GSBI3_RESET] = { 0x2a1c },
  2531. [GSBI4_RESET] = { 0x2a3c },
  2532. [GSBI5_RESET] = { 0x2a5c },
  2533. [GSBI6_RESET] = { 0x2a7c },
  2534. [GSBI7_RESET] = { 0x2a9c },
  2535. [GSBI8_RESET] = { 0x2abc },
  2536. [GSBI9_RESET] = { 0x2adc },
  2537. [GSBI10_RESET] = { 0x2afc },
  2538. [GSBI11_RESET] = { 0x2b1c },
  2539. [GSBI12_RESET] = { 0x2b3c },
  2540. [SPDM_RESET] = { 0x2b6c },
  2541. [SEC_CTRL_RESET] = { 0x2b80, 7 },
  2542. [TLMM_H_RESET] = { 0x2ba0, 7 },
  2543. [TLMM_RESET] = { 0x2ba4, 7 },
  2544. [MARRM_PWRON_RESET] = { 0x2bd4, 1 },
  2545. [MARM_RESET] = { 0x2bd4 },
  2546. [MAHB1_RESET] = { 0x2be4, 7 },
  2547. [SFAB_MSS_S_RESET] = { 0x2c00, 7 },
  2548. [MAHB2_RESET] = { 0x2c20, 7 },
  2549. [MODEM_SW_AHB_RESET] = { 0x2c48, 1 },
  2550. [MODEM_RESET] = { 0x2c48 },
  2551. [SFAB_MSS_MDM1_RESET] = { 0x2c4c, 1 },
  2552. [SFAB_MSS_MDM0_RESET] = { 0x2c4c },
  2553. [MSS_SLP_RESET] = { 0x2c60, 7 },
  2554. [MSS_MARM_SAW_RESET] = { 0x2c68, 1 },
  2555. [MSS_WDOG_RESET] = { 0x2c68 },
  2556. [TSSC_RESET] = { 0x2ca0, 7 },
  2557. [PDM_RESET] = { 0x2cc0, 12 },
  2558. [SCSS_CORE0_RESET] = { 0x2d60, 1 },
  2559. [SCSS_CORE0_POR_RESET] = { 0x2d60 },
  2560. [SCSS_CORE1_RESET] = { 0x2d80, 1 },
  2561. [SCSS_CORE1_POR_RESET] = { 0x2d80 },
  2562. [MPM_RESET] = { 0x2da4, 1 },
  2563. [EBI1_1X_DIV_RESET] = { 0x2dec, 9 },
  2564. [EBI1_RESET] = { 0x2dec, 7 },
  2565. [SFAB_SMPSS_S_RESET] = { 0x2e00, 7 },
  2566. [USB_PHY0_RESET] = { 0x2e20 },
  2567. [USB_PHY1_RESET] = { 0x2e40 },
  2568. [PRNG_RESET] = { 0x2e80, 12 },
  2569. };
  2570. static const struct regmap_config gcc_msm8660_regmap_config = {
  2571. .reg_bits = 32,
  2572. .reg_stride = 4,
  2573. .val_bits = 32,
  2574. .max_register = 0x363c,
  2575. .fast_io = true,
  2576. };
  2577. static const struct qcom_cc_desc gcc_msm8660_desc = {
  2578. .config = &gcc_msm8660_regmap_config,
  2579. .clks = gcc_msm8660_clks,
  2580. .num_clks = ARRAY_SIZE(gcc_msm8660_clks),
  2581. .resets = gcc_msm8660_resets,
  2582. .num_resets = ARRAY_SIZE(gcc_msm8660_resets),
  2583. };
  2584. static const struct of_device_id gcc_msm8660_match_table[] = {
  2585. { .compatible = "qcom,gcc-msm8660" },
  2586. { }
  2587. };
  2588. MODULE_DEVICE_TABLE(of, gcc_msm8660_match_table);
  2589. static int gcc_msm8660_probe(struct platform_device *pdev)
  2590. {
  2591. struct clk *clk;
  2592. struct device *dev = &pdev->dev;
  2593. /* Temporary until RPM clocks supported */
  2594. clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000);
  2595. if (IS_ERR(clk))
  2596. return PTR_ERR(clk);
  2597. clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 27000000);
  2598. if (IS_ERR(clk))
  2599. return PTR_ERR(clk);
  2600. return qcom_cc_probe(pdev, &gcc_msm8660_desc);
  2601. }
  2602. static struct platform_driver gcc_msm8660_driver = {
  2603. .probe = gcc_msm8660_probe,
  2604. .driver = {
  2605. .name = "gcc-msm8660",
  2606. .of_match_table = gcc_msm8660_match_table,
  2607. },
  2608. };
  2609. static int __init gcc_msm8660_init(void)
  2610. {
  2611. return platform_driver_register(&gcc_msm8660_driver);
  2612. }
  2613. core_initcall(gcc_msm8660_init);
  2614. static void __exit gcc_msm8660_exit(void)
  2615. {
  2616. platform_driver_unregister(&gcc_msm8660_driver);
  2617. }
  2618. module_exit(gcc_msm8660_exit);
  2619. MODULE_DESCRIPTION("GCC MSM 8660 Driver");
  2620. MODULE_LICENSE("GPL v2");
  2621. MODULE_ALIAS("platform:gcc-msm8660");