Commit 4f62d0a2 authored by Álvaro Fernández Rojas's avatar Álvaro Fernández Rojas Committed by Thomas Bogendoerfer

mips: smp-bmips: fix CPU mappings

When booting bmips with SMP enabled on a BCM6358 running on CPU #1 instead of
CPU #0, the current CPU mapping code produces the following:
- smp_processor_id(): 0
- cpu_logical_map(0): 1
- cpu_number_map(0): 1

This is because SMP isn't supported on BCM6358 since it has a shared TLB, so
it is disabled and max_cpus is decreased from 2 to 1.
Signed-off-by: default avatarÁlvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent ee5e12e7
...@@ -134,17 +134,24 @@ static void __init bmips_smp_setup(void) ...@@ -134,17 +134,24 @@ static void __init bmips_smp_setup(void)
if (!board_ebase_setup) if (!board_ebase_setup)
board_ebase_setup = &bmips_ebase_setup; board_ebase_setup = &bmips_ebase_setup;
__cpu_number_map[boot_cpu] = 0; if (max_cpus > 1) {
__cpu_logical_map[0] = boot_cpu; __cpu_number_map[boot_cpu] = 0;
__cpu_logical_map[0] = boot_cpu;
for (i = 0; i < max_cpus; i++) {
if (i != boot_cpu) { for (i = 0; i < max_cpus; i++) {
__cpu_number_map[i] = cpu; if (i != boot_cpu) {
__cpu_logical_map[cpu] = i; __cpu_number_map[i] = cpu;
cpu++; __cpu_logical_map[cpu] = i;
cpu++;
}
set_cpu_possible(i, 1);
set_cpu_present(i, 1);
} }
set_cpu_possible(i, 1); } else {
set_cpu_present(i, 1); __cpu_number_map[0] = boot_cpu;
__cpu_logical_map[0] = 0;
set_cpu_possible(0, 1);
set_cpu_present(0, 1);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment