Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 1998 11:39:23 -0600 (CST)
From:      Kevin Day <toasty@home.dragondata.com>
To:        sanpei@sanpei.org (MIHIRA Yoshiro)
Cc:        current@FreeBSD.ORG, sanpei@sanpei.org, cjohnson@netgsi.com
Subject:   Re: MediaGX and calcru: negative time
Message-ID:  <199811171739.LAA28243@home.dragondata.com>
In-Reply-To: <199811171122.UAA01911@lavender.sanpei.org> from MIHIRA Yoshiro at "Nov 17, 98 08:22:10 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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<FPU,TSC,MSR,CX8,CMOV,MMX>



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811171739.LAA28243>