diff options
author | Ye Li <ye.li@nxp.com> | 2017-11-20 00:54:45 -0600 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-11-20 01:00:41 -0600 |
commit | fa65b0a9056baca4629f27cc056e8b202aa2da30 (patch) | |
tree | 7f2e8557524c7924b6ec5a6e78416712a8b66199 | |
parent | aa6bafbb6badda51e5ccca8f7b741b63381717be (diff) |
MLK-16903 imx8m: Add reset_cpu to use external WDOG_B for reset
The WDT is enabled for WDOG in current u-boot reset, this cause external WDOG_B
and internal WDOG_RESET_B_DEB both asserted for timeout. To avoid any unpredictable
behavior, change to use the WDOG_B only.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | arch/arm/cpu/armv8/imx8m/soc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/imx8m/soc.c b/arch/arm/cpu/armv8/imx8m/soc.c index 8602c4a596..fdf7355ebd 100644 --- a/arch/arm/cpu/armv8/imx8m/soc.c +++ b/arch/arm/cpu/armv8/imx8m/soc.c @@ -14,6 +14,7 @@ #include <asm/armv8/mmu.h> #include <errno.h> #include <fdt_support.h> +#include <fsl_wdog.h> DECLARE_GLOBAL_DATA_PTR; @@ -507,3 +508,17 @@ add_status: return ft_add_optee_node(blob, bd); } #endif + +void reset_cpu(ulong addr) +{ + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; + + /* Clear WDA to trigger WDOG_B immediately */ + writew((WCR_WDE | WCR_SRS), &wdog->wcr); + + while (1) { + /* + * spin for .5 seconds before reset + */ + } +} |