gcc-mdm9607.c 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/bitops.h>
  7. #include <linux/err.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/module.h>
  10. #include <linux/of.h>
  11. #include <linux/clk-provider.h>
  12. #include <linux/regmap.h>
  13. #include <linux/reset-controller.h>
  14. #include <dt-bindings/clock/qcom,gcc-mdm9607.h>
  15. #include "common.h"
  16. #include "clk-regmap.h"
  17. #include "clk-alpha-pll.h"
  18. #include "clk-pll.h"
  19. #include "clk-rcg.h"
  20. #include "clk-branch.h"
  21. #include "reset.h"
  22. #include "gdsc.h"
  23. enum {
  24. P_XO,
  25. P_BIMC,
  26. P_GPLL0,
  27. P_GPLL1,
  28. P_GPLL2,
  29. P_SLEEP_CLK,
  30. };
  31. static struct clk_alpha_pll gpll0_early = {
  32. .offset = 0x21000,
  33. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
  34. .clkr = {
  35. .enable_reg = 0x45000,
  36. .enable_mask = BIT(0),
  37. .hw.init = &(struct clk_init_data)
  38. {
  39. .name = "gpll0_early",
  40. .parent_data = &(const struct clk_parent_data){
  41. .fw_name = "xo",
  42. },
  43. .num_parents = 1,
  44. .ops = &clk_alpha_pll_ops,
  45. },
  46. },
  47. };
  48. static struct clk_alpha_pll_postdiv gpll0 = {
  49. .offset = 0x21000,
  50. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
  51. .clkr.hw.init = &(struct clk_init_data)
  52. {
  53. .name = "gpll0",
  54. .parent_hws = (const struct clk_hw *[]){ &gpll0_early.clkr.hw },
  55. .num_parents = 1,
  56. .ops = &clk_alpha_pll_postdiv_ops,
  57. },
  58. };
  59. static const struct parent_map gcc_xo_gpll0_map[] = {
  60. { P_XO, 0 },
  61. { P_GPLL0, 1 },
  62. };
  63. static const struct clk_parent_data gcc_xo_gpll0[] = {
  64. { .fw_name = "xo" },
  65. { .hw = &gpll0.clkr.hw },
  66. };
  67. static struct clk_pll gpll1 = {
  68. .l_reg = 0x20004,
  69. .m_reg = 0x20008,
  70. .n_reg = 0x2000c,
  71. .config_reg = 0x20010,
  72. .mode_reg = 0x20000,
  73. .status_reg = 0x2001c,
  74. .status_bit = 17,
  75. .clkr.hw.init = &(struct clk_init_data){
  76. .name = "gpll1",
  77. .parent_data = &(const struct clk_parent_data){
  78. .fw_name = "xo",
  79. },
  80. .num_parents = 1,
  81. .ops = &clk_pll_ops,
  82. },
  83. };
  84. static struct clk_regmap gpll1_vote = {
  85. .enable_reg = 0x45000,
  86. .enable_mask = BIT(1),
  87. .hw.init = &(struct clk_init_data){
  88. .name = "gpll1_vote",
  89. .parent_hws = (const struct clk_hw *[]){ &gpll1.clkr.hw },
  90. .num_parents = 1,
  91. .ops = &clk_pll_vote_ops,
  92. },
  93. };
  94. static const struct parent_map gcc_xo_gpll0_gpll1_sleep_map[] = {
  95. { P_XO, 0 },
  96. { P_GPLL0, 1 },
  97. { P_GPLL1, 2 },
  98. { P_SLEEP_CLK, 6 },
  99. };
  100. static const struct clk_parent_data gcc_xo_gpll0_gpll1_sleep[] = {
  101. { .fw_name = "xo" },
  102. { .hw = &gpll0.clkr.hw },
  103. { .hw = &gpll1_vote.hw },
  104. { .fw_name = "sleep_clk" },
  105. };
  106. static struct clk_alpha_pll gpll2_early = {
  107. .offset = 0x25000,
  108. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
  109. .clkr = {
  110. .enable_reg = 0x45000,
  111. .enable_mask = BIT(3), /* Yeah, apparently it's not 2 */
  112. .hw.init = &(struct clk_init_data)
  113. {
  114. .name = "gpll2_early",
  115. .parent_data = &(const struct clk_parent_data){
  116. .fw_name = "xo",
  117. },
  118. .num_parents = 1,
  119. .ops = &clk_alpha_pll_ops,
  120. },
  121. },
  122. };
  123. static struct clk_alpha_pll_postdiv gpll2 = {
  124. .offset = 0x25000,
  125. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
  126. .clkr.hw.init = &(struct clk_init_data)
  127. {
  128. .name = "gpll2",
  129. .parent_hws = (const struct clk_hw *[]){ &gpll2_early.clkr.hw },
  130. .num_parents = 1,
  131. .ops = &clk_alpha_pll_postdiv_ops,
  132. },
  133. };
  134. static const struct parent_map gcc_xo_gpll0_gpll2_map[] = {
  135. { P_XO, 0 },
  136. { P_GPLL0, 1 },
  137. { P_GPLL2, 2 },
  138. };
  139. static const struct clk_parent_data gcc_xo_gpll0_gpll2[] = {
  140. { .fw_name = "xo" },
  141. { .hw = &gpll0.clkr.hw },
  142. { .hw = &gpll2.clkr.hw },
  143. };
  144. static const struct parent_map gcc_xo_gpll0_gpll1_gpll2_map[] = {
  145. { P_XO, 0 },
  146. { P_GPLL0, 1 },
  147. { P_GPLL1, 2 },
  148. { P_GPLL2, 3 },
  149. };
  150. static const struct clk_parent_data gcc_xo_gpll0_gpll1_gpll2[] = {
  151. { .fw_name = "xo" },
  152. { .hw = &gpll0.clkr.hw },
  153. { .hw = &gpll1_vote.hw },
  154. { .hw = &gpll2.clkr.hw },
  155. };
  156. static const struct freq_tbl ftbl_apss_ahb_clk[] = {
  157. F(19200000, P_XO, 1, 0, 0),
  158. F(50000000, P_GPLL0, 16, 0, 0),
  159. F(100000000, P_GPLL0, 8, 0, 0),
  160. { }
  161. };
  162. static struct clk_rcg2 apss_ahb_clk_src = {
  163. .cmd_rcgr = 0x46000,
  164. .hid_width = 5,
  165. .parent_map = gcc_xo_gpll0_map,
  166. .freq_tbl = ftbl_apss_ahb_clk,
  167. .clkr.hw.init = &(struct clk_init_data){
  168. .name = "apss_ahb_clk_src",
  169. .parent_data = gcc_xo_gpll0,
  170. .num_parents = 2,
  171. .ops = &clk_rcg2_ops,
  172. },
  173. };
  174. static struct clk_pll bimc_pll = {
  175. .l_reg = 0x23004,
  176. .m_reg = 0x23008,
  177. .n_reg = 0x2300c,
  178. .config_reg = 0x23010,
  179. .mode_reg = 0x23000,
  180. .status_reg = 0x2301c,
  181. .status_bit = 17,
  182. .clkr.hw.init = &(struct clk_init_data){
  183. .name = "bimc_pll",
  184. .parent_data = &(const struct clk_parent_data){
  185. .fw_name = "xo",
  186. },
  187. .num_parents = 1,
  188. .ops = &clk_pll_ops,
  189. },
  190. };
  191. static struct clk_regmap bimc_pll_vote = {
  192. .enable_reg = 0x45000,
  193. .enable_mask = BIT(3),
  194. .hw.init = &(struct clk_init_data){
  195. .name = "bimc_pll_vote",
  196. .parent_hws = (const struct clk_hw *[]){ &bimc_pll.clkr.hw },
  197. .num_parents = 1,
  198. .ops = &clk_pll_vote_ops,
  199. },
  200. };
  201. static const struct parent_map gcc_xo_gpll0_bimc_map[] = {
  202. { P_XO, 0 },
  203. { P_GPLL0, 1 },
  204. { P_BIMC, 2 },
  205. };
  206. static const struct clk_parent_data gcc_xo_gpll0_bimc[] = {
  207. { .fw_name = "xo" },
  208. { .hw = &gpll0.clkr.hw },
  209. { .hw = &bimc_pll_vote.hw },
  210. };
  211. static const struct freq_tbl ftbl_pcnoc_bfdcd_clk_src[] = {
  212. F(19200000, P_XO, 1, 0, 0),
  213. F(50000000, P_GPLL0, 16, 0, 0),
  214. F(100000000, P_GPLL0, 8, 0, 0),
  215. { }
  216. };
  217. static struct clk_rcg2 pcnoc_bfdcd_clk_src = {
  218. .cmd_rcgr = 0x27000,
  219. .freq_tbl = ftbl_pcnoc_bfdcd_clk_src,
  220. .hid_width = 5,
  221. .parent_map = gcc_xo_gpll0_bimc_map,
  222. .clkr.hw.init = &(struct clk_init_data){
  223. .name = "pcnoc_bfdcd_clk_src",
  224. .parent_data = gcc_xo_gpll0_bimc,
  225. .num_parents = ARRAY_SIZE(gcc_xo_gpll0_bimc),
  226. .ops = &clk_rcg2_ops,
  227. .flags = CLK_IS_CRITICAL,
  228. },
  229. };
  230. static struct clk_rcg2 system_noc_bfdcd_clk_src = {
  231. .cmd_rcgr = 0x26004,
  232. .hid_width = 5,
  233. .parent_map = gcc_xo_gpll0_bimc_map,
  234. .clkr.hw.init = &(struct clk_init_data){
  235. .name = "system_noc_bfdcd_clk_src",
  236. .parent_data = gcc_xo_gpll0_bimc,
  237. .num_parents = ARRAY_SIZE(gcc_xo_gpll0_bimc),
  238. .ops = &clk_rcg2_ops,
  239. },
  240. };
  241. static const struct freq_tbl ftbl_gcc_blsp1_qup1_6_i2c_apps_clk[] = {
  242. F(19200000, P_XO, 1, 0, 0),
  243. F(50000000, P_GPLL0, 16, 0, 0),
  244. { }
  245. };
  246. static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
  247. .cmd_rcgr = 0x200c,
  248. .hid_width = 5,
  249. .parent_map = gcc_xo_gpll0_map,
  250. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  251. .clkr.hw.init = &(struct clk_init_data){
  252. .name = "blsp1_qup1_i2c_apps_clk_src",
  253. .parent_data = gcc_xo_gpll0,
  254. .num_parents = 2,
  255. .ops = &clk_rcg2_ops,
  256. },
  257. };
  258. static const struct freq_tbl ftbl_gcc_blsp1_qup1_6_spi_apps_clk[] = {
  259. F(960000, P_XO, 10, 1, 2),
  260. F(4800000, P_XO, 4, 0, 0),
  261. F(9600000, P_XO, 2, 0, 0),
  262. F(16000000, P_GPLL0, 10, 1, 5),
  263. F(19200000, P_XO, 1, 0, 0),
  264. F(25000000, P_GPLL0, 16, 1, 2),
  265. F(50000000, P_GPLL0, 16, 0, 0),
  266. { }
  267. };
  268. static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
  269. .cmd_rcgr = 0x2024,
  270. .mnd_width = 8,
  271. .hid_width = 5,
  272. .parent_map = gcc_xo_gpll0_map,
  273. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  274. .clkr.hw.init = &(struct clk_init_data){
  275. .name = "blsp1_qup1_spi_apps_clk_src",
  276. .parent_data = gcc_xo_gpll0,
  277. .num_parents = 2,
  278. .ops = &clk_rcg2_ops,
  279. },
  280. };
  281. static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
  282. .cmd_rcgr = 0x3000,
  283. .hid_width = 5,
  284. .parent_map = gcc_xo_gpll0_map,
  285. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  286. .clkr.hw.init = &(struct clk_init_data){
  287. .name = "blsp1_qup2_i2c_apps_clk_src",
  288. .parent_data = gcc_xo_gpll0,
  289. .num_parents = 2,
  290. .ops = &clk_rcg2_ops,
  291. },
  292. };
  293. static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
  294. .cmd_rcgr = 0x3014,
  295. .mnd_width = 8,
  296. .hid_width = 5,
  297. .parent_map = gcc_xo_gpll0_map,
  298. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  299. .clkr.hw.init = &(struct clk_init_data){
  300. .name = "blsp1_qup2_spi_apps_clk_src",
  301. .parent_data = gcc_xo_gpll0,
  302. .num_parents = 2,
  303. .ops = &clk_rcg2_ops,
  304. },
  305. };
  306. static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
  307. .cmd_rcgr = 0x4000,
  308. .hid_width = 5,
  309. .parent_map = gcc_xo_gpll0_map,
  310. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  311. .clkr.hw.init = &(struct clk_init_data){
  312. .name = "blsp1_qup3_i2c_apps_clk_src",
  313. .parent_data = gcc_xo_gpll0,
  314. .num_parents = 2,
  315. .ops = &clk_rcg2_ops,
  316. },
  317. };
  318. static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
  319. .cmd_rcgr = 0x4024,
  320. .mnd_width = 8,
  321. .hid_width = 5,
  322. .parent_map = gcc_xo_gpll0_map,
  323. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  324. .clkr.hw.init = &(struct clk_init_data){
  325. .name = "blsp1_qup3_spi_apps_clk_src",
  326. .parent_data = gcc_xo_gpll0,
  327. .num_parents = 2,
  328. .ops = &clk_rcg2_ops,
  329. },
  330. };
  331. static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
  332. .cmd_rcgr = 0x5000,
  333. .hid_width = 5,
  334. .parent_map = gcc_xo_gpll0_map,
  335. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  336. .clkr.hw.init = &(struct clk_init_data){
  337. .name = "blsp1_qup4_i2c_apps_clk_src",
  338. .parent_data = gcc_xo_gpll0,
  339. .num_parents = 2,
  340. .ops = &clk_rcg2_ops,
  341. },
  342. };
  343. static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
  344. .cmd_rcgr = 0x5024,
  345. .mnd_width = 8,
  346. .hid_width = 5,
  347. .parent_map = gcc_xo_gpll0_map,
  348. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  349. .clkr.hw.init = &(struct clk_init_data){
  350. .name = "blsp1_qup4_spi_apps_clk_src",
  351. .parent_data = gcc_xo_gpll0,
  352. .num_parents = 2,
  353. .ops = &clk_rcg2_ops,
  354. },
  355. };
  356. static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
  357. .cmd_rcgr = 0x6000,
  358. .hid_width = 5,
  359. .parent_map = gcc_xo_gpll0_map,
  360. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  361. .clkr.hw.init = &(struct clk_init_data){
  362. .name = "blsp1_qup5_i2c_apps_clk_src",
  363. .parent_data = gcc_xo_gpll0,
  364. .num_parents = 2,
  365. .ops = &clk_rcg2_ops,
  366. },
  367. };
  368. static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
  369. .cmd_rcgr = 0x6024,
  370. .mnd_width = 8,
  371. .hid_width = 5,
  372. .parent_map = gcc_xo_gpll0_map,
  373. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  374. .clkr.hw.init = &(struct clk_init_data){
  375. .name = "blsp1_qup5_spi_apps_clk_src",
  376. .parent_data = gcc_xo_gpll0,
  377. .num_parents = 2,
  378. .ops = &clk_rcg2_ops,
  379. },
  380. };
  381. static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
  382. .cmd_rcgr = 0x7000,
  383. .hid_width = 5,
  384. .parent_map = gcc_xo_gpll0_map,
  385. .freq_tbl = ftbl_gcc_blsp1_qup1_6_i2c_apps_clk,
  386. .clkr.hw.init = &(struct clk_init_data){
  387. .name = "blsp1_qup6_i2c_apps_clk_src",
  388. .parent_data = gcc_xo_gpll0,
  389. .num_parents = 2,
  390. .ops = &clk_rcg2_ops,
  391. },
  392. };
  393. static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
  394. .cmd_rcgr = 0x7024,
  395. .mnd_width = 8,
  396. .hid_width = 5,
  397. .parent_map = gcc_xo_gpll0_map,
  398. .freq_tbl = ftbl_gcc_blsp1_qup1_6_spi_apps_clk,
  399. .clkr.hw.init = &(struct clk_init_data){
  400. .name = "blsp1_qup6_spi_apps_clk_src",
  401. .parent_data = gcc_xo_gpll0,
  402. .num_parents = 2,
  403. .ops = &clk_rcg2_ops,
  404. },
  405. };
  406. static const struct freq_tbl ftbl_gcc_blsp1_uart1_6_apps_clk[] = {
  407. F(3686400, P_GPLL0, 1, 72, 15625),
  408. F(7372800, P_GPLL0, 1, 144, 15625),
  409. F(14745600, P_GPLL0, 1, 288, 15625),
  410. F(16000000, P_GPLL0, 10, 1, 5),
  411. F(19200000, P_XO, 1, 0, 0),
  412. F(24000000, P_GPLL0, 1, 3, 100),
  413. F(25000000, P_GPLL0, 16, 1, 2),
  414. F(32000000, P_GPLL0, 1, 1, 25),
  415. F(40000000, P_GPLL0, 1, 1, 20),
  416. F(46400000, P_GPLL0, 1, 29, 500),
  417. F(48000000, P_GPLL0, 1, 3, 50),
  418. F(51200000, P_GPLL0, 1, 8, 125),
  419. F(56000000, P_GPLL0, 1, 7, 100),
  420. F(58982400, P_GPLL0, 1, 1152, 15625),
  421. F(60000000, P_GPLL0, 1, 3, 40),
  422. { }
  423. };
  424. static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
  425. .cmd_rcgr = 0x2044,
  426. .mnd_width = 16,
  427. .hid_width = 5,
  428. .parent_map = gcc_xo_gpll0_map,
  429. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  430. .clkr.hw.init = &(struct clk_init_data){
  431. .name = "blsp1_uart1_apps_clk_src",
  432. .parent_data = gcc_xo_gpll0,
  433. .num_parents = 2,
  434. .ops = &clk_rcg2_ops,
  435. },
  436. };
  437. static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
  438. .cmd_rcgr = 0x3034,
  439. .mnd_width = 16,
  440. .hid_width = 5,
  441. .parent_map = gcc_xo_gpll0_map,
  442. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  443. .clkr.hw.init = &(struct clk_init_data){
  444. .name = "blsp1_uart2_apps_clk_src",
  445. .parent_data = gcc_xo_gpll0,
  446. .num_parents = 2,
  447. .ops = &clk_rcg2_ops,
  448. },
  449. };
  450. static struct clk_rcg2 blsp1_uart3_apps_clk_src = {
  451. .cmd_rcgr = 0x4044,
  452. .mnd_width = 16,
  453. .hid_width = 5,
  454. .parent_map = gcc_xo_gpll0_map,
  455. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  456. .clkr.hw.init = &(struct clk_init_data){
  457. .name = "blsp1_uart3_apps_clk_src",
  458. .parent_data = gcc_xo_gpll0,
  459. .num_parents = 2,
  460. .ops = &clk_rcg2_ops,
  461. },
  462. };
  463. static struct clk_rcg2 blsp1_uart4_apps_clk_src = {
  464. .cmd_rcgr = 0x5044,
  465. .mnd_width = 16,
  466. .hid_width = 5,
  467. .parent_map = gcc_xo_gpll0_map,
  468. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  469. .clkr.hw.init = &(struct clk_init_data){
  470. .name = "blsp1_uart4_apps_clk_src",
  471. .parent_data = gcc_xo_gpll0,
  472. .num_parents = 2,
  473. .ops = &clk_rcg2_ops,
  474. },
  475. };
  476. static struct clk_rcg2 blsp1_uart5_apps_clk_src = {
  477. .cmd_rcgr = 0x6044,
  478. .mnd_width = 16,
  479. .hid_width = 5,
  480. .parent_map = gcc_xo_gpll0_map,
  481. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  482. .clkr.hw.init = &(struct clk_init_data){
  483. .name = "blsp1_uart5_apps_clk_src",
  484. .parent_data = gcc_xo_gpll0,
  485. .num_parents = 2,
  486. .ops = &clk_rcg2_ops,
  487. },
  488. };
  489. static struct clk_rcg2 blsp1_uart6_apps_clk_src = {
  490. .cmd_rcgr = 0x7044,
  491. .mnd_width = 16,
  492. .hid_width = 5,
  493. .parent_map = gcc_xo_gpll0_map,
  494. .freq_tbl = ftbl_gcc_blsp1_uart1_6_apps_clk,
  495. .clkr.hw.init = &(struct clk_init_data){
  496. .name = "blsp1_uart6_apps_clk_src",
  497. .parent_data = gcc_xo_gpll0,
  498. .num_parents = 2,
  499. .ops = &clk_rcg2_ops,
  500. },
  501. };
  502. static const struct freq_tbl ftbl_gcc_crypto_clk[] = {
  503. F(50000000, P_GPLL0, 16, 0, 0),
  504. F(80000000, P_GPLL0, 10, 0, 0),
  505. F(100000000, P_GPLL0, 8, 0, 0),
  506. F(160000000, P_GPLL0, 5, 0, 0),
  507. { }
  508. };
  509. static struct clk_rcg2 crypto_clk_src = {
  510. .cmd_rcgr = 0x16004,
  511. .hid_width = 5,
  512. .parent_map = gcc_xo_gpll0_map,
  513. .freq_tbl = ftbl_gcc_crypto_clk,
  514. .clkr.hw.init = &(struct clk_init_data){
  515. .name = "crypto_clk_src",
  516. .parent_data = gcc_xo_gpll0,
  517. .num_parents = 2,
  518. .ops = &clk_rcg2_ops,
  519. },
  520. };
  521. static const struct freq_tbl ftbl_gcc_gp1_3_clk[] = {
  522. F(19200000, P_XO, 1, 0, 0),
  523. { }
  524. };
  525. static struct clk_rcg2 gp1_clk_src = {
  526. .cmd_rcgr = 0x8004,
  527. .mnd_width = 8,
  528. .hid_width = 5,
  529. .parent_map = gcc_xo_gpll0_gpll1_sleep_map,
  530. .freq_tbl = ftbl_gcc_gp1_3_clk,
  531. .clkr.hw.init = &(struct clk_init_data){
  532. .name = "gp1_clk_src",
  533. .parent_data = gcc_xo_gpll0_gpll1_sleep,
  534. .num_parents = ARRAY_SIZE(gcc_xo_gpll0_gpll1_sleep),
  535. .ops = &clk_rcg2_ops,
  536. },
  537. };
  538. static struct clk_rcg2 gp2_clk_src = {
  539. .cmd_rcgr = 0x09004,
  540. .mnd_width = 8,
  541. .hid_width = 5,
  542. .parent_map = gcc_xo_gpll0_gpll1_sleep_map,
  543. .freq_tbl = ftbl_gcc_gp1_3_clk,
  544. .clkr.hw.init = &(struct clk_init_data){
  545. .name = "gp2_clk_src",
  546. .parent_data = gcc_xo_gpll0_gpll1_sleep,
  547. .num_parents = ARRAY_SIZE(gcc_xo_gpll0_gpll1_sleep),
  548. .ops = &clk_rcg2_ops,
  549. },
  550. };
  551. static struct clk_rcg2 gp3_clk_src = {
  552. .cmd_rcgr = 0x0a004,
  553. .mnd_width = 8,
  554. .hid_width = 5,
  555. .parent_map = gcc_xo_gpll0_gpll1_sleep_map,
  556. .freq_tbl = ftbl_gcc_gp1_3_clk,
  557. .clkr.hw.init = &(struct clk_init_data){
  558. .name = "gp3_clk_src",
  559. .parent_data = gcc_xo_gpll0_gpll1_sleep,
  560. .num_parents = ARRAY_SIZE(gcc_xo_gpll0_gpll1_sleep),
  561. .ops = &clk_rcg2_ops,
  562. },
  563. };
  564. static const struct freq_tbl ftbl_gcc_pdm2_clk[] = {
  565. F(64000000, P_GPLL0, 12.5, 0, 0),
  566. { }
  567. };
  568. static struct clk_rcg2 pdm2_clk_src = {
  569. .cmd_rcgr = 0x44010,
  570. .hid_width = 5,
  571. .parent_map = gcc_xo_gpll0_map,
  572. .freq_tbl = ftbl_gcc_pdm2_clk,
  573. .clkr.hw.init = &(struct clk_init_data){
  574. .name = "pdm2_clk_src",
  575. .parent_data = gcc_xo_gpll0,
  576. .num_parents = 2,
  577. .ops = &clk_rcg2_ops,
  578. },
  579. };
  580. static const struct freq_tbl ftbl_gcc_sdcc_apps_clk[] = {
  581. F(144000, P_XO, 16, 3, 25),
  582. F(400000, P_XO, 12, 1, 4),
  583. F(20000000, P_GPLL0, 10, 1, 4),
  584. F(25000000, P_GPLL0, 16, 1, 2),
  585. F(50000000, P_GPLL0, 16, 0, 0),
  586. F(100000000, P_GPLL0, 8, 0, 0),
  587. F(177770000, P_GPLL0, 4.5, 0, 0),
  588. F(200000000, P_GPLL0, 4, 0, 0),
  589. { }
  590. };
  591. static struct clk_rcg2 sdcc1_apps_clk_src = {
  592. .cmd_rcgr = 0x42004,
  593. .mnd_width = 8,
  594. .hid_width = 5,
  595. .parent_map = gcc_xo_gpll0_map,
  596. .freq_tbl = ftbl_gcc_sdcc_apps_clk,
  597. .clkr.hw.init = &(struct clk_init_data){
  598. .name = "sdcc1_apps_clk_src",
  599. .parent_data = gcc_xo_gpll0,
  600. .num_parents = 2,
  601. .ops = &clk_rcg2_floor_ops,
  602. },
  603. };
  604. static struct clk_rcg2 sdcc2_apps_clk_src = {
  605. .cmd_rcgr = 0x43004,
  606. .mnd_width = 8,
  607. .hid_width = 5,
  608. .parent_map = gcc_xo_gpll0_map,
  609. .freq_tbl = ftbl_gcc_sdcc_apps_clk,
  610. .clkr.hw.init = &(struct clk_init_data){
  611. .name = "sdcc2_apps_clk_src",
  612. .parent_data = gcc_xo_gpll0,
  613. .num_parents = 2,
  614. .ops = &clk_rcg2_floor_ops,
  615. },
  616. };
  617. static const struct freq_tbl ftbl_gcc_apss_tcu_clk[] = {
  618. F(155000000, P_GPLL2, 6, 0, 0),
  619. F(310000000, P_GPLL2, 3, 0, 0),
  620. F(400000000, P_GPLL0, 2, 0, 0),
  621. { }
  622. };
  623. static struct clk_rcg2 apss_tcu_clk_src = {
  624. .cmd_rcgr = 0x1207c,
  625. .hid_width = 5,
  626. .parent_map = gcc_xo_gpll0_gpll1_gpll2_map,
  627. .freq_tbl = ftbl_gcc_apss_tcu_clk,
  628. .clkr.hw.init = &(struct clk_init_data){
  629. .name = "apss_tcu_clk_src",
  630. .parent_data = gcc_xo_gpll0_gpll1_gpll2,
  631. .num_parents = 4,
  632. .ops = &clk_rcg2_ops,
  633. },
  634. };
  635. static const struct freq_tbl ftbl_gcc_usb_hs_system_clk[] = {
  636. F(19200000, P_XO, 1, 0, 0),
  637. F(57140000, P_GPLL0, 14, 0, 0),
  638. F(69565000, P_GPLL0, 11.5, 0, 0),
  639. F(133330000, P_GPLL0, 6, 0, 0),
  640. F(177778000, P_GPLL0, 4.5, 0, 0),
  641. { }
  642. };
  643. static struct clk_rcg2 usb_hs_system_clk_src = {
  644. .cmd_rcgr = 0x41010,
  645. .hid_width = 5,
  646. .parent_map = gcc_xo_gpll0_map,
  647. .freq_tbl = ftbl_gcc_usb_hs_system_clk,
  648. .clkr.hw.init = &(struct clk_init_data){
  649. .name = "usb_hs_system_clk_src",
  650. .parent_data = gcc_xo_gpll0,
  651. .num_parents = 2,
  652. .ops = &clk_rcg2_ops,
  653. },
  654. };
  655. static const struct freq_tbl ftbl_usb_hsic_clk_src[] = {
  656. F(480000000, P_GPLL2, 1, 0, 0),
  657. { }
  658. };
  659. static struct clk_rcg2 usb_hsic_clk_src = {
  660. .cmd_rcgr = 0x3d018,
  661. .hid_width = 5,
  662. .parent_map = gcc_xo_gpll0_gpll2_map,
  663. .freq_tbl = ftbl_usb_hsic_clk_src,
  664. .clkr.hw.init = &(struct clk_init_data){
  665. .name = "usb_hsic_clk_src",
  666. .parent_data = gcc_xo_gpll0_gpll2,
  667. .num_parents = ARRAY_SIZE(gcc_xo_gpll0_gpll2),
  668. .ops = &clk_rcg2_ops,
  669. },
  670. };
  671. static const struct freq_tbl ftbl_usb_hsic_io_cal_clk_src[] = {
  672. F(9600000, P_XO, 2, 0, 0),
  673. { }
  674. };
  675. static struct clk_rcg2 usb_hsic_io_cal_clk_src = {
  676. .cmd_rcgr = 0x3d030,
  677. .hid_width = 5,
  678. .parent_map = gcc_xo_gpll0_map,
  679. .freq_tbl = ftbl_usb_hsic_io_cal_clk_src,
  680. .clkr.hw.init = &(struct clk_init_data){
  681. .name = "usb_hsic_io_cal_clk_src",
  682. .parent_data = gcc_xo_gpll0,
  683. .num_parents = ARRAY_SIZE(gcc_xo_gpll0),
  684. .ops = &clk_rcg2_ops,
  685. },
  686. };
  687. static const struct freq_tbl ftbl_usb_hsic_system_clk_src[] = {
  688. F(19200000, P_XO, 1, 0, 0),
  689. F(57140000, P_GPLL0, 14, 0, 0),
  690. F(133330000, P_GPLL0, 6, 0, 0),
  691. F(177778000, P_GPLL0, 4.5, 0, 0),
  692. { }
  693. };
  694. static struct clk_rcg2 usb_hsic_system_clk_src = {
  695. .cmd_rcgr = 0x3d000,
  696. .hid_width = 5,
  697. .parent_map = gcc_xo_gpll0_map,
  698. .freq_tbl = ftbl_usb_hsic_system_clk_src,
  699. .clkr.hw.init = &(struct clk_init_data){
  700. .name = "usb_hsic_system_clk_src",
  701. .parent_data = gcc_xo_gpll0,
  702. .num_parents = ARRAY_SIZE(gcc_xo_gpll0),
  703. .ops = &clk_rcg2_ops,
  704. },
  705. };
  706. static struct clk_branch gcc_blsp1_ahb_clk = {
  707. .halt_reg = 0x1008,
  708. .halt_check = BRANCH_HALT_VOTED,
  709. .clkr = {
  710. .enable_reg = 0x45004,
  711. .enable_mask = BIT(10),
  712. .hw.init = &(struct clk_init_data){
  713. .name = "gcc_blsp1_ahb_clk",
  714. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  715. .num_parents = 1,
  716. .ops = &clk_branch2_ops,
  717. },
  718. },
  719. };
  720. static struct clk_branch gcc_blsp1_sleep_clk = {
  721. .halt_reg = 0x1004,
  722. .clkr = {
  723. .enable_reg = 0x1004,
  724. .enable_mask = BIT(0),
  725. .hw.init = &(struct clk_init_data){
  726. .name = "gcc_blsp1_sleep_clk",
  727. .parent_data = &(const struct clk_parent_data){
  728. .fw_name = "sleep_clk",
  729. },
  730. .num_parents = 1,
  731. .flags = CLK_SET_RATE_PARENT,
  732. .ops = &clk_branch2_ops,
  733. },
  734. },
  735. };
  736. static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
  737. .halt_reg = 0x2008,
  738. .clkr = {
  739. .enable_reg = 0x2008,
  740. .enable_mask = BIT(0),
  741. .hw.init = &(struct clk_init_data){
  742. .name = "gcc_blsp1_qup1_i2c_apps_clk",
  743. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup1_i2c_apps_clk_src.clkr.hw },
  744. .num_parents = 1,
  745. .flags = CLK_SET_RATE_PARENT,
  746. .ops = &clk_branch2_ops,
  747. },
  748. },
  749. };
  750. static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
  751. .halt_reg = 0x2004,
  752. .clkr = {
  753. .enable_reg = 0x2004,
  754. .enable_mask = BIT(0),
  755. .hw.init = &(struct clk_init_data){
  756. .name = "gcc_blsp1_qup1_spi_apps_clk",
  757. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup1_spi_apps_clk_src.clkr.hw },
  758. .num_parents = 1,
  759. .flags = CLK_SET_RATE_PARENT,
  760. .ops = &clk_branch2_ops,
  761. },
  762. },
  763. };
  764. static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
  765. .halt_reg = 0x3010,
  766. .clkr = {
  767. .enable_reg = 0x3010,
  768. .enable_mask = BIT(0),
  769. .hw.init = &(struct clk_init_data){
  770. .name = "gcc_blsp1_qup2_i2c_apps_clk",
  771. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup2_i2c_apps_clk_src.clkr.hw },
  772. .num_parents = 1,
  773. .flags = CLK_SET_RATE_PARENT,
  774. .ops = &clk_branch2_ops,
  775. },
  776. },
  777. };
  778. static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
  779. .halt_reg = 0x300c,
  780. .clkr = {
  781. .enable_reg = 0x300c,
  782. .enable_mask = BIT(0),
  783. .hw.init = &(struct clk_init_data){
  784. .name = "gcc_blsp1_qup2_spi_apps_clk",
  785. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup2_spi_apps_clk_src.clkr.hw },
  786. .num_parents = 1,
  787. .flags = CLK_SET_RATE_PARENT,
  788. .ops = &clk_branch2_ops,
  789. },
  790. },
  791. };
  792. static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
  793. .halt_reg = 0x4020,
  794. .clkr = {
  795. .enable_reg = 0x4020,
  796. .enable_mask = BIT(0),
  797. .hw.init = &(struct clk_init_data){
  798. .name = "gcc_blsp1_qup3_i2c_apps_clk",
  799. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup3_i2c_apps_clk_src.clkr.hw },
  800. .num_parents = 1,
  801. .flags = CLK_SET_RATE_PARENT,
  802. .ops = &clk_branch2_ops,
  803. },
  804. },
  805. };
  806. static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = {
  807. .halt_reg = 0x401c,
  808. .clkr = {
  809. .enable_reg = 0x401c,
  810. .enable_mask = BIT(0),
  811. .hw.init = &(struct clk_init_data){
  812. .name = "gcc_blsp1_qup3_spi_apps_clk",
  813. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup3_spi_apps_clk_src.clkr.hw },
  814. .num_parents = 1,
  815. .flags = CLK_SET_RATE_PARENT,
  816. .ops = &clk_branch2_ops,
  817. },
  818. },
  819. };
  820. static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
  821. .halt_reg = 0x5020,
  822. .clkr = {
  823. .enable_reg = 0x5020,
  824. .enable_mask = BIT(0),
  825. .hw.init = &(struct clk_init_data){
  826. .name = "gcc_blsp1_qup4_i2c_apps_clk",
  827. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup4_i2c_apps_clk_src.clkr.hw },
  828. .num_parents = 1,
  829. .flags = CLK_SET_RATE_PARENT,
  830. .ops = &clk_branch2_ops,
  831. },
  832. },
  833. };
  834. static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
  835. .halt_reg = 0x501c,
  836. .clkr = {
  837. .enable_reg = 0x501c,
  838. .enable_mask = BIT(0),
  839. .hw.init = &(struct clk_init_data){
  840. .name = "gcc_blsp1_qup4_spi_apps_clk",
  841. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup4_spi_apps_clk_src.clkr.hw },
  842. .num_parents = 1,
  843. .flags = CLK_SET_RATE_PARENT,
  844. .ops = &clk_branch2_ops,
  845. },
  846. },
  847. };
  848. static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
  849. .halt_reg = 0x6020,
  850. .clkr = {
  851. .enable_reg = 0x6020,
  852. .enable_mask = BIT(0),
  853. .hw.init = &(struct clk_init_data){
  854. .name = "gcc_blsp1_qup5_i2c_apps_clk",
  855. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup5_i2c_apps_clk_src.clkr.hw },
  856. .num_parents = 1,
  857. .flags = CLK_SET_RATE_PARENT,
  858. .ops = &clk_branch2_ops,
  859. },
  860. },
  861. };
  862. static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
  863. .halt_reg = 0x601c,
  864. .clkr = {
  865. .enable_reg = 0x601c,
  866. .enable_mask = BIT(0),
  867. .hw.init = &(struct clk_init_data){
  868. .name = "gcc_blsp1_qup5_spi_apps_clk",
  869. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup5_spi_apps_clk_src.clkr.hw },
  870. .num_parents = 1,
  871. .flags = CLK_SET_RATE_PARENT,
  872. .ops = &clk_branch2_ops,
  873. },
  874. },
  875. };
  876. static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
  877. .halt_reg = 0x7020,
  878. .clkr = {
  879. .enable_reg = 0x7020,
  880. .enable_mask = BIT(0),
  881. .hw.init = &(struct clk_init_data){
  882. .name = "gcc_blsp1_qup6_i2c_apps_clk",
  883. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup6_i2c_apps_clk_src.clkr.hw },
  884. .num_parents = 1,
  885. .flags = CLK_SET_RATE_PARENT,
  886. .ops = &clk_branch2_ops,
  887. },
  888. },
  889. };
  890. static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
  891. .halt_reg = 0x701c,
  892. .clkr = {
  893. .enable_reg = 0x701c,
  894. .enable_mask = BIT(0),
  895. .hw.init = &(struct clk_init_data){
  896. .name = "gcc_blsp1_qup6_spi_apps_clk",
  897. .parent_hws = (const struct clk_hw *[]){ &blsp1_qup6_spi_apps_clk_src.clkr.hw },
  898. .num_parents = 1,
  899. .flags = CLK_SET_RATE_PARENT,
  900. .ops = &clk_branch2_ops,
  901. },
  902. },
  903. };
  904. static struct clk_branch gcc_blsp1_uart1_apps_clk = {
  905. .halt_reg = 0x203c,
  906. .clkr = {
  907. .enable_reg = 0x203c,
  908. .enable_mask = BIT(0),
  909. .hw.init = &(struct clk_init_data){
  910. .name = "gcc_blsp1_uart1_apps_clk",
  911. .parent_hws = (const struct clk_hw *[]){ &blsp1_uart1_apps_clk_src.clkr.hw },
  912. .num_parents = 1,
  913. .flags = CLK_SET_RATE_PARENT,
  914. .ops = &clk_branch2_ops,
  915. },
  916. },
  917. };
  918. static struct clk_branch gcc_blsp1_uart2_apps_clk = {
  919. .halt_reg = 0x302c,
  920. .clkr = {
  921. .enable_reg = 0x302c,
  922. .enable_mask = BIT(0),
  923. .hw.init = &(struct clk_init_data){
  924. .name = "gcc_blsp1_uart2_apps_clk",
  925. .parent_hws = (const struct clk_hw *[]){ &blsp1_uart2_apps_clk_src.clkr.hw },
  926. .num_parents = 1,
  927. .flags = CLK_SET_RATE_PARENT,
  928. .ops = &clk_branch2_ops,
  929. },
  930. },
  931. };
  932. static struct clk_branch gcc_blsp1_uart3_apps_clk = {
  933. .halt_reg = 0x403c,
  934. .clkr = {
  935. .enable_reg = 0x403c,
  936. .enable_mask = BIT(0),
  937. .hw.init = &(struct clk_init_data){
  938. .name = "gcc_blsp1_uart3_apps_clk",
  939. .parent_hws = (const struct clk_hw *[]){ &blsp1_uart3_apps_clk_src.clkr.hw },
  940. .num_parents = 1,
  941. .flags = CLK_SET_RATE_PARENT,
  942. .ops = &clk_branch2_ops,
  943. },
  944. },
  945. };
  946. static struct clk_branch gcc_blsp1_uart4_apps_clk = {
  947. .halt_reg = 0x503c,
  948. .clkr = {
  949. .enable_reg = 0x503c,
  950. .enable_mask = BIT(0),
  951. .hw.init = &(struct clk_init_data){
  952. .name = "gcc_blsp1_uart4_apps_clk",
  953. .parent_hws = (const struct clk_hw *[]){ &blsp1_uart4_apps_clk_src.clkr.hw },
  954. .num_parents = 1,
  955. .flags = CLK_SET_RATE_PARENT,
  956. .ops = &clk_branch2_ops,
  957. },
  958. },
  959. };
  960. static struct clk_branch gcc_blsp1_uart5_apps_clk = {
  961. .halt_reg = 0x603c,
  962. .clkr = {
  963. .enable_reg = 0x603c,
  964. .enable_mask = BIT(0),
  965. .hw.init = &(struct clk_init_data){
  966. .name = "gcc_blsp1_uart5_apps_clk",
  967. .parent_hws = (const struct clk_hw *[]){ &blsp1_uart5_apps_clk_src.clkr.hw },
  968. .num_parents = 1,
  969. .flags = CLK_SET_RATE_PARENT,
  970. .ops = &clk_branch2_ops,
  971. },
  972. },
  973. };
  974. static struct clk_branch gcc_blsp1_uart6_apps_clk = {
  975. .halt_reg = 0x703c,
  976. .clkr = {
  977. .enable_reg = 0x703c,
  978. .enable_mask = BIT(0),
  979. .hw.init = &(struct clk_init_data){
  980. .name = "gcc_blsp1_uart6_apps_clk",
  981. .parent_hws = (const struct clk_hw *[]){ &blsp1_uart6_apps_clk_src.clkr.hw },
  982. .num_parents = 1,
  983. .flags = CLK_SET_RATE_PARENT,
  984. .ops = &clk_branch2_ops,
  985. },
  986. },
  987. };
  988. static struct clk_branch gcc_boot_rom_ahb_clk = {
  989. .halt_reg = 0x1300c,
  990. .halt_check = BRANCH_HALT_VOTED,
  991. .clkr = {
  992. .enable_reg = 0x45004,
  993. .enable_mask = BIT(7),
  994. .hw.init = &(struct clk_init_data){
  995. .name = "gcc_boot_rom_ahb_clk",
  996. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  997. .num_parents = 1,
  998. .ops = &clk_branch2_ops,
  999. },
  1000. },
  1001. };
  1002. static struct clk_branch gcc_crypto_ahb_clk = {
  1003. .halt_reg = 0x16024,
  1004. .halt_check = BRANCH_HALT_VOTED,
  1005. .clkr = {
  1006. .enable_reg = 0x45004,
  1007. .enable_mask = BIT(0),
  1008. .hw.init = &(struct clk_init_data){
  1009. .name = "gcc_crypto_ahb_clk",
  1010. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1011. .num_parents = 1,
  1012. .flags = CLK_SET_RATE_PARENT,
  1013. .ops = &clk_branch2_ops,
  1014. },
  1015. },
  1016. };
  1017. static struct clk_branch gcc_crypto_axi_clk = {
  1018. .halt_reg = 0x16020,
  1019. .halt_check = BRANCH_HALT_VOTED,
  1020. .clkr = {
  1021. .enable_reg = 0x45004,
  1022. .enable_mask = BIT(1),
  1023. .hw.init = &(struct clk_init_data){
  1024. .name = "gcc_crypto_axi_clk",
  1025. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1026. .num_parents = 1,
  1027. .flags = CLK_SET_RATE_PARENT,
  1028. .ops = &clk_branch2_ops,
  1029. },
  1030. },
  1031. };
  1032. static struct clk_branch gcc_crypto_clk = {
  1033. .halt_reg = 0x1601c,
  1034. .halt_check = BRANCH_HALT_VOTED,
  1035. .clkr = {
  1036. .enable_reg = 0x45004,
  1037. .enable_mask = BIT(2),
  1038. .hw.init = &(struct clk_init_data){
  1039. .name = "gcc_crypto_clk",
  1040. .parent_hws = (const struct clk_hw *[]){ &crypto_clk_src.clkr.hw },
  1041. .num_parents = 1,
  1042. .flags = CLK_SET_RATE_PARENT,
  1043. .ops = &clk_branch2_ops,
  1044. },
  1045. },
  1046. };
  1047. static struct clk_branch gcc_gp1_clk = {
  1048. .halt_reg = 0x08000,
  1049. .clkr = {
  1050. .enable_reg = 0x08000,
  1051. .enable_mask = BIT(0),
  1052. .hw.init = &(struct clk_init_data){
  1053. .name = "gcc_gp1_clk",
  1054. .parent_hws = (const struct clk_hw *[]){ &gp1_clk_src.clkr.hw },
  1055. .num_parents = 1,
  1056. .flags = CLK_SET_RATE_PARENT,
  1057. .ops = &clk_branch2_ops,
  1058. },
  1059. },
  1060. };
  1061. static struct clk_branch gcc_gp2_clk = {
  1062. .halt_reg = 0x09000,
  1063. .clkr = {
  1064. .enable_reg = 0x09000,
  1065. .enable_mask = BIT(0),
  1066. .hw.init = &(struct clk_init_data){
  1067. .name = "gcc_gp2_clk",
  1068. .parent_hws = (const struct clk_hw *[]){ &gp2_clk_src.clkr.hw },
  1069. .num_parents = 1,
  1070. .flags = CLK_SET_RATE_PARENT,
  1071. .ops = &clk_branch2_ops,
  1072. },
  1073. },
  1074. };
  1075. static struct clk_branch gcc_gp3_clk = {
  1076. .halt_reg = 0x0a000,
  1077. .clkr = {
  1078. .enable_reg = 0x0a000,
  1079. .enable_mask = BIT(0),
  1080. .hw.init = &(struct clk_init_data){
  1081. .name = "gcc_gp3_clk",
  1082. .parent_hws = (const struct clk_hw *[]){ &gp3_clk_src.clkr.hw },
  1083. .num_parents = 1,
  1084. .flags = CLK_SET_RATE_PARENT,
  1085. .ops = &clk_branch2_ops,
  1086. },
  1087. },
  1088. };
  1089. static struct clk_branch gcc_mss_cfg_ahb_clk = {
  1090. .halt_reg = 0x49000,
  1091. .clkr = {
  1092. .enable_reg = 0x49000,
  1093. .enable_mask = BIT(0),
  1094. .hw.init = &(struct clk_init_data){
  1095. .name = "gcc_mss_cfg_ahb_clk",
  1096. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1097. .num_parents = 1,
  1098. .flags = CLK_SET_RATE_PARENT,
  1099. .ops = &clk_branch2_ops,
  1100. },
  1101. },
  1102. };
  1103. static struct clk_branch gcc_pdm2_clk = {
  1104. .halt_reg = 0x4400c,
  1105. .clkr = {
  1106. .enable_reg = 0x4400c,
  1107. .enable_mask = BIT(0),
  1108. .hw.init = &(struct clk_init_data){
  1109. .name = "gcc_pdm2_clk",
  1110. .parent_hws = (const struct clk_hw *[]){ &pdm2_clk_src.clkr.hw },
  1111. .num_parents = 1,
  1112. .flags = CLK_SET_RATE_PARENT,
  1113. .ops = &clk_branch2_ops,
  1114. },
  1115. },
  1116. };
  1117. static struct clk_branch gcc_pdm_ahb_clk = {
  1118. .halt_reg = 0x44004,
  1119. .clkr = {
  1120. .enable_reg = 0x44004,
  1121. .enable_mask = BIT(0),
  1122. .hw.init = &(struct clk_init_data){
  1123. .name = "gcc_pdm_ahb_clk",
  1124. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1125. .num_parents = 1,
  1126. .flags = CLK_SET_RATE_PARENT,
  1127. .ops = &clk_branch2_ops,
  1128. },
  1129. },
  1130. };
  1131. static struct clk_branch gcc_prng_ahb_clk = {
  1132. .halt_reg = 0x13004,
  1133. .halt_check = BRANCH_HALT_VOTED,
  1134. .clkr = {
  1135. .enable_reg = 0x45004,
  1136. .enable_mask = BIT(8),
  1137. .hw.init = &(struct clk_init_data){
  1138. .name = "gcc_prng_ahb_clk",
  1139. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1140. .num_parents = 1,
  1141. .flags = CLK_SET_RATE_PARENT,
  1142. .ops = &clk_branch2_ops,
  1143. },
  1144. },
  1145. };
  1146. static struct clk_branch gcc_sdcc1_ahb_clk = {
  1147. .halt_reg = 0x4201c,
  1148. .clkr = {
  1149. .enable_reg = 0x4201c,
  1150. .enable_mask = BIT(0),
  1151. .hw.init = &(struct clk_init_data){
  1152. .name = "gcc_sdcc1_ahb_clk",
  1153. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1154. .num_parents = 1,
  1155. .flags = CLK_SET_RATE_PARENT,
  1156. .ops = &clk_branch2_ops,
  1157. },
  1158. },
  1159. };
  1160. static struct clk_branch gcc_sdcc1_apps_clk = {
  1161. .halt_reg = 0x42018,
  1162. .clkr = {
  1163. .enable_reg = 0x42018,
  1164. .enable_mask = BIT(0),
  1165. .hw.init = &(struct clk_init_data){
  1166. .name = "gcc_sdcc1_apps_clk",
  1167. .parent_hws = (const struct clk_hw *[]){ &sdcc1_apps_clk_src.clkr.hw },
  1168. .num_parents = 1,
  1169. .flags = CLK_SET_RATE_PARENT,
  1170. .ops = &clk_branch2_ops,
  1171. },
  1172. },
  1173. };
  1174. static struct clk_branch gcc_sdcc2_ahb_clk = {
  1175. .halt_reg = 0x4301c,
  1176. .clkr = {
  1177. .enable_reg = 0x4301c,
  1178. .enable_mask = BIT(0),
  1179. .hw.init = &(struct clk_init_data){
  1180. .name = "gcc_sdcc2_ahb_clk",
  1181. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1182. .num_parents = 1,
  1183. .flags = CLK_SET_RATE_PARENT,
  1184. .ops = &clk_branch2_ops,
  1185. },
  1186. },
  1187. };
  1188. static struct clk_branch gcc_sdcc2_apps_clk = {
  1189. .halt_reg = 0x43018,
  1190. .clkr = {
  1191. .enable_reg = 0x43018,
  1192. .enable_mask = BIT(0),
  1193. .hw.init = &(struct clk_init_data){
  1194. .name = "gcc_sdcc2_apps_clk",
  1195. .parent_hws = (const struct clk_hw *[]){ &sdcc2_apps_clk_src.clkr.hw },
  1196. .num_parents = 1,
  1197. .flags = CLK_SET_RATE_PARENT,
  1198. .ops = &clk_branch2_ops,
  1199. },
  1200. },
  1201. };
  1202. static struct clk_rcg2 bimc_ddr_clk_src = {
  1203. .cmd_rcgr = 0x32004,
  1204. .hid_width = 5,
  1205. .parent_map = gcc_xo_gpll0_bimc_map,
  1206. .clkr.hw.init = &(struct clk_init_data){
  1207. .name = "bimc_ddr_clk_src",
  1208. .parent_data = gcc_xo_gpll0_bimc,
  1209. .num_parents = 3,
  1210. .ops = &clk_rcg2_ops,
  1211. .flags = CLK_GET_RATE_NOCACHE,
  1212. },
  1213. };
  1214. static struct clk_branch gcc_mss_q6_bimc_axi_clk = {
  1215. .halt_reg = 0x49004,
  1216. .clkr = {
  1217. .enable_reg = 0x49004,
  1218. .enable_mask = BIT(0),
  1219. .hw.init = &(struct clk_init_data){
  1220. .name = "gcc_mss_q6_bimc_axi_clk",
  1221. .parent_hws = (const struct clk_hw *[]){ &bimc_ddr_clk_src.clkr.hw },
  1222. .num_parents = 1,
  1223. .flags = CLK_SET_RATE_PARENT,
  1224. .ops = &clk_branch2_ops,
  1225. },
  1226. },
  1227. };
  1228. static struct clk_branch gcc_apss_tcu_clk = {
  1229. .halt_reg = 0x12018,
  1230. .halt_check = BRANCH_HALT_VOTED,
  1231. .clkr = {
  1232. .enable_reg = 0x4500c,
  1233. .enable_mask = BIT(1),
  1234. .hw.init = &(struct clk_init_data){
  1235. .name = "gcc_apss_tcu_clk",
  1236. .parent_hws = (const struct clk_hw *[]){ &bimc_ddr_clk_src.clkr.hw },
  1237. .num_parents = 1,
  1238. .ops = &clk_branch2_ops,
  1239. },
  1240. },
  1241. };
  1242. static struct clk_branch gcc_smmu_cfg_clk = {
  1243. .halt_reg = 0x12038,
  1244. .halt_check = BRANCH_HALT_VOTED,
  1245. .clkr = {
  1246. .enable_reg = 0x4500c,
  1247. .enable_mask = BIT(12),
  1248. .hw.init = &(struct clk_init_data){
  1249. .name = "gcc_smmu_cfg_clk",
  1250. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1251. .num_parents = 1,
  1252. .flags = CLK_SET_RATE_PARENT,
  1253. .ops = &clk_branch2_ops,
  1254. },
  1255. },
  1256. };
  1257. static struct clk_branch gcc_qdss_dap_clk = {
  1258. .halt_reg = 0x29084,
  1259. .halt_check = BRANCH_HALT_VOTED,
  1260. .clkr = {
  1261. .enable_reg = 0x45004,
  1262. .enable_mask = BIT(19),
  1263. .hw.init = &(struct clk_init_data){
  1264. .name = "gcc_qdss_dap_clk",
  1265. .parent_data = &(const struct clk_parent_data){
  1266. .fw_name = "xo",
  1267. },
  1268. .num_parents = 1,
  1269. .ops = &clk_branch2_ops,
  1270. },
  1271. },
  1272. };
  1273. static struct clk_branch gcc_usb2a_phy_sleep_clk = {
  1274. .halt_reg = 0x4102c,
  1275. .clkr = {
  1276. .enable_reg = 0x4102c,
  1277. .enable_mask = BIT(0),
  1278. .hw.init = &(struct clk_init_data){
  1279. .name = "gcc_usb2a_phy_sleep_clk",
  1280. .parent_data = &(const struct clk_parent_data){
  1281. .fw_name = "sleep_clk",
  1282. },
  1283. .num_parents = 1,
  1284. .flags = CLK_SET_RATE_PARENT,
  1285. .ops = &clk_branch2_ops,
  1286. },
  1287. },
  1288. };
  1289. static struct clk_branch gcc_usb_hs_phy_cfg_ahb_clk = {
  1290. .halt_reg = 0x41030,
  1291. .halt_check = BRANCH_HALT,
  1292. .clkr = {
  1293. .enable_reg = 0x41030,
  1294. .enable_mask = BIT(0),
  1295. .hw.init = &(struct clk_init_data){
  1296. .name = "gcc_usb_hs_phy_cfg_ahb_clk",
  1297. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1298. .num_parents = 1,
  1299. .flags = CLK_SET_RATE_PARENT,
  1300. .ops = &clk_branch2_ops,
  1301. },
  1302. },
  1303. };
  1304. static struct clk_branch gcc_usb_hs_ahb_clk = {
  1305. .halt_reg = 0x41008,
  1306. .clkr = {
  1307. .enable_reg = 0x41008,
  1308. .enable_mask = BIT(0),
  1309. .hw.init = &(struct clk_init_data){
  1310. .name = "gcc_usb_hs_ahb_clk",
  1311. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1312. .num_parents = 1,
  1313. .flags = CLK_SET_RATE_PARENT,
  1314. .ops = &clk_branch2_ops,
  1315. },
  1316. },
  1317. };
  1318. static struct clk_branch gcc_usb_hs_system_clk = {
  1319. .halt_reg = 0x41004,
  1320. .clkr = {
  1321. .enable_reg = 0x41004,
  1322. .enable_mask = BIT(0),
  1323. .hw.init = &(struct clk_init_data){
  1324. .name = "gcc_usb_hs_system_clk",
  1325. .parent_hws = (const struct clk_hw *[]){ &usb_hs_system_clk_src.clkr.hw },
  1326. .num_parents = 1,
  1327. .flags = CLK_SET_RATE_PARENT,
  1328. .ops = &clk_branch2_ops,
  1329. },
  1330. },
  1331. };
  1332. static struct clk_branch gcc_apss_ahb_clk = {
  1333. .halt_reg = 0x4601c,
  1334. .halt_check = BRANCH_HALT_VOTED,
  1335. .clkr = {
  1336. .enable_reg = 0x45004,
  1337. .enable_mask = BIT(14),
  1338. .hw.init = &(struct clk_init_data){
  1339. .name = "gcc_apss_ahb_clk",
  1340. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1341. .num_parents = 1,
  1342. .ops = &clk_branch2_ops,
  1343. },
  1344. },
  1345. };
  1346. static struct clk_branch gcc_apss_axi_clk = {
  1347. .halt_reg = 0x4601c,
  1348. .halt_check = BRANCH_HALT_VOTED,
  1349. .clkr = {
  1350. .enable_reg = 0x45004,
  1351. .enable_mask = BIT(13),
  1352. .hw.init = &(struct clk_init_data){
  1353. .name = "gcc_apss_axi_clk",
  1354. .parent_hws = (const struct clk_hw *[]){ &pcnoc_bfdcd_clk_src.clkr.hw },
  1355. .num_parents = 1,
  1356. .ops = &clk_branch2_ops,
  1357. },
  1358. },
  1359. };
  1360. static struct clk_regmap *gcc_mdm9607_clocks[] = {
  1361. [GPLL0] = &gpll0.clkr,
  1362. [GPLL0_EARLY] = &gpll0_early.clkr,
  1363. [GPLL1] = &gpll1.clkr,
  1364. [GPLL1_VOTE] = &gpll1_vote,
  1365. [GPLL2] = &gpll2.clkr,
  1366. [GPLL2_EARLY] = &gpll2_early.clkr,
  1367. [BIMC_PLL] = &bimc_pll.clkr,
  1368. [BIMC_PLL_VOTE] = &bimc_pll_vote,
  1369. [BIMC_DDR_CLK_SRC] = &bimc_ddr_clk_src.clkr,
  1370. [PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
  1371. [SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
  1372. [APSS_AHB_CLK_SRC] = &apss_ahb_clk_src.clkr,
  1373. [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
  1374. [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
  1375. [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
  1376. [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
  1377. [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
  1378. [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
  1379. [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
  1380. [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
  1381. [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
  1382. [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
  1383. [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
  1384. [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
  1385. [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
  1386. [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
  1387. [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
  1388. [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr,
  1389. [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr,
  1390. [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr,
  1391. [CRYPTO_CLK_SRC] = &crypto_clk_src.clkr,
  1392. [GP1_CLK_SRC] = &gp1_clk_src.clkr,
  1393. [GP2_CLK_SRC] = &gp2_clk_src.clkr,
  1394. [GP3_CLK_SRC] = &gp3_clk_src.clkr,
  1395. [PDM2_CLK_SRC] = &pdm2_clk_src.clkr,
  1396. [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr,
  1397. [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
  1398. [APSS_TCU_CLK_SRC] = &apss_tcu_clk_src.clkr,
  1399. [USB_HS_SYSTEM_CLK_SRC] = &usb_hs_system_clk_src.clkr,
  1400. [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
  1401. [GCC_BLSP1_SLEEP_CLK] = &gcc_blsp1_sleep_clk.clkr,
  1402. [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
  1403. [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
  1404. [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
  1405. [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
  1406. [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
  1407. [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
  1408. [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
  1409. [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
  1410. [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
  1411. [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
  1412. [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
  1413. [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
  1414. [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
  1415. [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
  1416. [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
  1417. [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr,
  1418. [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr,
  1419. [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr,
  1420. [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
  1421. [GCC_CRYPTO_AHB_CLK] = &gcc_crypto_ahb_clk.clkr,
  1422. [GCC_CRYPTO_AXI_CLK] = &gcc_crypto_axi_clk.clkr,
  1423. [GCC_CRYPTO_CLK] = &gcc_crypto_clk.clkr,
  1424. [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
  1425. [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
  1426. [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
  1427. [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
  1428. [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
  1429. [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
  1430. [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
  1431. [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
  1432. [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
  1433. [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
  1434. [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
  1435. [GCC_SMMU_CFG_CLK] = &gcc_smmu_cfg_clk.clkr,
  1436. [GCC_USB2A_PHY_SLEEP_CLK] = &gcc_usb2a_phy_sleep_clk.clkr,
  1437. [GCC_USB_HS_PHY_CFG_AHB_CLK] = &gcc_usb_hs_phy_cfg_ahb_clk.clkr,
  1438. [GCC_USB_HS_AHB_CLK] = &gcc_usb_hs_ahb_clk.clkr,
  1439. [GCC_USB_HS_SYSTEM_CLK] = &gcc_usb_hs_system_clk.clkr,
  1440. [GCC_APSS_TCU_CLK] = &gcc_apss_tcu_clk.clkr,
  1441. [GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr,
  1442. [GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr,
  1443. [GCC_APSS_AHB_CLK] = &gcc_apss_ahb_clk.clkr,
  1444. [GCC_APSS_AXI_CLK] = &gcc_apss_axi_clk.clkr,
  1445. [GCC_USB_HSIC_CLK_SRC] = &usb_hsic_clk_src.clkr,
  1446. [GCC_USB_HSIC_IO_CAL_CLK_SRC] = &usb_hsic_io_cal_clk_src.clkr,
  1447. [GCC_USB_HSIC_SYSTEM_CLK_SRC] = &usb_hsic_system_clk_src.clkr,
  1448. };
  1449. static const struct qcom_reset_map gcc_mdm9607_resets[] = {
  1450. [USB_HS_HSIC_BCR] = { 0x3d05c },
  1451. [GCC_MSS_RESTART] = { 0x3e000 },
  1452. [USB_HS_BCR] = { 0x41000 },
  1453. [USB2_HS_PHY_ONLY_BCR] = { 0x41034 },
  1454. [QUSB2_PHY_BCR] = { 0x4103c },
  1455. };
  1456. static const struct regmap_config gcc_mdm9607_regmap_config = {
  1457. .reg_bits = 32,
  1458. .reg_stride = 4,
  1459. .val_bits = 32,
  1460. .max_register = 0x80000,
  1461. .fast_io = true,
  1462. };
  1463. static const struct qcom_cc_desc gcc_mdm9607_desc = {
  1464. .config = &gcc_mdm9607_regmap_config,
  1465. .clks = gcc_mdm9607_clocks,
  1466. .num_clks = ARRAY_SIZE(gcc_mdm9607_clocks),
  1467. .resets = gcc_mdm9607_resets,
  1468. .num_resets = ARRAY_SIZE(gcc_mdm9607_resets),
  1469. };
  1470. static const struct of_device_id gcc_mdm9607_match_table[] = {
  1471. { .compatible = "qcom,gcc-mdm9607" },
  1472. { }
  1473. };
  1474. MODULE_DEVICE_TABLE(of, gcc_mdm9607_match_table);
  1475. static int gcc_mdm9607_probe(struct platform_device *pdev)
  1476. {
  1477. struct regmap *regmap;
  1478. regmap = qcom_cc_map(pdev, &gcc_mdm9607_desc);
  1479. if (IS_ERR(regmap))
  1480. return PTR_ERR(regmap);
  1481. /* Vote for GPLL0 to turn on. Needed by acpuclock. */
  1482. regmap_update_bits(regmap, 0x45000, BIT(0), BIT(0));
  1483. return qcom_cc_really_probe(&pdev->dev, &gcc_mdm9607_desc, regmap);
  1484. }
  1485. static struct platform_driver gcc_mdm9607_driver = {
  1486. .probe = gcc_mdm9607_probe,
  1487. .driver = {
  1488. .name = "gcc-mdm9607",
  1489. .of_match_table = gcc_mdm9607_match_table,
  1490. },
  1491. };
  1492. static int __init gcc_mdm9607_init(void)
  1493. {
  1494. return platform_driver_register(&gcc_mdm9607_driver);
  1495. }
  1496. core_initcall(gcc_mdm9607_init);
  1497. static void __exit gcc_mdm9607_exit(void)
  1498. {
  1499. platform_driver_unregister(&gcc_mdm9607_driver);
  1500. }
  1501. module_exit(gcc_mdm9607_exit);
  1502. MODULE_DESCRIPTION("Qualcomm GCC mdm9607 Driver");
  1503. MODULE_LICENSE("GPL v2");