ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / h8300 / platform / h8300h / h8max / timer.c
1 /*
2  *  linux/arch/h8300/platform/h8300h/h8max/timer.c
3  *
4  *  Yoshinori Sato <ysato@users.sourcefoge.jp>
5  *
6  *  Platform depend Timer Handler
7  *
8  */
9
10 #include <linux/config.h>
11 #include <linux/errno.h>
12 #include <linux/sched.h>
13 #include <linux/kernel.h>
14 #include <linux/param.h>
15 #include <linux/string.h>
16 #include <linux/mm.h>
17 #include <linux/interrupt.h>
18 #include <linux/init.h>
19 #include <linux/timex.h>
20
21 #include <asm/segment.h>
22 #include <asm/io.h>
23 #include <asm/irq.h>
24 #include <asm/regs306x.h>
25
26 #define CMFA 6
27
28 void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
29 {
30         ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
31         ctrl_outb(0x00,_8TCSR2);
32         request_irq(40,timer_int,0,"timer",0);
33         ctrl_outb(0x40|0x08|0x03,_8TCR2);
34 }
35
36 void platform_timer_eoi(void)
37 {
38         *(volatile unsigned char *)_8TCSR2 &= ~(1 << CMFA);
39 }
40
41 void platform_gettod(int *year, int *mon, int *day, int *hour,
42                  int *min, int *sec)
43 {
44         *year = *mon = *day = *hour = *min = *sec = 0;
45 }
46