MIPS: Netlogic: Move cores per node out of multi-node.h
Use the current_cpu_data package field to get the node of the current CPU. This allows us to remove xlp_cores_per_node and move nlm_threads_per_node() and nlm_cores_per_node() to netlogic/common.h, which simplifies code. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/8889/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:

committed by
Ralf Baechle

parent
65fecc2725
commit
c273652546
@@ -51,7 +51,6 @@ uint64_t nlm_io_base;
|
||||
struct nlm_soc_info nlm_nodes[NLM_NR_NODES];
|
||||
cpumask_t nlm_cpumask = CPU_MASK_CPU0;
|
||||
unsigned int nlm_threads_per_core;
|
||||
unsigned int xlp_cores_per_node;
|
||||
|
||||
static void nlm_linux_exit(void)
|
||||
{
|
||||
@@ -163,10 +162,6 @@ void __init prom_init(void)
|
||||
void *reset_vec;
|
||||
|
||||
nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE);
|
||||
if (cpu_is_xlp9xx())
|
||||
xlp_cores_per_node = 32;
|
||||
else
|
||||
xlp_cores_per_node = 8;
|
||||
nlm_init_boot_cpu();
|
||||
xlp_mmu_init();
|
||||
nlm_node_init(0);
|
||||
|
@@ -111,7 +111,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
|
||||
struct nlm_soc_info *nodep;
|
||||
uint64_t syspcibase, fusebase;
|
||||
uint32_t syscoremask, mask, fusemask;
|
||||
int core, n, cpu;
|
||||
int core, n, cpu, ncores;
|
||||
|
||||
for (n = 0; n < NLM_NR_NODES; n++) {
|
||||
if (n != 0) {
|
||||
@@ -168,7 +168,8 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
|
||||
syscoremask = (1 << hweight32(~fusemask & mask)) - 1;
|
||||
|
||||
pr_info("Node %d - SYS/FUSE coremask %x\n", n, syscoremask);
|
||||
for (core = 0; core < nlm_cores_per_node(); core++) {
|
||||
ncores = nlm_cores_per_node();
|
||||
for (core = 0; core < ncores; core++) {
|
||||
/* we will be on node 0 core 0 */
|
||||
if (n == 0 && core == 0)
|
||||
continue;
|
||||
@@ -178,8 +179,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
|
||||
continue;
|
||||
|
||||
/* see if at least the first hw thread is enabled */
|
||||
cpu = (n * nlm_cores_per_node() + core)
|
||||
* NLM_THREADS_PER_CORE;
|
||||
cpu = (n * ncores + core) * NLM_THREADS_PER_CORE;
|
||||
if (!cpumask_test_cpu(cpu, wakeup_mask))
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user