vserver 1.9.5.x5
[linux-2.6.git] / arch / arm / mach-clps7500 / core.c
index 11fa530..1b37ac1 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/list.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/serial_8250.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -267,10 +268,13 @@ static void __init clps7500_map_io(void)
 }
 
 extern void ioctime_init(void);
+extern unsigned long ioc_timer_gettimeoffset(void);
 
 static irqreturn_t
 clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
+       write_seqlock(&xtime_lock);
+
        timer_tick(regs);
 
        /* Why not using do_leds interface?? */
@@ -283,6 +287,9 @@ clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                        *((volatile unsigned int *)LED_ADDRESS) = state;
                }
        }
+
+       write_sequnlock(&xtime_lock);
+
        return IRQ_HANDLED;
 }
 
@@ -295,18 +302,72 @@ static struct irqaction clps7500_timer_irq = {
 /*
  * Set up timer interrupt.
  */
-void __init clps7500_init_time(void)
+static void __init clps7500_timer_init(void)
 {
        ioctime_init();
 
        setup_irq(IRQ_TIMER, &clps7500_timer_irq);
 }
 
+static struct clps7500_timer = {
+       .init           = clps7500_timer_init,
+       .offset         = ioc_timer_gettimeoffset,
+};
+
+static struct plat_serial8250_port serial_platform_data[] = {
+       {
+               .mapbase        = 0x03010fe0,
+               .irq            = 10,
+               .uartclk        = 1843200,
+               .regshift       = 2,
+               .iotype         = UPIO_MEM,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
+       },
+       {
+               .mapbase        = 0x03010be0,
+               .irq            = 0,
+               .uartclk        = 1843200,
+               .regshift       = 2,
+               .iotype         = UPIO_MEM,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SKIP_TEST,
+       },
+       {
+               .iobase         = ISASLOT_IO + 0x2e8,
+               .irq            = 41,
+               .uartclk        = 1843200,
+               .regshift       = 0,
+               .iotype         = UPIO_PORT,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+       },
+       {
+               .iobase         = ISASLOT_IO + 0x3e8,
+               .irq            = 40,
+               .uartclk        = 1843200,
+               .regshift       = 0,
+               .iotype         = UPIO_PORT,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+       },
+       { },
+};
+
+static struct platform_device serial_device = {
+       .name                   = "serial8250",
+       .id                     = 0,
+       .dev                    = {
+               .platform_data  = serial_platform_data,
+       },
+};
+
+static int __init clps7500_init(void)
+{
+       return platform_register_device(&serial_device);
+}
+
 MACHINE_START(CLPS7500, "CL-PS7500")
        MAINTAINER("Philip Blundell")
        BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
        MAPIO(clps7500_map_io)
        INITIRQ(clps7500_init_irq)
-       INITTIME(clps7500_init_time)
+       .timer          = &clps7500_timer,
 MACHINE_END