Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-shark / core.c
bloba9bc5d0dbd85515c5694c04a3a21f8d0c706b35b
1 /*
2 * linux/arch/arm/mach-shark/arch.c
4 * Architecture specific stuff.
5 */
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <linux/interrupt.h>
9 #include <linux/sched.h>
10 #include <linux/serial_8250.h>
12 #include <asm/setup.h>
13 #include <asm/mach-types.h>
14 #include <asm/io.h>
15 #include <asm/leds.h>
16 #include <asm/param.h>
18 #include <asm/mach/map.h>
19 #include <asm/mach/arch.h>
20 #include <asm/mach/time.h>
22 static struct plat_serial8250_port serial_platform_data[] = {
24 .iobase = 0x3f8,
25 .irq = 4,
26 .uartclk = 1843200,
27 .regshift = 2,
28 .iotype = UPIO_PORT,
29 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
32 .iobase = 0x2f8,
33 .irq = 3,
34 .uartclk = 1843200,
35 .regshift = 2,
36 .iotype = UPIO_PORT,
37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
39 { },
42 static struct platform_device serial_device = {
43 .name = "serial8250",
44 .id = 0,
45 .dev = {
46 .platform_data = serial_platform_data,
50 static int __init shark_init(void)
52 int ret;
54 if (machine_is_shark())
55 ret = platform_device_register(&serial_device);
57 return ret;
60 arch_initcall(shark_init);
62 extern void shark_init_irq(void);
64 static struct map_desc shark_io_desc[] __initdata = {
65 { IO_BASE , IO_START , IO_SIZE , MT_DEVICE }
68 static void __init shark_map_io(void)
70 iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
73 #define IRQ_TIMER 0
74 #define HZ_TIME ((1193180 + HZ/2) / HZ)
76 static irqreturn_t
77 shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
79 write_seqlock(&xtime_lock);
80 timer_tick(regs);
81 write_sequnlock(&xtime_lock);
82 return IRQ_HANDLED;
85 static struct irqaction shark_timer_irq = {
86 .name = "Shark Timer Tick",
87 .flags = SA_INTERRUPT,
88 .handler = shark_timer_interrupt
92 * Set up timer interrupt, and return the current time in seconds.
94 static void __init shark_timer_init(void)
96 outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
97 outb(HZ_TIME & 0xff, 0x40); /* LSB of count */
98 outb(HZ_TIME >> 8, 0x40);
100 setup_irq(IRQ_TIMER, &shark_timer_irq);
103 static struct sys_timer shark_timer = {
104 .init = shark_timer_init,
107 MACHINE_START(SHARK, "Shark")
108 MAINTAINER("Alexander Schulz")
109 BOOT_MEM(0x08000000, 0x40000000, 0xe0000000)
110 BOOT_PARAMS(0x08003000)
111 MAPIO(shark_map_io)
112 INITIRQ(shark_init_irq)
113 .timer = &shark_timer,
114 MACHINE_END