Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204559
b: refs/heads/master
c: edfcbb8
h: refs/heads/master
i:
  204557: b5d62a1
  204555: 79e10a0
  204551: 30fd1f2
  204543: edb436f
v: v3
  • Loading branch information
David Daney authored and Ralf Baechle committed Aug 5, 2010
1 parent 5e9e3f9 commit a139456
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d9eee6e52e817c006666b0efc5068aa219dbecb
refs/heads/master: edfcbb8cac13d679c0d656fd4576b3945429f3c0
37 changes: 30 additions & 7 deletions trunk/arch/mips/cavium-octeon/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2004-2008 Cavium Networks
* Copyright (C) 2004-2008, 2009, 2010 Cavium Networks
*/
#include <linux/cpu.h>
#include <linux/init.h>
Expand Down Expand Up @@ -102,24 +102,47 @@ static void octeon_smp_setup(void)
const int coreid = cvmx_get_core_num();
int cpus;
int id;

int core_mask = octeon_get_boot_coremask();
#ifdef CONFIG_HOTPLUG_CPU
unsigned int num_cores = cvmx_octeon_num_cores();
#endif

/* The present CPUs are initially just the boot cpu (CPU 0). */
for (id = 0; id < NR_CPUS; id++) {
set_cpu_possible(id, id == 0);
set_cpu_present(id, id == 0);
}

cpus_clear(cpu_possible_map);
__cpu_number_map[coreid] = 0;
__cpu_logical_map[0] = coreid;
cpu_set(0, cpu_possible_map);

/* The present CPUs get the lowest CPU numbers. */
cpus = 1;
for (id = 0; id < 16; id++) {
for (id = 0; id < NR_CPUS; id++) {
if ((id != coreid) && (core_mask & (1 << id))) {
cpu_set(cpus, cpu_possible_map);
set_cpu_possible(cpus, true);
set_cpu_present(cpus, true);
__cpu_number_map[id] = cpus;
__cpu_logical_map[cpus] = id;
cpus++;
}
}
cpu_present_map = cpu_possible_map;

#ifdef CONFIG_HOTPLUG_CPU
/*
* The possible CPUs are all those present on the chip. We
* will assign CPU numbers for possible cores as well. Cores
* are always consecutively numberd from 0.
*/
for (id = 0; id < num_cores && id < NR_CPUS; id++) {
if (!(core_mask & (1 << id))) {
set_cpu_possible(cpus, true);
__cpu_number_map[id] = cpus;
__cpu_logical_map[cpus] = id;
cpus++;
}
}
#endif

octeon_smp_hotplug_setup();
}
Expand Down

0 comments on commit a139456

Please sign in to comment.