sdx55.c 20 KB

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