From 4b7d472fa3eedc032a1ca4757362d4daa8fe5f9a Mon Sep 17 00:00:00 2001 From: Jacky Bai Date: Tue, 27 Oct 2020 16:43:53 +0800 Subject: MLK-24923-02 plat: imx8m: Put dram into retention when dsp lpa buffer in ocram when the DSP LPA buffer is in OCRAM, dram can be put into retention to save power. This support is missed when removing the i.MX8MP A0 support, so add it back. Signed-off-by: Jacky Bai Reviewed-by: Anson Huang --- plat/imx/imx8m/imx8m_psci_common.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plat/imx/imx8m/imx8m_psci_common.c b/plat/imx/imx8m/imx8m_psci_common.c index 452958ce..ca0a5fc3 100644 --- a/plat/imx/imx8m/imx8m_psci_common.c +++ b/plat/imx/imx8m/imx8m_psci_common.c @@ -126,8 +126,13 @@ void imx_domain_suspend(const psci_power_state_t *target_state) dram_enter_retention(); imx_anamix_override(true); imx_noc_wrapper_pre_suspend(core_id); + } else { + /* flag 0xD means DSP LPA buffer is in OCRAM */ + if (mmio_read_32(IMX_SRC_BASE + LPA_STATUS) == 0xD) + dram_enter_retention(); } - imx_set_sys_wakeup(core_id, true); + + imx_set_sys_wakeup(core_id, true); } } @@ -142,8 +147,13 @@ void imx_domain_suspend_finish(const psci_power_state_t *target_state) imx_anamix_override(false); dram_exit_retention(); imx_set_sys_lpm(core_id, false); + } else { + /* flag 0xD means DSP LPA buffer is in OCRAM */ + if (mmio_read_32(IMX_SRC_BASE + LPA_STATUS) == 0xD) + dram_exit_retention(); } - imx_set_sys_wakeup(core_id, false); + + imx_set_sys_wakeup(core_id, false); } if (!is_local_state_run(CLUSTER_PWR_STATE(target_state))) { -- cgit v1.2.3