mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 20:58:22 +00:00
x86: Avoid timer-clock overflow
When the clock speed is above about 4GHz, e.g. on modern PC hardware, the timer overflows, resulting in a much lower frequency than expected. Deal with this by capping the clock speed. It would be possible to move to a 64-bit value for the clock, but that is a pain to deal with. A better approach might be to express the clock in MHz but that is left for later consideration. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3b2e4f542e
commit
7c0f70b65b
1 changed files with 1 additions and 0 deletions
|
@ -442,6 +442,7 @@ static void tsc_timer_ensure_setup(bool early)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
fast_calibrate = min(fast_calibrate, 4000UL);
|
||||||
if (!gd->arch.clock_rate)
|
if (!gd->arch.clock_rate)
|
||||||
gd->arch.clock_rate = fast_calibrate * 1000000;
|
gd->arch.clock_rate = fast_calibrate * 1000000;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue