From 629c9ae08928eab76f27dde4c5ffe1a708ebfdfb Mon Sep 17 00:00:00 2001 From: Ivan Kokshaysky Date: Mon, 24 May 2004 18:38:44 -0700 Subject: [PATCH] [PATCH] fix system clock on ruffian Unlike most other alphas, ruffian uses i8253 timer instead of RTC as the system clock source. However, the PIT clock divisor (LATCH) is bogus since CLOCK_TICK_RATE has been changed to 32 KHz. Fixed using recently introduced PIT_TICK_RATE macro. Ivan. --- arch/alpha/kernel/sys_ruffian.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c index 3438b8d4880d9..ccabcb1e3724c 100644 --- a/arch/alpha/kernel/sys_ruffian.c +++ b/arch/alpha/kernel/sys_ruffian.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "proto.h" #include "irq_impl.h" @@ -64,6 +65,8 @@ ruffian_init_irq(void) common_init_isa_dma(); } +#define RUFFIAN_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ) + static void __init ruffian_init_rtc(void) { @@ -72,8 +75,8 @@ ruffian_init_rtc(void) /* Setup interval timer. */ outb(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */ - outb(LATCH & 0xff, 0x40); /* LSB */ - outb(LATCH >> 8, 0x40); /* MSB */ + outb(RUFFIAN_LATCH & 0xff, 0x40); /* LSB */ + outb(RUFFIAN_LATCH >> 8, 0x40); /* MSB */ outb(0xb6, 0x43); /* pit counter 2: speaker */ outb(0x31, 0x42); -- 2.53.0