initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / arm / mach-h720x / cpu-h7201.c
blob30f4d61184b9a8b926430d777c5a9d4a143126a3
1 /*
2 * linux/arch/arm/mach-h720x/cpu-h7201.c
4 * Copyright (C) 2003 Thomas Gleixner <tglx@linutronix.de>
5 * 2003 Robert Schwebel <r.schwebel@pengutronix.de>
6 * 2004 Sascha Hauer <s.hauer@pengutronix.de>
8 * processor specific stuff for the Hynix h7201
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
16 #include <linux/init.h>
17 #include <linux/interrupt.h>
18 #include <linux/module.h>
19 #include <asm/types.h>
20 #include <asm/hardware.h>
21 #include <asm/irq.h>
22 #include <asm/arch/irqs.h>
23 #include <asm/mach/irq.h>
24 #include <asm/mach/time.h>
26 extern unsigned long h720x_gettimeoffset(void);
27 extern void __init h720x_init_irq (void);
30 * Timer interrupt handler
32 static irqreturn_t
33 h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
35 CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
36 timer_tick(regs);
37 return IRQ_HANDLED;
40 static struct irqaction h7201_timer_irq = {
41 .name = "h7201 Timer Tick",
42 .flags = SA_INTERRUPT,
43 .handler = h7201_timer_interrupt
47 * Setup TIMER0 as system timer
49 void __init h7201_init_time(void)
51 gettimeoffset = h720x_gettimeoffset;
53 CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
54 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
55 CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
56 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
58 setup_irq(IRQ_TIMER0, &h7201_timer_irq);