summaryrefslogtreecommitdiff
path: root/plat/imx/imx8qx/imx8qx_psci.c
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2018-07-12 11:07:10 +0800
committerAnson Huang <Anson.Huang@nxp.com>2018-07-12 11:12:39 +0800
commit3260f5c7c864e1f93157a5ff1bbe8f93cc9bbed0 (patch)
tree55eea6d9d39b5248b2939b461bd23917d79ee14a /plat/imx/imx8qx/imx8qx_psci.c
parent351e3731cacf9c36f94a80e0bee6af021bed7faf (diff)
imx: imx8qx: add domain off support
Add domain off support for Linux kernel's cpu hot-plug feature, when there are cpu off request from Linux kernel, TF-A will send command to system controller to do CPU power gate accordingly. Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Diffstat (limited to 'plat/imx/imx8qx/imx8qx_psci.c')
-rw-r--r--plat/imx/imx8qx/imx8qx_psci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plat/imx/imx8qx/imx8qx_psci.c b/plat/imx/imx8qx/imx8qx_psci.c
index 80f747b1..7a6e822b 100644
--- a/plat/imx/imx8qx/imx8qx_psci.c
+++ b/plat/imx/imx8qx/imx8qx_psci.c
@@ -60,12 +60,24 @@ int imx_validate_ns_entrypoint(uintptr_t ns_entrypoint)
return PSCI_E_SUCCESS;
}
+void imx_pwr_domain_off(const psci_power_state_t *target_state)
+{
+ u_register_t mpidr = read_mpidr_el1();
+ unsigned int cpu_id = MPIDR_AFFLVL0_VAL(mpidr);
+
+ plat_gic_cpuif_disable();
+ sc_pm_req_cpu_low_power_mode(ipc_handle, ap_core_index[cpu_id],
+ SC_PM_PW_MODE_OFF, SC_PM_WAKE_SRC_NONE);
+ tf_printf("turn off core:%d\n", cpu_id);
+}
+
static const plat_psci_ops_t imx_plat_psci_ops = {
.pwr_domain_on = imx_pwr_domain_on,
.pwr_domain_on_finish = imx_pwr_domain_on_finish,
.validate_ns_entrypoint = imx_validate_ns_entrypoint,
.system_off = imx_system_off,
.system_reset = imx_system_reset,
+ .pwr_domain_off = imx_pwr_domain_off,
};
int plat_setup_psci_ops(uintptr_t sec_entrypoint,