linux-mips
[Top] [All Lists]

Re: some questions about mips timer

To: Florian Fainelli <ffainelli@freebox.fr>
Subject: Re: some questions about mips timer
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 6 Mar 2012 21:27:12 +0100
Cc: loody <miloody@gmail.com>, Linux MIPS Mailing List <linux-mips@linux-mips.org>
In-reply-to: <160192556.459513.1331042510355.JavaMail.root@zmc>
References: <CANudz+ugY7NfCSGh-_kS4pzC91p02ZtYpxXMdCOKsM+spAt37g@mail.gmail.com> <160192556.459513.1331042510355.JavaMail.root@zmc>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
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.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>