summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2017-09-06 20:54:24 +0800
committerAnson Huang <Anson.Huang@nxp.com>2017-09-06 20:56:29 +0800
commitef3f0fc559c355038872549ee2deac32418e42a4 (patch)
tree532ed304d7b245b28f0238d45e6b737938ca49e1
parentd52b12729a6c7c54cdd213203742b0e5dea0ae27 (diff)
i.mx8qm/i.mx8qxp: psci: add power off support
Add system_off pcsi callback to avoid below kernel message when doing power off: [11613.953711] reboot: Power down [11613.958318] systemd-shutdow: 8 output lines suppressed due to ratelimiting [11613.965285] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00 [11613.965285] [11613.974441] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 4.9.11-03354-g0e1 [11613.982369] Hardware name: Freescale i.MX8QXP LPDDR4 ARM2 (DT) [11613.988216] Call trace: [11613.990681] [<ffff0000080882bc>] dump_backtrace+0x0/0x1a8 [11613.996092] [<ffff000008088478>] show_stack+0x14/0x1c [11614.001154] [<ffff0000083aaf98>] dump_stack+0x8c/0xac [11614.006213] [<ffff000008162aac>] panic+0x124/0x28c [11614.011016] [<ffff0000080c0b20>] complete_and_exit+0x0/0x20 [11614.016600] [<ffff0000080dc6d8>] SyS_reboot+0x168/0x244 [11614.021829] [<ffff000008082ef0>] el0_svc_naked+0x24/0x28 [11614.027153] Kernel Offset: disabled [11614.030646] Memory Limit: none [11614.040755] ---[ end Kernel panic - not syncing: Attempted to kill init! exi0 [11614.040755] As there is no system power off SCFW API available now, so just simply do wfi and never return when system_off is called. Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
-rw-r--r--plat/freescale/imx8qm/imx8qm_psci.c11
-rw-r--r--plat/freescale/imx8qxp/imx8qxp_psci.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/plat/freescale/imx8qm/imx8qm_psci.c b/plat/freescale/imx8qm/imx8qm_psci.c
index 7cc80c88..ebc7d08c 100644
--- a/plat/freescale/imx8qm/imx8qm_psci.c
+++ b/plat/freescale/imx8qm/imx8qm_psci.c
@@ -224,6 +224,16 @@ void __attribute__((noreturn)) imx_system_reset(void)
;
}
+void __attribute__((noreturn)) imx_system_off(void)
+{
+ /*
+ * Never return, no SCFW API is available for
+ * system poweroff, here just do wfi for now
+ */
+ while (1)
+ wfi();
+}
+
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,
@@ -235,6 +245,7 @@ static const plat_psci_ops_t imx_plat_psci_ops = {
.pwr_domain_suspend_finish = imx_domain_suspend_finish,
.get_sys_suspend_power_state = imx_get_sys_suspend_power_state,
.system_reset = imx_system_reset,
+ .system_off = imx_system_off,
};
/* export the platform specific psci ops */
diff --git a/plat/freescale/imx8qxp/imx8qxp_psci.c b/plat/freescale/imx8qxp/imx8qxp_psci.c
index 6f2883f4..f235d5ec 100644
--- a/plat/freescale/imx8qxp/imx8qxp_psci.c
+++ b/plat/freescale/imx8qxp/imx8qxp_psci.c
@@ -201,6 +201,16 @@ void __attribute__((noreturn)) imx_system_reset(void)
;
}
+void __attribute__((noreturn)) imx_system_off(void)
+{
+ /*
+ * Never return, no SCFW API is available for
+ * system poweroff, here just do wfi for now
+ */
+ while (1)
+ wfi();
+}
+
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,
@@ -212,6 +222,7 @@ static const plat_psci_ops_t imx_plat_psci_ops = {
.pwr_domain_suspend_finish = imx_domain_suspend_finish,
.get_sys_suspend_power_state = imx_get_sys_suspend_power_state,
.system_reset = imx_system_reset,
+ .system_off = imx_system_off,
};
/* export the platform specific psci ops */