http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / kernel / linux / arch / arm / mach-shark / core.c
1 /*
2  *  linux/arch/arm/mach-shark/arch.c
3  *
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
11 #include <asm/setup.h>
12 #include <asm/mach-types.h>
13 #include <asm/io.h>
14 #include <asm/leds.h>
15 #include <asm/param.h>
16
17 #include <asm/mach/map.h>
18 #include <asm/mach/arch.h>
19 #include <asm/mach/time.h>
20
21 extern void shark_init_irq(void);
22
23 static struct map_desc shark_io_desc[] __initdata = {
24         { IO_BASE       , IO_START      , IO_SIZE       , MT_DEVICE }
25 };
26
27 static void __init shark_map_io(void)
28 {
29         iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
30 }
31
32 #define IRQ_TIMER 0
33 #define HZ_TIME ((1193180 + HZ/2) / HZ)
34
35 static irqreturn_t
36 shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
37 {
38         timer_tick(regs);
39
40         return IRQ_HANDLED;
41 }
42
43 static struct irqaction shark_timer_irq = {
44         .name           = "Shark Timer Tick",
45         .flags          = SA_INTERRUPT,
46         .handler        = shark_timer_interrupt
47 };
48
49 /*
50  * Set up timer interrupt, and return the current time in seconds.
51  */
52 void __init shark_init_time(void)
53 {
54         unsigned long flags;
55
56         outb(0x34, 0x43);               /* binary, mode 0, LSB/MSB, Ch 0 */
57         outb(HZ_TIME & 0xff, 0x40);     /* LSB of count */
58         outb(HZ_TIME >> 8, 0x40);
59
60         setup_irq(IRQ_TIMER, &shark_timer_irq);
61 }
62
63
64 MACHINE_START(SHARK, "Shark")
65         MAINTAINER("Alexander Schulz")
66         BOOT_MEM(0x08000000, 0x40000000, 0xe0000000)
67         BOOT_PARAMS(0x08003000)
68         MAPIO(shark_map_io)
69         INITIRQ(shark_init_irq)
70         INITTIME(shark_init_time)
71 MACHINE_END