sdx65.c 18 KB

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