diff options
author | Peng Fan <peng.fan@nxp.com> | 2017-06-27 13:41:47 +0800 |
---|---|---|
committer | Anson Huang <Anson.Huang@nxp.com> | 2017-07-12 23:33:09 +0800 |
commit | 865f6d5a5e800cf7eabcf581673e34e20a256861 (patch) | |
tree | 91be20aa9c48f4d26d339e2146a90a09e5121b5a /plat/freescale/imx8mq/imx8m_psci.c | |
parent | d2afe314fea30626de3f11b56efa11290d7a85e0 (diff) |
imx8mq: add wdog reset
Add wdog reset support.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'plat/freescale/imx8mq/imx8m_psci.c')
-rw-r--r-- | plat/freescale/imx8mq/imx8m_psci.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plat/freescale/imx8mq/imx8m_psci.c b/plat/freescale/imx8mq/imx8m_psci.c index f53c81eb..117188b7 100644 --- a/plat/freescale/imx8mq/imx8m_psci.c +++ b/plat/freescale/imx8mq/imx8m_psci.c @@ -191,6 +191,26 @@ void imx_get_sys_suspend_power_state(psci_power_state_t *req_state) req_state->pwr_domain_state[i] = PLAT_MAX_RET_STATE; } +void __attribute__((noreturn)) imx_system_reset(void) +{ + uintptr_t wdog_base = IMX_WDOG_BASE; + unsigned int val; + + /* WDOG_B reset */ + val = mmio_read_16(wdog_base); +#ifdef IMX_WDOG_B_RESET + val = (val & 0x00FF) | (7 << 2) | (1 << 0); +#else + val = (val & 0x00FF) | (4 << 2) | (1 << 0); +#endif + mmio_write_16(wdog_base, val); + + mmio_write_16(wdog_base + 0x2, 0x5555); + mmio_write_16(wdog_base + 0x2, 0xaaaa); + 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, @@ -201,6 +221,7 @@ static const plat_psci_ops_t imx_plat_psci_ops = { .pwr_domain_suspend = imx_domain_suspend, .pwr_domain_suspend_finish = imx_domain_suspend_finish, .get_sys_suspend_power_state = imx_get_sys_suspend_power_state, + .system_reset = imx_system_reset, }; /* export the platform specific psci ops */ |