Commit 2d7a9cf5873ba2e4523deb80ed62dd184e1fe3bc

Authored by Ye Li
1 parent 30ba253de4

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

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

arch/arm/mach-imx/mx7/soc.c
... ... @@ -18,6 +18,7 @@
18 18 #include <imx_thermal.h>
19 19 #include <fsl_sec.h>
20 20 #include <asm/setup.h>
  21 +#include <fsl_wdog.h>
21 22  
22 23 #define IOMUXC_GPR1 0x4
23 24 #define BM_IOMUXC_GPR1_IRQ 0x1000
... ... @@ -415,5 +416,19 @@
415 416 lcdif_power_down();
416 417 #endif
417 418 #endif
  419 +}
  420 +
  421 +void reset_cpu(ulong addr)
  422 +{
  423 + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
  424 +
  425 + /* Clear WDA to trigger WDOG_B immediately */
  426 + writew((WCR_WDE | WCR_SRS), &wdog->wcr);
  427 +
  428 + while (1) {
  429 + /*
  430 + * spin for .5 seconds before reset
  431 + */
  432 + }
418 433 }