2 * linux/arch/h8300/platform/h8s/generic/timer.c
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
6 * Platform depend Timer Handler
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>
17 #include <linux/interrupt.h>
18 #include <linux/init.h>
19 #include <linux/timex.h>
21 #include <asm/segment.h>
24 #include <asm/regs267x.h>
26 #define REGS(regs) __REGS(regs)
27 #define __REGS(regs) #regs
29 int __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
31 unsigned char mstpcrl;
32 mstpcrl = ctrl_inb(MSTPCRL); /* Enable timer */
34 ctrl_outb(mstpcrl,MSTPCRL);
35 ctrl_outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
36 ctrl_outb(0x00,_8TCSR1);
37 request_irq(76,timer_int,0,"timer",0);
38 ctrl_outb(0x40|0x08|0x03,_8TCR1);
42 void platform_timer_eoi(void)
44 __asm__("bclr #6,@" REGS(_8TCSR1) ":8");
47 void platform_gettod(int *year, int *mon, int *day, int *hour,
50 /* FIXME! not RTC support */
51 *year = *mon = *day = *hour = *min = *sec = 0;