aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2013-12-21 06:22:18 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-24 16:39:47 -0500
commitdb038feedd9a5c83851d2f5aa6a84ff800da8ccb (patch)
treea7ee7db1a8e217221acdf10571c7a542d2a19b73
parentcfec4c63f5034160ab4a4654c05dd6241f51b282 (diff)
MIPS: Netlogic: Get coremask from FUSE register
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> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6275/
-rw-r--r--arch/mips/netlogic/xlp/wakeup.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c
index 682d5638dc01..e6f77c053658 100644
--- a/arch/mips/netlogic/xlp/wakeup.c
+++ b/arch/mips/netlogic/xlp/wakeup.c
@@ -99,7 +99,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
99{ 99{
100 struct nlm_soc_info *nodep; 100 struct nlm_soc_info *nodep;
101 uint64_t syspcibase; 101 uint64_t syspcibase;
102 uint32_t syscoremask; 102 uint32_t syscoremask, mask, fusemask;
103 int core, n, cpu; 103 int core, n, cpu;
104 104
105 for (n = 0; n < NLM_NR_NODES; n++) { 105 for (n = 0; n < NLM_NR_NODES; n++) {
@@ -111,12 +111,31 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
111 if (n != 0) 111 if (n != 0)
112 nlm_node_init(n); 112 nlm_node_init(n);
113 nodep = nlm_get_node(n); 113 nodep = nlm_get_node(n);
114 syscoremask = nlm_read_sys_reg(nodep->sysbase, SYS_CPU_RESET); 114
115 fusemask = nlm_read_sys_reg(nodep->sysbase,
116 SYS_EFUSE_DEVICE_CFG_STATUS0);
117 switch (read_c0_prid() & 0xff00) {
118 case PRID_IMP_NETLOGIC_XLP3XX:
119 mask = 0xf;
120 break;
121 case PRID_IMP_NETLOGIC_XLP2XX:
122 mask = 0x3;
123 break;
124 case PRID_IMP_NETLOGIC_XLP8XX:
125 default:
126 mask = 0xff;
127 break;
128 }
129
130 /*
131 * Fused out cores are set in the fusemask, and the remaining
132 * cores are renumbered to range 0 .. nactive-1
133 */
134 syscoremask = (1 << hweight32(~fusemask & mask)) - 1;
135
115 /* The boot cpu */ 136 /* The boot cpu */
116 if (n == 0) { 137 if (n == 0)
117 syscoremask |= 1;
118 nodep->coremask = 1; 138 nodep->coremask = 1;
119 }
120 139
121 for (core = 0; core < NLM_CORES_PER_NODE; core++) { 140 for (core = 0; core < NLM_CORES_PER_NODE; core++) {
122 /* we will be on node 0 core 0 */ 141 /* we will be on node 0 core 0 */