imx8m: restrict reset_cpu

Make reset_cpu only visible when CONFIG_SYSRESET not defined
or CONFIG_SPL_BUILD.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan 2019-08-27 06:25:41 +00:00 committed by Stefano Babic
parent 0528ba0e1c
commit d2041725e8

View file

@ -301,9 +301,13 @@ int ft_system_setup(void *blob, bd_t *bd)
} }
#endif #endif
#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYSRESET)
void reset_cpu(ulong addr) void reset_cpu(ulong addr)
{ {
struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; struct watchdog_regs *wdog = (struct watchdog_regs *)addr;
if (!addr)
wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
/* Clear WDA to trigger WDOG_B immediately */ /* Clear WDA to trigger WDOG_B immediately */
writew((WCR_WDE | WCR_SRS), &wdog->wcr); writew((WCR_WDE | WCR_SRS), &wdog->wcr);
@ -314,3 +318,4 @@ void reset_cpu(ulong addr)
*/ */
} }
} }
#endif