All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Florian Fainelli <ffainelli@freebox.fr>,
	loody <miloody@gmail.com>,
	Linux MIPS Mailing List <linux-mips@linux-mips.org>
Subject: Re: some questions about mips timer
Date: Tue, 06 Mar 2012 12:33:44 -0800	[thread overview]
Message-ID: <4F5674A8.3040605@gmail.com> (raw)
In-Reply-To: <20120306202712.GM4519@linux-mips.org>

On 03/06/2012 12:27 PM, Ralf Baechle wrote:
> On Tue, Mar 06, 2012 at 03:01:50PM +0100, Florian Fainelli wrote:
>
>>> hi all:
>>> I have some questions about mips_hpt_frequency:
>>> 1. is mips_hpt_frequency == mips cpu frequency?
>>
>> No, it is usually cpu frequency / 2.
>
> The architecture specification leaves the counter clock rate up up to the
> implementation and only says the clock rate is a function of the pipeline
> clock.  In all reality this means the counter is running at the full or
> half frequency.  Just don't build on it,
>
>    clock := pipeline_clock * next_weeks_lottery_number % 42
>
> would by compliant ;-)
>
> On some CPUs the frequency can even be selected through a configuration
> bitstream at reset time so you can't always count on a fixed relation
> between CPU clock and count rate.
>
> Some older CPU manuals contain a confusing wording saying the counter
> increments at half (or full) instruction issue rate.  That just means the
> pipeline clock, no reason to be confused.
>

If you have a v2 or later ISA, you can use 'rdhwr x, $3' to find the 
ratio between the clock rate and the increment rate of the timer.

David Daney

      reply	other threads:[~2012-03-06 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 13:48 some questions about mips timer loody
2012-03-06 14:01 ` Florian Fainelli
2012-03-06 20:27   ` Ralf Baechle
2012-03-06 20:33     ` David Daney [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=4F5674A8.3040605@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=ffainelli@freebox.fr \
    --cc=linux-mips@linux-mips.org \
    --cc=miloody@gmail.com \
    --cc=ralf@linux-mips.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 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.