Commit cde504077e1ce94d9ad34ece0f3e882972404297

Authored by Ye Li
1 parent af92ba299b

MLK-14422 imx7d: wdog: Overwrite the reset_cpu to turn off internal reset signal

Set wdog WCR register SRS bit to turn off internal reset signal WDOG_RESET_B_DEB
for mx7d. So that the warm reset is disabled.
The WDA is cleared to output WDOG_B immediately to reset the board.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 6d09863801695d975060fbc240147a9067dbafbf)

Showing 1 changed file with 14 additions and 0 deletions Side-by-side Diff

arch/arm/mach-imx/mx7/soc.c
... ... @@ -19,6 +19,7 @@
19 19 #include <dm.h>
20 20 #include <imx_thermal.h>
21 21 #include <fsl_sec.h>
  22 +#include <fsl_wdog.h>
22 23  
23 24 #if defined(CONFIG_IMX_THERMAL)
24 25 static const struct imx_thermal_plat imx7_thermal_plat = {
... ... @@ -300,5 +301,19 @@
300 301 #ifdef CONFIG_VIDEO_MXS
301 302 lcdif_power_down();
302 303 #endif
  304 +}
  305 +
  306 +void reset_cpu(ulong addr)
  307 +{
  308 + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
  309 +
  310 + /* Clear WDA to trigger WDOG_B immediately */
  311 + writew((WCR_WDE | WCR_SRS), &wdog->wcr);
  312 +
  313 + while (1) {
  314 + /*
  315 + * spin for .5 seconds before reset
  316 + */
  317 + }
303 318 }