From owner-freebsd-current Tue Nov 17 09:49:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA13809 for freebsd-current-outgoing; Tue, 17 Nov 1998 09:49:43 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from home.dragondata.com (home.dragondata.com [204.137.237.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA13798 for ; Tue, 17 Nov 1998 09:49:41 -0800 (PST) (envelope-from toasty@home.dragondata.com) Received: (from toasty@localhost) by home.dragondata.com (8.8.8/8.8.5) id LAA28243; Tue, 17 Nov 1998 11:39:24 -0600 (CST) From: Kevin Day Message-Id: <199811171739.LAA28243@home.dragondata.com> Subject: Re: MediaGX and calcru: negative time In-Reply-To: <199811171122.UAA01911@lavender.sanpei.org> from MIHIRA Yoshiro at "Nov 17, 98 08:22:10 pm" To: sanpei@sanpei.org (MIHIRA Yoshiro) Date: Tue, 17 Nov 1998 11:39:23 -0600 (CST) Cc: current@FreeBSD.ORG, sanpei@sanpei.org, cjohnson@netgsi.com X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I can confirm that this patch works: Copyright (c) 1992-1998 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 3.0-RELEASE #3: Tue Nov 24 17:38:30 CST 1998 devel@kevin1.touchmaster:/usr/src/sys/compile/DEVEL Calibrating clock(s) ... TSC clock: 233902340 Hz, i8254 clock: 1217245 Hz 1217245 Hz differs from default of 1193182 Hz by more than 1% Timecounter "i8254" frequency 1193182 Hz cost 1302 ns Timecounter "TSC" frequency 233864996 Hz cost 180 ns CPU: Cyrix GXm (233.86-MHz 586-class CPU) Origin = "CyrixInstead" Id = 0x540 Stepping=0 DIR=0x3346 Features=0x808131 I'm going to file a errata report with Cyrix.... Kevin > > I have MediaGX box. I install 2.2.6R. I also have this problem..... > But my problem is only calcru, and can't detect psm0(PS/2) port. > Sometimes can't detect Ethernet Card(occasionally automatically rebooted...). > > This problem (I think) already reported to GNATS Problem repository, > kern/6630[1] which is included experimental patch. Please apply this patch. > This Patch is ``check timer twice, and use larger one at getit:clock.c''. > > Another person who has also MediaGX box, reported me that > his MediaGX box is needed 4 times to detect correct one. > > I had planning to report this problem to GNATS Database and Mr Christopher > T. Johnson. > > [1] kern/6630: Fix for Cyrix I8254 bug > http://www.freebsd.org/cgi/query-pr.cgi?pr=6630 > > Thank you > MIHIRA Yoshiro > > ----- > 4times patch > --- /sys/i386/isa/clock.c Sun Apr 27 22:44:19 1997 > +++ ./clock.c Mon Nov 2 17:01:55 1998 > @@ -345,7 +345,9 @@ > { > u_long ef; > int high, low; > - > +#ifdef CPU_CYRIX_NO_I8254_LATCH > + int ret1, ret2, ret3, ret4; > +#endif > ef = read_eflags(); > disable_intr(); > > @@ -354,9 +356,32 @@ > > low = inb(TIMER_CNTR0); > high = inb(TIMER_CNTR0); > +#ifdef CPU_CYRIX_NO_I8254_LATCH > + ret1 = (high << 8) | low; > > + outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); > + low = inb(TIMER_CNTR0); > + high= inb(TIMER_CNTR0); > + ret2 = (high << 8) | low; > + > + outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); > + low = inb(TIMER_CNTR0); > + high= inb(TIMER_CNTR0); > + ret3 = (high << 8) | low; > + > + outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); > + low = inb(TIMER_CNTR0); > + high= inb(TIMER_CNTR0); > + ret4 = (high << 8) | low; > +#endif > write_eflags(ef); > +#ifdef CPU_CYRIX_NO_I8254_LATCH > + ret1 = (ret1 > ret2 ? ret1 : ret2); > + ret3 = (ret3 > ret4 ? ret3 : ret4); > + return (ret1 > ret3 ? ret1 : ret3); > +#else > return ((high << 8) | low); > +#endif > } > > /* > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message