On 9/16/26 9:58 AM, Julien Stephan wrote:
> Add power domain support for MT8365.
>
> The domain tables and bus-protection sequences mirror the Linux
> mt8365-pm-domains.h data available at commit ffeebf7587f5
extra space.
> ("pmdomain: mediatek: Convert all SoCs to new style regmap retrieval")
>
...
> +static const struct mtk_scp_domain_data mt8365_scp_domain[] = {
> + [MT8365_POWER_DOMAIN_MM] = {
> + .sta_mask = PWR_STATUS_DISP,
> + .ctl_offs = 0x30c,
> + .pwr_sta_offs = MT8365_SPM_PWR_STATUS,
> + .pwr_sta2nd_offs = MT8365_SPM_PWR_STATUS_2ND,
> + .sram_pdn_bits = GENMASK(8, 8),
> + .sram_pdn_ack_bits = GENMASK(12, 12),
> + .bp_cfg = {
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI_1(
> +
> MT8365_INFRA_TOPAXI_PROTECTEN_1_MM2INFRA_AXI_GALS_MST_0 |
> +
> MT8365_INFRA_TOPAXI_PROTECTEN_1_MM2INFRA_AXI_GALS_MST_1),
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI(
> + MT8365_INFRA_TOPAXI_PROTECTEN_MM_M0 |
> + MT8365_INFRA_TOPAXI_PROTECTEN_MDMCU_M1 |
> +
> MT8365_INFRA_TOPAXI_PROTECTEN_MM2INFRA_AXI_GALS_SLV_0 |
> +
> MT8365_INFRA_TOPAXI_PROTECTEN_MM2INFRA_AXI_GALS_SLV_1),
> + BUS_PROT_WAY_EN(MT8365_INFRA_TOPAXI_SI0_WAY_EN_MMAPB_S,
> + MT8365_INFRA_TOPAXI_SI0_CTL,
> +
> MT8365_INFRA_NAO_TOPAXI_SI0_CTRL_UPDATED,
> + MT8365_INFRA_NAO_TOPAXI_SI0_STA),
> + BUS_PROT_WAY_EN(MT8365_INFRA_TOPAXI_SI2_WAY_EN_PERI_M1,
> + MT8365_INFRA_TOPAXI_SI2_CTL,
> +
> MT8365_INFRA_NAO_TOPAXI_SI2_CTRL_UPDATED,
> + MT8365_INFRA_NAO_TOPAXI_SI2_STA),
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI(
> + MT8365_INFRA_TOPAXI_PROTECTEN_MMAPB_S),
> + },
> + },
Do we need a new strict bus protection .caps flag on MT8365_POWER_DOMAIN_MM?
It would need an implementation like [1].
[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d2567a84520d10b8418cc3b53454e4b6aadaf728
> + [MT8365_POWER_DOMAIN_CONN] = {
> + .sta_mask = PWR_STATUS_CONN,
> + .ctl_offs = 0x032c,
> + .pwr_sta_offs = MT8365_SPM_PWR_STATUS,
> + .pwr_sta2nd_offs = MT8365_SPM_PWR_STATUS_2ND,
> + .sram_pdn_bits = 0,
> + .sram_pdn_ack_bits = 0,
> + .bp_cfg = {
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI(
> + MT8365_INFRA_TOPAXI_PROTECTEN_AP2CONN_AHB),
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI_1(
> +
> MT8365_INFRA_TOPAXI_PROTECTEN_1_CONN2INFRA_AXI_GALS_MST),
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI(
> + MT8365_INFRA_TOPAXI_PROTECTEN_CONN2INFRA_AHB),
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI_1(
> +
> MT8365_INFRA_TOPAXI_PROTECTEN_1_INFRA2CONN_AHB_GALS_SLV),
> + },
> + },
> + [MT8365_POWER_DOMAIN_MFG] = {
> + .sta_mask = PWR_STATUS_MFG,
> + .ctl_offs = 0x0338,
> + .pwr_sta_offs = MT8365_SPM_PWR_STATUS,
> + .pwr_sta2nd_offs = MT8365_SPM_PWR_STATUS_2ND,
> + .sram_pdn_bits = GENMASK(9, 8),
> + .sram_pdn_ack_bits = GENMASK(13, 12),
> + .bp_cfg = {
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI(BIT(25)),
I see this is copied from Linux, but would be nice to have a macro for
BIT(25) to be consistent with surrounding code.
> + MT8365_BUS_PROT_INFRA_WR_TOPAXI(
> + MT8365_INFRA_TOPAXI_PROTECTEN_MFG_M0 |
> + MT8365_INFRA_TOPAXI_PROTECTEN_INFRA2MFG),
> + },
> + },