Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / arm / mach-clps7500 / core.c
index 11fa530..5b12cab 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/list.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial_8250.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -24,6 +26,8 @@
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
+unsigned int vram_size;
+
 static void cl7500_ack_irq_a(unsigned int irq)
 {
        unsigned int val, mask;
@@ -255,10 +259,27 @@ static void __init clps7500_init_irq(void)
 }
 
 static struct map_desc cl7500_io_desc[] __initdata = {
-       { IO_BASE,      IO_START,       IO_SIZE,    MT_DEVICE },        /* IO space     */
-       { ISA_BASE,     ISA_START,      ISA_SIZE,   MT_DEVICE },        /* ISA space    */
-       { FLASH_BASE,   FLASH_START,    FLASH_SIZE, MT_DEVICE },        /* Flash        */
-       { LED_BASE,     LED_START,      LED_SIZE,   MT_DEVICE }         /* LED          */
+       {       /* IO space     */
+               .virtual        = (unsigned long)IO_BASE,
+               .pfn            = __phys_to_pfn(IO_START),
+               .length         = IO_SIZE,
+               .type           = MT_DEVICE
+       }, {    /* ISA space    */
+               .virtual        = ISA_BASE,
+               .pfn            = __phys_to_pfn(ISA_START),
+               .length         = ISA_SIZE,
+               .type           = MT_DEVICE
+       }, {    /* Flash        */
+               .virtual        = FLASH_BASE,
+               .pfn            = __phys_to_pfn(FLASH_START),
+               .length         = FLASH_SIZE,
+               .type           = MT_DEVICE
+       }, {    /* LED          */
+               .virtual        = LED_BASE,
+               .pfn            = __phys_to_pfn(LED_START),
+               .length         = LED_SIZE,
+               .type           = MT_DEVICE
+       }
 };
 
 static void __init clps7500_map_io(void)
@@ -267,10 +288,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,30 +307,88 @@ 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;
 }
 
 static struct irqaction clps7500_timer_irq = {
        .name           = "CLPS7500 Timer Tick",
-       .flags          = SA_INTERRUPT,
-       .handler        = clps7500_timer_interrupt
+       .flags          = SA_INTERRUPT | SA_TIMER,
+       .handler        = clps7500_timer_interrupt,
 };
 
 /*
  * 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 sys_timer 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                     = PLAT8250_DEV_PLATFORM,
+       .dev                    = {
+               .platform_data  = serial_platform_data,
+       },
+};
+
+static void __init clps7500_init(void)
+{
+       platform_device_register(&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)
+       /* Maintainer: Philip Blundell */
+       .phys_io        = 0x03000000,
+       .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
+       .map_io         = clps7500_map_io,
+       .init_irq       = clps7500_init_irq,
+       .init_machine   = clps7500_init,
+       .timer          = &clps7500_timer,
 MACHINE_END