From owner-freebsd-i386@FreeBSD.ORG Mon Jun 11 08:53:12 2007 Return-Path: X-Original-To: freebsd-i386@FreeBSD.org Delivered-To: freebsd-i386@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82EA816A469 for ; Mon, 11 Jun 2007 08:53:12 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [83.98.131.211]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD0D13C457 for ; Mon, 11 Jun 2007 08:53:12 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id A2CDA1CC5A; Mon, 11 Jun 2007 10:37:45 +0200 (CEST) Date: Mon, 11 Jun 2007 10:37:45 +0200 From: Ed Schouten To: Bruce Evans Message-ID: <20070611083745.GL89502@hoeg.nl> References: <20070610201813.B11831CCB7@palm.hoeg.nl> <20070611132137.G7222@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UK1lfQXsnwKrySH9" Content-Disposition: inline In-Reply-To: <20070611132137.G7222@besplex.bde.org> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-i386@FreeBSD.org Subject: Re: i386/113540: decrease i8254 calibration precision to make it work with Xbox, remove warnings X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 08:53:12 -0000 --UK1lfQXsnwKrySH9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Bruce, * Bruce Evans wrote: > On Sun, 10 Jun 2007, Ed Schouten wrote: > [...] > > - It decreases the precision of the timer (by default disabled) timer > > calibration code from 1% to 10%; this is needed because the Xbox clock > > is 6% off. >=20 > Is it only 6% off because the default is 6% off? The error margin is > supposed to be just a sanity check, but if the i8254 clock frequency is > not required to be nearly 1193182 then this frequency can be almost > anything in theory and no sanity check works. On all Xboxes it's 6% off. > > - It removes the hardcoded Xbox timer value from the Xbox configuration > > file and enables timer calibration. >=20 > I hope to remove the timer calibration. It was mainly for RTC calibrati= on, > but that most important part of it has been axed. In practice, the i8254 > has always been nearly 1193182 until now, with an error of about the same > as for the RTC, so it doesn't matter which of these is used as a referen= ce. > What I do now is not worry much about initial calibration; then fix up > the frequencies of all timecounters in /etc/rc.local, using the results > of more accurate calibrations previously done in userland. Unfortunatel= y, > this requires a lot of setup (ntpd might be able to do it automatically > but might take years to stabilize if the initial frequencies are very > inaccurate). So what do you think about this patch: http://g-rave.nl/junk/freebsd-xbox-clock.diff We don't depend on the calibration code anymore, but just set the new standard timer frequency in i8254_init(). It doesn't touch any existing code outside ifdef's. > [...] >=20 > Does XBOX have any other timers/timecounters that might give a more > suitable reference? As far as I know, they don't. Xbox'es don't have ACPI, so that means we can't use things like the HPET. The only two counters that show up are: | Timecounter "i8254" frequency 1124993 Hz quality 0 | Timecounter "TSC" frequency 733333526 Hz quality 800 Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --UK1lfQXsnwKrySH9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGbQnZ52SDGA2eCwURAjusAJ40D7F3tPhMxF1ni5h5T+/Klmj+VQCfdfPp WD/ujL8P1cNxUZxUHI6ThM4= =ndy0 -----END PGP SIGNATURE----- --UK1lfQXsnwKrySH9--