diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-04-15 19:15:20 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-17 12:04:41 -0400 |
commit | 3c7d9c81e1302c244180e62999a08ca95b175cf5 (patch) | |
tree | a67961f6c0435e0a1965df9770433c73cdfe1664 /include/asm-arm/arch-s3c2410/system.h | |
parent | d96a980441a70168a8ead0a0f23c4c63725da5fa (diff) |
[ARM] 4987/1: S3C24XX: Ensure watchdog reset initiated from cached code.
There seems to be some problem with at-least the S3C2440 and
bus traffic during an reset. It is unlikely, but still possible
that the system will hang in such a way that the watchdog cannot
get the system out of the state it is in.
Change to making the code that calls the watchdog reset run from
cached memory so that instruction fetches have quiesced before the
watchdog fires.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-s3c2410/system.h')
-rw-r--r-- | include/asm-arm/arch-s3c2410/system.h | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h index 14de4e596f87..ad258085e53b 100644 --- a/include/asm-arm/arch-s3c2410/system.h +++ b/include/asm-arm/arch-s3c2410/system.h | |||
@@ -17,12 +17,8 @@ | |||
17 | #include <asm/arch/idle.h> | 17 | #include <asm/arch/idle.h> |
18 | #include <asm/arch/reset.h> | 18 | #include <asm/arch/reset.h> |
19 | 19 | ||
20 | #include <asm/plat-s3c/regs-watchdog.h> | ||
21 | #include <asm/arch/regs-clock.h> | 20 | #include <asm/arch/regs-clock.h> |
22 | 21 | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/err.h> | ||
25 | |||
26 | void (*s3c24xx_idle)(void); | 22 | void (*s3c24xx_idle)(void); |
27 | void (*s3c24xx_reset_hook)(void); | 23 | void (*s3c24xx_reset_hook)(void); |
28 | 24 | ||
@@ -59,44 +55,4 @@ static void arch_idle(void) | |||
59 | s3c24xx_default_idle(); | 55 | s3c24xx_default_idle(); |
60 | } | 56 | } |
61 | 57 | ||
62 | static void | 58 | #include <asm/arch/system-reset.h> |
63 | arch_reset(char mode) | ||
64 | { | ||
65 | struct clk *wdtclk; | ||
66 | |||
67 | if (mode == 's') { | ||
68 | cpu_reset(0); | ||
69 | } | ||
70 | |||
71 | if (s3c24xx_reset_hook) | ||
72 | s3c24xx_reset_hook(); | ||
73 | |||
74 | printk("arch_reset: attempting watchdog reset\n"); | ||
75 | |||
76 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ | ||
77 | |||
78 | wdtclk = clk_get(NULL, "watchdog"); | ||
79 | if (!IS_ERR(wdtclk)) { | ||
80 | clk_enable(wdtclk); | ||
81 | } else | ||
82 | printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); | ||
83 | |||
84 | /* put initial values into count and data */ | ||
85 | __raw_writel(0x80, S3C2410_WTCNT); | ||
86 | __raw_writel(0x80, S3C2410_WTDAT); | ||
87 | |||
88 | /* set the watchdog to go and reset... */ | ||
89 | __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | | ||
90 | S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); | ||
91 | |||
92 | /* wait for reset to assert... */ | ||
93 | mdelay(500); | ||
94 | |||
95 | printk(KERN_ERR "Watchdog reset failed to assert reset\n"); | ||
96 | |||
97 | /* delay to allow the serial port to show the message */ | ||
98 | mdelay(50); | ||
99 | |||
100 | /* we'll take a jump through zero as a poor second */ | ||
101 | cpu_reset(0); | ||
102 | } | ||