linux-mips
[Top] [All Lists]

[PATCH 09/15] MIPS: Netlogic: Pass cpuid to early_init_secondary

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 09/15] MIPS: Netlogic: Pass cpuid to early_init_secondary
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Wed, 31 Oct 2012 18:31:35 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <cover.1351688140.git.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>
References: <cover.1351688140.git.jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
The cpuid was not passed into early_init_secondary even though the
comment indicated that it will be. Fix this.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 arch/mips/netlogic/common/smp.c     |    2 +-
 arch/mips/netlogic/common/smpboot.S |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c
index fab316d..cd39f54 100644
--- a/arch/mips/netlogic/common/smp.c
+++ b/arch/mips/netlogic/common/smp.c
@@ -98,7 +98,7 @@ void nlm_early_init_secondary(int cpu)
        change_c0_config(CONF_CM_CMASK, 0x3);
        write_c0_ebase((uint32_t)nlm_common_ebase);
 #ifdef CONFIG_CPU_XLP
-       if (hard_smp_processor_id() % 4 == 0)
+       if (cpu % 4 == 0)
                xlp_mmu_init();
 #endif
 }
diff --git a/arch/mips/netlogic/common/smpboot.S 
b/arch/mips/netlogic/common/smpboot.S
index 25c1825..a0b7487 100644
--- a/arch/mips/netlogic/common/smpboot.S
+++ b/arch/mips/netlogic/common/smpboot.S
@@ -186,7 +186,7 @@ EXPORT(nlm_boot_siblings)
        * jump to the secondary wait function.
        */
        mfc0    v0, CP0_EBASE, 1
-       andi    v0, 0x7f                /* v0 <- node/core */
+       andi    v0, 0x3ff               /* v0 <- node/core */
 
        /* Init MMU in the first thread after changing THREAD_MODE
         * register (Ax Errata?)
@@ -263,6 +263,8 @@ NESTED(nlm_boot_secondary_cpus, 16, sp)
        PTR_L   gp, 0(t1)
 
        /* a0 has the processor id */
+       mfc0    a0, CP0_EBASE, 1
+       andi    a0, 0x3ff               /* a0 <- node/core */
        PTR_LA  t0, nlm_early_init_secondary
        jalr    t0
        nop
-- 
1.7.9.5



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