sc9863a-clk.c 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Unisoc SC9863A clock driver
  4. *
  5. * Copyright (C) 2019 Unisoc, Inc.
  6. * Author: Chunyan Zhang <[email protected]>
  7. */
  8. #include <linux/clk-provider.h>
  9. #include <linux/err.h>
  10. #include <linux/io.h>
  11. #include <linux/module.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/slab.h>
  14. #include <dt-bindings/clock/sprd,sc9863a-clk.h>
  15. #include "common.h"
  16. #include "composite.h"
  17. #include "div.h"
  18. #include "gate.h"
  19. #include "mux.h"
  20. #include "pll.h"
  21. /* mpll*_gate clocks control cpu cores, they were enabled by default */
  22. static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll0_gate, "mpll0-gate", "ext-26m", 0x94,
  23. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  24. static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll0_gate, "dpll0-gate", "ext-26m", 0x98,
  25. 0x1000, BIT(0), 0, 0, 240);
  26. static SPRD_PLL_SC_GATE_CLK_FW_NAME(lpll_gate, "lpll-gate", "ext-26m", 0x9c,
  27. 0x1000, BIT(0), 0, 0, 240);
  28. static SPRD_PLL_SC_GATE_CLK_FW_NAME(gpll_gate, "gpll-gate", "ext-26m", 0xa8,
  29. 0x1000, BIT(0), 0, 0, 240);
  30. static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll1_gate, "dpll1-gate", "ext-26m", 0x1dc,
  31. 0x1000, BIT(0), 0, 0, 240);
  32. static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll1_gate, "mpll1-gate", "ext-26m", 0x1e0,
  33. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  34. static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll2_gate, "mpll2-gate", "ext-26m", 0x1e4,
  35. 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
  36. static SPRD_PLL_SC_GATE_CLK_FW_NAME(isppll_gate, "isppll-gate", "ext-26m",
  37. 0x1e8, 0x1000, BIT(0), 0, 0, 240);
  38. static struct sprd_clk_common *sc9863a_pmu_gate_clks[] = {
  39. /* address base is 0x402b0000 */
  40. &mpll0_gate.common,
  41. &dpll0_gate.common,
  42. &lpll_gate.common,
  43. &gpll_gate.common,
  44. &dpll1_gate.common,
  45. &mpll1_gate.common,
  46. &mpll2_gate.common,
  47. &isppll_gate.common,
  48. };
  49. static struct clk_hw_onecell_data sc9863a_pmu_gate_hws = {
  50. .hws = {
  51. [CLK_MPLL0_GATE] = &mpll0_gate.common.hw,
  52. [CLK_DPLL0_GATE] = &dpll0_gate.common.hw,
  53. [CLK_LPLL_GATE] = &lpll_gate.common.hw,
  54. [CLK_GPLL_GATE] = &gpll_gate.common.hw,
  55. [CLK_DPLL1_GATE] = &dpll1_gate.common.hw,
  56. [CLK_MPLL1_GATE] = &mpll1_gate.common.hw,
  57. [CLK_MPLL2_GATE] = &mpll2_gate.common.hw,
  58. [CLK_ISPPLL_GATE] = &isppll_gate.common.hw,
  59. },
  60. .num = CLK_PMU_APB_NUM,
  61. };
  62. static const struct sprd_clk_desc sc9863a_pmu_gate_desc = {
  63. .clk_clks = sc9863a_pmu_gate_clks,
  64. .num_clk_clks = ARRAY_SIZE(sc9863a_pmu_gate_clks),
  65. .hw_clks = &sc9863a_pmu_gate_hws,
  66. };
  67. static const u64 itable[5] = {4, 1000000000, 1200000000,
  68. 1400000000, 1600000000};
  69. static const struct clk_bit_field f_twpll[PLL_FACT_MAX] = {
  70. { .shift = 95, .width = 1 }, /* lock_done */
  71. { .shift = 0, .width = 1 }, /* div_s */
  72. { .shift = 1, .width = 1 }, /* mod_en */
  73. { .shift = 2, .width = 1 }, /* sdm_en */
  74. { .shift = 0, .width = 0 }, /* refin */
  75. { .shift = 3, .width = 3 }, /* ibias */
  76. { .shift = 8, .width = 11 }, /* n */
  77. { .shift = 55, .width = 7 }, /* nint */
  78. { .shift = 32, .width = 23}, /* kint */
  79. { .shift = 0, .width = 0 }, /* prediv */
  80. { .shift = 0, .width = 0 }, /* postdiv */
  81. };
  82. static SPRD_PLL_FW_NAME(twpll, "twpll", "ext-26m", 0x4, 3, itable,
  83. f_twpll, 240, 1000, 1000, 0, 0);
  84. static CLK_FIXED_FACTOR_HW(twpll_768m, "twpll-768m", &twpll.common.hw, 2, 1, 0);
  85. static CLK_FIXED_FACTOR_HW(twpll_384m, "twpll-384m", &twpll.common.hw, 4, 1, 0);
  86. static CLK_FIXED_FACTOR_HW(twpll_192m, "twpll-192m", &twpll.common.hw, 8, 1, 0);
  87. static CLK_FIXED_FACTOR_HW(twpll_96m, "twpll-96m", &twpll.common.hw, 16, 1, 0);
  88. static CLK_FIXED_FACTOR_HW(twpll_48m, "twpll-48m", &twpll.common.hw, 32, 1, 0);
  89. static CLK_FIXED_FACTOR_HW(twpll_24m, "twpll-24m", &twpll.common.hw, 64, 1, 0);
  90. static CLK_FIXED_FACTOR_HW(twpll_12m, "twpll-12m", &twpll.common.hw, 128, 1, 0);
  91. static CLK_FIXED_FACTOR_HW(twpll_512m, "twpll-512m", &twpll.common.hw, 3, 1, 0);
  92. static CLK_FIXED_FACTOR_HW(twpll_256m, "twpll-256m", &twpll.common.hw, 6, 1, 0);
  93. static CLK_FIXED_FACTOR_HW(twpll_128m, "twpll-128m", &twpll.common.hw, 12, 1, 0);
  94. static CLK_FIXED_FACTOR_HW(twpll_64m, "twpll-64m", &twpll.common.hw, 24, 1, 0);
  95. static CLK_FIXED_FACTOR_HW(twpll_307m2, "twpll-307m2", &twpll.common.hw, 5, 1, 0);
  96. static CLK_FIXED_FACTOR_HW(twpll_219m4, "twpll-219m4", &twpll.common.hw, 7, 1, 0);
  97. static CLK_FIXED_FACTOR_HW(twpll_170m6, "twpll-170m6", &twpll.common.hw, 9, 1, 0);
  98. static CLK_FIXED_FACTOR_HW(twpll_153m6, "twpll-153m6", &twpll.common.hw, 10, 1, 0);
  99. static CLK_FIXED_FACTOR_HW(twpll_76m8, "twpll-76m8", &twpll.common.hw, 20, 1, 0);
  100. static CLK_FIXED_FACTOR_HW(twpll_51m2, "twpll-51m2", &twpll.common.hw, 30, 1, 0);
  101. static CLK_FIXED_FACTOR_HW(twpll_38m4, "twpll-38m4", &twpll.common.hw, 40, 1, 0);
  102. static CLK_FIXED_FACTOR_HW(twpll_19m2, "twpll-19m2", &twpll.common.hw, 80, 1, 0);
  103. static const struct clk_bit_field f_lpll[PLL_FACT_MAX] = {
  104. { .shift = 95, .width = 1 }, /* lock_done */
  105. { .shift = 0, .width = 1 }, /* div_s */
  106. { .shift = 1, .width = 1 }, /* mod_en */
  107. { .shift = 2, .width = 1 }, /* sdm_en */
  108. { .shift = 0, .width = 0 }, /* refin */
  109. { .shift = 6, .width = 2 }, /* ibias */
  110. { .shift = 8, .width = 11 }, /* n */
  111. { .shift = 55, .width = 7 }, /* nint */
  112. { .shift = 32, .width = 23}, /* kint */
  113. { .shift = 0, .width = 0 }, /* prediv */
  114. { .shift = 0, .width = 0 }, /* postdiv */
  115. };
  116. static SPRD_PLL_HW(lpll, "lpll", &lpll_gate.common.hw, 0x20, 3, itable,
  117. f_lpll, 240, 1000, 1000, 0, 0);
  118. static CLK_FIXED_FACTOR_HW(lpll_409m6, "lpll-409m6", &lpll.common.hw, 3, 1, 0);
  119. static CLK_FIXED_FACTOR_HW(lpll_245m76, "lpll-245m76", &lpll.common.hw, 5, 1, 0);
  120. static const struct clk_bit_field f_gpll[PLL_FACT_MAX] = {
  121. { .shift = 95, .width = 1 }, /* lock_done */
  122. { .shift = 0, .width = 1 }, /* div_s */
  123. { .shift = 1, .width = 1 }, /* mod_en */
  124. { .shift = 2, .width = 1 }, /* sdm_en */
  125. { .shift = 0, .width = 0 }, /* refin */
  126. { .shift = 6, .width = 2 }, /* ibias */
  127. { .shift = 8, .width = 11 }, /* n */
  128. { .shift = 55, .width = 7 }, /* nint */
  129. { .shift = 32, .width = 23}, /* kint */
  130. { .shift = 0, .width = 0 }, /* prediv */
  131. { .shift = 80, .width = 1 }, /* postdiv */
  132. };
  133. static SPRD_PLL_HW(gpll, "gpll", &gpll_gate.common.hw, 0x38, 3, itable,
  134. f_gpll, 240, 1000, 1000, 1, 400000000);
  135. static SPRD_PLL_HW(isppll, "isppll", &isppll_gate.common.hw, 0x50, 3, itable,
  136. f_gpll, 240, 1000, 1000, 0, 0);
  137. static CLK_FIXED_FACTOR_HW(isppll_468m, "isppll-468m", &isppll.common.hw, 2, 1, 0);
  138. static struct sprd_clk_common *sc9863a_pll_clks[] = {
  139. /* address base is 0x40353000 */
  140. &twpll.common,
  141. &lpll.common,
  142. &gpll.common,
  143. &isppll.common,
  144. };
  145. static struct clk_hw_onecell_data sc9863a_pll_hws = {
  146. .hws = {
  147. [CLK_TWPLL] = &twpll.common.hw,
  148. [CLK_TWPLL_768M] = &twpll_768m.hw,
  149. [CLK_TWPLL_384M] = &twpll_384m.hw,
  150. [CLK_TWPLL_192M] = &twpll_192m.hw,
  151. [CLK_TWPLL_96M] = &twpll_96m.hw,
  152. [CLK_TWPLL_48M] = &twpll_48m.hw,
  153. [CLK_TWPLL_24M] = &twpll_24m.hw,
  154. [CLK_TWPLL_12M] = &twpll_12m.hw,
  155. [CLK_TWPLL_512M] = &twpll_512m.hw,
  156. [CLK_TWPLL_256M] = &twpll_256m.hw,
  157. [CLK_TWPLL_128M] = &twpll_128m.hw,
  158. [CLK_TWPLL_64M] = &twpll_64m.hw,
  159. [CLK_TWPLL_307M2] = &twpll_307m2.hw,
  160. [CLK_TWPLL_219M4] = &twpll_219m4.hw,
  161. [CLK_TWPLL_170M6] = &twpll_170m6.hw,
  162. [CLK_TWPLL_153M6] = &twpll_153m6.hw,
  163. [CLK_TWPLL_76M8] = &twpll_76m8.hw,
  164. [CLK_TWPLL_51M2] = &twpll_51m2.hw,
  165. [CLK_TWPLL_38M4] = &twpll_38m4.hw,
  166. [CLK_TWPLL_19M2] = &twpll_19m2.hw,
  167. [CLK_LPLL] = &lpll.common.hw,
  168. [CLK_LPLL_409M6] = &lpll_409m6.hw,
  169. [CLK_LPLL_245M76] = &lpll_245m76.hw,
  170. [CLK_GPLL] = &gpll.common.hw,
  171. [CLK_ISPPLL] = &isppll.common.hw,
  172. [CLK_ISPPLL_468M] = &isppll_468m.hw,
  173. },
  174. .num = CLK_ANLG_PHY_G1_NUM,
  175. };
  176. static const struct sprd_clk_desc sc9863a_pll_desc = {
  177. .clk_clks = sc9863a_pll_clks,
  178. .num_clk_clks = ARRAY_SIZE(sc9863a_pll_clks),
  179. .hw_clks = &sc9863a_pll_hws,
  180. };
  181. static const u64 itable_mpll[6] = {5, 1000000000, 1200000000, 1400000000,
  182. 1600000000, 1800000000};
  183. static SPRD_PLL_HW(mpll0, "mpll0", &mpll0_gate.common.hw, 0x0, 3, itable_mpll,
  184. f_gpll, 240, 1000, 1000, 1, 1000000000);
  185. static SPRD_PLL_HW(mpll1, "mpll1", &mpll1_gate.common.hw, 0x18, 3, itable_mpll,
  186. f_gpll, 240, 1000, 1000, 1, 1000000000);
  187. static SPRD_PLL_HW(mpll2, "mpll2", &mpll2_gate.common.hw, 0x30, 3, itable_mpll,
  188. f_gpll, 240, 1000, 1000, 1, 1000000000);
  189. static CLK_FIXED_FACTOR_HW(mpll2_675m, "mpll2-675m", &mpll2.common.hw, 2, 1, 0);
  190. static struct sprd_clk_common *sc9863a_mpll_clks[] = {
  191. /* address base is 0x40359000 */
  192. &mpll0.common,
  193. &mpll1.common,
  194. &mpll2.common,
  195. };
  196. static struct clk_hw_onecell_data sc9863a_mpll_hws = {
  197. .hws = {
  198. [CLK_MPLL0] = &mpll0.common.hw,
  199. [CLK_MPLL1] = &mpll1.common.hw,
  200. [CLK_MPLL2] = &mpll2.common.hw,
  201. [CLK_MPLL2_675M] = &mpll2_675m.hw,
  202. },
  203. .num = CLK_ANLG_PHY_G4_NUM,
  204. };
  205. static const struct sprd_clk_desc sc9863a_mpll_desc = {
  206. .clk_clks = sc9863a_mpll_clks,
  207. .num_clk_clks = ARRAY_SIZE(sc9863a_mpll_clks),
  208. .hw_clks = &sc9863a_mpll_hws,
  209. };
  210. static SPRD_SC_GATE_CLK_FW_NAME(audio_gate, "audio-gate", "ext-26m",
  211. 0x4, 0x1000, BIT(8), 0, 0);
  212. static SPRD_PLL_FW_NAME(rpll, "rpll", "ext-26m", 0x10,
  213. 3, itable, f_lpll, 240, 1000, 1000, 0, 0);
  214. static CLK_FIXED_FACTOR_HW(rpll_390m, "rpll-390m", &rpll.common.hw, 2, 1, 0);
  215. static CLK_FIXED_FACTOR_HW(rpll_260m, "rpll-260m", &rpll.common.hw, 3, 1, 0);
  216. static CLK_FIXED_FACTOR_HW(rpll_195m, "rpll-195m", &rpll.common.hw, 4, 1, 0);
  217. static CLK_FIXED_FACTOR_HW(rpll_26m, "rpll-26m", &rpll.common.hw, 30, 1, 0);
  218. static struct sprd_clk_common *sc9863a_rpll_clks[] = {
  219. /* address base is 0x4035c000 */
  220. &audio_gate.common,
  221. &rpll.common,
  222. };
  223. static struct clk_hw_onecell_data sc9863a_rpll_hws = {
  224. .hws = {
  225. [CLK_AUDIO_GATE] = &audio_gate.common.hw,
  226. [CLK_RPLL] = &rpll.common.hw,
  227. [CLK_RPLL_390M] = &rpll_390m.hw,
  228. [CLK_RPLL_260M] = &rpll_260m.hw,
  229. [CLK_RPLL_195M] = &rpll_195m.hw,
  230. [CLK_RPLL_26M] = &rpll_26m.hw,
  231. },
  232. .num = CLK_ANLG_PHY_G5_NUM,
  233. };
  234. static const struct sprd_clk_desc sc9863a_rpll_desc = {
  235. .clk_clks = sc9863a_rpll_clks,
  236. .num_clk_clks = ARRAY_SIZE(sc9863a_rpll_clks),
  237. .hw_clks = &sc9863a_rpll_hws,
  238. };
  239. static const u64 itable_dpll[5] = {4, 1211000000, 1320000000, 1570000000,
  240. 1866000000};
  241. static SPRD_PLL_HW(dpll0, "dpll0", &dpll0_gate.common.hw, 0x0, 3, itable_dpll,
  242. f_lpll, 240, 1000, 1000, 0, 0);
  243. static SPRD_PLL_HW(dpll1, "dpll1", &dpll1_gate.common.hw, 0x18, 3, itable_dpll,
  244. f_lpll, 240, 1000, 1000, 0, 0);
  245. static CLK_FIXED_FACTOR_HW(dpll0_933m, "dpll0-933m", &dpll0.common.hw, 2, 1, 0);
  246. static CLK_FIXED_FACTOR_HW(dpll0_622m3, "dpll0-622m3", &dpll0.common.hw, 3, 1, 0);
  247. static CLK_FIXED_FACTOR_HW(dpll1_400m, "dpll1-400m", &dpll0.common.hw, 4, 1, 0);
  248. static CLK_FIXED_FACTOR_HW(dpll1_266m7, "dpll1-266m7", &dpll0.common.hw, 6, 1, 0);
  249. static CLK_FIXED_FACTOR_HW(dpll1_123m1, "dpll1-123m1", &dpll0.common.hw, 13, 1, 0);
  250. static CLK_FIXED_FACTOR_HW(dpll1_50m, "dpll1-50m", &dpll0.common.hw, 32, 1, 0);
  251. static struct sprd_clk_common *sc9863a_dpll_clks[] = {
  252. /* address base is 0x40363000 */
  253. &dpll0.common,
  254. &dpll1.common,
  255. };
  256. static struct clk_hw_onecell_data sc9863a_dpll_hws = {
  257. .hws = {
  258. [CLK_DPLL0] = &dpll0.common.hw,
  259. [CLK_DPLL1] = &dpll1.common.hw,
  260. [CLK_DPLL0_933M] = &dpll0_933m.hw,
  261. [CLK_DPLL0_622M3] = &dpll0_622m3.hw,
  262. [CLK_DPLL0_400M] = &dpll1_400m.hw,
  263. [CLK_DPLL0_266M7] = &dpll1_266m7.hw,
  264. [CLK_DPLL0_123M1] = &dpll1_123m1.hw,
  265. [CLK_DPLL0_50M] = &dpll1_50m.hw,
  266. },
  267. .num = CLK_ANLG_PHY_G7_NUM,
  268. };
  269. static const struct sprd_clk_desc sc9863a_dpll_desc = {
  270. .clk_clks = sc9863a_dpll_clks,
  271. .num_clk_clks = ARRAY_SIZE(sc9863a_dpll_clks),
  272. .hw_clks = &sc9863a_dpll_hws,
  273. };
  274. static CLK_FIXED_FACTOR_FW_NAME(clk_6m5, "clk-6m5", "ext-26m", 4, 1, 0);
  275. static CLK_FIXED_FACTOR_FW_NAME(clk_4m3, "clk-4m3", "ext-26m", 6, 1, 0);
  276. static CLK_FIXED_FACTOR_FW_NAME(clk_2m, "clk-2m", "ext-26m", 13, 1, 0);
  277. static CLK_FIXED_FACTOR_FW_NAME(clk_250k, "clk-250k", "ext-26m", 104, 1, 0);
  278. static CLK_FIXED_FACTOR_FW_NAME(rco_25m, "rco-25m", "rco-100m", 4, 1, 0);
  279. static CLK_FIXED_FACTOR_FW_NAME(rco_4m, "rco-4m", "rco-100m", 25, 1, 0);
  280. static CLK_FIXED_FACTOR_FW_NAME(rco_2m, "rco-2m", "rco-100m", 50, 1, 0);
  281. #define SC9863A_MUX_FLAG \
  282. (CLK_GET_RATE_NOCACHE | CLK_SET_RATE_NO_REPARENT)
  283. static CLK_FIXED_FACTOR_FW_NAME(clk_13m, "clk-13m", "ext-26m", 2, 1, 0);
  284. static const struct clk_parent_data emc_clk_parents[] = {
  285. { .fw_name = "ext-26m" },
  286. { .hw = &twpll_384m.hw },
  287. { .hw = &twpll_512m.hw },
  288. { .hw = &twpll_768m.hw },
  289. { .hw = &twpll.common.hw },
  290. };
  291. static SPRD_MUX_CLK_DATA(emc_clk, "emc-clk", emc_clk_parents, 0x220,
  292. 0, 3, SC9863A_MUX_FLAG);
  293. static const struct clk_parent_data aon_apb_parents[] = {
  294. { .hw = &rco_4m.hw },
  295. { .hw = &rco_25m.hw },
  296. { .fw_name = "ext-26m" },
  297. { .hw = &twpll_96m.hw },
  298. { .fw_name = "rco-100m" },
  299. { .hw = &twpll_128m.hw },
  300. };
  301. static SPRD_COMP_CLK_DATA(aon_apb, "aon-apb", aon_apb_parents, 0x224,
  302. 0, 3, 8, 2, 0);
  303. static const struct clk_parent_data adi_parents[] = {
  304. { .hw = &rco_4m.hw },
  305. { .hw = &rco_25m.hw },
  306. { .fw_name = "ext-26m" },
  307. { .hw = &twpll_38m4.hw },
  308. { .hw = &twpll_51m2.hw },
  309. };
  310. static SPRD_MUX_CLK_DATA(adi_clk, "adi-clk", adi_parents, 0x228,
  311. 0, 3, SC9863A_MUX_FLAG);
  312. static const struct clk_parent_data aux_parents[] = {
  313. { .fw_name = "ext-32k" },
  314. { .hw = &rpll_26m.hw },
  315. { .fw_name = "ext-26m" },
  316. };
  317. static SPRD_COMP_CLK_DATA(aux0_clk, "aux0-clk", aux_parents, 0x22c,
  318. 0, 5, 8, 4, 0);
  319. static SPRD_COMP_CLK_DATA(aux1_clk, "aux1-clk", aux_parents, 0x230,
  320. 0, 5, 8, 4, 0);
  321. static SPRD_COMP_CLK_DATA(aux2_clk, "aux2-clk", aux_parents, 0x234,
  322. 0, 5, 8, 4, 0);
  323. static SPRD_COMP_CLK_DATA(probe_clk, "probe-clk", aux_parents, 0x238,
  324. 0, 5, 8, 4, 0);
  325. static const struct clk_parent_data pwm_parents[] = {
  326. { .fw_name = "ext-32k" },
  327. { .hw = &rpll_26m.hw },
  328. { .fw_name = "ext-26m" },
  329. { .hw = &twpll_48m.hw },
  330. };
  331. static SPRD_MUX_CLK_DATA(pwm0_clk, "pwm0-clk", pwm_parents, 0x23c,
  332. 0, 2, SC9863A_MUX_FLAG);
  333. static SPRD_MUX_CLK_DATA(pwm1_clk, "pwm1-clk", pwm_parents, 0x240,
  334. 0, 2, SC9863A_MUX_FLAG);
  335. static SPRD_MUX_CLK_DATA(pwm2_clk, "pwm2-clk", pwm_parents, 0x244,
  336. 0, 2, SC9863A_MUX_FLAG);
  337. static const struct clk_parent_data aon_thm_parents[] = {
  338. { .fw_name = "ext-32k" },
  339. { .hw = &clk_250k.hw },
  340. };
  341. static SPRD_MUX_CLK_DATA(aon_thm_clk, "aon-thm-clk", aon_thm_parents, 0x25c,
  342. 0, 1, SC9863A_MUX_FLAG);
  343. static const struct clk_parent_data audif_parents[] = {
  344. { .fw_name = "ext-26m" },
  345. { .hw = &twpll_38m4.hw },
  346. { .hw = &twpll_51m2.hw },
  347. };
  348. static SPRD_MUX_CLK_DATA(audif_clk, "audif-clk", audif_parents, 0x264,
  349. 0, 2, SC9863A_MUX_FLAG);
  350. static const struct clk_parent_data cpu_dap_parents[] = {
  351. { .hw = &rco_4m.hw },
  352. { .hw = &rco_25m.hw },
  353. { .fw_name = "ext-26m" },
  354. { .hw = &twpll_76m8.hw },
  355. { .fw_name = "rco-100m" },
  356. { .hw = &twpll_128m.hw },
  357. { .hw = &twpll_153m6.hw },
  358. };
  359. static SPRD_MUX_CLK_DATA(cpu_dap_clk, "cpu-dap-clk", cpu_dap_parents, 0x26c,
  360. 0, 3, SC9863A_MUX_FLAG);
  361. static const struct clk_parent_data cpu_ts_parents[] = {
  362. { .fw_name = "ext-32k" },
  363. { .fw_name = "ext-26m" },
  364. { .hw = &twpll_128m.hw },
  365. { .hw = &twpll_153m6.hw },
  366. };
  367. static SPRD_MUX_CLK_DATA(cpu_ts_clk, "cpu-ts-clk", cpu_ts_parents, 0x274,
  368. 0, 2, SC9863A_MUX_FLAG);
  369. static const struct clk_parent_data djtag_tck_parents[] = {
  370. { .hw = &rco_4m.hw },
  371. { .fw_name = "ext-26m" },
  372. };
  373. static SPRD_MUX_CLK_DATA(djtag_tck_clk, "djtag-tck-clk", djtag_tck_parents, 0x28c,
  374. 0, 1, SC9863A_MUX_FLAG);
  375. static const struct clk_parent_data emc_ref_parents[] = {
  376. { .hw = &clk_6m5.hw },
  377. { .hw = &clk_13m.hw },
  378. { .fw_name = "ext-26m" },
  379. };
  380. static SPRD_MUX_CLK_DATA(emc_ref_clk, "emc-ref-clk", emc_ref_parents, 0x29c,
  381. 0, 2, SC9863A_MUX_FLAG);
  382. static const struct clk_parent_data cssys_parents[] = {
  383. { .hw = &rco_4m.hw },
  384. { .fw_name = "ext-26m" },
  385. { .hw = &twpll_96m.hw },
  386. { .fw_name = "rco-100m" },
  387. { .hw = &twpll_128m.hw },
  388. { .hw = &twpll_153m6.hw },
  389. { .hw = &twpll_384m.hw },
  390. { .hw = &twpll_512m.hw },
  391. { .hw = &mpll2_675m.hw },
  392. };
  393. static SPRD_COMP_CLK_DATA(cssys_clk, "cssys-clk", cssys_parents, 0x2a0,
  394. 0, 4, 8, 2, 0);
  395. static const struct clk_parent_data aon_pmu_parents[] = {
  396. { .fw_name = "ext-32k" },
  397. { .hw = &rco_4m.hw },
  398. { .fw_name = "ext-4m" },
  399. };
  400. static SPRD_MUX_CLK_DATA(aon_pmu_clk, "aon-pmu-clk", aon_pmu_parents, 0x2a8,
  401. 0, 2, SC9863A_MUX_FLAG);
  402. static const struct clk_parent_data pmu_26m_parents[] = {
  403. { .hw = &rco_4m.hw },
  404. { .hw = &rco_25m.hw },
  405. { .fw_name = "ext-26m" },
  406. };
  407. static SPRD_MUX_CLK_DATA(pmu_26m_clk, "26m-pmu-clk", pmu_26m_parents, 0x2ac,
  408. 0, 2, SC9863A_MUX_FLAG);
  409. static const struct clk_parent_data aon_tmr_parents[] = {
  410. { .hw = &rco_4m.hw },
  411. { .fw_name = "ext-26m" },
  412. };
  413. static SPRD_MUX_CLK_DATA(aon_tmr_clk, "aon-tmr-clk", aon_tmr_parents, 0x2b0,
  414. 0, 1, SC9863A_MUX_FLAG);
  415. static const struct clk_parent_data power_cpu_parents[] = {
  416. { .fw_name = "ext-26m" },
  417. { .hw = &rco_25m.hw },
  418. { .fw_name = "rco-100m" },
  419. { .hw = &twpll_128m.hw },
  420. };
  421. static SPRD_MUX_CLK_DATA(power_cpu_clk, "power-cpu-clk", power_cpu_parents, 0x2c4,
  422. 0, 2, SC9863A_MUX_FLAG);
  423. static const struct clk_parent_data ap_axi_parents[] = {
  424. { .fw_name = "ext-26m" },
  425. { .hw = &twpll_76m8.hw },
  426. { .hw = &twpll_128m.hw },
  427. { .hw = &twpll_256m.hw },
  428. };
  429. static SPRD_MUX_CLK_DATA(ap_axi, "ap-axi", ap_axi_parents, 0x2c8,
  430. 0, 2, SC9863A_MUX_FLAG);
  431. static const struct clk_parent_data sdio_parents[] = {
  432. { .fw_name = "ext-26m" },
  433. { .hw = &twpll_307m2.hw },
  434. { .hw = &twpll_384m.hw },
  435. { .hw = &rpll_390m.hw },
  436. { .hw = &dpll1_400m.hw },
  437. { .hw = &lpll_409m6.hw },
  438. };
  439. static SPRD_MUX_CLK_DATA(sdio0_2x, "sdio0-2x", sdio_parents, 0x2cc,
  440. 0, 3, SC9863A_MUX_FLAG);
  441. static SPRD_MUX_CLK_DATA(sdio1_2x, "sdio1-2x", sdio_parents, 0x2d4,
  442. 0, 3, SC9863A_MUX_FLAG);
  443. static SPRD_MUX_CLK_DATA(sdio2_2x, "sdio2-2x", sdio_parents, 0x2dc,
  444. 0, 3, SC9863A_MUX_FLAG);
  445. static SPRD_MUX_CLK_DATA(emmc_2x, "emmc-2x", sdio_parents, 0x2e4,
  446. 0, 3, SC9863A_MUX_FLAG);
  447. static const struct clk_parent_data dpu_parents[] = {
  448. { .hw = &twpll_153m6.hw },
  449. { .hw = &twpll_192m.hw },
  450. { .hw = &twpll_256m.hw },
  451. { .hw = &twpll_384m.hw },
  452. };
  453. static SPRD_MUX_CLK_DATA(dpu_clk, "dpu", dpu_parents, 0x2f4,
  454. 0, 2, SC9863A_MUX_FLAG);
  455. static const struct clk_parent_data dpu_dpi_parents[] = {
  456. { .hw = &twpll_128m.hw },
  457. { .hw = &twpll_153m6.hw },
  458. { .hw = &twpll_192m.hw },
  459. };
  460. static SPRD_COMP_CLK_DATA(dpu_dpi, "dpu-dpi", dpu_dpi_parents, 0x2f8,
  461. 0, 2, 8, 4, 0);
  462. static const struct clk_parent_data otg_ref_parents[] = {
  463. { .hw = &twpll_12m.hw },
  464. { .fw_name = "ext-26m" },
  465. };
  466. static SPRD_MUX_CLK_DATA(otg_ref_clk, "otg-ref-clk", otg_ref_parents, 0x308,
  467. 0, 1, SC9863A_MUX_FLAG);
  468. static const struct clk_parent_data sdphy_apb_parents[] = {
  469. { .fw_name = "ext-26m" },
  470. { .hw = &twpll_48m.hw },
  471. };
  472. static SPRD_MUX_CLK_DATA(sdphy_apb_clk, "sdphy-apb-clk", sdphy_apb_parents, 0x330,
  473. 0, 1, SC9863A_MUX_FLAG);
  474. static const struct clk_parent_data alg_io_apb_parents[] = {
  475. { .hw = &rco_4m.hw },
  476. { .fw_name = "ext-26m" },
  477. { .hw = &twpll_48m.hw },
  478. { .hw = &twpll_96m.hw },
  479. };
  480. static SPRD_MUX_CLK_DATA(alg_io_apb_clk, "alg-io-apb-clk", alg_io_apb_parents, 0x33c,
  481. 0, 1, SC9863A_MUX_FLAG);
  482. static const struct clk_parent_data gpu_parents[] = {
  483. { .hw = &twpll_153m6.hw },
  484. { .hw = &twpll_192m.hw },
  485. { .hw = &twpll_256m.hw },
  486. { .hw = &twpll_307m2.hw },
  487. { .hw = &twpll_384m.hw },
  488. { .hw = &twpll_512m.hw },
  489. { .hw = &gpll.common.hw },
  490. };
  491. static SPRD_COMP_CLK_DATA(gpu_core, "gpu-core", gpu_parents, 0x344,
  492. 0, 3, 8, 2, 0);
  493. static SPRD_COMP_CLK_DATA(gpu_soc, "gpu-soc", gpu_parents, 0x348,
  494. 0, 3, 8, 2, 0);
  495. static const struct clk_parent_data mm_emc_parents[] = {
  496. { .fw_name = "ext-26m" },
  497. { .hw = &twpll_384m.hw },
  498. { .hw = &isppll_468m.hw },
  499. { .hw = &twpll_512m.hw },
  500. };
  501. static SPRD_MUX_CLK_DATA(mm_emc, "mm-emc", mm_emc_parents, 0x350,
  502. 0, 2, SC9863A_MUX_FLAG);
  503. static const struct clk_parent_data mm_ahb_parents[] = {
  504. { .fw_name = "ext-26m" },
  505. { .hw = &twpll_96m.hw },
  506. { .hw = &twpll_128m.hw },
  507. { .hw = &twpll_153m6.hw },
  508. };
  509. static SPRD_MUX_CLK_DATA(mm_ahb, "mm-ahb", mm_ahb_parents, 0x354,
  510. 0, 2, SC9863A_MUX_FLAG);
  511. static const struct clk_parent_data bpc_clk_parents[] = {
  512. { .hw = &twpll_192m.hw },
  513. { .hw = &twpll_307m2.hw },
  514. { .hw = &twpll_384m.hw },
  515. { .hw = &isppll_468m.hw },
  516. { .hw = &dpll0_622m3.hw },
  517. };
  518. static SPRD_MUX_CLK_DATA(bpc_clk, "bpc-clk", bpc_clk_parents, 0x358,
  519. 0, 3, SC9863A_MUX_FLAG);
  520. static const struct clk_parent_data dcam_if_parents[] = {
  521. { .hw = &twpll_192m.hw },
  522. { .hw = &twpll_256m.hw },
  523. { .hw = &twpll_307m2.hw },
  524. { .hw = &twpll_384m.hw },
  525. };
  526. static SPRD_MUX_CLK_DATA(dcam_if_clk, "dcam-if-clk", dcam_if_parents, 0x35c,
  527. 0, 2, SC9863A_MUX_FLAG);
  528. static const struct clk_parent_data isp_parents[] = {
  529. { .hw = &twpll_128m.hw },
  530. { .hw = &twpll_256m.hw },
  531. { .hw = &twpll_307m2.hw },
  532. { .hw = &twpll_384m.hw },
  533. { .hw = &isppll_468m.hw },
  534. };
  535. static SPRD_MUX_CLK_DATA(isp_clk, "isp-clk", isp_parents, 0x360,
  536. 0, 3, SC9863A_MUX_FLAG);
  537. static const struct clk_parent_data jpg_parents[] = {
  538. { .hw = &twpll_76m8.hw },
  539. { .hw = &twpll_128m.hw },
  540. { .hw = &twpll_256m.hw },
  541. { .hw = &twpll_307m2.hw },
  542. };
  543. static SPRD_MUX_CLK_DATA(jpg_clk, "jpg-clk", jpg_parents, 0x364,
  544. 0, 2, SC9863A_MUX_FLAG);
  545. static SPRD_MUX_CLK_DATA(cpp_clk, "cpp-clk", jpg_parents, 0x368,
  546. 0, 2, SC9863A_MUX_FLAG);
  547. static const struct clk_parent_data sensor_parents[] = {
  548. { .fw_name = "ext-26m" },
  549. { .hw = &twpll_48m.hw },
  550. { .hw = &twpll_76m8.hw },
  551. { .hw = &twpll_96m.hw },
  552. };
  553. static SPRD_COMP_CLK_DATA(sensor0_clk, "sensor0-clk", sensor_parents, 0x36c,
  554. 0, 2, 8, 3, 0);
  555. static SPRD_COMP_CLK_DATA(sensor1_clk, "sensor1-clk", sensor_parents, 0x370,
  556. 0, 2, 8, 3, 0);
  557. static SPRD_COMP_CLK_DATA(sensor2_clk, "sensor2-clk", sensor_parents, 0x374,
  558. 0, 2, 8, 3, 0);
  559. static const struct clk_parent_data mm_vemc_parents[] = {
  560. { .fw_name = "ext-26m" },
  561. { .hw = &twpll_307m2.hw },
  562. { .hw = &twpll_384m.hw },
  563. { .hw = &isppll_468m.hw },
  564. };
  565. static SPRD_MUX_CLK_DATA(mm_vemc, "mm-vemc", mm_vemc_parents, 0x378,
  566. 0, 2, SC9863A_MUX_FLAG);
  567. static SPRD_MUX_CLK_DATA(mm_vahb, "mm-vahb", mm_ahb_parents, 0x37c,
  568. 0, 2, SC9863A_MUX_FLAG);
  569. static const struct clk_parent_data vsp_parents[] = {
  570. { .hw = &twpll_76m8.hw },
  571. { .hw = &twpll_128m.hw },
  572. { .hw = &twpll_256m.hw },
  573. { .hw = &twpll_307m2.hw },
  574. { .hw = &twpll_384m.hw },
  575. };
  576. static SPRD_MUX_CLK_DATA(clk_vsp, "vsp-clk", vsp_parents, 0x380,
  577. 0, 3, SC9863A_MUX_FLAG);
  578. static const struct clk_parent_data core_parents[] = {
  579. { .fw_name = "ext-26m" },
  580. { .hw = &twpll_512m.hw },
  581. { .hw = &twpll_768m.hw },
  582. { .hw = &lpll.common.hw },
  583. { .hw = &dpll0.common.hw },
  584. { .hw = &mpll2.common.hw },
  585. { .hw = &mpll0.common.hw },
  586. { .hw = &mpll1.common.hw },
  587. };
  588. static SPRD_COMP_CLK_DATA(core0_clk, "core0-clk", core_parents, 0xa20,
  589. 0, 3, 8, 3, 0);
  590. static SPRD_COMP_CLK_DATA(core1_clk, "core1-clk", core_parents, 0xa24,
  591. 0, 3, 8, 3, 0);
  592. static SPRD_COMP_CLK_DATA(core2_clk, "core2-clk", core_parents, 0xa28,
  593. 0, 3, 8, 3, 0);
  594. static SPRD_COMP_CLK_DATA(core3_clk, "core3-clk", core_parents, 0xa2c,
  595. 0, 3, 8, 3, 0);
  596. static SPRD_COMP_CLK_DATA(core4_clk, "core4-clk", core_parents, 0xa30,
  597. 0, 3, 8, 3, 0);
  598. static SPRD_COMP_CLK_DATA(core5_clk, "core5-clk", core_parents, 0xa34,
  599. 0, 3, 8, 3, 0);
  600. static SPRD_COMP_CLK_DATA(core6_clk, "core6-clk", core_parents, 0xa38,
  601. 0, 3, 8, 3, 0);
  602. static SPRD_COMP_CLK_DATA(core7_clk, "core7-clk", core_parents, 0xa3c,
  603. 0, 3, 8, 3, 0);
  604. static SPRD_COMP_CLK_DATA(scu_clk, "scu-clk", core_parents, 0xa40,
  605. 0, 3, 8, 3, 0);
  606. static SPRD_DIV_CLK_HW(ace_clk, "ace-clk", &scu_clk.common.hw, 0xa44,
  607. 8, 3, 0);
  608. static SPRD_DIV_CLK_HW(axi_periph_clk, "axi-periph-clk", &scu_clk.common.hw, 0xa48,
  609. 8, 3, 0);
  610. static SPRD_DIV_CLK_HW(axi_acp_clk, "axi-acp-clk", &scu_clk.common.hw, 0xa4c,
  611. 8, 3, 0);
  612. static const struct clk_parent_data atb_parents[] = {
  613. { .fw_name = "ext-26m" },
  614. { .hw = &twpll_384m.hw },
  615. { .hw = &twpll_512m.hw },
  616. { .hw = &mpll2.common.hw },
  617. };
  618. static SPRD_COMP_CLK_DATA(atb_clk, "atb-clk", atb_parents, 0xa50,
  619. 0, 2, 8, 3, 0);
  620. static SPRD_DIV_CLK_HW(debug_apb_clk, "debug-apb-clk", &atb_clk.common.hw, 0xa54,
  621. 8, 3, 0);
  622. static const struct clk_parent_data gic_parents[] = {
  623. { .fw_name = "ext-26m" },
  624. { .hw = &twpll_153m6.hw },
  625. { .hw = &twpll_384m.hw },
  626. { .hw = &twpll_512m.hw },
  627. };
  628. static SPRD_COMP_CLK_DATA(gic_clk, "gic-clk", gic_parents, 0xa58,
  629. 0, 2, 8, 3, 0);
  630. static SPRD_COMP_CLK_DATA(periph_clk, "periph-clk", gic_parents, 0xa5c,
  631. 0, 2, 8, 3, 0);
  632. static struct sprd_clk_common *sc9863a_aon_clks[] = {
  633. /* address base is 0x402d0000 */
  634. &emc_clk.common,
  635. &aon_apb.common,
  636. &adi_clk.common,
  637. &aux0_clk.common,
  638. &aux1_clk.common,
  639. &aux2_clk.common,
  640. &probe_clk.common,
  641. &pwm0_clk.common,
  642. &pwm1_clk.common,
  643. &pwm2_clk.common,
  644. &aon_thm_clk.common,
  645. &audif_clk.common,
  646. &cpu_dap_clk.common,
  647. &cpu_ts_clk.common,
  648. &djtag_tck_clk.common,
  649. &emc_ref_clk.common,
  650. &cssys_clk.common,
  651. &aon_pmu_clk.common,
  652. &pmu_26m_clk.common,
  653. &aon_tmr_clk.common,
  654. &power_cpu_clk.common,
  655. &ap_axi.common,
  656. &sdio0_2x.common,
  657. &sdio1_2x.common,
  658. &sdio2_2x.common,
  659. &emmc_2x.common,
  660. &dpu_clk.common,
  661. &dpu_dpi.common,
  662. &otg_ref_clk.common,
  663. &sdphy_apb_clk.common,
  664. &alg_io_apb_clk.common,
  665. &gpu_core.common,
  666. &gpu_soc.common,
  667. &mm_emc.common,
  668. &mm_ahb.common,
  669. &bpc_clk.common,
  670. &dcam_if_clk.common,
  671. &isp_clk.common,
  672. &jpg_clk.common,
  673. &cpp_clk.common,
  674. &sensor0_clk.common,
  675. &sensor1_clk.common,
  676. &sensor2_clk.common,
  677. &mm_vemc.common,
  678. &mm_vahb.common,
  679. &clk_vsp.common,
  680. &core0_clk.common,
  681. &core1_clk.common,
  682. &core2_clk.common,
  683. &core3_clk.common,
  684. &core4_clk.common,
  685. &core5_clk.common,
  686. &core6_clk.common,
  687. &core7_clk.common,
  688. &scu_clk.common,
  689. &ace_clk.common,
  690. &axi_periph_clk.common,
  691. &axi_acp_clk.common,
  692. &atb_clk.common,
  693. &debug_apb_clk.common,
  694. &gic_clk.common,
  695. &periph_clk.common,
  696. };
  697. static struct clk_hw_onecell_data sc9863a_aon_clk_hws = {
  698. .hws = {
  699. [CLK_13M] = &clk_13m.hw,
  700. [CLK_6M5] = &clk_6m5.hw,
  701. [CLK_4M3] = &clk_4m3.hw,
  702. [CLK_2M] = &clk_2m.hw,
  703. [CLK_250K] = &clk_250k.hw,
  704. [CLK_RCO_25M] = &rco_25m.hw,
  705. [CLK_RCO_4M] = &rco_4m.hw,
  706. [CLK_RCO_2M] = &rco_2m.hw,
  707. [CLK_EMC] = &emc_clk.common.hw,
  708. [CLK_AON_APB] = &aon_apb.common.hw,
  709. [CLK_ADI] = &adi_clk.common.hw,
  710. [CLK_AUX0] = &aux0_clk.common.hw,
  711. [CLK_AUX1] = &aux1_clk.common.hw,
  712. [CLK_AUX2] = &aux2_clk.common.hw,
  713. [CLK_PROBE] = &probe_clk.common.hw,
  714. [CLK_PWM0] = &pwm0_clk.common.hw,
  715. [CLK_PWM1] = &pwm1_clk.common.hw,
  716. [CLK_PWM2] = &pwm2_clk.common.hw,
  717. [CLK_AON_THM] = &aon_thm_clk.common.hw,
  718. [CLK_AUDIF] = &audif_clk.common.hw,
  719. [CLK_CPU_DAP] = &cpu_dap_clk.common.hw,
  720. [CLK_CPU_TS] = &cpu_ts_clk.common.hw,
  721. [CLK_DJTAG_TCK] = &djtag_tck_clk.common.hw,
  722. [CLK_EMC_REF] = &emc_ref_clk.common.hw,
  723. [CLK_CSSYS] = &cssys_clk.common.hw,
  724. [CLK_AON_PMU] = &aon_pmu_clk.common.hw,
  725. [CLK_PMU_26M] = &pmu_26m_clk.common.hw,
  726. [CLK_AON_TMR] = &aon_tmr_clk.common.hw,
  727. [CLK_POWER_CPU] = &power_cpu_clk.common.hw,
  728. [CLK_AP_AXI] = &ap_axi.common.hw,
  729. [CLK_SDIO0_2X] = &sdio0_2x.common.hw,
  730. [CLK_SDIO1_2X] = &sdio1_2x.common.hw,
  731. [CLK_SDIO2_2X] = &sdio2_2x.common.hw,
  732. [CLK_EMMC_2X] = &emmc_2x.common.hw,
  733. [CLK_DPU] = &dpu_clk.common.hw,
  734. [CLK_DPU_DPI] = &dpu_dpi.common.hw,
  735. [CLK_OTG_REF] = &otg_ref_clk.common.hw,
  736. [CLK_SDPHY_APB] = &sdphy_apb_clk.common.hw,
  737. [CLK_ALG_IO_APB] = &alg_io_apb_clk.common.hw,
  738. [CLK_GPU_CORE] = &gpu_core.common.hw,
  739. [CLK_GPU_SOC] = &gpu_soc.common.hw,
  740. [CLK_MM_EMC] = &mm_emc.common.hw,
  741. [CLK_MM_AHB] = &mm_ahb.common.hw,
  742. [CLK_BPC] = &bpc_clk.common.hw,
  743. [CLK_DCAM_IF] = &dcam_if_clk.common.hw,
  744. [CLK_ISP] = &isp_clk.common.hw,
  745. [CLK_JPG] = &jpg_clk.common.hw,
  746. [CLK_CPP] = &cpp_clk.common.hw,
  747. [CLK_SENSOR0] = &sensor0_clk.common.hw,
  748. [CLK_SENSOR1] = &sensor1_clk.common.hw,
  749. [CLK_SENSOR2] = &sensor2_clk.common.hw,
  750. [CLK_MM_VEMC] = &mm_vemc.common.hw,
  751. [CLK_MM_VAHB] = &mm_vahb.common.hw,
  752. [CLK_VSP] = &clk_vsp.common.hw,
  753. [CLK_CORE0] = &core0_clk.common.hw,
  754. [CLK_CORE1] = &core1_clk.common.hw,
  755. [CLK_CORE2] = &core2_clk.common.hw,
  756. [CLK_CORE3] = &core3_clk.common.hw,
  757. [CLK_CORE4] = &core4_clk.common.hw,
  758. [CLK_CORE5] = &core5_clk.common.hw,
  759. [CLK_CORE6] = &core6_clk.common.hw,
  760. [CLK_CORE7] = &core7_clk.common.hw,
  761. [CLK_SCU] = &scu_clk.common.hw,
  762. [CLK_ACE] = &ace_clk.common.hw,
  763. [CLK_AXI_PERIPH] = &axi_periph_clk.common.hw,
  764. [CLK_AXI_ACP] = &axi_acp_clk.common.hw,
  765. [CLK_ATB] = &atb_clk.common.hw,
  766. [CLK_DEBUG_APB] = &debug_apb_clk.common.hw,
  767. [CLK_GIC] = &gic_clk.common.hw,
  768. [CLK_PERIPH] = &periph_clk.common.hw,
  769. },
  770. .num = CLK_AON_CLK_NUM,
  771. };
  772. static const struct sprd_clk_desc sc9863a_aon_clk_desc = {
  773. .clk_clks = sc9863a_aon_clks,
  774. .num_clk_clks = ARRAY_SIZE(sc9863a_aon_clks),
  775. .hw_clks = &sc9863a_aon_clk_hws,
  776. };
  777. static const struct clk_parent_data ap_apb_parents[] = {
  778. { .fw_name = "ext-26m" },
  779. { .hw = &twpll_64m.hw },
  780. { .hw = &twpll_96m.hw },
  781. { .hw = &twpll_128m.hw },
  782. };
  783. static SPRD_MUX_CLK_DATA(ap_apb, "ap-apb", ap_apb_parents, 0x20,
  784. 0, 2, SC9863A_MUX_FLAG);
  785. static const struct clk_parent_data ap_ce_parents[] = {
  786. { .fw_name = "ext-26m" },
  787. { .hw = &twpll_256m.hw },
  788. };
  789. static SPRD_COMP_CLK_DATA(ap_ce, "ap-ce", ap_ce_parents, 0x24,
  790. 0, 1, 8, 3, 0);
  791. static const struct clk_parent_data nandc_ecc_parents[] = {
  792. { .fw_name = "ext-26m" },
  793. { .hw = &twpll_256m.hw },
  794. { .hw = &twpll_307m2.hw },
  795. };
  796. static SPRD_COMP_CLK_DATA(nandc_ecc, "nandc-ecc", nandc_ecc_parents, 0x28,
  797. 0, 2, 8, 3, 0);
  798. static const struct clk_parent_data nandc_26m_parents[] = {
  799. { .fw_name = "ext-32k" },
  800. { .fw_name = "ext-26m" },
  801. };
  802. static SPRD_MUX_CLK_DATA(nandc_26m, "nandc-26m", nandc_26m_parents, 0x2c,
  803. 0, 1, SC9863A_MUX_FLAG);
  804. static SPRD_MUX_CLK_DATA(emmc_32k, "emmc-32k", nandc_26m_parents, 0x30,
  805. 0, 1, SC9863A_MUX_FLAG);
  806. static SPRD_MUX_CLK_DATA(sdio0_32k, "sdio0-32k", nandc_26m_parents, 0x34,
  807. 0, 1, SC9863A_MUX_FLAG);
  808. static SPRD_MUX_CLK_DATA(sdio1_32k, "sdio1-32k", nandc_26m_parents, 0x38,
  809. 0, 1, SC9863A_MUX_FLAG);
  810. static SPRD_MUX_CLK_DATA(sdio2_32k, "sdio2-32k", nandc_26m_parents, 0x3c,
  811. 0, 1, SC9863A_MUX_FLAG);
  812. static SPRD_GATE_CLK_HW(otg_utmi, "otg-utmi", &aon_apb.common.hw, 0x40,
  813. BIT(16), 0, 0);
  814. static const struct clk_parent_data ap_uart_parents[] = {
  815. { .fw_name = "ext-26m" },
  816. { .hw = &twpll_48m.hw },
  817. { .hw = &twpll_51m2.hw },
  818. { .hw = &twpll_96m.hw },
  819. };
  820. static SPRD_COMP_CLK_DATA(ap_uart0, "ap-uart0", ap_uart_parents, 0x44,
  821. 0, 2, 8, 3, 0);
  822. static SPRD_COMP_CLK_DATA(ap_uart1, "ap-uart1", ap_uart_parents, 0x48,
  823. 0, 2, 8, 3, 0);
  824. static SPRD_COMP_CLK_DATA(ap_uart2, "ap-uart2", ap_uart_parents, 0x4c,
  825. 0, 2, 8, 3, 0);
  826. static SPRD_COMP_CLK_DATA(ap_uart3, "ap-uart3", ap_uart_parents, 0x50,
  827. 0, 2, 8, 3, 0);
  828. static SPRD_COMP_CLK_DATA(ap_uart4, "ap-uart4", ap_uart_parents, 0x54,
  829. 0, 2, 8, 3, 0);
  830. static const struct clk_parent_data i2c_parents[] = {
  831. { .fw_name = "ext-26m" },
  832. { .hw = &twpll_48m.hw },
  833. { .hw = &twpll_51m2.hw },
  834. { .hw = &twpll_153m6.hw },
  835. };
  836. static SPRD_COMP_CLK_DATA(ap_i2c0, "ap-i2c0", i2c_parents, 0x58,
  837. 0, 2, 8, 3, 0);
  838. static SPRD_COMP_CLK_DATA(ap_i2c1, "ap-i2c1", i2c_parents, 0x5c,
  839. 0, 2, 8, 3, 0);
  840. static SPRD_COMP_CLK_DATA(ap_i2c2, "ap-i2c2", i2c_parents, 0x60,
  841. 0, 2, 8, 3, 0);
  842. static SPRD_COMP_CLK_DATA(ap_i2c3, "ap-i2c3", i2c_parents, 0x64,
  843. 0, 2, 8, 3, 0);
  844. static SPRD_COMP_CLK_DATA(ap_i2c4, "ap-i2c4", i2c_parents, 0x68,
  845. 0, 2, 8, 3, 0);
  846. static SPRD_COMP_CLK_DATA(ap_i2c5, "ap-i2c5", i2c_parents, 0x6c,
  847. 0, 2, 8, 3, 0);
  848. static SPRD_COMP_CLK_DATA(ap_i2c6, "ap-i2c6", i2c_parents, 0x70,
  849. 0, 2, 8, 3, 0);
  850. static const struct clk_parent_data spi_parents[] = {
  851. { .fw_name = "ext-26m" },
  852. { .hw = &twpll_128m.hw },
  853. { .hw = &twpll_153m6.hw },
  854. { .hw = &twpll_192m.hw },
  855. };
  856. static SPRD_COMP_CLK_DATA(ap_spi0, "ap-spi0", spi_parents, 0x74,
  857. 0, 2, 8, 3, 0);
  858. static SPRD_COMP_CLK_DATA(ap_spi1, "ap-spi1", spi_parents, 0x78,
  859. 0, 2, 8, 3, 0);
  860. static SPRD_COMP_CLK_DATA(ap_spi2, "ap-spi2", spi_parents, 0x7c,
  861. 0, 2, 8, 3, 0);
  862. static SPRD_COMP_CLK_DATA(ap_spi3, "ap-spi3", spi_parents, 0x80,
  863. 0, 2, 8, 3, 0);
  864. static const struct clk_parent_data iis_parents[] = {
  865. { .fw_name = "ext-26m" },
  866. { .hw = &twpll_128m.hw },
  867. { .hw = &twpll_153m6.hw },
  868. };
  869. static SPRD_COMP_CLK_DATA(ap_iis0, "ap-iis0", iis_parents, 0x84,
  870. 0, 2, 8, 3, 0);
  871. static SPRD_COMP_CLK_DATA(ap_iis1, "ap-iis1", iis_parents, 0x88,
  872. 0, 2, 8, 3, 0);
  873. static SPRD_COMP_CLK_DATA(ap_iis2, "ap-iis2", iis_parents, 0x8c,
  874. 0, 2, 8, 3, 0);
  875. static const struct clk_parent_data sim0_parents[] = {
  876. { .fw_name = "ext-26m" },
  877. { .hw = &twpll_51m2.hw },
  878. { .hw = &twpll_64m.hw },
  879. { .hw = &twpll_96m.hw },
  880. { .hw = &twpll_128m.hw },
  881. };
  882. static SPRD_COMP_CLK_DATA(sim0, "sim0", sim0_parents, 0x90,
  883. 0, 3, 8, 3, 0);
  884. static const struct clk_parent_data sim0_32k_parents[] = {
  885. { .fw_name = "ext-32k" },
  886. { .fw_name = "ext-26m" },
  887. };
  888. static SPRD_MUX_CLK_DATA(sim0_32k, "sim0-32k", sim0_32k_parents, 0x94,
  889. 0, 1, SC9863A_MUX_FLAG);
  890. static struct sprd_clk_common *sc9863a_ap_clks[] = {
  891. /* address base is 0x21500000 */
  892. &ap_apb.common,
  893. &ap_ce.common,
  894. &nandc_ecc.common,
  895. &nandc_26m.common,
  896. &emmc_32k.common,
  897. &sdio0_32k.common,
  898. &sdio1_32k.common,
  899. &sdio2_32k.common,
  900. &otg_utmi.common,
  901. &ap_uart0.common,
  902. &ap_uart1.common,
  903. &ap_uart2.common,
  904. &ap_uart3.common,
  905. &ap_uart4.common,
  906. &ap_i2c0.common,
  907. &ap_i2c1.common,
  908. &ap_i2c2.common,
  909. &ap_i2c3.common,
  910. &ap_i2c4.common,
  911. &ap_i2c5.common,
  912. &ap_i2c6.common,
  913. &ap_spi0.common,
  914. &ap_spi1.common,
  915. &ap_spi2.common,
  916. &ap_spi3.common,
  917. &ap_iis0.common,
  918. &ap_iis1.common,
  919. &ap_iis2.common,
  920. &sim0.common,
  921. &sim0_32k.common,
  922. };
  923. static struct clk_hw_onecell_data sc9863a_ap_clk_hws = {
  924. .hws = {
  925. [CLK_AP_APB] = &ap_apb.common.hw,
  926. [CLK_AP_CE] = &ap_ce.common.hw,
  927. [CLK_NANDC_ECC] = &nandc_ecc.common.hw,
  928. [CLK_NANDC_26M] = &nandc_26m.common.hw,
  929. [CLK_EMMC_32K] = &emmc_32k.common.hw,
  930. [CLK_SDIO0_32K] = &sdio0_32k.common.hw,
  931. [CLK_SDIO1_32K] = &sdio1_32k.common.hw,
  932. [CLK_SDIO2_32K] = &sdio2_32k.common.hw,
  933. [CLK_OTG_UTMI] = &otg_utmi.common.hw,
  934. [CLK_AP_UART0] = &ap_uart0.common.hw,
  935. [CLK_AP_UART1] = &ap_uart1.common.hw,
  936. [CLK_AP_UART2] = &ap_uart2.common.hw,
  937. [CLK_AP_UART3] = &ap_uart3.common.hw,
  938. [CLK_AP_UART4] = &ap_uart4.common.hw,
  939. [CLK_AP_I2C0] = &ap_i2c0.common.hw,
  940. [CLK_AP_I2C1] = &ap_i2c1.common.hw,
  941. [CLK_AP_I2C2] = &ap_i2c2.common.hw,
  942. [CLK_AP_I2C3] = &ap_i2c3.common.hw,
  943. [CLK_AP_I2C4] = &ap_i2c4.common.hw,
  944. [CLK_AP_I2C5] = &ap_i2c5.common.hw,
  945. [CLK_AP_I2C6] = &ap_i2c6.common.hw,
  946. [CLK_AP_SPI0] = &ap_spi0.common.hw,
  947. [CLK_AP_SPI1] = &ap_spi1.common.hw,
  948. [CLK_AP_SPI2] = &ap_spi2.common.hw,
  949. [CLK_AP_SPI3] = &ap_spi3.common.hw,
  950. [CLK_AP_IIS0] = &ap_iis0.common.hw,
  951. [CLK_AP_IIS1] = &ap_iis1.common.hw,
  952. [CLK_AP_IIS2] = &ap_iis2.common.hw,
  953. [CLK_SIM0] = &sim0.common.hw,
  954. [CLK_SIM0_32K] = &sim0_32k.common.hw,
  955. },
  956. .num = CLK_AP_CLK_NUM,
  957. };
  958. static const struct sprd_clk_desc sc9863a_ap_clk_desc = {
  959. .clk_clks = sc9863a_ap_clks,
  960. .num_clk_clks = ARRAY_SIZE(sc9863a_ap_clks),
  961. .hw_clks = &sc9863a_ap_clk_hws,
  962. };
  963. static SPRD_SC_GATE_CLK_HW(otg_eb, "otg-eb", &ap_axi.common.hw, 0x0, 0x1000,
  964. BIT(4), 0, 0);
  965. static SPRD_SC_GATE_CLK_HW(dma_eb, "dma-eb", &ap_axi.common.hw, 0x0, 0x1000,
  966. BIT(5), 0, 0);
  967. static SPRD_SC_GATE_CLK_HW(ce_eb, "ce-eb", &ap_axi.common.hw, 0x0, 0x1000,
  968. BIT(6), 0, 0);
  969. static SPRD_SC_GATE_CLK_HW(nandc_eb, "nandc-eb", &ap_axi.common.hw, 0x0, 0x1000,
  970. BIT(7), 0, 0);
  971. static SPRD_SC_GATE_CLK_HW(sdio0_eb, "sdio0-eb", &ap_axi.common.hw, 0x0, 0x1000,
  972. BIT(8), 0, 0);
  973. static SPRD_SC_GATE_CLK_HW(sdio1_eb, "sdio1-eb", &ap_axi.common.hw, 0x0, 0x1000,
  974. BIT(9), 0, 0);
  975. static SPRD_SC_GATE_CLK_HW(sdio2_eb, "sdio2-eb", &ap_axi.common.hw, 0x0, 0x1000,
  976. BIT(10), 0, 0);
  977. static SPRD_SC_GATE_CLK_HW(emmc_eb, "emmc-eb", &ap_axi.common.hw, 0x0, 0x1000,
  978. BIT(11), 0, 0);
  979. static SPRD_SC_GATE_CLK_HW(emmc_32k_eb, "emmc-32k-eb", &ap_axi.common.hw, 0x0,
  980. 0x1000, BIT(27), 0, 0);
  981. static SPRD_SC_GATE_CLK_HW(sdio0_32k_eb, "sdio0-32k-eb", &ap_axi.common.hw, 0x0,
  982. 0x1000, BIT(28), 0, 0);
  983. static SPRD_SC_GATE_CLK_HW(sdio1_32k_eb, "sdio1-32k-eb", &ap_axi.common.hw, 0x0,
  984. 0x1000, BIT(29), 0, 0);
  985. static SPRD_SC_GATE_CLK_HW(sdio2_32k_eb, "sdio2-32k-eb", &ap_axi.common.hw, 0x0,
  986. 0x1000, BIT(30), 0, 0);
  987. static SPRD_SC_GATE_CLK_HW(nandc_26m_eb, "nandc-26m-eb", &ap_axi.common.hw, 0x0,
  988. 0x1000, BIT(31), 0, 0);
  989. static SPRD_SC_GATE_CLK_HW(dma_eb2, "dma-eb2", &ap_axi.common.hw, 0x18,
  990. 0x1000, BIT(0), 0, 0);
  991. static SPRD_SC_GATE_CLK_HW(ce_eb2, "ce-eb2", &ap_axi.common.hw, 0x18,
  992. 0x1000, BIT(1), 0, 0);
  993. static struct sprd_clk_common *sc9863a_apahb_gate_clks[] = {
  994. /* address base is 0x20e00000 */
  995. &otg_eb.common,
  996. &dma_eb.common,
  997. &ce_eb.common,
  998. &nandc_eb.common,
  999. &sdio0_eb.common,
  1000. &sdio1_eb.common,
  1001. &sdio2_eb.common,
  1002. &emmc_eb.common,
  1003. &emmc_32k_eb.common,
  1004. &sdio0_32k_eb.common,
  1005. &sdio1_32k_eb.common,
  1006. &sdio2_32k_eb.common,
  1007. &nandc_26m_eb.common,
  1008. &dma_eb2.common,
  1009. &ce_eb2.common,
  1010. };
  1011. static struct clk_hw_onecell_data sc9863a_apahb_gate_hws = {
  1012. .hws = {
  1013. [CLK_OTG_EB] = &otg_eb.common.hw,
  1014. [CLK_DMA_EB] = &dma_eb.common.hw,
  1015. [CLK_CE_EB] = &ce_eb.common.hw,
  1016. [CLK_NANDC_EB] = &nandc_eb.common.hw,
  1017. [CLK_SDIO0_EB] = &sdio0_eb.common.hw,
  1018. [CLK_SDIO1_EB] = &sdio1_eb.common.hw,
  1019. [CLK_SDIO2_EB] = &sdio2_eb.common.hw,
  1020. [CLK_EMMC_EB] = &emmc_eb.common.hw,
  1021. [CLK_EMMC_32K_EB] = &emmc_32k_eb.common.hw,
  1022. [CLK_SDIO0_32K_EB] = &sdio0_32k_eb.common.hw,
  1023. [CLK_SDIO1_32K_EB] = &sdio1_32k_eb.common.hw,
  1024. [CLK_SDIO2_32K_EB] = &sdio2_32k_eb.common.hw,
  1025. [CLK_NANDC_26M_EB] = &nandc_26m_eb.common.hw,
  1026. [CLK_DMA_EB2] = &dma_eb2.common.hw,
  1027. [CLK_CE_EB2] = &ce_eb2.common.hw,
  1028. },
  1029. .num = CLK_AP_AHB_GATE_NUM,
  1030. };
  1031. static const struct sprd_clk_desc sc9863a_apahb_gate_desc = {
  1032. .clk_clks = sc9863a_apahb_gate_clks,
  1033. .num_clk_clks = ARRAY_SIZE(sc9863a_apahb_gate_clks),
  1034. .hw_clks = &sc9863a_apahb_gate_hws,
  1035. };
  1036. /* aon gate clocks */
  1037. static SPRD_SC_GATE_CLK_HW(gpio_eb, "gpio-eb", &aon_apb.common.hw,
  1038. 0x0, 0x1000, BIT(3), 0, 0);
  1039. static SPRD_SC_GATE_CLK_HW(pwm0_eb, "pwm0-eb", &aon_apb.common.hw,
  1040. 0x0, 0x1000, BIT(4), 0, 0);
  1041. static SPRD_SC_GATE_CLK_HW(pwm1_eb, "pwm1-eb", &aon_apb.common.hw,
  1042. 0x0, 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
  1043. static SPRD_SC_GATE_CLK_HW(pwm2_eb, "pwm2-eb", &aon_apb.common.hw, 0x0,
  1044. 0x1000, BIT(6), 0, 0);
  1045. static SPRD_SC_GATE_CLK_HW(pwm3_eb, "pwm3-eb", &aon_apb.common.hw, 0x0,
  1046. 0x1000, BIT(7), 0, 0);
  1047. static SPRD_SC_GATE_CLK_HW(kpd_eb, "kpd-eb", &aon_apb.common.hw, 0x0,
  1048. 0x1000, BIT(8), 0, 0);
  1049. static SPRD_SC_GATE_CLK_HW(aon_syst_eb, "aon-syst-eb", &aon_apb.common.hw, 0x0,
  1050. 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
  1051. static SPRD_SC_GATE_CLK_HW(ap_syst_eb, "ap-syst-eb", &aon_apb.common.hw, 0x0,
  1052. 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
  1053. static SPRD_SC_GATE_CLK_HW(aon_tmr_eb, "aon-tmr-eb", &aon_apb.common.hw, 0x0,
  1054. 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
  1055. static SPRD_SC_GATE_CLK_HW(efuse_eb, "efuse-eb", &aon_apb.common.hw, 0x0,
  1056. 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0);
  1057. static SPRD_SC_GATE_CLK_HW(eic_eb, "eic-eb", &aon_apb.common.hw, 0x0,
  1058. 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1059. static SPRD_SC_GATE_CLK_HW(intc_eb, "intc-eb", &aon_apb.common.hw, 0x0,
  1060. 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1061. static SPRD_SC_GATE_CLK_HW(adi_eb, "adi-eb", &aon_apb.common.hw, 0x0,
  1062. 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1063. static SPRD_SC_GATE_CLK_HW(audif_eb, "audif-eb", &aon_apb.common.hw, 0x0,
  1064. 0x1000, BIT(17), 0, 0);
  1065. static SPRD_SC_GATE_CLK_HW(aud_eb, "aud-eb", &aon_apb.common.hw, 0x0,
  1066. 0x1000, BIT(18), 0, 0);
  1067. static SPRD_SC_GATE_CLK_HW(vbc_eb, "vbc-eb", &aon_apb.common.hw, 0x0,
  1068. 0x1000, BIT(19), 0, 0);
  1069. static SPRD_SC_GATE_CLK_HW(pin_eb, "pin-eb", &aon_apb.common.hw, 0x0,
  1070. 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
  1071. static SPRD_SC_GATE_CLK_HW(ap_wdg_eb, "ap-wdg-eb", &aon_apb.common.hw, 0x0,
  1072. 0x1000, BIT(24), 0, 0);
  1073. static SPRD_SC_GATE_CLK_HW(mm_eb, "mm-eb", &aon_apb.common.hw, 0x0,
  1074. 0x1000, BIT(25), CLK_IGNORE_UNUSED, 0);
  1075. static SPRD_SC_GATE_CLK_HW(aon_apb_ckg_eb, "aon-apb-ckg-eb", &aon_apb.common.hw,
  1076. 0x0, 0x1000, BIT(26), CLK_IGNORE_UNUSED, 0);
  1077. static SPRD_SC_GATE_CLK_HW(ca53_ts0_eb, "ca53-ts0-eb", &aon_apb.common.hw,
  1078. 0x0, 0x1000, BIT(28), CLK_IGNORE_UNUSED, 0);
  1079. static SPRD_SC_GATE_CLK_HW(ca53_ts1_eb, "ca53-ts1-eb", &aon_apb.common.hw,
  1080. 0x0, 0x1000, BIT(29), CLK_IGNORE_UNUSED, 0);
  1081. static SPRD_SC_GATE_CLK_HW(ca53_dap_eb, "ca53-dap-eb", &aon_apb.common.hw,
  1082. 0x0, 0x1000, BIT(30), CLK_IGNORE_UNUSED, 0);
  1083. static SPRD_SC_GATE_CLK_HW(pmu_eb, "pmu-eb", &aon_apb.common.hw,
  1084. 0x4, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
  1085. static SPRD_SC_GATE_CLK_HW(thm_eb, "thm-eb", &aon_apb.common.hw,
  1086. 0x4, 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
  1087. static SPRD_SC_GATE_CLK_HW(aux0_eb, "aux0-eb", &aon_apb.common.hw,
  1088. 0x4, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
  1089. static SPRD_SC_GATE_CLK_HW(aux1_eb, "aux1-eb", &aon_apb.common.hw,
  1090. 0x4, 0x1000, BIT(3), 0, 0);
  1091. static SPRD_SC_GATE_CLK_HW(aux2_eb, "aux2-eb", &aon_apb.common.hw,
  1092. 0x4, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
  1093. static SPRD_SC_GATE_CLK_HW(probe_eb, "probe-eb", &aon_apb.common.hw,
  1094. 0x4, 0x1000, BIT(5), 0, 0);
  1095. static SPRD_SC_GATE_CLK_HW(emc_ref_eb, "emc-ref-eb", &aon_apb.common.hw,
  1096. 0x4, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
  1097. static SPRD_SC_GATE_CLK_HW(ca53_wdg_eb, "ca53-wdg-eb", &aon_apb.common.hw,
  1098. 0x4, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
  1099. static SPRD_SC_GATE_CLK_HW(ap_tmr1_eb, "ap-tmr1-eb", &aon_apb.common.hw,
  1100. 0x4, 0x1000, BIT(9), 0, 0);
  1101. static SPRD_SC_GATE_CLK_HW(ap_tmr2_eb, "ap-tmr2-eb", &aon_apb.common.hw,
  1102. 0x4, 0x1000, BIT(10), 0, 0);
  1103. static SPRD_SC_GATE_CLK_HW(disp_emc_eb, "disp-emc-eb", &aon_apb.common.hw,
  1104. 0x4, 0x1000, BIT(11), 0, 0);
  1105. static SPRD_SC_GATE_CLK_HW(zip_emc_eb, "zip-emc-eb", &aon_apb.common.hw,
  1106. 0x4, 0x1000, BIT(12), 0, 0);
  1107. static SPRD_SC_GATE_CLK_HW(gsp_emc_eb, "gsp-emc-eb", &aon_apb.common.hw,
  1108. 0x4, 0x1000, BIT(13), 0, 0);
  1109. static SPRD_SC_GATE_CLK_HW(mm_vsp_eb, "mm-vsp-eb", &aon_apb.common.hw,
  1110. 0x4, 0x1000, BIT(14), 0, 0);
  1111. static SPRD_SC_GATE_CLK_HW(mdar_eb, "mdar-eb", &aon_apb.common.hw,
  1112. 0x4, 0x1000, BIT(17), 0, 0);
  1113. static SPRD_SC_GATE_CLK_HW(rtc4m0_cal_eb, "rtc4m0-cal-eb", &aon_apb.common.hw,
  1114. 0x4, 0x1000, BIT(18), 0, 0);
  1115. static SPRD_SC_GATE_CLK_HW(rtc4m1_cal_eb, "rtc4m1-cal-eb", &aon_apb.common.hw,
  1116. 0x4, 0x1000, BIT(19), 0, 0);
  1117. static SPRD_SC_GATE_CLK_HW(djtag_eb, "djtag-eb", &aon_apb.common.hw,
  1118. 0x4, 0x1000, BIT(20), 0, 0);
  1119. static SPRD_SC_GATE_CLK_HW(mbox_eb, "mbox-eb", &aon_apb.common.hw,
  1120. 0x4, 0x1000, BIT(21), 0, 0);
  1121. static SPRD_SC_GATE_CLK_HW(aon_dma_eb, "aon-dma-eb", &aon_apb.common.hw,
  1122. 0x4, 0x1000, BIT(22), 0, 0);
  1123. static SPRD_SC_GATE_CLK_HW(aon_apb_def_eb, "aon-apb-def-eb", &aon_apb.common.hw,
  1124. 0x4, 0x1000, BIT(25), 0, 0);
  1125. static SPRD_SC_GATE_CLK_HW(ca5_ts0_eb, "ca5-ts0-eb", &aon_apb.common.hw,
  1126. 0x4, 0x1000, BIT(26), 0, 0);
  1127. static SPRD_SC_GATE_CLK_HW(dbg_eb, "dbg-eb", &aon_apb.common.hw,
  1128. 0x4, 0x1000, BIT(28), 0, 0);
  1129. static SPRD_SC_GATE_CLK_HW(dbg_emc_eb, "dbg-emc-eb", &aon_apb.common.hw,
  1130. 0x4, 0x1000, BIT(29), 0, 0);
  1131. static SPRD_SC_GATE_CLK_HW(cross_trig_eb, "cross-trig-eb", &aon_apb.common.hw,
  1132. 0x4, 0x1000, BIT(30), 0, 0);
  1133. static SPRD_SC_GATE_CLK_HW(serdes_dphy_eb, "serdes-dphy-eb", &aon_apb.common.hw,
  1134. 0x4, 0x1000, BIT(31), 0, 0);
  1135. static SPRD_SC_GATE_CLK_HW(arch_rtc_eb, "arch-rtc-eb", &aon_apb.common.hw,
  1136. 0x10, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
  1137. static SPRD_SC_GATE_CLK_HW(kpd_rtc_eb, "kpd-rtc-eb", &aon_apb.common.hw,
  1138. 0x10, 0x1000, BIT(1), 0, 0);
  1139. static SPRD_SC_GATE_CLK_HW(aon_syst_rtc_eb, "aon-syst-rtc-eb", &aon_apb.common.hw,
  1140. 0x10, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
  1141. static SPRD_SC_GATE_CLK_HW(ap_syst_rtc_eb, "ap-syst-rtc-eb", &aon_apb.common.hw,
  1142. 0x10, 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0);
  1143. static SPRD_SC_GATE_CLK_HW(aon_tmr_rtc_eb, "aon-tmr-rtc-eb", &aon_apb.common.hw,
  1144. 0x10, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
  1145. static SPRD_SC_GATE_CLK_HW(ap_tmr0_rtc_eb, "ap-tmr0-rtc-eb", &aon_apb.common.hw,
  1146. 0x10, 0x1000, BIT(5), 0, 0);
  1147. static SPRD_SC_GATE_CLK_HW(eic_rtc_eb, "eic-rtc-eb", &aon_apb.common.hw,
  1148. 0x10, 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0);
  1149. static SPRD_SC_GATE_CLK_HW(eic_rtcdv5_eb, "eic-rtcdv5-eb", &aon_apb.common.hw,
  1150. 0x10, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
  1151. static SPRD_SC_GATE_CLK_HW(ap_wdg_rtc_eb, "ap-wdg-rtc-eb", &aon_apb.common.hw,
  1152. 0x10, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
  1153. static SPRD_SC_GATE_CLK_HW(ca53_wdg_rtc_eb, "ca53-wdg-rtc-eb", &aon_apb.common.hw,
  1154. 0x10, 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
  1155. static SPRD_SC_GATE_CLK_HW(thm_rtc_eb, "thm-rtc-eb", &aon_apb.common.hw,
  1156. 0x10, 0x1000, BIT(10), 0, 0);
  1157. static SPRD_SC_GATE_CLK_HW(athma_rtc_eb, "athma-rtc-eb", &aon_apb.common.hw,
  1158. 0x10, 0x1000, BIT(11), 0, 0);
  1159. static SPRD_SC_GATE_CLK_HW(gthma_rtc_eb, "gthma-rtc-eb", &aon_apb.common.hw,
  1160. 0x10, 0x1000, BIT(12), 0, 0);
  1161. static SPRD_SC_GATE_CLK_HW(athma_rtc_a_eb, "athma-rtc-a-eb", &aon_apb.common.hw,
  1162. 0x10, 0x1000, BIT(13), 0, 0);
  1163. static SPRD_SC_GATE_CLK_HW(gthma_rtc_a_eb, "gthma-rtc-a-eb", &aon_apb.common.hw,
  1164. 0x10, 0x1000, BIT(14), 0, 0);
  1165. static SPRD_SC_GATE_CLK_HW(ap_tmr1_rtc_eb, "ap-tmr1-rtc-eb", &aon_apb.common.hw,
  1166. 0x10, 0x1000, BIT(15), 0, 0);
  1167. static SPRD_SC_GATE_CLK_HW(ap_tmr2_rtc_eb, "ap-tmr2-rtc-eb", &aon_apb.common.hw,
  1168. 0x10, 0x1000, BIT(16), 0, 0);
  1169. static SPRD_SC_GATE_CLK_HW(dxco_lc_rtc_eb, "dxco-lc-rtc-eb", &aon_apb.common.hw,
  1170. 0x10, 0x1000, BIT(17), 0, 0);
  1171. static SPRD_SC_GATE_CLK_HW(bb_cal_rtc_eb, "bb-cal-rtc-eb", &aon_apb.common.hw,
  1172. 0x10, 0x1000, BIT(18), 0, 0);
  1173. static SPRD_SC_GATE_CLK_HW(gpu_eb, "gpu-eb", &aon_apb.common.hw, 0x50,
  1174. 0x1000, BIT(0), 0, 0);
  1175. static SPRD_SC_GATE_CLK_HW(disp_eb, "disp-eb", &aon_apb.common.hw, 0x50,
  1176. 0x1000, BIT(2), 0, 0);
  1177. static SPRD_SC_GATE_CLK_HW(mm_emc_eb, "mm-emc-eb", &aon_apb.common.hw, 0x50,
  1178. 0x1000, BIT(3), 0, 0);
  1179. static SPRD_SC_GATE_CLK_HW(power_cpu_eb, "power-cpu-eb", &aon_apb.common.hw, 0x50,
  1180. 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
  1181. static SPRD_SC_GATE_CLK_HW(hw_i2c_eb, "hw-i2c-eb", &aon_apb.common.hw, 0x50,
  1182. 0x1000, BIT(11), 0, 0);
  1183. static SPRD_SC_GATE_CLK_HW(mm_vsp_emc_eb, "mm-vsp-emc-eb", &aon_apb.common.hw, 0x50,
  1184. 0x1000, BIT(14), 0, 0);
  1185. static SPRD_SC_GATE_CLK_HW(vsp_eb, "vsp-eb", &aon_apb.common.hw, 0x50,
  1186. 0x1000, BIT(16), 0, 0);
  1187. static SPRD_SC_GATE_CLK_HW(cssys_eb, "cssys-eb", &aon_apb.common.hw, 0xb0,
  1188. 0x1000, BIT(4), 0, 0);
  1189. static SPRD_SC_GATE_CLK_HW(dmc_eb, "dmc-eb", &aon_apb.common.hw, 0xb0,
  1190. 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
  1191. static SPRD_SC_GATE_CLK_HW(rosc_eb, "rosc-eb", &aon_apb.common.hw, 0xb0,
  1192. 0x1000, BIT(7), 0, 0);
  1193. static SPRD_SC_GATE_CLK_HW(s_d_cfg_eb, "s-d-cfg-eb", &aon_apb.common.hw, 0xb0,
  1194. 0x1000, BIT(8), 0, 0);
  1195. static SPRD_SC_GATE_CLK_HW(s_d_ref_eb, "s-d-ref-eb", &aon_apb.common.hw, 0xb0,
  1196. 0x1000, BIT(9), 0, 0);
  1197. static SPRD_SC_GATE_CLK_HW(b_dma_eb, "b-dma-eb", &aon_apb.common.hw, 0xb0,
  1198. 0x1000, BIT(10), 0, 0);
  1199. static SPRD_SC_GATE_CLK_HW(anlg_eb, "anlg-eb", &aon_apb.common.hw, 0xb0,
  1200. 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
  1201. static SPRD_SC_GATE_CLK_HW(anlg_apb_eb, "anlg-apb-eb", &aon_apb.common.hw, 0xb0,
  1202. 0x1000, BIT(13), 0, 0);
  1203. static SPRD_SC_GATE_CLK_HW(bsmtmr_eb, "bsmtmr-eb", &aon_apb.common.hw, 0xb0,
  1204. 0x1000, BIT(14), 0, 0);
  1205. static SPRD_SC_GATE_CLK_HW(ap_axi_eb, "ap-axi-eb", &aon_apb.common.hw, 0xb0,
  1206. 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
  1207. static SPRD_SC_GATE_CLK_HW(ap_intc0_eb, "ap-intc0-eb", &aon_apb.common.hw, 0xb0,
  1208. 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
  1209. static SPRD_SC_GATE_CLK_HW(ap_intc1_eb, "ap-intc1-eb", &aon_apb.common.hw, 0xb0,
  1210. 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
  1211. static SPRD_SC_GATE_CLK_HW(ap_intc2_eb, "ap-intc2-eb", &aon_apb.common.hw, 0xb0,
  1212. 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0);
  1213. static SPRD_SC_GATE_CLK_HW(ap_intc3_eb, "ap-intc3-eb", &aon_apb.common.hw, 0xb0,
  1214. 0x1000, BIT(19), CLK_IGNORE_UNUSED, 0);
  1215. static SPRD_SC_GATE_CLK_HW(ap_intc4_eb, "ap-intc4-eb", &aon_apb.common.hw, 0xb0,
  1216. 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
  1217. static SPRD_SC_GATE_CLK_HW(ap_intc5_eb, "ap-intc5-eb", &aon_apb.common.hw, 0xb0,
  1218. 0x1000, BIT(21), CLK_IGNORE_UNUSED, 0);
  1219. static SPRD_SC_GATE_CLK_HW(scc_eb, "scc-eb", &aon_apb.common.hw, 0xb0,
  1220. 0x1000, BIT(22), 0, 0);
  1221. static SPRD_SC_GATE_CLK_HW(dphy_cfg_eb, "dphy-cfg-eb", &aon_apb.common.hw, 0xb0,
  1222. 0x1000, BIT(23), 0, 0);
  1223. static SPRD_SC_GATE_CLK_HW(dphy_ref_eb, "dphy-ref-eb", &aon_apb.common.hw, 0xb0,
  1224. 0x1000, BIT(24), 0, 0);
  1225. static SPRD_SC_GATE_CLK_HW(cphy_cfg_eb, "cphy-cfg-eb", &aon_apb.common.hw, 0xb0,
  1226. 0x1000, BIT(25), 0, 0);
  1227. static SPRD_SC_GATE_CLK_HW(otg_ref_eb, "otg-ref-eb", &aon_apb.common.hw, 0xb0,
  1228. 0x1000, BIT(26), 0, 0);
  1229. static SPRD_SC_GATE_CLK_HW(serdes_eb, "serdes-eb", &aon_apb.common.hw, 0xb0,
  1230. 0x1000, BIT(27), 0, 0);
  1231. static SPRD_SC_GATE_CLK_HW(aon_ap_emc_eb, "aon-ap-emc-eb", &aon_apb.common.hw, 0xb0,
  1232. 0x1000, BIT(28), 0, 0);
  1233. static struct sprd_clk_common *sc9863a_aonapb_gate_clks[] = {
  1234. /* address base is 0x402e0000 */
  1235. &gpio_eb.common,
  1236. &pwm0_eb.common,
  1237. &pwm1_eb.common,
  1238. &pwm2_eb.common,
  1239. &pwm3_eb.common,
  1240. &kpd_eb.common,
  1241. &aon_syst_eb.common,
  1242. &ap_syst_eb.common,
  1243. &aon_tmr_eb.common,
  1244. &efuse_eb.common,
  1245. &eic_eb.common,
  1246. &intc_eb.common,
  1247. &adi_eb.common,
  1248. &audif_eb.common,
  1249. &aud_eb.common,
  1250. &vbc_eb.common,
  1251. &pin_eb.common,
  1252. &ap_wdg_eb.common,
  1253. &mm_eb.common,
  1254. &aon_apb_ckg_eb.common,
  1255. &ca53_ts0_eb.common,
  1256. &ca53_ts1_eb.common,
  1257. &ca53_dap_eb.common,
  1258. &pmu_eb.common,
  1259. &thm_eb.common,
  1260. &aux0_eb.common,
  1261. &aux1_eb.common,
  1262. &aux2_eb.common,
  1263. &probe_eb.common,
  1264. &emc_ref_eb.common,
  1265. &ca53_wdg_eb.common,
  1266. &ap_tmr1_eb.common,
  1267. &ap_tmr2_eb.common,
  1268. &disp_emc_eb.common,
  1269. &zip_emc_eb.common,
  1270. &gsp_emc_eb.common,
  1271. &mm_vsp_eb.common,
  1272. &mdar_eb.common,
  1273. &rtc4m0_cal_eb.common,
  1274. &rtc4m1_cal_eb.common,
  1275. &djtag_eb.common,
  1276. &mbox_eb.common,
  1277. &aon_dma_eb.common,
  1278. &aon_apb_def_eb.common,
  1279. &ca5_ts0_eb.common,
  1280. &dbg_eb.common,
  1281. &dbg_emc_eb.common,
  1282. &cross_trig_eb.common,
  1283. &serdes_dphy_eb.common,
  1284. &arch_rtc_eb.common,
  1285. &kpd_rtc_eb.common,
  1286. &aon_syst_rtc_eb.common,
  1287. &ap_syst_rtc_eb.common,
  1288. &aon_tmr_rtc_eb.common,
  1289. &ap_tmr0_rtc_eb.common,
  1290. &eic_rtc_eb.common,
  1291. &eic_rtcdv5_eb.common,
  1292. &ap_wdg_rtc_eb.common,
  1293. &ca53_wdg_rtc_eb.common,
  1294. &thm_rtc_eb.common,
  1295. &athma_rtc_eb.common,
  1296. &gthma_rtc_eb.common,
  1297. &athma_rtc_a_eb.common,
  1298. &gthma_rtc_a_eb.common,
  1299. &ap_tmr1_rtc_eb.common,
  1300. &ap_tmr2_rtc_eb.common,
  1301. &dxco_lc_rtc_eb.common,
  1302. &bb_cal_rtc_eb.common,
  1303. &gpu_eb.common,
  1304. &disp_eb.common,
  1305. &mm_emc_eb.common,
  1306. &power_cpu_eb.common,
  1307. &hw_i2c_eb.common,
  1308. &mm_vsp_emc_eb.common,
  1309. &vsp_eb.common,
  1310. &cssys_eb.common,
  1311. &dmc_eb.common,
  1312. &rosc_eb.common,
  1313. &s_d_cfg_eb.common,
  1314. &s_d_ref_eb.common,
  1315. &b_dma_eb.common,
  1316. &anlg_eb.common,
  1317. &anlg_apb_eb.common,
  1318. &bsmtmr_eb.common,
  1319. &ap_axi_eb.common,
  1320. &ap_intc0_eb.common,
  1321. &ap_intc1_eb.common,
  1322. &ap_intc2_eb.common,
  1323. &ap_intc3_eb.common,
  1324. &ap_intc4_eb.common,
  1325. &ap_intc5_eb.common,
  1326. &scc_eb.common,
  1327. &dphy_cfg_eb.common,
  1328. &dphy_ref_eb.common,
  1329. &cphy_cfg_eb.common,
  1330. &otg_ref_eb.common,
  1331. &serdes_eb.common,
  1332. &aon_ap_emc_eb.common,
  1333. };
  1334. static struct clk_hw_onecell_data sc9863a_aonapb_gate_hws = {
  1335. .hws = {
  1336. [CLK_GPIO_EB] = &gpio_eb.common.hw,
  1337. [CLK_PWM0_EB] = &pwm0_eb.common.hw,
  1338. [CLK_PWM1_EB] = &pwm1_eb.common.hw,
  1339. [CLK_PWM2_EB] = &pwm2_eb.common.hw,
  1340. [CLK_PWM3_EB] = &pwm3_eb.common.hw,
  1341. [CLK_KPD_EB] = &kpd_eb.common.hw,
  1342. [CLK_AON_SYST_EB] = &aon_syst_eb.common.hw,
  1343. [CLK_AP_SYST_EB] = &ap_syst_eb.common.hw,
  1344. [CLK_AON_TMR_EB] = &aon_tmr_eb.common.hw,
  1345. [CLK_EFUSE_EB] = &efuse_eb.common.hw,
  1346. [CLK_EIC_EB] = &eic_eb.common.hw,
  1347. [CLK_INTC_EB] = &intc_eb.common.hw,
  1348. [CLK_ADI_EB] = &adi_eb.common.hw,
  1349. [CLK_AUDIF_EB] = &audif_eb.common.hw,
  1350. [CLK_AUD_EB] = &aud_eb.common.hw,
  1351. [CLK_VBC_EB] = &vbc_eb.common.hw,
  1352. [CLK_PIN_EB] = &pin_eb.common.hw,
  1353. [CLK_AP_WDG_EB] = &ap_wdg_eb.common.hw,
  1354. [CLK_MM_EB] = &mm_eb.common.hw,
  1355. [CLK_AON_APB_CKG_EB] = &aon_apb_ckg_eb.common.hw,
  1356. [CLK_CA53_TS0_EB] = &ca53_ts0_eb.common.hw,
  1357. [CLK_CA53_TS1_EB] = &ca53_ts1_eb.common.hw,
  1358. [CLK_CS53_DAP_EB] = &ca53_dap_eb.common.hw,
  1359. [CLK_PMU_EB] = &pmu_eb.common.hw,
  1360. [CLK_THM_EB] = &thm_eb.common.hw,
  1361. [CLK_AUX0_EB] = &aux0_eb.common.hw,
  1362. [CLK_AUX1_EB] = &aux1_eb.common.hw,
  1363. [CLK_AUX2_EB] = &aux2_eb.common.hw,
  1364. [CLK_PROBE_EB] = &probe_eb.common.hw,
  1365. [CLK_EMC_REF_EB] = &emc_ref_eb.common.hw,
  1366. [CLK_CA53_WDG_EB] = &ca53_wdg_eb.common.hw,
  1367. [CLK_AP_TMR1_EB] = &ap_tmr1_eb.common.hw,
  1368. [CLK_AP_TMR2_EB] = &ap_tmr2_eb.common.hw,
  1369. [CLK_DISP_EMC_EB] = &disp_emc_eb.common.hw,
  1370. [CLK_ZIP_EMC_EB] = &zip_emc_eb.common.hw,
  1371. [CLK_GSP_EMC_EB] = &gsp_emc_eb.common.hw,
  1372. [CLK_MM_VSP_EB] = &mm_vsp_eb.common.hw,
  1373. [CLK_MDAR_EB] = &mdar_eb.common.hw,
  1374. [CLK_RTC4M0_CAL_EB] = &rtc4m0_cal_eb.common.hw,
  1375. [CLK_RTC4M1_CAL_EB] = &rtc4m1_cal_eb.common.hw,
  1376. [CLK_DJTAG_EB] = &djtag_eb.common.hw,
  1377. [CLK_MBOX_EB] = &mbox_eb.common.hw,
  1378. [CLK_AON_DMA_EB] = &aon_dma_eb.common.hw,
  1379. [CLK_AON_APB_DEF_EB] = &aon_apb_def_eb.common.hw,
  1380. [CLK_CA5_TS0_EB] = &ca5_ts0_eb.common.hw,
  1381. [CLK_DBG_EB] = &dbg_eb.common.hw,
  1382. [CLK_DBG_EMC_EB] = &dbg_emc_eb.common.hw,
  1383. [CLK_CROSS_TRIG_EB] = &cross_trig_eb.common.hw,
  1384. [CLK_SERDES_DPHY_EB] = &serdes_dphy_eb.common.hw,
  1385. [CLK_ARCH_RTC_EB] = &arch_rtc_eb.common.hw,
  1386. [CLK_KPD_RTC_EB] = &kpd_rtc_eb.common.hw,
  1387. [CLK_AON_SYST_RTC_EB] = &aon_syst_rtc_eb.common.hw,
  1388. [CLK_AP_SYST_RTC_EB] = &ap_syst_rtc_eb.common.hw,
  1389. [CLK_AON_TMR_RTC_EB] = &aon_tmr_rtc_eb.common.hw,
  1390. [CLK_AP_TMR0_RTC_EB] = &ap_tmr0_rtc_eb.common.hw,
  1391. [CLK_EIC_RTC_EB] = &eic_rtc_eb.common.hw,
  1392. [CLK_EIC_RTCDV5_EB] = &eic_rtcdv5_eb.common.hw,
  1393. [CLK_AP_WDG_RTC_EB] = &ap_wdg_rtc_eb.common.hw,
  1394. [CLK_CA53_WDG_RTC_EB] = &ca53_wdg_rtc_eb.common.hw,
  1395. [CLK_THM_RTC_EB] = &thm_rtc_eb.common.hw,
  1396. [CLK_ATHMA_RTC_EB] = &athma_rtc_eb.common.hw,
  1397. [CLK_GTHMA_RTC_EB] = &gthma_rtc_eb.common.hw,
  1398. [CLK_ATHMA_RTC_A_EB] = &athma_rtc_a_eb.common.hw,
  1399. [CLK_GTHMA_RTC_A_EB] = &gthma_rtc_a_eb.common.hw,
  1400. [CLK_AP_TMR1_RTC_EB] = &ap_tmr1_rtc_eb.common.hw,
  1401. [CLK_AP_TMR2_RTC_EB] = &ap_tmr2_rtc_eb.common.hw,
  1402. [CLK_DXCO_LC_RTC_EB] = &dxco_lc_rtc_eb.common.hw,
  1403. [CLK_BB_CAL_RTC_EB] = &bb_cal_rtc_eb.common.hw,
  1404. [CLK_GNU_EB] = &gpu_eb.common.hw,
  1405. [CLK_DISP_EB] = &disp_eb.common.hw,
  1406. [CLK_MM_EMC_EB] = &mm_emc_eb.common.hw,
  1407. [CLK_POWER_CPU_EB] = &power_cpu_eb.common.hw,
  1408. [CLK_HW_I2C_EB] = &hw_i2c_eb.common.hw,
  1409. [CLK_MM_VSP_EMC_EB] = &mm_vsp_emc_eb.common.hw,
  1410. [CLK_VSP_EB] = &vsp_eb.common.hw,
  1411. [CLK_CSSYS_EB] = &cssys_eb.common.hw,
  1412. [CLK_DMC_EB] = &dmc_eb.common.hw,
  1413. [CLK_ROSC_EB] = &rosc_eb.common.hw,
  1414. [CLK_S_D_CFG_EB] = &s_d_cfg_eb.common.hw,
  1415. [CLK_S_D_REF_EB] = &s_d_ref_eb.common.hw,
  1416. [CLK_B_DMA_EB] = &b_dma_eb.common.hw,
  1417. [CLK_ANLG_EB] = &anlg_eb.common.hw,
  1418. [CLK_ANLG_APB_EB] = &anlg_apb_eb.common.hw,
  1419. [CLK_BSMTMR_EB] = &bsmtmr_eb.common.hw,
  1420. [CLK_AP_AXI_EB] = &ap_axi_eb.common.hw,
  1421. [CLK_AP_INTC0_EB] = &ap_intc0_eb.common.hw,
  1422. [CLK_AP_INTC1_EB] = &ap_intc1_eb.common.hw,
  1423. [CLK_AP_INTC2_EB] = &ap_intc2_eb.common.hw,
  1424. [CLK_AP_INTC3_EB] = &ap_intc3_eb.common.hw,
  1425. [CLK_AP_INTC4_EB] = &ap_intc4_eb.common.hw,
  1426. [CLK_AP_INTC5_EB] = &ap_intc5_eb.common.hw,
  1427. [CLK_SCC_EB] = &scc_eb.common.hw,
  1428. [CLK_DPHY_CFG_EB] = &dphy_cfg_eb.common.hw,
  1429. [CLK_DPHY_REF_EB] = &dphy_ref_eb.common.hw,
  1430. [CLK_CPHY_CFG_EB] = &cphy_cfg_eb.common.hw,
  1431. [CLK_OTG_REF_EB] = &otg_ref_eb.common.hw,
  1432. [CLK_SERDES_EB] = &serdes_eb.common.hw,
  1433. [CLK_AON_AP_EMC_EB] = &aon_ap_emc_eb.common.hw,
  1434. },
  1435. .num = CLK_AON_APB_GATE_NUM,
  1436. };
  1437. static const struct sprd_clk_desc sc9863a_aonapb_gate_desc = {
  1438. .clk_clks = sc9863a_aonapb_gate_clks,
  1439. .num_clk_clks = ARRAY_SIZE(sc9863a_aonapb_gate_clks),
  1440. .hw_clks = &sc9863a_aonapb_gate_hws,
  1441. };
  1442. /* mm gate clocks */
  1443. static SPRD_SC_GATE_CLK_HW(mahb_ckg_eb, "mahb-ckg-eb", &mm_ahb.common.hw, 0x0, 0x1000,
  1444. BIT(0), 0, 0);
  1445. static SPRD_SC_GATE_CLK_HW(mdcam_eb, "mdcam-eb", &mm_ahb.common.hw, 0x0, 0x1000,
  1446. BIT(1), 0, 0);
  1447. static SPRD_SC_GATE_CLK_HW(misp_eb, "misp-eb", &mm_ahb.common.hw, 0x0, 0x1000,
  1448. BIT(2), 0, 0);
  1449. static SPRD_SC_GATE_CLK_HW(mahbcsi_eb, "mahbcsi-eb", &mm_ahb.common.hw, 0x0, 0x1000,
  1450. BIT(3), 0, 0);
  1451. static SPRD_SC_GATE_CLK_HW(mcsi_s_eb, "mcsi-s-eb", &mm_ahb.common.hw, 0x0, 0x1000,
  1452. BIT(4), 0, 0);
  1453. static SPRD_SC_GATE_CLK_HW(mcsi_t_eb, "mcsi-t-eb", &mm_ahb.common.hw, 0x0, 0x1000,
  1454. BIT(5), 0, 0);
  1455. static SPRD_GATE_CLK_HW(dcam_axi_eb, "dcam-axi-eb", &mm_ahb.common.hw, 0x8,
  1456. BIT(0), 0, 0);
  1457. static SPRD_GATE_CLK_HW(isp_axi_eb, "isp-axi-eb", &mm_ahb.common.hw, 0x8,
  1458. BIT(1), 0, 0);
  1459. static SPRD_GATE_CLK_HW(mcsi_eb, "mcsi-eb", &mm_ahb.common.hw, 0x8,
  1460. BIT(2), 0, 0);
  1461. static SPRD_GATE_CLK_HW(mcsi_s_ckg_eb, "mcsi-s-ckg-eb", &mm_ahb.common.hw, 0x8,
  1462. BIT(3), 0, 0);
  1463. static SPRD_GATE_CLK_HW(mcsi_t_ckg_eb, "mcsi-t-ckg-eb", &mm_ahb.common.hw, 0x8,
  1464. BIT(4), 0, 0);
  1465. static SPRD_GATE_CLK_HW(sensor0_eb, "sensor0-eb", &mm_ahb.common.hw, 0x8,
  1466. BIT(5), 0, 0);
  1467. static SPRD_GATE_CLK_HW(sensor1_eb, "sensor1-eb", &mm_ahb.common.hw, 0x8,
  1468. BIT(6), 0, 0);
  1469. static SPRD_GATE_CLK_HW(sensor2_eb, "sensor2-eb", &mm_ahb.common.hw, 0x8,
  1470. BIT(7), 0, 0);
  1471. static SPRD_GATE_CLK_HW(mcphy_cfg_eb, "mcphy-cfg-eb", &mm_ahb.common.hw, 0x8,
  1472. BIT(8), 0, 0);
  1473. static struct sprd_clk_common *sc9863a_mm_gate_clks[] = {
  1474. /* address base is 0x60800000 */
  1475. &mahb_ckg_eb.common,
  1476. &mdcam_eb.common,
  1477. &misp_eb.common,
  1478. &mahbcsi_eb.common,
  1479. &mcsi_s_eb.common,
  1480. &mcsi_t_eb.common,
  1481. &dcam_axi_eb.common,
  1482. &isp_axi_eb.common,
  1483. &mcsi_eb.common,
  1484. &mcsi_s_ckg_eb.common,
  1485. &mcsi_t_ckg_eb.common,
  1486. &sensor0_eb.common,
  1487. &sensor1_eb.common,
  1488. &sensor2_eb.common,
  1489. &mcphy_cfg_eb.common,
  1490. };
  1491. static struct clk_hw_onecell_data sc9863a_mm_gate_hws = {
  1492. .hws = {
  1493. [CLK_MAHB_CKG_EB] = &mahb_ckg_eb.common.hw,
  1494. [CLK_MDCAM_EB] = &mdcam_eb.common.hw,
  1495. [CLK_MISP_EB] = &misp_eb.common.hw,
  1496. [CLK_MAHBCSI_EB] = &mahbcsi_eb.common.hw,
  1497. [CLK_MCSI_S_EB] = &mcsi_s_eb.common.hw,
  1498. [CLK_MCSI_T_EB] = &mcsi_t_eb.common.hw,
  1499. [CLK_DCAM_AXI_EB] = &dcam_axi_eb.common.hw,
  1500. [CLK_ISP_AXI_EB] = &isp_axi_eb.common.hw,
  1501. [CLK_MCSI_EB] = &mcsi_eb.common.hw,
  1502. [CLK_MCSI_S_CKG_EB] = &mcsi_s_ckg_eb.common.hw,
  1503. [CLK_MCSI_T_CKG_EB] = &mcsi_t_ckg_eb.common.hw,
  1504. [CLK_SENSOR0_EB] = &sensor0_eb.common.hw,
  1505. [CLK_SENSOR1_EB] = &sensor1_eb.common.hw,
  1506. [CLK_SENSOR2_EB] = &sensor2_eb.common.hw,
  1507. [CLK_MCPHY_CFG_EB] = &mcphy_cfg_eb.common.hw,
  1508. },
  1509. .num = CLK_MM_GATE_NUM,
  1510. };
  1511. static const struct sprd_clk_desc sc9863a_mm_gate_desc = {
  1512. .clk_clks = sc9863a_mm_gate_clks,
  1513. .num_clk_clks = ARRAY_SIZE(sc9863a_mm_gate_clks),
  1514. .hw_clks = &sc9863a_mm_gate_hws,
  1515. };
  1516. /* camera sensor clocks */
  1517. static SPRD_GATE_CLK_HW(mipi_csi_clk, "mipi-csi-clk", &mahb_ckg_eb.common.hw,
  1518. 0x20, BIT(16), 0, SPRD_GATE_NON_AON);
  1519. static SPRD_GATE_CLK_HW(mipi_csi_s_clk, "mipi-csi-s-clk", &mahb_ckg_eb.common.hw,
  1520. 0x24, BIT(16), 0, SPRD_GATE_NON_AON);
  1521. static SPRD_GATE_CLK_HW(mipi_csi_m_clk, "mipi-csi-m-clk", &mahb_ckg_eb.common.hw,
  1522. 0x28, BIT(16), 0, SPRD_GATE_NON_AON);
  1523. static struct sprd_clk_common *sc9863a_mm_clk_clks[] = {
  1524. /* address base is 0x60900000 */
  1525. &mipi_csi_clk.common,
  1526. &mipi_csi_s_clk.common,
  1527. &mipi_csi_m_clk.common,
  1528. };
  1529. static struct clk_hw_onecell_data sc9863a_mm_clk_hws = {
  1530. .hws = {
  1531. [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,
  1532. [CLK_MIPI_CSI_S] = &mipi_csi_s_clk.common.hw,
  1533. [CLK_MIPI_CSI_M] = &mipi_csi_m_clk.common.hw,
  1534. },
  1535. .num = CLK_MM_CLK_NUM,
  1536. };
  1537. static const struct sprd_clk_desc sc9863a_mm_clk_desc = {
  1538. .clk_clks = sc9863a_mm_clk_clks,
  1539. .num_clk_clks = ARRAY_SIZE(sc9863a_mm_clk_clks),
  1540. .hw_clks = &sc9863a_mm_clk_hws,
  1541. };
  1542. static SPRD_SC_GATE_CLK_FW_NAME(sim0_eb, "sim0-eb", "ext-26m", 0x0,
  1543. 0x1000, BIT(0), 0, 0);
  1544. static SPRD_SC_GATE_CLK_FW_NAME(iis0_eb, "iis0-eb", "ext-26m", 0x0,
  1545. 0x1000, BIT(1), 0, 0);
  1546. static SPRD_SC_GATE_CLK_FW_NAME(iis1_eb, "iis1-eb", "ext-26m", 0x0,
  1547. 0x1000, BIT(2), 0, 0);
  1548. static SPRD_SC_GATE_CLK_FW_NAME(iis2_eb, "iis2-eb", "ext-26m", 0x0,
  1549. 0x1000, BIT(3), 0, 0);
  1550. static SPRD_SC_GATE_CLK_FW_NAME(spi0_eb, "spi0-eb", "ext-26m", 0x0,
  1551. 0x1000, BIT(5), 0, 0);
  1552. static SPRD_SC_GATE_CLK_FW_NAME(spi1_eb, "spi1-eb", "ext-26m", 0x0,
  1553. 0x1000, BIT(6), 0, 0);
  1554. static SPRD_SC_GATE_CLK_FW_NAME(spi2_eb, "spi2-eb", "ext-26m", 0x0,
  1555. 0x1000, BIT(7), 0, 0);
  1556. static SPRD_SC_GATE_CLK_FW_NAME(i2c0_eb, "i2c0-eb", "ext-26m", 0x0,
  1557. 0x1000, BIT(8), 0, 0);
  1558. static SPRD_SC_GATE_CLK_FW_NAME(i2c1_eb, "i2c1-eb", "ext-26m", 0x0,
  1559. 0x1000, BIT(9), 0, 0);
  1560. static SPRD_SC_GATE_CLK_FW_NAME(i2c2_eb, "i2c2-eb", "ext-26m", 0x0,
  1561. 0x1000, BIT(10), 0, 0);
  1562. static SPRD_SC_GATE_CLK_FW_NAME(i2c3_eb, "i2c3-eb", "ext-26m", 0x0,
  1563. 0x1000, BIT(11), 0, 0);
  1564. static SPRD_SC_GATE_CLK_FW_NAME(i2c4_eb, "i2c4-eb", "ext-26m", 0x0,
  1565. 0x1000, BIT(12), 0, 0);
  1566. static SPRD_SC_GATE_CLK_FW_NAME(uart0_eb, "uart0-eb", "ext-26m", 0x0,
  1567. 0x1000, BIT(13), 0, 0);
  1568. /* uart1_eb is for console, don't gate even if unused */
  1569. static SPRD_SC_GATE_CLK_FW_NAME(uart1_eb, "uart1-eb", "ext-26m", 0x0,
  1570. 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
  1571. static SPRD_SC_GATE_CLK_FW_NAME(uart2_eb, "uart2-eb", "ext-26m", 0x0,
  1572. 0x1000, BIT(15), 0, 0);
  1573. static SPRD_SC_GATE_CLK_FW_NAME(uart3_eb, "uart3-eb", "ext-26m", 0x0,
  1574. 0x1000, BIT(16), 0, 0);
  1575. static SPRD_SC_GATE_CLK_FW_NAME(uart4_eb, "uart4-eb", "ext-26m", 0x0,
  1576. 0x1000, BIT(17), 0, 0);
  1577. static SPRD_SC_GATE_CLK_FW_NAME(sim0_32k_eb, "sim0_32k-eb", "ext-26m", 0x0,
  1578. 0x1000, BIT(18), 0, 0);
  1579. static SPRD_SC_GATE_CLK_FW_NAME(spi3_eb, "spi3-eb", "ext-26m", 0x0,
  1580. 0x1000, BIT(19), 0, 0);
  1581. static SPRD_SC_GATE_CLK_FW_NAME(i2c5_eb, "i2c5-eb", "ext-26m", 0x0,
  1582. 0x1000, BIT(20), 0, 0);
  1583. static SPRD_SC_GATE_CLK_FW_NAME(i2c6_eb, "i2c6-eb", "ext-26m", 0x0,
  1584. 0x1000, BIT(21), 0, 0);
  1585. static struct sprd_clk_common *sc9863a_apapb_gate[] = {
  1586. /* address base is 0x71300000 */
  1587. &sim0_eb.common,
  1588. &iis0_eb.common,
  1589. &iis1_eb.common,
  1590. &iis2_eb.common,
  1591. &spi0_eb.common,
  1592. &spi1_eb.common,
  1593. &spi2_eb.common,
  1594. &i2c0_eb.common,
  1595. &i2c1_eb.common,
  1596. &i2c2_eb.common,
  1597. &i2c3_eb.common,
  1598. &i2c4_eb.common,
  1599. &uart0_eb.common,
  1600. &uart1_eb.common,
  1601. &uart2_eb.common,
  1602. &uart3_eb.common,
  1603. &uart4_eb.common,
  1604. &sim0_32k_eb.common,
  1605. &spi3_eb.common,
  1606. &i2c5_eb.common,
  1607. &i2c6_eb.common,
  1608. };
  1609. static struct clk_hw_onecell_data sc9863a_apapb_gate_hws = {
  1610. .hws = {
  1611. [CLK_SIM0_EB] = &sim0_eb.common.hw,
  1612. [CLK_IIS0_EB] = &iis0_eb.common.hw,
  1613. [CLK_IIS1_EB] = &iis1_eb.common.hw,
  1614. [CLK_IIS2_EB] = &iis2_eb.common.hw,
  1615. [CLK_SPI0_EB] = &spi0_eb.common.hw,
  1616. [CLK_SPI1_EB] = &spi1_eb.common.hw,
  1617. [CLK_SPI2_EB] = &spi2_eb.common.hw,
  1618. [CLK_I2C0_EB] = &i2c0_eb.common.hw,
  1619. [CLK_I2C1_EB] = &i2c1_eb.common.hw,
  1620. [CLK_I2C2_EB] = &i2c2_eb.common.hw,
  1621. [CLK_I2C3_EB] = &i2c3_eb.common.hw,
  1622. [CLK_I2C4_EB] = &i2c4_eb.common.hw,
  1623. [CLK_UART0_EB] = &uart0_eb.common.hw,
  1624. [CLK_UART1_EB] = &uart1_eb.common.hw,
  1625. [CLK_UART2_EB] = &uart2_eb.common.hw,
  1626. [CLK_UART3_EB] = &uart3_eb.common.hw,
  1627. [CLK_UART4_EB] = &uart4_eb.common.hw,
  1628. [CLK_SIM0_32K_EB] = &sim0_32k_eb.common.hw,
  1629. [CLK_SPI3_EB] = &spi3_eb.common.hw,
  1630. [CLK_I2C5_EB] = &i2c5_eb.common.hw,
  1631. [CLK_I2C6_EB] = &i2c6_eb.common.hw,
  1632. },
  1633. .num = CLK_AP_APB_GATE_NUM,
  1634. };
  1635. static const struct sprd_clk_desc sc9863a_apapb_gate_desc = {
  1636. .clk_clks = sc9863a_apapb_gate,
  1637. .num_clk_clks = ARRAY_SIZE(sc9863a_apapb_gate),
  1638. .hw_clks = &sc9863a_apapb_gate_hws,
  1639. };
  1640. static const struct of_device_id sprd_sc9863a_clk_ids[] = {
  1641. { .compatible = "sprd,sc9863a-ap-clk", /* 0x21500000 */
  1642. .data = &sc9863a_ap_clk_desc },
  1643. { .compatible = "sprd,sc9863a-pmu-gate", /* 0x402b0000 */
  1644. .data = &sc9863a_pmu_gate_desc },
  1645. { .compatible = "sprd,sc9863a-pll", /* 0x40353000 */
  1646. .data = &sc9863a_pll_desc },
  1647. { .compatible = "sprd,sc9863a-mpll", /* 0x40359000 */
  1648. .data = &sc9863a_mpll_desc },
  1649. { .compatible = "sprd,sc9863a-rpll", /* 0x4035c000 */
  1650. .data = &sc9863a_rpll_desc },
  1651. { .compatible = "sprd,sc9863a-dpll", /* 0x40363000 */
  1652. .data = &sc9863a_dpll_desc },
  1653. { .compatible = "sprd,sc9863a-aon-clk", /* 0x402d0000 */
  1654. .data = &sc9863a_aon_clk_desc },
  1655. { .compatible = "sprd,sc9863a-apahb-gate", /* 0x20e00000 */
  1656. .data = &sc9863a_apahb_gate_desc },
  1657. { .compatible = "sprd,sc9863a-aonapb-gate", /* 0x402e0000 */
  1658. .data = &sc9863a_aonapb_gate_desc },
  1659. { .compatible = "sprd,sc9863a-mm-gate", /* 0x60800000 */
  1660. .data = &sc9863a_mm_gate_desc },
  1661. { .compatible = "sprd,sc9863a-mm-clk", /* 0x60900000 */
  1662. .data = &sc9863a_mm_clk_desc },
  1663. { .compatible = "sprd,sc9863a-apapb-gate", /* 0x71300000 */
  1664. .data = &sc9863a_apapb_gate_desc },
  1665. { }
  1666. };
  1667. MODULE_DEVICE_TABLE(of, sprd_sc9863a_clk_ids);
  1668. static int sc9863a_clk_probe(struct platform_device *pdev)
  1669. {
  1670. const struct sprd_clk_desc *desc;
  1671. int ret;
  1672. desc = device_get_match_data(&pdev->dev);
  1673. if (!desc)
  1674. return -ENODEV;
  1675. ret = sprd_clk_regmap_init(pdev, desc);
  1676. if (ret)
  1677. return ret;
  1678. return sprd_clk_probe(&pdev->dev, desc->hw_clks);
  1679. }
  1680. static struct platform_driver sc9863a_clk_driver = {
  1681. .probe = sc9863a_clk_probe,
  1682. .driver = {
  1683. .name = "sc9863a-clk",
  1684. .of_match_table = sprd_sc9863a_clk_ids,
  1685. },
  1686. };
  1687. module_platform_driver(sc9863a_clk_driver);
  1688. MODULE_DESCRIPTION("Spreadtrum SC9863A Clock Driver");
  1689. MODULE_LICENSE("GPL v2");