linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Ann <ktdann@gmail.com>
To: linuxppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Best way to determine tb_ticks_per_jiffy inside todc_calibrate_decr()
Date: Fri, 8 Apr 2005 17:45:22 +0900	[thread overview]
Message-ID: <9b7ca65705040801455b84eb0d@mail.gmail.com> (raw)

Hey folks,

I seem to have problem getting 1 second right. Board has no RTC so
I've basically NULLed all the todc_XXX functions except
todc_calibrate_decr.

Now question is, what value should I be assigning it to tb_ticks_per_jiffy ?

I was able to dig up some info from the archive, and it read,
=-=-=-FROM ARCHIVE =-=-=-
You must find this value by yourself but a good starting point is your
frequency in Hz (I think)
Example of the code
	unsigned int freq = 28000000;
	tb_tick_per_jiffy = freq/HZ;
	tb_to_us = mulhwu_scale_factor(freq,1000000);
=-=-=-END OF ARCHIVE =-=-=-

I'm fine with working it out myself but where do I start ? My board
has 33MHz OSC, so I've trie freq = 33 * 1000000 (where HZ is defined
100) but it turned out to be little short. I could have just tried few
more trial and error, but I prefer knowing what I'm doing so.. :)

Before I was trying it with 100 * 1000000 which had delays like 10:1.
Now its only about 1.5:1. So, I guess I'm on the right track.... so
can anyone please help me out here?

Also, could anyone spill their brain on mulhwu_scale_factor() ? I've
followed the code and ended up reading what seems to be a assembler.
(Should have paid attention during the lectures :P) Any hint on this ?

Thanks heaps..
Cheers,

-- 
Daniel

             reply	other threads:[~2005-04-08  8:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08  8:45 Daniel Ann [this message]
2005-04-08 18:32 ` Best way to determine tb_ticks_per_jiffy inside todc_calibrate_decr() Mark A. Greer
2005-04-09  1:29   ` Daniel Ann
2005-04-11 18:39     ` Mark A. Greer
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=9b7ca65705040801455b84eb0d@mail.gmail.com \
    --to=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).