diff options
author | Paul Burton <paul.burton@imgtec.com> | 2017-08-13 04:49:42 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-08-30 00:57:28 +0200 |
commit | 3c9b4166213d415afa09bf2be104074f3a1161c8 (patch) | |
tree | 090628d88c17fe1458da3497a0ded39b922f11a4 /arch/mips/kernel | |
parent | MIPS: CPS: Have asm/mips-cps.h include CM & CPC headers (diff) | |
download | linux-3c9b4166213d415afa09bf2be104074f3a1161c8.tar.xz linux-3c9b4166213d415afa09bf2be104074f3a1161c8.zip |
MIPS: CPS: Cluster support for topology functions
Modify the functions we use to read information about the topology of
the system (the number of cores, VPs & IOCUs that it contains) in order
to take into account multiple clusters, and provide a new function to
determine the number of clusters in the system.
Users of these functions are modified only such that they continue to
build successfully - having them actually handle multiple clusters is
left to further patches.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17016/
Patchwork: https://patchwork.linux-mips.org/patch/17218/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/smp-cps.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 57b331b85e54..4b9dcca12e5f 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -42,19 +42,10 @@ early_param("nothreads", setup_nothreads); static unsigned core_vpe_count(unsigned core) { - unsigned cfg; - if (threads_disabled) return 1; - if ((!IS_ENABLED(CONFIG_MIPS_MT_SMP) || !cpu_has_mipsmt) - && (!IS_ENABLED(CONFIG_CPU_MIPSR6) || !cpu_has_vp)) - return 1; - - mips_cm_lock_other(0, core, 0, CM_GCR_Cx_OTHER_BLOCK_LOCAL); - cfg = read_gcr_co_config() & CM_GCR_Cx_CONFIG_PVPE; - mips_cm_unlock_other(); - return cfg + 1; + return mips_cps_numvps(0, core); } static void __init cps_smp_setup(void) @@ -64,7 +55,7 @@ static void __init cps_smp_setup(void) int c, v; /* Detect & record VPE topology */ - ncores = mips_cm_numcores(); + ncores = mips_cps_numcores(0); pr_info("%s topology ", cpu_has_mips_r6 ? "VP" : "VPE"); for (c = nvpes = 0; c < ncores; c++) { core_vpes = core_vpe_count(c); @@ -138,7 +129,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus) } /* Warn the user if the CCA prevents multi-core */ - ncores = mips_cm_numcores(); + ncores = mips_cps_numcores(0); if ((cca_unsuitable || cpu_has_dc_aliases) && ncores > 1) { pr_warn("Using only one core due to %s%s%s\n", cca_unsuitable ? "unsuitable CCA" : "", |