I2C: TWL4030: Kconfig and Makefile changes
[linux-ginger.git] / arch / arm / mach-shark / core.c
blob09d9f33d4072fb591c8f4b1c2f2b90894ef86c70
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/irq.h>
10 #include <linux/sched.h>
11 #include <linux/serial_8250.h>
13 #include <asm/setup.h>
14 #include <asm/mach-types.h>
15 #include <asm/io.h>
16 #include <asm/leds.h>
17 #include <asm/param.h>
19 #include <asm/mach/map.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/time.h>
23 static struct plat_serial8250_port serial_platform_data[] = {
25 .iobase = 0x3f8,
26 .irq = 4,
27 .uartclk = 1843200,
28 .regshift = 0,
29 .iotype = UPIO_PORT,
30 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
33 .iobase = 0x2f8,
34 .irq = 3,
35 .uartclk = 1843200,
36 .regshift = 0,
37 .iotype = UPIO_PORT,
38 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
40 { },
43 static struct platform_device serial_device = {
44 .name = "serial8250",
45 .id = PLAT8250_DEV_PLATFORM,
46 .dev = {
47 .platform_data = serial_platform_data,
51 static int __init shark_init(void)
53 int ret;
55 if (machine_is_shark())
56 ret = platform_device_register(&serial_device);
58 return ret;
61 arch_initcall(shark_init);
63 extern void shark_init_irq(void);
65 static struct map_desc shark_io_desc[] __initdata = {
67 .virtual = IO_BASE,
68 .pfn = __phys_to_pfn(IO_START),
69 .length = IO_SIZE,
70 .type = MT_DEVICE
74 static void __init shark_map_io(void)
76 iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
79 #define IRQ_TIMER 0
80 #define HZ_TIME ((1193180 + HZ/2) / HZ)
82 static irqreturn_t
83 shark_timer_interrupt(int irq, void *dev_id)
85 timer_tick();
86 return IRQ_HANDLED;
89 static struct irqaction shark_timer_irq = {
90 .name = "Shark Timer Tick",
91 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
92 .handler = shark_timer_interrupt,
96 * Set up timer interrupt, and return the current time in seconds.
98 static void __init shark_timer_init(void)
100 outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
101 outb(HZ_TIME & 0xff, 0x40); /* LSB of count */
102 outb(HZ_TIME >> 8, 0x40);
104 setup_irq(IRQ_TIMER, &shark_timer_irq);
107 static struct sys_timer shark_timer = {
108 .init = shark_timer_init,
111 MACHINE_START(SHARK, "Shark")
112 /* Maintainer: Alexander Schulz */
113 .phys_io = 0x40000000,
114 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
115 .boot_params = 0x08003000,
116 .map_io = shark_map_io,
117 .init_irq = shark_init_irq,
118 .timer = &shark_timer,
119 MACHINE_END