[PATCH 2/3] plat-nomadik: Added suspend/resume support for MTU timer.
Alessandro Rubini
rubini-list at gnudd.com
Fri Sep 3 07:49:00 EDT 2010
Linus about the prescaler on the Nomadik MTU:
> That comes from Alessandros oneshot mode a while back actually,
> Jonas is only factoring it around.
Yes. 8815 has 2.5MHz and the U8500 had 110MHz according to this line:
>>> - * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:
Now changed to:
>>> + * Tick rate is 2.4MHz for Nomadik and 100 or 133MHz for ux5
So I chose to add a prescaler if the frequency is too high. A
non-prescaled 110MHz overflows in 39 seconds. But the threshold is
subjective. I think I choise ~16MHz to have no more than 1usec per
tick, for timeevent precision.
Russell:
>> n << 20 doesn't give you MHz, so this code doesn't match the comments.
>> Do you mean 16MHz or 16.777216MHz ?
Well, it's not really important which one. But the comment is wrong,
my fault.
> Alessandro why do we kick in a prescaler if rate > (16 << 20)?
> Seems weird to me too when I look at it, more like it'd be
> if rate (1 << 20) which makes sense, if the counter will flip
> around 20 bits in 1 second we prescale it by 16.
Your "makes sense" is as subjective as mine. But on 8815, with 2.4MHz
we overflow in around 1790 seconds. I feel it reasonable. If you
prescale we get at 150kHz, which is 6.6 usec per tick: I don't like
that figure too much.
/alessandro
More information about the linux-arm-kernel
mailing list