
Dear Andrew,
In message AANLkTim48UHND2wg0jCqs-EIZ2T_CGV-DUVatPzh6h6l@mail.gmail.com you wrote:
--- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -41,7 +41,7 @@ void reset_timer (void)
ulong get_timer (ulong base) {
return get_timer_masked ();
return get_timer_masked () - base;
This patch is wrong. The get_timer() code is as it was designed to be. If it is causing problems, then the caller must be fixed.
Hmmm. I put the same patch in a long time ago for imx for the same reason. http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/45922 Looking at some other arm timer implementations they do it the same way.
Hm... ouch...
Guess this needs fixing.
I see the cfi_flash code now has reset_timer calls sprinkled through it that should make the base offset functionality in the timer mostly a nop (assuming it's implemented). Maybe the OP has old cfi_flash code?
Well, "sprinkled" - I see exactly two such calls. And I think these are only needed because the implementer did not understand the concept of how to implement a timeout using unsigned arithmentic in a way that works even when the timer wraps around.
Best regards,
Wolfgang Denk