xref: /linux/drivers/pmdomain/mediatek/mt8167-pm-domains.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1e2ad626fSUlf Hansson /* SPDX-License-Identifier: GPL-2.0-only */
2e2ad626fSUlf Hansson 
3e2ad626fSUlf Hansson #ifndef __SOC_MEDIATEK_MT8167_PM_DOMAINS_H
4e2ad626fSUlf Hansson #define __SOC_MEDIATEK_MT8167_PM_DOMAINS_H
5e2ad626fSUlf Hansson 
6e2ad626fSUlf Hansson #include "mtk-pm-domains.h"
7e2ad626fSUlf Hansson #include <dt-bindings/power/mt8167-power.h>
8e2ad626fSUlf Hansson 
9e2ad626fSUlf Hansson #define MT8167_PWR_STATUS_MFG_2D	BIT(24)
10e2ad626fSUlf Hansson #define MT8167_PWR_STATUS_MFG_ASYNC	BIT(25)
11e2ad626fSUlf Hansson 
12e2ad626fSUlf Hansson /*
13e2ad626fSUlf Hansson  * MT8167 power domain support
14e2ad626fSUlf Hansson  */
15e2ad626fSUlf Hansson 
16e2ad626fSUlf Hansson static const struct scpsys_domain_data scpsys_domain_data_mt8167[] = {
17e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_MM] = {
18e2ad626fSUlf Hansson 		.name = "mm",
19e2ad626fSUlf Hansson 		.sta_mask = PWR_STATUS_DISP,
20e2ad626fSUlf Hansson 		.ctl_offs = SPM_DIS_PWR_CON,
21e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
22e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
23e2ad626fSUlf Hansson 		.sram_pdn_bits = GENMASK(11, 8),
24e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = GENMASK(12, 12),
25*151bd6c5SMarkus Schneider-Pargmann 		.bp_cfg = {
26*151bd6c5SMarkus Schneider-Pargmann 			BUS_PROT_INFRA_UPDATE_TOPAXI(MT8167_TOP_AXI_PROT_EN_MM_EMI |
27e2ad626fSUlf Hansson 						     MT8167_TOP_AXI_PROT_EN_MCU_MM),
28e2ad626fSUlf Hansson 		},
29e2ad626fSUlf Hansson 		.caps = MTK_SCPD_ACTIVE_WAKEUP,
30e2ad626fSUlf Hansson 	},
31e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_VDEC] = {
32e2ad626fSUlf Hansson 		.name = "vdec",
33e2ad626fSUlf Hansson 		.sta_mask = PWR_STATUS_VDEC,
34e2ad626fSUlf Hansson 		.ctl_offs = SPM_VDE_PWR_CON,
35e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
36e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
37e2ad626fSUlf Hansson 		.sram_pdn_bits = GENMASK(8, 8),
38e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = GENMASK(12, 12),
39e2ad626fSUlf Hansson 		.caps = MTK_SCPD_ACTIVE_WAKEUP,
40e2ad626fSUlf Hansson 	},
41e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_ISP] = {
42e2ad626fSUlf Hansson 		.name = "isp",
43e2ad626fSUlf Hansson 		.sta_mask = PWR_STATUS_ISP,
44e2ad626fSUlf Hansson 		.ctl_offs = SPM_ISP_PWR_CON,
45e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
46e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
47e2ad626fSUlf Hansson 		.sram_pdn_bits = GENMASK(11, 8),
48e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = GENMASK(13, 12),
49e2ad626fSUlf Hansson 		.caps = MTK_SCPD_ACTIVE_WAKEUP,
50e2ad626fSUlf Hansson 	},
51e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_MFG_ASYNC] = {
52e2ad626fSUlf Hansson 		.name = "mfg_async",
53e2ad626fSUlf Hansson 		.sta_mask = MT8167_PWR_STATUS_MFG_ASYNC,
54e2ad626fSUlf Hansson 		.ctl_offs = SPM_MFG_ASYNC_PWR_CON,
55e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
56e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
57e2ad626fSUlf Hansson 		.sram_pdn_bits = 0,
58e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = 0,
59*151bd6c5SMarkus Schneider-Pargmann 		.bp_cfg = {
60*151bd6c5SMarkus Schneider-Pargmann 			BUS_PROT_INFRA_UPDATE_TOPAXI(MT8167_TOP_AXI_PROT_EN_MCU_MFG |
61e2ad626fSUlf Hansson 						     MT8167_TOP_AXI_PROT_EN_MFG_EMI),
62e2ad626fSUlf Hansson 		},
63e2ad626fSUlf Hansson 	},
64e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_MFG_2D] = {
65e2ad626fSUlf Hansson 		.name = "mfg_2d",
66e2ad626fSUlf Hansson 		.sta_mask = MT8167_PWR_STATUS_MFG_2D,
67e2ad626fSUlf Hansson 		.ctl_offs = SPM_MFG_2D_PWR_CON,
68e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
69e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
70e2ad626fSUlf Hansson 		.sram_pdn_bits = GENMASK(11, 8),
71e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = GENMASK(15, 12),
72e2ad626fSUlf Hansson 	},
73e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_MFG] = {
74e2ad626fSUlf Hansson 		.name = "mfg",
75e2ad626fSUlf Hansson 		.sta_mask = PWR_STATUS_MFG,
76e2ad626fSUlf Hansson 		.ctl_offs = SPM_MFG_PWR_CON,
77e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
78e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
79e2ad626fSUlf Hansson 		.sram_pdn_bits = GENMASK(11, 8),
80e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = GENMASK(15, 12),
81e2ad626fSUlf Hansson 	},
82e2ad626fSUlf Hansson 	[MT8167_POWER_DOMAIN_CONN] = {
83e2ad626fSUlf Hansson 		.name = "conn",
84e2ad626fSUlf Hansson 		.sta_mask = PWR_STATUS_CONN,
85e2ad626fSUlf Hansson 		.ctl_offs = SPM_CONN_PWR_CON,
86e2ad626fSUlf Hansson 		.pwr_sta_offs = SPM_PWR_STATUS,
87e2ad626fSUlf Hansson 		.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
88e2ad626fSUlf Hansson 		.sram_pdn_bits = GENMASK(8, 8),
89e2ad626fSUlf Hansson 		.sram_pdn_ack_bits = 0,
90e2ad626fSUlf Hansson 		.caps = MTK_SCPD_ACTIVE_WAKEUP,
91*151bd6c5SMarkus Schneider-Pargmann 		.bp_cfg = {
92*151bd6c5SMarkus Schneider-Pargmann 			BUS_PROT_INFRA_UPDATE_TOPAXI(MT8167_TOP_AXI_PROT_EN_CONN_EMI |
93e2ad626fSUlf Hansson 						     MT8167_TOP_AXI_PROT_EN_CONN_MCU |
94e2ad626fSUlf Hansson 						     MT8167_TOP_AXI_PROT_EN_MCU_CONN),
95e2ad626fSUlf Hansson 		},
96e2ad626fSUlf Hansson 	},
97e2ad626fSUlf Hansson };
98e2ad626fSUlf Hansson 
99e2ad626fSUlf Hansson static const struct scpsys_soc_data mt8167_scpsys_data = {
100e2ad626fSUlf Hansson 	.domains_data = scpsys_domain_data_mt8167,
101e2ad626fSUlf Hansson 	.num_domains = ARRAY_SIZE(scpsys_domain_data_mt8167),
102e2ad626fSUlf Hansson };
103e2ad626fSUlf Hansson 
104e2ad626fSUlf Hansson #endif /* __SOC_MEDIATEK_MT8167_PM_DOMAINS_H */
105e2ad626fSUlf Hansson 
106