aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc/system.c')
-rw-r--r--arch/arm/plat-mxc/system.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c
index 79c37577c916..15e30532f4a5 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -30,29 +30,28 @@
30#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
31#include <asm/system.h> 31#include <asm/system.h>
32 32
33#ifdef CONFIG_ARCH_MX1 33static void __iomem *wdog_base;
34#define WDOG_WCR_REG IO_ADDRESS(WDT_BASE_ADDR)
35#define WDOG_WCR_ENABLE (1 << 0)
36#else
37#define WDOG_WCR_REG IO_ADDRESS(WDOG_BASE_ADDR)
38#define WDOG_WCR_ENABLE (1 << 2)
39#endif
40 34
41/* 35/*
42 * Reset the system. It is called by machine_restart(). 36 * Reset the system. It is called by machine_restart().
43 */ 37 */
44void arch_reset(char mode, const char *cmd) 38void arch_reset(char mode, const char *cmd)
45{ 39{
46 if (!cpu_is_mx1()) { 40 unsigned int wcr_enable;
41
42 if (cpu_is_mx1()) {
43 wcr_enable = (1 << 0);
44 } else {
47 struct clk *clk; 45 struct clk *clk;
48 46
49 clk = clk_get_sys("imx-wdt.0", NULL); 47 clk = clk_get_sys("imx-wdt.0", NULL);
50 if (!IS_ERR(clk)) 48 if (!IS_ERR(clk))
51 clk_enable(clk); 49 clk_enable(clk);
50 wcr_enable = (1 << 2);
52 } 51 }
53 52
54 /* Assert SRS signal */ 53 /* Assert SRS signal */
55 __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); 54 __raw_writew(wcr_enable, wdog_base);
56 55
57 /* wait for reset to assert... */ 56 /* wait for reset to assert... */
58 mdelay(500); 57 mdelay(500);
@@ -65,3 +64,8 @@ void arch_reset(char mode, const char *cmd)
65 /* we'll take a jump through zero as a poor second */ 64 /* we'll take a jump through zero as a poor second */
66 cpu_reset(0); 65 cpu_reset(0);
67} 66}
67
68void mxc_arch_reset_init(void __iomem *base)
69{
70 wdog_base = base;
71}