1 /* arch/arm/mach-s3c2410/include/mach/system-reset.h
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * S3C2410 - System define for arch_reset() function
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <mach/hardware.h>
16 #include <asm/plat-s3c/regs-watchdog.h>
17 #include <mach/regs-clock.h>
19 #include <linux/clk.h>
20 #include <linux/err.h>
22 extern void (*s3c24xx_reset_hook)(void);
33 if (s3c24xx_reset_hook)
36 printk("arch_reset: attempting watchdog reset\n");
38 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
40 wdtclk = clk_get(NULL, "watchdog");
41 if (!IS_ERR(wdtclk)) {
44 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
46 /* put initial values into count and data */
47 __raw_writel(0x80, S3C2410_WTCNT);
48 __raw_writel(0x80, S3C2410_WTDAT);
50 /* set the watchdog to go and reset... */
51 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
52 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
54 /* wait for reset to assert... */
57 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
59 /* delay to allow the serial port to show the message */
62 /* we'll take a jump through zero as a poor second */