All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn <shawnxjin@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] CFG_HZ and get_timer() issue
Date: Fri, 15 Oct 2004 16:01:43 -0700	[thread overview]
Message-ID: <c3d0340b04101516017ab281a5@mail.gmail.com> (raw)
In-Reply-To: <20041014211001.F02C4C1430@atlas.denx.de>

Wolfgang,

> > Flash write gets stuck in while loop if there is a real problem. It
> > may be other factor(s) that cause this problem. For example, timer is
> > not accurate?
> 
> This is one  possible  explanation.  Check  timer  implementation.  I
> noticed  that  quite  a  lot  of  boards use insane values of CFG_HZ.
> Remember that this should be the  number  of  clock  ticks  (=  timer
> interrupts)  per  second,  and  there  is  usually no reason to chose
> anything else but the default value of 1000.  Many  boards  use  some
> much,  much  higher  clock  values instead. This should be fixed. [We
> recently fixed this for AT91RM9200 systems.]

It seems that people easily get confused about what CFG_HZ should be.
A grep of CFG_HZ finds that many ARM boards (of course, some other
boards) don't interpret CFG_HZ or clock ticks in the way as you did
above. Studying your fix for AT91RM9200 systems finds out your newly
introduced get_timer_raw() function. So now we have a few functions
get_timer(), get_timer_masked(), and get_timer_raw(). I noticed that
some people called get_timer_masked() directly and other used
get_timer() in a loop to determine the timeout of some actions.

Shall we have a rule to guide where and when these functions should be used?

To my understanding based on your fix for AT91RM9200 systems,
1. get_timer_maksed() should return the number of clock ticks, just as
get_ticks().
2. get_timer_raw() returns the value of timestamp, which counts how
many clocks elapse according to the timer's setting. It'a local
function and should not be called in any other modules.

Regards,
-Shawn.

  reply	other threads:[~2004-10-15 23:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-14 13:43 [U-Boot-Users] ARM VersatilePB - Fixed flash support Philippe Robin
2004-10-14 16:51 ` Shawn
2004-10-14 21:09   ` Wolfgang Denk
2004-10-15 23:01     ` Shawn [this message]
2005-01-12  0:33       ` [U-Boot-Users] CFG_HZ and get_timer() issue Wolfgang Denk

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=c3d0340b04101516017ab281a5@mail.gmail.com \
    --to=shawnxjin@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.