diff options
| -rw-r--r-- | arch/mips/include/asm/mips-cm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 58e7874e9347..4fafeefe65c2 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h | |||
| @@ -458,10 +458,21 @@ static inline int mips_cm_revision(void) | |||
| 458 | static inline unsigned int mips_cm_max_vp_width(void) | 458 | static inline unsigned int mips_cm_max_vp_width(void) |
| 459 | { | 459 | { |
| 460 | extern int smp_num_siblings; | 460 | extern int smp_num_siblings; |
| 461 | uint32_t cfg; | ||
| 461 | 462 | ||
| 462 | if (mips_cm_revision() >= CM_REV_CM3) | 463 | if (mips_cm_revision() >= CM_REV_CM3) |
| 463 | return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK; | 464 | return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK; |
| 464 | 465 | ||
| 466 | if (mips_cm_present()) { | ||
| 467 | /* | ||
| 468 | * We presume that all cores in the system will have the same | ||
| 469 | * number of VP(E)s, and if that ever changes then this will | ||
| 470 | * need revisiting. | ||
| 471 | */ | ||
| 472 | cfg = read_gcr_cl_config() & CM_GCR_Cx_CONFIG_PVPE_MSK; | ||
| 473 | return (cfg >> CM_GCR_Cx_CONFIG_PVPE_SHF) + 1; | ||
| 474 | } | ||
| 475 | |||
| 465 | if (IS_ENABLED(CONFIG_SMP)) | 476 | if (IS_ENABLED(CONFIG_SMP)) |
| 466 | return smp_num_siblings; | 477 | return smp_num_siblings; |
| 467 | 478 | ||
