1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
7 #include <linux/device.h>
8 #include <linux/interconnect.h>
9 #include <linux/interconnect-provider.h>
10 #include <linux/mod_devicetable.h>
11 #include <linux/module.h>
12 #include <linux/platform_device.h>
13 #include <dt-bindings/interconnect/qcom,qdu1000-rpmh.h>
15 #include "bcm-voter.h"
16 #include "icc-common.h"
20 static struct qcom_icc_node qup0_core_master
= {
21 .name
= "qup0_core_master",
22 .id
= QDU1000_MASTER_QUP_CORE_0
,
26 .links
= { QDU1000_SLAVE_QUP_CORE_0
},
29 static struct qcom_icc_node qup1_core_master
= {
30 .name
= "qup1_core_master",
31 .id
= QDU1000_MASTER_QUP_CORE_1
,
35 .links
= { QDU1000_SLAVE_QUP_CORE_1
},
38 static struct qcom_icc_node alm_sys_tcu
= {
39 .name
= "alm_sys_tcu",
40 .id
= QDU1000_MASTER_SYS_TCU
,
44 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
},
47 static struct qcom_icc_node chm_apps
= {
49 .id
= QDU1000_MASTER_APPSS_PROC
,
53 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
,
54 QDU1000_SLAVE_GEMNOC_MODEM_CNOC
, QDU1000_SLAVE_MEM_NOC_PCIE_SNOC
58 static struct qcom_icc_node qnm_ecpri_dma
= {
59 .name
= "qnm_ecpri_dma",
60 .id
= QDU1000_MASTER_GEMNOC_ECPRI_DMA
,
64 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
},
67 static struct qcom_icc_node qnm_fec_2_gemnoc
= {
68 .name
= "qnm_fec_2_gemnoc",
69 .id
= QDU1000_MASTER_FEC_2_GEMNOC
,
73 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
},
76 static struct qcom_icc_node qnm_pcie
= {
78 .id
= QDU1000_MASTER_ANOC_PCIE_GEM_NOC
,
82 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
,
83 QDU1000_SLAVE_GEMNOC_MODEM_CNOC
87 static struct qcom_icc_node qnm_snoc_gc
= {
88 .name
= "qnm_snoc_gc",
89 .id
= QDU1000_MASTER_SNOC_GC_MEM_NOC
,
93 .links
= { QDU1000_SLAVE_LLCC
},
96 static struct qcom_icc_node qnm_snoc_sf
= {
97 .name
= "qnm_snoc_sf",
98 .id
= QDU1000_MASTER_SNOC_SF_MEM_NOC
,
102 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
,
103 QDU1000_SLAVE_GEMNOC_MODEM_CNOC
, QDU1000_SLAVE_MEM_NOC_PCIE_SNOC
107 static struct qcom_icc_node qxm_mdsp
= {
109 .id
= QDU1000_MASTER_MSS_PROC
,
113 .links
= { QDU1000_SLAVE_GEM_NOC_CNOC
, QDU1000_SLAVE_LLCC
,
114 QDU1000_SLAVE_MEM_NOC_PCIE_SNOC
118 static struct qcom_icc_node llcc_mc
= {
120 .id
= QDU1000_MASTER_LLCC
,
124 .links
= { QDU1000_SLAVE_EBI1
},
127 static struct qcom_icc_node qhm_gic
= {
129 .id
= QDU1000_MASTER_GIC_AHB
,
133 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_SF
},
136 static struct qcom_icc_node qhm_qdss_bam
= {
137 .name
= "qhm_qdss_bam",
138 .id
= QDU1000_MASTER_QDSS_BAM
,
142 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_SF
},
145 static struct qcom_icc_node qhm_qpic
= {
147 .id
= QDU1000_MASTER_QPIC
,
151 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
154 static struct qcom_icc_node qhm_qspi
= {
156 .id
= QDU1000_MASTER_QSPI_0
,
160 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
163 static struct qcom_icc_node qhm_qup0
= {
165 .id
= QDU1000_MASTER_QUP_0
,
169 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
172 static struct qcom_icc_node qhm_qup1
= {
174 .id
= QDU1000_MASTER_QUP_1
,
178 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
181 static struct qcom_icc_node qhm_system_noc_cfg
= {
182 .name
= "qhm_system_noc_cfg",
183 .id
= QDU1000_MASTER_SNOC_CFG
,
187 .links
= { QDU1000_SLAVE_SERVICE_SNOC
},
190 static struct qcom_icc_node qnm_aggre_noc
= {
191 .name
= "qnm_aggre_noc",
192 .id
= QDU1000_MASTER_ANOC_SNOC
,
196 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_SF
},
199 static struct qcom_icc_node qnm_aggre_noc_gsi
= {
200 .name
= "qnm_aggre_noc_gsi",
201 .id
= QDU1000_MASTER_ANOC_GSI
,
205 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_GC
},
208 static struct qcom_icc_node qnm_gemnoc_cnoc
= {
209 .name
= "qnm_gemnoc_cnoc",
210 .id
= QDU1000_MASTER_GEM_NOC_CNOC
,
214 .links
= { QDU1000_SLAVE_AHB2PHY_SOUTH
, QDU1000_SLAVE_AHB2PHY_NORTH
,
215 QDU1000_SLAVE_AHB2PHY_EAST
, QDU1000_SLAVE_AOSS
,
216 QDU1000_SLAVE_CLK_CTL
, QDU1000_SLAVE_RBCPR_CX_CFG
,
217 QDU1000_SLAVE_RBCPR_MX_CFG
, QDU1000_SLAVE_CRYPTO_0_CFG
,
218 QDU1000_SLAVE_ECPRI_CFG
, QDU1000_SLAVE_IMEM_CFG
,
219 QDU1000_SLAVE_IPC_ROUTER_CFG
, QDU1000_SLAVE_CNOC_MSS
,
220 QDU1000_SLAVE_PCIE_CFG
, QDU1000_SLAVE_PDM
,
221 QDU1000_SLAVE_PIMEM_CFG
, QDU1000_SLAVE_PRNG
,
222 QDU1000_SLAVE_QDSS_CFG
, QDU1000_SLAVE_QPIC
,
223 QDU1000_SLAVE_QSPI_0
, QDU1000_SLAVE_QUP_0
,
224 QDU1000_SLAVE_QUP_1
, QDU1000_SLAVE_SDCC_2
,
225 QDU1000_SLAVE_SMBUS_CFG
, QDU1000_SLAVE_SNOC_CFG
,
226 QDU1000_SLAVE_TCSR
, QDU1000_SLAVE_TLMM
,
227 QDU1000_SLAVE_TME_CFG
, QDU1000_SLAVE_TSC_CFG
,
228 QDU1000_SLAVE_USB3_0
, QDU1000_SLAVE_VSENSE_CTRL_CFG
,
229 QDU1000_SLAVE_DDRSS_CFG
, QDU1000_SLAVE_IMEM
,
230 QDU1000_SLAVE_PIMEM
, QDU1000_SLAVE_ETHERNET_SS
,
231 QDU1000_SLAVE_QDSS_STM
, QDU1000_SLAVE_TCU
235 static struct qcom_icc_node qnm_gemnoc_modem_slave
= {
236 .name
= "qnm_gemnoc_modem_slave",
237 .id
= QDU1000_MASTER_GEMNOC_MODEM_CNOC
,
241 .links
= { QDU1000_SLAVE_MODEM_OFFLINE
},
244 static struct qcom_icc_node qnm_gemnoc_pcie
= {
245 .name
= "qnm_gemnoc_pcie",
246 .id
= QDU1000_MASTER_GEM_NOC_PCIE_SNOC
,
250 .links
= { QDU1000_SLAVE_PCIE_0
},
253 static struct qcom_icc_node qxm_crypto
= {
254 .name
= "qxm_crypto",
255 .id
= QDU1000_MASTER_CRYPTO
,
259 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
262 static struct qcom_icc_node qxm_ecpri_gsi
= {
263 .name
= "qxm_ecpri_gsi",
264 .id
= QDU1000_MASTER_ECPRI_GSI
,
268 .links
= { QDU1000_SLAVE_ANOC_SNOC_GSI
, QDU1000_SLAVE_PCIE_0
},
271 static struct qcom_icc_node qxm_pimem
= {
273 .id
= QDU1000_MASTER_PIMEM
,
277 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_GC
},
280 static struct qcom_icc_node xm_ecpri_dma
= {
281 .name
= "xm_ecpri_dma",
282 .id
= QDU1000_MASTER_SNOC_ECPRI_DMA
,
286 .links
= { QDU1000_SLAVE_ECPRI_GEMNOC
, QDU1000_SLAVE_PCIE_0
},
289 static struct qcom_icc_node xm_gic
= {
291 .id
= QDU1000_MASTER_GIC
,
295 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_GC
},
298 static struct qcom_icc_node xm_pcie
= {
300 .id
= QDU1000_MASTER_PCIE
,
304 .links
= { QDU1000_SLAVE_ANOC_PCIE_GEM_NOC
},
307 static struct qcom_icc_node xm_qdss_etr0
= {
308 .name
= "xm_qdss_etr0",
309 .id
= QDU1000_MASTER_QDSS_ETR
,
313 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_SF
},
316 static struct qcom_icc_node xm_qdss_etr1
= {
317 .name
= "xm_qdss_etr1",
318 .id
= QDU1000_MASTER_QDSS_ETR_1
,
322 .links
= { QDU1000_SLAVE_SNOC_GEM_NOC_SF
},
325 static struct qcom_icc_node xm_sdc
= {
327 .id
= QDU1000_MASTER_SDCC_1
,
331 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
334 static struct qcom_icc_node xm_usb3
= {
336 .id
= QDU1000_MASTER_USB3
,
340 .links
= { QDU1000_SLAVE_A1NOC_SNOC
},
343 static struct qcom_icc_node qup0_core_slave
= {
344 .name
= "qup0_core_slave",
345 .id
= QDU1000_SLAVE_QUP_CORE_0
,
351 static struct qcom_icc_node qup1_core_slave
= {
352 .name
= "qup1_core_slave",
353 .id
= QDU1000_SLAVE_QUP_CORE_1
,
359 static struct qcom_icc_node qns_gem_noc_cnoc
= {
360 .name
= "qns_gem_noc_cnoc",
361 .id
= QDU1000_SLAVE_GEM_NOC_CNOC
,
365 .links
= { QDU1000_MASTER_GEM_NOC_CNOC
},
368 static struct qcom_icc_node qns_llcc
= {
370 .id
= QDU1000_SLAVE_LLCC
,
374 .links
= { QDU1000_MASTER_LLCC
},
377 static struct qcom_icc_node qns_modem_slave
= {
378 .name
= "qns_modem_slave",
379 .id
= QDU1000_SLAVE_GEMNOC_MODEM_CNOC
,
383 .links
= { QDU1000_MASTER_GEMNOC_MODEM_CNOC
},
386 static struct qcom_icc_node qns_pcie
= {
388 .id
= QDU1000_SLAVE_MEM_NOC_PCIE_SNOC
,
392 .links
= { QDU1000_MASTER_GEM_NOC_PCIE_SNOC
},
395 static struct qcom_icc_node ebi
= {
397 .id
= QDU1000_SLAVE_EBI1
,
403 static struct qcom_icc_node qhs_ahb2phy0_south
= {
404 .name
= "qhs_ahb2phy0_south",
405 .id
= QDU1000_SLAVE_AHB2PHY_SOUTH
,
411 static struct qcom_icc_node qhs_ahb2phy1_north
= {
412 .name
= "qhs_ahb2phy1_north",
413 .id
= QDU1000_SLAVE_AHB2PHY_NORTH
,
419 static struct qcom_icc_node qhs_ahb2phy2_east
= {
420 .name
= "qhs_ahb2phy2_east",
421 .id
= QDU1000_SLAVE_AHB2PHY_EAST
,
427 static struct qcom_icc_node qhs_aoss
= {
429 .id
= QDU1000_SLAVE_AOSS
,
435 static struct qcom_icc_node qhs_clk_ctl
= {
436 .name
= "qhs_clk_ctl",
437 .id
= QDU1000_SLAVE_CLK_CTL
,
443 static struct qcom_icc_node qhs_cpr_cx
= {
444 .name
= "qhs_cpr_cx",
445 .id
= QDU1000_SLAVE_RBCPR_CX_CFG
,
451 static struct qcom_icc_node qhs_cpr_mx
= {
452 .name
= "qhs_cpr_mx",
453 .id
= QDU1000_SLAVE_RBCPR_MX_CFG
,
459 static struct qcom_icc_node qhs_crypto_cfg
= {
460 .name
= "qhs_crypto_cfg",
461 .id
= QDU1000_SLAVE_CRYPTO_0_CFG
,
467 static struct qcom_icc_node qhs_ecpri_cfg
= {
468 .name
= "qhs_ecpri_cfg",
469 .id
= QDU1000_SLAVE_ECPRI_CFG
,
475 static struct qcom_icc_node qhs_imem_cfg
= {
476 .name
= "qhs_imem_cfg",
477 .id
= QDU1000_SLAVE_IMEM_CFG
,
483 static struct qcom_icc_node qhs_ipc_router
= {
484 .name
= "qhs_ipc_router",
485 .id
= QDU1000_SLAVE_IPC_ROUTER_CFG
,
491 static struct qcom_icc_node qhs_mss_cfg
= {
492 .name
= "qhs_mss_cfg",
493 .id
= QDU1000_SLAVE_CNOC_MSS
,
499 static struct qcom_icc_node qhs_pcie_cfg
= {
500 .name
= "qhs_pcie_cfg",
501 .id
= QDU1000_SLAVE_PCIE_CFG
,
507 static struct qcom_icc_node qhs_pdm
= {
509 .id
= QDU1000_SLAVE_PDM
,
515 static struct qcom_icc_node qhs_pimem_cfg
= {
516 .name
= "qhs_pimem_cfg",
517 .id
= QDU1000_SLAVE_PIMEM_CFG
,
523 static struct qcom_icc_node qhs_prng
= {
525 .id
= QDU1000_SLAVE_PRNG
,
531 static struct qcom_icc_node qhs_qdss_cfg
= {
532 .name
= "qhs_qdss_cfg",
533 .id
= QDU1000_SLAVE_QDSS_CFG
,
539 static struct qcom_icc_node qhs_qpic
= {
541 .id
= QDU1000_SLAVE_QPIC
,
547 static struct qcom_icc_node qhs_qspi
= {
549 .id
= QDU1000_SLAVE_QSPI_0
,
555 static struct qcom_icc_node qhs_qup0
= {
557 .id
= QDU1000_SLAVE_QUP_0
,
563 static struct qcom_icc_node qhs_qup1
= {
565 .id
= QDU1000_SLAVE_QUP_1
,
571 static struct qcom_icc_node qhs_sdc2
= {
573 .id
= QDU1000_SLAVE_SDCC_2
,
579 static struct qcom_icc_node qhs_smbus_cfg
= {
580 .name
= "qhs_smbus_cfg",
581 .id
= QDU1000_SLAVE_SMBUS_CFG
,
587 static struct qcom_icc_node qhs_system_noc_cfg
= {
588 .name
= "qhs_system_noc_cfg",
589 .id
= QDU1000_SLAVE_SNOC_CFG
,
593 .links
= { QDU1000_MASTER_SNOC_CFG
},
596 static struct qcom_icc_node qhs_tcsr
= {
598 .id
= QDU1000_SLAVE_TCSR
,
604 static struct qcom_icc_node qhs_tlmm
= {
606 .id
= QDU1000_SLAVE_TLMM
,
612 static struct qcom_icc_node qhs_tme_cfg
= {
613 .name
= "qhs_tme_cfg",
614 .id
= QDU1000_SLAVE_TME_CFG
,
620 static struct qcom_icc_node qhs_tsc_cfg
= {
621 .name
= "qhs_tsc_cfg",
622 .id
= QDU1000_SLAVE_TSC_CFG
,
628 static struct qcom_icc_node qhs_usb3
= {
630 .id
= QDU1000_SLAVE_USB3_0
,
636 static struct qcom_icc_node qhs_vsense_ctrl_cfg
= {
637 .name
= "qhs_vsense_ctrl_cfg",
638 .id
= QDU1000_SLAVE_VSENSE_CTRL_CFG
,
644 static struct qcom_icc_node qns_a1noc_snoc
= {
645 .name
= "qns_a1noc_snoc",
646 .id
= QDU1000_SLAVE_A1NOC_SNOC
,
650 .links
= { QDU1000_MASTER_ANOC_SNOC
},
653 static struct qcom_icc_node qns_anoc_snoc_gsi
= {
654 .name
= "qns_anoc_snoc_gsi",
655 .id
= QDU1000_SLAVE_ANOC_SNOC_GSI
,
659 .links
= { QDU1000_MASTER_ANOC_GSI
},
662 static struct qcom_icc_node qns_ddrss_cfg
= {
663 .name
= "qns_ddrss_cfg",
664 .id
= QDU1000_SLAVE_DDRSS_CFG
,
670 static struct qcom_icc_node qns_ecpri_gemnoc
= {
671 .name
= "qns_ecpri_gemnoc",
672 .id
= QDU1000_SLAVE_ECPRI_GEMNOC
,
676 .links
= { QDU1000_MASTER_GEMNOC_ECPRI_DMA
},
679 static struct qcom_icc_node qns_gemnoc_gc
= {
680 .name
= "qns_gemnoc_gc",
681 .id
= QDU1000_SLAVE_SNOC_GEM_NOC_GC
,
685 .links
= { QDU1000_MASTER_SNOC_GC_MEM_NOC
},
688 static struct qcom_icc_node qns_gemnoc_sf
= {
689 .name
= "qns_gemnoc_sf",
690 .id
= QDU1000_SLAVE_SNOC_GEM_NOC_SF
,
694 .links
= { QDU1000_MASTER_SNOC_SF_MEM_NOC
},
697 static struct qcom_icc_node qns_modem
= {
699 .id
= QDU1000_SLAVE_MODEM_OFFLINE
,
705 static struct qcom_icc_node qns_pcie_gemnoc
= {
706 .name
= "qns_pcie_gemnoc",
707 .id
= QDU1000_SLAVE_ANOC_PCIE_GEM_NOC
,
711 .links
= { QDU1000_MASTER_ANOC_PCIE_GEM_NOC
},
714 static struct qcom_icc_node qxs_imem
= {
716 .id
= QDU1000_SLAVE_IMEM
,
722 static struct qcom_icc_node qxs_pimem
= {
724 .id
= QDU1000_SLAVE_PIMEM
,
730 static struct qcom_icc_node srvc_system_noc
= {
731 .name
= "srvc_system_noc",
732 .id
= QDU1000_SLAVE_SERVICE_SNOC
,
738 static struct qcom_icc_node xs_ethernet_ss
= {
739 .name
= "xs_ethernet_ss",
740 .id
= QDU1000_SLAVE_ETHERNET_SS
,
746 static struct qcom_icc_node xs_pcie
= {
748 .id
= QDU1000_SLAVE_PCIE_0
,
754 static struct qcom_icc_node xs_qdss_stm
= {
755 .name
= "xs_qdss_stm",
756 .id
= QDU1000_SLAVE_QDSS_STM
,
762 static struct qcom_icc_node xs_sys_tcu_cfg
= {
763 .name
= "xs_sys_tcu_cfg",
764 .id
= QDU1000_SLAVE_TCU
,
770 static struct qcom_icc_bcm bcm_acv
= {
772 .enable_mask
= BIT(3),
777 static struct qcom_icc_bcm bcm_ce0
= {
780 .nodes
= { &qxm_crypto
},
783 static struct qcom_icc_bcm bcm_cn0
= {
786 .nodes
= { &qhm_qpic
, &qhm_qspi
,
787 &qnm_gemnoc_cnoc
, &qnm_gemnoc_modem_slave
,
788 &qnm_gemnoc_pcie
, &xm_sdc
,
789 &xm_usb3
, &qhs_ahb2phy0_south
,
790 &qhs_ahb2phy1_north
, &qhs_ahb2phy2_east
,
791 &qhs_aoss
, &qhs_clk_ctl
,
792 &qhs_cpr_cx
, &qhs_cpr_mx
,
793 &qhs_crypto_cfg
, &qhs_ecpri_cfg
,
794 &qhs_imem_cfg
, &qhs_ipc_router
,
795 &qhs_mss_cfg
, &qhs_pcie_cfg
,
796 &qhs_pdm
, &qhs_pimem_cfg
,
797 &qhs_prng
, &qhs_qdss_cfg
,
798 &qhs_qpic
, &qhs_qspi
,
799 &qhs_qup0
, &qhs_qup1
,
800 &qhs_sdc2
, &qhs_smbus_cfg
,
801 &qhs_system_noc_cfg
, &qhs_tcsr
,
802 &qhs_tlmm
, &qhs_tme_cfg
,
803 &qhs_tsc_cfg
, &qhs_usb3
,
804 &qhs_vsense_ctrl_cfg
, &qns_ddrss_cfg
,
805 &qns_modem
, &qxs_imem
,
806 &qxs_pimem
, &xs_ethernet_ss
,
807 &xs_qdss_stm
, &xs_sys_tcu_cfg
811 static struct qcom_icc_bcm bcm_mc0
= {
817 static struct qcom_icc_bcm bcm_qup0
= {
820 .nodes
= { &qup0_core_slave
, &qup1_core_slave
},
823 static struct qcom_icc_bcm bcm_sh0
= {
826 .nodes
= { &qns_llcc
},
829 static struct qcom_icc_bcm bcm_sh1
= {
832 .nodes
= { &alm_sys_tcu
, &chm_apps
,
833 &qnm_ecpri_dma
, &qnm_fec_2_gemnoc
,
834 &qnm_pcie
, &qnm_snoc_gc
,
835 &qnm_snoc_sf
, &qxm_mdsp
,
836 &qns_gem_noc_cnoc
, &qns_modem_slave
,
841 static struct qcom_icc_bcm bcm_sn0
= {
844 .nodes
= { &qns_gemnoc_sf
},
847 static struct qcom_icc_bcm bcm_sn1
= {
850 .nodes
= { &qhm_gic
, &qxm_pimem
,
851 &xm_gic
, &xm_qdss_etr0
,
852 &xm_qdss_etr1
, &qns_gemnoc_gc
856 static struct qcom_icc_bcm bcm_sn2
= {
859 .nodes
= { &qnm_aggre_noc
, &qxm_ecpri_gsi
,
860 &xm_ecpri_dma
, &qns_anoc_snoc_gsi
,
865 static struct qcom_icc_bcm bcm_sn7
= {
868 .nodes
= { &qns_pcie_gemnoc
, &xs_pcie
},
871 static struct qcom_icc_bcm
* const clk_virt_bcms
[] = {
875 static struct qcom_icc_node
* const clk_virt_nodes
[] = {
876 [MASTER_QUP_CORE_0
] = &qup0_core_master
,
877 [MASTER_QUP_CORE_1
] = &qup1_core_master
,
878 [SLAVE_QUP_CORE_0
] = &qup0_core_slave
,
879 [SLAVE_QUP_CORE_1
] = &qup1_core_slave
,
882 static const struct qcom_icc_desc qdu1000_clk_virt
= {
883 .nodes
= clk_virt_nodes
,
884 .num_nodes
= ARRAY_SIZE(clk_virt_nodes
),
885 .bcms
= clk_virt_bcms
,
886 .num_bcms
= ARRAY_SIZE(clk_virt_bcms
),
889 static struct qcom_icc_bcm
* const gem_noc_bcms
[] = {
894 static struct qcom_icc_node
* const gem_noc_nodes
[] = {
895 [MASTER_SYS_TCU
] = &alm_sys_tcu
,
896 [MASTER_APPSS_PROC
] = &chm_apps
,
897 [MASTER_GEMNOC_ECPRI_DMA
] = &qnm_ecpri_dma
,
898 [MASTER_FEC_2_GEMNOC
] = &qnm_fec_2_gemnoc
,
899 [MASTER_ANOC_PCIE_GEM_NOC
] = &qnm_pcie
,
900 [MASTER_SNOC_GC_MEM_NOC
] = &qnm_snoc_gc
,
901 [MASTER_SNOC_SF_MEM_NOC
] = &qnm_snoc_sf
,
902 [MASTER_MSS_PROC
] = &qxm_mdsp
,
903 [SLAVE_GEM_NOC_CNOC
] = &qns_gem_noc_cnoc
,
904 [SLAVE_LLCC
] = &qns_llcc
,
905 [SLAVE_GEMNOC_MODEM_CNOC
] = &qns_modem_slave
,
906 [SLAVE_MEM_NOC_PCIE_SNOC
] = &qns_pcie
,
909 static const struct qcom_icc_desc qdu1000_gem_noc
= {
910 .nodes
= gem_noc_nodes
,
911 .num_nodes
= ARRAY_SIZE(gem_noc_nodes
),
912 .bcms
= gem_noc_bcms
,
913 .num_bcms
= ARRAY_SIZE(gem_noc_bcms
),
916 static struct qcom_icc_bcm
* const mc_virt_bcms
[] = {
921 static struct qcom_icc_node
* const mc_virt_nodes
[] = {
922 [MASTER_LLCC
] = &llcc_mc
,
926 static const struct qcom_icc_desc qdu1000_mc_virt
= {
927 .nodes
= mc_virt_nodes
,
928 .num_nodes
= ARRAY_SIZE(mc_virt_nodes
),
929 .bcms
= mc_virt_bcms
,
930 .num_bcms
= ARRAY_SIZE(mc_virt_bcms
),
933 static struct qcom_icc_bcm
* const system_noc_bcms
[] = {
942 static struct qcom_icc_node
* const system_noc_nodes
[] = {
943 [MASTER_GIC_AHB
] = &qhm_gic
,
944 [MASTER_QDSS_BAM
] = &qhm_qdss_bam
,
945 [MASTER_QPIC
] = &qhm_qpic
,
946 [MASTER_QSPI_0
] = &qhm_qspi
,
947 [MASTER_QUP_0
] = &qhm_qup0
,
948 [MASTER_QUP_1
] = &qhm_qup1
,
949 [MASTER_SNOC_CFG
] = &qhm_system_noc_cfg
,
950 [MASTER_ANOC_SNOC
] = &qnm_aggre_noc
,
951 [MASTER_ANOC_GSI
] = &qnm_aggre_noc_gsi
,
952 [MASTER_GEM_NOC_CNOC
] = &qnm_gemnoc_cnoc
,
953 [MASTER_GEMNOC_MODEM_CNOC
] = &qnm_gemnoc_modem_slave
,
954 [MASTER_GEM_NOC_PCIE_SNOC
] = &qnm_gemnoc_pcie
,
955 [MASTER_CRYPTO
] = &qxm_crypto
,
956 [MASTER_ECPRI_GSI
] = &qxm_ecpri_gsi
,
957 [MASTER_PIMEM
] = &qxm_pimem
,
958 [MASTER_SNOC_ECPRI_DMA
] = &xm_ecpri_dma
,
959 [MASTER_GIC
] = &xm_gic
,
960 [MASTER_PCIE
] = &xm_pcie
,
961 [MASTER_QDSS_ETR
] = &xm_qdss_etr0
,
962 [MASTER_QDSS_ETR_1
] = &xm_qdss_etr1
,
963 [MASTER_SDCC_1
] = &xm_sdc
,
964 [MASTER_USB3
] = &xm_usb3
,
965 [SLAVE_AHB2PHY_SOUTH
] = &qhs_ahb2phy0_south
,
966 [SLAVE_AHB2PHY_NORTH
] = &qhs_ahb2phy1_north
,
967 [SLAVE_AHB2PHY_EAST
] = &qhs_ahb2phy2_east
,
968 [SLAVE_AOSS
] = &qhs_aoss
,
969 [SLAVE_CLK_CTL
] = &qhs_clk_ctl
,
970 [SLAVE_RBCPR_CX_CFG
] = &qhs_cpr_cx
,
971 [SLAVE_RBCPR_MX_CFG
] = &qhs_cpr_mx
,
972 [SLAVE_CRYPTO_0_CFG
] = &qhs_crypto_cfg
,
973 [SLAVE_ECPRI_CFG
] = &qhs_ecpri_cfg
,
974 [SLAVE_IMEM_CFG
] = &qhs_imem_cfg
,
975 [SLAVE_IPC_ROUTER_CFG
] = &qhs_ipc_router
,
976 [SLAVE_CNOC_MSS
] = &qhs_mss_cfg
,
977 [SLAVE_PCIE_CFG
] = &qhs_pcie_cfg
,
978 [SLAVE_PDM
] = &qhs_pdm
,
979 [SLAVE_PIMEM_CFG
] = &qhs_pimem_cfg
,
980 [SLAVE_PRNG
] = &qhs_prng
,
981 [SLAVE_QDSS_CFG
] = &qhs_qdss_cfg
,
982 [SLAVE_QPIC
] = &qhs_qpic
,
983 [SLAVE_QSPI_0
] = &qhs_qspi
,
984 [SLAVE_QUP_0
] = &qhs_qup0
,
985 [SLAVE_QUP_1
] = &qhs_qup1
,
986 [SLAVE_SDCC_2
] = &qhs_sdc2
,
987 [SLAVE_SMBUS_CFG
] = &qhs_smbus_cfg
,
988 [SLAVE_SNOC_CFG
] = &qhs_system_noc_cfg
,
989 [SLAVE_TCSR
] = &qhs_tcsr
,
990 [SLAVE_TLMM
] = &qhs_tlmm
,
991 [SLAVE_TME_CFG
] = &qhs_tme_cfg
,
992 [SLAVE_TSC_CFG
] = &qhs_tsc_cfg
,
993 [SLAVE_USB3_0
] = &qhs_usb3
,
994 [SLAVE_VSENSE_CTRL_CFG
] = &qhs_vsense_ctrl_cfg
,
995 [SLAVE_A1NOC_SNOC
] = &qns_a1noc_snoc
,
996 [SLAVE_ANOC_SNOC_GSI
] = &qns_anoc_snoc_gsi
,
997 [SLAVE_DDRSS_CFG
] = &qns_ddrss_cfg
,
998 [SLAVE_ECPRI_GEMNOC
] = &qns_ecpri_gemnoc
,
999 [SLAVE_SNOC_GEM_NOC_GC
] = &qns_gemnoc_gc
,
1000 [SLAVE_SNOC_GEM_NOC_SF
] = &qns_gemnoc_sf
,
1001 [SLAVE_MODEM_OFFLINE
] = &qns_modem
,
1002 [SLAVE_ANOC_PCIE_GEM_NOC
] = &qns_pcie_gemnoc
,
1003 [SLAVE_IMEM
] = &qxs_imem
,
1004 [SLAVE_PIMEM
] = &qxs_pimem
,
1005 [SLAVE_SERVICE_SNOC
] = &srvc_system_noc
,
1006 [SLAVE_ETHERNET_SS
] = &xs_ethernet_ss
,
1007 [SLAVE_PCIE_0
] = &xs_pcie
,
1008 [SLAVE_QDSS_STM
] = &xs_qdss_stm
,
1009 [SLAVE_TCU
] = &xs_sys_tcu_cfg
,
1012 static const struct qcom_icc_desc qdu1000_system_noc
= {
1013 .nodes
= system_noc_nodes
,
1014 .num_nodes
= ARRAY_SIZE(system_noc_nodes
),
1015 .bcms
= system_noc_bcms
,
1016 .num_bcms
= ARRAY_SIZE(system_noc_bcms
),
1019 static int qnoc_probe(struct platform_device
*pdev
)
1023 ret
= qcom_icc_rpmh_probe(pdev
);
1025 dev_err(&pdev
->dev
, "failed to register ICC provider\n");
1030 static const struct of_device_id qnoc_of_match
[] = {
1031 { .compatible
= "qcom,qdu1000-clk-virt",
1032 .data
= &qdu1000_clk_virt
1034 { .compatible
= "qcom,qdu1000-gem-noc",
1035 .data
= &qdu1000_gem_noc
1037 { .compatible
= "qcom,qdu1000-mc-virt",
1038 .data
= &qdu1000_mc_virt
1040 { .compatible
= "qcom,qdu1000-system-noc",
1041 .data
= &qdu1000_system_noc
1045 MODULE_DEVICE_TABLE(of
, qnoc_of_match
);
1047 static struct platform_driver qnoc_driver
= {
1048 .probe
= qnoc_probe
,
1049 .remove
= qcom_icc_rpmh_remove
,
1051 .name
= "qnoc-qdu1000",
1052 .of_match_table
= qnoc_of_match
,
1056 static int __init
qnoc_driver_init(void)
1058 return platform_driver_register(&qnoc_driver
);
1060 core_initcall(qnoc_driver_init
);
1062 static void __exit
qnoc_driver_exit(void)
1064 platform_driver_unregister(&qnoc_driver
);
1066 module_exit(qnoc_driver_exit
);
1068 MODULE_DESCRIPTION("QDU1000 NoC driver");
1069 MODULE_LICENSE("GPL");