Date: Mon, 11 Jun 2007 10:37:45 +0200 From: Ed Schouten <ed@fxq.nl> To: Bruce Evans <brde@optusnet.com.au> 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 Message-ID: <20070611083745.GL89502@hoeg.nl> In-Reply-To: <20070611132137.G7222@besplex.bde.org> References: <20070610201813.B11831CCB7@palm.hoeg.nl> <20070611132137.G7222@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--UK1lfQXsnwKrySH9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Bruce, * Bruce Evans <brde@optusnet.com.au> 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 <ed@fxq.nl> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070611083745.GL89502>