public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alessandro Rubini <rubini-list@gnudd.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2 rev2] ep93xx: Refactoring of timer code
Date: Thu, 25 Feb 2010 20:22:59 +0100	[thread overview]
Message-ID: <20100225192259.GA31347@morgana.gnudd.com> (raw)
In-Reply-To: <20100225181528.GA3628@darwin>

> 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.

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.


  source-file                    get_ticks()          get_tbclk

arm920t/at91/timer.c                 get_timer()      CONFIG_SYS_HZ
arm920t/a320/timer.c                 get_timer()      CONFIG_SYS_HZ
arm920t/s3c24x0/timer.c              hw-ticks         (I didn't understand)
arm920t/imx/timer.c                  get_timer()      CONFIG_SYS_HZ
arm920t/at91rm9200/timer.c           get_timer()      CONFIG_SYS_HZ
pxa/timer.c                          hw-ticks-32bits  TIMER_FREQ_HZ
arm_cortexa8/omap3/timer.c           get_timer()      CONFIG_SYS_HZ
arm_cortexa8/s5pc1xx/timer.c         get_timer()      CONFIG_SYS_HZ
arm925t/timer.c                      get_timer()      CONFIG_SYS_HZ
ppc4xx/cpu.c                         lib_ppc/ticks.S  freqProcessor
blackfin/interrupts.c                get_timer()      CONFIG_SYS_HZ
sa1100/timer.c                       get_timer()      CONFIG_SYS_HZ
mpc824x/cpu.c                        lib_ppc/ticks.S  bus_freq
mpc8xx/cpu.c                         lib_ppc/ticks.S  timebase
mpc512x/cpu.c                        lib_ppc/ticks.S  timebase
mpc5xxx/cpu.c                        lib_ppc/ticks.S  timebase
mpc8220/cpu.c                        lib_ppc/ticks.S  timebase
at32ap/interrupts.c                  hw-ticks         cpu_hz
mpc85xx/cpu.c                        lib_ppc/ticks.S  timebase
74xx_7xx/cpu.c                       lib_ppc/ticks.S  timebase
arm1136/omap24xx/timer.c             get_timer()      CONFIG_SYS_HZ
mpc86xx/cpu.c                        lib_ppc/ticks.S  timebase
mpc8260/cpu.c                        lib_ppc/ticks.S  timebase
arm926ejs/omap/timer.c               get_timer()      CONFIG_SYS_HZ
arm926ejs/davinci/timer.c            get_timer()      CONFIG_SYS_HZ
arm926ejs/versatile/timer.c          get_timer()      CONFIG_SYS_HZ
arm926ejs/at91/timer.c               hwticks          CONFIG_SYS_HZ
arm926ejs/spear/timer.c              hwticks          CONFIG_SYS_HZ
arm1176/s3c64xx/timer.c              hwrticks         (I didn't understand)
lh7a40x/timer.c                      get_timer        (I didn't understand)
mpc5xx/cpu.c                         lib_ppc/ticks.S  timebase

/alessandro

  reply	other threads:[~2010-02-25 19:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7ee75976e78e2f82b4163fe1ff4233a850d4393c.1266966938.git.matthias@kaehlcke.net>
2010-02-23 23:22 ` [U-Boot] [PATCH 2/2 rev2] ep93xx: Refactoring of timer code Matthias Kaehlcke
2010-02-25 15:54   ` Tom
2010-02-25 18:15     ` Matthias Kaehlcke
2010-02-25 19:22       ` Alessandro Rubini [this message]
2010-02-25 19:47         ` Matthias Kaehlcke
2010-02-26  0:13       ` Tom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100225192259.GA31347@morgana.gnudd.com \
    --to=rubini-list@gnudd.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox