imx: imx8qx: add system reset support
authorAnson Huang <Anson.Huang@nxp.com>
Thu, 12 Jul 2018 03:04:15 +0000 (11:04 +0800)
committerAnson Huang <Anson.Huang@nxp.com>
Thu, 12 Jul 2018 03:05:21 +0000 (11:05 +0800)
Add system reset support for i.MX8QX,
when Linux kernel issues "reboot" command,
TF-A will send command to inform system
controller to reset whole board according
to board design, tested on i.MX8QX MEK board.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
plat/imx/common/imx8_psci.c
plat/imx/common/include/plat_imx8.h
plat/imx/imx8qx/imx8qx_psci.c

index 0b0dcb577842e5d41cd9b4c9ee4c3d3d0a680ae2..37eda3e6ac5e197198a0915ab7e858328fa175bc 100644 (file)
@@ -19,4 +19,11 @@ void __dead2 imx_system_off(void)
        panic();
 }
 
+void __dead2 imx_system_reset(void)
+{
+       sc_pm_reset(ipc_handle, SC_PM_RESET_TYPE_BOARD);
+       wfi();
+       ERROR("system reset failed.\n");
+       panic();
+}
 
index 640d60e76a55c14560c5df4023ce7e4d2ce60181..3b5f4ec6b2de1495fb9f64172fbdf54d76fd245a 100644 (file)
@@ -18,4 +18,5 @@ void plat_gic_cpuif_disable(void);
 void plat_gic_pcpu_init(void);
 
 void __dead2 imx_system_off(void);
+void __dead2 imx_system_reset(void);
 #endif /*__PLAT_IMX8_H__ */
index 1e8f7fa491d7f8599d630589854e8be2348bee7b..80f747b19a326c977dd55fbe6978120402dce551 100644 (file)
@@ -65,6 +65,7 @@ static const plat_psci_ops_t imx_plat_psci_ops = {
        .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,
 };
 
 int plat_setup_psci_ops(uintptr_t sec_entrypoint,