1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Linaro Ltd
4 * Author: Jun Nie <jun.nie@linaro.org>
5 * With reference of msm8916 interconnect driver of Georgi Djakov.
8 #include <linux/device.h>
9 #include <linux/interconnect-provider.h>
11 #include <linux/module.h>
12 #include <linux/mod_devicetable.h>
13 #include <linux/platform_device.h>
14 #include <linux/regmap.h>
16 #include <dt-bindings/interconnect/qcom,msm8939.h>
21 MSM8939_BIMC_SNOC_MAS
= 1,
22 MSM8939_BIMC_SNOC_SLV
,
23 MSM8939_MASTER_AMPSS_M0
,
25 MSM8939_MASTER_BLSP_1
,
27 MSM8939_MASTER_GRAPHICS_3D
,
29 MSM8939_MASTER_MDP_PORT0
,
30 MSM8939_MASTER_MDP_PORT1
,
32 MSM8939_MASTER_CRYPTO_CORE0
,
33 MSM8939_MASTER_SDCC_1
,
34 MSM8939_MASTER_SDCC_2
,
35 MSM8939_MASTER_QDSS_BAM
,
36 MSM8939_MASTER_QDSS_ETR
,
37 MSM8939_MASTER_SNOC_CFG
,
40 MSM8939_MASTER_USB_HS1
,
41 MSM8939_MASTER_USB_HS2
,
43 MSM8939_MASTER_VIDEO_P0
,
44 MSM8939_SNOC_MM_INT_0
,
45 MSM8939_SNOC_MM_INT_1
,
46 MSM8939_SNOC_MM_INT_2
,
58 MSM8939_PNOC_SNOC_MAS
,
59 MSM8939_PNOC_SNOC_SLV
,
60 MSM8939_SNOC_QDSS_INT
,
61 MSM8939_SLAVE_AMPSS_L2
,
64 MSM8939_SLAVE_BIMC_CFG
,
66 MSM8939_SLAVE_BOOT_ROM
,
67 MSM8939_SLAVE_CAMERA_CFG
,
68 MSM8939_SLAVE_CATS_128
,
69 MSM8939_SLAVE_OCMEM_64
,
70 MSM8939_SLAVE_CLK_CTL
,
71 MSM8939_SLAVE_CRYPTO_0_CFG
,
72 MSM8939_SLAVE_DEHR_CFG
,
73 MSM8939_SLAVE_DISPLAY_CFG
,
74 MSM8939_SLAVE_EBI_CH0
,
75 MSM8939_SLAVE_GRAPHICS_3D_CFG
,
76 MSM8939_SLAVE_IMEM_CFG
,
79 MSM8939_SLAVE_MSG_RAM
,
82 MSM8939_SLAVE_PMIC_ARB
,
83 MSM8939_SLAVE_PNOC_CFG
,
85 MSM8939_SLAVE_QDSS_CFG
,
86 MSM8939_SLAVE_QDSS_STM
,
87 MSM8939_SLAVE_RBCPR_CFG
,
90 MSM8939_SLAVE_SECURITY
,
91 MSM8939_SLAVE_SNOC_CFG
,
93 MSM8939_SLAVE_SRVC_SNOC
,
96 MSM8939_SLAVE_USB_HS1
,
97 MSM8939_SLAVE_USB_HS2
,
98 MSM8939_SLAVE_VENUS_CFG
,
99 MSM8939_SNOC_BIMC_0_MAS
,
100 MSM8939_SNOC_BIMC_0_SLV
,
101 MSM8939_SNOC_BIMC_1_MAS
,
102 MSM8939_SNOC_BIMC_1_SLV
,
103 MSM8939_SNOC_BIMC_2_MAS
,
104 MSM8939_SNOC_BIMC_2_SLV
,
107 MSM8939_SNOC_INT_BIMC
,
108 MSM8939_SNOC_PNOC_MAS
,
109 MSM8939_SNOC_PNOC_SLV
,
112 static const u16 bimc_snoc_mas_links
[] = {
113 MSM8939_BIMC_SNOC_SLV
116 static struct qcom_icc_node bimc_snoc_mas
= {
117 .name
= "bimc_snoc_mas",
118 .id
= MSM8939_BIMC_SNOC_MAS
,
122 .qos
.ap_owned
= true,
123 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
124 .num_links
= ARRAY_SIZE(bimc_snoc_mas_links
),
125 .links
= bimc_snoc_mas_links
,
128 static const u16 bimc_snoc_slv_links
[] = {
133 static struct qcom_icc_node bimc_snoc_slv
= {
134 .name
= "bimc_snoc_slv",
135 .id
= MSM8939_BIMC_SNOC_SLV
,
139 .num_links
= ARRAY_SIZE(bimc_snoc_slv_links
),
140 .links
= bimc_snoc_slv_links
,
143 static const u16 mas_apss_links
[] = {
144 MSM8939_SLAVE_EBI_CH0
,
145 MSM8939_BIMC_SNOC_MAS
,
146 MSM8939_SLAVE_AMPSS_L2
149 static struct qcom_icc_node mas_apss
= {
151 .id
= MSM8939_MASTER_AMPSS_M0
,
155 .qos
.ap_owned
= true,
156 .qos
.qos_mode
= NOC_QOS_MODE_FIXED
,
160 .num_links
= ARRAY_SIZE(mas_apss_links
),
161 .links
= mas_apss_links
,
164 static const u16 mas_audio_links
[] = {
168 static struct qcom_icc_node mas_audio
= {
170 .id
= MSM8939_MASTER_LPASS
,
174 .num_links
= ARRAY_SIZE(mas_audio_links
),
175 .links
= mas_audio_links
,
178 static const u16 mas_blsp_1_links
[] = {
182 static struct qcom_icc_node mas_blsp_1
= {
183 .name
= "mas_blsp_1",
184 .id
= MSM8939_MASTER_BLSP_1
,
188 .num_links
= ARRAY_SIZE(mas_blsp_1_links
),
189 .links
= mas_blsp_1_links
,
192 static const u16 mas_dehr_links
[] = {
196 static struct qcom_icc_node mas_dehr
= {
198 .id
= MSM8939_MASTER_DEHR
,
202 .num_links
= ARRAY_SIZE(mas_dehr_links
),
203 .links
= mas_dehr_links
,
206 static const u16 mas_gfx_links
[] = {
207 MSM8939_SLAVE_EBI_CH0
,
208 MSM8939_BIMC_SNOC_MAS
,
209 MSM8939_SLAVE_AMPSS_L2
212 static struct qcom_icc_node mas_gfx
= {
214 .id
= MSM8939_MASTER_GRAPHICS_3D
,
218 .qos
.ap_owned
= true,
219 .qos
.qos_mode
= NOC_QOS_MODE_FIXED
,
223 .num_links
= ARRAY_SIZE(mas_gfx_links
),
224 .links
= mas_gfx_links
,
227 static const u16 mas_jpeg_links
[] = {
228 MSM8939_SNOC_MM_INT_0
,
229 MSM8939_SNOC_MM_INT_2
232 static struct qcom_icc_node mas_jpeg
= {
234 .id
= MSM8939_MASTER_JPEG
,
238 .qos
.ap_owned
= true,
239 .qos
.qos_mode
= NOC_QOS_MODE_BYPASS
,
243 .num_links
= ARRAY_SIZE(mas_jpeg_links
),
244 .links
= mas_jpeg_links
,
247 static const u16 mas_mdp0_links
[] = {
248 MSM8939_SNOC_MM_INT_1
,
249 MSM8939_SNOC_MM_INT_2
252 static struct qcom_icc_node mas_mdp0
= {
254 .id
= MSM8939_MASTER_MDP_PORT0
,
258 .qos
.ap_owned
= true,
259 .qos
.qos_mode
= NOC_QOS_MODE_BYPASS
,
263 .num_links
= ARRAY_SIZE(mas_mdp0_links
),
264 .links
= mas_mdp0_links
,
267 static const u16 mas_mdp1_links
[] = {
268 MSM8939_SNOC_MM_INT_0
,
269 MSM8939_SNOC_MM_INT_2
272 static struct qcom_icc_node mas_mdp1
= {
274 .id
= MSM8939_MASTER_MDP_PORT1
,
278 .qos
.ap_owned
= true,
279 .qos
.qos_mode
= NOC_QOS_MODE_BYPASS
,
283 .num_links
= ARRAY_SIZE(mas_mdp1_links
),
284 .links
= mas_mdp1_links
,
287 static const u16 mas_cpp_links
[] = {
288 MSM8939_SNOC_MM_INT_0
,
289 MSM8939_SNOC_MM_INT_2
292 static struct qcom_icc_node mas_cpp
= {
294 .id
= MSM8939_MASTER_CPP
,
298 .qos
.ap_owned
= true,
299 .qos
.qos_mode
= NOC_QOS_MODE_BYPASS
,
303 .num_links
= ARRAY_SIZE(mas_cpp_links
),
304 .links
= mas_cpp_links
,
307 static const u16 mas_pcnoc_crypto_0_links
[] = {
311 static struct qcom_icc_node mas_pcnoc_crypto_0
= {
312 .name
= "mas_pcnoc_crypto_0",
313 .id
= MSM8939_MASTER_CRYPTO_CORE0
,
317 .num_links
= ARRAY_SIZE(mas_pcnoc_crypto_0_links
),
318 .links
= mas_pcnoc_crypto_0_links
,
321 static const u16 mas_pcnoc_sdcc_1_links
[] = {
325 static struct qcom_icc_node mas_pcnoc_sdcc_1
= {
326 .name
= "mas_pcnoc_sdcc_1",
327 .id
= MSM8939_MASTER_SDCC_1
,
331 .num_links
= ARRAY_SIZE(mas_pcnoc_sdcc_1_links
),
332 .links
= mas_pcnoc_sdcc_1_links
,
335 static const u16 mas_pcnoc_sdcc_2_links
[] = {
339 static struct qcom_icc_node mas_pcnoc_sdcc_2
= {
340 .name
= "mas_pcnoc_sdcc_2",
341 .id
= MSM8939_MASTER_SDCC_2
,
345 .num_links
= ARRAY_SIZE(mas_pcnoc_sdcc_2_links
),
346 .links
= mas_pcnoc_sdcc_2_links
,
349 static const u16 mas_qdss_bam_links
[] = {
350 MSM8939_SNOC_QDSS_INT
353 static struct qcom_icc_node mas_qdss_bam
= {
354 .name
= "mas_qdss_bam",
355 .id
= MSM8939_MASTER_QDSS_BAM
,
359 .qos
.ap_owned
= true,
360 .qos
.qos_mode
= NOC_QOS_MODE_FIXED
,
364 .num_links
= ARRAY_SIZE(mas_qdss_bam_links
),
365 .links
= mas_qdss_bam_links
,
368 static const u16 mas_qdss_etr_links
[] = {
369 MSM8939_SNOC_QDSS_INT
372 static struct qcom_icc_node mas_qdss_etr
= {
373 .name
= "mas_qdss_etr",
374 .id
= MSM8939_MASTER_QDSS_ETR
,
378 .qos
.ap_owned
= true,
379 .qos
.qos_mode
= NOC_QOS_MODE_FIXED
,
383 .num_links
= ARRAY_SIZE(mas_qdss_etr_links
),
384 .links
= mas_qdss_etr_links
,
387 static const u16 mas_snoc_cfg_links
[] = {
388 MSM8939_SLAVE_SRVC_SNOC
391 static struct qcom_icc_node mas_snoc_cfg
= {
392 .name
= "mas_snoc_cfg",
393 .id
= MSM8939_MASTER_SNOC_CFG
,
397 .num_links
= ARRAY_SIZE(mas_snoc_cfg_links
),
398 .links
= mas_snoc_cfg_links
,
401 static const u16 mas_spdm_links
[] = {
405 static struct qcom_icc_node mas_spdm
= {
407 .id
= MSM8939_MASTER_SPDM
,
411 .num_links
= ARRAY_SIZE(mas_spdm_links
),
412 .links
= mas_spdm_links
,
415 static const u16 mas_tcu0_links
[] = {
416 MSM8939_SLAVE_EBI_CH0
,
417 MSM8939_BIMC_SNOC_MAS
,
418 MSM8939_SLAVE_AMPSS_L2
421 static struct qcom_icc_node mas_tcu0
= {
423 .id
= MSM8939_MASTER_TCU0
,
427 .qos
.ap_owned
= true,
428 .qos
.qos_mode
= NOC_QOS_MODE_FIXED
,
432 .num_links
= ARRAY_SIZE(mas_tcu0_links
),
433 .links
= mas_tcu0_links
,
436 static const u16 mas_usb_hs1_links
[] = {
440 static struct qcom_icc_node mas_usb_hs1
= {
441 .name
= "mas_usb_hs1",
442 .id
= MSM8939_MASTER_USB_HS1
,
446 .num_links
= ARRAY_SIZE(mas_usb_hs1_links
),
447 .links
= mas_usb_hs1_links
,
450 static const u16 mas_usb_hs2_links
[] = {
454 static struct qcom_icc_node mas_usb_hs2
= {
455 .name
= "mas_usb_hs2",
456 .id
= MSM8939_MASTER_USB_HS2
,
460 .num_links
= ARRAY_SIZE(mas_usb_hs2_links
),
461 .links
= mas_usb_hs2_links
,
464 static const u16 mas_vfe_links
[] = {
465 MSM8939_SNOC_MM_INT_1
,
466 MSM8939_SNOC_MM_INT_2
469 static struct qcom_icc_node mas_vfe
= {
471 .id
= MSM8939_MASTER_VFE
,
475 .qos
.ap_owned
= true,
476 .qos
.qos_mode
= NOC_QOS_MODE_BYPASS
,
480 .num_links
= ARRAY_SIZE(mas_vfe_links
),
481 .links
= mas_vfe_links
,
484 static const u16 mas_video_links
[] = {
485 MSM8939_SNOC_MM_INT_0
,
486 MSM8939_SNOC_MM_INT_2
489 static struct qcom_icc_node mas_video
= {
491 .id
= MSM8939_MASTER_VIDEO_P0
,
495 .qos
.ap_owned
= true,
496 .qos
.qos_mode
= NOC_QOS_MODE_BYPASS
,
500 .num_links
= ARRAY_SIZE(mas_video_links
),
501 .links
= mas_video_links
,
504 static const u16 mm_int_0_links
[] = {
505 MSM8939_SNOC_BIMC_2_MAS
508 static struct qcom_icc_node mm_int_0
= {
510 .id
= MSM8939_SNOC_MM_INT_0
,
514 .qos
.ap_owned
= true,
515 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
516 .num_links
= ARRAY_SIZE(mm_int_0_links
),
517 .links
= mm_int_0_links
,
520 static const u16 mm_int_1_links
[] = {
521 MSM8939_SNOC_BIMC_1_MAS
524 static struct qcom_icc_node mm_int_1
= {
526 .id
= MSM8939_SNOC_MM_INT_1
,
530 .qos
.ap_owned
= true,
531 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
532 .num_links
= ARRAY_SIZE(mm_int_1_links
),
533 .links
= mm_int_1_links
,
536 static const u16 mm_int_2_links
[] = {
540 static struct qcom_icc_node mm_int_2
= {
542 .id
= MSM8939_SNOC_MM_INT_2
,
546 .qos
.ap_owned
= true,
547 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
548 .num_links
= ARRAY_SIZE(mm_int_2_links
),
549 .links
= mm_int_2_links
,
552 static const u16 pcnoc_int_0_links
[] = {
553 MSM8939_PNOC_SNOC_MAS
,
563 static struct qcom_icc_node pcnoc_int_0
= {
564 .name
= "pcnoc_int_0",
565 .id
= MSM8939_PNOC_INT_0
,
569 .num_links
= ARRAY_SIZE(pcnoc_int_0_links
),
570 .links
= pcnoc_int_0_links
,
573 static const u16 pcnoc_int_1_links
[] = {
574 MSM8939_PNOC_SNOC_MAS
577 static struct qcom_icc_node pcnoc_int_1
= {
578 .name
= "pcnoc_int_1",
579 .id
= MSM8939_PNOC_INT_1
,
583 .num_links
= ARRAY_SIZE(pcnoc_int_1_links
),
584 .links
= pcnoc_int_1_links
,
587 static const u16 pcnoc_m_0_links
[] = {
591 static struct qcom_icc_node pcnoc_m_0
= {
593 .id
= MSM8939_PNOC_MAS_0
,
597 .num_links
= ARRAY_SIZE(pcnoc_m_0_links
),
598 .links
= pcnoc_m_0_links
,
601 static const u16 pcnoc_m_1_links
[] = {
602 MSM8939_PNOC_SNOC_MAS
605 static struct qcom_icc_node pcnoc_m_1
= {
607 .id
= MSM8939_PNOC_MAS_1
,
611 .num_links
= ARRAY_SIZE(pcnoc_m_1_links
),
612 .links
= pcnoc_m_1_links
,
615 static const u16 pcnoc_s_0_links
[] = {
616 MSM8939_SLAVE_CLK_CTL
,
619 MSM8939_SLAVE_SECURITY
,
623 static struct qcom_icc_node pcnoc_s_0
= {
625 .id
= MSM8939_PNOC_SLV_0
,
629 .num_links
= ARRAY_SIZE(pcnoc_s_0_links
),
630 .links
= pcnoc_s_0_links
,
633 static const u16 pcnoc_s_1_links
[] = {
634 MSM8939_SLAVE_IMEM_CFG
,
635 MSM8939_SLAVE_CRYPTO_0_CFG
,
636 MSM8939_SLAVE_MSG_RAM
,
641 static struct qcom_icc_node pcnoc_s_1
= {
643 .id
= MSM8939_PNOC_SLV_1
,
647 .num_links
= ARRAY_SIZE(pcnoc_s_1_links
),
648 .links
= pcnoc_s_1_links
,
651 static const u16 pcnoc_s_2_links
[] = {
653 MSM8939_SLAVE_BOOT_ROM
,
654 MSM8939_SLAVE_BIMC_CFG
,
655 MSM8939_SLAVE_PNOC_CFG
,
656 MSM8939_SLAVE_PMIC_ARB
659 static struct qcom_icc_node pcnoc_s_2
= {
661 .id
= MSM8939_PNOC_SLV_2
,
665 .num_links
= ARRAY_SIZE(pcnoc_s_2_links
),
666 .links
= pcnoc_s_2_links
,
669 static const u16 pcnoc_s_3_links
[] = {
671 MSM8939_SLAVE_SNOC_CFG
,
672 MSM8939_SLAVE_RBCPR_CFG
,
673 MSM8939_SLAVE_QDSS_CFG
,
674 MSM8939_SLAVE_DEHR_CFG
677 static struct qcom_icc_node pcnoc_s_3
= {
679 .id
= MSM8939_PNOC_SLV_3
,
683 .num_links
= ARRAY_SIZE(pcnoc_s_3_links
),
684 .links
= pcnoc_s_3_links
,
687 static const u16 pcnoc_s_4_links
[] = {
688 MSM8939_SLAVE_VENUS_CFG
,
689 MSM8939_SLAVE_CAMERA_CFG
,
690 MSM8939_SLAVE_DISPLAY_CFG
693 static struct qcom_icc_node pcnoc_s_4
= {
695 .id
= MSM8939_PNOC_SLV_4
,
699 .num_links
= ARRAY_SIZE(pcnoc_s_4_links
),
700 .links
= pcnoc_s_4_links
,
703 static const u16 pcnoc_s_8_links
[] = {
704 MSM8939_SLAVE_USB_HS1
,
705 MSM8939_SLAVE_SDCC_1
,
709 static struct qcom_icc_node pcnoc_s_8
= {
711 .id
= MSM8939_PNOC_SLV_8
,
715 .num_links
= ARRAY_SIZE(pcnoc_s_8_links
),
716 .links
= pcnoc_s_8_links
,
719 static const u16 pcnoc_s_9_links
[] = {
720 MSM8939_SLAVE_SDCC_2
,
722 MSM8939_SLAVE_USB_HS2
725 static struct qcom_icc_node pcnoc_s_9
= {
727 .id
= MSM8939_PNOC_SLV_9
,
731 .num_links
= ARRAY_SIZE(pcnoc_s_9_links
),
732 .links
= pcnoc_s_9_links
,
735 static const u16 pcnoc_snoc_mas_links
[] = {
736 MSM8939_PNOC_SNOC_SLV
739 static struct qcom_icc_node pcnoc_snoc_mas
= {
740 .name
= "pcnoc_snoc_mas",
741 .id
= MSM8939_PNOC_SNOC_MAS
,
745 .num_links
= ARRAY_SIZE(pcnoc_snoc_mas_links
),
746 .links
= pcnoc_snoc_mas_links
,
749 static const u16 pcnoc_snoc_slv_links
[] = {
751 MSM8939_SNOC_INT_BIMC
,
755 static struct qcom_icc_node pcnoc_snoc_slv
= {
756 .name
= "pcnoc_snoc_slv",
757 .id
= MSM8939_PNOC_SNOC_SLV
,
761 .num_links
= ARRAY_SIZE(pcnoc_snoc_slv_links
),
762 .links
= pcnoc_snoc_slv_links
,
765 static const u16 qdss_int_links
[] = {
767 MSM8939_SNOC_INT_BIMC
770 static struct qcom_icc_node qdss_int
= {
772 .id
= MSM8939_SNOC_QDSS_INT
,
776 .qos
.ap_owned
= true,
777 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
778 .num_links
= ARRAY_SIZE(qdss_int_links
),
779 .links
= qdss_int_links
,
782 static struct qcom_icc_node slv_apps_l2
= {
783 .name
= "slv_apps_l2",
784 .id
= MSM8939_SLAVE_AMPSS_L2
,
790 static struct qcom_icc_node slv_apss
= {
792 .id
= MSM8939_SLAVE_APSS
,
798 static struct qcom_icc_node slv_audio
= {
800 .id
= MSM8939_SLAVE_LPASS
,
806 static struct qcom_icc_node slv_bimc_cfg
= {
807 .name
= "slv_bimc_cfg",
808 .id
= MSM8939_SLAVE_BIMC_CFG
,
814 static struct qcom_icc_node slv_blsp_1
= {
815 .name
= "slv_blsp_1",
816 .id
= MSM8939_SLAVE_BLSP_1
,
822 static struct qcom_icc_node slv_boot_rom
= {
823 .name
= "slv_boot_rom",
824 .id
= MSM8939_SLAVE_BOOT_ROM
,
830 static struct qcom_icc_node slv_camera_cfg
= {
831 .name
= "slv_camera_cfg",
832 .id
= MSM8939_SLAVE_CAMERA_CFG
,
838 static struct qcom_icc_node slv_cats_0
= {
839 .name
= "slv_cats_0",
840 .id
= MSM8939_SLAVE_CATS_128
,
846 static struct qcom_icc_node slv_cats_1
= {
847 .name
= "slv_cats_1",
848 .id
= MSM8939_SLAVE_OCMEM_64
,
854 static struct qcom_icc_node slv_clk_ctl
= {
855 .name
= "slv_clk_ctl",
856 .id
= MSM8939_SLAVE_CLK_CTL
,
862 static struct qcom_icc_node slv_crypto_0_cfg
= {
863 .name
= "slv_crypto_0_cfg",
864 .id
= MSM8939_SLAVE_CRYPTO_0_CFG
,
870 static struct qcom_icc_node slv_dehr_cfg
= {
871 .name
= "slv_dehr_cfg",
872 .id
= MSM8939_SLAVE_DEHR_CFG
,
878 static struct qcom_icc_node slv_display_cfg
= {
879 .name
= "slv_display_cfg",
880 .id
= MSM8939_SLAVE_DISPLAY_CFG
,
886 static struct qcom_icc_node slv_ebi_ch0
= {
887 .name
= "slv_ebi_ch0",
888 .id
= MSM8939_SLAVE_EBI_CH0
,
894 static struct qcom_icc_node slv_gfx_cfg
= {
895 .name
= "slv_gfx_cfg",
896 .id
= MSM8939_SLAVE_GRAPHICS_3D_CFG
,
902 static struct qcom_icc_node slv_imem_cfg
= {
903 .name
= "slv_imem_cfg",
904 .id
= MSM8939_SLAVE_IMEM_CFG
,
910 static struct qcom_icc_node slv_imem
= {
912 .id
= MSM8939_SLAVE_IMEM
,
918 static struct qcom_icc_node slv_mpm
= {
920 .id
= MSM8939_SLAVE_MPM
,
926 static struct qcom_icc_node slv_msg_ram
= {
927 .name
= "slv_msg_ram",
928 .id
= MSM8939_SLAVE_MSG_RAM
,
934 static struct qcom_icc_node slv_mss
= {
936 .id
= MSM8939_SLAVE_MSS
,
942 static struct qcom_icc_node slv_pdm
= {
944 .id
= MSM8939_SLAVE_PDM
,
950 static struct qcom_icc_node slv_pmic_arb
= {
951 .name
= "slv_pmic_arb",
952 .id
= MSM8939_SLAVE_PMIC_ARB
,
958 static struct qcom_icc_node slv_pcnoc_cfg
= {
959 .name
= "slv_pcnoc_cfg",
960 .id
= MSM8939_SLAVE_PNOC_CFG
,
966 static struct qcom_icc_node slv_prng
= {
968 .id
= MSM8939_SLAVE_PRNG
,
974 static struct qcom_icc_node slv_qdss_cfg
= {
975 .name
= "slv_qdss_cfg",
976 .id
= MSM8939_SLAVE_QDSS_CFG
,
982 static struct qcom_icc_node slv_qdss_stm
= {
983 .name
= "slv_qdss_stm",
984 .id
= MSM8939_SLAVE_QDSS_STM
,
990 static struct qcom_icc_node slv_rbcpr_cfg
= {
991 .name
= "slv_rbcpr_cfg",
992 .id
= MSM8939_SLAVE_RBCPR_CFG
,
998 static struct qcom_icc_node slv_sdcc_1
= {
999 .name
= "slv_sdcc_1",
1000 .id
= MSM8939_SLAVE_SDCC_1
,
1006 static struct qcom_icc_node slv_sdcc_2
= {
1007 .name
= "slv_sdcc_2",
1008 .id
= MSM8939_SLAVE_SDCC_2
,
1014 static struct qcom_icc_node slv_security
= {
1015 .name
= "slv_security",
1016 .id
= MSM8939_SLAVE_SECURITY
,
1022 static struct qcom_icc_node slv_snoc_cfg
= {
1023 .name
= "slv_snoc_cfg",
1024 .id
= MSM8939_SLAVE_SNOC_CFG
,
1030 static struct qcom_icc_node slv_spdm
= {
1032 .id
= MSM8939_SLAVE_SPDM
,
1038 static struct qcom_icc_node slv_srvc_snoc
= {
1039 .name
= "slv_srvc_snoc",
1040 .id
= MSM8939_SLAVE_SRVC_SNOC
,
1046 static struct qcom_icc_node slv_tcsr
= {
1048 .id
= MSM8939_SLAVE_TCSR
,
1054 static struct qcom_icc_node slv_tlmm
= {
1056 .id
= MSM8939_SLAVE_TLMM
,
1062 static struct qcom_icc_node slv_usb_hs1
= {
1063 .name
= "slv_usb_hs1",
1064 .id
= MSM8939_SLAVE_USB_HS1
,
1070 static struct qcom_icc_node slv_usb_hs2
= {
1071 .name
= "slv_usb_hs2",
1072 .id
= MSM8939_SLAVE_USB_HS2
,
1078 static struct qcom_icc_node slv_venus_cfg
= {
1079 .name
= "slv_venus_cfg",
1080 .id
= MSM8939_SLAVE_VENUS_CFG
,
1086 static const u16 snoc_bimc_0_mas_links
[] = {
1087 MSM8939_SNOC_BIMC_0_SLV
1090 static struct qcom_icc_node snoc_bimc_0_mas
= {
1091 .name
= "snoc_bimc_0_mas",
1092 .id
= MSM8939_SNOC_BIMC_0_MAS
,
1096 .qos
.ap_owned
= true,
1097 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
1098 .num_links
= ARRAY_SIZE(snoc_bimc_0_mas_links
),
1099 .links
= snoc_bimc_0_mas_links
,
1102 static const u16 snoc_bimc_0_slv_links
[] = {
1103 MSM8939_SLAVE_EBI_CH0
1106 static struct qcom_icc_node snoc_bimc_0_slv
= {
1107 .name
= "snoc_bimc_0_slv",
1108 .id
= MSM8939_SNOC_BIMC_0_SLV
,
1112 .qos
.ap_owned
= true,
1113 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
1114 .num_links
= ARRAY_SIZE(snoc_bimc_0_slv_links
),
1115 .links
= snoc_bimc_0_slv_links
,
1118 static const u16 snoc_bimc_1_mas_links
[] = {
1119 MSM8939_SNOC_BIMC_1_SLV
1122 static struct qcom_icc_node snoc_bimc_1_mas
= {
1123 .name
= "snoc_bimc_1_mas",
1124 .id
= MSM8939_SNOC_BIMC_1_MAS
,
1128 .num_links
= ARRAY_SIZE(snoc_bimc_1_mas_links
),
1129 .links
= snoc_bimc_1_mas_links
,
1132 static const u16 snoc_bimc_1_slv_links
[] = {
1133 MSM8939_SLAVE_EBI_CH0
1136 static struct qcom_icc_node snoc_bimc_1_slv
= {
1137 .name
= "snoc_bimc_1_slv",
1138 .id
= MSM8939_SNOC_BIMC_1_SLV
,
1142 .num_links
= ARRAY_SIZE(snoc_bimc_1_slv_links
),
1143 .links
= snoc_bimc_1_slv_links
,
1146 static const u16 snoc_bimc_2_mas_links
[] = {
1147 MSM8939_SNOC_BIMC_2_SLV
1150 static struct qcom_icc_node snoc_bimc_2_mas
= {
1151 .name
= "snoc_bimc_2_mas",
1152 .id
= MSM8939_SNOC_BIMC_2_MAS
,
1156 .qos
.ap_owned
= true,
1157 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
1158 .num_links
= ARRAY_SIZE(snoc_bimc_2_mas_links
),
1159 .links
= snoc_bimc_2_mas_links
,
1162 static const u16 snoc_bimc_2_slv_links
[] = {
1163 MSM8939_SLAVE_EBI_CH0
1166 static struct qcom_icc_node snoc_bimc_2_slv
= {
1167 .name
= "snoc_bimc_2_slv",
1168 .id
= MSM8939_SNOC_BIMC_2_SLV
,
1172 .qos
.ap_owned
= true,
1173 .qos
.qos_mode
= NOC_QOS_MODE_INVALID
,
1174 .num_links
= ARRAY_SIZE(snoc_bimc_2_slv_links
),
1175 .links
= snoc_bimc_2_slv_links
,
1178 static const u16 snoc_int_0_links
[] = {
1179 MSM8939_SLAVE_QDSS_STM
,
1181 MSM8939_SNOC_PNOC_MAS
1184 static struct qcom_icc_node snoc_int_0
= {
1185 .name
= "snoc_int_0",
1186 .id
= MSM8939_SNOC_INT_0
,
1190 .num_links
= ARRAY_SIZE(snoc_int_0_links
),
1191 .links
= snoc_int_0_links
,
1194 static const u16 snoc_int_1_links
[] = {
1196 MSM8939_SLAVE_CATS_128
,
1197 MSM8939_SLAVE_OCMEM_64
1200 static struct qcom_icc_node snoc_int_1
= {
1201 .name
= "snoc_int_1",
1202 .id
= MSM8939_SNOC_INT_1
,
1206 .num_links
= ARRAY_SIZE(snoc_int_1_links
),
1207 .links
= snoc_int_1_links
,
1210 static const u16 snoc_int_bimc_links
[] = {
1211 MSM8939_SNOC_BIMC_1_MAS
1214 static struct qcom_icc_node snoc_int_bimc
= {
1215 .name
= "snoc_int_bimc",
1216 .id
= MSM8939_SNOC_INT_BIMC
,
1220 .num_links
= ARRAY_SIZE(snoc_int_bimc_links
),
1221 .links
= snoc_int_bimc_links
,
1224 static const u16 snoc_pcnoc_mas_links
[] = {
1225 MSM8939_SNOC_PNOC_SLV
1228 static struct qcom_icc_node snoc_pcnoc_mas
= {
1229 .name
= "snoc_pcnoc_mas",
1230 .id
= MSM8939_SNOC_PNOC_MAS
,
1234 .num_links
= ARRAY_SIZE(snoc_pcnoc_mas_links
),
1235 .links
= snoc_pcnoc_mas_links
,
1238 static const u16 snoc_pcnoc_slv_links
[] = {
1242 static struct qcom_icc_node snoc_pcnoc_slv
= {
1243 .name
= "snoc_pcnoc_slv",
1244 .id
= MSM8939_SNOC_PNOC_SLV
,
1248 .num_links
= ARRAY_SIZE(snoc_pcnoc_slv_links
),
1249 .links
= snoc_pcnoc_slv_links
,
1252 static struct qcom_icc_node
* const msm8939_snoc_nodes
[] = {
1253 [BIMC_SNOC_SLV
] = &bimc_snoc_slv
,
1254 [MASTER_QDSS_BAM
] = &mas_qdss_bam
,
1255 [MASTER_QDSS_ETR
] = &mas_qdss_etr
,
1256 [MASTER_SNOC_CFG
] = &mas_snoc_cfg
,
1257 [PCNOC_SNOC_SLV
] = &pcnoc_snoc_slv
,
1258 [SLAVE_APSS
] = &slv_apss
,
1259 [SLAVE_CATS_128
] = &slv_cats_0
,
1260 [SLAVE_OCMEM_64
] = &slv_cats_1
,
1261 [SLAVE_IMEM
] = &slv_imem
,
1262 [SLAVE_QDSS_STM
] = &slv_qdss_stm
,
1263 [SLAVE_SRVC_SNOC
] = &slv_srvc_snoc
,
1264 [SNOC_BIMC_0_MAS
] = &snoc_bimc_0_mas
,
1265 [SNOC_BIMC_1_MAS
] = &snoc_bimc_1_mas
,
1266 [SNOC_BIMC_2_MAS
] = &snoc_bimc_2_mas
,
1267 [SNOC_INT_0
] = &snoc_int_0
,
1268 [SNOC_INT_1
] = &snoc_int_1
,
1269 [SNOC_INT_BIMC
] = &snoc_int_bimc
,
1270 [SNOC_PCNOC_MAS
] = &snoc_pcnoc_mas
,
1271 [SNOC_QDSS_INT
] = &qdss_int
,
1274 static const struct regmap_config msm8939_snoc_regmap_config
= {
1278 .max_register
= 0x14080,
1282 static const struct qcom_icc_desc msm8939_snoc
= {
1283 .type
= QCOM_ICC_NOC
,
1284 .nodes
= msm8939_snoc_nodes
,
1285 .num_nodes
= ARRAY_SIZE(msm8939_snoc_nodes
),
1286 .bus_clk_desc
= &bus_1_clk
,
1287 .regmap_cfg
= &msm8939_snoc_regmap_config
,
1288 .qos_offset
= 0x7000,
1291 static struct qcom_icc_node
* const msm8939_snoc_mm_nodes
[] = {
1292 [MASTER_VIDEO_P0
] = &mas_video
,
1293 [MASTER_JPEG
] = &mas_jpeg
,
1294 [MASTER_VFE
] = &mas_vfe
,
1295 [MASTER_MDP_PORT0
] = &mas_mdp0
,
1296 [MASTER_MDP_PORT1
] = &mas_mdp1
,
1297 [MASTER_CPP
] = &mas_cpp
,
1298 [SNOC_MM_INT_0
] = &mm_int_0
,
1299 [SNOC_MM_INT_1
] = &mm_int_1
,
1300 [SNOC_MM_INT_2
] = &mm_int_2
,
1303 static const struct qcom_icc_desc msm8939_snoc_mm
= {
1304 .type
= QCOM_ICC_NOC
,
1305 .nodes
= msm8939_snoc_mm_nodes
,
1306 .num_nodes
= ARRAY_SIZE(msm8939_snoc_mm_nodes
),
1307 .bus_clk_desc
= &bus_2_clk
,
1308 .regmap_cfg
= &msm8939_snoc_regmap_config
,
1309 .qos_offset
= 0x7000,
1312 static struct qcom_icc_node
* const msm8939_bimc_nodes
[] = {
1313 [BIMC_SNOC_MAS
] = &bimc_snoc_mas
,
1314 [MASTER_AMPSS_M0
] = &mas_apss
,
1315 [MASTER_GRAPHICS_3D
] = &mas_gfx
,
1316 [MASTER_TCU0
] = &mas_tcu0
,
1317 [SLAVE_AMPSS_L2
] = &slv_apps_l2
,
1318 [SLAVE_EBI_CH0
] = &slv_ebi_ch0
,
1319 [SNOC_BIMC_0_SLV
] = &snoc_bimc_0_slv
,
1320 [SNOC_BIMC_1_SLV
] = &snoc_bimc_1_slv
,
1321 [SNOC_BIMC_2_SLV
] = &snoc_bimc_2_slv
,
1324 static const struct regmap_config msm8939_bimc_regmap_config
= {
1328 .max_register
= 0x62000,
1332 static const struct qcom_icc_desc msm8939_bimc
= {
1333 .type
= QCOM_ICC_BIMC
,
1334 .nodes
= msm8939_bimc_nodes
,
1335 .num_nodes
= ARRAY_SIZE(msm8939_bimc_nodes
),
1336 .bus_clk_desc
= &bimc_clk
,
1337 .regmap_cfg
= &msm8939_bimc_regmap_config
,
1338 .qos_offset
= 0x8000,
1341 static struct qcom_icc_node
* const msm8939_pcnoc_nodes
[] = {
1342 [MASTER_BLSP_1
] = &mas_blsp_1
,
1343 [MASTER_DEHR
] = &mas_dehr
,
1344 [MASTER_LPASS
] = &mas_audio
,
1345 [MASTER_CRYPTO_CORE0
] = &mas_pcnoc_crypto_0
,
1346 [MASTER_SDCC_1
] = &mas_pcnoc_sdcc_1
,
1347 [MASTER_SDCC_2
] = &mas_pcnoc_sdcc_2
,
1348 [MASTER_SPDM
] = &mas_spdm
,
1349 [MASTER_USB_HS1
] = &mas_usb_hs1
,
1350 [MASTER_USB_HS2
] = &mas_usb_hs2
,
1351 [PCNOC_INT_0
] = &pcnoc_int_0
,
1352 [PCNOC_INT_1
] = &pcnoc_int_1
,
1353 [PCNOC_MAS_0
] = &pcnoc_m_0
,
1354 [PCNOC_MAS_1
] = &pcnoc_m_1
,
1355 [PCNOC_SLV_0
] = &pcnoc_s_0
,
1356 [PCNOC_SLV_1
] = &pcnoc_s_1
,
1357 [PCNOC_SLV_2
] = &pcnoc_s_2
,
1358 [PCNOC_SLV_3
] = &pcnoc_s_3
,
1359 [PCNOC_SLV_4
] = &pcnoc_s_4
,
1360 [PCNOC_SLV_8
] = &pcnoc_s_8
,
1361 [PCNOC_SLV_9
] = &pcnoc_s_9
,
1362 [PCNOC_SNOC_MAS
] = &pcnoc_snoc_mas
,
1363 [SLAVE_BIMC_CFG
] = &slv_bimc_cfg
,
1364 [SLAVE_BLSP_1
] = &slv_blsp_1
,
1365 [SLAVE_BOOT_ROM
] = &slv_boot_rom
,
1366 [SLAVE_CAMERA_CFG
] = &slv_camera_cfg
,
1367 [SLAVE_CLK_CTL
] = &slv_clk_ctl
,
1368 [SLAVE_CRYPTO_0_CFG
] = &slv_crypto_0_cfg
,
1369 [SLAVE_DEHR_CFG
] = &slv_dehr_cfg
,
1370 [SLAVE_DISPLAY_CFG
] = &slv_display_cfg
,
1371 [SLAVE_GRAPHICS_3D_CFG
] = &slv_gfx_cfg
,
1372 [SLAVE_IMEM_CFG
] = &slv_imem_cfg
,
1373 [SLAVE_LPASS
] = &slv_audio
,
1374 [SLAVE_MPM
] = &slv_mpm
,
1375 [SLAVE_MSG_RAM
] = &slv_msg_ram
,
1376 [SLAVE_MSS
] = &slv_mss
,
1377 [SLAVE_PDM
] = &slv_pdm
,
1378 [SLAVE_PMIC_ARB
] = &slv_pmic_arb
,
1379 [SLAVE_PCNOC_CFG
] = &slv_pcnoc_cfg
,
1380 [SLAVE_PRNG
] = &slv_prng
,
1381 [SLAVE_QDSS_CFG
] = &slv_qdss_cfg
,
1382 [SLAVE_RBCPR_CFG
] = &slv_rbcpr_cfg
,
1383 [SLAVE_SDCC_1
] = &slv_sdcc_1
,
1384 [SLAVE_SDCC_2
] = &slv_sdcc_2
,
1385 [SLAVE_SECURITY
] = &slv_security
,
1386 [SLAVE_SNOC_CFG
] = &slv_snoc_cfg
,
1387 [SLAVE_SPDM
] = &slv_spdm
,
1388 [SLAVE_TCSR
] = &slv_tcsr
,
1389 [SLAVE_TLMM
] = &slv_tlmm
,
1390 [SLAVE_USB_HS1
] = &slv_usb_hs1
,
1391 [SLAVE_USB_HS2
] = &slv_usb_hs2
,
1392 [SLAVE_VENUS_CFG
] = &slv_venus_cfg
,
1393 [SNOC_PCNOC_SLV
] = &snoc_pcnoc_slv
,
1396 static const struct regmap_config msm8939_pcnoc_regmap_config
= {
1400 .max_register
= 0x11000,
1404 static const struct qcom_icc_desc msm8939_pcnoc
= {
1405 .type
= QCOM_ICC_NOC
,
1406 .nodes
= msm8939_pcnoc_nodes
,
1407 .num_nodes
= ARRAY_SIZE(msm8939_pcnoc_nodes
),
1408 .bus_clk_desc
= &bus_0_clk
,
1409 .regmap_cfg
= &msm8939_pcnoc_regmap_config
,
1410 .qos_offset
= 0x7000,
1413 static const struct of_device_id msm8939_noc_of_match
[] = {
1414 { .compatible
= "qcom,msm8939-bimc", .data
= &msm8939_bimc
},
1415 { .compatible
= "qcom,msm8939-pcnoc", .data
= &msm8939_pcnoc
},
1416 { .compatible
= "qcom,msm8939-snoc", .data
= &msm8939_snoc
},
1417 { .compatible
= "qcom,msm8939-snoc-mm", .data
= &msm8939_snoc_mm
},
1420 MODULE_DEVICE_TABLE(of
, msm8939_noc_of_match
);
1422 static struct platform_driver msm8939_noc_driver
= {
1423 .probe
= qnoc_probe
,
1424 .remove
= qnoc_remove
,
1426 .name
= "qnoc-msm8939",
1427 .of_match_table
= msm8939_noc_of_match
,
1428 .sync_state
= icc_sync_state
,
1431 module_platform_driver(msm8939_noc_driver
);
1432 MODULE_AUTHOR("Jun Nie <jun.nie@linaro.org>");
1433 MODULE_DESCRIPTION("Qualcomm MSM8939 NoC driver");
1434 MODULE_LICENSE("GPL v2");