summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/sn
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2020-01-09 13:33:47 +0100
committerPaul Burton <paulburton@kernel.org>2020-01-10 00:30:01 +0100
commit524c4e1fd412d122c2e2707c0b49f959c31a1dd2 (patch)
treefac49b0b0ec758485828c2ac99a5769648b3a1da /arch/mips/include/asm/sn
parentMIPS: SGI-IP27: Use structs for decoding error status registers (diff)
downloadlinux-524c4e1fd412d122c2e2707c0b49f959c31a1dd2.tar.xz
linux-524c4e1fd412d122c2e2707c0b49f959c31a1dd2.zip
MIPS: SGI-IP27: Use specific get_region_shift
IP35 has a different way to find out regions, so we move the IP27 implementation to IP27 specific file. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Signed-off-by: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/mips/include/asm/sn')
-rw-r--r--arch/mips/include/asm/sn/sn0/hubni.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/mips/include/asm/sn/sn0/hubni.h b/arch/mips/include/asm/sn/sn0/hubni.h
index b73c4bee65f2..b8253142cb83 100644
--- a/arch/mips/include/asm/sn/sn0/hubni.h
+++ b/arch/mips/include/asm/sn/sn0/hubni.h
@@ -250,6 +250,14 @@ typedef union hubni_port_error_u {
#define NI_LLP_CB_MAX 0xff
#define NI_LLP_SN_MAX 0xff
+static inline int get_region_shift(void)
+{
+ if (LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_REGIONSIZE_MASK)
+ return NASID_TO_FINEREG_SHFT;
+
+ return NASID_TO_COARSEREG_SHFT;
+}
+
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_SGI_SN0_HUBNI_H */