sdx55.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Qualcomm SDX55 interconnect driver
  4. * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  5. *
  6. * Copyright (c) 2021, Linaro Ltd.
  7. *
  8. */
  9. #include <linux/device.h>
  10. #include <linux/interconnect.h>
  11. #include <linux/interconnect-provider.h>
  12. #include <linux/mod_devicetable.h>
  13. #include <linux/module.h>
  14. #include <linux/platform_device.h>
  15. #include <dt-bindings/interconnect/qcom,sdx55.h>
  16. #include "bcm-voter.h"
  17. #include "icc-rpmh.h"
  18. static struct qcom_icc_node llcc_mc;
  19. static struct qcom_icc_node acm_tcu;
  20. static struct qcom_icc_node qnm_snoc_gc;
  21. static struct qcom_icc_node xm_apps_rdwr;
  22. static struct qcom_icc_node qhm_audio;
  23. static struct qcom_icc_node qhm_blsp1;
  24. static struct qcom_icc_node qhm_qdss_bam;
  25. static struct qcom_icc_node qhm_qpic;
  26. static struct qcom_icc_node qhm_snoc_cfg;
  27. static struct qcom_icc_node qhm_spmi_fetcher1;
  28. static struct qcom_icc_node qnm_aggre_noc;
  29. static struct qcom_icc_node qnm_ipa;
  30. static struct qcom_icc_node qnm_memnoc;
  31. static struct qcom_icc_node qnm_memnoc_pcie;
  32. static struct qcom_icc_node qxm_crypto;
  33. static struct qcom_icc_node xm_emac;
  34. static struct qcom_icc_node xm_ipa2pcie_slv;
  35. static struct qcom_icc_node xm_pcie;
  36. static struct qcom_icc_node xm_qdss_etr;
  37. static struct qcom_icc_node xm_sdc1;
  38. static struct qcom_icc_node xm_usb3;
  39. static struct qcom_icc_node ebi;
  40. static struct qcom_icc_node qns_llcc;
  41. static struct qcom_icc_node qns_memnoc_snoc;
  42. static struct qcom_icc_node qns_sys_pcie;
  43. static struct qcom_icc_node qhs_aop;
  44. static struct qcom_icc_node qhs_aoss;
  45. static struct qcom_icc_node qhs_apss;
  46. static struct qcom_icc_node qhs_audio;
  47. static struct qcom_icc_node qhs_blsp1;
  48. static struct qcom_icc_node qhs_clk_ctl;
  49. static struct qcom_icc_node qhs_crypto0_cfg;
  50. static struct qcom_icc_node qhs_ddrss_cfg;
  51. static struct qcom_icc_node qhs_ecc_cfg;
  52. static struct qcom_icc_node qhs_emac_cfg;
  53. static struct qcom_icc_node qhs_imem_cfg;
  54. static struct qcom_icc_node qhs_ipa;
  55. static struct qcom_icc_node qhs_mss_cfg;
  56. static struct qcom_icc_node qhs_pcie_parf;
  57. static struct qcom_icc_node qhs_pdm;
  58. static struct qcom_icc_node qhs_prng;
  59. static struct qcom_icc_node qhs_qdss_cfg;
  60. static struct qcom_icc_node qhs_qpic;
  61. static struct qcom_icc_node qhs_sdc1;
  62. static struct qcom_icc_node qhs_snoc_cfg;
  63. static struct qcom_icc_node qhs_spmi_fetcher;
  64. static struct qcom_icc_node qhs_spmi_vgi_coex;
  65. static struct qcom_icc_node qhs_tcsr;
  66. static struct qcom_icc_node qhs_tlmm;
  67. static struct qcom_icc_node qhs_usb3;
  68. static struct qcom_icc_node qhs_usb3_phy;
  69. static struct qcom_icc_node qns_aggre_noc;
  70. static struct qcom_icc_node qns_snoc_memnoc;
  71. static struct qcom_icc_node qxs_imem;
  72. static struct qcom_icc_node srvc_snoc;
  73. static struct qcom_icc_node xs_pcie;
  74. static struct qcom_icc_node xs_qdss_stm;
  75. static struct qcom_icc_node xs_sys_tcu_cfg;
  76. static struct qcom_icc_node llcc_mc = {
  77. .name = "llcc_mc",
  78. .channels = 4,
  79. .buswidth = 4,
  80. .num_links = 1,
  81. .link_nodes = { &ebi },
  82. };
  83. static struct qcom_icc_node acm_tcu = {
  84. .name = "acm_tcu",
  85. .channels = 1,
  86. .buswidth = 8,
  87. .num_links = 3,
  88. .link_nodes = { &qns_llcc,
  89. &qns_memnoc_snoc,
  90. &qns_sys_pcie },
  91. };
  92. static struct qcom_icc_node qnm_snoc_gc = {
  93. .name = "qnm_snoc_gc",
  94. .channels = 1,
  95. .buswidth = 8,
  96. .num_links = 1,
  97. .link_nodes = { &qns_llcc },
  98. };
  99. static struct qcom_icc_node xm_apps_rdwr = {
  100. .name = "xm_apps_rdwr",
  101. .channels = 1,
  102. .buswidth = 16,
  103. .num_links = 3,
  104. .link_nodes = { &qns_llcc,
  105. &qns_memnoc_snoc,
  106. &qns_sys_pcie },
  107. };
  108. static struct qcom_icc_node qhm_audio = {
  109. .name = "qhm_audio",
  110. .channels = 1,
  111. .buswidth = 4,
  112. .num_links = 1,
  113. .link_nodes = { &qns_aggre_noc },
  114. };
  115. static struct qcom_icc_node qhm_blsp1 = {
  116. .name = "qhm_blsp1",
  117. .channels = 1,
  118. .buswidth = 4,
  119. .num_links = 1,
  120. .link_nodes = { &qns_aggre_noc },
  121. };
  122. static struct qcom_icc_node qhm_qdss_bam = {
  123. .name = "qhm_qdss_bam",
  124. .channels = 1,
  125. .buswidth = 4,
  126. .num_links = 28,
  127. .link_nodes = { &qhs_snoc_cfg,
  128. &qhs_emac_cfg,
  129. &qhs_usb3,
  130. &qhs_tlmm,
  131. &qhs_spmi_fetcher,
  132. &qhs_qdss_cfg,
  133. &qhs_pdm,
  134. &qns_snoc_memnoc,
  135. &qhs_tcsr,
  136. &qhs_ddrss_cfg,
  137. &qhs_spmi_vgi_coex,
  138. &qhs_qpic,
  139. &qxs_imem,
  140. &qhs_ipa,
  141. &qhs_usb3_phy,
  142. &qhs_aop,
  143. &qhs_blsp1,
  144. &qhs_sdc1,
  145. &qhs_mss_cfg,
  146. &qhs_pcie_parf,
  147. &qhs_ecc_cfg,
  148. &qhs_audio,
  149. &qhs_aoss,
  150. &qhs_prng,
  151. &qhs_crypto0_cfg,
  152. &xs_sys_tcu_cfg,
  153. &qhs_clk_ctl,
  154. &qhs_imem_cfg },
  155. };
  156. static struct qcom_icc_node qhm_qpic = {
  157. .name = "qhm_qpic",
  158. .channels = 1,
  159. .buswidth = 4,
  160. .num_links = 5,
  161. .link_nodes = { &qhs_aoss,
  162. &qhs_ipa,
  163. &qns_aggre_noc,
  164. &qhs_aop,
  165. &qhs_audio },
  166. };
  167. static struct qcom_icc_node qhm_snoc_cfg = {
  168. .name = "qhm_snoc_cfg",
  169. .channels = 1,
  170. .buswidth = 4,
  171. .num_links = 1,
  172. .link_nodes = { &srvc_snoc },
  173. };
  174. static struct qcom_icc_node qhm_spmi_fetcher1 = {
  175. .name = "qhm_spmi_fetcher1",
  176. .channels = 1,
  177. .buswidth = 4,
  178. .num_links = 3,
  179. .link_nodes = { &qhs_aoss,
  180. &qns_aggre_noc,
  181. &qhs_aop },
  182. };
  183. static struct qcom_icc_node qnm_aggre_noc = {
  184. .name = "qnm_aggre_noc",
  185. .channels = 1,
  186. .buswidth = 8,
  187. .num_links = 30,
  188. .link_nodes = { &xs_pcie,
  189. &qhs_snoc_cfg,
  190. &qhs_sdc1,
  191. &qhs_tlmm,
  192. &qhs_spmi_fetcher,
  193. &qhs_qdss_cfg,
  194. &qhs_pdm,
  195. &qns_snoc_memnoc,
  196. &qhs_tcsr,
  197. &qhs_ddrss_cfg,
  198. &qhs_spmi_vgi_coex,
  199. &xs_qdss_stm,
  200. &qhs_qpic,
  201. &qxs_imem,
  202. &qhs_ipa,
  203. &qhs_usb3_phy,
  204. &qhs_aop,
  205. &qhs_blsp1,
  206. &qhs_usb3,
  207. &qhs_mss_cfg,
  208. &qhs_pcie_parf,
  209. &qhs_ecc_cfg,
  210. &qhs_apss,
  211. &qhs_audio,
  212. &qhs_aoss,
  213. &qhs_prng,
  214. &qhs_crypto0_cfg,
  215. &xs_sys_tcu_cfg,
  216. &qhs_clk_ctl,
  217. &qhs_imem_cfg },
  218. };
  219. static struct qcom_icc_node qnm_ipa = {
  220. .name = "qnm_ipa",
  221. .channels = 1,
  222. .buswidth = 8,
  223. .num_links = 27,
  224. .link_nodes = { &qhs_snoc_cfg,
  225. &qhs_emac_cfg,
  226. &qhs_usb3,
  227. &qhs_aoss,
  228. &qhs_spmi_fetcher,
  229. &qhs_qdss_cfg,
  230. &qhs_pdm,
  231. &qns_snoc_memnoc,
  232. &qhs_tcsr,
  233. &qhs_ddrss_cfg,
  234. &xs_qdss_stm,
  235. &qhs_qpic,
  236. &qxs_imem,
  237. &qhs_ipa,
  238. &qhs_usb3_phy,
  239. &qhs_aop,
  240. &qhs_blsp1,
  241. &qhs_sdc1,
  242. &qhs_mss_cfg,
  243. &qhs_pcie_parf,
  244. &qhs_ecc_cfg,
  245. &qhs_audio,
  246. &qhs_tlmm,
  247. &qhs_prng,
  248. &qhs_crypto0_cfg,
  249. &qhs_clk_ctl,
  250. &qhs_imem_cfg },
  251. };
  252. static struct qcom_icc_node qnm_memnoc = {
  253. .name = "qnm_memnoc",
  254. .channels = 1,
  255. .buswidth = 8,
  256. .num_links = 29,
  257. .link_nodes = { &qhs_snoc_cfg,
  258. &qhs_emac_cfg,
  259. &qhs_usb3,
  260. &qhs_tlmm,
  261. &qhs_spmi_fetcher,
  262. &qhs_qdss_cfg,
  263. &qhs_pdm,
  264. &qhs_tcsr,
  265. &qhs_ddrss_cfg,
  266. &qhs_spmi_vgi_coex,
  267. &xs_qdss_stm,
  268. &qhs_qpic,
  269. &qxs_imem,
  270. &qhs_ipa,
  271. &qhs_usb3_phy,
  272. &qhs_aop,
  273. &qhs_blsp1,
  274. &qhs_sdc1,
  275. &qhs_mss_cfg,
  276. &qhs_pcie_parf,
  277. &qhs_ecc_cfg,
  278. &qhs_apss,
  279. &qhs_audio,
  280. &qhs_aoss,
  281. &qhs_prng,
  282. &qhs_crypto0_cfg,
  283. &xs_sys_tcu_cfg,
  284. &qhs_clk_ctl,
  285. &qhs_imem_cfg },
  286. };
  287. static struct qcom_icc_node qnm_memnoc_pcie = {
  288. .name = "qnm_memnoc_pcie",
  289. .channels = 1,
  290. .buswidth = 8,
  291. .num_links = 1,
  292. .link_nodes = { &xs_pcie },
  293. };
  294. static struct qcom_icc_node qxm_crypto = {
  295. .name = "qxm_crypto",
  296. .channels = 1,
  297. .buswidth = 8,
  298. .num_links = 3,
  299. .link_nodes = { &qhs_aoss,
  300. &qns_aggre_noc,
  301. &qhs_aop },
  302. };
  303. static struct qcom_icc_node xm_emac = {
  304. .name = "xm_emac",
  305. .channels = 1,
  306. .buswidth = 8,
  307. .num_links = 1,
  308. .link_nodes = { &qns_aggre_noc },
  309. };
  310. static struct qcom_icc_node xm_ipa2pcie_slv = {
  311. .name = "xm_ipa2pcie_slv",
  312. .channels = 1,
  313. .buswidth = 8,
  314. .num_links = 1,
  315. .link_nodes = { &xs_pcie },
  316. };
  317. static struct qcom_icc_node xm_pcie = {
  318. .name = "xm_pcie",
  319. .channels = 1,
  320. .buswidth = 8,
  321. .num_links = 1,
  322. .link_nodes = { &qns_aggre_noc },
  323. };
  324. static struct qcom_icc_node xm_qdss_etr = {
  325. .name = "xm_qdss_etr",
  326. .channels = 1,
  327. .buswidth = 8,
  328. .num_links = 28,
  329. .link_nodes = { &qhs_snoc_cfg,
  330. &qhs_emac_cfg,
  331. &qhs_usb3,
  332. &qhs_aoss,
  333. &qhs_spmi_fetcher,
  334. &qhs_qdss_cfg,
  335. &qhs_pdm,
  336. &qns_snoc_memnoc,
  337. &qhs_tcsr,
  338. &qhs_ddrss_cfg,
  339. &qhs_spmi_vgi_coex,
  340. &qhs_qpic,
  341. &qxs_imem,
  342. &qhs_ipa,
  343. &qhs_usb3_phy,
  344. &qhs_aop,
  345. &qhs_blsp1,
  346. &qhs_sdc1,
  347. &qhs_mss_cfg,
  348. &qhs_pcie_parf,
  349. &qhs_ecc_cfg,
  350. &qhs_audio,
  351. &qhs_aoss,
  352. &qhs_prng,
  353. &qhs_crypto0_cfg,
  354. &xs_sys_tcu_cfg,
  355. &qhs_clk_ctl,
  356. &qhs_imem_cfg },
  357. };
  358. static struct qcom_icc_node xm_sdc1 = {
  359. .name = "xm_sdc1",
  360. .channels = 1,
  361. .buswidth = 8,
  362. .num_links = 5,
  363. .link_nodes = { &qhs_aoss,
  364. &qhs_ipa,
  365. &qns_aggre_noc,
  366. &qhs_aop,
  367. &qhs_audio },
  368. };
  369. static struct qcom_icc_node xm_usb3 = {
  370. .name = "xm_usb3",
  371. .channels = 1,
  372. .buswidth = 8,
  373. .num_links = 1,
  374. .link_nodes = { &qns_aggre_noc },
  375. };
  376. static struct qcom_icc_node ebi = {
  377. .name = "ebi",
  378. .channels = 1,
  379. .buswidth = 4,
  380. };
  381. static struct qcom_icc_node qns_llcc = {
  382. .name = "qns_llcc",
  383. .channels = 1,
  384. .buswidth = 16,
  385. .num_links = 1,
  386. .link_nodes = { &ebi },
  387. };
  388. static struct qcom_icc_node qns_memnoc_snoc = {
  389. .name = "qns_memnoc_snoc",
  390. .channels = 1,
  391. .buswidth = 8,
  392. .num_links = 1,
  393. .link_nodes = { &qnm_memnoc },
  394. };
  395. static struct qcom_icc_node qns_sys_pcie = {
  396. .name = "qns_sys_pcie",
  397. .channels = 1,
  398. .buswidth = 8,
  399. .num_links = 1,
  400. .link_nodes = { &qnm_memnoc_pcie },
  401. };
  402. static struct qcom_icc_node qhs_aop = {
  403. .name = "qhs_aop",
  404. .channels = 1,
  405. .buswidth = 4,
  406. };
  407. static struct qcom_icc_node qhs_aoss = {
  408. .name = "qhs_aoss",
  409. .channels = 1,
  410. .buswidth = 4,
  411. };
  412. static struct qcom_icc_node qhs_apss = {
  413. .name = "qhs_apss",
  414. .channels = 1,
  415. .buswidth = 4,
  416. };
  417. static struct qcom_icc_node qhs_audio = {
  418. .name = "qhs_audio",
  419. .channels = 1,
  420. .buswidth = 4,
  421. };
  422. static struct qcom_icc_node qhs_blsp1 = {
  423. .name = "qhs_blsp1",
  424. .channels = 1,
  425. .buswidth = 4,
  426. };
  427. static struct qcom_icc_node qhs_clk_ctl = {
  428. .name = "qhs_clk_ctl",
  429. .channels = 1,
  430. .buswidth = 4,
  431. };
  432. static struct qcom_icc_node qhs_crypto0_cfg = {
  433. .name = "qhs_crypto0_cfg",
  434. .channels = 1,
  435. .buswidth = 4,
  436. };
  437. static struct qcom_icc_node qhs_ddrss_cfg = {
  438. .name = "qhs_ddrss_cfg",
  439. .channels = 1,
  440. .buswidth = 4,
  441. };
  442. static struct qcom_icc_node qhs_ecc_cfg = {
  443. .name = "qhs_ecc_cfg",
  444. .channels = 1,
  445. .buswidth = 4,
  446. };
  447. static struct qcom_icc_node qhs_emac_cfg = {
  448. .name = "qhs_emac_cfg",
  449. .channels = 1,
  450. .buswidth = 4,
  451. };
  452. static struct qcom_icc_node qhs_imem_cfg = {
  453. .name = "qhs_imem_cfg",
  454. .channels = 1,
  455. .buswidth = 4,
  456. };
  457. static struct qcom_icc_node qhs_ipa = {
  458. .name = "qhs_ipa",
  459. .channels = 1,
  460. .buswidth = 4,
  461. };
  462. static struct qcom_icc_node qhs_mss_cfg = {
  463. .name = "qhs_mss_cfg",
  464. .channels = 1,
  465. .buswidth = 4,
  466. };
  467. static struct qcom_icc_node qhs_pcie_parf = {
  468. .name = "qhs_pcie_parf",
  469. .channels = 1,
  470. .buswidth = 4,
  471. };
  472. static struct qcom_icc_node qhs_pdm = {
  473. .name = "qhs_pdm",
  474. .channels = 1,
  475. .buswidth = 4,
  476. };
  477. static struct qcom_icc_node qhs_prng = {
  478. .name = "qhs_prng",
  479. .channels = 1,
  480. .buswidth = 4,
  481. };
  482. static struct qcom_icc_node qhs_qdss_cfg = {
  483. .name = "qhs_qdss_cfg",
  484. .channels = 1,
  485. .buswidth = 4,
  486. };
  487. static struct qcom_icc_node qhs_qpic = {
  488. .name = "qhs_qpic",
  489. .channels = 1,
  490. .buswidth = 4,
  491. };
  492. static struct qcom_icc_node qhs_sdc1 = {
  493. .name = "qhs_sdc1",
  494. .channels = 1,
  495. .buswidth = 4,
  496. };
  497. static struct qcom_icc_node qhs_snoc_cfg = {
  498. .name = "qhs_snoc_cfg",
  499. .channels = 1,
  500. .buswidth = 4,
  501. .num_links = 1,
  502. .link_nodes = { &qhm_snoc_cfg },
  503. };
  504. static struct qcom_icc_node qhs_spmi_fetcher = {
  505. .name = "qhs_spmi_fetcher",
  506. .channels = 1,
  507. .buswidth = 4,
  508. };
  509. static struct qcom_icc_node qhs_spmi_vgi_coex = {
  510. .name = "qhs_spmi_vgi_coex",
  511. .channels = 1,
  512. .buswidth = 4,
  513. };
  514. static struct qcom_icc_node qhs_tcsr = {
  515. .name = "qhs_tcsr",
  516. .channels = 1,
  517. .buswidth = 4,
  518. };
  519. static struct qcom_icc_node qhs_tlmm = {
  520. .name = "qhs_tlmm",
  521. .channels = 1,
  522. .buswidth = 4,
  523. };
  524. static struct qcom_icc_node qhs_usb3 = {
  525. .name = "qhs_usb3",
  526. .channels = 1,
  527. .buswidth = 4,
  528. };
  529. static struct qcom_icc_node qhs_usb3_phy = {
  530. .name = "qhs_usb3_phy",
  531. .channels = 1,
  532. .buswidth = 4,
  533. };
  534. static struct qcom_icc_node qns_aggre_noc = {
  535. .name = "qns_aggre_noc",
  536. .channels = 1,
  537. .buswidth = 8,
  538. .num_links = 1,
  539. .link_nodes = { &qnm_aggre_noc },
  540. };
  541. static struct qcom_icc_node qns_snoc_memnoc = {
  542. .name = "qns_snoc_memnoc",
  543. .channels = 1,
  544. .buswidth = 8,
  545. .num_links = 1,
  546. .link_nodes = { &qnm_snoc_gc },
  547. };
  548. static struct qcom_icc_node qxs_imem = {
  549. .name = "qxs_imem",
  550. .channels = 1,
  551. .buswidth = 8,
  552. };
  553. static struct qcom_icc_node srvc_snoc = {
  554. .name = "srvc_snoc",
  555. .channels = 1,
  556. .buswidth = 4,
  557. };
  558. static struct qcom_icc_node xs_pcie = {
  559. .name = "xs_pcie",
  560. .channels = 1,
  561. .buswidth = 8,
  562. };
  563. static struct qcom_icc_node xs_qdss_stm = {
  564. .name = "xs_qdss_stm",
  565. .channels = 1,
  566. .buswidth = 4,
  567. };
  568. static struct qcom_icc_node xs_sys_tcu_cfg = {
  569. .name = "xs_sys_tcu_cfg",
  570. .channels = 1,
  571. .buswidth = 8,
  572. };
  573. static struct qcom_icc_bcm bcm_mc0 = {
  574. .name = "MC0",
  575. .keepalive = true,
  576. .num_nodes = 1,
  577. .nodes = { &ebi },
  578. };
  579. static struct qcom_icc_bcm bcm_sh0 = {
  580. .name = "SH0",
  581. .keepalive = true,
  582. .num_nodes = 1,
  583. .nodes = { &qns_llcc },
  584. };
  585. static struct qcom_icc_bcm bcm_ce0 = {
  586. .name = "CE0",
  587. .keepalive = false,
  588. .num_nodes = 1,
  589. .nodes = { &qxm_crypto },
  590. };
  591. static struct qcom_icc_bcm bcm_pn0 = {
  592. .name = "PN0",
  593. .keepalive = false,
  594. .num_nodes = 1,
  595. .nodes = { &qhm_snoc_cfg },
  596. };
  597. static struct qcom_icc_bcm bcm_sh3 = {
  598. .name = "SH3",
  599. .keepalive = false,
  600. .num_nodes = 1,
  601. .nodes = { &xm_apps_rdwr },
  602. };
  603. static struct qcom_icc_bcm bcm_sh4 = {
  604. .name = "SH4",
  605. .keepalive = false,
  606. .num_nodes = 2,
  607. .nodes = { &qns_memnoc_snoc, &qns_sys_pcie },
  608. };
  609. static struct qcom_icc_bcm bcm_sn0 = {
  610. .name = "SN0",
  611. .keepalive = true,
  612. .num_nodes = 1,
  613. .nodes = { &qns_snoc_memnoc },
  614. };
  615. static struct qcom_icc_bcm bcm_sn1 = {
  616. .name = "SN1",
  617. .keepalive = false,
  618. .num_nodes = 1,
  619. .nodes = { &qxs_imem },
  620. };
  621. static struct qcom_icc_bcm bcm_pn1 = {
  622. .name = "PN1",
  623. .keepalive = false,
  624. .num_nodes = 1,
  625. .nodes = { &xm_sdc1 },
  626. };
  627. static struct qcom_icc_bcm bcm_pn2 = {
  628. .name = "PN2",
  629. .keepalive = false,
  630. .num_nodes = 2,
  631. .nodes = { &qhm_audio, &qhm_spmi_fetcher1 },
  632. };
  633. static struct qcom_icc_bcm bcm_sn3 = {
  634. .name = "SN3",
  635. .keepalive = false,
  636. .num_nodes = 1,
  637. .nodes = { &xs_qdss_stm },
  638. };
  639. static struct qcom_icc_bcm bcm_pn3 = {
  640. .name = "PN3",
  641. .keepalive = false,
  642. .num_nodes = 2,
  643. .nodes = { &qhm_blsp1, &qhm_qpic },
  644. };
  645. static struct qcom_icc_bcm bcm_sn4 = {
  646. .name = "SN4",
  647. .keepalive = false,
  648. .num_nodes = 1,
  649. .nodes = { &xs_sys_tcu_cfg },
  650. };
  651. static struct qcom_icc_bcm bcm_pn5 = {
  652. .name = "PN5",
  653. .keepalive = false,
  654. .num_nodes = 1,
  655. .nodes = { &qxm_crypto },
  656. };
  657. static struct qcom_icc_bcm bcm_sn6 = {
  658. .name = "SN6",
  659. .keepalive = false,
  660. .num_nodes = 1,
  661. .nodes = { &xs_pcie },
  662. };
  663. static struct qcom_icc_bcm bcm_sn7 = {
  664. .name = "SN7",
  665. .keepalive = false,
  666. .num_nodes = 5,
  667. .nodes = { &qnm_aggre_noc, &xm_emac, &xm_emac, &xm_usb3, &qns_aggre_noc },
  668. };
  669. static struct qcom_icc_bcm bcm_sn8 = {
  670. .name = "SN8",
  671. .keepalive = false,
  672. .num_nodes = 2,
  673. .nodes = { &qhm_qdss_bam, &xm_qdss_etr },
  674. };
  675. static struct qcom_icc_bcm bcm_sn9 = {
  676. .name = "SN9",
  677. .keepalive = false,
  678. .num_nodes = 1,
  679. .nodes = { &qnm_memnoc },
  680. };
  681. static struct qcom_icc_bcm bcm_sn10 = {
  682. .name = "SN10",
  683. .keepalive = false,
  684. .num_nodes = 1,
  685. .nodes = { &qnm_memnoc_pcie },
  686. };
  687. static struct qcom_icc_bcm bcm_sn11 = {
  688. .name = "SN11",
  689. .keepalive = false,
  690. .num_nodes = 2,
  691. .nodes = { &qnm_ipa, &xm_ipa2pcie_slv },
  692. };
  693. static struct qcom_icc_bcm * const mc_virt_bcms[] = {
  694. &bcm_mc0,
  695. };
  696. static struct qcom_icc_node * const mc_virt_nodes[] = {
  697. [MASTER_LLCC] = &llcc_mc,
  698. [SLAVE_EBI_CH0] = &ebi,
  699. };
  700. static const struct qcom_icc_desc sdx55_mc_virt = {
  701. .nodes = mc_virt_nodes,
  702. .num_nodes = ARRAY_SIZE(mc_virt_nodes),
  703. .bcms = mc_virt_bcms,
  704. .num_bcms = ARRAY_SIZE(mc_virt_bcms),
  705. };
  706. static struct qcom_icc_bcm * const mem_noc_bcms[] = {
  707. &bcm_sh0,
  708. &bcm_sh3,
  709. &bcm_sh4,
  710. };
  711. static struct qcom_icc_node * const mem_noc_nodes[] = {
  712. [MASTER_TCU_0] = &acm_tcu,
  713. [MASTER_SNOC_GC_MEM_NOC] = &qnm_snoc_gc,
  714. [MASTER_AMPSS_M0] = &xm_apps_rdwr,
  715. [SLAVE_LLCC] = &qns_llcc,
  716. [SLAVE_MEM_NOC_SNOC] = &qns_memnoc_snoc,
  717. [SLAVE_MEM_NOC_PCIE_SNOC] = &qns_sys_pcie,
  718. };
  719. static const struct qcom_icc_desc sdx55_mem_noc = {
  720. .nodes = mem_noc_nodes,
  721. .num_nodes = ARRAY_SIZE(mem_noc_nodes),
  722. .bcms = mem_noc_bcms,
  723. .num_bcms = ARRAY_SIZE(mem_noc_bcms),
  724. };
  725. static struct qcom_icc_bcm * const system_noc_bcms[] = {
  726. &bcm_ce0,
  727. &bcm_pn0,
  728. &bcm_pn1,
  729. &bcm_pn2,
  730. &bcm_pn3,
  731. &bcm_pn5,
  732. &bcm_sn0,
  733. &bcm_sn1,
  734. &bcm_sn3,
  735. &bcm_sn4,
  736. &bcm_sn6,
  737. &bcm_sn7,
  738. &bcm_sn8,
  739. &bcm_sn9,
  740. &bcm_sn10,
  741. &bcm_sn11,
  742. };
  743. static struct qcom_icc_node * const system_noc_nodes[] = {
  744. [MASTER_AUDIO] = &qhm_audio,
  745. [MASTER_BLSP_1] = &qhm_blsp1,
  746. [MASTER_QDSS_BAM] = &qhm_qdss_bam,
  747. [MASTER_QPIC] = &qhm_qpic,
  748. [MASTER_SNOC_CFG] = &qhm_snoc_cfg,
  749. [MASTER_SPMI_FETCHER] = &qhm_spmi_fetcher1,
  750. [MASTER_ANOC_SNOC] = &qnm_aggre_noc,
  751. [MASTER_IPA] = &qnm_ipa,
  752. [MASTER_MEM_NOC_SNOC] = &qnm_memnoc,
  753. [MASTER_MEM_NOC_PCIE_SNOC] = &qnm_memnoc_pcie,
  754. [MASTER_CRYPTO_CORE_0] = &qxm_crypto,
  755. [MASTER_EMAC] = &xm_emac,
  756. [MASTER_IPA_PCIE] = &xm_ipa2pcie_slv,
  757. [MASTER_PCIE] = &xm_pcie,
  758. [MASTER_QDSS_ETR] = &xm_qdss_etr,
  759. [MASTER_SDCC_1] = &xm_sdc1,
  760. [MASTER_USB3] = &xm_usb3,
  761. [SLAVE_AOP] = &qhs_aop,
  762. [SLAVE_AOSS] = &qhs_aoss,
  763. [SLAVE_APPSS] = &qhs_apss,
  764. [SLAVE_AUDIO] = &qhs_audio,
  765. [SLAVE_BLSP_1] = &qhs_blsp1,
  766. [SLAVE_CLK_CTL] = &qhs_clk_ctl,
  767. [SLAVE_CRYPTO_0_CFG] = &qhs_crypto0_cfg,
  768. [SLAVE_CNOC_DDRSS] = &qhs_ddrss_cfg,
  769. [SLAVE_ECC_CFG] = &qhs_ecc_cfg,
  770. [SLAVE_EMAC_CFG] = &qhs_emac_cfg,
  771. [SLAVE_IMEM_CFG] = &qhs_imem_cfg,
  772. [SLAVE_IPA_CFG] = &qhs_ipa,
  773. [SLAVE_CNOC_MSS] = &qhs_mss_cfg,
  774. [SLAVE_PCIE_PARF] = &qhs_pcie_parf,
  775. [SLAVE_PDM] = &qhs_pdm,
  776. [SLAVE_PRNG] = &qhs_prng,
  777. [SLAVE_QDSS_CFG] = &qhs_qdss_cfg,
  778. [SLAVE_QPIC] = &qhs_qpic,
  779. [SLAVE_SDCC_1] = &qhs_sdc1,
  780. [SLAVE_SNOC_CFG] = &qhs_snoc_cfg,
  781. [SLAVE_SPMI_FETCHER] = &qhs_spmi_fetcher,
  782. [SLAVE_SPMI_VGI_COEX] = &qhs_spmi_vgi_coex,
  783. [SLAVE_TCSR] = &qhs_tcsr,
  784. [SLAVE_TLMM] = &qhs_tlmm,
  785. [SLAVE_USB3] = &qhs_usb3,
  786. [SLAVE_USB3_PHY_CFG] = &qhs_usb3_phy,
  787. [SLAVE_ANOC_SNOC] = &qns_aggre_noc,
  788. [SLAVE_SNOC_MEM_NOC_GC] = &qns_snoc_memnoc,
  789. [SLAVE_OCIMEM] = &qxs_imem,
  790. [SLAVE_SERVICE_SNOC] = &srvc_snoc,
  791. [SLAVE_PCIE_0] = &xs_pcie,
  792. [SLAVE_QDSS_STM] = &xs_qdss_stm,
  793. [SLAVE_TCU] = &xs_sys_tcu_cfg,
  794. };
  795. static const struct qcom_icc_desc sdx55_system_noc = {
  796. .nodes = system_noc_nodes,
  797. .num_nodes = ARRAY_SIZE(system_noc_nodes),
  798. .bcms = system_noc_bcms,
  799. .num_bcms = ARRAY_SIZE(system_noc_bcms),
  800. };
  801. static const struct of_device_id qnoc_of_match[] = {
  802. { .compatible = "qcom,sdx55-mc-virt",
  803. .data = &sdx55_mc_virt},
  804. { .compatible = "qcom,sdx55-mem-noc",
  805. .data = &sdx55_mem_noc},
  806. { .compatible = "qcom,sdx55-system-noc",
  807. .data = &sdx55_system_noc},
  808. { }
  809. };
  810. MODULE_DEVICE_TABLE(of, qnoc_of_match);
  811. static struct platform_driver qnoc_driver = {
  812. .probe = qcom_icc_rpmh_probe,
  813. .remove = qcom_icc_rpmh_remove,
  814. .driver = {
  815. .name = "qnoc-sdx55",
  816. .of_match_table = qnoc_of_match,
  817. .sync_state = icc_sync_state,
  818. },
  819. };
  820. module_platform_driver(qnoc_driver);
  821. MODULE_DESCRIPTION("Qualcomm SDX55 NoC driver");
  822. MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
  823. MODULE_LICENSE("GPL v2");