summaryrefslogtreecommitdiff
path: root/plat/imx/common
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2019-11-22 14:34:18 +0800
committerAnson Huang <Anson.Huang@nxp.com>2019-12-13 10:45:48 +0800
commit823f912b333a4cc114286b65ca821e7f9b1dcbf7 (patch)
tree1224ecfc4342b8c6048830aed800742f48501958 /plat/imx/common
parent8443529e9ade148e2aee258a0d1cda6e8eaf1f85 (diff)
imx: add system_reset2 support for i.MX8QM/i.MX8QX
Add system_reset2 support for i.MX8QM/i.MX8QX to support WARM/COLD/BOARD reset. Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Diffstat (limited to 'plat/imx/common')
-rw-r--r--plat/imx/common/imx8_psci.c26
-rw-r--r--plat/imx/common/include/plat_imx8.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/plat/imx/common/imx8_psci.c b/plat/imx/common/imx8_psci.c
index 396a8854..97832b03 100644
--- a/plat/imx/common/imx8_psci.c
+++ b/plat/imx/common/imx8_psci.c
@@ -29,6 +29,32 @@ void __dead2 imx_system_reset(void)
panic();
}
+int imx_system_reset2(int is_vendor, int reset_type, u_register_t cookie)
+{
+ const char *reset_type_name = "";
+
+ switch(reset_type) {
+ case PSCI_RESET2_SYSTEM_WARM_RESET:
+ sc_pm_reboot(ipc_handle, SC_PM_RESET_TYPE_WARM);
+ reset_type_name = "warm";
+ break;
+ case PSCI_RESET2_SYSTEM_COLD_RESET:
+ sc_pm_reboot(ipc_handle, SC_PM_RESET_TYPE_COLD);
+ reset_type_name = "cold";
+ break;
+ case PSCI_RESET2_SYSTEM_BOARD_RESET:
+ sc_pm_reset(ipc_handle, SC_PM_RESET_TYPE_BOARD);
+ reset_type_name = "board";
+ break;
+ default:
+ return PSCI_E_INVALID_PARAMS;
+ }
+
+ wfi();
+ ERROR("system %s reset failed.\n", reset_type_name);
+ panic();
+}
+
int imx_validate_power_state(unsigned int power_state,
psci_power_state_t *req_state)
{
diff --git a/plat/imx/common/include/plat_imx8.h b/plat/imx/common/include/plat_imx8.h
index be99b970..08066a84 100644
--- a/plat/imx/common/include/plat_imx8.h
+++ b/plat/imx/common/include/plat_imx8.h
@@ -25,6 +25,7 @@ void plat_gic_pcpu_init(void);
void __dead2 imx_system_off(void);
void __dead2 imx_system_reset(void);
+int imx_system_reset2(int is_vendor, int reset_type, u_register_t cookie);
int imx_validate_power_state(unsigned int power_state,
psci_power_state_t *req_state);
void imx_get_sys_suspend_power_state(psci_power_state_t *req_state);