summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2017-07-05 18:29:30 +0800
committerAnson Huang <Anson.Huang@nxp.com>2017-07-12 23:33:09 +0800
commit542e7d15f95a6084e23316214d333b67c484248a (patch)
tree6547a7664e3f5a1cf1127d0116368096b372403f
parent865f6d5a5e800cf7eabcf581673e34e20a256861 (diff)
plat: freescale: imx8mq: add system off support
Add system off support, linux kernel can issue "poweroff" to power down system. Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
-rw-r--r--plat/freescale/imx8mq/imx8m_psci.c13
-rw-r--r--plat/freescale/imx8mq/include/platform_def.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/plat/freescale/imx8mq/imx8m_psci.c b/plat/freescale/imx8mq/imx8m_psci.c
index 117188b7..132468e1 100644
--- a/plat/freescale/imx8mq/imx8m_psci.c
+++ b/plat/freescale/imx8mq/imx8m_psci.c
@@ -44,6 +44,8 @@
#define GPC_CPU_PGC_SW_PUP_REQ 0xf0
#define GPC_CPU_PGC_SW_PDN_REQ 0xfc
+#define SNVS_LPCR 0x38
+
extern void imx_gpc_set_core_pdn_pup_by_software(unsigned int cpu, bool pdn);
extern void imx_gpc_set_cpu_power_gate_by_wfi(unsigned int cpu, bool pdn);
@@ -211,6 +213,16 @@ void __attribute__((noreturn)) imx_system_reset(void)
;
}
+void __attribute__((noreturn)) imx_system_off(void)
+{
+ mmio_write_32(IMX_SNVS_BASE + SNVS_LPCR, 0x61);
+
+ tf_printf("Unable to poweroff system\n");
+
+ while (1)
+ ;
+}
+
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,
@@ -222,6 +234,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/imx8mq/include/platform_def.h b/plat/freescale/imx8mq/include/platform_def.h
index 058cd4ef..32d5839d 100644
--- a/plat/freescale/imx8mq/include/platform_def.h
+++ b/plat/freescale/imx8mq/include/platform_def.h
@@ -46,6 +46,7 @@
#define IMX_SRC_BASE 0x30390000
#define IMX_GPC_BASE 0x303a0000
#define IMX_WDOG_BASE 0x30280000
+#define IMX_SNVS_BASE 0x30370000
#define COUNTER_FREQUENCY 8000000 /* 8MHz */