[U-Boot] [PATCH] sa1100 change get_timer(base) to return time since base

Andrew Dyer amdyer at gmail.com
Wed Jun 23 00:09:19 CEST 2010


On Tue, Jun 22, 2010 at 4:29 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Jochen Friedrich,
>
> In message <1274031318-22876-1-git-send-email-jochen at scram.de> you wrote:
>> similar to 274737e5eb25b2bcd3af3a96da923effd543284f
>>
>> This patch changes get_timer() for sa1100 to return the time since
>> 'base' instead of the time since the counter was at zero.
>>
>> Symptom seen is flash timeout errors when erasing or programming a
>> sector using the common cfi flash code.
>>
>> Signed-off-by: Jochen Friedrich <jochen at scram.de>
>> ---
>>  arch/arm/cpu/sa1100/timer.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
>> index 0207501..aea90ab 100644
>> --- 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.

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?


More information about the U-Boot mailing list