X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-shark%2Fcore.c;h=0e480fae8ec51e0c4ca07706373681ce8c90448e;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=e4ae688899c12054589140d8fdd825c4f815fcae;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index e4ae68889..0e480fae8 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include #include #include @@ -18,10 +20,55 @@ #include #include +static struct plat_serial8250_port serial_platform_data[] = { + { + .iobase = 0x3f8, + .irq = 4, + .uartclk = 1843200, + .regshift = 0, + .iotype = UPIO_PORT, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + }, + { + .iobase = 0x2f8, + .irq = 3, + .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 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 = { - { IO_BASE , IO_START , IO_SIZE , MT_DEVICE } + { + .virtual = IO_BASE, + .pfn = __phys_to_pfn(IO_START), + .length = IO_SIZE, + .type = MT_DEVICE + } }; static void __init shark_map_io(void) @@ -33,26 +80,25 @@ static void __init shark_map_io(void) #define HZ_TIME ((1193180 + HZ/2) / HZ) static irqreturn_t -shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +shark_timer_interrupt(int irq, void *dev_id) { - timer_tick(regs); - + write_seqlock(&xtime_lock); + timer_tick(); + write_sequnlock(&xtime_lock); return IRQ_HANDLED; } static struct irqaction shark_timer_irq = { .name = "Shark Timer Tick", - .flags = SA_INTERRUPT, - .handler = shark_timer_interrupt + .flags = IRQF_DISABLED | IRQF_TIMER, + .handler = shark_timer_interrupt, }; /* * 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,12 +106,16 @@ 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") - BOOT_MEM(0x08000000, 0x40000000, 0xe0000000) - BOOT_PARAMS(0x08003000) - MAPIO(shark_map_io) - INITIRQ(shark_init_irq) - INITTIME(shark_init_time) + /* Maintainer: Alexander Schulz */ + .phys_io = 0x40000000, + .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, + .boot_params = 0x08003000, + .map_io = shark_map_io, + .init_irq = shark_init_irq, + .timer = &shark_timer, MACHINE_END