]> err.no Git - linux-2.6/blobdiff - include/asm-arm/arch-s3c2410/system.h
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[linux-2.6] / include / asm-arm / arch-s3c2410 / system.h
index 1c74ef17da3363eda55e8dcf8fee51c84d502148..14de4e596f87b170661faad4cabe21deeb7019aa 100644 (file)
 #include <asm/arch/idle.h>
 #include <asm/arch/reset.h>
 
-#include <asm/arch/regs-watchdog.h>
+#include <asm/plat-s3c/regs-watchdog.h>
 #include <asm/arch/regs-clock.h>
 
+#include <linux/clk.h>
+#include <linux/err.h>
+
 void (*s3c24xx_idle)(void);
 void (*s3c24xx_reset_hook)(void);
 
@@ -59,6 +62,8 @@ static void arch_idle(void)
 static void
 arch_reset(char mode)
 {
+       struct clk *wdtclk;
+
        if (mode == 's') {
                cpu_reset(0);
        }
@@ -70,19 +75,28 @@ arch_reset(char mode)
 
        __raw_writel(0, S3C2410_WTCON);   /* disable watchdog, to be safe  */
 
+       wdtclk = clk_get(NULL, "watchdog");
+       if (!IS_ERR(wdtclk)) {
+               clk_enable(wdtclk);
+       } else
+               printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
+
        /* put initial values into count and data */
-       __raw_writel(0x100, S3C2410_WTCNT);
-       __raw_writel(0x100, S3C2410_WTDAT);
+       __raw_writel(0x80, S3C2410_WTCNT);
+       __raw_writel(0x80, S3C2410_WTDAT);
 
        /* set the watchdog to go and reset... */
        __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
                     S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
 
        /* wait for reset to assert... */
-       mdelay(5000);
+       mdelay(500);
 
        printk(KERN_ERR "Watchdog reset failed to assert reset\n");
 
+       /* delay to allow the serial port to show the message */
+       mdelay(50);
+
        /* we'll take a jump through zero as a poor second */
        cpu_reset(0);
 }