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>
9 #include <linux/sched.h>
10 #include <linux/serial_8250.h>
12 #include <asm/setup.h>
13 #include <asm/mach-types.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
[] = {
29 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
37 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
,
42 static struct platform_device serial_device
= {
44 .id
= PLAT8250_DEV_PLATFORM
,
46 .platform_data
= serial_platform_data
,
50 static int __init
shark_init(void)
54 if (machine_is_shark())
55 ret
= platform_device_register(&serial_device
);
60 arch_initcall(shark_init
);
62 extern void shark_init_irq(void);
64 static struct map_desc shark_io_desc
[] __initdata
= {
67 .pfn
= __phys_to_pfn(IO_START
),
73 static void __init
shark_map_io(void)
75 iotable_init(shark_io_desc
, ARRAY_SIZE(shark_io_desc
));
79 #define HZ_TIME ((1193180 + HZ/2) / HZ)
82 shark_timer_interrupt(int irq
, void *dev_id
, struct pt_regs
*regs
)
84 write_seqlock(&xtime_lock
);
86 write_sequnlock(&xtime_lock
);
90 static struct irqaction shark_timer_irq
= {
91 .name
= "Shark Timer Tick",
92 .flags
= SA_INTERRUPT
| SA_TIMER
,
93 .handler
= shark_timer_interrupt
,
97 * Set up timer interrupt, and return the current time in seconds.
99 static void __init
shark_timer_init(void)
101 outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
102 outb(HZ_TIME
& 0xff, 0x40); /* LSB of count */
103 outb(HZ_TIME
>> 8, 0x40);
105 setup_irq(IRQ_TIMER
, &shark_timer_irq
);
108 static struct sys_timer shark_timer
= {
109 .init
= shark_timer_init
,
112 MACHINE_START(SHARK
, "Shark")
113 /* Maintainer: Alexander Schulz */
114 .phys_ram
= 0x08000000,
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
,