Files
openbios/arch/ppc
Laurent Vivier e85a0d9bde PowerPC: Fix milliseconds prom call
The current implementation of the milliseconds prom call on PowerPC is
totally buggy:
- The timer frequency returned by get_timer_freq() does not correspond
  to the timer which is read.
- The dividend and the divisor of the division are swapped
- If called very often, this function is not precise
- Depending on the timer frequency and of the frequency of the calls,
  the variable overflow after a few dozen of seconds.

Please find in this patch a totally new implementation. This fixes the
problem observed with the quik when a timeout is defined.

The timer frequency is defined using #define, I wonder if there is a
better place to put it.

It reads both low and high part of the timer to make sure there is no
overflow. It also removes the function that returns 0 on the first call
as this is not needed according to IEEE 1275-1994. Finally it computes
the real value of the timer each time, instead of adding a small value
to a variable at each function calls, in order to get a correct
precision if this method is call very often.

(Aurelien Jarno)


git-svn-id: svn://coreboot.org/openbios/openbios-devel@407 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-14 23:25:41 +00:00
..
2008-12-20 14:48:40 +00:00
2008-12-13 09:26:41 +00:00
2008-12-20 14:48:40 +00:00
2009-01-14 23:25:41 +00:00
2008-12-13 09:26:41 +00:00
2008-12-20 17:15:47 +00:00