Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / arch / arm / mach-s3c2410 / include / mach / system.h
bloba8cbca6701e54faf00e940b5db0c1ed1fbc8fd21
1 /* arch/arm/mach-s3c2410/include/mach/system.h
3 * Copyright (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.
13 #include <linux/io.h>
14 #include <mach/hardware.h>
16 #include <mach/map.h>
17 #include <mach/idle.h>
18 #include <mach/reset.h>
20 #include <mach/regs-clock.h>
22 void (*s3c24xx_idle)(void);
23 void (*s3c24xx_reset_hook)(void);
25 void s3c24xx_default_idle(void)
27 unsigned long tmp;
28 int i;
30 /* idle the system by using the idle mode which will wait for an
31 * interrupt to happen before restarting the system.
34 /* Warning: going into idle state upsets jtag scanning */
36 __raw_writel(__raw_readl(S3C2410_CLKCON) | S3C2410_CLKCON_IDLE,
37 S3C2410_CLKCON);
39 /* the samsung port seems to do a loop and then unset idle.. */
40 for (i = 0; i < 50; i++) {
41 tmp += __raw_readl(S3C2410_CLKCON); /* ensure loop not optimised out */
44 /* this bit is not cleared on re-start... */
46 __raw_writel(__raw_readl(S3C2410_CLKCON) & ~S3C2410_CLKCON_IDLE,
47 S3C2410_CLKCON);
50 static void arch_idle(void)
52 if (s3c24xx_idle != NULL)
53 (s3c24xx_idle)();
54 else
55 s3c24xx_default_idle();
58 #include <mach/system-reset.h>