
18 Apr
2013
18 Apr
'13
4:53 a.m.
Hi Simon,
On Thu, Apr 18, 2013 at 12:13 PM, Simon Glass sjg@chromium.org wrote:
While we don't want PCAT timers for timing, we want timer 2 so that we can still make a beep. Re-purpose the PCAT driver for this, and enable it in coreboot.
Signed-off-by: Simon Glass sjg@chromium.org
arch/x86/include/asm/u-boot-x86.h | 1 + arch/x86/lib/Makefile | 2 +- arch/x86/lib/pcat_timer.c | 69
++-------------------------------------
arch/x86/lib/tsc_timer.c | 6 +++- include/configs/coreboot.h | 1 + 5 files changed, 11 insertions(+), 68 deletions(-)
[snip]
-/* this is not very exact */ -void __udelay(unsigned long usec) -{
int counter;
int wraps;
if (timer_init_done) {
counter = read_pit();
wraps = usec / 1000;
usec = usec % 1000;
usec *= 1194;
usec /= 1000;
usec += counter;
while (usec > 1194) {
usec -= 1194;
wraps++;
}
while (1) {
int new_count = read_pit();
if (((new_count < usec) && !wraps) || wraps < 0)
break;
if (new_count > counter)
wraps--;
counter = new_count;
}
}
-}
This does not seem related...
Regards,
Graeme