X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=arch%2Farm%2Fmach-shark%2Fcore.c;h=a9bc5d0dbd85515c5694c04a3a21f8d0c706b35b;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=e4ae688899c12054589140d8fdd825c4f815fcae;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index e4ae68889..a9bc5d0db 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -18,6 +19,46 @@ #include #include +static struct plat_serial8250_port serial_platform_data[] = { + { + .iobase = 0x3f8, + .irq = 4, + .uartclk = 1843200, + .regshift = 2, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .iobase = 0x2f8, + .irq = 3, + .uartclk = 1843200, + .regshift = 2, + .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 shark_init(void) +{ + int ret; + + if (machine_is_shark()) + ret = platform_device_register(&serial_device); + + return ret; +} + +arch_initcall(shark_init); + extern void shark_init_irq(void); static struct map_desc shark_io_desc[] __initdata = { @@ -35,8 +76,9 @@ static void __init shark_map_io(void) static irqreturn_t shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + write_seqlock(&xtime_lock); timer_tick(regs); - + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } @@ -49,10 +91,8 @@ static struct irqaction shark_timer_irq = { /* * Set up timer interrupt, and return the current time in seconds. */ -void __init shark_init_time(void) +static void __init shark_timer_init(void) { - unsigned long flags; - outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */ outb(HZ_TIME & 0xff, 0x40); /* LSB of count */ outb(HZ_TIME >> 8, 0x40); @@ -60,6 +100,9 @@ void __init shark_init_time(void) setup_irq(IRQ_TIMER, &shark_timer_irq); } +static struct sys_timer shark_timer = { + .init = shark_timer_init, +}; MACHINE_START(SHARK, "Shark") MAINTAINER("Alexander Schulz") @@ -67,5 +110,5 @@ MACHINE_START(SHARK, "Shark") BOOT_PARAMS(0x08003000) MAPIO(shark_map_io) INITIRQ(shark_init_irq) - INITTIME(shark_init_time) + .timer = &shark_timer, MACHINE_END