18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Derived from IRIX <sys/SN/SN0/hubni.h>, Revision 1.27.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 1992-1997, 1999 Silicon Graphics, Inc.
98c2ecf20Sopenharmony_ci * Copyright (C) 1999 by Ralf Baechle
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#ifndef _ASM_SGI_SN0_HUBNI_H
128c2ecf20Sopenharmony_ci#define _ASM_SGI_SN0_HUBNI_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
158c2ecf20Sopenharmony_ci#include <linux/types.h>
168c2ecf20Sopenharmony_ci#endif
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/*
198c2ecf20Sopenharmony_ci * Hub Network Interface registers
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * All registers in this file are subject to change until Hub chip tapeout.
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define NI_BASE			0x600000
258c2ecf20Sopenharmony_ci#define NI_BASE_TABLES		0x630000
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define NI_STATUS_REV_ID	0x600000 /* Hub network status, rev, and ID */
288c2ecf20Sopenharmony_ci#define NI_PORT_RESET		0x600008 /* Reset the network interface	    */
298c2ecf20Sopenharmony_ci#define NI_PROTECTION		0x600010 /* NI register access permissions  */
308c2ecf20Sopenharmony_ci#define NI_GLOBAL_PARMS		0x600018 /* LLP parameters		    */
318c2ecf20Sopenharmony_ci#define NI_SCRATCH_REG0		0x600100 /* Scratch register 0 (64 bits)    */
328c2ecf20Sopenharmony_ci#define NI_SCRATCH_REG1		0x600108 /* Scratch register 1 (64 bits)    */
338c2ecf20Sopenharmony_ci#define NI_DIAG_PARMS		0x600110 /* Parameters for diags	    */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define NI_VECTOR_PARMS		0x600200 /* Vector PIO routing parameters   */
368c2ecf20Sopenharmony_ci#define NI_VECTOR		0x600208 /* Vector PIO route		    */
378c2ecf20Sopenharmony_ci#define NI_VECTOR_DATA		0x600210 /* Vector PIO data		    */
388c2ecf20Sopenharmony_ci#define NI_VECTOR_STATUS	0x600300 /* Vector PIO return status	    */
398c2ecf20Sopenharmony_ci#define NI_RETURN_VECTOR	0x600308 /* Vector PIO return vector	    */
408c2ecf20Sopenharmony_ci#define NI_VECTOR_READ_DATA	0x600310 /* Vector PIO read data	    */
418c2ecf20Sopenharmony_ci#define NI_VECTOR_CLEAR		0x600380 /* Vector PIO read & clear status  */
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define NI_IO_PROTECT		0x600400 /* PIO protection bits		    */
448c2ecf20Sopenharmony_ci#define NI_IO_PROT_OVRRD	0x600408 /* PIO protection bit override	    */
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define NI_AGE_CPU0_MEMORY	0x600500 /* CPU 0 memory age control	    */
478c2ecf20Sopenharmony_ci#define NI_AGE_CPU0_PIO		0x600508 /* CPU 0 PIO age control	    */
488c2ecf20Sopenharmony_ci#define NI_AGE_CPU1_MEMORY	0x600510 /* CPU 1 memory age control	    */
498c2ecf20Sopenharmony_ci#define NI_AGE_CPU1_PIO		0x600518 /* CPU 1 PIO age control	    */
508c2ecf20Sopenharmony_ci#define NI_AGE_GBR_MEMORY	0x600520 /* GBR memory age control	    */
518c2ecf20Sopenharmony_ci#define NI_AGE_GBR_PIO		0x600528 /* GBR PIO age control		    */
528c2ecf20Sopenharmony_ci#define NI_AGE_IO_MEMORY	0x600530 /* IO memory age control	    */
538c2ecf20Sopenharmony_ci#define NI_AGE_IO_PIO		0x600538 /* IO PIO age control		    */
548c2ecf20Sopenharmony_ci#define NI_AGE_REG_MIN		NI_AGE_CPU0_MEMORY
558c2ecf20Sopenharmony_ci#define NI_AGE_REG_MAX		NI_AGE_IO_PIO
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define NI_PORT_PARMS		0x608000 /* LLP Parameters		    */
588c2ecf20Sopenharmony_ci#define NI_PORT_ERROR		0x608008 /* LLP Errors			    */
598c2ecf20Sopenharmony_ci#define NI_PORT_ERROR_CLEAR	0x608088 /* Clear the error bits	    */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define NI_META_TABLE0		0x638000 /* First meta routing table entry  */
628c2ecf20Sopenharmony_ci#define NI_META_TABLE(_x)	(NI_META_TABLE0 + (8 * (_x)))
638c2ecf20Sopenharmony_ci#define NI_META_ENTRIES		32
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define NI_LOCAL_TABLE0		0x638100 /* First local routing table entry */
668c2ecf20Sopenharmony_ci#define NI_LOCAL_TABLE(_x)	(NI_LOCAL_TABLE0 + (8 * (_x)))
678c2ecf20Sopenharmony_ci#define NI_LOCAL_ENTRIES	16
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci/*
708c2ecf20Sopenharmony_ci * NI_STATUS_REV_ID mask and shift definitions
718c2ecf20Sopenharmony_ci * Have to use UINT64_CAST instead of 'L' suffix, for assembler.
728c2ecf20Sopenharmony_ci */
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define NSRI_8BITMODE_SHFT	30
758c2ecf20Sopenharmony_ci#define NSRI_8BITMODE_MASK	(UINT64_CAST 0x1 << 30)
768c2ecf20Sopenharmony_ci#define NSRI_LINKUP_SHFT	29
778c2ecf20Sopenharmony_ci#define NSRI_LINKUP_MASK	(UINT64_CAST 0x1 << 29)
788c2ecf20Sopenharmony_ci#define NSRI_DOWNREASON_SHFT	28		/* 0=failed, 1=never came   */
798c2ecf20Sopenharmony_ci#define NSRI_DOWNREASON_MASK	(UINT64_CAST 0x1 << 28) /*    out of reset. */
808c2ecf20Sopenharmony_ci#define NSRI_MORENODES_SHFT	18
818c2ecf20Sopenharmony_ci#define NSRI_MORENODES_MASK	(UINT64_CAST 1 << 18)	/* Max. # of nodes  */
828c2ecf20Sopenharmony_ci#define	 MORE_MEMORY		0
838c2ecf20Sopenharmony_ci#define	 MORE_NODES		1
848c2ecf20Sopenharmony_ci#define NSRI_REGIONSIZE_SHFT	17
858c2ecf20Sopenharmony_ci#define NSRI_REGIONSIZE_MASK	(UINT64_CAST 1 << 17)	/* Granularity	    */
868c2ecf20Sopenharmony_ci#define	 REGIONSIZE_FINE	1
878c2ecf20Sopenharmony_ci#define	 REGIONSIZE_COARSE	0
888c2ecf20Sopenharmony_ci#define NSRI_NODEID_SHFT	8
898c2ecf20Sopenharmony_ci#define NSRI_NODEID_MASK	(UINT64_CAST 0x1ff << 8)/* Node (Hub) ID    */
908c2ecf20Sopenharmony_ci#define NSRI_REV_SHFT		4
918c2ecf20Sopenharmony_ci#define NSRI_REV_MASK		(UINT64_CAST 0xf << 4)	/* Chip Revision    */
928c2ecf20Sopenharmony_ci#define NSRI_CHIPID_SHFT	0
938c2ecf20Sopenharmony_ci#define NSRI_CHIPID_MASK	(UINT64_CAST 0xf)	/* Chip type ID	    */
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci/*
968c2ecf20Sopenharmony_ci * In fine mode, each node is a region.	 In coarse mode, there are
978c2ecf20Sopenharmony_ci * eight nodes per region.
988c2ecf20Sopenharmony_ci */
998c2ecf20Sopenharmony_ci#define NASID_TO_FINEREG_SHFT	0
1008c2ecf20Sopenharmony_ci#define NASID_TO_COARSEREG_SHFT 3
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci/* NI_PORT_RESET mask definitions */
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define NPR_PORTRESET		(UINT64_CAST 1 << 7)	/* Send warm reset  */
1058c2ecf20Sopenharmony_ci#define NPR_LINKRESET		(UINT64_CAST 1 << 1)	/* Send link reset  */
1068c2ecf20Sopenharmony_ci#define NPR_LOCALRESET		(UINT64_CAST 1)		/* Reset entire hub */
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* NI_PROTECTION mask and shift definitions */
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#define NPROT_RESETOK		(UINT64_CAST 1)
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/* NI_GLOBAL_PARMS mask and shift definitions */
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci#define NGP_MAXRETRY_SHFT	48		/* Maximum retries	    */
1158c2ecf20Sopenharmony_ci#define NGP_MAXRETRY_MASK	(UINT64_CAST 0x3ff << 48)
1168c2ecf20Sopenharmony_ci#define NGP_TAILTOWRAP_SHFT	32		/* Tail timeout wrap	    */
1178c2ecf20Sopenharmony_ci#define NGP_TAILTOWRAP_MASK	(UINT64_CAST 0xffff << 32)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci#define NGP_CREDITTOVAL_SHFT	16		/* Tail timeout wrap	    */
1208c2ecf20Sopenharmony_ci#define NGP_CREDITTOVAL_MASK	(UINT64_CAST 0xf << 16)
1218c2ecf20Sopenharmony_ci#define NGP_TAILTOVAL_SHFT	4		/* Tail timeout value	    */
1228c2ecf20Sopenharmony_ci#define NGP_TAILTOVAL_MASK	(UINT64_CAST 0xf << 4)
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* NI_DIAG_PARMS mask and shift definitions */
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define NDP_PORTTORESET		(UINT64_CAST 1 << 18)	/* Port tmout reset */
1278c2ecf20Sopenharmony_ci#define NDP_LLP8BITMODE		(UINT64_CAST 1 << 12)	/* LLP 8-bit mode   */
1288c2ecf20Sopenharmony_ci#define NDP_PORTDISABLE		(UINT64_CAST 1 <<  6)	/* Port disable	    */
1298c2ecf20Sopenharmony_ci#define NDP_SENDERROR		(UINT64_CAST 1)		/* Send data error  */
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/*
1328c2ecf20Sopenharmony_ci * NI_VECTOR_PARMS mask and shift definitions.
1338c2ecf20Sopenharmony_ci * TYPE may be any of the first four PIOTYPEs defined under NI_VECTOR_STATUS.
1348c2ecf20Sopenharmony_ci */
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define NVP_PIOID_SHFT		40
1378c2ecf20Sopenharmony_ci#define NVP_PIOID_MASK		(UINT64_CAST 0x3ff << 40)
1388c2ecf20Sopenharmony_ci#define NVP_WRITEID_SHFT	32
1398c2ecf20Sopenharmony_ci#define NVP_WRITEID_MASK	(UINT64_CAST 0xff << 32)
1408c2ecf20Sopenharmony_ci#define NVP_ADDRESS_MASK	(UINT64_CAST 0xffff8)	/* Bits 19:3	    */
1418c2ecf20Sopenharmony_ci#define NVP_TYPE_SHFT		0
1428c2ecf20Sopenharmony_ci#define NVP_TYPE_MASK		(UINT64_CAST 0x3)
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci/* NI_VECTOR_STATUS mask and shift definitions */
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci#define NVS_VALID		(UINT64_CAST 1 << 63)
1478c2ecf20Sopenharmony_ci#define NVS_OVERRUN		(UINT64_CAST 1 << 62)
1488c2ecf20Sopenharmony_ci#define NVS_TARGET_SHFT		51
1498c2ecf20Sopenharmony_ci#define NVS_TARGET_MASK		(UINT64_CAST 0x3ff << 51)
1508c2ecf20Sopenharmony_ci#define NVS_PIOID_SHFT		40
1518c2ecf20Sopenharmony_ci#define NVS_PIOID_MASK		(UINT64_CAST 0x3ff << 40)
1528c2ecf20Sopenharmony_ci#define NVS_WRITEID_SHFT	32
1538c2ecf20Sopenharmony_ci#define NVS_WRITEID_MASK	(UINT64_CAST 0xff << 32)
1548c2ecf20Sopenharmony_ci#define NVS_ADDRESS_MASK	(UINT64_CAST 0xfffffff8)   /* Bits 31:3	    */
1558c2ecf20Sopenharmony_ci#define NVS_TYPE_SHFT		0
1568c2ecf20Sopenharmony_ci#define NVS_TYPE_MASK		(UINT64_CAST 0x7)
1578c2ecf20Sopenharmony_ci#define NVS_ERROR_MASK		(UINT64_CAST 0x4)  /* bit set means error */
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#define	 PIOTYPE_READ		0	/* VECTOR_PARMS and VECTOR_STATUS   */
1618c2ecf20Sopenharmony_ci#define	 PIOTYPE_WRITE		1	/* VECTOR_PARMS and VECTOR_STATUS   */
1628c2ecf20Sopenharmony_ci#define	 PIOTYPE_UNDEFINED	2	/* VECTOR_PARMS and VECTOR_STATUS   */
1638c2ecf20Sopenharmony_ci#define	 PIOTYPE_EXCHANGE	3	/* VECTOR_PARMS and VECTOR_STATUS   */
1648c2ecf20Sopenharmony_ci#define	 PIOTYPE_ADDR_ERR	4	/* VECTOR_STATUS only		    */
1658c2ecf20Sopenharmony_ci#define	 PIOTYPE_CMD_ERR	5	/* VECTOR_STATUS only		    */
1668c2ecf20Sopenharmony_ci#define	 PIOTYPE_PROT_ERR	6	/* VECTOR_STATUS only		    */
1678c2ecf20Sopenharmony_ci#define	 PIOTYPE_UNKNOWN	7	/* VECTOR_STATUS only		    */
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci/* NI_AGE_XXX mask and shift definitions */
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci#define NAGE_VCH_SHFT		10
1728c2ecf20Sopenharmony_ci#define NAGE_VCH_MASK		(UINT64_CAST 3 << 10)
1738c2ecf20Sopenharmony_ci#define NAGE_CC_SHFT		8
1748c2ecf20Sopenharmony_ci#define NAGE_CC_MASK		(UINT64_CAST 3 << 8)
1758c2ecf20Sopenharmony_ci#define NAGE_AGE_SHFT		0
1768c2ecf20Sopenharmony_ci#define NAGE_AGE_MASK		(UINT64_CAST 0xff)
1778c2ecf20Sopenharmony_ci#define NAGE_MASK		(NAGE_VCH_MASK | NAGE_CC_MASK | NAGE_AGE_MASK)
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci#define	 VCHANNEL_A		0
1808c2ecf20Sopenharmony_ci#define	 VCHANNEL_B		1
1818c2ecf20Sopenharmony_ci#define	 VCHANNEL_ANY		2
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci/* NI_PORT_PARMS mask and shift definitions */
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define NPP_NULLTO_SHFT		10
1868c2ecf20Sopenharmony_ci#define NPP_NULLTO_MASK		(UINT64_CAST 0x3f << 16)
1878c2ecf20Sopenharmony_ci#define NPP_MAXBURST_SHFT	0
1888c2ecf20Sopenharmony_ci#define NPP_MAXBURST_MASK	(UINT64_CAST 0x3ff)
1898c2ecf20Sopenharmony_ci#define NPP_RESET_DFLT_HUB20	((UINT64_CAST 1	    << NPP_NULLTO_SHFT) | \
1908c2ecf20Sopenharmony_ci				 (UINT64_CAST 0x3f0 << NPP_MAXBURST_SHFT))
1918c2ecf20Sopenharmony_ci#define NPP_RESET_DEFAULTS	((UINT64_CAST 6	    << NPP_NULLTO_SHFT) | \
1928c2ecf20Sopenharmony_ci				 (UINT64_CAST 0x3f0 << NPP_MAXBURST_SHFT))
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci/* NI_PORT_ERROR mask and shift definitions */
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci#define NPE_LINKRESET		(UINT64_CAST 1 << 37)
1988c2ecf20Sopenharmony_ci#define NPE_INTERNALERROR	(UINT64_CAST 1 << 36)
1998c2ecf20Sopenharmony_ci#define NPE_BADMESSAGE		(UINT64_CAST 1 << 35)
2008c2ecf20Sopenharmony_ci#define NPE_BADDEST		(UINT64_CAST 1 << 34)
2018c2ecf20Sopenharmony_ci#define NPE_FIFOOVERFLOW	(UINT64_CAST 1 << 33)
2028c2ecf20Sopenharmony_ci#define NPE_CREDITTO_SHFT	28
2038c2ecf20Sopenharmony_ci#define NPE_CREDITTO_MASK	(UINT64_CAST 0xf << 28)
2048c2ecf20Sopenharmony_ci#define NPE_TAILTO_SHFT		24
2058c2ecf20Sopenharmony_ci#define NPE_TAILTO_MASK		(UINT64_CAST 0xf << 24)
2068c2ecf20Sopenharmony_ci#define NPE_RETRYCOUNT_SHFT	16
2078c2ecf20Sopenharmony_ci#define NPE_RETRYCOUNT_MASK	(UINT64_CAST 0xff << 16)
2088c2ecf20Sopenharmony_ci#define NPE_CBERRCOUNT_SHFT	8
2098c2ecf20Sopenharmony_ci#define NPE_CBERRCOUNT_MASK	(UINT64_CAST 0xff << 8)
2108c2ecf20Sopenharmony_ci#define NPE_SNERRCOUNT_SHFT	0
2118c2ecf20Sopenharmony_ci#define NPE_SNERRCOUNT_MASK	(UINT64_CAST 0xff << 0)
2128c2ecf20Sopenharmony_ci#define NPE_MASK		0x3effffffff
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci#define NPE_COUNT_MAX		0xff
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define NPE_FATAL_ERRORS	(NPE_LINKRESET | NPE_INTERNALERROR |	\
2178c2ecf20Sopenharmony_ci				 NPE_BADMESSAGE | NPE_BADDEST |		\
2188c2ecf20Sopenharmony_ci				 NPE_FIFOOVERFLOW | NPE_CREDITTO_MASK | \
2198c2ecf20Sopenharmony_ci				 NPE_TAILTO_MASK)
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci/* NI_META_TABLE mask and shift definitions */
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci#define NMT_EXIT_PORT_MASK (UINT64_CAST 0xf)
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci/* NI_LOCAL_TABLE mask and shift definitions */
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci#define NLT_EXIT_PORT_MASK (UINT64_CAST 0xf)
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_citypedef union	hubni_port_error_u {
2328c2ecf20Sopenharmony_ci	u64	nipe_reg_value;
2338c2ecf20Sopenharmony_ci	struct {
2348c2ecf20Sopenharmony_ci	    u64 nipe_rsvd:	26,	/* unused */
2358c2ecf20Sopenharmony_ci		nipe_lnk_reset:	 1,	/* link reset */
2368c2ecf20Sopenharmony_ci		nipe_intl_err:	 1,	/* internal error */
2378c2ecf20Sopenharmony_ci		nipe_bad_msg:	 1,	/* bad message */
2388c2ecf20Sopenharmony_ci		nipe_bad_dest:	 1,	/* bad dest	*/
2398c2ecf20Sopenharmony_ci		nipe_fifo_ovfl:	 1,	/* fifo overflow */
2408c2ecf20Sopenharmony_ci		nipe_rsvd1:	 1,	/* unused */
2418c2ecf20Sopenharmony_ci		nipe_credit_to:	 4,	/* credit timeout */
2428c2ecf20Sopenharmony_ci		nipe_tail_to:	 4,	/* tail timeout */
2438c2ecf20Sopenharmony_ci		nipe_retry_cnt:	 8,	/* retry error count */
2448c2ecf20Sopenharmony_ci		nipe_cb_cnt:	 8,	/* checkbit error count */
2458c2ecf20Sopenharmony_ci		nipe_sn_cnt:	 8;	/* sequence number count */
2468c2ecf20Sopenharmony_ci	} nipe_fields_s;
2478c2ecf20Sopenharmony_ci} hubni_port_error_t;
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci#define NI_LLP_RETRY_MAX	0xff
2508c2ecf20Sopenharmony_ci#define NI_LLP_CB_MAX		0xff
2518c2ecf20Sopenharmony_ci#define NI_LLP_SN_MAX		0xff
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_cistatic inline int get_region_shift(void)
2548c2ecf20Sopenharmony_ci{
2558c2ecf20Sopenharmony_ci	if (LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_REGIONSIZE_MASK)
2568c2ecf20Sopenharmony_ci		return NASID_TO_FINEREG_SHFT;
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci	return NASID_TO_COARSEREG_SHFT;
2598c2ecf20Sopenharmony_ci}
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci#endif /* _ASM_SGI_SN0_HUBNI_H */
264