aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/system.c')
-rw-r--r--arch/arm/mach-imx/system.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index 3b0733edb68c..d14c33fd6b03 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -42,7 +42,10 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
42{ 42{
43 unsigned int wcr_enable; 43 unsigned int wcr_enable;
44 44
45 if (wdog_clk) 45 if (!wdog_base)
46 goto reset_fallback;
47
48 if (!IS_ERR(wdog_clk))
46 clk_enable(wdog_clk); 49 clk_enable(wdog_clk);
47 50
48 if (cpu_is_mx1()) 51 if (cpu_is_mx1())
@@ -70,6 +73,7 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
70 /* delay to allow the serial port to show the message */ 73 /* delay to allow the serial port to show the message */
71 mdelay(50); 74 mdelay(50);
72 75
76reset_fallback:
73 /* we'll take a jump through zero as a poor second */ 77 /* we'll take a jump through zero as a poor second */
74 soft_restart(0); 78 soft_restart(0);
75} 79}
@@ -79,13 +83,10 @@ void __init mxc_arch_reset_init(void __iomem *base)
79 wdog_base = base; 83 wdog_base = base;
80 84
81 wdog_clk = clk_get_sys("imx2-wdt.0", NULL); 85 wdog_clk = clk_get_sys("imx2-wdt.0", NULL);
82 if (IS_ERR(wdog_clk)) { 86 if (IS_ERR(wdog_clk))
83 pr_warn("%s: failed to get wdog clock\n", __func__); 87 pr_warn("%s: failed to get wdog clock\n", __func__);
84 wdog_clk = NULL; 88 else
85 return; 89 clk_prepare(wdog_clk);
86 }
87
88 clk_prepare(wdog_clk);
89} 90}
90 91
91void __init mxc_arch_reset_init_dt(void) 92void __init mxc_arch_reset_init_dt(void)
@@ -97,13 +98,10 @@ void __init mxc_arch_reset_init_dt(void)
97 WARN_ON(!wdog_base); 98 WARN_ON(!wdog_base);
98 99
99 wdog_clk = of_clk_get(np, 0); 100 wdog_clk = of_clk_get(np, 0);
100 if (IS_ERR(wdog_clk)) { 101 if (IS_ERR(wdog_clk))
101 pr_warn("%s: failed to get wdog clock\n", __func__); 102 pr_warn("%s: failed to get wdog clock\n", __func__);
102 wdog_clk = NULL; 103 else
103 return; 104 clk_prepare(wdog_clk);
104 }
105
106 clk_prepare(wdog_clk);
107} 105}
108 106
109#ifdef CONFIG_CACHE_L2X0 107#ifdef CONFIG_CACHE_L2X0