Commit a48e71da9d2b5e122ace8e698e3f3903d0da78be

Authored by Ye Li
1 parent 8c7de513ed
Exists in emb_lf_v2022.04

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)
(cherry picked from commit 2d7a9cf5873ba2e4523deb80ed62dd184e1fe3bc)
(cherry picked from commit 6e601c056e4fbbe6eee1eebd2296a66288fd3382)

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

arch/arm/mach-imx/mx7/soc.c
... ... @@ -23,6 +23,7 @@
23 23 #include <imx_thermal.h>
24 24 #include <asm/setup.h>
25 25 #include <linux/delay.h>
  26 +#include <fsl_wdog.h>
26 27  
27 28 #define IOMUXC_GPR1 0x4
28 29 #define BM_IOMUXC_GPR1_IRQ 0x1000
... ... @@ -451,5 +452,19 @@
451 452 lcdif_power_down();
452 453 #endif
453 454 #endif
  455 +}
  456 +
  457 +void reset_cpu(ulong addr)
  458 +{
  459 + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
  460 +
  461 + /* Clear WDA to trigger WDOG_B immediately */
  462 + writew((WCR_WDE | WCR_SRS), &wdog->wcr);
  463 +
  464 + while (1) {
  465 + /*
  466 + * spin for .5 seconds before reset
  467 + */
  468 + }
454 469 }