sdx75.c 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. */
  6. #include <linux/device.h>
  7. #include <linux/interconnect.h>
  8. #include <linux/interconnect-provider.h>
  9. #include <linux/module.h>
  10. #include <linux/of_platform.h>
  11. #include <dt-bindings/interconnect/qcom,sdx75.h>
  12. #include "bcm-voter.h"
  13. #include "icc-common.h"
  14. #include "icc-rpmh.h"
  15. static struct qcom_icc_node qup0_core_master;
  16. static struct qcom_icc_node qnm_cnoc;
  17. static struct qcom_icc_node alm_sys_tcu;
  18. static struct qcom_icc_node chm_apps;
  19. static struct qcom_icc_node qnm_gemnoc_cfg;
  20. static struct qcom_icc_node qnm_mdsp;
  21. static struct qcom_icc_node qnm_pcie;
  22. static struct qcom_icc_node qnm_snoc_sf;
  23. static struct qcom_icc_node xm_gic;
  24. static struct qcom_icc_node xm_ipa2pcie;
  25. static struct qcom_icc_node llcc_mc;
  26. static struct qcom_icc_node xm_pcie3_0;
  27. static struct qcom_icc_node xm_pcie3_1;
  28. static struct qcom_icc_node xm_pcie3_2;
  29. static struct qcom_icc_node qhm_audio;
  30. static struct qcom_icc_node qhm_gic;
  31. static struct qcom_icc_node qhm_pcie_rscc;
  32. static struct qcom_icc_node qhm_qdss_bam;
  33. static struct qcom_icc_node qhm_qpic;
  34. static struct qcom_icc_node qhm_qup0;
  35. static struct qcom_icc_node qnm_aggre_noc;
  36. static struct qcom_icc_node qnm_gemnoc_cnoc;
  37. static struct qcom_icc_node qnm_gemnoc_pcie;
  38. static struct qcom_icc_node qnm_system_noc_cfg;
  39. static struct qcom_icc_node qnm_system_noc_pcie_cfg;
  40. static struct qcom_icc_node qxm_crypto;
  41. static struct qcom_icc_node qxm_ipa;
  42. static struct qcom_icc_node qxm_mvmss;
  43. static struct qcom_icc_node xm_emac_0;
  44. static struct qcom_icc_node xm_emac_1;
  45. static struct qcom_icc_node xm_qdss_etr0;
  46. static struct qcom_icc_node xm_qdss_etr1;
  47. static struct qcom_icc_node xm_sdc1;
  48. static struct qcom_icc_node xm_sdc4;
  49. static struct qcom_icc_node xm_usb3;
  50. static struct qcom_icc_node qup0_core_slave;
  51. static struct qcom_icc_node qhs_lagg;
  52. static struct qcom_icc_node qhs_mccc_master;
  53. static struct qcom_icc_node qns_gemnoc;
  54. static struct qcom_icc_node qss_snoop_bwmon;
  55. static struct qcom_icc_node qns_gemnoc_cnoc;
  56. static struct qcom_icc_node qns_llcc;
  57. static struct qcom_icc_node qns_pcie;
  58. static struct qcom_icc_node srvc_gemnoc;
  59. static struct qcom_icc_node ebi;
  60. static struct qcom_icc_node qns_pcie_gemnoc;
  61. static struct qcom_icc_node ps_eth0_cfg;
  62. static struct qcom_icc_node ps_eth1_cfg;
  63. static struct qcom_icc_node qhs_audio;
  64. static struct qcom_icc_node qhs_clk_ctl;
  65. static struct qcom_icc_node qhs_crypto_cfg;
  66. static struct qcom_icc_node qhs_imem_cfg;
  67. static struct qcom_icc_node qhs_ipa;
  68. static struct qcom_icc_node qhs_ipc_router;
  69. static struct qcom_icc_node qhs_mss_cfg;
  70. static struct qcom_icc_node qhs_mvmss_cfg;
  71. static struct qcom_icc_node qhs_pcie0_cfg;
  72. static struct qcom_icc_node qhs_pcie1_cfg;
  73. static struct qcom_icc_node qhs_pcie2_cfg;
  74. static struct qcom_icc_node qhs_pcie_rscc;
  75. static struct qcom_icc_node qhs_pdm;
  76. static struct qcom_icc_node qhs_prng;
  77. static struct qcom_icc_node qhs_qdss_cfg;
  78. static struct qcom_icc_node qhs_qpic;
  79. static struct qcom_icc_node qhs_qup0;
  80. static struct qcom_icc_node qhs_sdc1;
  81. static struct qcom_icc_node qhs_sdc4;
  82. static struct qcom_icc_node qhs_spmi_vgi_coex;
  83. static struct qcom_icc_node qhs_tcsr;
  84. static struct qcom_icc_node qhs_tlmm;
  85. static struct qcom_icc_node qhs_usb3;
  86. static struct qcom_icc_node qhs_usb3_phy;
  87. static struct qcom_icc_node qns_a1noc;
  88. static struct qcom_icc_node qns_ddrss_cfg;
  89. static struct qcom_icc_node qns_gemnoc_sf;
  90. static struct qcom_icc_node qns_system_noc_cfg;
  91. static struct qcom_icc_node qns_system_noc_pcie_cfg;
  92. static struct qcom_icc_node qxs_imem;
  93. static struct qcom_icc_node srvc_pcie_system_noc;
  94. static struct qcom_icc_node srvc_system_noc;
  95. static struct qcom_icc_node xs_pcie_0;
  96. static struct qcom_icc_node xs_pcie_1;
  97. static struct qcom_icc_node xs_pcie_2;
  98. static struct qcom_icc_node xs_qdss_stm;
  99. static struct qcom_icc_node xs_sys_tcu_cfg;
  100. static struct qcom_icc_node qup0_core_master = {
  101. .name = "qup0_core_master",
  102. .channels = 1,
  103. .buswidth = 4,
  104. .num_links = 1,
  105. .link_nodes = { &qup0_core_slave },
  106. };
  107. static struct qcom_icc_node qnm_cnoc = {
  108. .name = "qnm_cnoc",
  109. .channels = 1,
  110. .buswidth = 4,
  111. .num_links = 4,
  112. .link_nodes = { &qhs_lagg, &qhs_mccc_master,
  113. &qns_gemnoc, &qss_snoop_bwmon },
  114. };
  115. static struct qcom_icc_node alm_sys_tcu = {
  116. .name = "alm_sys_tcu",
  117. .channels = 1,
  118. .buswidth = 8,
  119. .num_links = 2,
  120. .link_nodes = { &qns_gemnoc_cnoc, &qns_llcc },
  121. };
  122. static struct qcom_icc_node chm_apps = {
  123. .name = "chm_apps",
  124. .channels = 1,
  125. .buswidth = 16,
  126. .num_links = 3,
  127. .link_nodes = { &qns_gemnoc_cnoc, &qns_llcc,
  128. &qns_pcie },
  129. };
  130. static struct qcom_icc_node qnm_gemnoc_cfg = {
  131. .name = "qnm_gemnoc_cfg",
  132. .channels = 1,
  133. .buswidth = 4,
  134. .num_links = 1,
  135. .link_nodes = { &srvc_gemnoc },
  136. };
  137. static struct qcom_icc_node qnm_mdsp = {
  138. .name = "qnm_mdsp",
  139. .channels = 1,
  140. .buswidth = 16,
  141. .num_links = 3,
  142. .link_nodes = { &qns_gemnoc_cnoc, &qns_llcc,
  143. &qns_pcie },
  144. };
  145. static struct qcom_icc_node qnm_pcie = {
  146. .name = "qnm_pcie",
  147. .channels = 1,
  148. .buswidth = 16,
  149. .num_links = 2,
  150. .link_nodes = { &qns_gemnoc_cnoc, &qns_llcc },
  151. };
  152. static struct qcom_icc_node qnm_snoc_sf = {
  153. .name = "qnm_snoc_sf",
  154. .channels = 1,
  155. .buswidth = 16,
  156. .num_links = 3,
  157. .link_nodes = { &qns_gemnoc_cnoc, &qns_llcc,
  158. &qns_pcie },
  159. };
  160. static struct qcom_icc_node xm_gic = {
  161. .name = "xm_gic",
  162. .channels = 1,
  163. .buswidth = 8,
  164. .num_links = 1,
  165. .link_nodes = { &qns_llcc },
  166. };
  167. static struct qcom_icc_node xm_ipa2pcie = {
  168. .name = "xm_ipa2pcie",
  169. .channels = 1,
  170. .buswidth = 8,
  171. .num_links = 1,
  172. .link_nodes = { &qns_pcie },
  173. };
  174. static struct qcom_icc_node llcc_mc = {
  175. .name = "llcc_mc",
  176. .channels = 1,
  177. .buswidth = 4,
  178. .num_links = 1,
  179. .link_nodes = { &ebi },
  180. };
  181. static struct qcom_icc_node xm_pcie3_0 = {
  182. .name = "xm_pcie3_0",
  183. .channels = 1,
  184. .buswidth = 8,
  185. .num_links = 1,
  186. .link_nodes = { &qns_pcie_gemnoc },
  187. };
  188. static struct qcom_icc_node xm_pcie3_1 = {
  189. .name = "xm_pcie3_1",
  190. .channels = 1,
  191. .buswidth = 8,
  192. .num_links = 1,
  193. .link_nodes = { &qns_pcie_gemnoc },
  194. };
  195. static struct qcom_icc_node xm_pcie3_2 = {
  196. .name = "xm_pcie3_2",
  197. .channels = 1,
  198. .buswidth = 8,
  199. .num_links = 1,
  200. .link_nodes = { &qns_pcie_gemnoc },
  201. };
  202. static struct qcom_icc_node qhm_audio = {
  203. .name = "qhm_audio",
  204. .channels = 1,
  205. .buswidth = 4,
  206. .num_links = 1,
  207. .link_nodes = { &qns_gemnoc_sf },
  208. };
  209. static struct qcom_icc_node qhm_gic = {
  210. .name = "qhm_gic",
  211. .channels = 1,
  212. .buswidth = 4,
  213. .num_links = 1,
  214. .link_nodes = { &qns_gemnoc_sf },
  215. };
  216. static struct qcom_icc_node qhm_pcie_rscc = {
  217. .name = "qhm_pcie_rscc",
  218. .channels = 1,
  219. .buswidth = 4,
  220. .num_links = 31,
  221. .link_nodes = { &ps_eth0_cfg, &ps_eth1_cfg,
  222. &qhs_audio, &qhs_clk_ctl,
  223. &qhs_crypto_cfg, &qhs_imem_cfg,
  224. &qhs_ipa, &qhs_ipc_router,
  225. &qhs_mss_cfg, &qhs_mvmss_cfg,
  226. &qhs_pcie0_cfg, &qhs_pcie1_cfg,
  227. &qhs_pcie2_cfg, &qhs_pdm,
  228. &qhs_prng, &qhs_qdss_cfg,
  229. &qhs_qpic, &qhs_qup0,
  230. &qhs_sdc1, &qhs_sdc4,
  231. &qhs_spmi_vgi_coex, &qhs_tcsr,
  232. &qhs_tlmm, &qhs_usb3,
  233. &qhs_usb3_phy, &qns_ddrss_cfg,
  234. &qns_system_noc_cfg, &qns_system_noc_pcie_cfg,
  235. &qxs_imem, &xs_qdss_stm,
  236. &xs_sys_tcu_cfg },
  237. };
  238. static struct qcom_icc_node qhm_qdss_bam = {
  239. .name = "qhm_qdss_bam",
  240. .channels = 1,
  241. .buswidth = 4,
  242. .num_links = 1,
  243. .link_nodes = { &qns_a1noc },
  244. };
  245. static struct qcom_icc_node qhm_qpic = {
  246. .name = "qhm_qpic",
  247. .channels = 1,
  248. .buswidth = 4,
  249. .num_links = 1,
  250. .link_nodes = { &qns_a1noc },
  251. };
  252. static struct qcom_icc_node qhm_qup0 = {
  253. .name = "qhm_qup0",
  254. .channels = 1,
  255. .buswidth = 4,
  256. .num_links = 1,
  257. .link_nodes = { &qns_a1noc },
  258. };
  259. static struct qcom_icc_node qnm_aggre_noc = {
  260. .name = "qnm_aggre_noc",
  261. .channels = 1,
  262. .buswidth = 8,
  263. .num_links = 1,
  264. .link_nodes = { &qns_gemnoc_sf },
  265. };
  266. static struct qcom_icc_node qnm_gemnoc_cnoc = {
  267. .name = "qnm_gemnoc_cnoc",
  268. .channels = 1,
  269. .buswidth = 8,
  270. .num_links = 32,
  271. .link_nodes = { &ps_eth0_cfg, &ps_eth1_cfg,
  272. &qhs_audio, &qhs_clk_ctl,
  273. &qhs_crypto_cfg, &qhs_imem_cfg,
  274. &qhs_ipa, &qhs_ipc_router,
  275. &qhs_mss_cfg, &qhs_mvmss_cfg,
  276. &qhs_pcie0_cfg, &qhs_pcie1_cfg,
  277. &qhs_pcie2_cfg, &qhs_pcie_rscc,
  278. &qhs_pdm, &qhs_prng,
  279. &qhs_qdss_cfg, &qhs_qpic,
  280. &qhs_qup0, &qhs_sdc1,
  281. &qhs_sdc4, &qhs_spmi_vgi_coex,
  282. &qhs_tcsr, &qhs_tlmm,
  283. &qhs_usb3, &qhs_usb3_phy,
  284. &qns_ddrss_cfg, &qns_system_noc_cfg,
  285. &qns_system_noc_pcie_cfg, &qxs_imem,
  286. &xs_qdss_stm, &xs_sys_tcu_cfg },
  287. };
  288. static struct qcom_icc_node qnm_gemnoc_pcie = {
  289. .name = "qnm_gemnoc_pcie",
  290. .channels = 1,
  291. .buswidth = 16,
  292. .num_links = 3,
  293. .link_nodes = { &xs_pcie_0, &xs_pcie_1,
  294. &xs_pcie_2 },
  295. };
  296. static struct qcom_icc_node qnm_system_noc_cfg = {
  297. .name = "qnm_system_noc_cfg",
  298. .channels = 1,
  299. .buswidth = 4,
  300. .num_links = 1,
  301. .link_nodes = { &srvc_system_noc },
  302. };
  303. static struct qcom_icc_node qnm_system_noc_pcie_cfg = {
  304. .name = "qnm_system_noc_pcie_cfg",
  305. .channels = 1,
  306. .buswidth = 4,
  307. .num_links = 1,
  308. .link_nodes = { &srvc_pcie_system_noc },
  309. };
  310. static struct qcom_icc_node qxm_crypto = {
  311. .name = "qxm_crypto",
  312. .channels = 1,
  313. .buswidth = 8,
  314. .num_links = 1,
  315. .link_nodes = { &qns_a1noc },
  316. };
  317. static struct qcom_icc_node qxm_ipa = {
  318. .name = "qxm_ipa",
  319. .channels = 1,
  320. .buswidth = 8,
  321. .num_links = 1,
  322. .link_nodes = { &qns_gemnoc_sf },
  323. };
  324. static struct qcom_icc_node qxm_mvmss = {
  325. .name = "qxm_mvmss",
  326. .channels = 1,
  327. .buswidth = 8,
  328. .num_links = 1,
  329. .link_nodes = { &qns_a1noc },
  330. };
  331. static struct qcom_icc_node xm_emac_0 = {
  332. .name = "xm_emac_0",
  333. .channels = 1,
  334. .buswidth = 8,
  335. .num_links = 1,
  336. .link_nodes = { &qns_a1noc },
  337. };
  338. static struct qcom_icc_node xm_emac_1 = {
  339. .name = "xm_emac_1",
  340. .channels = 1,
  341. .buswidth = 8,
  342. .num_links = 1,
  343. .link_nodes = { &qns_a1noc },
  344. };
  345. static struct qcom_icc_node xm_qdss_etr0 = {
  346. .name = "xm_qdss_etr0",
  347. .channels = 1,
  348. .buswidth = 8,
  349. .num_links = 1,
  350. .link_nodes = { &qns_a1noc },
  351. };
  352. static struct qcom_icc_node xm_qdss_etr1 = {
  353. .name = "xm_qdss_etr1",
  354. .channels = 1,
  355. .buswidth = 8,
  356. .num_links = 1,
  357. .link_nodes = { &qns_a1noc },
  358. };
  359. static struct qcom_icc_node xm_sdc1 = {
  360. .name = "xm_sdc1",
  361. .channels = 1,
  362. .buswidth = 8,
  363. .num_links = 1,
  364. .link_nodes = { &qns_a1noc },
  365. };
  366. static struct qcom_icc_node xm_sdc4 = {
  367. .name = "xm_sdc4",
  368. .channels = 1,
  369. .buswidth = 8,
  370. .num_links = 1,
  371. .link_nodes = { &qns_a1noc },
  372. };
  373. static struct qcom_icc_node xm_usb3 = {
  374. .name = "xm_usb3",
  375. .channels = 1,
  376. .buswidth = 8,
  377. .num_links = 1,
  378. .link_nodes = { &qns_a1noc },
  379. };
  380. static struct qcom_icc_node qup0_core_slave = {
  381. .name = "qup0_core_slave",
  382. .channels = 1,
  383. .buswidth = 4,
  384. };
  385. static struct qcom_icc_node qhs_lagg = {
  386. .name = "qhs_lagg",
  387. .channels = 1,
  388. .buswidth = 4,
  389. };
  390. static struct qcom_icc_node qhs_mccc_master = {
  391. .name = "qhs_mccc_master",
  392. .channels = 1,
  393. .buswidth = 4,
  394. };
  395. static struct qcom_icc_node qns_gemnoc = {
  396. .name = "qns_gemnoc",
  397. .channels = 1,
  398. .buswidth = 4,
  399. };
  400. static struct qcom_icc_node qss_snoop_bwmon = {
  401. .name = "qss_snoop_bwmon",
  402. .channels = 1,
  403. .buswidth = 4,
  404. };
  405. static struct qcom_icc_node qns_gemnoc_cnoc = {
  406. .name = "qns_gemnoc_cnoc",
  407. .channels = 1,
  408. .buswidth = 8,
  409. .num_links = 1,
  410. .link_nodes = { &qnm_gemnoc_cnoc },
  411. };
  412. static struct qcom_icc_node qns_llcc = {
  413. .name = "qns_llcc",
  414. .channels = 1,
  415. .buswidth = 16,
  416. .num_links = 1,
  417. .link_nodes = { &llcc_mc },
  418. };
  419. static struct qcom_icc_node qns_pcie = {
  420. .name = "qns_pcie",
  421. .channels = 1,
  422. .buswidth = 16,
  423. .num_links = 1,
  424. .link_nodes = { &qnm_gemnoc_pcie },
  425. };
  426. static struct qcom_icc_node srvc_gemnoc = {
  427. .name = "srvc_gemnoc",
  428. .channels = 1,
  429. .buswidth = 4,
  430. };
  431. static struct qcom_icc_node ebi = {
  432. .name = "ebi",
  433. .channels = 1,
  434. .buswidth = 4,
  435. };
  436. static struct qcom_icc_node qns_pcie_gemnoc = {
  437. .name = "qns_pcie_gemnoc",
  438. .channels = 1,
  439. .buswidth = 16,
  440. .num_links = 1,
  441. .link_nodes = { &qnm_pcie },
  442. };
  443. static struct qcom_icc_node ps_eth0_cfg = {
  444. .name = "ps_eth0_cfg",
  445. .channels = 1,
  446. .buswidth = 4,
  447. };
  448. static struct qcom_icc_node ps_eth1_cfg = {
  449. .name = "ps_eth1_cfg",
  450. .channels = 1,
  451. .buswidth = 4,
  452. };
  453. static struct qcom_icc_node qhs_audio = {
  454. .name = "qhs_audio",
  455. .channels = 1,
  456. .buswidth = 4,
  457. };
  458. static struct qcom_icc_node qhs_clk_ctl = {
  459. .name = "qhs_clk_ctl",
  460. .channels = 1,
  461. .buswidth = 4,
  462. };
  463. static struct qcom_icc_node qhs_crypto_cfg = {
  464. .name = "qhs_crypto_cfg",
  465. .channels = 1,
  466. .buswidth = 4,
  467. };
  468. static struct qcom_icc_node qhs_imem_cfg = {
  469. .name = "qhs_imem_cfg",
  470. .channels = 1,
  471. .buswidth = 4,
  472. };
  473. static struct qcom_icc_node qhs_ipa = {
  474. .name = "qhs_ipa",
  475. .channels = 1,
  476. .buswidth = 4,
  477. };
  478. static struct qcom_icc_node qhs_ipc_router = {
  479. .name = "qhs_ipc_router",
  480. .channels = 1,
  481. .buswidth = 4,
  482. };
  483. static struct qcom_icc_node qhs_mss_cfg = {
  484. .name = "qhs_mss_cfg",
  485. .channels = 1,
  486. .buswidth = 4,
  487. };
  488. static struct qcom_icc_node qhs_mvmss_cfg = {
  489. .name = "qhs_mvmss_cfg",
  490. .channels = 1,
  491. .buswidth = 4,
  492. };
  493. static struct qcom_icc_node qhs_pcie0_cfg = {
  494. .name = "qhs_pcie0_cfg",
  495. .channels = 1,
  496. .buswidth = 4,
  497. };
  498. static struct qcom_icc_node qhs_pcie1_cfg = {
  499. .name = "qhs_pcie1_cfg",
  500. .channels = 1,
  501. .buswidth = 4,
  502. };
  503. static struct qcom_icc_node qhs_pcie2_cfg = {
  504. .name = "qhs_pcie2_cfg",
  505. .channels = 1,
  506. .buswidth = 4,
  507. };
  508. static struct qcom_icc_node qhs_pcie_rscc = {
  509. .name = "qhs_pcie_rscc",
  510. .channels = 1,
  511. .buswidth = 4,
  512. };
  513. static struct qcom_icc_node qhs_pdm = {
  514. .name = "qhs_pdm",
  515. .channels = 1,
  516. .buswidth = 4,
  517. };
  518. static struct qcom_icc_node qhs_prng = {
  519. .name = "qhs_prng",
  520. .channels = 1,
  521. .buswidth = 4,
  522. };
  523. static struct qcom_icc_node qhs_qdss_cfg = {
  524. .name = "qhs_qdss_cfg",
  525. .channels = 1,
  526. .buswidth = 4,
  527. };
  528. static struct qcom_icc_node qhs_qpic = {
  529. .name = "qhs_qpic",
  530. .channels = 1,
  531. .buswidth = 4,
  532. };
  533. static struct qcom_icc_node qhs_qup0 = {
  534. .name = "qhs_qup0",
  535. .channels = 1,
  536. .buswidth = 4,
  537. };
  538. static struct qcom_icc_node qhs_sdc1 = {
  539. .name = "qhs_sdc1",
  540. .channels = 1,
  541. .buswidth = 4,
  542. };
  543. static struct qcom_icc_node qhs_sdc4 = {
  544. .name = "qhs_sdc4",
  545. .channels = 1,
  546. .buswidth = 4,
  547. };
  548. static struct qcom_icc_node qhs_spmi_vgi_coex = {
  549. .name = "qhs_spmi_vgi_coex",
  550. .channels = 1,
  551. .buswidth = 4,
  552. };
  553. static struct qcom_icc_node qhs_tcsr = {
  554. .name = "qhs_tcsr",
  555. .channels = 1,
  556. .buswidth = 4,
  557. };
  558. static struct qcom_icc_node qhs_tlmm = {
  559. .name = "qhs_tlmm",
  560. .channels = 1,
  561. .buswidth = 4,
  562. };
  563. static struct qcom_icc_node qhs_usb3 = {
  564. .name = "qhs_usb3",
  565. .channels = 1,
  566. .buswidth = 4,
  567. };
  568. static struct qcom_icc_node qhs_usb3_phy = {
  569. .name = "qhs_usb3_phy",
  570. .channels = 1,
  571. .buswidth = 4,
  572. };
  573. static struct qcom_icc_node qns_a1noc = {
  574. .name = "qns_a1noc",
  575. .channels = 1,
  576. .buswidth = 8,
  577. .num_links = 1,
  578. .link_nodes = { &qnm_aggre_noc },
  579. };
  580. static struct qcom_icc_node qns_ddrss_cfg = {
  581. .name = "qns_ddrss_cfg",
  582. .channels = 1,
  583. .buswidth = 4,
  584. .num_links = 1,
  585. .link_nodes = { &qnm_cnoc },
  586. };
  587. static struct qcom_icc_node qns_gemnoc_sf = {
  588. .name = "qns_gemnoc_sf",
  589. .channels = 1,
  590. .buswidth = 16,
  591. .num_links = 1,
  592. .link_nodes = { &qnm_snoc_sf },
  593. };
  594. static struct qcom_icc_node qns_system_noc_cfg = {
  595. .name = "qns_system_noc_cfg",
  596. .channels = 1,
  597. .buswidth = 4,
  598. .num_links = 1,
  599. .link_nodes = { &qnm_system_noc_cfg },
  600. };
  601. static struct qcom_icc_node qns_system_noc_pcie_cfg = {
  602. .name = "qns_system_noc_pcie_cfg",
  603. .channels = 1,
  604. .buswidth = 4,
  605. .num_links = 1,
  606. .link_nodes = { &qnm_system_noc_pcie_cfg },
  607. };
  608. static struct qcom_icc_node qxs_imem = {
  609. .name = "qxs_imem",
  610. .channels = 1,
  611. .buswidth = 8,
  612. };
  613. static struct qcom_icc_node srvc_pcie_system_noc = {
  614. .name = "srvc_pcie_system_noc",
  615. .channels = 1,
  616. .buswidth = 4,
  617. };
  618. static struct qcom_icc_node srvc_system_noc = {
  619. .name = "srvc_system_noc",
  620. .channels = 1,
  621. .buswidth = 4,
  622. };
  623. static struct qcom_icc_node xs_pcie_0 = {
  624. .name = "xs_pcie_0",
  625. .channels = 1,
  626. .buswidth = 8,
  627. };
  628. static struct qcom_icc_node xs_pcie_1 = {
  629. .name = "xs_pcie_1",
  630. .channels = 1,
  631. .buswidth = 8,
  632. };
  633. static struct qcom_icc_node xs_pcie_2 = {
  634. .name = "xs_pcie_2",
  635. .channels = 1,
  636. .buswidth = 8,
  637. };
  638. static struct qcom_icc_node xs_qdss_stm = {
  639. .name = "xs_qdss_stm",
  640. .channels = 1,
  641. .buswidth = 4,
  642. };
  643. static struct qcom_icc_node xs_sys_tcu_cfg = {
  644. .name = "xs_sys_tcu_cfg",
  645. .channels = 1,
  646. .buswidth = 8,
  647. };
  648. static struct qcom_icc_bcm bcm_ce0 = {
  649. .name = "CE0",
  650. .num_nodes = 1,
  651. .nodes = { &qxm_crypto },
  652. };
  653. static struct qcom_icc_bcm bcm_cn0 = {
  654. .name = "CN0",
  655. .keepalive = true,
  656. .num_nodes = 39,
  657. .nodes = { &qhm_pcie_rscc, &qnm_gemnoc_cnoc,
  658. &ps_eth0_cfg, &ps_eth1_cfg,
  659. &qhs_audio, &qhs_clk_ctl,
  660. &qhs_crypto_cfg, &qhs_imem_cfg,
  661. &qhs_ipa, &qhs_ipc_router,
  662. &qhs_mss_cfg, &qhs_mvmss_cfg,
  663. &qhs_pcie0_cfg, &qhs_pcie1_cfg,
  664. &qhs_pcie2_cfg, &qhs_pcie_rscc,
  665. &qhs_pdm, &qhs_prng,
  666. &qhs_qdss_cfg, &qhs_qpic,
  667. &qhs_qup0, &qhs_sdc1,
  668. &qhs_sdc4, &qhs_spmi_vgi_coex,
  669. &qhs_tcsr, &qhs_tlmm,
  670. &qhs_usb3, &qhs_usb3_phy,
  671. &qns_ddrss_cfg, &qns_system_noc_cfg,
  672. &qns_system_noc_pcie_cfg, &qxs_imem,
  673. &srvc_pcie_system_noc, &srvc_system_noc,
  674. &xs_pcie_0, &xs_pcie_1,
  675. &xs_pcie_2, &xs_qdss_stm,
  676. &xs_sys_tcu_cfg },
  677. };
  678. static struct qcom_icc_bcm bcm_mc0 = {
  679. .name = "MC0",
  680. .keepalive = true,
  681. .num_nodes = 1,
  682. .nodes = { &ebi },
  683. };
  684. static struct qcom_icc_bcm bcm_qup0 = {
  685. .name = "QUP0",
  686. .keepalive = true,
  687. .vote_scale = 1,
  688. .num_nodes = 1,
  689. .nodes = { &qup0_core_slave },
  690. };
  691. static struct qcom_icc_bcm bcm_sh0 = {
  692. .name = "SH0",
  693. .keepalive = true,
  694. .num_nodes = 1,
  695. .nodes = { &qns_llcc },
  696. };
  697. static struct qcom_icc_bcm bcm_sh1 = {
  698. .name = "SH1",
  699. .num_nodes = 10,
  700. .nodes = { &alm_sys_tcu, &chm_apps,
  701. &qnm_gemnoc_cfg, &qnm_mdsp,
  702. &qnm_snoc_sf, &xm_gic,
  703. &xm_ipa2pcie, &qns_gemnoc_cnoc,
  704. &qns_pcie, &srvc_gemnoc },
  705. };
  706. static struct qcom_icc_bcm bcm_sn0 = {
  707. .name = "SN0",
  708. .keepalive = true,
  709. .num_nodes = 1,
  710. .nodes = { &qns_gemnoc_sf },
  711. };
  712. static struct qcom_icc_bcm bcm_sn1 = {
  713. .name = "SN1",
  714. .num_nodes = 21,
  715. .nodes = { &xm_pcie3_0, &xm_pcie3_1,
  716. &xm_pcie3_2, &qhm_audio,
  717. &qhm_gic, &qhm_qdss_bam,
  718. &qhm_qpic, &qhm_qup0,
  719. &qnm_gemnoc_pcie, &qnm_system_noc_cfg,
  720. &qnm_system_noc_pcie_cfg, &qxm_crypto,
  721. &qxm_ipa, &qxm_mvmss,
  722. &xm_emac_0, &xm_emac_1,
  723. &xm_qdss_etr0, &xm_qdss_etr1,
  724. &xm_sdc1, &xm_sdc4,
  725. &xm_usb3 },
  726. };
  727. static struct qcom_icc_bcm bcm_sn2 = {
  728. .name = "SN2",
  729. .num_nodes = 2,
  730. .nodes = { &qnm_aggre_noc, &qns_a1noc },
  731. };
  732. static struct qcom_icc_bcm bcm_sn4 = {
  733. .name = "SN4",
  734. .num_nodes = 2,
  735. .nodes = { &qnm_pcie, &qns_pcie_gemnoc },
  736. };
  737. static struct qcom_icc_bcm * const clk_virt_bcms[] = {
  738. &bcm_qup0,
  739. };
  740. static struct qcom_icc_node * const clk_virt_nodes[] = {
  741. [MASTER_QUP_CORE_0] = &qup0_core_master,
  742. [SLAVE_QUP_CORE_0] = &qup0_core_slave,
  743. };
  744. static const struct qcom_icc_desc sdx75_clk_virt = {
  745. .nodes = clk_virt_nodes,
  746. .num_nodes = ARRAY_SIZE(clk_virt_nodes),
  747. .bcms = clk_virt_bcms,
  748. .num_bcms = ARRAY_SIZE(clk_virt_bcms),
  749. };
  750. static struct qcom_icc_node * const dc_noc_nodes[] = {
  751. [MASTER_CNOC_DC_NOC] = &qnm_cnoc,
  752. [SLAVE_LAGG_CFG] = &qhs_lagg,
  753. [SLAVE_MCCC_MASTER] = &qhs_mccc_master,
  754. [SLAVE_GEM_NOC_CFG] = &qns_gemnoc,
  755. [SLAVE_SNOOP_BWMON] = &qss_snoop_bwmon,
  756. };
  757. static const struct qcom_icc_desc sdx75_dc_noc = {
  758. .nodes = dc_noc_nodes,
  759. .num_nodes = ARRAY_SIZE(dc_noc_nodes),
  760. };
  761. static struct qcom_icc_bcm * const gem_noc_bcms[] = {
  762. &bcm_sh0,
  763. &bcm_sh1,
  764. &bcm_sn4,
  765. };
  766. static struct qcom_icc_node * const gem_noc_nodes[] = {
  767. [MASTER_SYS_TCU] = &alm_sys_tcu,
  768. [MASTER_APPSS_PROC] = &chm_apps,
  769. [MASTER_GEM_NOC_CFG] = &qnm_gemnoc_cfg,
  770. [MASTER_MSS_PROC] = &qnm_mdsp,
  771. [MASTER_ANOC_PCIE_GEM_NOC] = &qnm_pcie,
  772. [MASTER_SNOC_SF_MEM_NOC] = &qnm_snoc_sf,
  773. [MASTER_GIC] = &xm_gic,
  774. [MASTER_IPA_PCIE] = &xm_ipa2pcie,
  775. [SLAVE_GEM_NOC_CNOC] = &qns_gemnoc_cnoc,
  776. [SLAVE_LLCC] = &qns_llcc,
  777. [SLAVE_MEM_NOC_PCIE_SNOC] = &qns_pcie,
  778. [SLAVE_SERVICE_GEM_NOC] = &srvc_gemnoc,
  779. };
  780. static const struct qcom_icc_desc sdx75_gem_noc = {
  781. .nodes = gem_noc_nodes,
  782. .num_nodes = ARRAY_SIZE(gem_noc_nodes),
  783. .bcms = gem_noc_bcms,
  784. .num_bcms = ARRAY_SIZE(gem_noc_bcms),
  785. };
  786. static struct qcom_icc_bcm * const mc_virt_bcms[] = {
  787. &bcm_mc0,
  788. };
  789. static struct qcom_icc_node * const mc_virt_nodes[] = {
  790. [MASTER_LLCC] = &llcc_mc,
  791. [SLAVE_EBI1] = &ebi,
  792. };
  793. static const struct qcom_icc_desc sdx75_mc_virt = {
  794. .nodes = mc_virt_nodes,
  795. .num_nodes = ARRAY_SIZE(mc_virt_nodes),
  796. .bcms = mc_virt_bcms,
  797. .num_bcms = ARRAY_SIZE(mc_virt_bcms),
  798. };
  799. static struct qcom_icc_bcm * const pcie_anoc_bcms[] = {
  800. &bcm_sn1,
  801. &bcm_sn4,
  802. };
  803. static struct qcom_icc_node * const pcie_anoc_nodes[] = {
  804. [MASTER_PCIE_0] = &xm_pcie3_0,
  805. [MASTER_PCIE_1] = &xm_pcie3_1,
  806. [MASTER_PCIE_2] = &xm_pcie3_2,
  807. [SLAVE_ANOC_PCIE_GEM_NOC] = &qns_pcie_gemnoc,
  808. };
  809. static const struct qcom_icc_desc sdx75_pcie_anoc = {
  810. .nodes = pcie_anoc_nodes,
  811. .num_nodes = ARRAY_SIZE(pcie_anoc_nodes),
  812. .bcms = pcie_anoc_bcms,
  813. .num_bcms = ARRAY_SIZE(pcie_anoc_bcms),
  814. };
  815. static struct qcom_icc_bcm * const system_noc_bcms[] = {
  816. &bcm_ce0,
  817. &bcm_cn0,
  818. &bcm_sn0,
  819. &bcm_sn1,
  820. &bcm_sn2,
  821. };
  822. static struct qcom_icc_node * const system_noc_nodes[] = {
  823. [MASTER_AUDIO] = &qhm_audio,
  824. [MASTER_GIC_AHB] = &qhm_gic,
  825. [MASTER_PCIE_RSCC] = &qhm_pcie_rscc,
  826. [MASTER_QDSS_BAM] = &qhm_qdss_bam,
  827. [MASTER_QPIC] = &qhm_qpic,
  828. [MASTER_QUP_0] = &qhm_qup0,
  829. [MASTER_ANOC_SNOC] = &qnm_aggre_noc,
  830. [MASTER_GEM_NOC_CNOC] = &qnm_gemnoc_cnoc,
  831. [MASTER_GEM_NOC_PCIE_SNOC] = &qnm_gemnoc_pcie,
  832. [MASTER_SNOC_CFG] = &qnm_system_noc_cfg,
  833. [MASTER_PCIE_ANOC_CFG] = &qnm_system_noc_pcie_cfg,
  834. [MASTER_CRYPTO] = &qxm_crypto,
  835. [MASTER_IPA] = &qxm_ipa,
  836. [MASTER_MVMSS] = &qxm_mvmss,
  837. [MASTER_EMAC_0] = &xm_emac_0,
  838. [MASTER_EMAC_1] = &xm_emac_1,
  839. [MASTER_QDSS_ETR] = &xm_qdss_etr0,
  840. [MASTER_QDSS_ETR_1] = &xm_qdss_etr1,
  841. [MASTER_SDCC_1] = &xm_sdc1,
  842. [MASTER_SDCC_4] = &xm_sdc4,
  843. [MASTER_USB3_0] = &xm_usb3,
  844. [SLAVE_ETH0_CFG] = &ps_eth0_cfg,
  845. [SLAVE_ETH1_CFG] = &ps_eth1_cfg,
  846. [SLAVE_AUDIO] = &qhs_audio,
  847. [SLAVE_CLK_CTL] = &qhs_clk_ctl,
  848. [SLAVE_CRYPTO_0_CFG] = &qhs_crypto_cfg,
  849. [SLAVE_IMEM_CFG] = &qhs_imem_cfg,
  850. [SLAVE_IPA_CFG] = &qhs_ipa,
  851. [SLAVE_IPC_ROUTER_CFG] = &qhs_ipc_router,
  852. [SLAVE_CNOC_MSS] = &qhs_mss_cfg,
  853. [SLAVE_ICBDI_MVMSS_CFG] = &qhs_mvmss_cfg,
  854. [SLAVE_PCIE_0_CFG] = &qhs_pcie0_cfg,
  855. [SLAVE_PCIE_1_CFG] = &qhs_pcie1_cfg,
  856. [SLAVE_PCIE_2_CFG] = &qhs_pcie2_cfg,
  857. [SLAVE_PCIE_RSC_CFG] = &qhs_pcie_rscc,
  858. [SLAVE_PDM] = &qhs_pdm,
  859. [SLAVE_PRNG] = &qhs_prng,
  860. [SLAVE_QDSS_CFG] = &qhs_qdss_cfg,
  861. [SLAVE_QPIC] = &qhs_qpic,
  862. [SLAVE_QUP_0] = &qhs_qup0,
  863. [SLAVE_SDCC_1] = &qhs_sdc1,
  864. [SLAVE_SDCC_4] = &qhs_sdc4,
  865. [SLAVE_SPMI_VGI_COEX] = &qhs_spmi_vgi_coex,
  866. [SLAVE_TCSR] = &qhs_tcsr,
  867. [SLAVE_TLMM] = &qhs_tlmm,
  868. [SLAVE_USB3] = &qhs_usb3,
  869. [SLAVE_USB3_PHY_CFG] = &qhs_usb3_phy,
  870. [SLAVE_A1NOC_CFG] = &qns_a1noc,
  871. [SLAVE_DDRSS_CFG] = &qns_ddrss_cfg,
  872. [SLAVE_SNOC_GEM_NOC_SF] = &qns_gemnoc_sf,
  873. [SLAVE_SNOC_CFG] = &qns_system_noc_cfg,
  874. [SLAVE_PCIE_ANOC_CFG] = &qns_system_noc_pcie_cfg,
  875. [SLAVE_IMEM] = &qxs_imem,
  876. [SLAVE_SERVICE_PCIE_ANOC] = &srvc_pcie_system_noc,
  877. [SLAVE_SERVICE_SNOC] = &srvc_system_noc,
  878. [SLAVE_PCIE_0] = &xs_pcie_0,
  879. [SLAVE_PCIE_1] = &xs_pcie_1,
  880. [SLAVE_PCIE_2] = &xs_pcie_2,
  881. [SLAVE_QDSS_STM] = &xs_qdss_stm,
  882. [SLAVE_TCU] = &xs_sys_tcu_cfg,
  883. };
  884. static const struct qcom_icc_desc sdx75_system_noc = {
  885. .nodes = system_noc_nodes,
  886. .num_nodes = ARRAY_SIZE(system_noc_nodes),
  887. .bcms = system_noc_bcms,
  888. .num_bcms = ARRAY_SIZE(system_noc_bcms),
  889. };
  890. static const struct of_device_id qnoc_of_match[] = {
  891. { .compatible = "qcom,sdx75-clk-virt", .data = &sdx75_clk_virt },
  892. { .compatible = "qcom,sdx75-dc-noc", .data = &sdx75_dc_noc },
  893. { .compatible = "qcom,sdx75-gem-noc", .data = &sdx75_gem_noc },
  894. { .compatible = "qcom,sdx75-mc-virt", .data = &sdx75_mc_virt },
  895. { .compatible = "qcom,sdx75-pcie-anoc", .data = &sdx75_pcie_anoc },
  896. { .compatible = "qcom,sdx75-system-noc", .data = &sdx75_system_noc },
  897. { }
  898. };
  899. MODULE_DEVICE_TABLE(of, qnoc_of_match);
  900. static struct platform_driver qnoc_driver = {
  901. .probe = qcom_icc_rpmh_probe,
  902. .remove = qcom_icc_rpmh_remove,
  903. .driver = {
  904. .name = "qnoc-sdx75",
  905. .of_match_table = qnoc_of_match,
  906. .sync_state = icc_sync_state,
  907. },
  908. };
  909. static int __init qnoc_driver_init(void)
  910. {
  911. return platform_driver_register(&qnoc_driver);
  912. }
  913. core_initcall(qnoc_driver_init);
  914. static void __exit qnoc_driver_exit(void)
  915. {
  916. platform_driver_unregister(&qnoc_driver);
  917. }
  918. module_exit(qnoc_driver_exit);
  919. MODULE_DESCRIPTION("SDX75 NoC driver");
  920. MODULE_LICENSE("GPL");