Skip to contentSkip to conversation

ARM: imx: soc: Add reset for non-DM case

PATCH New Marek Vasut 1 participant 1 message Aug 5, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: soc: Add reset for non-DM case

This is another in series of patches which remove ad-hoc reset_cpu() hacks from board files. This one is for iMX7, so implement default reset_cpu() there to prevent it from showing up in board files.

Cc Fabio Estevam <[email protected]>
Cc NXP i.MX U-Boot Team <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/mach-imx/mx7/soc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/mach-imx/mx7/soc.c +13 -0
index 9cb61f5c34..8db672fb05 100644
@@ -18,6 +18,7 @@
 #include <env.h>
 #include <imx_thermal.h>
 #include <fsl_sec.h>
+#include <fsl_wdog.h>
 #include <asm/setup.h>
 #include <linux/delay.h>
 
@@ -419,3 +420,15 @@ void reset_misc(void)
 #endif
 }
 
+#if !CONFIG_IS_ENABLED(SYSRESET)
+void reset_cpu(ulong addr)
+{
+	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+	/* Clear WDA to trigger WDOG_B immediately */
+	writew(SET_WCR_WT(1) | WCR_WDT | WCR_WDE | WCR_SRS, &wdog->wcr);
+
+	while (1)
+		;
+}
+#endif
Signature · 1 line
2.27.0