linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Mark A. Greer" <mgreer@mvista.com>
To: Daniel Ann <ktdann@gmail.com>
Cc: linuxppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: Best way to determine tb_ticks_per_jiffy inside todc_calibrate_decr()
Date: Mon, 11 Apr 2005 11:39:05 -0700	[thread overview]
Message-ID: <425AC449.4070401@mvista.com> (raw)
In-Reply-To: <9b7ca6570504081829cb84a7d@mail.gmail.com>

Daniel Ann wrote:

>On Apr 9, 2005 3:32 AM, Mark A. Greer <mgreer@mvista.com> wrote:
>  
>

>>Also, 33MHz does not sound right but then you don't say what processor
>>you're using so who knows.  You need to find the bus freq used by the
>>cpu/system.  Try looking for the freq of the processor's SYSCLK input.
>>Then you probably have to divide that by 4 to get the frequency that the
>>decrementer runs at.  That's the value that you should use for the
>>'freq' variable in the example code you included in your email.
>>    
>>
>
>Okay guess I had all these things mixed up in head. What I should have
>said is, source to PCI_SYNC_IN is 33MHz.
>

Ah, that sounds reasonable.  ;)

>Anyway, following the MPC8245 hardware Spec pdf file, I was able to
>find the peripheral logic/memory bus clock to be 99,000,000. Dividing
>that by 4 like you said, gave me the value of 24,750,000. Which is
>I've used it to get very real 1 second :)
>

Cool.

>
>BTW, why do you have to divide it by 4 ?
>

Because the internally kept time in ppc linux is based on the 
decrementer counter and, according to the manual for the 8245, the 
decrementer counter is decremented once every four sys_logic_clk 
cycles.  Therefore, you need to divide by 4.

Mark

  reply	other threads:[~2005-04-11 18:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08  8:45 Best way to determine tb_ticks_per_jiffy inside todc_calibrate_decr() Daniel Ann
2005-04-08 18:32 ` Mark A. Greer
2005-04-09  1:29   ` Daniel Ann
2005-04-11 18:39     ` Mark A. Greer [this message]
2005-04-12  3:55       ` Daniel Ann

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=425AC449.4070401@mvista.com \
    --to=mgreer@mvista.com \
    --cc=ktdann@gmail.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).