The ADSP_TOP_DORMANT and EDP_TX_DORMANT domains both need SRAM isolation
and have an inverted SRAM power-down bit, which the core driver can now
describe. Set the caps on both so they can actually be powered up, and
drop the part of the comment that said this was not modelled.

Until now both domains carried the plain power-down values, which would
have powered their SRAM down rather than up and left the isolation
asserted. Nothing in the device tree referenced either domain, so that was
never reached.

Linux marks ADSP_TOP_DORMANT with MTK_SCPD_ACTIVE_WAKEUP and
MTK_SCPD_KEEP_DEFAULT_OFF as well. Leave both out, since U-Boot has no
runtime power management and does not power domains on at probe.

EDP_TX_DORMANT has no SRAM power-down ack bits, so state that explicitly
rather than leaving the field implicitly zero, matching Linux. This leaves
nothing to wait for, as both branches of the acknowledgment poll are
satisfied by the first read.

Signed-off-by: David Lechner <[email protected]>
---
 drivers/power/domain/mt8189-power-domain.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/power/domain/mt8189-power-domain.c 
b/drivers/power/domain/mt8189-power-domain.c
index 503919b7045..6ad2dd4874d 100644
--- a/drivers/power/domain/mt8189-power-domain.c
+++ b/drivers/power/domain/mt8189-power-domain.c
@@ -71,12 +71,11 @@
 #define MT8189_PROT_EN_PERISYS_STA_0_SSUSB     BIT(7)
 
 /*
- * Three things the Linux driver does for these domains are not modelled
- * here, because this driver only ever powers up the domains that the U-Boot
- * device tree references: the EMICFG GALS sleep protection step that MFG1
- * needs, the domain supply regulator that MFG0 and MFG1 need
- * (MTK_SCPD_DOMAIN_SUPPLY in Linux), and the SRAM isolation with an inverted
- * SRAM power-down bit that ADSP_TOP_DORMANT and EDP_TX_DORMANT need.
+ * Two things the Linux driver does for these domains are not modelled here,
+ * because this driver only ever powers up the domains that the U-Boot device
+ * tree references: the EMICFG GALS sleep protection step that MFG1 needs, and
+ * the domain supply regulator that MFG0 and MFG1 need (MTK_SCPD_DOMAIN_SUPPLY
+ * in Linux).
  */
 
 static const struct mtk_scp_domain_data mt8189_scp_domain[] = {
@@ -125,6 +124,7 @@ static const struct mtk_scp_domain_data mt8189_scp_domain[] 
= {
                .pwr_sta2nd_offs = MT8189_SPM_PWR_STATUS_2ND,
                .sram_pdn_bits = BIT(9),
                .sram_pdn_ack_bits = BIT(13),
+               .caps = MTK_SCPD_SRAM_ISO | MTK_SCPD_SRAM_PDN_INVERTED,
        },
        [MT8189_POWER_DOMAIN_ADSP_INFRA] = {
                .sta_mask = BIT(8),
@@ -384,6 +384,8 @@ static const struct mtk_scp_domain_data mt8189_scp_domain[] 
= {
                .pwr_sta_offs = MT8189_SPM_PWR_STATUS_MSB,
                .pwr_sta2nd_offs = MT8189_SPM_PWR_STATUS_MSB_2ND,
                .sram_pdn_bits = BIT(9),
+               .sram_pdn_ack_bits = 0,
+               .caps = MTK_SCPD_SRAM_ISO | MTK_SCPD_SRAM_PDN_INVERTED,
        },
        [MT8189_POWER_DOMAIN_PCIE] = {
                .sta_mask = BIT(13),

-- 
2.43.0

Reply via email to