1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __SOC_MEDIATEK_MT8183_PM_DOMAINS_H
4 #define __SOC_MEDIATEK_MT8183_PM_DOMAINS_H
6 #include "mtk-pm-domains.h"
7 #include <dt-bindings/power/mt8183-power.h>
10 * MT8183 power domain support
13 static const struct scpsys_domain_data scpsys_domain_data_mt8183
[] = {
14 [MT8183_POWER_DOMAIN_AUDIO
] = {
15 .sta_mask
= PWR_STATUS_AUDIO
,
17 .sram_pdn_bits
= GENMASK(11, 8),
18 .sram_pdn_ack_bits
= GENMASK(15, 12),
20 [MT8183_POWER_DOMAIN_CONN
] = {
21 .sta_mask
= PWR_STATUS_CONN
,
24 .sram_pdn_ack_bits
= 0,
26 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_CONN
, MT8183_TOP_AXI_PROT_EN_SET
,
27 MT8183_TOP_AXI_PROT_EN_CLR
, MT8183_TOP_AXI_PROT_EN_STA1
),
30 [MT8183_POWER_DOMAIN_MFG_ASYNC
] = {
31 .sta_mask
= PWR_STATUS_MFG_ASYNC
,
34 .sram_pdn_ack_bits
= 0,
36 [MT8183_POWER_DOMAIN_MFG
] = {
37 .sta_mask
= PWR_STATUS_MFG
,
39 .sram_pdn_bits
= GENMASK(8, 8),
40 .sram_pdn_ack_bits
= GENMASK(12, 12),
42 [MT8183_POWER_DOMAIN_MFG_CORE0
] = {
45 .sram_pdn_bits
= GENMASK(8, 8),
46 .sram_pdn_ack_bits
= GENMASK(12, 12),
48 [MT8183_POWER_DOMAIN_MFG_CORE1
] = {
51 .sram_pdn_bits
= GENMASK(8, 8),
52 .sram_pdn_ack_bits
= GENMASK(12, 12),
54 [MT8183_POWER_DOMAIN_MFG_2D
] = {
55 .sta_mask
= PWR_STATUS_MFG_2D
,
57 .sram_pdn_bits
= GENMASK(8, 8),
58 .sram_pdn_ack_bits
= GENMASK(12, 12),
60 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_1_MFG
, MT8183_TOP_AXI_PROT_EN_1_SET
,
61 MT8183_TOP_AXI_PROT_EN_1_CLR
, MT8183_TOP_AXI_PROT_EN_STA1_1
),
62 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MFG
, MT8183_TOP_AXI_PROT_EN_SET
,
63 MT8183_TOP_AXI_PROT_EN_CLR
, MT8183_TOP_AXI_PROT_EN_STA1
),
66 [MT8183_POWER_DOMAIN_DISP
] = {
67 .sta_mask
= PWR_STATUS_DISP
,
69 .sram_pdn_bits
= GENMASK(8, 8),
70 .sram_pdn_ack_bits
= GENMASK(12, 12),
72 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_1_DISP
, MT8183_TOP_AXI_PROT_EN_1_SET
,
73 MT8183_TOP_AXI_PROT_EN_1_CLR
, MT8183_TOP_AXI_PROT_EN_STA1_1
),
74 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_DISP
, MT8183_TOP_AXI_PROT_EN_SET
,
75 MT8183_TOP_AXI_PROT_EN_CLR
, MT8183_TOP_AXI_PROT_EN_STA1
),
78 BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_DISP
,
79 MT8183_SMI_COMMON_CLAMP_EN_SET
,
80 MT8183_SMI_COMMON_CLAMP_EN_CLR
,
81 MT8183_SMI_COMMON_CLAMP_EN
),
84 [MT8183_POWER_DOMAIN_CAM
] = {
87 .sram_pdn_bits
= GENMASK(9, 8),
88 .sram_pdn_ack_bits
= GENMASK(13, 12),
90 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_CAM
, MT8183_TOP_AXI_PROT_EN_MM_SET
,
91 MT8183_TOP_AXI_PROT_EN_MM_CLR
, MT8183_TOP_AXI_PROT_EN_MM_STA1
),
92 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_CAM
, MT8183_TOP_AXI_PROT_EN_SET
,
93 MT8183_TOP_AXI_PROT_EN_CLR
, MT8183_TOP_AXI_PROT_EN_STA1
),
94 BUS_PROT_WR_IGN(MT8183_TOP_AXI_PROT_EN_MM_CAM_2ND
,
95 MT8183_TOP_AXI_PROT_EN_MM_SET
,
96 MT8183_TOP_AXI_PROT_EN_MM_CLR
,
97 MT8183_TOP_AXI_PROT_EN_MM_STA1
),
100 BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_CAM
,
101 MT8183_SMI_COMMON_CLAMP_EN_SET
,
102 MT8183_SMI_COMMON_CLAMP_EN_CLR
,
103 MT8183_SMI_COMMON_CLAMP_EN
),
106 [MT8183_POWER_DOMAIN_ISP
] = {
107 .sta_mask
= PWR_STATUS_ISP
,
109 .sram_pdn_bits
= GENMASK(9, 8),
110 .sram_pdn_ack_bits
= GENMASK(13, 12),
112 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_ISP
,
113 MT8183_TOP_AXI_PROT_EN_MM_SET
,
114 MT8183_TOP_AXI_PROT_EN_MM_CLR
,
115 MT8183_TOP_AXI_PROT_EN_MM_STA1
),
116 BUS_PROT_WR_IGN(MT8183_TOP_AXI_PROT_EN_MM_ISP_2ND
,
117 MT8183_TOP_AXI_PROT_EN_MM_SET
,
118 MT8183_TOP_AXI_PROT_EN_MM_CLR
,
119 MT8183_TOP_AXI_PROT_EN_MM_STA1
),
122 BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_ISP
,
123 MT8183_SMI_COMMON_CLAMP_EN_SET
,
124 MT8183_SMI_COMMON_CLAMP_EN_CLR
,
125 MT8183_SMI_COMMON_CLAMP_EN
),
128 [MT8183_POWER_DOMAIN_VDEC
] = {
131 .sram_pdn_bits
= GENMASK(8, 8),
132 .sram_pdn_ack_bits
= GENMASK(12, 12),
134 BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_VDEC
,
135 MT8183_SMI_COMMON_CLAMP_EN_SET
,
136 MT8183_SMI_COMMON_CLAMP_EN_CLR
,
137 MT8183_SMI_COMMON_CLAMP_EN
),
140 [MT8183_POWER_DOMAIN_VENC
] = {
141 .sta_mask
= PWR_STATUS_VENC
,
143 .sram_pdn_bits
= GENMASK(11, 8),
144 .sram_pdn_ack_bits
= GENMASK(15, 12),
146 BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_VENC
,
147 MT8183_SMI_COMMON_CLAMP_EN_SET
,
148 MT8183_SMI_COMMON_CLAMP_EN_CLR
,
149 MT8183_SMI_COMMON_CLAMP_EN
),
152 [MT8183_POWER_DOMAIN_VPU_TOP
] = {
155 .sram_pdn_bits
= GENMASK(8, 8),
156 .sram_pdn_ack_bits
= GENMASK(12, 12),
158 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_VPU_TOP
,
159 MT8183_TOP_AXI_PROT_EN_MM_SET
,
160 MT8183_TOP_AXI_PROT_EN_MM_CLR
,
161 MT8183_TOP_AXI_PROT_EN_MM_STA1
),
162 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_VPU_TOP
,
163 MT8183_TOP_AXI_PROT_EN_SET
,
164 MT8183_TOP_AXI_PROT_EN_CLR
,
165 MT8183_TOP_AXI_PROT_EN_STA1
),
166 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_VPU_TOP_2ND
,
167 MT8183_TOP_AXI_PROT_EN_MM_SET
,
168 MT8183_TOP_AXI_PROT_EN_MM_CLR
,
169 MT8183_TOP_AXI_PROT_EN_MM_STA1
),
172 BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_VPU_TOP
,
173 MT8183_SMI_COMMON_CLAMP_EN_SET
,
174 MT8183_SMI_COMMON_CLAMP_EN_CLR
,
175 MT8183_SMI_COMMON_CLAMP_EN
),
178 [MT8183_POWER_DOMAIN_VPU_CORE0
] = {
181 .sram_pdn_bits
= GENMASK(11, 8),
182 .sram_pdn_ack_bits
= GENMASK(13, 12),
184 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE0
,
185 MT8183_TOP_AXI_PROT_EN_MCU_SET
,
186 MT8183_TOP_AXI_PROT_EN_MCU_CLR
,
187 MT8183_TOP_AXI_PROT_EN_MCU_STA1
),
188 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE0_2ND
,
189 MT8183_TOP_AXI_PROT_EN_MCU_SET
,
190 MT8183_TOP_AXI_PROT_EN_MCU_CLR
,
191 MT8183_TOP_AXI_PROT_EN_MCU_STA1
),
193 .caps
= MTK_SCPD_SRAM_ISO
,
195 [MT8183_POWER_DOMAIN_VPU_CORE1
] = {
198 .sram_pdn_bits
= GENMASK(11, 8),
199 .sram_pdn_ack_bits
= GENMASK(13, 12),
201 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE1
,
202 MT8183_TOP_AXI_PROT_EN_MCU_SET
,
203 MT8183_TOP_AXI_PROT_EN_MCU_CLR
,
204 MT8183_TOP_AXI_PROT_EN_MCU_STA1
),
205 BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE1_2ND
,
206 MT8183_TOP_AXI_PROT_EN_MCU_SET
,
207 MT8183_TOP_AXI_PROT_EN_MCU_CLR
,
208 MT8183_TOP_AXI_PROT_EN_MCU_STA1
),
210 .caps
= MTK_SCPD_SRAM_ISO
,
214 static const struct scpsys_soc_data mt8183_scpsys_data
= {
215 .domains_data
= scpsys_domain_data_mt8183
,
216 .num_domains
= ARRAY_SIZE(scpsys_domain_data_mt8183
),
217 .pwr_sta_offs
= 0x0180,
218 .pwr_sta2nd_offs
= 0x0184
221 #endif /* __SOC_MEDIATEK_MT8183_PM_DOMAINS_H */