2 * linux/arch/arm/mach-shark/arch.c
4 * Architecture specific stuff.
6 #include <linux/kernel.h>
7 #include <linux/init.h>
8 #include <linux/interrupt.h>
10 #include <linux/sched.h>
11 #include <linux/serial_8250.h>
14 #include <asm/setup.h>
15 #include <asm/mach-types.h>
17 #include <asm/param.h>
19 #include <mach/hardware.h>
21 #include <asm/mach/map.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/time.h>
25 static struct plat_serial8250_port serial_platform_data
[] = {
32 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
40 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
45 static struct platform_device serial_device
= {
47 .id
= PLAT8250_DEV_PLATFORM
,
49 .platform_data
= serial_platform_data
,
53 static int __init
shark_init(void)
57 if (machine_is_shark())
58 ret
= platform_device_register(&serial_device
);
63 arch_initcall(shark_init
);
65 extern void shark_init_irq(void);
67 static struct map_desc shark_io_desc
[] __initdata
= {
70 .pfn
= __phys_to_pfn(IO_START
),
76 static void __init
shark_map_io(void)
78 iotable_init(shark_io_desc
, ARRAY_SIZE(shark_io_desc
));
82 #define HZ_TIME ((1193180 + HZ/2) / HZ)
85 shark_timer_interrupt(int irq
, void *dev_id
)
91 static struct irqaction shark_timer_irq
= {
92 .name
= "Shark Timer Tick",
93 .flags
= IRQF_DISABLED
| IRQF_TIMER
| IRQF_IRQPOLL
,
94 .handler
= shark_timer_interrupt
,
98 * Set up timer interrupt, and return the current time in seconds.
100 static void __init
shark_timer_init(void)
102 outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
103 outb(HZ_TIME
& 0xff, 0x40); /* LSB of count */
104 outb(HZ_TIME
>> 8, 0x40);
106 setup_irq(IRQ_TIMER
, &shark_timer_irq
);
109 static struct sys_timer shark_timer
= {
110 .init
= shark_timer_init
,
113 MACHINE_START(SHARK
, "Shark")
114 /* Maintainer: Alexander Schulz */
115 .phys_io
= 0x40000000,
116 .io_pg_offst
= ((0xe0000000) >> 18) & 0xfffc,
117 .boot_params
= 0x08003000,
118 .map_io
= shark_map_io
,
119 .init_irq
= shark_init_irq
,
120 .timer
= &shark_timer
,