Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Netlogic: nlm_core_id for xlp9xx

XLP9XX has 5 bits that specify the core in the EBASE register. XLP5XX
case added as well for completeness.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8890/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Jayachandran C and committed by
Ralf Baechle
7d1859dc c2736525

+7 -1
+7 -1
arch/mips/include/asm/netlogic/mips-extns.h
··· 157 157 158 158 static inline unsigned int nlm_core_id(void) 159 159 { 160 - return (read_c0_ebase() & 0x1c) >> 2; 160 + uint32_t prid = read_c0_prid() & PRID_IMP_MASK; 161 + 162 + if ((prid == PRID_IMP_NETLOGIC_XLP9XX) || 163 + (prid == PRID_IMP_NETLOGIC_XLP5XX)) 164 + return (read_c0_ebase() & 0x7c) >> 2; 165 + else 166 + return (read_c0_ebase() & 0x1c) >> 2; 161 167 } 162 168 163 169 static inline unsigned int nlm_thread_id(void)