Commit b0d49a10b23f0b9a7d8cc9299e6eac6b39ce1434

Authored by Ye Li
1 parent b0eae27fce

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)
(cherry picked from commit cde504077e1ce94d9ad34ece0f3e882972404297)

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

arch/arm/mach-imx/mx7/soc.c
... ... @@ -17,6 +17,7 @@
17 17 #include <imx_thermal.h>
18 18 #include <fsl_sec.h>
19 19 #include <asm/setup.h>
  20 +#include <fsl_wdog.h>
20 21  
21 22 #define IOMUXC_GPR1 0x4
22 23 #define BM_IOMUXC_GPR1_IRQ 0x1000
... ... @@ -373,5 +374,19 @@
373 374 lcdif_power_down();
374 375 #endif
375 376 #endif
  377 +}
  378 +
  379 +void reset_cpu(ulong addr)
  380 +{
  381 + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
  382 +
  383 + /* Clear WDA to trigger WDOG_B immediately */
  384 + writew((WCR_WDE | WCR_SRS), &wdog->wcr);
  385 +
  386 + while (1) {
  387 + /*
  388 + * spin for .5 seconds before reset
  389 + */
  390 + }
376 391 }