public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm925t: Fix CONFIG_SYS_HZ to 1000
Date: Wed, 22 Apr 2009 01:13:26 +0200	[thread overview]
Message-ID: <20090421231326.GB2878@localhost.localdomain> (raw)
In-Reply-To: <49EDE86D.1010806@googlemail.com>

On Tue, Apr 21, 2009 at 05:38:21PM +0200, Dirk Behme wrote:
> Ladislav Michl wrote:
>> On Mon, Apr 20, 2009 at 08:27:34PM +0200, Dirk Behme wrote:
>>> Just to get an idea of the math:
>>>
>>> CONFIG_SYS_CLK_FREQ is 12000000 (12MHz)? This is divided by 256, so   
>>> TIMER_CLOCK is 46875Hz? A free running 32-bit count down timer is 
>>> used  starting at 0xffffffff? Underflow (0) is reached after ~91626s 
>>> ==  ~25hours with this?
>>>
>>> Please correct if something is wrong ;)
>>
>> Math is perfectly correct, except in my case CONFIG_SYS_CLK_FREQ is 150MHz,
>> so resolution is actually 12.5 times better. 
>
> Ok. Is this 150MHz defined in one of the configs you modify with this  
> patch or do you use a custom config? Just curious ;)

All three 32-bit counters receive a dedicated clock from clock generator
module 1 (either CLKIN or DPLL1 output). You will find CONFIG_SYS_CLK_FREQ
defined to be 150000000 in include/configs/netstar.h and code in
board/netstar/setup.S selects DPLL1 as a clock source (and you'll probably
notice that netstar's lowlevel_init code looks different from all others just
because it was not copied, but written from scratch long before its author
even explored u-boot's existence, so take care when copying anything from
netstar's config file as it handles low level init different way).

>> Perhaps I should modify those
>> boards wich uses 12MHz clock to use smaller divisor, 
>
> Yes, this should be easily doable by changing CONFIG_SYS_PTV.

Yes, I'll send updated patch.

[snip]
>> Right, but the key point here is to unbind udelay from get_timer as now
>> get_timer works with miliseconds resolution.
>
> I hope I got it right with the updated patch sent some minutes ago.

Yes, that one looks definitely better (although I have no way to test it).

	ladis

      reply	other threads:[~2009-04-21 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 19:07 [U-Boot] [PATCH] arm925t: Fix CONFIG_SYS_HZ to 1000 Ladislav Michl
2009-04-20 17:38 ` Dirk Behme
2009-04-20 22:32   ` Ladislav Michl
2009-04-20 18:27 ` Dirk Behme
2009-04-20 22:31   ` Ladislav Michl
2009-04-21 15:38     ` Dirk Behme
2009-04-21 23:13       ` Ladislav Michl [this message]

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=20090421231326.GB2878@localhost.localdomain \
    --to=ladis@linux-mips.org \
    --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