Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2001 11:54:23 +0200 (SAST)
From:      Zwane Mwaikambo <zwane@linux.realnet.co.sz>
To:        <freebsd-hackers@FreeBSD.org>
Subject:   [PATCH] Relevance of 8254 calibration.
Message-ID:  <Pine.LNX.4.33.0111251151240.28188-100000@netfinity.realnet.co.sz>

next in thread | raw e-mail | index | archive | help
I'd just like to know wether there are any i386 boxes which don't have a
timer_freq of  1193182Hz I know there might be slight variations but i
still have to come across a box that doesn't, which leads me to the
purpose of this email. Do we need to do the 8254 clock calibration?

One of the reasons for me delving in this particular code is because i've
got a box with a broken  mc146818A and it locks the box until timeout
occurs (currently set to 100000000), dropping timeout to 10 or something
much lower speeds up booting somewhat ;).

Any feedback (flames too ;) would be greatly appreciated

Thanks in advance,
	Zwane Mwaikambo

Please CC me as i'm not on the list.

Patch - add a "rtc_is_broken" variable NB. I've tried not to be too
intrusive here and only added the rtc_is_broken check where it affects
this specifc case. Diffed against 4.3-RELEASE

diff -crbB fbsd4.3-rel.orig/i386/include/clock.h fbsd4.3-rel.zm1/i386/include/clock.h
*** fbsd4.3-rel.orig/i386/include/clock.h	Sun Aug 19 21:39:26 2001
--- fbsd4.3-rel.zm1/i386/include/clock.h	Sun Nov 25 09:06:21 2001
***************
*** 21,26 ****
--- 21,27 ----
  extern int	timer0_max_count;
  extern u_int	tsc_freq;
  extern int	tsc_is_broken;
+ extern int	rtc_is_broken;
  extern int	wall_cmos_clock;
  #ifdef APIC_IO
  extern int	apic_8254_intr;
Only in fbsd4.3-rel.zm1/i386/isa: .clock.c.swp
diff -crbB fbsd4.3-rel.orig/i386/isa/clock.c fbsd4.3-rel.zm1/i386/isa/clock.c
*** fbsd4.3-rel.orig/i386/isa/clock.c	Sun Aug 19 21:41:08 2001
--- fbsd4.3-rel.zm1/i386/isa/clock.c	Sun Nov 25 09:24:48 2001
***************
*** 141,146 ****
--- 141,147 ----
  int	timer0_max_count;
  u_int	tsc_freq;
  int	tsc_is_broken;
+ int	rtc_is_broken = 0;
  int	wall_cmos_clock;	/* wall CMOS clock assumed if != 0 */

  static	int	beeping = 0;
***************
*** 591,596 ****
--- 592,601 ----

  	if (bootverbose)
  	        printf("Calibrating clock(s) ... ");
+
+ 	if (rtc_is_broken)
+ 		goto fail;
+
  	if (!(rtcin(RTC_STATUSD) & RTCSD_PWR))
  		goto fail;
  	timeout = 100000000;


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.33.0111251151240.28188-100000>