linux-mips
[Top] [All Lists]

Re: [PATCH 08/14] MIPS: Octeon: Scale Octeon2 clocks in octeon_init_cvm

To: David Daney <ddaney@caviumnetworks.com>
Subject: Re: [PATCH 08/14] MIPS: Octeon: Scale Octeon2 clocks in octeon_init_cvmcount()
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Fri, 08 Oct 2010 14:36:23 +0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <1286492633-26885-9-git-send-email-ddaney@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1286492633-26885-1-git-send-email-ddaney@caviumnetworks.com> <1286492633-26885-9-git-send-email-ddaney@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
Hello.

On 08-10-2010 3:03, David Daney wrote:

The per-CPU clocks are synchronized from IPD_CLK_COUNT, on cn63XX it
must be scaled by the clock frequency ratio.

Signed-off-by: David Daney<ddaney@caviumnetworks.com>
[...]

diff --git a/arch/mips/cavium-octeon/csrc-octeon.c 
b/arch/mips/cavium-octeon/csrc-octeon.c
index b6847c8..c85a681 100644
--- a/arch/mips/cavium-octeon/csrc-octeon.c
+++ b/arch/mips/cavium-octeon/csrc-octeon.c
[...]
@@ -33,8 +49,20 @@ void octeon_init_cvmcount(void)
         * Loop several times so we are executing from the cache,
         * which should give more deterministic timing.
         */
-       while (loops--)
-               write_c0_cvmcount(cvmx_read_csr(CVMX_IPD_CLK_COUNT));
+       while (loops--) {
+               u64 ipd_clk_count = cvmx_read_csr(CVMX_IPD_CLK_COUNT);
+               if (rdiv != 0) {
+                       ipd_clk_count = ipd_clk_count * rdiv;

   Why not:

                        ipd_clk_count *= rdiv;

WBR, Sergei

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