Commit b35c238fa9b5cdba543de073c2837a276c0ad491
1 parent
b43ed4dac3
Exists in
emb_lf_v2023.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 |
... | ... | @@ -456,5 +457,19 @@ |
456 | 457 | lcdif_power_down(); |
457 | 458 | #endif |
458 | 459 | #endif |
460 | +} | |
461 | + | |
462 | +void reset_cpu(ulong addr) | |
463 | +{ | |
464 | + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; | |
465 | + | |
466 | + /* Clear WDA to trigger WDOG_B immediately */ | |
467 | + writew((WCR_WDE | WCR_SRS), &wdog->wcr); | |
468 | + | |
469 | + while (1) { | |
470 | + /* | |
471 | + * spin for .5 seconds before reset | |
472 | + */ | |
473 | + } | |
459 | 474 | } |