sdx65.c 19 KB

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