ums512-clk.c 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Unisoc UMS512 clock driver
  4. *
  5. * Copyright (C) 2022 Unisoc, Inc.
  6. * Author: Xiaolong Zhang <xiaolong.zhang@unisoc.com>
  7. */
  8. #include <linux/clk-provider.h>
  9. #include <linux/err.h>
  10. #include <linux/io.h>
  11. #include <linux/mod_devicetable.h>
  12. #include <linux/module.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/slab.h>
  15. #include <dt-bindings/clock/sprd,ums512-clk.h>
  16. #include "common.h"
  17. #include "composite.h"
  18. #include "div.h"
  19. #include "gate.h"
  20. #include "mux.h"
  21. #include "pll.h"
  22. #define UMS512_MUX_FLAG \
  23. (CLK_GET_RATE_NOCACHE | CLK_SET_RATE_NO_REPARENT)
  24. /* pll gate clock */
  25. /* some pll clocks configure CLK_IGNORE_UNUSED because hw dvfs does not call
  26. * clock interface. hw dvfs can not gate the pll clock.
  27. */
  28. static CLK_FIXED_FACTOR_FW_NAME(clk_26m_aud, "clk-26m-aud", "ext-26m", 1, 1, 0);
  29. static CLK_FIXED_FACTOR_FW_NAME(clk_13m, "clk-13m", "ext-26m", 2, 1, 0);
  30. static CLK_FIXED_FACTOR_FW_NAME(clk_6m5, "clk-6m5", "ext-26m", 4, 1, 0);
  31. static CLK_FIXED_FACTOR_FW_NAME(clk_4m3, "clk-4m3", "ext-26m", 6, 1, 0);
  32. static CLK_FIXED_FACTOR_FW_NAME(clk_2m, "clk-2m", "ext-26m", 13, 1, 0);
  33. static CLK_FIXED_FACTOR_FW_NAME(clk_1m, "clk-1m", "ext-26m", 26, 1, 0);
  34. static CLK_FIXED_FACTOR_FW_NAME(clk_250k, "clk-250k", "ext-26m", 104, 1, 0);
  35. static CLK_FIXED_FACTOR_FW_NAME(rco_25m, "rco-25m", "rco-100m", 4, 1, 0);
  36. static CLK_FIXED_FACTOR_FW_NAME(rco_4m, "rco-4m", "rco-100m", 25, 1, 0);
  37. static CLK_FIXED_FACTOR_FW_NAME(rco_2m, "rco-2m", "rco-100m", 50, 1, 0);
  38. static SPRD_PLL_SC_GATE_CLK_FW_NAME(isppll_gate, "isppll-gate", "ext-26m", 0x8c,
  39. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  40. static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll0_gate, "dpll0-gate", "ext-26m", 0x98,
  41. 0x1000, BIT(0), 0, 0, 240);
  42. static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll1_gate, "dpll1-gate", "ext-26m", 0x9c,
  43. 0x1000, BIT(0), 0, 0, 240);
  44. static SPRD_PLL_SC_GATE_CLK_FW_NAME(lpll_gate, "lpll-gate", "ext-26m", 0xa0,
  45. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  46. static SPRD_PLL_SC_GATE_CLK_FW_NAME(twpll_gate, "twpll-gate", "ext-26m", 0xa4,
  47. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  48. static SPRD_PLL_SC_GATE_CLK_FW_NAME(gpll_gate, "gpll-gate", "ext-26m", 0xa8,
  49. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  50. static SPRD_PLL_SC_GATE_CLK_FW_NAME(rpll_gate, "rpll-gate", "ext-26m", 0xac,
  51. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  52. static SPRD_PLL_SC_GATE_CLK_FW_NAME(cppll_gate, "cppll-gate", "ext-26m", 0xe4,
  53. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  54. static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll0_gate, "mpll0-gate", "ext-26m", 0x190,
  55. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  56. static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll1_gate, "mpll1-gate", "ext-26m", 0x194,
  57. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  58. static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll2_gate, "mpll2-gate", "ext-26m", 0x198,
  59. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  60. static struct sprd_clk_common *ums512_pmu_gate_clks[] = {
  61. /* address base is 0x327e0000 */
  62. &isppll_gate.common,
  63. &dpll0_gate.common,
  64. &dpll1_gate.common,
  65. &lpll_gate.common,
  66. &twpll_gate.common,
  67. &gpll_gate.common,
  68. &rpll_gate.common,
  69. &cppll_gate.common,
  70. &mpll0_gate.common,
  71. &mpll1_gate.common,
  72. &mpll2_gate.common,
  73. };
  74. static struct clk_hw_onecell_data ums512_pmu_gate_hws = {
  75. .hws = {
  76. [CLK_26M_AUD] = &clk_26m_aud.hw,
  77. [CLK_13M] = &clk_13m.hw,
  78. [CLK_6M5] = &clk_6m5.hw,
  79. [CLK_4M3] = &clk_4m3.hw,
  80. [CLK_2M] = &clk_2m.hw,
  81. [CLK_1M] = &clk_1m.hw,
  82. [CLK_250K] = &clk_250k.hw,
  83. [CLK_RCO_25M] = &rco_25m.hw,
  84. [CLK_RCO_4M] = &rco_4m.hw,
  85. [CLK_RCO_2M] = &rco_2m.hw,
  86. [CLK_ISPPLL_GATE] = &isppll_gate.common.hw,
  87. [CLK_DPLL0_GATE] = &dpll0_gate.common.hw,
  88. [CLK_DPLL1_GATE] = &dpll1_gate.common.hw,
  89. [CLK_LPLL_GATE] = &lpll_gate.common.hw,
  90. [CLK_TWPLL_GATE] = &twpll_gate.common.hw,
  91. [CLK_GPLL_GATE] = &gpll_gate.common.hw,
  92. [CLK_RPLL_GATE] = &rpll_gate.common.hw,
  93. [CLK_CPPLL_GATE] = &cppll_gate.common.hw,
  94. [CLK_MPLL0_GATE] = &mpll0_gate.common.hw,
  95. [CLK_MPLL1_GATE] = &mpll1_gate.common.hw,
  96. [CLK_MPLL2_GATE] = &mpll2_gate.common.hw,
  97. },
  98. .num = CLK_PMU_GATE_NUM,
  99. };
  100. static struct sprd_clk_desc ums512_pmu_gate_desc = {
  101. .clk_clks = ums512_pmu_gate_clks,
  102. .num_clk_clks = ARRAY_SIZE(ums512_pmu_gate_clks),
  103. .hw_clks = &ums512_pmu_gate_hws,
  104. };
  105. /* pll clock at g0 */
  106. static const u64 itable_dpll0[7] = { 6, 0, 0,
  107. 1173000000ULL, 1475000000ULL,
  108. 1855000000ULL, 1866000000ULL };
  109. static struct clk_bit_field f_dpll0[PLL_FACT_MAX] = {
  110. { .shift = 18, .width = 1 }, /* lock_done */
  111. { .shift = 0, .width = 1 }, /* div_s */
  112. { .shift = 67, .width = 1 }, /* mod_en */
  113. { .shift = 1, .width = 1 }, /* sdm_en */
  114. { .shift = 0, .width = 0 }, /* refin */
  115. { .shift = 4, .width = 3 }, /* icp */
  116. { .shift = 7, .width = 11 }, /* n */
  117. { .shift = 55, .width = 7 }, /* nint */
  118. { .shift = 32, .width = 23}, /* kint */
  119. { .shift = 0, .width = 0 }, /* prediv */
  120. { .shift = 0, .width = 0 }, /* postdiv */
  121. };
  122. static SPRD_PLL_HW(dpll0, "dpll0", &dpll0_gate.common.hw, 0x4, 3,
  123. itable_dpll0, f_dpll0, 240, 1000, 1000, 0, 0);
  124. static CLK_FIXED_FACTOR_HW(dpll0_58m31, "dpll0-58m31", &dpll0.common.hw,
  125. 32, 1, 0);
  126. static struct sprd_clk_common *ums512_g0_pll_clks[] = {
  127. /* address base is 0x32390000 */
  128. &dpll0.common,
  129. };
  130. static struct clk_hw_onecell_data ums512_g0_pll_hws = {
  131. .hws = {
  132. [CLK_DPLL0] = &dpll0.common.hw,
  133. [CLK_DPLL0_58M31] = &dpll0_58m31.hw,
  134. },
  135. .num = CLK_ANLG_PHY_G0_NUM,
  136. };
  137. static struct sprd_clk_desc ums512_g0_pll_desc = {
  138. .clk_clks = ums512_g0_pll_clks,
  139. .num_clk_clks = ARRAY_SIZE(ums512_g0_pll_clks),
  140. .hw_clks = &ums512_g0_pll_hws,
  141. };
  142. /* pll clock at g2 */
  143. static const u64 itable_mpll[8] = { 7, 0,
  144. 1400000000ULL, 1600000000ULL,
  145. 1800000000ULL, 2000000000ULL,
  146. 2200000000ULL, 2500000000ULL };
  147. static struct clk_bit_field f_mpll[PLL_FACT_MAX] = {
  148. { .shift = 17, .width = 1 }, /* lock_done */
  149. { .shift = 0, .width = 1 }, /* div_s */
  150. { .shift = 67, .width = 1 }, /* mod_en */
  151. { .shift = 1, .width = 1 }, /* sdm_en */
  152. { .shift = 0, .width = 0 }, /* refin */
  153. { .shift = 2, .width = 3 }, /* icp */
  154. { .shift = 5, .width = 11 }, /* n */
  155. { .shift = 55, .width = 7 }, /* nint */
  156. { .shift = 32, .width = 23}, /* kint */
  157. { .shift = 0, .width = 0 }, /* prediv */
  158. { .shift = 77, .width = 1 }, /* postdiv */
  159. };
  160. static SPRD_PLL_HW(mpll1, "mpll1", &mpll1_gate.common.hw, 0x0, 3,
  161. itable_mpll, f_mpll, 240, 1000, 1000, 1, 1200000000);
  162. static CLK_FIXED_FACTOR_HW(mpll1_63m38, "mpll1-63m38", &mpll1.common.hw,
  163. 32, 1, 0);
  164. static struct sprd_clk_common *ums512_g2_pll_clks[] = {
  165. /* address base is 0x323B0000 */
  166. &mpll1.common,
  167. };
  168. static struct clk_hw_onecell_data ums512_g2_pll_hws = {
  169. .hws = {
  170. [CLK_MPLL1] = &mpll1.common.hw,
  171. [CLK_MPLL1_63M38] = &mpll1_63m38.hw,
  172. },
  173. .num = CLK_ANLG_PHY_G2_NUM,
  174. };
  175. static struct sprd_clk_desc ums512_g2_pll_desc = {
  176. .clk_clks = ums512_g2_pll_clks,
  177. .num_clk_clks = ARRAY_SIZE(ums512_g2_pll_clks),
  178. .hw_clks = &ums512_g2_pll_hws,
  179. };
  180. /* pll at g3 */
  181. static const u64 itable[8] = { 7, 0, 0,
  182. 900000000ULL, 1100000000ULL,
  183. 1300000000ULL, 1500000000ULL,
  184. 1600000000ULL };
  185. static struct clk_bit_field f_pll[PLL_FACT_MAX] = {
  186. { .shift = 18, .width = 1 }, /* lock_done */
  187. { .shift = 0, .width = 1 }, /* div_s */
  188. { .shift = 67, .width = 1 }, /* mod_en */
  189. { .shift = 1, .width = 1 }, /* sdm_en */
  190. { .shift = 0, .width = 0 }, /* refin */
  191. { .shift = 2, .width = 3 }, /* icp */
  192. { .shift = 5, .width = 11 }, /* n */
  193. { .shift = 55, .width = 7 }, /* nint */
  194. { .shift = 32, .width = 23}, /* kint */
  195. { .shift = 0, .width = 0 }, /* prediv */
  196. { .shift = 77, .width = 1 }, /* postdiv */
  197. };
  198. static SPRD_PLL_FW_NAME(rpll, "rpll", "ext-26m", 0x0, 3,
  199. itable, f_pll, 240, 1000, 1000, 1, 750000000);
  200. static SPRD_SC_GATE_CLK_FW_NAME(audio_gate, "audio-gate", "ext-26m", 0x24,
  201. 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
  202. static struct clk_bit_field f_mpll2[PLL_FACT_MAX] = {
  203. { .shift = 16, .width = 1 }, /* lock_done */
  204. { .shift = 0, .width = 1 }, /* div_s */
  205. { .shift = 67, .width = 1 }, /* mod_en */
  206. { .shift = 1, .width = 1 }, /* sdm_en */
  207. { .shift = 0, .width = 0 }, /* refin */
  208. { .shift = 2, .width = 3 }, /* icp */
  209. { .shift = 5, .width = 11 }, /* n */
  210. { .shift = 55, .width = 7 }, /* nint */
  211. { .shift = 32, .width = 23}, /* kint */
  212. { .shift = 0, .width = 0 }, /* prediv */
  213. { .shift = 77, .width = 1 }, /* postdiv */
  214. };
  215. static SPRD_PLL_HW(mpll0, "mpll0", &mpll0_gate.common.hw, 0x54, 3,
  216. itable_mpll, f_mpll, 240, 1000, 1000, 1, 1200000000);
  217. static CLK_FIXED_FACTOR_HW(mpll0_56m88, "mpll0-56m88", &mpll0.common.hw,
  218. 32, 1, 0);
  219. static const u64 itable_mpll2[6] = { 5,
  220. 1200000000ULL, 1400000000ULL,
  221. 1600000000ULL, 1800000000ULL,
  222. 2000000000ULL };
  223. static SPRD_PLL_HW(mpll2, "mpll2", &mpll2_gate.common.hw, 0x9c, 3,
  224. itable_mpll2, f_mpll2, 240, 1000, 1000, 1, 1000000000);
  225. static CLK_FIXED_FACTOR_HW(mpll2_47m13, "mpll2-47m13", &mpll2.common.hw,
  226. 32, 1, 0);
  227. static struct sprd_clk_common *ums512_g3_pll_clks[] = {
  228. /* address base is 0x323c0000 */
  229. &rpll.common,
  230. &audio_gate.common,
  231. &mpll0.common,
  232. &mpll2.common,
  233. };
  234. static struct clk_hw_onecell_data ums512_g3_pll_hws = {
  235. .hws = {
  236. [CLK_RPLL] = &rpll.common.hw,
  237. [CLK_AUDIO_GATE] = &audio_gate.common.hw,
  238. [CLK_MPLL0] = &mpll0.common.hw,
  239. [CLK_MPLL0_56M88] = &mpll0_56m88.hw,
  240. [CLK_MPLL2] = &mpll2.common.hw,
  241. [CLK_MPLL2_47M13] = &mpll2_47m13.hw,
  242. },
  243. .num = CLK_ANLG_PHY_G3_NUM,
  244. };
  245. static struct sprd_clk_desc ums512_g3_pll_desc = {
  246. .clk_clks = ums512_g3_pll_clks,
  247. .num_clk_clks = ARRAY_SIZE(ums512_g3_pll_clks),
  248. .hw_clks = &ums512_g3_pll_hws,
  249. };
  250. /* pll clock at gc */
  251. static SPRD_PLL_FW_NAME(twpll, "twpll", "ext-26m", 0x0, 3,
  252. itable, f_pll, 240, 1000, 1000, 1, 750000000);
  253. static CLK_FIXED_FACTOR_HW(twpll_768m, "twpll-768m", &twpll.common.hw,
  254. 2, 1, 0);
  255. static CLK_FIXED_FACTOR_HW(twpll_384m, "twpll-384m", &twpll.common.hw,
  256. 4, 1, 0);
  257. static CLK_FIXED_FACTOR_HW(twpll_192m, "twpll-192m", &twpll.common.hw,
  258. 8, 1, 0);
  259. static CLK_FIXED_FACTOR_HW(twpll_96m, "twpll-96m", &twpll.common.hw,
  260. 16, 1, 0);
  261. static CLK_FIXED_FACTOR_HW(twpll_48m, "twpll-48m", &twpll.common.hw,
  262. 32, 1, 0);
  263. static CLK_FIXED_FACTOR_HW(twpll_24m, "twpll-24m", &twpll.common.hw,
  264. 64, 1, 0);
  265. static CLK_FIXED_FACTOR_HW(twpll_12m, "twpll-12m", &twpll.common.hw,
  266. 128, 1, 0);
  267. static CLK_FIXED_FACTOR_HW(twpll_512m, "twpll-512m", &twpll.common.hw,
  268. 3, 1, 0);
  269. static CLK_FIXED_FACTOR_HW(twpll_256m, "twpll-256m", &twpll.common.hw,
  270. 6, 1, 0);
  271. static CLK_FIXED_FACTOR_HW(twpll_128m, "twpll-128m", &twpll.common.hw,
  272. 12, 1, 0);
  273. static CLK_FIXED_FACTOR_HW(twpll_64m, "twpll-64m", &twpll.common.hw,
  274. 24, 1, 0);
  275. static CLK_FIXED_FACTOR_HW(twpll_307m2, "twpll-307m2", &twpll.common.hw,
  276. 5, 1, 0);
  277. static CLK_FIXED_FACTOR_HW(twpll_219m4, "twpll-219m4", &twpll.common.hw,
  278. 7, 1, 0);
  279. static CLK_FIXED_FACTOR_HW(twpll_170m6, "twpll-170m6", &twpll.common.hw,
  280. 9, 1, 0);
  281. static CLK_FIXED_FACTOR_HW(twpll_153m6, "twpll-153m6", &twpll.common.hw,
  282. 10, 1, 0);
  283. static CLK_FIXED_FACTOR_HW(twpll_76m8, "twpll-76m8", &twpll.common.hw,
  284. 20, 1, 0);
  285. static CLK_FIXED_FACTOR_HW(twpll_51m2, "twpll-51m2", &twpll.common.hw,
  286. 30, 1, 0);
  287. static CLK_FIXED_FACTOR_HW(twpll_38m4, "twpll-38m4", &twpll.common.hw,
  288. 40, 1, 0);
  289. static CLK_FIXED_FACTOR_HW(twpll_19m2, "twpll-19m2", &twpll.common.hw,
  290. 80, 1, 0);
  291. static CLK_FIXED_FACTOR_HW(twpll_12m29, "twpll-12m29", &twpll.common.hw,
  292. 125, 1, 0);
  293. static SPRD_PLL_FW_NAME(lpll, "lpll", "ext-26m", 0x18, 3,
  294. itable, f_pll, 240, 1000, 1000, 1, 750000000);
  295. static CLK_FIXED_FACTOR_HW(lpll_614m4, "lpll-614m4", &lpll.common.hw,
  296. 2, 1, 0);
  297. static CLK_FIXED_FACTOR_HW(lpll_409m6, "lpll-409m6", &lpll.common.hw,
  298. 3, 1, 0);
  299. static CLK_FIXED_FACTOR_HW(lpll_245m76, "lpll-245m76", &lpll.common.hw,
  300. 5, 1, 0);
  301. static CLK_FIXED_FACTOR_HW(lpll_30m72, "lpll-30m72", &lpll.common.hw,
  302. 40, 1, 0);
  303. static SPRD_PLL_FW_NAME(isppll, "isppll", "ext-26m", 0x30, 3,
  304. itable, f_pll, 240, 1000, 1000, 1, 750000000);
  305. static CLK_FIXED_FACTOR_HW(isppll_468m, "isppll-468m", &isppll.common.hw,
  306. 2, 1, 0);
  307. static CLK_FIXED_FACTOR_HW(isppll_78m, "isppll-78m", &isppll.common.hw,
  308. 12, 1, 0);
  309. static SPRD_PLL_HW(gpll, "gpll", &gpll_gate.common.hw, 0x48, 3,
  310. itable, f_pll, 240, 1000, 1000, 1, 750000000);
  311. static CLK_FIXED_FACTOR_HW(gpll_40m, "gpll-40m", &gpll.common.hw,
  312. 20, 1, 0);
  313. static SPRD_PLL_HW(cppll, "cppll", &cppll_gate.common.hw, 0x60, 3,
  314. itable, f_pll, 240, 1000, 1000, 1, 750000000);
  315. static CLK_FIXED_FACTOR_HW(cppll_39m32, "cppll-39m32", &cppll.common.hw,
  316. 26, 1, 0);
  317. static struct sprd_clk_common *ums512_gc_pll_clks[] = {
  318. /* address base is 0x323e0000 */
  319. &twpll.common,
  320. &lpll.common,
  321. &isppll.common,
  322. &gpll.common,
  323. &cppll.common,
  324. };
  325. static struct clk_hw_onecell_data ums512_gc_pll_hws = {
  326. .hws = {
  327. [CLK_TWPLL] = &twpll.common.hw,
  328. [CLK_TWPLL_768M] = &twpll_768m.hw,
  329. [CLK_TWPLL_384M] = &twpll_384m.hw,
  330. [CLK_TWPLL_192M] = &twpll_192m.hw,
  331. [CLK_TWPLL_96M] = &twpll_96m.hw,
  332. [CLK_TWPLL_48M] = &twpll_48m.hw,
  333. [CLK_TWPLL_24M] = &twpll_24m.hw,
  334. [CLK_TWPLL_12M] = &twpll_12m.hw,
  335. [CLK_TWPLL_512M] = &twpll_512m.hw,
  336. [CLK_TWPLL_256M] = &twpll_256m.hw,
  337. [CLK_TWPLL_128M] = &twpll_128m.hw,
  338. [CLK_TWPLL_64M] = &twpll_64m.hw,
  339. [CLK_TWPLL_307M2] = &twpll_307m2.hw,
  340. [CLK_TWPLL_219M4] = &twpll_219m4.hw,
  341. [CLK_TWPLL_170M6] = &twpll_170m6.hw,
  342. [CLK_TWPLL_153M6] = &twpll_153m6.hw,
  343. [CLK_TWPLL_76M8] = &twpll_76m8.hw,
  344. [CLK_TWPLL_51M2] = &twpll_51m2.hw,
  345. [CLK_TWPLL_38M4] = &twpll_38m4.hw,
  346. [CLK_TWPLL_19M2] = &twpll_19m2.hw,
  347. [CLK_TWPLL_12M29] = &twpll_12m29.hw,
  348. [CLK_LPLL] = &lpll.common.hw,
  349. [CLK_LPLL_614M4] = &lpll_614m4.hw,
  350. [CLK_LPLL_409M6] = &lpll_409m6.hw,
  351. [CLK_LPLL_245M76] = &lpll_245m76.hw,
  352. [CLK_LPLL_30M72] = &lpll_30m72.hw,
  353. [CLK_ISPPLL] = &isppll.common.hw,
  354. [CLK_ISPPLL_468M] = &isppll_468m.hw,
  355. [CLK_ISPPLL_78M] = &isppll_78m.hw,
  356. [CLK_GPLL] = &gpll.common.hw,
  357. [CLK_GPLL_40M] = &gpll_40m.hw,
  358. [CLK_CPPLL] = &cppll.common.hw,
  359. [CLK_CPPLL_39M32] = &cppll_39m32.hw,
  360. },
  361. .num = CLK_ANLG_PHY_GC_NUM,
  362. };
  363. static struct sprd_clk_desc ums512_gc_pll_desc = {
  364. .clk_clks = ums512_gc_pll_clks,
  365. .num_clk_clks = ARRAY_SIZE(ums512_gc_pll_clks),
  366. .hw_clks = &ums512_gc_pll_hws,
  367. };
  368. /* ap ahb gates */
  369. static SPRD_SC_GATE_CLK_FW_NAME(dsi_eb, "dsi-eb", "ext-26m",
  370. 0x0, 0x1000, BIT(0), 0, 0);
  371. static SPRD_SC_GATE_CLK_FW_NAME(dispc_eb, "dispc-eb", "ext-26m",
  372. 0x0, 0x1000, BIT(1), 0, 0);
  373. static SPRD_SC_GATE_CLK_FW_NAME(vsp_eb, "vsp-eb", "ext-26m",
  374. 0x0, 0x1000, BIT(2), 0, 0);
  375. static SPRD_SC_GATE_CLK_FW_NAME(vdma_eb, "vdma-eb", "ext-26m",
  376. 0x0, 0x1000, BIT(3), 0, 0);
  377. static SPRD_SC_GATE_CLK_FW_NAME(dma_pub_eb, "dma-pub-eb", "ext-26m",
  378. 0x0, 0x1000, BIT(4), 0, 0);
  379. static SPRD_SC_GATE_CLK_FW_NAME(dma_sec_eb, "dma-sec-eb", "ext-26m",
  380. 0x0, 0x1000, BIT(5), 0, 0);
  381. static SPRD_SC_GATE_CLK_FW_NAME(ipi_eb, "ipi-eb", "ext-26m",
  382. 0x0, 0x1000, BIT(6), 0, 0);
  383. static SPRD_SC_GATE_CLK_FW_NAME(ahb_ckg_eb, "ahb-ckg-eb", "ext-26m",
  384. 0x0, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
  385. static SPRD_SC_GATE_CLK_FW_NAME(bm_clk_eb, "bm-clk-eb", "ext-26m",
  386. 0x0, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
  387. static struct sprd_clk_common *ums512_apahb_gate[] = {
  388. /* address base is 0x20100000 */
  389. &dsi_eb.common,
  390. &dispc_eb.common,
  391. &vsp_eb.common,
  392. &vdma_eb.common,
  393. &dma_pub_eb.common,
  394. &dma_sec_eb.common,
  395. &ipi_eb.common,
  396. &ahb_ckg_eb.common,
  397. &bm_clk_eb.common,
  398. };
  399. static struct clk_hw_onecell_data ums512_apahb_gate_hws = {
  400. .hws = {
  401. [CLK_DSI_EB] = &dsi_eb.common.hw,
  402. [CLK_DISPC_EB] = &dispc_eb.common.hw,
  403. [CLK_VSP_EB] = &vsp_eb.common.hw,
  404. [CLK_VDMA_EB] = &vdma_eb.common.hw,
  405. [CLK_DMA_PUB_EB] = &dma_pub_eb.common.hw,
  406. [CLK_DMA_SEC_EB] = &dma_sec_eb.common.hw,
  407. [CLK_IPI_EB] = &ipi_eb.common.hw,
  408. [CLK_AHB_CKG_EB] = &ahb_ckg_eb.common.hw,
  409. [CLK_BM_CLK_EB] = &bm_clk_eb.common.hw,
  410. },
  411. .num = CLK_AP_AHB_GATE_NUM,
  412. };
  413. static struct sprd_clk_desc ums512_apahb_gate_desc = {
  414. .clk_clks = ums512_apahb_gate,
  415. .num_clk_clks = ARRAY_SIZE(ums512_apahb_gate),
  416. .hw_clks = &ums512_apahb_gate_hws,
  417. };
  418. /* ap clks */
  419. static const struct clk_parent_data ap_apb_parents[] = {
  420. { .fw_name = "ext-26m" },
  421. { .hw = &twpll_64m.hw },
  422. { .hw = &twpll_96m.hw },
  423. { .hw = &twpll_128m.hw },
  424. };
  425. static SPRD_MUX_CLK_DATA(ap_apb_clk, "ap-apb-clk", ap_apb_parents,
  426. 0x20, 0, 2, UMS512_MUX_FLAG);
  427. static const struct clk_parent_data ipi_parents[] = {
  428. { .fw_name = "ext-26m" },
  429. { .hw = &twpll_64m.hw },
  430. { .hw = &twpll_96m.hw },
  431. { .hw = &twpll_128m.hw },
  432. };
  433. static SPRD_MUX_CLK_DATA(ipi_clk, "ipi-clk", ipi_parents,
  434. 0x24, 0, 2, UMS512_MUX_FLAG);
  435. static const struct clk_parent_data ap_uart_parents[] = {
  436. { .fw_name = "ext-26m" },
  437. { .hw = &twpll_48m.hw },
  438. { .hw = &twpll_51m2.hw },
  439. { .hw = &twpll_96m.hw },
  440. };
  441. static SPRD_COMP_CLK_DATA(ap_uart0_clk, "ap-uart0-clk", ap_uart_parents,
  442. 0x28, 0, 2, 8, 3, 0);
  443. static SPRD_COMP_CLK_DATA(ap_uart1_clk, "ap-uart1-clk", ap_uart_parents,
  444. 0x2c, 0, 2, 8, 3, 0);
  445. static SPRD_COMP_CLK_DATA(ap_uart2_clk, "ap-uart2-clk", ap_uart_parents,
  446. 0x30, 0, 2, 8, 3, 0);
  447. static const struct clk_parent_data i2c_parents[] = {
  448. { .fw_name = "ext-26m" },
  449. { .hw = &twpll_48m.hw },
  450. { .hw = &twpll_51m2.hw },
  451. { .hw = &twpll_153m6.hw },
  452. };
  453. static SPRD_COMP_CLK_DATA(ap_i2c0_clk, "ap-i2c0-clk", i2c_parents,
  454. 0x34, 0, 2, 8, 3, 0);
  455. static SPRD_COMP_CLK_DATA(ap_i2c1_clk, "ap-i2c1-clk", i2c_parents,
  456. 0x38, 0, 2, 8, 3, 0);
  457. static SPRD_COMP_CLK_DATA(ap_i2c2_clk, "ap-i2c2-clk", i2c_parents,
  458. 0x3c, 0, 2, 8, 3, 0);
  459. static SPRD_COMP_CLK_DATA(ap_i2c3_clk, "ap-i2c3-clk", i2c_parents,
  460. 0x40, 0, 2, 8, 3, 0);
  461. static SPRD_COMP_CLK_DATA(ap_i2c4_clk, "ap-i2c4-clk", i2c_parents,
  462. 0x44, 0, 2, 8, 3, 0);
  463. static const struct clk_parent_data spi_parents[] = {
  464. { .fw_name = "ext-26m" },
  465. { .hw = &twpll_128m.hw },
  466. { .hw = &twpll_153m6.hw },
  467. { .hw = &twpll_192m.hw },
  468. };
  469. static SPRD_COMP_CLK_DATA(ap_spi0_clk, "ap-spi0-clk", spi_parents,
  470. 0x48, 0, 2, 8, 3, 0);
  471. static SPRD_COMP_CLK_DATA(ap_spi1_clk, "ap-spi1-clk", spi_parents,
  472. 0x4c, 0, 2, 8, 3, 0);
  473. static SPRD_COMP_CLK_DATA(ap_spi2_clk, "ap-spi2-clk", spi_parents,
  474. 0x50, 0, 2, 8, 3, 0);
  475. static SPRD_COMP_CLK_DATA(ap_spi3_clk, "ap-spi3-clk", spi_parents,
  476. 0x54, 0, 2, 8, 3, 0);
  477. static const struct clk_parent_data iis_parents[] = {
  478. { .fw_name = "ext-26m" },
  479. { .hw = &twpll_128m.hw },
  480. { .hw = &twpll_153m6.hw },
  481. };
  482. static SPRD_COMP_CLK_DATA(ap_iis0_clk, "ap-iis0-clk", iis_parents,
  483. 0x58, 0, 2, 8, 3, 0);
  484. static SPRD_COMP_CLK_DATA(ap_iis1_clk, "ap-iis1-clk", iis_parents,
  485. 0x5c, 0, 2, 8, 3, 0);
  486. static SPRD_COMP_CLK_DATA(ap_iis2_clk, "ap-iis2-clk", iis_parents,
  487. 0x60, 0, 2, 8, 3, 0);
  488. static const struct clk_parent_data sim_parents[] = {
  489. { .fw_name = "ext-26m" },
  490. { .hw = &twpll_51m2.hw },
  491. { .hw = &twpll_64m.hw },
  492. { .hw = &twpll_96m.hw },
  493. { .hw = &twpll_128m.hw },
  494. };
  495. static SPRD_COMP_CLK_DATA(ap_sim_clk, "ap-sim-clk", sim_parents,
  496. 0x64, 0, 3, 8, 3, 0);
  497. static const struct clk_parent_data ap_ce_parents[] = {
  498. { .fw_name = "ext-26m" },
  499. { .hw = &twpll_96m.hw },
  500. { .hw = &twpll_192m.hw },
  501. { .hw = &twpll_256m.hw },
  502. };
  503. static SPRD_MUX_CLK_DATA(ap_ce_clk, "ap-ce-clk", ap_ce_parents,
  504. 0x68, 0, 2, UMS512_MUX_FLAG);
  505. static const struct clk_parent_data sdio_parents[] = {
  506. { .hw = &clk_1m.hw },
  507. { .fw_name = "ext-26m" },
  508. { .hw = &twpll_307m2.hw },
  509. { .hw = &twpll_384m.hw },
  510. { .hw = &rpll.common.hw },
  511. { .hw = &lpll_409m6.hw },
  512. };
  513. static SPRD_MUX_CLK_DATA(sdio0_2x_clk, "sdio0-2x", sdio_parents,
  514. 0x80, 0, 3, UMS512_MUX_FLAG);
  515. static SPRD_MUX_CLK_DATA(sdio1_2x_clk, "sdio1-2x", sdio_parents,
  516. 0x88, 0, 3, UMS512_MUX_FLAG);
  517. static SPRD_MUX_CLK_DATA(emmc_2x_clk, "emmc-2x", sdio_parents,
  518. 0x90, 0, 3, UMS512_MUX_FLAG);
  519. static const struct clk_parent_data vsp_parents[] = {
  520. { .hw = &twpll_256m.hw },
  521. { .hw = &twpll_307m2.hw },
  522. { .hw = &twpll_384m.hw },
  523. };
  524. static SPRD_MUX_CLK_DATA(vsp_clk, "vsp-clk", vsp_parents,
  525. 0x98, 0, 2, UMS512_MUX_FLAG);
  526. static const struct clk_parent_data dispc0_parents[] = {
  527. { .hw = &twpll_153m6.hw },
  528. { .hw = &twpll_192m.hw },
  529. { .hw = &twpll_256m.hw },
  530. { .hw = &twpll_307m2.hw },
  531. { .hw = &twpll_384m.hw },
  532. };
  533. static SPRD_MUX_CLK_DATA(dispc0_clk, "dispc0-clk", dispc0_parents,
  534. 0x9c, 0, 3, UMS512_MUX_FLAG);
  535. static const struct clk_parent_data dispc0_dpi_parents[] = {
  536. { .hw = &twpll_96m.hw },
  537. { .hw = &twpll_128m.hw },
  538. { .hw = &twpll_153m6.hw },
  539. { .hw = &twpll_192m.hw },
  540. };
  541. static SPRD_COMP_CLK_DATA(dispc0_dpi_clk, "dispc0-dpi-clk", dispc0_dpi_parents,
  542. 0xa0, 0, 3, 8, 4, 0);
  543. static const struct clk_parent_data dsi_apb_parents[] = {
  544. { .hw = &twpll_96m.hw },
  545. { .hw = &twpll_128m.hw },
  546. { .hw = &twpll_153m6.hw },
  547. { .hw = &twpll_192m.hw },
  548. };
  549. static SPRD_MUX_CLK_DATA(dsi_apb_clk, "dsi-apb-clk", dsi_apb_parents,
  550. 0xa4, 0, 2, UMS512_MUX_FLAG);
  551. static SPRD_GATE_CLK_FW_NAME(dsi_rxesc, "dsi-rxesc", "ext-26m",
  552. 0xa8, BIT(16), 0, 0);
  553. static SPRD_GATE_CLK_FW_NAME(dsi_lanebyte, "dsi-lanebyte", "ext-26m",
  554. 0xac, BIT(16), 0, 0);
  555. static const struct clk_parent_data vdsp_parents[] = {
  556. { .hw = &twpll_256m.hw },
  557. { .hw = &twpll_384m.hw },
  558. { .hw = &twpll_512m.hw },
  559. { .hw = &lpll_614m4.hw },
  560. { .hw = &twpll_768m.hw },
  561. { .hw = &isppll.common.hw },
  562. };
  563. static SPRD_MUX_CLK_DATA(vdsp_clk, "vdsp-clk", vdsp_parents,
  564. 0xb0, 0, 3, UMS512_MUX_FLAG);
  565. static SPRD_DIV_CLK_HW(vdsp_m_clk, "vdsp-m-clk", &vdsp_clk.common.hw,
  566. 0xb4, 8, 2, 0);
  567. static struct sprd_clk_common *ums512_ap_clks[] = {
  568. /* address base is 0x20200000 */
  569. &ap_apb_clk.common,
  570. &ipi_clk.common,
  571. &ap_uart0_clk.common,
  572. &ap_uart1_clk.common,
  573. &ap_uart2_clk.common,
  574. &ap_i2c0_clk.common,
  575. &ap_i2c1_clk.common,
  576. &ap_i2c2_clk.common,
  577. &ap_i2c3_clk.common,
  578. &ap_i2c4_clk.common,
  579. &ap_spi0_clk.common,
  580. &ap_spi1_clk.common,
  581. &ap_spi2_clk.common,
  582. &ap_spi3_clk.common,
  583. &ap_iis0_clk.common,
  584. &ap_iis1_clk.common,
  585. &ap_iis2_clk.common,
  586. &ap_sim_clk.common,
  587. &ap_ce_clk.common,
  588. &sdio0_2x_clk.common,
  589. &sdio1_2x_clk.common,
  590. &emmc_2x_clk.common,
  591. &vsp_clk.common,
  592. &dispc0_clk.common,
  593. &dispc0_dpi_clk.common,
  594. &dsi_apb_clk.common,
  595. &dsi_rxesc.common,
  596. &dsi_lanebyte.common,
  597. &vdsp_clk.common,
  598. &vdsp_m_clk.common,
  599. };
  600. static struct clk_hw_onecell_data ums512_ap_clk_hws = {
  601. .hws = {
  602. [CLK_AP_APB] = &ap_apb_clk.common.hw,
  603. [CLK_IPI] = &ipi_clk.common.hw,
  604. [CLK_AP_UART0] = &ap_uart0_clk.common.hw,
  605. [CLK_AP_UART1] = &ap_uart1_clk.common.hw,
  606. [CLK_AP_UART2] = &ap_uart2_clk.common.hw,
  607. [CLK_AP_I2C0] = &ap_i2c0_clk.common.hw,
  608. [CLK_AP_I2C1] = &ap_i2c1_clk.common.hw,
  609. [CLK_AP_I2C2] = &ap_i2c2_clk.common.hw,
  610. [CLK_AP_I2C3] = &ap_i2c3_clk.common.hw,
  611. [CLK_AP_I2C4] = &ap_i2c4_clk.common.hw,
  612. [CLK_AP_SPI0] = &ap_spi0_clk.common.hw,
  613. [CLK_AP_SPI1] = &ap_spi1_clk.common.hw,
  614. [CLK_AP_SPI2] = &ap_spi2_clk.common.hw,
  615. [CLK_AP_SPI3] = &ap_spi3_clk.common.hw,
  616. [CLK_AP_IIS0] = &ap_iis0_clk.common.hw,
  617. [CLK_AP_IIS1] = &ap_iis1_clk.common.hw,
  618. [CLK_AP_IIS2] = &ap_iis2_clk.common.hw,
  619. [CLK_AP_SIM] = &ap_sim_clk.common.hw,
  620. [CLK_AP_CE] = &ap_ce_clk.common.hw,
  621. [CLK_SDIO0_2X] = &sdio0_2x_clk.common.hw,
  622. [CLK_SDIO1_2X] = &sdio1_2x_clk.common.hw,
  623. [CLK_EMMC_2X] = &emmc_2x_clk.common.hw,
  624. [CLK_VSP] = &vsp_clk.common.hw,
  625. [CLK_DISPC0] = &dispc0_clk.common.hw,
  626. [CLK_DISPC0_DPI] = &dispc0_dpi_clk.common.hw,
  627. [CLK_DSI_APB] = &dsi_apb_clk.common.hw,
  628. [CLK_DSI_RXESC] = &dsi_rxesc.common.hw,
  629. [CLK_DSI_LANEBYTE] = &dsi_lanebyte.common.hw,
  630. [CLK_VDSP] = &vdsp_clk.common.hw,
  631. [CLK_VDSP_M] = &vdsp_m_clk.common.hw,
  632. },
  633. .num = CLK_AP_CLK_NUM,
  634. };
  635. static struct sprd_clk_desc ums512_ap_clk_desc = {
  636. .clk_clks = ums512_ap_clks,
  637. .num_clk_clks = ARRAY_SIZE(ums512_ap_clks),
  638. .hw_clks = &ums512_ap_clk_hws,
  639. };
  640. /* aon apb clks */
  641. static const struct clk_parent_data aon_apb_parents[] = {
  642. { .hw = &rco_4m.hw },
  643. { .fw_name = "ext-4m" },
  644. { .hw = &clk_13m.hw },
  645. { .hw = &rco_25m.hw },
  646. { .fw_name = "ext-26m" },
  647. { .hw = &twpll_96m.hw },
  648. { .fw_name = "rco-100m" },
  649. { .hw = &twpll_128m.hw },
  650. };
  651. static SPRD_COMP_CLK_DATA(aon_apb_clk, "aon-apb-clk", aon_apb_parents,
  652. 0x220, 0, 3, 8, 2, 0);
  653. static const struct clk_parent_data adi_parents[] = {
  654. { .hw = &rco_4m.hw },
  655. { .fw_name = "ext-26m" },
  656. { .hw = &rco_25m.hw },
  657. { .hw = &twpll_38m4.hw },
  658. { .hw = &twpll_51m2.hw },
  659. };
  660. static SPRD_MUX_CLK_DATA(adi_clk, "adi-clk", adi_parents,
  661. 0x224, 0, 3, UMS512_MUX_FLAG);
  662. static const struct clk_parent_data aux_parents[] = {
  663. { .fw_name = "ext-32k" },
  664. { .fw_name = "ext-26m" },
  665. { .hw = &clk_26m_aud.hw },
  666. { .hw = &rco_25m.hw },
  667. { .hw = &cppll_39m32.hw },
  668. { .hw = &mpll0_56m88.hw },
  669. { .hw = &mpll1_63m38.hw },
  670. { .hw = &mpll2_47m13.hw },
  671. { .hw = &dpll0_58m31.hw },
  672. { .hw = &gpll_40m.hw },
  673. { .hw = &twpll_48m.hw },
  674. };
  675. static const struct clk_parent_data aux1_parents[] = {
  676. { .fw_name = "ext-32k" },
  677. { .fw_name = "ext-26m" },
  678. { .hw = &clk_26m_aud.hw },
  679. { .hw = &rco_25m.hw },
  680. { .hw = &cppll_39m32.hw },
  681. { .hw = &mpll0_56m88.hw },
  682. { .hw = &mpll1_63m38.hw },
  683. { .hw = &mpll2_47m13.hw },
  684. { .hw = &dpll0_58m31.hw },
  685. { .hw = &gpll_40m.hw },
  686. { .hw = &twpll_19m2.hw },
  687. { .hw = &lpll_30m72.hw },
  688. { .hw = &rpll.common.hw },
  689. { .hw = &twpll_12m29.hw },
  690. };
  691. static SPRD_COMP_CLK_DATA(aux0_clk, "aux0-clk", aux_parents,
  692. 0x228, 0, 5, 8, 4, 0);
  693. static SPRD_COMP_CLK_DATA(aux1_clk, "aux1-clk", aux1_parents,
  694. 0x22c, 0, 5, 8, 4, 0);
  695. static SPRD_COMP_CLK_DATA(aux2_clk, "aux2-clk", aux_parents,
  696. 0x230, 0, 5, 8, 4, 0);
  697. static SPRD_COMP_CLK_DATA(probe_clk, "probe-clk", aux_parents,
  698. 0x234, 0, 5, 8, 4, 0);
  699. static const struct clk_parent_data pwm_parents[] = {
  700. { .fw_name = "ext-32k" },
  701. { .fw_name = "ext-26m" },
  702. { .hw = &rco_4m.hw },
  703. { .hw = &rco_25m.hw },
  704. { .hw = &twpll_48m.hw },
  705. };
  706. static SPRD_MUX_CLK_DATA(pwm0_clk, "pwm0-clk", pwm_parents,
  707. 0x238, 0, 3, UMS512_MUX_FLAG);
  708. static SPRD_MUX_CLK_DATA(pwm1_clk, "pwm1-clk", pwm_parents,
  709. 0x23c, 0, 3, UMS512_MUX_FLAG);
  710. static SPRD_MUX_CLK_DATA(pwm2_clk, "pwm2-clk", pwm_parents,
  711. 0x240, 0, 3, UMS512_MUX_FLAG);
  712. static SPRD_MUX_CLK_DATA(pwm3_clk, "pwm3-clk", pwm_parents,
  713. 0x244, 0, 3, UMS512_MUX_FLAG);
  714. static const struct clk_parent_data efuse_parents[] = {
  715. { .hw = &rco_25m.hw },
  716. { .fw_name = "ext-26m" },
  717. };
  718. static SPRD_MUX_CLK_DATA(efuse_clk, "efuse-clk", efuse_parents,
  719. 0x248, 0, 1, UMS512_MUX_FLAG);
  720. static const struct clk_parent_data uart_parents[] = {
  721. { .hw = &rco_4m.hw },
  722. { .fw_name = "ext-26m" },
  723. { .hw = &twpll_48m.hw },
  724. { .hw = &twpll_51m2.hw },
  725. { .hw = &twpll_96m.hw },
  726. { .fw_name = "rco-100m" },
  727. { .hw = &twpll_128m.hw },
  728. };
  729. static SPRD_MUX_CLK_DATA(uart0_clk, "uart0-clk", uart_parents,
  730. 0x24c, 0, 3, UMS512_MUX_FLAG);
  731. static SPRD_MUX_CLK_DATA(uart1_clk, "uart1-clk", uart_parents,
  732. 0x250, 0, 3, UMS512_MUX_FLAG);
  733. static const struct clk_parent_data thm_parents[] = {
  734. { .fw_name = "ext-32k" },
  735. { .hw = &clk_250k.hw },
  736. };
  737. static SPRD_MUX_CLK_DATA(thm0_clk, "thm0-clk", thm_parents,
  738. 0x260, 0, 1, UMS512_MUX_FLAG);
  739. static SPRD_MUX_CLK_DATA(thm1_clk, "thm1-clk", thm_parents,
  740. 0x264, 0, 1, UMS512_MUX_FLAG);
  741. static SPRD_MUX_CLK_DATA(thm2_clk, "thm2-clk", thm_parents,
  742. 0x268, 0, 1, UMS512_MUX_FLAG);
  743. static SPRD_MUX_CLK_DATA(thm3_clk, "thm3-clk", thm_parents,
  744. 0x26c, 0, 1, UMS512_MUX_FLAG);
  745. static const struct clk_parent_data aon_i2c_parents[] = {
  746. { .hw = &rco_4m.hw },
  747. { .fw_name = "ext-26m" },
  748. { .hw = &twpll_48m.hw },
  749. { .hw = &twpll_51m2.hw },
  750. { .fw_name = "rco-100m" },
  751. { .hw = &twpll_153m6.hw },
  752. };
  753. static SPRD_MUX_CLK_DATA(aon_i2c_clk, "aon-i2c-clk", aon_i2c_parents,
  754. 0x27c, 0, 3, UMS512_MUX_FLAG);
  755. static const struct clk_parent_data aon_iis_parents[] = {
  756. { .fw_name = "ext-26m" },
  757. { .hw = &twpll_128m.hw },
  758. { .hw = &twpll_153m6.hw },
  759. };
  760. static SPRD_MUX_CLK_DATA(aon_iis_clk, "aon-iis-clk", aon_iis_parents,
  761. 0x280, 0, 2, UMS512_MUX_FLAG);
  762. static const struct clk_parent_data scc_parents[] = {
  763. { .fw_name = "ext-26m" },
  764. { .hw = &twpll_48m.hw },
  765. { .hw = &twpll_51m2.hw },
  766. { .hw = &twpll_96m.hw },
  767. };
  768. static SPRD_MUX_CLK_DATA(scc_clk, "scc-clk", scc_parents,
  769. 0x284, 0, 2, UMS512_MUX_FLAG);
  770. static const struct clk_parent_data apcpu_dap_parents[] = {
  771. { .fw_name = "ext-26m" },
  772. { .hw = &rco_4m.hw },
  773. { .hw = &twpll_76m8.hw },
  774. { .fw_name = "rco-100m" },
  775. { .hw = &twpll_128m.hw },
  776. { .hw = &twpll_153m6.hw },
  777. };
  778. static SPRD_MUX_CLK_DATA(apcpu_dap_clk, "apcpu-dap-clk", apcpu_dap_parents,
  779. 0x288, 0, 3, UMS512_MUX_FLAG);
  780. static SPRD_GATE_CLK_FW_NAME(apcpu_dap_mtck, "apcpu-dap-mtck", "ext-26m",
  781. 0x28c, BIT(16), 0, 0);
  782. static const struct clk_parent_data apcpu_ts_parents[] = {
  783. { .fw_name = "ext-32m" },
  784. { .fw_name = "ext-26m" },
  785. { .hw = &twpll_128m.hw },
  786. { .hw = &twpll_153m6.hw },
  787. };
  788. static SPRD_MUX_CLK_DATA(apcpu_ts_clk, "apcpu-ts-clk", apcpu_ts_parents,
  789. 0x290, 0, 2, UMS512_MUX_FLAG);
  790. static const struct clk_parent_data debug_ts_parents[] = {
  791. { .fw_name = "ext-26m" },
  792. { .hw = &twpll_76m8.hw },
  793. { .hw = &twpll_128m.hw },
  794. { .hw = &twpll_192m.hw },
  795. };
  796. static SPRD_MUX_CLK_DATA(debug_ts_clk, "debug-ts-clk", debug_ts_parents,
  797. 0x294, 0, 2, UMS512_MUX_FLAG);
  798. static SPRD_GATE_CLK_FW_NAME(dsi_test_s, "dsi-test-s", "ext-26m",
  799. 0x298, BIT(16), 0, 0);
  800. static const struct clk_parent_data djtag_tck_parents[] = {
  801. { .hw = &rco_4m.hw },
  802. { .fw_name = "ext-26m" },
  803. };
  804. static SPRD_MUX_CLK_DATA(djtag_tck_clk, "djtag-tck-clk", djtag_tck_parents,
  805. 0x2b4, 0, 1, UMS512_MUX_FLAG);
  806. static SPRD_GATE_CLK_FW_NAME(djtag_tck_hw, "djtag-tck-hw", "ext-26m",
  807. 0x2b8, BIT(16), 0, 0);
  808. static const struct clk_parent_data aon_tmr_parents[] = {
  809. { .hw = &rco_4m.hw },
  810. { .hw = &rco_25m.hw },
  811. { .fw_name = "ext-26m" },
  812. };
  813. static SPRD_MUX_CLK_DATA(aon_tmr_clk, "aon-tmr-clk", aon_tmr_parents,
  814. 0x2c0, 0, 2, UMS512_MUX_FLAG);
  815. static const struct clk_parent_data aon_pmu_parents[] = {
  816. { .fw_name = "ext-32k" },
  817. { .hw = &rco_4m.hw },
  818. { .fw_name = "ext-4m" },
  819. };
  820. static SPRD_MUX_CLK_DATA(aon_pmu_clk, "aon-pmu-clk", aon_pmu_parents,
  821. 0x2c8, 0, 2, UMS512_MUX_FLAG);
  822. static const struct clk_parent_data debounce_parents[] = {
  823. { .fw_name = "ext-32k" },
  824. { .hw = &rco_4m.hw },
  825. { .hw = &rco_25m.hw },
  826. { .fw_name = "ext-26m" },
  827. };
  828. static SPRD_MUX_CLK_DATA(debounce_clk, "debounce-clk", debounce_parents,
  829. 0x2cc, 0, 2, UMS512_MUX_FLAG);
  830. static const struct clk_parent_data apcpu_pmu_parents[] = {
  831. { .fw_name = "ext-26m" },
  832. { .hw = &twpll_76m8.hw },
  833. { .fw_name = "rco-100m" },
  834. { .hw = &twpll_128m.hw },
  835. };
  836. static SPRD_MUX_CLK_DATA(apcpu_pmu_clk, "apcpu-pmu-clk", apcpu_pmu_parents,
  837. 0x2d0, 0, 2, UMS512_MUX_FLAG);
  838. static const struct clk_parent_data top_dvfs_parents[] = {
  839. { .fw_name = "ext-26m" },
  840. { .hw = &twpll_96m.hw },
  841. { .fw_name = "rco-100m" },
  842. { .hw = &twpll_128m.hw },
  843. };
  844. static SPRD_MUX_CLK_DATA(top_dvfs_clk, "top-dvfs-clk", top_dvfs_parents,
  845. 0x2d8, 0, 2, UMS512_MUX_FLAG);
  846. static SPRD_GATE_CLK_FW_NAME(otg_utmi, "otg-utmi", "ext-26m", 0x2dc,
  847. BIT(16), 0, 0);
  848. static const struct clk_parent_data otg_ref_parents[] = {
  849. { .hw = &twpll_12m.hw },
  850. { .fw_name = "ext-26m" },
  851. };
  852. static SPRD_MUX_CLK_DATA(otg_ref_clk, "otg-ref-clk", otg_ref_parents,
  853. 0x2e0, 0, 1, UMS512_MUX_FLAG);
  854. static const struct clk_parent_data cssys_parents[] = {
  855. { .hw = &rco_25m.hw },
  856. { .fw_name = "ext-26m" },
  857. { .fw_name = "rco-100m" },
  858. { .hw = &twpll_153m6.hw },
  859. { .hw = &twpll_384m.hw },
  860. { .hw = &twpll_512m.hw },
  861. };
  862. static SPRD_COMP_CLK_DATA(cssys_clk, "cssys-clk", cssys_parents,
  863. 0x2e4, 0, 3, 8, 2, 0);
  864. static SPRD_DIV_CLK_HW(cssys_pub_clk, "cssys-pub-clk", &cssys_clk.common.hw,
  865. 0x2e8, 8, 2, 0);
  866. static SPRD_DIV_CLK_HW(cssys_apb_clk, "cssys-apb-clk", &cssys_clk.common.hw,
  867. 0x2ec, 8, 3, 0);
  868. static const struct clk_parent_data ap_axi_parents[] = {
  869. { .fw_name = "ext-26m" },
  870. { .hw = &twpll_76m8.hw },
  871. { .hw = &twpll_128m.hw },
  872. { .hw = &twpll_256m.hw },
  873. };
  874. static SPRD_MUX_CLK_DATA(ap_axi_clk, "ap-axi-clk", ap_axi_parents,
  875. 0x2f0, 0, 2, UMS512_MUX_FLAG);
  876. static const struct clk_parent_data ap_mm_parents[] = {
  877. { .fw_name = "ext-26m" },
  878. { .hw = &twpll_96m.hw },
  879. { .hw = &twpll_128m.hw },
  880. { .hw = &twpll_153m6.hw },
  881. };
  882. static SPRD_MUX_CLK_DATA(ap_mm_clk, "ap-mm-clk", ap_mm_parents,
  883. 0x2f4, 0, 2, UMS512_MUX_FLAG);
  884. static const struct clk_parent_data sdio2_2x_parents[] = {
  885. { .hw = &clk_1m.hw },
  886. { .fw_name = "ext-26m" },
  887. { .hw = &twpll_307m2.hw },
  888. { .hw = &twpll_384m.hw },
  889. { .hw = &rpll.common.hw },
  890. { .hw = &lpll_409m6.hw },
  891. };
  892. static SPRD_MUX_CLK_DATA(sdio2_2x_clk, "sdio2-2x-clk", sdio2_2x_parents,
  893. 0x2f8, 0, 3, UMS512_MUX_FLAG);
  894. static const struct clk_parent_data analog_io_apb_parents[] = {
  895. { .fw_name = "ext-26m" },
  896. { .hw = &twpll_48m.hw },
  897. };
  898. static SPRD_COMP_CLK_DATA(analog_io_apb, "analog-io-apb", analog_io_apb_parents,
  899. 0x300, 0, 1, 8, 2, 0);
  900. static const struct clk_parent_data dmc_ref_parents[] = {
  901. { .hw = &clk_6m5.hw },
  902. { .hw = &clk_13m.hw },
  903. { .fw_name = "ext-26m" },
  904. };
  905. static SPRD_MUX_CLK_DATA(dmc_ref_clk, "dmc-ref-clk", dmc_ref_parents,
  906. 0x304, 0, 2, UMS512_MUX_FLAG);
  907. static const struct clk_parent_data emc_parents[] = {
  908. { .fw_name = "ext-26m" },
  909. { .hw = &twpll_384m.hw },
  910. { .hw = &twpll_512m.hw },
  911. { .hw = &twpll_768m.hw },
  912. };
  913. static SPRD_MUX_CLK_DATA(emc_clk, "emc-clk", emc_parents,
  914. 0x30c, 0, 2, UMS512_MUX_FLAG);
  915. static const struct clk_parent_data usb_parents[] = {
  916. { .hw = &rco_25m.hw },
  917. { .fw_name = "ext-26m" },
  918. { .hw = &twpll_192m.hw },
  919. { .hw = &twpll_96m.hw },
  920. { .fw_name = "rco-100m" },
  921. { .hw = &twpll_128m.hw },
  922. };
  923. static SPRD_COMP_CLK_DATA(usb_clk, "usb-clk", usb_parents,
  924. 0x310, 0, 3, 8, 2, 0);
  925. static const struct clk_parent_data pmu_26m_parents[] = {
  926. { .hw = &rco_25m.hw },
  927. { .fw_name = "ext-26m" },
  928. };
  929. static SPRD_MUX_CLK_DATA(pmu_26m_clk, "26m-pmu-clk", pmu_26m_parents,
  930. 0x318, 0, 1, UMS512_MUX_FLAG);
  931. static struct sprd_clk_common *ums512_aon_apb[] = {
  932. /* address base is 0x32080200 */
  933. &aon_apb_clk.common,
  934. &adi_clk.common,
  935. &aux0_clk.common,
  936. &aux1_clk.common,
  937. &aux2_clk.common,
  938. &probe_clk.common,
  939. &pwm0_clk.common,
  940. &pwm1_clk.common,
  941. &pwm2_clk.common,
  942. &pwm3_clk.common,
  943. &efuse_clk.common,
  944. &uart0_clk.common,
  945. &uart1_clk.common,
  946. &thm0_clk.common,
  947. &thm1_clk.common,
  948. &thm2_clk.common,
  949. &thm3_clk.common,
  950. &aon_i2c_clk.common,
  951. &aon_iis_clk.common,
  952. &scc_clk.common,
  953. &apcpu_dap_clk.common,
  954. &apcpu_dap_mtck.common,
  955. &apcpu_ts_clk.common,
  956. &debug_ts_clk.common,
  957. &dsi_test_s.common,
  958. &djtag_tck_clk.common,
  959. &djtag_tck_hw.common,
  960. &aon_tmr_clk.common,
  961. &aon_pmu_clk.common,
  962. &debounce_clk.common,
  963. &apcpu_pmu_clk.common,
  964. &top_dvfs_clk.common,
  965. &otg_utmi.common,
  966. &otg_ref_clk.common,
  967. &cssys_clk.common,
  968. &cssys_pub_clk.common,
  969. &cssys_apb_clk.common,
  970. &ap_axi_clk.common,
  971. &ap_mm_clk.common,
  972. &sdio2_2x_clk.common,
  973. &analog_io_apb.common,
  974. &dmc_ref_clk.common,
  975. &emc_clk.common,
  976. &usb_clk.common,
  977. &pmu_26m_clk.common,
  978. };
  979. static struct clk_hw_onecell_data ums512_aon_apb_hws = {
  980. .hws = {
  981. [CLK_AON_APB] = &aon_apb_clk.common.hw,
  982. [CLK_ADI] = &adi_clk.common.hw,
  983. [CLK_AUX0] = &aux0_clk.common.hw,
  984. [CLK_AUX1] = &aux1_clk.common.hw,
  985. [CLK_AUX2] = &aux2_clk.common.hw,
  986. [CLK_PROBE] = &probe_clk.common.hw,
  987. [CLK_PWM0] = &pwm0_clk.common.hw,
  988. [CLK_PWM1] = &pwm1_clk.common.hw,
  989. [CLK_PWM2] = &pwm2_clk.common.hw,
  990. [CLK_PWM3] = &pwm3_clk.common.hw,
  991. [CLK_EFUSE] = &efuse_clk.common.hw,
  992. [CLK_UART0] = &uart0_clk.common.hw,
  993. [CLK_UART1] = &uart1_clk.common.hw,
  994. [CLK_THM0] = &thm0_clk.common.hw,
  995. [CLK_THM1] = &thm1_clk.common.hw,
  996. [CLK_THM2] = &thm2_clk.common.hw,
  997. [CLK_THM3] = &thm3_clk.common.hw,
  998. [CLK_AON_I2C] = &aon_i2c_clk.common.hw,
  999. [CLK_AON_IIS] = &aon_iis_clk.common.hw,
  1000. [CLK_SCC] = &scc_clk.common.hw,
  1001. [CLK_APCPU_DAP] = &apcpu_dap_clk.common.hw,
  1002. [CLK_APCPU_DAP_MTCK] = &apcpu_dap_mtck.common.hw,
  1003. [CLK_APCPU_TS] = &apcpu_ts_clk.common.hw,
  1004. [CLK_DEBUG_TS] = &debug_ts_clk.common.hw,
  1005. [CLK_DSI_TEST_S] = &dsi_test_s.common.hw,
  1006. [CLK_DJTAG_TCK] = &djtag_tck_clk.common.hw,
  1007. [CLK_DJTAG_TCK_HW] = &djtag_tck_hw.common.hw,
  1008. [CLK_AON_TMR] = &aon_tmr_clk.common.hw,
  1009. [CLK_AON_PMU] = &aon_pmu_clk.common.hw,
  1010. [CLK_DEBOUNCE] = &debounce_clk.common.hw,
  1011. [CLK_APCPU_PMU] = &apcpu_pmu_clk.common.hw,
  1012. [CLK_TOP_DVFS] = &top_dvfs_clk.common.hw,
  1013. [CLK_OTG_UTMI] = &otg_utmi.common.hw,
  1014. [CLK_OTG_REF] = &otg_ref_clk.common.hw,
  1015. [CLK_CSSYS] = &cssys_clk.common.hw,
  1016. [CLK_CSSYS_PUB] = &cssys_pub_clk.common.hw,
  1017. [CLK_CSSYS_APB] = &cssys_apb_clk.common.hw,
  1018. [CLK_AP_AXI] = &ap_axi_clk.common.hw,
  1019. [CLK_AP_MM] = &ap_mm_clk.common.hw,
  1020. [CLK_SDIO2_2X] = &sdio2_2x_clk.common.hw,
  1021. [CLK_ANALOG_IO_APB] = &analog_io_apb.common.hw,
  1022. [CLK_DMC_REF_CLK] = &dmc_ref_clk.common.hw,
  1023. [CLK_EMC] = &emc_clk.common.hw,
  1024. [CLK_USB] = &usb_clk.common.hw,
  1025. [CLK_26M_PMU] = &pmu_26m_clk.common.hw,
  1026. },
  1027. .num = CLK_AON_APB_NUM,
  1028. };
  1029. static struct sprd_clk_desc ums512_aon_apb_desc = {
  1030. .clk_clks = ums512_aon_apb,
  1031. .num_clk_clks = ARRAY_SIZE(ums512_aon_apb),
  1032. .hw_clks = &ums512_aon_apb_hws,
  1033. };
  1034. /* aon apb gates */
  1035. static SPRD_SC_GATE_CLK_FW_NAME(rc100m_cal_eb, "rc100m-cal-eb", "ext-26m",
  1036. 0x0, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
  1037. static SPRD_SC_GATE_CLK_FW_NAME(djtag_tck_eb, "djtag-tck-eb", "ext-26m",
  1038. 0x0, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
  1039. static SPRD_SC_GATE_CLK_FW_NAME(djtag_eb, "djtag-eb", "ext-26m",
  1040. 0x0, 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0);
  1041. static SPRD_SC_GATE_CLK_FW_NAME(aux0_eb, "aux0-eb", "ext-26m",
  1042. 0x0, 0x1000, BIT(4), 0, 0);
  1043. static SPRD_SC_GATE_CLK_FW_NAME(aux1_eb, "aux1-eb", "ext-26m",
  1044. 0x0, 0x1000, BIT(5), 0, 0);
  1045. static SPRD_SC_GATE_CLK_FW_NAME(aux2_eb, "aux2-eb", "ext-26m",
  1046. 0x0, 0x1000, BIT(6), 0, 0);
  1047. static SPRD_SC_GATE_CLK_FW_NAME(probe_eb, "probe-eb", "ext-26m",
  1048. 0x0, 0x1000, BIT(7), 0, 0);
  1049. static SPRD_SC_GATE_CLK_FW_NAME(mm_eb, "mm-eb", "ext-26m",
  1050. 0x0, 0x1000, BIT(9), 0, 0);
  1051. static SPRD_SC_GATE_CLK_FW_NAME(gpu_eb, "gpu-eb", "ext-26m",
  1052. 0x0, 0x1000, BIT(11), 0, 0);
  1053. static SPRD_SC_GATE_CLK_FW_NAME(mspi_eb, "mspi-eb", "ext-26m",
  1054. 0x0, 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0);
  1055. static SPRD_SC_GATE_CLK_FW_NAME(apcpu_dap_eb, "apcpu-dap-eb", "ext-26m",
  1056. 0x0, 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1057. static SPRD_SC_GATE_CLK_FW_NAME(aon_cssys_eb, "aon-cssys-eb", "ext-26m",
  1058. 0x0, 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1059. static SPRD_SC_GATE_CLK_FW_NAME(cssys_apb_eb, "cssys-apb-eb", "ext-26m",
  1060. 0x0, 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1061. static SPRD_SC_GATE_CLK_FW_NAME(cssys_pub_eb, "cssys-pub-eb", "ext-26m",
  1062. 0x0, 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1063. static SPRD_SC_GATE_CLK_FW_NAME(sdphy_cfg_eb, "sdphy-cfg-eb", "ext-26m",
  1064. 0x0, 0x1000, BIT(19), 0, 0);
  1065. static SPRD_SC_GATE_CLK_FW_NAME(sdphy_ref_eb, "sdphy-ref-eb", "ext-26m",
  1066. 0x0, 0x1000, BIT(20), 0, 0);
  1067. static SPRD_SC_GATE_CLK_FW_NAME(efuse_eb, "efuse-eb", "ext-26m",
  1068. 0x4, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
  1069. static SPRD_SC_GATE_CLK_FW_NAME(gpio_eb, "gpio-eb", "ext-26m",
  1070. 0x4, 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
  1071. static SPRD_SC_GATE_CLK_FW_NAME(mbox_eb, "mbox-eb", "ext-26m",
  1072. 0x4, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
  1073. static SPRD_SC_GATE_CLK_FW_NAME(kpd_eb, "kpd-eb", "ext-26m",
  1074. 0x4, 0x1000, BIT(3), 0, 0);
  1075. static SPRD_SC_GATE_CLK_FW_NAME(aon_syst_eb, "aon-syst-eb", "ext-26m",
  1076. 0x4, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
  1077. static SPRD_SC_GATE_CLK_FW_NAME(ap_syst_eb, "ap-syst-eb", "ext-26m",
  1078. 0x4, 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
  1079. static SPRD_SC_GATE_CLK_FW_NAME(aon_tmr_eb, "aon-tmr-eb", "ext-26m",
  1080. 0x4, 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0);
  1081. static SPRD_SC_GATE_CLK_FW_NAME(otg_utmi_eb, "otg-utmi-eb", "ext-26m",
  1082. 0x4, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
  1083. static SPRD_SC_GATE_CLK_FW_NAME(otg_phy_eb, "otg-phy-eb", "ext-26m",
  1084. 0x4, 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
  1085. static SPRD_SC_GATE_CLK_FW_NAME(splk_eb, "splk-eb", "ext-26m",
  1086. 0x4, 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
  1087. static SPRD_SC_GATE_CLK_FW_NAME(pin_eb, "pin-eb", "ext-26m",
  1088. 0x4, 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
  1089. static SPRD_SC_GATE_CLK_FW_NAME(ana_eb, "ana-eb", "ext-26m",
  1090. 0x4, 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0);
  1091. static SPRD_SC_GATE_CLK_FW_NAME(apcpu_ts0_eb, "apcpu-ts0-eb", "ext-26m",
  1092. 0x4, 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1093. static SPRD_SC_GATE_CLK_FW_NAME(apb_busmon_eb, "apb-busmon-eb", "ext-26m",
  1094. 0x4, 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0);
  1095. static SPRD_SC_GATE_CLK_FW_NAME(aon_iis_eb, "aon-iis-eb", "ext-26m",
  1096. 0x4, 0x1000, BIT(19), CLK_IGNORE_UNUSED, 0);
  1097. static SPRD_SC_GATE_CLK_FW_NAME(scc_eb, "scc-eb", "ext-26m",
  1098. 0x4, 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
  1099. static SPRD_SC_GATE_CLK_FW_NAME(thm0_eb, "thm0-eb", "ext-26m",
  1100. 0x8, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
  1101. static SPRD_SC_GATE_CLK_FW_NAME(thm1_eb, "thm1-eb", "ext-26m",
  1102. 0x8, 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
  1103. static SPRD_SC_GATE_CLK_FW_NAME(thm2_eb, "thm2-eb", "ext-26m",
  1104. 0x8, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
  1105. static SPRD_SC_GATE_CLK_FW_NAME(asim_top_eb, "asim-top", "ext-26m",
  1106. 0x8, 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0);
  1107. static SPRD_SC_GATE_CLK_FW_NAME(i2c_eb, "i2c-eb", "ext-26m",
  1108. 0x8, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
  1109. static SPRD_SC_GATE_CLK_FW_NAME(pmu_eb, "pmu-eb", "ext-26m",
  1110. 0x8, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
  1111. static SPRD_SC_GATE_CLK_FW_NAME(adi_eb, "adi-eb", "ext-26m",
  1112. 0x8, 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
  1113. static SPRD_SC_GATE_CLK_FW_NAME(eic_eb, "eic-eb", "ext-26m",
  1114. 0x8, 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
  1115. static SPRD_SC_GATE_CLK_FW_NAME(ap_intc0_eb, "ap-intc0-eb", "ext-26m",
  1116. 0x8, 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
  1117. static SPRD_SC_GATE_CLK_FW_NAME(ap_intc1_eb, "ap-intc1-eb", "ext-26m",
  1118. 0x8, 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0);
  1119. static SPRD_SC_GATE_CLK_FW_NAME(ap_intc2_eb, "ap-intc2-eb", "ext-26m",
  1120. 0x8, 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0);
  1121. static SPRD_SC_GATE_CLK_FW_NAME(ap_intc3_eb, "ap-intc3-eb", "ext-26m",
  1122. 0x8, 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1123. static SPRD_SC_GATE_CLK_FW_NAME(ap_intc4_eb, "ap-intc4-eb", "ext-26m",
  1124. 0x8, 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1125. static SPRD_SC_GATE_CLK_FW_NAME(ap_intc5_eb, "ap-intc5-eb", "ext-26m",
  1126. 0x8, 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1127. static SPRD_SC_GATE_CLK_FW_NAME(audcp_intc_eb, "audcp-intc-eb", "ext-26m",
  1128. 0x8, 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1129. static SPRD_SC_GATE_CLK_FW_NAME(ap_tmr0_eb, "ap-tmr0-eb", "ext-26m",
  1130. 0x8, 0x1000, BIT(22), CLK_IGNORE_UNUSED, 0);
  1131. static SPRD_SC_GATE_CLK_FW_NAME(ap_tmr1_eb, "ap-tmr1-eb", "ext-26m",
  1132. 0x8, 0x1000, BIT(23), CLK_IGNORE_UNUSED, 0);
  1133. static SPRD_SC_GATE_CLK_FW_NAME(ap_tmr2_eb, "ap-tmr2-eb", "ext-26m",
  1134. 0x8, 0x1000, BIT(24), CLK_IGNORE_UNUSED, 0);
  1135. static SPRD_SC_GATE_CLK_FW_NAME(pwm0_eb, "pwm0-eb", "ext-26m",
  1136. 0x8, 0x1000, BIT(25), 0, 0);
  1137. static SPRD_SC_GATE_CLK_FW_NAME(pwm1_eb, "pwm1-eb", "ext-26m",
  1138. 0x8, 0x1000, BIT(26), 0, 0);
  1139. static SPRD_SC_GATE_CLK_FW_NAME(pwm2_eb, "pwm2-eb", "ext-26m",
  1140. 0x8, 0x1000, BIT(27), 0, 0);
  1141. static SPRD_SC_GATE_CLK_FW_NAME(pwm3_eb, "pwm3-eb", "ext-26m",
  1142. 0x8, 0x1000, BIT(28), 0, 0);
  1143. static SPRD_SC_GATE_CLK_FW_NAME(ap_wdg_eb, "ap-wdg-eb", "ext-26m",
  1144. 0x8, 0x1000, BIT(29), 0, 0);
  1145. static SPRD_SC_GATE_CLK_FW_NAME(apcpu_wdg_eb, "apcpu-wdg-eb", "ext-26m",
  1146. 0x8, 0x1000, BIT(30), 0, 0);
  1147. static SPRD_SC_GATE_CLK_FW_NAME(serdes_eb, "serdes-eb", "ext-26m",
  1148. 0x8, 0x1000, BIT(31), 0, 0);
  1149. static SPRD_SC_GATE_CLK_FW_NAME(arch_rtc_eb, "arch-rtc-eb", "ext-26m",
  1150. 0x18, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
  1151. static SPRD_SC_GATE_CLK_FW_NAME(kpd_rtc_eb, "kpd-rtc-eb", "ext-26m",
  1152. 0x18, 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
  1153. static SPRD_SC_GATE_CLK_FW_NAME(aon_syst_rtc_eb, "aon-syst-rtc-eb", "ext-26m",
  1154. 0x18, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
  1155. static SPRD_SC_GATE_CLK_FW_NAME(ap_syst_rtc_eb, "ap-syst-rtc-eb", "ext-26m",
  1156. 0x18, 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0);
  1157. static SPRD_SC_GATE_CLK_FW_NAME(aon_tmr_rtc_eb, "aon-tmr-rtc-eb", "ext-26m",
  1158. 0x18, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
  1159. static SPRD_SC_GATE_CLK_FW_NAME(eic_rtc_eb, "eic-rtc-eb", "ext-26m",
  1160. 0x18, 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
  1161. static SPRD_SC_GATE_CLK_FW_NAME(eic_rtcdv5_eb, "eic-rtcdv5-eb", "ext-26m",
  1162. 0x18, 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0);
  1163. static SPRD_SC_GATE_CLK_FW_NAME(ap_wdg_rtc_eb, "ap-wdg-rtc-eb", "ext-26m",
  1164. 0x18, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
  1165. static SPRD_SC_GATE_CLK_FW_NAME(ac_wdg_rtc_eb, "ac-wdg-rtc-eb", "ext-26m",
  1166. 0x18, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
  1167. static SPRD_SC_GATE_CLK_FW_NAME(ap_tmr0_rtc_eb, "ap-tmr0-rtc-eb", "ext-26m",
  1168. 0x18, 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
  1169. static SPRD_SC_GATE_CLK_FW_NAME(ap_tmr1_rtc_eb, "ap-tmr1-rtc-eb", "ext-26m",
  1170. 0x18, 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
  1171. static SPRD_SC_GATE_CLK_FW_NAME(ap_tmr2_rtc_eb, "ap-tmr2-rtc-eb", "ext-26m",
  1172. 0x18, 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
  1173. static SPRD_SC_GATE_CLK_FW_NAME(dcxo_lc_rtc_eb, "dcxo-lc-rtc-eb", "ext-26m",
  1174. 0x18, 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0);
  1175. static SPRD_SC_GATE_CLK_FW_NAME(bb_cal_rtc_eb, "bb-cal-rtc-eb", "ext-26m",
  1176. 0x18, 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0);
  1177. static SPRD_SC_GATE_CLK_FW_NAME(ap_emmc_rtc_eb, "ap-emmc-rtc-eb", "ext-26m",
  1178. 0x18, 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1179. static SPRD_SC_GATE_CLK_FW_NAME(ap_sdio0_rtc_eb, "ap-sdio0-rtc-eb", "ext-26m",
  1180. 0x18, 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1181. static SPRD_SC_GATE_CLK_FW_NAME(ap_sdio1_rtc_eb, "ap-sdio1-rtc-eb", "ext-26m",
  1182. 0x18, 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1183. static SPRD_SC_GATE_CLK_FW_NAME(ap_sdio2_rtc_eb, "ap-sdio2-rtc-eb", "ext-26m",
  1184. 0x18, 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1185. static SPRD_SC_GATE_CLK_FW_NAME(dsi_csi_test_eb, "dsi-csi-test-eb", "ext-26m",
  1186. 0x138, 0x1000, BIT(8), 0, 0);
  1187. static SPRD_SC_GATE_CLK_FW_NAME(djtag_tck_en, "djtag-tck-en", "ext-26m",
  1188. 0x138, 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
  1189. static SPRD_SC_GATE_CLK_FW_NAME(dphy_ref_eb, "dphy-ref-eb", "ext-26m",
  1190. 0x138, 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
  1191. static SPRD_SC_GATE_CLK_FW_NAME(dmc_ref_eb, "dmc-ref-eb", "ext-26m",
  1192. 0x138, 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
  1193. static SPRD_SC_GATE_CLK_FW_NAME(otg_ref_eb, "otg-ref-eb", "ext-26m",
  1194. 0x138, 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0);
  1195. static SPRD_SC_GATE_CLK_FW_NAME(tsen_eb, "tsen-eb", "ext-26m",
  1196. 0x138, 0x1000, BIT(13), 0, 0);
  1197. static SPRD_SC_GATE_CLK_FW_NAME(tmr_eb, "tmr-eb", "ext-26m",
  1198. 0x138, 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1199. static SPRD_SC_GATE_CLK_FW_NAME(rc100m_ref_eb, "rc100m-ref-eb", "ext-26m",
  1200. 0x138, 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1201. static SPRD_SC_GATE_CLK_FW_NAME(rc100m_fdk_eb, "rc100m-fdk-eb", "ext-26m",
  1202. 0x138, 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1203. static SPRD_SC_GATE_CLK_FW_NAME(debounce_eb, "debounce-eb", "ext-26m",
  1204. 0x138, 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1205. static SPRD_SC_GATE_CLK_FW_NAME(det_32k_eb, "det-32k-eb", "ext-26m",
  1206. 0x138, 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0);
  1207. static SPRD_SC_GATE_CLK_FW_NAME(top_cssys_en, "top-cssys-en", "ext-26m",
  1208. 0x13c, 0x1000, BIT(0), 0, 0);
  1209. static SPRD_SC_GATE_CLK_FW_NAME(ap_axi_en, "ap-axi-en", "ext-26m",
  1210. 0x13c, 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
  1211. static SPRD_SC_GATE_CLK_FW_NAME(sdio0_2x_en, "sdio0-2x-en", "ext-26m",
  1212. 0x13c, 0x1000, BIT(2), 0, 0);
  1213. static SPRD_SC_GATE_CLK_FW_NAME(sdio0_1x_en, "sdio0-1x-en", "ext-26m",
  1214. 0x13c, 0x1000, BIT(3), 0, 0);
  1215. static SPRD_SC_GATE_CLK_FW_NAME(sdio1_2x_en, "sdio1-2x-en", "ext-26m",
  1216. 0x13c, 0x1000, BIT(4), 0, 0);
  1217. static SPRD_SC_GATE_CLK_FW_NAME(sdio1_1x_en, "sdio1-1x-en", "ext-26m",
  1218. 0x13c, 0x1000, BIT(5), 0, 0);
  1219. static SPRD_SC_GATE_CLK_FW_NAME(sdio2_2x_en, "sdio2-2x-en", "ext-26m",
  1220. 0x13c, 0x1000, BIT(6), 0, 0);
  1221. static SPRD_SC_GATE_CLK_FW_NAME(sdio2_1x_en, "sdio2-1x-en", "ext-26m",
  1222. 0x13c, 0x1000, BIT(7), 0, 0);
  1223. static SPRD_SC_GATE_CLK_FW_NAME(emmc_2x_en, "emmc-2x-en", "ext-26m",
  1224. 0x13c, 0x1000, BIT(8), 0, 0);
  1225. static SPRD_SC_GATE_CLK_FW_NAME(emmc_1x_en, "emmc-1x-en", "ext-26m",
  1226. 0x13c, 0x1000, BIT(9), 0, 0);
  1227. static SPRD_SC_GATE_CLK_FW_NAME(pll_test_en, "pll-test-en", "ext-26m",
  1228. 0x13c, 0x1000, BIT(14), 0, 0);
  1229. static SPRD_SC_GATE_CLK_FW_NAME(cphy_cfg_en, "cphy-cfg-en", "ext-26m",
  1230. 0x13c, 0x1000, BIT(15), 0, 0);
  1231. static SPRD_SC_GATE_CLK_FW_NAME(debug_ts_en, "debug-ts-en", "ext-26m",
  1232. 0x13c, 0x1000, BIT(18), 0, 0);
  1233. static SPRD_SC_GATE_CLK_FW_NAME(access_aud_en, "access-aud-en",
  1234. "ext-26m", 0x14c, 0x1000, BIT(0), 0, 0);
  1235. static struct sprd_clk_common *ums512_aon_gate[] = {
  1236. /* address base is 0x327d0000 */
  1237. &rc100m_cal_eb.common,
  1238. &djtag_tck_eb.common,
  1239. &djtag_eb.common,
  1240. &aux0_eb.common,
  1241. &aux1_eb.common,
  1242. &aux2_eb.common,
  1243. &probe_eb.common,
  1244. &mm_eb.common,
  1245. &gpu_eb.common,
  1246. &mspi_eb.common,
  1247. &apcpu_dap_eb.common,
  1248. &aon_cssys_eb.common,
  1249. &cssys_apb_eb.common,
  1250. &cssys_pub_eb.common,
  1251. &sdphy_cfg_eb.common,
  1252. &sdphy_ref_eb.common,
  1253. &efuse_eb.common,
  1254. &gpio_eb.common,
  1255. &mbox_eb.common,
  1256. &kpd_eb.common,
  1257. &aon_syst_eb.common,
  1258. &ap_syst_eb.common,
  1259. &aon_tmr_eb.common,
  1260. &otg_utmi_eb.common,
  1261. &otg_phy_eb.common,
  1262. &splk_eb.common,
  1263. &pin_eb.common,
  1264. &ana_eb.common,
  1265. &apcpu_ts0_eb.common,
  1266. &apb_busmon_eb.common,
  1267. &aon_iis_eb.common,
  1268. &scc_eb.common,
  1269. &thm0_eb.common,
  1270. &thm1_eb.common,
  1271. &thm2_eb.common,
  1272. &asim_top_eb.common,
  1273. &i2c_eb.common,
  1274. &pmu_eb.common,
  1275. &adi_eb.common,
  1276. &eic_eb.common,
  1277. &ap_intc0_eb.common,
  1278. &ap_intc1_eb.common,
  1279. &ap_intc2_eb.common,
  1280. &ap_intc3_eb.common,
  1281. &ap_intc4_eb.common,
  1282. &ap_intc5_eb.common,
  1283. &audcp_intc_eb.common,
  1284. &ap_tmr0_eb.common,
  1285. &ap_tmr1_eb.common,
  1286. &ap_tmr2_eb.common,
  1287. &pwm0_eb.common,
  1288. &pwm1_eb.common,
  1289. &pwm2_eb.common,
  1290. &pwm3_eb.common,
  1291. &ap_wdg_eb.common,
  1292. &apcpu_wdg_eb.common,
  1293. &serdes_eb.common,
  1294. &arch_rtc_eb.common,
  1295. &kpd_rtc_eb.common,
  1296. &aon_syst_rtc_eb.common,
  1297. &ap_syst_rtc_eb.common,
  1298. &aon_tmr_rtc_eb.common,
  1299. &eic_rtc_eb.common,
  1300. &eic_rtcdv5_eb.common,
  1301. &ap_wdg_rtc_eb.common,
  1302. &ac_wdg_rtc_eb.common,
  1303. &ap_tmr0_rtc_eb.common,
  1304. &ap_tmr1_rtc_eb.common,
  1305. &ap_tmr2_rtc_eb.common,
  1306. &dcxo_lc_rtc_eb.common,
  1307. &bb_cal_rtc_eb.common,
  1308. &ap_emmc_rtc_eb.common,
  1309. &ap_sdio0_rtc_eb.common,
  1310. &ap_sdio1_rtc_eb.common,
  1311. &ap_sdio2_rtc_eb.common,
  1312. &dsi_csi_test_eb.common,
  1313. &djtag_tck_en.common,
  1314. &dphy_ref_eb.common,
  1315. &dmc_ref_eb.common,
  1316. &otg_ref_eb.common,
  1317. &tsen_eb.common,
  1318. &tmr_eb.common,
  1319. &rc100m_ref_eb.common,
  1320. &rc100m_fdk_eb.common,
  1321. &debounce_eb.common,
  1322. &det_32k_eb.common,
  1323. &top_cssys_en.common,
  1324. &ap_axi_en.common,
  1325. &sdio0_2x_en.common,
  1326. &sdio0_1x_en.common,
  1327. &sdio1_2x_en.common,
  1328. &sdio1_1x_en.common,
  1329. &sdio2_2x_en.common,
  1330. &sdio2_1x_en.common,
  1331. &emmc_2x_en.common,
  1332. &emmc_1x_en.common,
  1333. &pll_test_en.common,
  1334. &cphy_cfg_en.common,
  1335. &debug_ts_en.common,
  1336. &access_aud_en.common,
  1337. };
  1338. static struct clk_hw_onecell_data ums512_aon_gate_hws = {
  1339. .hws = {
  1340. [CLK_RC100M_CAL_EB] = &rc100m_cal_eb.common.hw,
  1341. [CLK_DJTAG_TCK_EB] = &djtag_tck_eb.common.hw,
  1342. [CLK_DJTAG_EB] = &djtag_eb.common.hw,
  1343. [CLK_AUX0_EB] = &aux0_eb.common.hw,
  1344. [CLK_AUX1_EB] = &aux1_eb.common.hw,
  1345. [CLK_AUX2_EB] = &aux2_eb.common.hw,
  1346. [CLK_PROBE_EB] = &probe_eb.common.hw,
  1347. [CLK_MM_EB] = &mm_eb.common.hw,
  1348. [CLK_GPU_EB] = &gpu_eb.common.hw,
  1349. [CLK_MSPI_EB] = &mspi_eb.common.hw,
  1350. [CLK_APCPU_DAP_EB] = &apcpu_dap_eb.common.hw,
  1351. [CLK_AON_CSSYS_EB] = &aon_cssys_eb.common.hw,
  1352. [CLK_CSSYS_APB_EB] = &cssys_apb_eb.common.hw,
  1353. [CLK_CSSYS_PUB_EB] = &cssys_pub_eb.common.hw,
  1354. [CLK_SDPHY_CFG_EB] = &sdphy_cfg_eb.common.hw,
  1355. [CLK_SDPHY_REF_EB] = &sdphy_ref_eb.common.hw,
  1356. [CLK_EFUSE_EB] = &efuse_eb.common.hw,
  1357. [CLK_GPIO_EB] = &gpio_eb.common.hw,
  1358. [CLK_MBOX_EB] = &mbox_eb.common.hw,
  1359. [CLK_KPD_EB] = &kpd_eb.common.hw,
  1360. [CLK_AON_SYST_EB] = &aon_syst_eb.common.hw,
  1361. [CLK_AP_SYST_EB] = &ap_syst_eb.common.hw,
  1362. [CLK_AON_TMR_EB] = &aon_tmr_eb.common.hw,
  1363. [CLK_OTG_UTMI_EB] = &otg_utmi_eb.common.hw,
  1364. [CLK_OTG_PHY_EB] = &otg_phy_eb.common.hw,
  1365. [CLK_SPLK_EB] = &splk_eb.common.hw,
  1366. [CLK_PIN_EB] = &pin_eb.common.hw,
  1367. [CLK_ANA_EB] = &ana_eb.common.hw,
  1368. [CLK_APCPU_TS0_EB] = &apcpu_ts0_eb.common.hw,
  1369. [CLK_APB_BUSMON_EB] = &apb_busmon_eb.common.hw,
  1370. [CLK_AON_IIS_EB] = &aon_iis_eb.common.hw,
  1371. [CLK_SCC_EB] = &scc_eb.common.hw,
  1372. [CLK_THM0_EB] = &thm0_eb.common.hw,
  1373. [CLK_THM1_EB] = &thm1_eb.common.hw,
  1374. [CLK_THM2_EB] = &thm2_eb.common.hw,
  1375. [CLK_ASIM_TOP_EB] = &asim_top_eb.common.hw,
  1376. [CLK_I2C_EB] = &i2c_eb.common.hw,
  1377. [CLK_PMU_EB] = &pmu_eb.common.hw,
  1378. [CLK_ADI_EB] = &adi_eb.common.hw,
  1379. [CLK_EIC_EB] = &eic_eb.common.hw,
  1380. [CLK_AP_INTC0_EB] = &ap_intc0_eb.common.hw,
  1381. [CLK_AP_INTC1_EB] = &ap_intc1_eb.common.hw,
  1382. [CLK_AP_INTC2_EB] = &ap_intc2_eb.common.hw,
  1383. [CLK_AP_INTC3_EB] = &ap_intc3_eb.common.hw,
  1384. [CLK_AP_INTC4_EB] = &ap_intc4_eb.common.hw,
  1385. [CLK_AP_INTC5_EB] = &ap_intc5_eb.common.hw,
  1386. [CLK_AUDCP_INTC_EB] = &audcp_intc_eb.common.hw,
  1387. [CLK_AP_TMR0_EB] = &ap_tmr0_eb.common.hw,
  1388. [CLK_AP_TMR1_EB] = &ap_tmr1_eb.common.hw,
  1389. [CLK_AP_TMR2_EB] = &ap_tmr2_eb.common.hw,
  1390. [CLK_PWM0_EB] = &pwm0_eb.common.hw,
  1391. [CLK_PWM1_EB] = &pwm1_eb.common.hw,
  1392. [CLK_PWM2_EB] = &pwm2_eb.common.hw,
  1393. [CLK_PWM3_EB] = &pwm3_eb.common.hw,
  1394. [CLK_AP_WDG_EB] = &ap_wdg_eb.common.hw,
  1395. [CLK_APCPU_WDG_EB] = &apcpu_wdg_eb.common.hw,
  1396. [CLK_SERDES_EB] = &serdes_eb.common.hw,
  1397. [CLK_ARCH_RTC_EB] = &arch_rtc_eb.common.hw,
  1398. [CLK_KPD_RTC_EB] = &kpd_rtc_eb.common.hw,
  1399. [CLK_AON_SYST_RTC_EB] = &aon_syst_rtc_eb.common.hw,
  1400. [CLK_AP_SYST_RTC_EB] = &ap_syst_rtc_eb.common.hw,
  1401. [CLK_AON_TMR_RTC_EB] = &aon_tmr_rtc_eb.common.hw,
  1402. [CLK_EIC_RTC_EB] = &eic_rtc_eb.common.hw,
  1403. [CLK_EIC_RTCDV5_EB] = &eic_rtcdv5_eb.common.hw,
  1404. [CLK_AP_WDG_RTC_EB] = &ap_wdg_rtc_eb.common.hw,
  1405. [CLK_AC_WDG_RTC_EB] = &ac_wdg_rtc_eb.common.hw,
  1406. [CLK_AP_TMR0_RTC_EB] = &ap_tmr0_rtc_eb.common.hw,
  1407. [CLK_AP_TMR1_RTC_EB] = &ap_tmr1_rtc_eb.common.hw,
  1408. [CLK_AP_TMR2_RTC_EB] = &ap_tmr2_rtc_eb.common.hw,
  1409. [CLK_DCXO_LC_RTC_EB] = &dcxo_lc_rtc_eb.common.hw,
  1410. [CLK_BB_CAL_RTC_EB] = &bb_cal_rtc_eb.common.hw,
  1411. [CLK_AP_EMMC_RTC_EB] = &ap_emmc_rtc_eb.common.hw,
  1412. [CLK_AP_SDIO0_RTC_EB] = &ap_sdio0_rtc_eb.common.hw,
  1413. [CLK_AP_SDIO1_RTC_EB] = &ap_sdio1_rtc_eb.common.hw,
  1414. [CLK_AP_SDIO2_RTC_EB] = &ap_sdio2_rtc_eb.common.hw,
  1415. [CLK_DSI_CSI_TEST_EB] = &dsi_csi_test_eb.common.hw,
  1416. [CLK_DJTAG_TCK_EN] = &djtag_tck_en.common.hw,
  1417. [CLK_DPHY_REF_EB] = &dphy_ref_eb.common.hw,
  1418. [CLK_DMC_REF_EB] = &dmc_ref_eb.common.hw,
  1419. [CLK_OTG_REF_EB] = &otg_ref_eb.common.hw,
  1420. [CLK_TSEN_EB] = &tsen_eb.common.hw,
  1421. [CLK_TMR_EB] = &tmr_eb.common.hw,
  1422. [CLK_RC100M_REF_EB] = &rc100m_ref_eb.common.hw,
  1423. [CLK_RC100M_FDK_EB] = &rc100m_fdk_eb.common.hw,
  1424. [CLK_DEBOUNCE_EB] = &debounce_eb.common.hw,
  1425. [CLK_DET_32K_EB] = &det_32k_eb.common.hw,
  1426. [CLK_TOP_CSSYS_EB] = &top_cssys_en.common.hw,
  1427. [CLK_AP_AXI_EN] = &ap_axi_en.common.hw,
  1428. [CLK_SDIO0_2X_EN] = &sdio0_2x_en.common.hw,
  1429. [CLK_SDIO0_1X_EN] = &sdio0_1x_en.common.hw,
  1430. [CLK_SDIO1_2X_EN] = &sdio1_2x_en.common.hw,
  1431. [CLK_SDIO1_1X_EN] = &sdio1_1x_en.common.hw,
  1432. [CLK_SDIO2_2X_EN] = &sdio2_2x_en.common.hw,
  1433. [CLK_SDIO2_1X_EN] = &sdio2_1x_en.common.hw,
  1434. [CLK_EMMC_2X_EN] = &emmc_2x_en.common.hw,
  1435. [CLK_EMMC_1X_EN] = &emmc_1x_en.common.hw,
  1436. [CLK_PLL_TEST_EN] = &pll_test_en.common.hw,
  1437. [CLK_CPHY_CFG_EN] = &cphy_cfg_en.common.hw,
  1438. [CLK_DEBUG_TS_EN] = &debug_ts_en.common.hw,
  1439. [CLK_ACCESS_AUD_EN] = &access_aud_en.common.hw,
  1440. },
  1441. .num = CLK_AON_APB_GATE_NUM,
  1442. };
  1443. static struct sprd_clk_desc ums512_aon_gate_desc = {
  1444. .clk_clks = ums512_aon_gate,
  1445. .num_clk_clks = ARRAY_SIZE(ums512_aon_gate),
  1446. .hw_clks = &ums512_aon_gate_hws,
  1447. };
  1448. /* audcp apb gates */
  1449. /* Audcp apb clocks configure CLK_IGNORE_UNUSED because these clocks may be
  1450. * controlled by audcp sys at the same time. It may be cause an execption if
  1451. * kernel gates these clock.
  1452. */
  1453. static SPRD_SC_GATE_CLK_HW(audcp_wdg_eb, "audcp-wdg-eb",
  1454. &access_aud_en.common.hw, 0x0, 0x100, BIT(1),
  1455. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1456. static SPRD_SC_GATE_CLK_HW(audcp_rtc_wdg_eb, "audcp-rtc-wdg-eb",
  1457. &access_aud_en.common.hw, 0x0, 0x100, BIT(2),
  1458. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1459. static SPRD_SC_GATE_CLK_HW(audcp_tmr0_eb, "audcp-tmr0-eb",
  1460. &access_aud_en.common.hw, 0x0, 0x100, BIT(5),
  1461. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1462. static SPRD_SC_GATE_CLK_HW(audcp_tmr1_eb, "audcp-tmr1-eb",
  1463. &access_aud_en.common.hw, 0x0, 0x100, BIT(6),
  1464. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1465. static struct sprd_clk_common *ums512_audcpapb_gate[] = {
  1466. /* address base is 0x3350d000 */
  1467. &audcp_wdg_eb.common,
  1468. &audcp_rtc_wdg_eb.common,
  1469. &audcp_tmr0_eb.common,
  1470. &audcp_tmr1_eb.common,
  1471. };
  1472. static struct clk_hw_onecell_data ums512_audcpapb_gate_hws = {
  1473. .hws = {
  1474. [CLK_AUDCP_WDG_EB] = &audcp_wdg_eb.common.hw,
  1475. [CLK_AUDCP_RTC_WDG_EB] = &audcp_rtc_wdg_eb.common.hw,
  1476. [CLK_AUDCP_TMR0_EB] = &audcp_tmr0_eb.common.hw,
  1477. [CLK_AUDCP_TMR1_EB] = &audcp_tmr1_eb.common.hw,
  1478. },
  1479. .num = CLK_AUDCP_APB_GATE_NUM,
  1480. };
  1481. static const struct sprd_clk_desc ums512_audcpapb_gate_desc = {
  1482. .clk_clks = ums512_audcpapb_gate,
  1483. .num_clk_clks = ARRAY_SIZE(ums512_audcpapb_gate),
  1484. .hw_clks = &ums512_audcpapb_gate_hws,
  1485. };
  1486. /* audcp ahb gates */
  1487. /* Audcp aphb clocks configure CLK_IGNORE_UNUSED because these clocks may be
  1488. * controlled by audcp sys at the same time. It may be cause an execption if
  1489. * kernel gates these clock.
  1490. */
  1491. static SPRD_SC_GATE_CLK_HW(audcp_iis0_eb, "audcp-iis0-eb",
  1492. &access_aud_en.common.hw, 0x0, 0x100, BIT(0),
  1493. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1494. static SPRD_SC_GATE_CLK_HW(audcp_iis1_eb, "audcp-iis1-eb",
  1495. &access_aud_en.common.hw, 0x0, 0x100, BIT(1),
  1496. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1497. static SPRD_SC_GATE_CLK_HW(audcp_iis2_eb, "audcp-iis2-eb",
  1498. &access_aud_en.common.hw, 0x0, 0x100, BIT(2),
  1499. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1500. static SPRD_SC_GATE_CLK_HW(audcp_uart_eb, "audcp-uart-eb",
  1501. &access_aud_en.common.hw, 0x0, 0x100, BIT(4),
  1502. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1503. static SPRD_SC_GATE_CLK_HW(audcp_dma_cp_eb, "audcp-dma-cp-eb",
  1504. &access_aud_en.common.hw, 0x0, 0x100, BIT(5),
  1505. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1506. static SPRD_SC_GATE_CLK_HW(audcp_dma_ap_eb, "audcp-dma-ap-eb",
  1507. &access_aud_en.common.hw, 0x0, 0x100, BIT(6),
  1508. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1509. static SPRD_SC_GATE_CLK_HW(audcp_src48k_eb, "audcp-src48k-eb",
  1510. &access_aud_en.common.hw, 0x0, 0x100, BIT(10),
  1511. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1512. static SPRD_SC_GATE_CLK_HW(audcp_mcdt_eb, "audcp-mcdt-eb",
  1513. &access_aud_en.common.hw, 0x0, 0x100, BIT(12),
  1514. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1515. static SPRD_SC_GATE_CLK_HW(audcp_vbcifd_eb, "audcp-vbcifd-eb",
  1516. &access_aud_en.common.hw, 0x0, 0x100, BIT(13),
  1517. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1518. static SPRD_SC_GATE_CLK_HW(audcp_vbc_eb, "audcp-vbc-eb",
  1519. &access_aud_en.common.hw, 0x0, 0x100, BIT(14),
  1520. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1521. static SPRD_SC_GATE_CLK_HW(audcp_splk_eb, "audcp-splk-eb",
  1522. &access_aud_en.common.hw, 0x0, 0x100, BIT(15),
  1523. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1524. static SPRD_SC_GATE_CLK_HW(audcp_icu_eb, "audcp-icu-eb",
  1525. &access_aud_en.common.hw, 0x0, 0x100, BIT(16),
  1526. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1527. static SPRD_SC_GATE_CLK_HW(dma_ap_ashb_eb, "dma-ap-ashb-eb",
  1528. &access_aud_en.common.hw, 0x0, 0x100, BIT(17),
  1529. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1530. static SPRD_SC_GATE_CLK_HW(dma_cp_ashb_eb, "dma-cp-ashb-eb",
  1531. &access_aud_en.common.hw, 0x0, 0x100, BIT(18),
  1532. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1533. static SPRD_SC_GATE_CLK_HW(audcp_aud_eb, "audcp-aud-eb",
  1534. &access_aud_en.common.hw, 0x0, 0x100, BIT(19),
  1535. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1536. static SPRD_SC_GATE_CLK_HW(audcp_vbc_24m_eb, "audcp-vbc-24m-eb",
  1537. &access_aud_en.common.hw, 0x0, 0x100, BIT(21),
  1538. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1539. static SPRD_SC_GATE_CLK_HW(audcp_tmr_26m_eb, "audcp-tmr-26m-eb",
  1540. &access_aud_en.common.hw, 0x0, 0x100, BIT(22),
  1541. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1542. static SPRD_SC_GATE_CLK_HW(audcp_dvfs_ashb_eb, "audcp-dvfs-ashb-eb",
  1543. &access_aud_en.common.hw, 0x0, 0x100, BIT(23),
  1544. CLK_IGNORE_UNUSED, SPRD_GATE_NON_AON);
  1545. static struct sprd_clk_common *ums512_audcpahb_gate[] = {
  1546. /* address base is 0x335e0000 */
  1547. &audcp_iis0_eb.common,
  1548. &audcp_iis1_eb.common,
  1549. &audcp_iis2_eb.common,
  1550. &audcp_uart_eb.common,
  1551. &audcp_dma_cp_eb.common,
  1552. &audcp_dma_ap_eb.common,
  1553. &audcp_src48k_eb.common,
  1554. &audcp_mcdt_eb.common,
  1555. &audcp_vbcifd_eb.common,
  1556. &audcp_vbc_eb.common,
  1557. &audcp_splk_eb.common,
  1558. &audcp_icu_eb.common,
  1559. &dma_ap_ashb_eb.common,
  1560. &dma_cp_ashb_eb.common,
  1561. &audcp_aud_eb.common,
  1562. &audcp_vbc_24m_eb.common,
  1563. &audcp_tmr_26m_eb.common,
  1564. &audcp_dvfs_ashb_eb.common,
  1565. };
  1566. static struct clk_hw_onecell_data ums512_audcpahb_gate_hws = {
  1567. .hws = {
  1568. [CLK_AUDCP_IIS0_EB] = &audcp_iis0_eb.common.hw,
  1569. [CLK_AUDCP_IIS1_EB] = &audcp_iis1_eb.common.hw,
  1570. [CLK_AUDCP_IIS2_EB] = &audcp_iis2_eb.common.hw,
  1571. [CLK_AUDCP_UART_EB] = &audcp_uart_eb.common.hw,
  1572. [CLK_AUDCP_DMA_CP_EB] = &audcp_dma_cp_eb.common.hw,
  1573. [CLK_AUDCP_DMA_AP_EB] = &audcp_dma_ap_eb.common.hw,
  1574. [CLK_AUDCP_SRC48K_EB] = &audcp_src48k_eb.common.hw,
  1575. [CLK_AUDCP_MCDT_EB] = &audcp_mcdt_eb.common.hw,
  1576. [CLK_AUDCP_VBCIFD_EB] = &audcp_vbcifd_eb.common.hw,
  1577. [CLK_AUDCP_VBC_EB] = &audcp_vbc_eb.common.hw,
  1578. [CLK_AUDCP_SPLK_EB] = &audcp_splk_eb.common.hw,
  1579. [CLK_AUDCP_ICU_EB] = &audcp_icu_eb.common.hw,
  1580. [CLK_AUDCP_DMA_AP_ASHB_EB] = &dma_ap_ashb_eb.common.hw,
  1581. [CLK_AUDCP_DMA_CP_ASHB_EB] = &dma_cp_ashb_eb.common.hw,
  1582. [CLK_AUDCP_AUD_EB] = &audcp_aud_eb.common.hw,
  1583. [CLK_AUDCP_VBC_24M_EB] = &audcp_vbc_24m_eb.common.hw,
  1584. [CLK_AUDCP_TMR_26M_EB] = &audcp_tmr_26m_eb.common.hw,
  1585. [CLK_AUDCP_DVFS_ASHB_EB] = &audcp_dvfs_ashb_eb.common.hw,
  1586. },
  1587. .num = CLK_AUDCP_AHB_GATE_NUM,
  1588. };
  1589. static const struct sprd_clk_desc ums512_audcpahb_gate_desc = {
  1590. .clk_clks = ums512_audcpahb_gate,
  1591. .num_clk_clks = ARRAY_SIZE(ums512_audcpahb_gate),
  1592. .hw_clks = &ums512_audcpahb_gate_hws,
  1593. };
  1594. /* gpu clocks */
  1595. static SPRD_GATE_CLK_HW(gpu_core_gate, "gpu-core-gate", &gpu_eb.common.hw,
  1596. 0x4, BIT(0), 0, 0);
  1597. static const struct clk_parent_data gpu_parents[] = {
  1598. { .fw_name = "ext-26m" },
  1599. { .hw = &twpll_384m.hw },
  1600. { .hw = &twpll_512m.hw },
  1601. { .hw = &lpll_614m4.hw },
  1602. { .hw = &twpll_768m.hw },
  1603. { .hw = &gpll.common.hw },
  1604. };
  1605. static SPRD_COMP_CLK_DATA(gpu_core_clk, "gpu-core-clk", gpu_parents,
  1606. 0x4, 4, 3, 8, 3, 0);
  1607. static SPRD_GATE_CLK_HW(gpu_mem_gate, "gpu-mem-gate", &gpu_eb.common.hw,
  1608. 0x8, BIT(0), 0, 0);
  1609. static SPRD_COMP_CLK_DATA(gpu_mem_clk, "gpu-mem-clk", gpu_parents,
  1610. 0x8, 4, 3, 8, 3, 0);
  1611. static SPRD_GATE_CLK_HW(gpu_sys_gate, "gpu-sys-gate", &gpu_eb.common.hw,
  1612. 0xc, BIT(0), 0, 0);
  1613. static SPRD_DIV_CLK_HW(gpu_sys_clk, "gpu-sys-clk", &gpu_eb.common.hw,
  1614. 0xc, 4, 3, 0);
  1615. static struct sprd_clk_common *ums512_gpu_clk[] = {
  1616. /* address base is 0x60100000 */
  1617. &gpu_core_gate.common,
  1618. &gpu_core_clk.common,
  1619. &gpu_mem_gate.common,
  1620. &gpu_mem_clk.common,
  1621. &gpu_sys_gate.common,
  1622. &gpu_sys_clk.common,
  1623. };
  1624. static struct clk_hw_onecell_data ums512_gpu_clk_hws = {
  1625. .hws = {
  1626. [CLK_GPU_CORE_EB] = &gpu_core_gate.common.hw,
  1627. [CLK_GPU_CORE] = &gpu_core_clk.common.hw,
  1628. [CLK_GPU_MEM_EB] = &gpu_mem_gate.common.hw,
  1629. [CLK_GPU_MEM] = &gpu_mem_clk.common.hw,
  1630. [CLK_GPU_SYS_EB] = &gpu_sys_gate.common.hw,
  1631. [CLK_GPU_SYS] = &gpu_sys_clk.common.hw,
  1632. },
  1633. .num = CLK_GPU_CLK_NUM,
  1634. };
  1635. static struct sprd_clk_desc ums512_gpu_clk_desc = {
  1636. .clk_clks = ums512_gpu_clk,
  1637. .num_clk_clks = ARRAY_SIZE(ums512_gpu_clk),
  1638. .hw_clks = &ums512_gpu_clk_hws,
  1639. };
  1640. /* mm clocks */
  1641. static const struct clk_parent_data mm_ahb_parents[] = {
  1642. { .fw_name = "ext-26m" },
  1643. { .hw = &twpll_96m.hw },
  1644. { .hw = &twpll_128m.hw },
  1645. { .hw = &twpll_153m6.hw },
  1646. };
  1647. static SPRD_MUX_CLK_DATA(mm_ahb_clk, "mm-ahb-clk", mm_ahb_parents,
  1648. 0x20, 0, 2, UMS512_MUX_FLAG);
  1649. static const struct clk_parent_data mm_mtx_parents[] = {
  1650. { .hw = &twpll_76m8.hw },
  1651. { .hw = &twpll_128m.hw },
  1652. { .hw = &twpll_256m.hw },
  1653. { .hw = &twpll_307m2.hw },
  1654. { .hw = &twpll_384m.hw },
  1655. { .hw = &isppll_468m.hw },
  1656. { .hw = &twpll_512m.hw },
  1657. };
  1658. static SPRD_MUX_CLK_DATA(mm_mtx_clk, "mm-mtx-clk", mm_mtx_parents,
  1659. 0x24, 0, 3, UMS512_MUX_FLAG);
  1660. static const struct clk_parent_data sensor_parents[] = {
  1661. { .fw_name = "ext-26m" },
  1662. { .hw = &twpll_48m.hw },
  1663. { .hw = &twpll_76m8.hw },
  1664. { .hw = &twpll_96m.hw },
  1665. };
  1666. static SPRD_COMP_CLK_DATA(sensor0_clk, "sensor0-clk", sensor_parents,
  1667. 0x28, 0, 2, 8, 3, 0);
  1668. static SPRD_COMP_CLK_DATA(sensor1_clk, "sensor1-clk", sensor_parents,
  1669. 0x2c, 0, 2, 8, 3, 0);
  1670. static SPRD_COMP_CLK_DATA(sensor2_clk, "sensor2-clk", sensor_parents,
  1671. 0x30, 0, 2, 8, 3, 0);
  1672. static const struct clk_parent_data cpp_parents[] = {
  1673. { .hw = &twpll_76m8.hw },
  1674. { .hw = &twpll_128m.hw },
  1675. { .hw = &twpll_256m.hw },
  1676. { .hw = &twpll_384m.hw },
  1677. };
  1678. static SPRD_MUX_CLK_DATA(cpp_clk, "cpp-clk", cpp_parents,
  1679. 0x34, 0, 2, UMS512_MUX_FLAG);
  1680. static const struct clk_parent_data jpg_parents[] = {
  1681. { .hw = &twpll_76m8.hw },
  1682. { .hw = &twpll_128m.hw },
  1683. { .hw = &twpll_256m.hw },
  1684. { .hw = &twpll_384m.hw },
  1685. };
  1686. static SPRD_MUX_CLK_DATA(jpg_clk, "jpg-clk", jpg_parents,
  1687. 0x38, 0, 2, UMS512_MUX_FLAG);
  1688. static const struct clk_parent_data fd_parents[] = {
  1689. { .hw = &twpll_76m8.hw },
  1690. { .hw = &twpll_192m.hw },
  1691. { .hw = &twpll_307m2.hw },
  1692. { .hw = &twpll_384m.hw },
  1693. };
  1694. static SPRD_MUX_CLK_DATA(fd_clk, "fd-clk", fd_parents,
  1695. 0x3c, 0, 2, UMS512_MUX_FLAG);
  1696. static const struct clk_parent_data dcam_if_parents[] = {
  1697. { .hw = &twpll_192m.hw },
  1698. { .hw = &twpll_256m.hw },
  1699. { .hw = &twpll_307m2.hw },
  1700. { .hw = &twpll_384m.hw },
  1701. { .hw = &isppll_468m.hw },
  1702. };
  1703. static SPRD_MUX_CLK_DATA(dcam_if_clk, "dcam-if-clk", dcam_if_parents,
  1704. 0x40, 0, 3, UMS512_MUX_FLAG);
  1705. static const struct clk_parent_data dcam_axi_parents[] = {
  1706. { .hw = &twpll_256m.hw },
  1707. { .hw = &twpll_307m2.hw },
  1708. { .hw = &twpll_384m.hw },
  1709. { .hw = &isppll_468m.hw },
  1710. };
  1711. static SPRD_MUX_CLK_DATA(dcam_axi_clk, "dcam-axi-clk", dcam_axi_parents,
  1712. 0x44, 0, 2, UMS512_MUX_FLAG);
  1713. static const struct clk_parent_data isp_parents[] = {
  1714. { .hw = &twpll_256m.hw },
  1715. { .hw = &twpll_307m2.hw },
  1716. { .hw = &twpll_384m.hw },
  1717. { .hw = &isppll_468m.hw },
  1718. { .hw = &twpll_512m.hw },
  1719. };
  1720. static SPRD_MUX_CLK_DATA(isp_clk, "isp-clk", isp_parents,
  1721. 0x48, 0, 3, UMS512_MUX_FLAG);
  1722. static SPRD_GATE_CLK_HW(mipi_csi0, "mipi-csi0", &mm_eb.common.hw,
  1723. 0x4c, BIT(16), CLK_IGNORE_UNUSED, 0);
  1724. static SPRD_GATE_CLK_HW(mipi_csi1, "mipi-csi1", &mm_eb.common.hw,
  1725. 0x50, BIT(16), CLK_IGNORE_UNUSED, 0);
  1726. static SPRD_GATE_CLK_HW(mipi_csi2, "mipi-csi2", &mm_eb.common.hw,
  1727. 0x54, BIT(16), CLK_IGNORE_UNUSED, 0);
  1728. static struct sprd_clk_common *ums512_mm_clk[] = {
  1729. /* address base is 0x62100000 */
  1730. &mm_ahb_clk.common,
  1731. &mm_mtx_clk.common,
  1732. &sensor0_clk.common,
  1733. &sensor1_clk.common,
  1734. &sensor2_clk.common,
  1735. &cpp_clk.common,
  1736. &jpg_clk.common,
  1737. &fd_clk.common,
  1738. &dcam_if_clk.common,
  1739. &dcam_axi_clk.common,
  1740. &isp_clk.common,
  1741. &mipi_csi0.common,
  1742. &mipi_csi1.common,
  1743. &mipi_csi2.common,
  1744. };
  1745. static struct clk_hw_onecell_data ums512_mm_clk_hws = {
  1746. .hws = {
  1747. [CLK_MM_AHB] = &mm_ahb_clk.common.hw,
  1748. [CLK_MM_MTX] = &mm_mtx_clk.common.hw,
  1749. [CLK_SENSOR0] = &sensor0_clk.common.hw,
  1750. [CLK_SENSOR1] = &sensor1_clk.common.hw,
  1751. [CLK_SENSOR2] = &sensor2_clk.common.hw,
  1752. [CLK_CPP] = &cpp_clk.common.hw,
  1753. [CLK_JPG] = &jpg_clk.common.hw,
  1754. [CLK_FD] = &fd_clk.common.hw,
  1755. [CLK_DCAM_IF] = &dcam_if_clk.common.hw,
  1756. [CLK_DCAM_AXI] = &dcam_axi_clk.common.hw,
  1757. [CLK_ISP] = &isp_clk.common.hw,
  1758. [CLK_MIPI_CSI0] = &mipi_csi0.common.hw,
  1759. [CLK_MIPI_CSI1] = &mipi_csi1.common.hw,
  1760. [CLK_MIPI_CSI2] = &mipi_csi2.common.hw,
  1761. },
  1762. .num = CLK_MM_CLK_NUM,
  1763. };
  1764. static struct sprd_clk_desc ums512_mm_clk_desc = {
  1765. .clk_clks = ums512_mm_clk,
  1766. .num_clk_clks = ARRAY_SIZE(ums512_mm_clk),
  1767. .hw_clks = &ums512_mm_clk_hws,
  1768. };
  1769. /* mm gate clocks */
  1770. static SPRD_SC_GATE_CLK_HW(mm_cpp_eb, "mm-cpp-eb", &mm_eb.common.hw,
  1771. 0x0, 0x1000, BIT(0), 0, 0);
  1772. static SPRD_SC_GATE_CLK_HW(mm_jpg_eb, "mm-jpg-eb", &mm_eb.common.hw,
  1773. 0x0, 0x1000, BIT(1), 0, 0);
  1774. static SPRD_SC_GATE_CLK_HW(mm_dcam_eb, "mm-dcam-eb", &mm_eb.common.hw,
  1775. 0x0, 0x1000, BIT(2), 0, 0);
  1776. static SPRD_SC_GATE_CLK_HW(mm_isp_eb, "mm-isp-eb", &mm_eb.common.hw,
  1777. 0x0, 0x1000, BIT(3), 0, 0);
  1778. static SPRD_SC_GATE_CLK_HW(mm_csi2_eb, "mm-csi2-eb", &mm_eb.common.hw,
  1779. 0x0, 0x1000, BIT(4), 0, 0);
  1780. static SPRD_SC_GATE_CLK_HW(mm_csi1_eb, "mm-csi1-eb", &mm_eb.common.hw,
  1781. 0x0, 0x1000, BIT(5), 0, 0);
  1782. static SPRD_SC_GATE_CLK_HW(mm_csi0_eb, "mm-csi0-eb", &mm_eb.common.hw,
  1783. 0x0, 0x1000, BIT(6), 0, 0);
  1784. static SPRD_SC_GATE_CLK_HW(mm_ckg_eb, "mm-ckg-eb", &mm_eb.common.hw,
  1785. 0x0, 0x1000, BIT(7), 0, 0);
  1786. static SPRD_SC_GATE_CLK_HW(mm_isp_ahb_eb, "mm-isp-ahb-eb", &mm_eb.common.hw,
  1787. 0x0, 0x1000, BIT(8), 0, 0);
  1788. static SPRD_SC_GATE_CLK_HW(mm_dvfs_eb, "mm-dvfs-eb", &mm_eb.common.hw,
  1789. 0x0, 0x1000, BIT(9), 0, 0);
  1790. static SPRD_SC_GATE_CLK_HW(mm_fd_eb, "mm-fd-eb", &mm_eb.common.hw,
  1791. 0x0, 0x1000, BIT(10), 0, 0);
  1792. static SPRD_SC_GATE_CLK_HW(mm_sensor2_en, "mm-sensor2-en", &mm_eb.common.hw,
  1793. 0x8, 0x1000, BIT(0), 0, 0);
  1794. static SPRD_SC_GATE_CLK_HW(mm_sensor1_en, "mm-sensor1-en", &mm_eb.common.hw,
  1795. 0x8, 0x1000, BIT(1), 0, 0);
  1796. static SPRD_SC_GATE_CLK_HW(mm_sensor0_en, "mm-sensor0-en", &mm_eb.common.hw,
  1797. 0x8, 0x1000, BIT(2), 0, 0);
  1798. static SPRD_SC_GATE_CLK_HW(mm_mipi_csi2_en, "mm-mipi-csi2-en", &mm_eb.common.hw,
  1799. 0x8, 0x1000, BIT(3), 0, 0);
  1800. static SPRD_SC_GATE_CLK_HW(mm_mipi_csi1_en, "mm-mipi-csi1-en", &mm_eb.common.hw,
  1801. 0x8, 0x1000, BIT(4), 0, 0);
  1802. static SPRD_SC_GATE_CLK_HW(mm_mipi_csi0_en, "mm-mipi-csi0-en", &mm_eb.common.hw,
  1803. 0x8, 0x1000, BIT(5), 0, 0);
  1804. static SPRD_SC_GATE_CLK_HW(mm_dcam_axi_en, "mm-dcam-axi-en", &mm_eb.common.hw,
  1805. 0x8, 0x1000, BIT(6), 0, 0);
  1806. static SPRD_SC_GATE_CLK_HW(mm_isp_axi_en, "mm-isp-axi-en", &mm_eb.common.hw,
  1807. 0x8, 0x1000, BIT(7), 0, 0);
  1808. static SPRD_SC_GATE_CLK_HW(mm_cphy_en, "mm-cphy-en", &mm_eb.common.hw,
  1809. 0x8, 0x1000, BIT(8), 0, 0);
  1810. static struct sprd_clk_common *ums512_mm_gate_clk[] = {
  1811. /* address base is 0x62200000 */
  1812. &mm_cpp_eb.common,
  1813. &mm_jpg_eb.common,
  1814. &mm_dcam_eb.common,
  1815. &mm_isp_eb.common,
  1816. &mm_csi2_eb.common,
  1817. &mm_csi1_eb.common,
  1818. &mm_csi0_eb.common,
  1819. &mm_ckg_eb.common,
  1820. &mm_isp_ahb_eb.common,
  1821. &mm_dvfs_eb.common,
  1822. &mm_fd_eb.common,
  1823. &mm_sensor2_en.common,
  1824. &mm_sensor1_en.common,
  1825. &mm_sensor0_en.common,
  1826. &mm_mipi_csi2_en.common,
  1827. &mm_mipi_csi1_en.common,
  1828. &mm_mipi_csi0_en.common,
  1829. &mm_dcam_axi_en.common,
  1830. &mm_isp_axi_en.common,
  1831. &mm_cphy_en.common,
  1832. };
  1833. static struct clk_hw_onecell_data ums512_mm_gate_clk_hws = {
  1834. .hws = {
  1835. [CLK_MM_CPP_EB] = &mm_cpp_eb.common.hw,
  1836. [CLK_MM_JPG_EB] = &mm_jpg_eb.common.hw,
  1837. [CLK_MM_DCAM_EB] = &mm_dcam_eb.common.hw,
  1838. [CLK_MM_ISP_EB] = &mm_isp_eb.common.hw,
  1839. [CLK_MM_CSI2_EB] = &mm_csi2_eb.common.hw,
  1840. [CLK_MM_CSI1_EB] = &mm_csi1_eb.common.hw,
  1841. [CLK_MM_CSI0_EB] = &mm_csi0_eb.common.hw,
  1842. [CLK_MM_CKG_EB] = &mm_ckg_eb.common.hw,
  1843. [CLK_ISP_AHB_EB] = &mm_isp_ahb_eb.common.hw,
  1844. [CLK_MM_DVFS_EB] = &mm_dvfs_eb.common.hw,
  1845. [CLK_MM_FD_EB] = &mm_fd_eb.common.hw,
  1846. [CLK_MM_SENSOR2_EB] = &mm_sensor2_en.common.hw,
  1847. [CLK_MM_SENSOR1_EB] = &mm_sensor1_en.common.hw,
  1848. [CLK_MM_SENSOR0_EB] = &mm_sensor0_en.common.hw,
  1849. [CLK_MM_MIPI_CSI2_EB] = &mm_mipi_csi2_en.common.hw,
  1850. [CLK_MM_MIPI_CSI1_EB] = &mm_mipi_csi1_en.common.hw,
  1851. [CLK_MM_MIPI_CSI0_EB] = &mm_mipi_csi0_en.common.hw,
  1852. [CLK_DCAM_AXI_EB] = &mm_dcam_axi_en.common.hw,
  1853. [CLK_ISP_AXI_EB] = &mm_isp_axi_en.common.hw,
  1854. [CLK_MM_CPHY_EB] = &mm_cphy_en.common.hw,
  1855. },
  1856. .num = CLK_MM_GATE_CLK_NUM,
  1857. };
  1858. static struct sprd_clk_desc ums512_mm_gate_clk_desc = {
  1859. .clk_clks = ums512_mm_gate_clk,
  1860. .num_clk_clks = ARRAY_SIZE(ums512_mm_gate_clk),
  1861. .hw_clks = &ums512_mm_gate_clk_hws,
  1862. };
  1863. /* ap apb gates */
  1864. static SPRD_SC_GATE_CLK_FW_NAME(sim0_eb, "sim0-eb", "ext-26m",
  1865. 0x0, 0x1000, BIT(0), 0, 0);
  1866. static SPRD_SC_GATE_CLK_FW_NAME(iis0_eb, "iis0-eb", "ext-26m",
  1867. 0x0, 0x1000, BIT(1), 0, 0);
  1868. static SPRD_SC_GATE_CLK_FW_NAME(iis1_eb, "iis1-eb", "ext-26m",
  1869. 0x0, 0x1000, BIT(2), 0, 0);
  1870. static SPRD_SC_GATE_CLK_FW_NAME(iis2_eb, "iis2-eb", "ext-26m",
  1871. 0x0, 0x1000, BIT(3), 0, 0);
  1872. static SPRD_SC_GATE_CLK_FW_NAME(apb_reg_eb, "apb-reg-eb", "ext-26m",
  1873. 0x0, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
  1874. static SPRD_SC_GATE_CLK_FW_NAME(spi0_eb, "spi0-eb", "ext-26m",
  1875. 0x0, 0x1000, BIT(5), 0, 0);
  1876. static SPRD_SC_GATE_CLK_FW_NAME(spi1_eb, "spi1-eb", "ext-26m",
  1877. 0x0, 0x1000, BIT(6), 0, 0);
  1878. static SPRD_SC_GATE_CLK_FW_NAME(spi2_eb, "spi2-eb", "ext-26m",
  1879. 0x0, 0x1000, BIT(7), 0, 0);
  1880. static SPRD_SC_GATE_CLK_FW_NAME(spi3_eb, "spi3-eb", "ext-26m",
  1881. 0x0, 0x1000, BIT(8), 0, 0);
  1882. static SPRD_SC_GATE_CLK_FW_NAME(i2c0_eb, "i2c0-eb", "ext-26m",
  1883. 0x0, 0x1000, BIT(9), 0, 0);
  1884. static SPRD_SC_GATE_CLK_FW_NAME(i2c1_eb, "i2c1-eb", "ext-26m",
  1885. 0x0, 0x1000, BIT(10), 0, 0);
  1886. static SPRD_SC_GATE_CLK_FW_NAME(i2c2_eb, "i2c2-eb", "ext-26m",
  1887. 0x0, 0x1000, BIT(11), 0, 0);
  1888. static SPRD_SC_GATE_CLK_FW_NAME(i2c3_eb, "i2c3-eb", "ext-26m",
  1889. 0x0, 0x1000, BIT(12), 0, 0);
  1890. static SPRD_SC_GATE_CLK_FW_NAME(i2c4_eb, "i2c4-eb", "ext-26m",
  1891. 0x0, 0x1000, BIT(13), 0, 0);
  1892. static SPRD_SC_GATE_CLK_FW_NAME(uart0_eb, "uart0-eb", "ext-26m",
  1893. 0x0, 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1894. static SPRD_SC_GATE_CLK_FW_NAME(uart1_eb, "uart1-eb", "ext-26m",
  1895. 0x0, 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1896. static SPRD_SC_GATE_CLK_FW_NAME(uart2_eb, "uart2-eb", "ext-26m",
  1897. 0x0, 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1898. static SPRD_SC_GATE_CLK_FW_NAME(sim0_32k_eb, "sim0-32k-eb", "ext-26m",
  1899. 0x0, 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1900. static SPRD_SC_GATE_CLK_FW_NAME(spi0_lfin_eb, "spi0-lfin-eb", "ext-26m",
  1901. 0x0, 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0);
  1902. static SPRD_SC_GATE_CLK_FW_NAME(spi1_lfin_eb, "spi1-lfin-eb", "ext-26m",
  1903. 0x0, 0x1000, BIT(19), CLK_IGNORE_UNUSED, 0);
  1904. static SPRD_SC_GATE_CLK_FW_NAME(spi2_lfin_eb, "spi2-lfin-eb", "ext-26m",
  1905. 0x0, 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
  1906. static SPRD_SC_GATE_CLK_FW_NAME(spi3_lfin_eb, "spi3-lfin-eb", "ext-26m",
  1907. 0x0, 0x1000, BIT(21), CLK_IGNORE_UNUSED, 0);
  1908. static SPRD_SC_GATE_CLK_FW_NAME(sdio0_eb, "sdio0-eb", "ext-26m",
  1909. 0x0, 0x1000, BIT(22), 0, 0);
  1910. static SPRD_SC_GATE_CLK_FW_NAME(sdio1_eb, "sdio1-eb", "ext-26m",
  1911. 0x0, 0x1000, BIT(23), 0, 0);
  1912. static SPRD_SC_GATE_CLK_FW_NAME(sdio2_eb, "sdio2-eb", "ext-26m",
  1913. 0x0, 0x1000, BIT(24), 0, 0);
  1914. static SPRD_SC_GATE_CLK_FW_NAME(emmc_eb, "emmc-eb", "ext-26m",
  1915. 0x0, 0x1000, BIT(25), 0, 0);
  1916. static SPRD_SC_GATE_CLK_FW_NAME(sdio0_32k_eb, "sdio0-32k-eb", "ext-26m",
  1917. 0x0, 0x1000, BIT(26), 0, 0);
  1918. static SPRD_SC_GATE_CLK_FW_NAME(sdio1_32k_eb, "sdio1-32k-eb", "ext-26m",
  1919. 0x0, 0x1000, BIT(27), 0, 0);
  1920. static SPRD_SC_GATE_CLK_FW_NAME(sdio2_32k_eb, "sdio2-32k-eb", "ext-26m",
  1921. 0x0, 0x1000, BIT(28), 0, 0);
  1922. static SPRD_SC_GATE_CLK_FW_NAME(emmc_32k_eb, "emmc-32k-eb", "ext-26m",
  1923. 0x0, 0x1000, BIT(29), 0, 0);
  1924. static struct sprd_clk_common *ums512_apapb_gate[] = {
  1925. /* address base is 0x71000000 */
  1926. &sim0_eb.common,
  1927. &iis0_eb.common,
  1928. &iis1_eb.common,
  1929. &iis2_eb.common,
  1930. &apb_reg_eb.common,
  1931. &spi0_eb.common,
  1932. &spi1_eb.common,
  1933. &spi2_eb.common,
  1934. &spi3_eb.common,
  1935. &i2c0_eb.common,
  1936. &i2c1_eb.common,
  1937. &i2c2_eb.common,
  1938. &i2c3_eb.common,
  1939. &i2c4_eb.common,
  1940. &uart0_eb.common,
  1941. &uart1_eb.common,
  1942. &uart2_eb.common,
  1943. &sim0_32k_eb.common,
  1944. &spi0_lfin_eb.common,
  1945. &spi1_lfin_eb.common,
  1946. &spi2_lfin_eb.common,
  1947. &spi3_lfin_eb.common,
  1948. &sdio0_eb.common,
  1949. &sdio1_eb.common,
  1950. &sdio2_eb.common,
  1951. &emmc_eb.common,
  1952. &sdio0_32k_eb.common,
  1953. &sdio1_32k_eb.common,
  1954. &sdio2_32k_eb.common,
  1955. &emmc_32k_eb.common,
  1956. };
  1957. static struct clk_hw_onecell_data ums512_apapb_gate_hws = {
  1958. .hws = {
  1959. [CLK_SIM0_EB] = &sim0_eb.common.hw,
  1960. [CLK_IIS0_EB] = &iis0_eb.common.hw,
  1961. [CLK_IIS1_EB] = &iis1_eb.common.hw,
  1962. [CLK_IIS2_EB] = &iis2_eb.common.hw,
  1963. [CLK_APB_REG_EB] = &apb_reg_eb.common.hw,
  1964. [CLK_SPI0_EB] = &spi0_eb.common.hw,
  1965. [CLK_SPI1_EB] = &spi1_eb.common.hw,
  1966. [CLK_SPI2_EB] = &spi2_eb.common.hw,
  1967. [CLK_SPI3_EB] = &spi3_eb.common.hw,
  1968. [CLK_I2C0_EB] = &i2c0_eb.common.hw,
  1969. [CLK_I2C1_EB] = &i2c1_eb.common.hw,
  1970. [CLK_I2C2_EB] = &i2c2_eb.common.hw,
  1971. [CLK_I2C3_EB] = &i2c3_eb.common.hw,
  1972. [CLK_I2C4_EB] = &i2c4_eb.common.hw,
  1973. [CLK_UART0_EB] = &uart0_eb.common.hw,
  1974. [CLK_UART1_EB] = &uart1_eb.common.hw,
  1975. [CLK_UART2_EB] = &uart2_eb.common.hw,
  1976. [CLK_SIM0_32K_EB] = &sim0_32k_eb.common.hw,
  1977. [CLK_SPI0_LFIN_EB] = &spi0_lfin_eb.common.hw,
  1978. [CLK_SPI1_LFIN_EB] = &spi1_lfin_eb.common.hw,
  1979. [CLK_SPI2_LFIN_EB] = &spi2_lfin_eb.common.hw,
  1980. [CLK_SPI3_LFIN_EB] = &spi3_lfin_eb.common.hw,
  1981. [CLK_SDIO0_EB] = &sdio0_eb.common.hw,
  1982. [CLK_SDIO1_EB] = &sdio1_eb.common.hw,
  1983. [CLK_SDIO2_EB] = &sdio2_eb.common.hw,
  1984. [CLK_EMMC_EB] = &emmc_eb.common.hw,
  1985. [CLK_SDIO0_32K_EB] = &sdio0_32k_eb.common.hw,
  1986. [CLK_SDIO1_32K_EB] = &sdio1_32k_eb.common.hw,
  1987. [CLK_SDIO2_32K_EB] = &sdio2_32k_eb.common.hw,
  1988. [CLK_EMMC_32K_EB] = &emmc_32k_eb.common.hw,
  1989. },
  1990. .num = CLK_AP_APB_GATE_NUM,
  1991. };
  1992. static struct sprd_clk_desc ums512_apapb_gate_desc = {
  1993. .clk_clks = ums512_apapb_gate,
  1994. .num_clk_clks = ARRAY_SIZE(ums512_apapb_gate),
  1995. .hw_clks = &ums512_apapb_gate_hws,
  1996. };
  1997. static const struct of_device_id sprd_ums512_clk_ids[] = {
  1998. { .compatible = "sprd,ums512-pmu-gate", /* 0x327e0000 */
  1999. .data = &ums512_pmu_gate_desc },
  2000. { .compatible = "sprd,ums512-g0-pll", /* 0x32390000 */
  2001. .data = &ums512_g0_pll_desc },
  2002. { .compatible = "sprd,ums512-g2-pll", /* 0x323b0000 */
  2003. .data = &ums512_g2_pll_desc },
  2004. { .compatible = "sprd,ums512-g3-pll", /* 0x323c0000 */
  2005. .data = &ums512_g3_pll_desc },
  2006. { .compatible = "sprd,ums512-gc-pll", /* 0x323e0000 */
  2007. .data = &ums512_gc_pll_desc },
  2008. { .compatible = "sprd,ums512-apahb-gate", /* 0x20100000 */
  2009. .data = &ums512_apahb_gate_desc },
  2010. { .compatible = "sprd,ums512-ap-clk", /* 0x20200000 */
  2011. .data = &ums512_ap_clk_desc },
  2012. { .compatible = "sprd,ums512-aonapb-clk", /* 0x32080200 */
  2013. .data = &ums512_aon_apb_desc },
  2014. { .compatible = "sprd,ums512-aon-gate", /* 0x327d0000 */
  2015. .data = &ums512_aon_gate_desc },
  2016. { .compatible = "sprd,ums512-audcpapb-gate", /* 0x3350d000 */
  2017. .data = &ums512_audcpapb_gate_desc },
  2018. { .compatible = "sprd,ums512-audcpahb-gate", /* 0x335e0000 */
  2019. .data = &ums512_audcpahb_gate_desc },
  2020. { .compatible = "sprd,ums512-gpu-clk", /* 0x60100000 */
  2021. .data = &ums512_gpu_clk_desc },
  2022. { .compatible = "sprd,ums512-mm-clk", /* 0x62100000 */
  2023. .data = &ums512_mm_clk_desc },
  2024. { .compatible = "sprd,ums512-mm-gate-clk", /* 0x62200000 */
  2025. .data = &ums512_mm_gate_clk_desc },
  2026. { .compatible = "sprd,ums512-apapb-gate", /* 0x71000000 */
  2027. .data = &ums512_apapb_gate_desc },
  2028. { }
  2029. };
  2030. MODULE_DEVICE_TABLE(of, sprd_ums512_clk_ids);
  2031. static int ums512_clk_probe(struct platform_device *pdev)
  2032. {
  2033. const struct sprd_clk_desc *desc;
  2034. int ret;
  2035. desc = device_get_match_data(&pdev->dev);
  2036. if (!desc)
  2037. return -ENODEV;
  2038. ret = sprd_clk_regmap_init(pdev, desc);
  2039. if (ret)
  2040. return ret;
  2041. return sprd_clk_probe(&pdev->dev, desc->hw_clks);
  2042. }
  2043. static struct platform_driver ums512_clk_driver = {
  2044. .probe = ums512_clk_probe,
  2045. .driver = {
  2046. .name = "ums512-clk",
  2047. .of_match_table = sprd_ums512_clk_ids,
  2048. },
  2049. };
  2050. module_platform_driver(ums512_clk_driver);
  2051. MODULE_DESCRIPTION("Unisoc UMS512 Clock Driver");
  2052. MODULE_LICENSE("GPL");