X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fh8300%2Fplatform%2Fh8300h%2Fh8max%2Ftimer.c;h=85a574afe9d0c2a98341bc856229bc923f97a42a;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=745da9d277651ce6030c7c711d0317a319e843ad;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/h8300/platform/h8300h/h8max/timer.c b/arch/h8300/platform/h8300h/h8max/timer.c index 745da9d27..85a574afe 100644 --- a/arch/h8300/platform/h8300h/h8max/timer.c +++ b/arch/h8300/platform/h8300h/h8max/timer.c @@ -7,7 +7,6 @@ * */ -#include #include #include #include @@ -25,12 +24,19 @@ #define CMFA 6 +#define CMIEA 0x40 +#define CCLR_CMA 0x08 +#define CLK_DIV8192 0x03 + +#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */ + void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *)) { - ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2); - ctrl_outb(0x00,_8TCSR2); - request_irq(40,timer_int,0,"timer",0); - ctrl_outb(0x40|0x08|0x03,_8TCR2); + /* setup 8bit timer ch2 */ + ctrl_outb(H8300_TIMER_FREQ / HZ, TCORA2); /* set interval */ + ctrl_outb(0x00, _8TCSR2); /* no output */ + request_irq(40, timer_int, 0, "timer", 0); + ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR2); /* start count */ } void platform_timer_eoi(void)