linux-mips
[Top] [All Lists]

Re: some questions about mips timer

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: some questions about mips timer
From: David Daney <ddaney.cavm@gmail.com>
Date: Tue, 06 Mar 2012 12:33:44 -0800
Authentication-results: mr.google.com; spf=pass (google.com: domain of ddaney.cavm@gmail.com designates 10.60.4.106 as permitted sender) smtp.mail=ddaney.cavm@gmail.com; dkim=pass header.i=ddaney.cavm@gmail.com
Cc: Florian Fainelli <ffainelli@freebox.fr>, loody <miloody@gmail.com>, Linux MIPS Mailing List <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5ABuA5uQ3aS3SpgjTH4heFBWxsxfvaTPNSJAg3xjWYg=; b=nbHIo2Wig7ojbruPhzlNGXgtIVfN8dWhhuCWxVr/IF/8EXnfPJ4repAaonxE/275zE io63HM+huhCRHQtR7EUucvE8zO+coAu3SnypJiYP2yLMP7LxEZ4ADpgweFXhJVSFw4/3 4Nf4zu4YQSfDmQf4ThBVVhTDAcvru9/S1LATyZF/ofC3DcwowBVoZquP3isEPZQRi+pS MpzoR04LPVMsCLXut5N9MVTomq3VZw84cYa7OrLSiTHOToAW6OvvDyOZ4QkkBSjXVtYs 3sc8TUK39YiyDhAThgu62ewnE62uHY/FIbo9W7JVl8gBEEY6CilChsZC+i2YpQHBxsu3 pGEA==
In-reply-to: <20120306202712.GM4519@linux-mips.org>
References: <CANudz+ugY7NfCSGh-_kS4pzC91p02ZtYpxXMdCOKsM+spAt37g@mail.gmail.com> <160192556.459513.1331042510355.JavaMail.root@zmc> <20120306202712.GM4519@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
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


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