Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / arch / arm / mach-s3c2412 / s3c2412.c
index c602aa3..e0ccb40 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 #include <linux/sysdev.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#include <asm/arch/reset.h>
 #include <asm/arch/idle.h>
 
 #include <asm/arch/regs-clock.h>
-#include <asm/arch/regs-serial.h>
+#include <asm/plat-s3c/regs-serial.h>
 #include <asm/arch/regs-power.h>
 #include <asm/arch/regs-gpio.h>
 #include <asm/arch/regs-gpioj.h>
 #include <asm/arch/regs-dsc.h>
-#include <asm/arch/regs-spi.h>
+#include <asm/plat-s3c24xx/regs-spi.h>
+#include <asm/arch/regs-s3c2412.h>
 
 #include <asm/plat-s3c24xx/s3c2412.h>
 #include <asm/plat-s3c24xx/cpu.h>
@@ -60,7 +63,6 @@ static inline void s3c2412_init_gpio2(void)
 
 static struct map_desc s3c2412_iodesc[] __initdata = {
        IODESC_ENT(CLKPWR),
-       IODESC_ENT(LCD),
        IODESC_ENT(TIMER),
        IODESC_ENT(WATCHDOG),
 };
@@ -106,6 +108,23 @@ static void s3c2412_idle(void)
        cpu_do_idle();
 }
 
+static void s3c2412_hard_reset(void)
+{
+       /* errata "Watch-dog/Software Reset Problem" specifies that
+        * this reset must be done with the SYSCLK sourced from
+        * EXTCLK instead of FOUT to avoid a glitch in the reset
+        * mechanism.
+        *
+        * See the watchdog section of the S3C2412 manual for more
+        * information on this fix.
+        */
+
+       __raw_writel(0x00, S3C2412_CLKSRC);
+       __raw_writel(S3C2412_SWRST_RESET, S3C2412_SWRST);
+
+       mdelay(1);
+}
+
 /* s3c2412_map_io
  *
  * register the standard cpu IO areas, and any passed in from the
@@ -122,6 +141,10 @@ void __init s3c2412_map_io(struct map_desc *mach_desc, int mach_size)
 
        s3c24xx_idle = s3c2412_idle;
 
+       /* set custom reset hook */
+
+       s3c24xx_reset_hook = s3c2412_hard_reset;
+
        /* register our io-tables */
 
        iotable_init(s3c2412_iodesc, ARRAY_SIZE(s3c2412_iodesc));