Commit 7d1859dc authored by Jayachandran C's avatar Jayachandran C Committed by Ralf Baechle

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: default avatarJayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8890/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent c2736525
...@@ -157,7 +157,13 @@ static inline int nlm_nodeid(void) ...@@ -157,7 +157,13 @@ static inline int nlm_nodeid(void)
static inline unsigned int nlm_core_id(void) static inline unsigned int nlm_core_id(void)
{ {
return (read_c0_ebase() & 0x1c) >> 2; uint32_t prid = read_c0_prid() & PRID_IMP_MASK;
if ((prid == PRID_IMP_NETLOGIC_XLP9XX) ||
(prid == PRID_IMP_NETLOGIC_XLP5XX))
return (read_c0_ebase() & 0x7c) >> 2;
else
return (read_c0_ebase() & 0x1c) >> 2;
} }
static inline unsigned int nlm_thread_id(void) static inline unsigned int nlm_thread_id(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment