Commit 5a6e1502 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Shawn Guo

ARM: i.MX system: Add a reset fallback if base address of watchdog is not set

This patch adds a reset fallback if base address of watchdog is not set.
This is intended for a targets not compatible with imx-21 watchdog,
i.MX1 for example.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarShawn Guo <shawn.guo@freescale.com>
parent ce8ad883
...@@ -42,6 +42,9 @@ void mxc_restart(enum reboot_mode mode, const char *cmd) ...@@ -42,6 +42,9 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
{ {
unsigned int wcr_enable; unsigned int wcr_enable;
if (!wdog_base)
goto reset_fallback;
if (!IS_ERR(wdog_clk)) if (!IS_ERR(wdog_clk))
clk_enable(wdog_clk); clk_enable(wdog_clk);
...@@ -70,6 +73,7 @@ void mxc_restart(enum reboot_mode mode, const char *cmd) ...@@ -70,6 +73,7 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
/* delay to allow the serial port to show the message */ /* delay to allow the serial port to show the message */
mdelay(50); mdelay(50);
reset_fallback:
/* we'll take a jump through zero as a poor second */ /* we'll take a jump through zero as a poor second */
soft_restart(0); soft_restart(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment