fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / arm / mach-ebsa110 / core.c
index 07c5563..8459431 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/serial_8250.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
@@ -44,7 +45,7 @@ static void ebsa110_unmask_irq(unsigned int irq)
        __raw_writeb(1 << irq, IRQ_MSET);
 }
 
-static struct irqchip ebsa110_irq_chip = {
+static struct irq_chip ebsa110_irq_chip = {
        .ack    = ebsa110_mask_irq,
        .mask   = ebsa110_mask_irq,
        .unmask = ebsa110_unmask_irq,
@@ -66,7 +67,7 @@ static void __init ebsa110_init_irq(void)
 
        for (irq = 0; irq < NR_IRQS; irq++) {
                set_irq_chip(irq, &ebsa110_irq_chip);
-               set_irq_handler(irq, do_level_IRQ);
+               set_irq_handler(irq, handle_level_irq);
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
        }
 }
@@ -75,16 +76,42 @@ static struct map_desc ebsa110_io_desc[] __initdata = {
        /*
         * sparse external-decode ISAIO space
         */
-       { IRQ_STAT,    TRICK4_PHYS, PGDIR_SIZE,  MT_DEVICE }, /* IRQ_STAT/IRQ_MCLR */
-       { IRQ_MASK,    TRICK3_PHYS, PGDIR_SIZE,  MT_DEVICE }, /* IRQ_MASK/IRQ_MSET */
-       { SOFT_BASE,   TRICK1_PHYS, PGDIR_SIZE,  MT_DEVICE }, /* SOFT_BASE */
-       { PIT_BASE,    TRICK0_PHYS, PGDIR_SIZE,  MT_DEVICE }, /* PIT_BASE */
+       {       /* IRQ_STAT/IRQ_MCLR */
+               .virtual        = IRQ_STAT,
+               .pfn            = __phys_to_pfn(TRICK4_PHYS),
+               .length         = PGDIR_SIZE,
+               .type           = MT_DEVICE
+       }, {    /* IRQ_MASK/IRQ_MSET */
+               .virtual        = IRQ_MASK,
+               .pfn            = __phys_to_pfn(TRICK3_PHYS),
+               .length         = PGDIR_SIZE,
+               .type           = MT_DEVICE
+       }, {    /* SOFT_BASE */
+               .virtual        = SOFT_BASE,
+               .pfn            = __phys_to_pfn(TRICK1_PHYS),
+               .length         = PGDIR_SIZE,
+               .type           = MT_DEVICE
+       }, {    /* PIT_BASE */
+               .virtual        = PIT_BASE,
+               .pfn            = __phys_to_pfn(TRICK0_PHYS),
+               .length         = PGDIR_SIZE,
+               .type           = MT_DEVICE
+       },
 
        /*
         * self-decode ISAIO space
         */
-       { ISAIO_BASE,  ISAIO_PHYS,  ISAIO_SIZE,  MT_DEVICE },
-       { ISAMEM_BASE, ISAMEM_PHYS, ISAMEM_SIZE, MT_DEVICE }
+       {
+               .virtual        = ISAIO_BASE,
+               .pfn            = __phys_to_pfn(ISAIO_PHYS),
+               .length         = ISAIO_SIZE,
+               .type           = MT_DEVICE
+       }, {
+               .virtual        = ISAMEM_BASE,
+               .pfn            = __phys_to_pfn(ISAMEM_PHYS),
+               .length         = ISAMEM_SIZE,
+               .type           = MT_DEVICE
+       }
 };
 
 static void __init ebsa110_map_io(void)
@@ -147,10 +174,12 @@ static unsigned long ebsa110_gettimeoffset(void)
 }
 
 static irqreturn_t
-ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+ebsa110_timer_interrupt(int irq, void *dev_id)
 {
        u32 count;
 
+       write_seqlock(&xtime_lock);
+
        /* latch and read timer 1 */
        __raw_writeb(0x40, PIT_CTRL);
        count = __raw_readb(PIT_T1);
@@ -161,21 +190,23 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        __raw_writeb(count & 0xff, PIT_T1);
        __raw_writeb(count >> 8, PIT_T1);
 
-       timer_tick(regs);
+       timer_tick();
+
+       write_sequnlock(&xtime_lock);
 
        return IRQ_HANDLED;
 }
 
 static struct irqaction ebsa110_timer_irq = {
        .name           = "EBSA110 Timer Tick",
-       .flags          = SA_INTERRUPT,
-       .handler        = ebsa110_timer_interrupt
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
+       .handler        = ebsa110_timer_interrupt,
 };
 
 /*
  * Set up timer interrupt.
  */
-static void __init ebsa110_init_time(void)
+static void __init ebsa110_timer_init(void)
 {
        /*
         * Timer 1, mode 2, LSB/MSB
@@ -184,19 +215,82 @@ static void __init ebsa110_init_time(void)
        __raw_writeb(COUNT & 0xff, PIT_T1);
        __raw_writeb(COUNT >> 8, PIT_T1);
 
-       gettimeoffset = ebsa110_gettimeoffset;
-
        setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq);
 }
 
+static struct sys_timer ebsa110_timer = {
+       .init           = ebsa110_timer_init,
+       .offset         = ebsa110_gettimeoffset,
+};
+
+static struct plat_serial8250_port serial_platform_data[] = {
+       {
+               .iobase         = 0x3f8,
+               .irq            = 1,
+               .uartclk        = 1843200,
+               .regshift       = 0,
+               .iotype         = UPIO_PORT,
+               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+       },
+       {
+               .iobase         = 0x2f8,
+               .irq            = 2,
+               .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 struct resource am79c961_resources[] = {
+       {
+               .start          = 0x220,
+               .end            = 0x238,
+               .flags          = IORESOURCE_IO,
+       }, {
+               .start          = IRQ_EBSA110_ETHERNET,
+               .end            = IRQ_EBSA110_ETHERNET,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device am79c961_device = {
+       .name                   = "am79c961",
+       .id                     = -1,
+       .num_resources          = ARRAY_SIZE(am79c961_resources),
+       .resource               = am79c961_resources,
+};
+
+static struct platform_device *ebsa110_devices[] = {
+       &serial_device,
+       &am79c961_device,
+};
+
+static int __init ebsa110_init(void)
+{
+       return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices));
+}
+
+arch_initcall(ebsa110_init);
+
 MACHINE_START(EBSA110, "EBSA110")
-       MAINTAINER("Russell King")
-       BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000)
-       BOOT_PARAMS(0x00000400)
-       DISABLE_PARPORT(0)
-       DISABLE_PARPORT(2)
-       SOFT_REBOOT
-       MAPIO(ebsa110_map_io)
-       INITIRQ(ebsa110_init_irq)
-       INITTIME(ebsa110_init_time)
+       /* Maintainer: Russell King */
+       .phys_io        = 0xe0000000,
+       .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
+       .boot_params    = 0x00000400,
+       .reserve_lp0    = 1,
+       .reserve_lp2    = 1,
+       .soft_reboot    = 1,
+       .map_io         = ebsa110_map_io,
+       .init_irq       = ebsa110_init_irq,
+       .timer          = &ebsa110_timer,
 MACHINE_END