diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-04 06:19:02 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-07 06:10:51 -0400 |
commit | be124c94279edf4306798100f120c386947d8724 (patch) | |
tree | 98bc16285b121af329a4ce2c42e1690decf35e70 /arch/arm/plat-mxc/system.c | |
parent | 8db5d1a64d36d0750b88c6c13feeaf0e00be2eb4 (diff) |
system.c: runtime base address
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/system.c')
-rw-r--r-- | arch/arm/plat-mxc/system.c | 22 |
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 | 33 | static 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 | */ |
44 | void arch_reset(char mode, const char *cmd) | 38 | void 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 | |||
68 | void mxc_arch_reset_init(void __iomem *base) | ||
69 | { | ||
70 | wdog_base = base; | ||
71 | } | ||