From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 6912 invoked from network); 15 Oct 1998 19:57:25 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 15 Oct 1998 19:57:25 -0000 Received: from smtp3.xs4all.nl (smtp3.xs4all.nl [194.109.6.53]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA08493 for ; Thu, 15 Oct 1998 15:50:27 -0400 Received: from mycroft.rc5.nl (n064.wageningen.telekabel.euronet.nl [194.134.133.69]) by smtp3.xs4all.nl (8.8.8/8.8.8) with SMTP id VAA29956; Thu, 15 Oct 1998 21:50:14 +0200 (CEST) Message-Id: <199810151950.VAA29956@smtp3.xs4all.nl> From: "Willem Boschman" Organization: CSC Kobra To: wknaka@pobox.com Date: Thu, 15 Oct 1998 21:54:50 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: XL300 2.1.123 clock Reply-to: wiz@xs4all.nl CC: axp-list@redhat.com Priority: normal In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.01b) > > > While experimenting with kernel 2.1.123, I noticed that my clock is now > running quite a bit too fast. I know that this is a common problem, but > I didn't have the problem before trying out 2.1.123 (previously running > 2.1.107). I was looking over the gatekeeper ftp site for the various > fixes suggested but I don't see anything that might work for my machine, > which is an XL300. Any pointers? > > thanks, > -Wes. > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com > i've backed out some of the alpha changes in 2.1.121. i don't no why but this seems to solve my clock problem, patch attached. now if someone could explain to me why i would feel a lot better. -willem --- linux/arch/alpha/kernel/setup.c.wiz Thu Oct 15 16:09:39 1998 +++ linux/arch/alpha/kernel/setup.c Thu Oct 15 21:19:59 1998 @@ -20,6 +20,7 @@ #include #include #include /* CONFIG_ALPHA_LCA etc */ +#include #include #include #include @@ -96,6 +97,69 @@ orig_video_points: 16 }; + +/* + * Initialize Programmable Interval Timers with standard values. Some + * drivers depend on them being initialized (e.g., joystick driver). + */ + +/* It is (normally) only counter 1 that presents config problems, so + provide this support function to do the rest of the job. */ + +void inline +init_pit_rest(void) +{ + int x; +#if 0 + /* Leave refresh timer alone---nobody should depend on a + particular value anyway. */ + outb(0x54, 0x43); /* counter 1: refresh timer */ + outb(0x18, 0x41); +#endif + + outb(0xb6, 0x43); /* counter 2: speaker */ + outb(0x31, 0x42); + outb(0x13, 0x42); + + if ((x = (CMOS_READ(RTC_FREQ_SELECT) & 0x3f)) != 0x26) { + printk("Setting RTC_FREQ to 1024 Hz (%x)\n", x); + CMOS_WRITE(0x26, RTC_FREQ_SELECT); + } +} + +#ifdef CONFIG_RTC +static inline void +rtc_init_pit (void) +{ + /* Setup interval timer if /dev/rtc is being used */ + outb(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */ + outb(LATCH & 0xff, 0x40); /* LSB */ + outb(LATCH >> 8, 0x40); /* MSB */ + request_region(0x40, 0x20, "timer"); /* reserve pit */ + + init_pit_rest(); +} +#endif + +void +generic_init_pit (void) +{ + outb(0x36, 0x43); /* counter 0: system timer */ + outb(0x00, 0x40); + outb(0x00, 0x40); + request_region(RTC_PORT(0), 0x10, "timer"); /* reserve rtc */ + + init_pit_rest(); +} + +/* This probably isn't Right, but it is what the old code did. */ +#if defined(CONFIG_RTC) +# define init_pit rtc_init_pit +#else +# define init_pit alpha_mv.init_pit +#endif + + /* * Declare all of the machine vectors. */ @@ -259,6 +323,9 @@ DMA windows and the like. */ if (alpha_mv.init_arch) alpha_mv.init_arch(memory_start_p, memory_end_p); + + /* Initialize the timers. */ + init_pit(); /* * Give us a default console. TGA users will see nothing until --- linux/arch/alpha/kernel/time.c.wiz Thu Oct 15 16:09:39 1998 +++ linux/arch/alpha/kernel/time.c Thu Oct 15 17:08:03 1998 @@ -25,7 +25,7 @@ #include #include #include -#include +/* #include */ #include #include @@ -42,6 +42,8 @@ #define TIMER_IRQ 8 /* using rtc for timer */ #endif +extern struct hwrpb_struct *hwrpb; + static int set_rtc_mmss(unsigned long); @@ -157,69 +159,6 @@ )*60 + sec; /* finally seconds */ } -/* - * Initialize Programmable Interval Timers with standard values. Some - * drivers depend on them being initialized (e.g., joystick driver). - */ - -/* It is (normally) only counter 1 that presents config problems, so - provide this support function to do the rest of the job. */ - -void inline -init_pit_rest(void) -{ -#if 0 - /* Leave refresh timer alone---nobody should depend on a - particular value anyway. */ - outb(0x54, 0x43); /* counter 1: refresh timer */ - outb(0x18, 0x41); -#endif - - outb(0xb6, 0x43); /* counter 2: speaker */ - outb(0x31, 0x42); - outb(0x13, 0x42); -} - -#ifdef CONFIG_RTC -static inline void -rtc_init_pit (void) -{ - /* Setup interval timer if /dev/rtc is being used */ - outb(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */ - outb(LATCH & 0xff, 0x40); /* LSB */ - outb(LATCH >> 8, 0x40); /* MSB */ - request_region(0x40, 0x20, "timer"); /* reserve pit */ - - init_pit_rest(); -} -#endif - -void -generic_init_pit (void) -{ - int x; - if ((x = (CMOS_READ(RTC_FREQ_SELECT) & 0x3f)) != 0x26) { - printk("Setting RTC_FREQ to 1024 Hz (%x)\n", x); - CMOS_WRITE(0x26, RTC_FREQ_SELECT); - } - request_region(RTC_PORT(0), 0x10, "timer"); /* reserve rtc */ - - /* Turn off the PIT. */ - outb(0x36, 0x43); /* counter 0: system timer */ - outb(0x00, 0x40); - outb(0x00, 0x40); - - init_pit_rest(); -} - -/* This probably isn't Right, but it is what the old code did. */ -#if defined(CONFIG_RTC) -# define init_pit rtc_init_pit -#else -# define init_pit alpha_mv.init_pit -#endif - - void time_init(void) { @@ -230,7 +169,7 @@ unsigned int year, mon, day, hour, min, sec, cc1, cc2; /* Initialize the timers. */ - init_pit(); + /* init_pit(); */ /* * The Linux interpretation of the CMOS clock register contents: