162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci#ifndef __SOC_MEDIATEK_MT8183_PM_DOMAINS_H
462306a36Sopenharmony_ci#define __SOC_MEDIATEK_MT8183_PM_DOMAINS_H
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#include "mtk-pm-domains.h"
762306a36Sopenharmony_ci#include <dt-bindings/power/mt8183-power.h>
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci/*
1062306a36Sopenharmony_ci * MT8183 power domain support
1162306a36Sopenharmony_ci */
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_cistatic const struct scpsys_domain_data scpsys_domain_data_mt8183[] = {
1462306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_AUDIO] = {
1562306a36Sopenharmony_ci		.name = "audio",
1662306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_AUDIO,
1762306a36Sopenharmony_ci		.ctl_offs = 0x0314,
1862306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
1962306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
2062306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(11, 8),
2162306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(15, 12),
2262306a36Sopenharmony_ci	},
2362306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_CONN] = {
2462306a36Sopenharmony_ci		.name = "conn",
2562306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_CONN,
2662306a36Sopenharmony_ci		.ctl_offs = 0x032c,
2762306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
2862306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
2962306a36Sopenharmony_ci		.sram_pdn_bits = 0,
3062306a36Sopenharmony_ci		.sram_pdn_ack_bits = 0,
3162306a36Sopenharmony_ci		.bp_infracfg = {
3262306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_CONN, MT8183_TOP_AXI_PROT_EN_SET,
3362306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_CLR, MT8183_TOP_AXI_PROT_EN_STA1),
3462306a36Sopenharmony_ci		},
3562306a36Sopenharmony_ci	},
3662306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_MFG_ASYNC] = {
3762306a36Sopenharmony_ci		.name = "mfg_async",
3862306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_MFG_ASYNC,
3962306a36Sopenharmony_ci		.ctl_offs = 0x0334,
4062306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
4162306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
4262306a36Sopenharmony_ci		.sram_pdn_bits = 0,
4362306a36Sopenharmony_ci		.sram_pdn_ack_bits = 0,
4462306a36Sopenharmony_ci		.caps = MTK_SCPD_DOMAIN_SUPPLY,
4562306a36Sopenharmony_ci	},
4662306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_MFG] = {
4762306a36Sopenharmony_ci		.name = "mfg",
4862306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_MFG,
4962306a36Sopenharmony_ci		.ctl_offs = 0x0338,
5062306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
5162306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
5262306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
5362306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
5462306a36Sopenharmony_ci		.caps = MTK_SCPD_DOMAIN_SUPPLY,
5562306a36Sopenharmony_ci	},
5662306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_MFG_CORE0] = {
5762306a36Sopenharmony_ci		.name = "mfg_core0",
5862306a36Sopenharmony_ci		.sta_mask = BIT(7),
5962306a36Sopenharmony_ci		.ctl_offs = 0x034c,
6062306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
6162306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
6262306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
6362306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
6462306a36Sopenharmony_ci	},
6562306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_MFG_CORE1] = {
6662306a36Sopenharmony_ci		.name = "mfg_core1",
6762306a36Sopenharmony_ci		.sta_mask = BIT(20),
6862306a36Sopenharmony_ci		.ctl_offs = 0x0310,
6962306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
7062306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
7162306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
7262306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
7362306a36Sopenharmony_ci	},
7462306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_MFG_2D] = {
7562306a36Sopenharmony_ci		.name = "mfg_2d",
7662306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_MFG_2D,
7762306a36Sopenharmony_ci		.ctl_offs = 0x0348,
7862306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
7962306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
8062306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
8162306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
8262306a36Sopenharmony_ci		.bp_infracfg = {
8362306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_1_MFG, MT8183_TOP_AXI_PROT_EN_1_SET,
8462306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_1_CLR, MT8183_TOP_AXI_PROT_EN_STA1_1),
8562306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MFG, MT8183_TOP_AXI_PROT_EN_SET,
8662306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_CLR, MT8183_TOP_AXI_PROT_EN_STA1),
8762306a36Sopenharmony_ci		},
8862306a36Sopenharmony_ci	},
8962306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_DISP] = {
9062306a36Sopenharmony_ci		.name = "disp",
9162306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_DISP,
9262306a36Sopenharmony_ci		.ctl_offs = 0x030c,
9362306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
9462306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
9562306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
9662306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
9762306a36Sopenharmony_ci		.bp_infracfg = {
9862306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_1_DISP, MT8183_TOP_AXI_PROT_EN_1_SET,
9962306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_1_CLR, MT8183_TOP_AXI_PROT_EN_STA1_1),
10062306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_DISP, MT8183_TOP_AXI_PROT_EN_SET,
10162306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_CLR, MT8183_TOP_AXI_PROT_EN_STA1),
10262306a36Sopenharmony_ci		},
10362306a36Sopenharmony_ci		.bp_smi = {
10462306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_DISP,
10562306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_SET,
10662306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_CLR,
10762306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN),
10862306a36Sopenharmony_ci		},
10962306a36Sopenharmony_ci	},
11062306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_CAM] = {
11162306a36Sopenharmony_ci		.name = "cam",
11262306a36Sopenharmony_ci		.sta_mask = BIT(25),
11362306a36Sopenharmony_ci		.ctl_offs = 0x0344,
11462306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
11562306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
11662306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(9, 8),
11762306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(13, 12),
11862306a36Sopenharmony_ci		.bp_infracfg = {
11962306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_CAM, MT8183_TOP_AXI_PROT_EN_MM_SET,
12062306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_CLR, MT8183_TOP_AXI_PROT_EN_MM_STA1),
12162306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_CAM, MT8183_TOP_AXI_PROT_EN_SET,
12262306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_CLR, MT8183_TOP_AXI_PROT_EN_STA1),
12362306a36Sopenharmony_ci			BUS_PROT_WR_IGN(MT8183_TOP_AXI_PROT_EN_MM_CAM_2ND,
12462306a36Sopenharmony_ci					MT8183_TOP_AXI_PROT_EN_MM_SET,
12562306a36Sopenharmony_ci					MT8183_TOP_AXI_PROT_EN_MM_CLR,
12662306a36Sopenharmony_ci					MT8183_TOP_AXI_PROT_EN_MM_STA1),
12762306a36Sopenharmony_ci		},
12862306a36Sopenharmony_ci		.bp_smi = {
12962306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_CAM,
13062306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_SET,
13162306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_CLR,
13262306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN),
13362306a36Sopenharmony_ci		},
13462306a36Sopenharmony_ci	},
13562306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_ISP] = {
13662306a36Sopenharmony_ci		.name = "isp",
13762306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_ISP,
13862306a36Sopenharmony_ci		.ctl_offs = 0x0308,
13962306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
14062306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
14162306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(9, 8),
14262306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(13, 12),
14362306a36Sopenharmony_ci		.bp_infracfg = {
14462306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_ISP,
14562306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_SET,
14662306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_CLR,
14762306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_STA1),
14862306a36Sopenharmony_ci			BUS_PROT_WR_IGN(MT8183_TOP_AXI_PROT_EN_MM_ISP_2ND,
14962306a36Sopenharmony_ci					MT8183_TOP_AXI_PROT_EN_MM_SET,
15062306a36Sopenharmony_ci					MT8183_TOP_AXI_PROT_EN_MM_CLR,
15162306a36Sopenharmony_ci					MT8183_TOP_AXI_PROT_EN_MM_STA1),
15262306a36Sopenharmony_ci		},
15362306a36Sopenharmony_ci		.bp_smi = {
15462306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_ISP,
15562306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_SET,
15662306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_CLR,
15762306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN),
15862306a36Sopenharmony_ci		},
15962306a36Sopenharmony_ci	},
16062306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_VDEC] = {
16162306a36Sopenharmony_ci		.name = "vdec",
16262306a36Sopenharmony_ci		.sta_mask = BIT(31),
16362306a36Sopenharmony_ci		.ctl_offs = 0x0300,
16462306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
16562306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
16662306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
16762306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
16862306a36Sopenharmony_ci		.bp_smi = {
16962306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_VDEC,
17062306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_SET,
17162306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_CLR,
17262306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN),
17362306a36Sopenharmony_ci		},
17462306a36Sopenharmony_ci	},
17562306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_VENC] = {
17662306a36Sopenharmony_ci		.name = "venc",
17762306a36Sopenharmony_ci		.sta_mask = PWR_STATUS_VENC,
17862306a36Sopenharmony_ci		.ctl_offs = 0x0304,
17962306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
18062306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
18162306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(11, 8),
18262306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(15, 12),
18362306a36Sopenharmony_ci		.bp_smi = {
18462306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_VENC,
18562306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_SET,
18662306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_CLR,
18762306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN),
18862306a36Sopenharmony_ci		},
18962306a36Sopenharmony_ci	},
19062306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_VPU_TOP] = {
19162306a36Sopenharmony_ci		.name = "vpu_top",
19262306a36Sopenharmony_ci		.sta_mask = BIT(26),
19362306a36Sopenharmony_ci		.ctl_offs = 0x0324,
19462306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
19562306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
19662306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(8, 8),
19762306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(12, 12),
19862306a36Sopenharmony_ci		.bp_infracfg = {
19962306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_VPU_TOP,
20062306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_SET,
20162306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_CLR,
20262306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_STA1),
20362306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_VPU_TOP,
20462306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_SET,
20562306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_CLR,
20662306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_STA1),
20762306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MM_VPU_TOP_2ND,
20862306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_SET,
20962306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_CLR,
21062306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MM_STA1),
21162306a36Sopenharmony_ci		},
21262306a36Sopenharmony_ci		.bp_smi = {
21362306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_SMI_COMMON_SMI_CLAMP_VPU_TOP,
21462306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_SET,
21562306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN_CLR,
21662306a36Sopenharmony_ci				    MT8183_SMI_COMMON_CLAMP_EN),
21762306a36Sopenharmony_ci		},
21862306a36Sopenharmony_ci	},
21962306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_VPU_CORE0] = {
22062306a36Sopenharmony_ci		.name = "vpu_core0",
22162306a36Sopenharmony_ci		.sta_mask = BIT(27),
22262306a36Sopenharmony_ci		.ctl_offs = 0x33c,
22362306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
22462306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
22562306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(11, 8),
22662306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(13, 12),
22762306a36Sopenharmony_ci		.bp_infracfg = {
22862306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE0,
22962306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_SET,
23062306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_CLR,
23162306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_STA1),
23262306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE0_2ND,
23362306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_SET,
23462306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_CLR,
23562306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_STA1),
23662306a36Sopenharmony_ci		},
23762306a36Sopenharmony_ci		.caps = MTK_SCPD_SRAM_ISO,
23862306a36Sopenharmony_ci	},
23962306a36Sopenharmony_ci	[MT8183_POWER_DOMAIN_VPU_CORE1] = {
24062306a36Sopenharmony_ci		.name = "vpu_core1",
24162306a36Sopenharmony_ci		.sta_mask = BIT(28),
24262306a36Sopenharmony_ci		.ctl_offs = 0x0340,
24362306a36Sopenharmony_ci		.pwr_sta_offs = 0x0180,
24462306a36Sopenharmony_ci		.pwr_sta2nd_offs = 0x0184,
24562306a36Sopenharmony_ci		.sram_pdn_bits = GENMASK(11, 8),
24662306a36Sopenharmony_ci		.sram_pdn_ack_bits = GENMASK(13, 12),
24762306a36Sopenharmony_ci		.bp_infracfg = {
24862306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE1,
24962306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_SET,
25062306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_CLR,
25162306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_STA1),
25262306a36Sopenharmony_ci			BUS_PROT_WR(MT8183_TOP_AXI_PROT_EN_MCU_VPU_CORE1_2ND,
25362306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_SET,
25462306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_CLR,
25562306a36Sopenharmony_ci				    MT8183_TOP_AXI_PROT_EN_MCU_STA1),
25662306a36Sopenharmony_ci		},
25762306a36Sopenharmony_ci		.caps = MTK_SCPD_SRAM_ISO,
25862306a36Sopenharmony_ci	},
25962306a36Sopenharmony_ci};
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_cistatic const struct scpsys_soc_data mt8183_scpsys_data = {
26262306a36Sopenharmony_ci	.domains_data = scpsys_domain_data_mt8183,
26362306a36Sopenharmony_ci	.num_domains = ARRAY_SIZE(scpsys_domain_data_mt8183),
26462306a36Sopenharmony_ci};
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci#endif /* __SOC_MEDIATEK_MT8183_PM_DOMAINS_H */
267