Subject: Re: changes to adb code?
To: Colin Wood <cwood@ichips.intel.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-mac68k
Date: 06/01/1999 14:36:44
On Tue, 01 Jun 1999 14:21:56 -0700 
 Jason Thorpe <thorpej@nas.nasa.gov> wrote:

 > So, in working kernel:
 > 
 > cpu: delay factor 355
 > 
 > In broken kernel:
 > 
 > cpu: delay factor 388
 > 
 > "Oh, that's COOL!"

Just peeked at the mac68k_calibrate_delay() routine... and it seems suspect.
Given the way it works, I could see how the different cache effects, etc. of
differently-sized kernels could have an effect on how well the delay_factor
is calibrated.

It should be fixed to not require an interrupt to be taken.  Basically, it
should do what the mvme68k/hp300 delay calibration routines do:

	1. start with a close-but-conservative delay_factor (one that will
	   cause a delay(1000) to expire too early).

	2. Program your hardware timer for 1ms.

	3. Start the timer.

	4. delay(1000).

	5. Look at the timer directly to see if the interval has expired.

		a. yes?  delay_factor calibrated properly.

		b. no?  adjust delay factor and try again.

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>