Skip to content

Commit 497e803

Browse files
mpredfearnralfbaechle
authored andcommitted
MIPS: smp-cps: Ensure secondary cores start with EVA disabled
The kernel currently assumes that a core will start up in legacy mode using the exception base provided through the CM GCR registers. If a core has been configured in hardware to start in EVA mode, these assumptions will fail. This patch ensures that secondary cores are initialized to meet these assumptions. Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com> Reviewed-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11907/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent a68f376 commit 497e803

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80)
243243
#define CM_GCR_BASE_CMDEFTGT_IOCU0 2
244244
#define CM_GCR_BASE_CMDEFTGT_IOCU1 3
245245

246+
/* GCR_RESET_EXT_BASE register fields */
247+
#define CM_GCR_RESET_EXT_BASE_EVARESET BIT(31)
248+
#define CM_GCR_RESET_EXT_BASE_UEB BIT(30)
249+
246250
/* GCR_ACCESS register fields */
247251
#define CM_GCR_ACCESS_ACCESSEN_SHF 0
248252
#define CM_GCR_ACCESS_ACCESSEN_MSK (_ULCAST_(0xff) << 0)

arch/mips/kernel/smp-cps.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ static void boot_core(unsigned core)
202202
/* Ensure its coherency is disabled */
203203
write_gcr_co_coherence(0);
204204

205+
/* Start it with the legacy memory map and exception base */
206+
write_gcr_co_reset_ext_base(CM_GCR_RESET_EXT_BASE_UEB);
207+
205208
/* Ensure the core can access the GCRs */
206209
access = read_gcr_access();
207210
access |= 1 << (CM_GCR_ACCESS_ACCESSEN_SHF + core);

0 commit comments

Comments
 (0)