On Wed, 24 Mar 2010, Carl-Daniel Hailfinger wrote:
This cleanup is part 1/2 to make flashrom work with clang and unbreak
the delay calculation.
If the new style code is OK, I'll submit part 2/2 which makes heavy use
of the new style code to get timing accuracy of +-10% even in case of
CPU speed variations. Considering that the current code relies on the
dumbness of the optimizer in the C compiler and still manages to make
all delays twice as long as intended, I hope we can get the fixed code
in before 0.9.2.
Imo looks fine,
on one machine and nic3com i get
Calibrating delay loop... 95M loops per second, 10 myus = 23 us, 100 myus = 202 us, 1000
myus = 2042 us, 10000 myus = 20020 us, OK.
same machine but mainboard interface (internal)
Calibrating delay loop... 94M loops per second, 10 myus = 23 us, 100 myus = 199 us, 1000
myus = 1972 us, 10000 myus = 19784 us, OK.
still bit far from 10uS = 10myus
anyway i think it won't break anything
Acked-by: Maciej Pijanka <maciej.pijanka(a)gmail.com>
On 06.03.2010 04:28, Carl-Daniel Hailfinger wrote:
Note: This patch is the first step towards a
better delay loop
calibration which will work regardless of how smart the C compiler is.
Clean up code duplication and measure timing of 10/100/1000/10000 us delays.
Add copyright notices for my past and current work on this file.
If possible, please run the following command a few times and mail the
output to flashrom(a)flashrom.org
flashrom -V|grep delay
I don't fear computers, I fear lack of them -- Isaac Asimov