aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic/xlp/wakeup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/netlogic/xlp/wakeup.c')
-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 */