aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-s3c2410/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-s3c2410/system.h')
-rw-r--r--include/asm-arm/arch-s3c2410/system.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 63891786dfa0..14de4e596f87 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -20,6 +20,9 @@
20#include <asm/plat-s3c/regs-watchdog.h> 20#include <asm/plat-s3c/regs-watchdog.h>
21#include <asm/arch/regs-clock.h> 21#include <asm/arch/regs-clock.h>
22 22
23#include <linux/clk.h>
24#include <linux/err.h>
25
23void (*s3c24xx_idle)(void); 26void (*s3c24xx_idle)(void);
24void (*s3c24xx_reset_hook)(void); 27void (*s3c24xx_reset_hook)(void);
25 28
@@ -59,6 +62,8 @@ static void arch_idle(void)
59static void 62static void
60arch_reset(char mode) 63arch_reset(char mode)
61{ 64{
65 struct clk *wdtclk;
66
62 if (mode == 's') { 67 if (mode == 's') {
63 cpu_reset(0); 68 cpu_reset(0);
64 } 69 }
@@ -70,19 +75,28 @@ arch_reset(char mode)
70 75
71 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ 76 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
72 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
73 /* put initial values into count and data */ 84 /* put initial values into count and data */
74 __raw_writel(0x100, S3C2410_WTCNT); 85 __raw_writel(0x80, S3C2410_WTCNT);
75 __raw_writel(0x100, S3C2410_WTDAT); 86 __raw_writel(0x80, S3C2410_WTDAT);
76 87
77 /* set the watchdog to go and reset... */ 88 /* set the watchdog to go and reset... */
78 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | 89 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
79 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); 90 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
80 91
81 /* wait for reset to assert... */ 92 /* wait for reset to assert... */
82 mdelay(5000); 93 mdelay(500);
83 94
84 printk(KERN_ERR "Watchdog reset failed to assert reset\n"); 95 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
85 96
97 /* delay to allow the serial port to show the message */
98 mdelay(50);
99
86 /* we'll take a jump through zero as a poor second */ 100 /* we'll take a jump through zero as a poor second */
87 cpu_reset(0); 101 cpu_reset(0);
88} 102}