[U-Boot] [PATCH] [Timer]Remove calls to [get, reset]_timer outside arch/

J. William Campbell jwilliamcampbell at comcast.net
Tue May 24 17:41:06 CEST 2011


On 5/23/2011 10:13 PM, Graeme Russ wrote:
> On Tue, May 24, 2011 at 7:02 AM, Graeme Russ<graeme.russ at gmail.com>  wrote:
>
> [snip]
>> Well, we have no control over the argument in cfi driver (unless you plan
>> to put #ifdef NIOS all over the place)
>>
>> Maybe we could round up the parameter inside get_timer() itself?
> Wow, what was I on! - Oh, thats right, no coffee ;)
>
> The parameter to get_timer() is not a timeout, it is a reference epoch
Hi Graeme,
        No, you were not on drugs.  If base != 0 then { if (timer - base 
< 20) return 0;  return timer - base -10} return timer.  That will make 
the subsequent comparison do what you wanted. Differences of less than 
20 are unreliable because of quantization, so we return
0. If the difference was > 20, return a conservative number, the 
difference -10. If the input base was 0, return the timer, the user is 
just trying to read it.

Best Regards
Bill Campbell
> So I think adding reset_timer() to the NIOS get_timer() when the parameter
> is zero is the only option
>
> Regards,
>
> Graeme
>
>



More information about the U-Boot mailing list