linux-mips
[Top] [All Lists]

Re: [PATCH 06/18] MIPS: Netlogic: Get coremask from FUSE register

To: Jayachandran C <jchandra@broadcom.com>
Subject: Re: [PATCH 06/18] MIPS: Netlogic: Get coremask from FUSE register
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Tue, 15 Oct 2013 16:09:30 +0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <1381756874-22616-7-git-send-email-jchandra@broadcom.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1381756874-22616-1-git-send-email-jchandra@broadcom.com> <1381756874-22616-7-git-send-email-jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
Hello.

On 14-10-2013 17:21, Jayachandran C wrote:

Use the FUSE register to get the list of active cores in the CPU
instead of using the CPU reset register, this is the recommended
method.

Also add code to mask the coremask with the default number of cores
for each processor series.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
  arch/mips/netlogic/xlp/wakeup.c |   31 ++++++++++++++++++++++++++-----
  1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c
index 682d563..1011577 100644
--- a/arch/mips/netlogic/xlp/wakeup.c
+++ b/arch/mips/netlogic/xlp/wakeup.c
[...]
@@ -111,12 +111,33 @@ static void xlp_enable_secondary_cores(const cpumask_t 
*wakeup_mask)
                if (n != 0)
                        nlm_node_init(n);
                nodep = nlm_get_node(n);
-               syscoremask = nlm_read_sys_reg(nodep->sysbase, SYS_CPU_RESET);
+
+               fusemask = nlm_read_sys_reg(nodep->sysbase,
+                                       SYS_EFUSE_DEVICE_CFG_STATUS0);
+               switch (read_c0_prid() & 0xff00) {
+               case PRID_IMP_NETLOGIC_XLP3XX:
+                       mask = 0xf;
+                       break;
+               case PRID_IMP_NETLOGIC_XLP2XX:
+                       mask = 0x3;
+                       break;
+               case PRID_IMP_NETLOGIC_XLP8XX:
+                       mask = 0xff;
+                       break;
+               default:
+                       mask = 0xff;
+                       break;

   Why not merge the last 2 cases?

+               }

WBR, Sergei


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