[U-Boot] [PATCH 2/2 rev2] ep93xx: Refactoring of timer code

Matthias Kaehlcke matthias at kaehlcke.net
Thu Feb 25 20:47:46 CET 2010


Hi,

El Thu, Feb 25, 2010 at 08:22:59PM +0100 Alessandro Rubini ha dit:

> > i was/am working on a new version of the patch, taking into account
> > your remarks about the unit of TIMER_FREQ and fixing some issues
> > discussed with Alessandro Rubini off-list, who worked on a similar
> > patch.
> 
> Actually, I checked the point we disagreed about, which is the unit of
> get_ticks() and get_tbclk().  You currently return hw-ticks in
> get_ticks, and CONFIG_SYS_HZ (i.e. 1000) in get_tbclk.  However, these
> two functions are expected to be used together, so they must be
> consistent in their return value.

actually there is no disagreement between us, i totally agree with you
that the return value of get_ticks() should be in CONFIG_SYS_HZ
resolution and consistent with get_tbclk(). the patch i sent you
yesterday off-list fixes exactly this.

> It's true that the functions are little used (they are mostly used in
> ppc code, within cpu/*/interrupts), and that's why I didn't even
> provide them in cpu/arm926ejs/nomadik/timer.c. All few users assume
> they are consistent, but there is no documentation:
> 
>      tornado% grep -qr get_tbclk README* doc  || echo not found
>      not found
>      tornado% grep -qr get_ticks README* doc/* || echo not found
>      not found
> 
> I've made a quick tour of all definitions in cpu/ and here is the result.
> As you see, at91 (which you used as reference, I understand) is wrong,
> while all the others use either hwticks or SYS_HZ consistently.

yes, i used precisely at91 as reference, i liked it's code structure
and didn't notice that it is wrong in this point.

thanks for your research!

-- 
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

              We build too many walls and not enough bridges
                             (Isaac Newton)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-


More information about the U-Boot mailing list