initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-arm / arch-s3c2410 / system.h
blob1322cecea011685591888239592f13aa5f6a6f63
1 /* linux/include/asm-arm/arch-s3c2410/system.h
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * S3C2410 - System function defines and includes
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.
12 * Changelog:
13 * 12-May-2003 BJD Created file
14 * 14-May-2003 BJD Removed idle to aid debugging
15 * 12-Jun-2003 BJD Added reset via watchdog
16 * 04-Sep-2003 BJD Moved to v2.6
19 #include <asm/hardware.h>
20 #include <asm/io.h>
22 #include <asm/arch/map.h>
24 #include <asm/arch/regs-watchdog.h>
25 #include <asm/arch/regs-clock.h>
27 extern void printascii(const char *);
29 void
30 arch_idle(void)
32 //unsigned long reg = S3C2410_CLKCON;
34 //printascii("arch_idle:\n");
36 /* idle the system by using the idle mode which will wait for an
37 * interrupt to happen before restarting the system.
40 /* going into idle state upsets the jtag, so don't do it
41 * at the moment */
43 #if 0
44 __raw_writel(__raw_readl(reg) | (1<<2), reg);
46 /* the samsung port seems to do a loop and then unset idle.. */
47 for (i = 0; i < 50; i++) {
48 tmp = __raw_readl(reg); /* ensure loop not optimised out */
51 //printascii("arch_idle: done\n");
53 __raw_writel(__raw_readl(reg) & ~(1<<2), reg);
54 #endif
58 static void
59 arch_reset(char mode)
61 if (mode == 's') {
62 cpu_reset(0);
65 printk("arch_reset: attempting watchdog reset\n");
67 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
69 /* put initial values into count and data */
70 __raw_writel(0x100, S3C2410_WTCNT);
71 __raw_writel(0x100, S3C2410_WTDAT);
73 /* set the watchdog to go and reset... */
74 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
75 S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
77 /* wait for reset to assert... */
78 mdelay(5000);
80 panic("Watchdog reset failed to assert reset\n");
82 /* we'll take a jump through zero as a poor second */
83 cpu_reset(0);