diff options
author | Jayachandran C <jchandra@broadcom.com> | 2013-12-21 06:22:26 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-01-24 16:39:49 -0500 |
commit | 98d4884ca55883e8b16180bd969a8bccaa885c80 (patch) | |
tree | ca7424268b4ef49d1472895bf2bb50d57b38d4fe /arch/mips/netlogic/xlp | |
parent | e7aa6c66b0acc34caba3af485f1a039bfa8aef07 (diff) |
MIPS: Netlogic: Add cpu to node mapping for XLP9XX
XLP9XX has 20 cores per node, opposed to 8 on earlier XLP8XX.
Update code that calculates node id from cpu id to handle this.
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6283/
Diffstat (limited to 'arch/mips/netlogic/xlp')
-rw-r--r-- | arch/mips/netlogic/xlp/setup.c | 5 | ||||
-rw-r--r-- | arch/mips/netlogic/xlp/wakeup.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c index 310d88a82abe..2a39bbeb45b0 100644 --- a/arch/mips/netlogic/xlp/setup.c +++ b/arch/mips/netlogic/xlp/setup.c | |||
@@ -51,6 +51,7 @@ uint64_t nlm_io_base; | |||
51 | struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; | 51 | struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; |
52 | cpumask_t nlm_cpumask = CPU_MASK_CPU0; | 52 | cpumask_t nlm_cpumask = CPU_MASK_CPU0; |
53 | unsigned int nlm_threads_per_core; | 53 | unsigned int nlm_threads_per_core; |
54 | unsigned int xlp_cores_per_node; | ||
54 | 55 | ||
55 | static void nlm_linux_exit(void) | 56 | static void nlm_linux_exit(void) |
56 | { | 57 | { |
@@ -154,6 +155,10 @@ void __init prom_init(void) | |||
154 | void *reset_vec; | 155 | void *reset_vec; |
155 | 156 | ||
156 | nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); | 157 | nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); |
158 | if (cpu_is_xlp9xx()) | ||
159 | xlp_cores_per_node = 32; | ||
160 | else | ||
161 | xlp_cores_per_node = 8; | ||
157 | nlm_init_boot_cpu(); | 162 | nlm_init_boot_cpu(); |
158 | xlp_mmu_init(); | 163 | xlp_mmu_init(); |
159 | nlm_node_init(0); | 164 | nlm_node_init(0); |
diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c index a5d6647e5fe8..bbd53f8e92db 100644 --- a/arch/mips/netlogic/xlp/wakeup.c +++ b/arch/mips/netlogic/xlp/wakeup.c | |||
@@ -165,7 +165,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) | |||
165 | nodep->coremask = 1; | 165 | nodep->coremask = 1; |
166 | 166 | ||
167 | pr_info("Node %d - SYS/FUSE coremask %x\n", n, syscoremask); | 167 | pr_info("Node %d - SYS/FUSE coremask %x\n", n, syscoremask); |
168 | for (core = 0; core < NLM_CORES_PER_NODE; core++) { | 168 | for (core = 0; core < nlm_cores_per_node(); core++) { |
169 | /* we will be on node 0 core 0 */ | 169 | /* we will be on node 0 core 0 */ |
170 | if (n == 0 && core == 0) | 170 | if (n == 0 && core == 0) |
171 | continue; | 171 | continue; |
@@ -175,7 +175,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) | |||
175 | continue; | 175 | continue; |
176 | 176 | ||
177 | /* see if at least the first hw thread is enabled */ | 177 | /* see if at least the first hw thread is enabled */ |
178 | cpu = (n * NLM_CORES_PER_NODE + core) | 178 | cpu = (n * nlm_cores_per_node() + core) |
179 | * NLM_THREADS_PER_CORE; | 179 | * NLM_THREADS_PER_CORE; |
180 | if (!cpumask_test_cpu(cpu, wakeup_mask)) | 180 | if (!cpumask_test_cpu(cpu, wakeup_mask)) |
181 | continue; | 181 | continue; |