From: Marek Vasut Date: Wed, 5 Aug 2020 15:31:29 +0200 Subject: [PATCH] ARM: imx: soc: Add reset for non-DM case Message-ID: <20200805133129.101266-1-marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This is another in series of patches which remove ad-hoc reset_cpu() hacks from board files. This one is for iMX7, so implement default reset_cpu() there to prevent it from showing up in board files. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP i.MX U-Boot Team Cc: Peng Fan Cc: Stefano Babic --- arch/arm/mach-imx/mx7/soc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index 9cb61f5c34..8db672fb05 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -419,3 +420,15 @@ void reset_misc(void) #endif } +#if !CONFIG_IS_ENABLED(SYSRESET) +void reset_cpu(ulong addr) +{ + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; + + /* Clear WDA to trigger WDOG_B immediately */ + writew(SET_WCR_WT(1) | WCR_WDT | WCR_WDE | WCR_SRS, &wdog->wcr); + + while (1) + ; +} +#endif -- 2.27.0