Skip to content

Commit a263e5f

Browse files
gclementtsbogend
authored andcommitted
MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later
When the CM block migrated from CM2.5 to CM3.0, the address offset for the Global CSR Access Privilege register was modified. We saw this in the "MIPS64 I6500 Multiprocessing System Programmer's Guide," it is stated that "the Global CSR Access Privilege register is located at offset 0x0120" in section 5.4. It is at least the same for I6400. This fix allows to use the VP cores in SMP mode if the reset values were modified by the bootloader. Based on the work of Vladimir Kondratiev <[email protected]> and the feedback from Jiaxun Yang <[email protected]>. Fixes: 197e89e ("MIPS: mips-cm: Implement mips_cm_revision") Signed-off-by: Gregory CLEMENT <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent fa165f9 commit a263e5f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arch/mips/include/asm/mips-cm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ GCR_ACCESSOR_RO(32, 0x0d0, gic_status)
240240
GCR_ACCESSOR_RO(32, 0x0f0, cpc_status)
241241
#define CM_GCR_CPC_STATUS_EX BIT(0)
242242

243+
/* GCR_ACCESS - Controls core/IOCU access to GCRs */
244+
GCR_ACCESSOR_RW(32, 0x120, access_cm3)
245+
#define CM_GCR_ACCESS_ACCESSEN GENMASK(7, 0)
246+
243247
/* GCR_L2_CONFIG - Indicates L2 cache configuration when Config5.L2C=1 */
244248
GCR_ACCESSOR_RW(32, 0x130, l2_config)
245249
#define CM_GCR_L2_CONFIG_BYPASS BIT(20)

arch/mips/kernel/smp-cps.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ static void boot_core(unsigned int core, unsigned int vpe_id)
317317
write_gcr_co_reset_ext_base(CM_GCR_Cx_RESET_EXT_BASE_UEB);
318318

319319
/* Ensure the core can access the GCRs */
320-
set_gcr_access(1 << core);
320+
if (mips_cm_revision() < CM_REV_CM3)
321+
set_gcr_access(1 << core);
322+
else
323+
set_gcr_access_cm3(1 << core);
321324

322325
if (mips_cpc_present()) {
323326
/* Reset the core */

0 commit comments

Comments
 (0)