xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/sn/agent.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
3*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
4*4882a593Smuzhiyun  * for more details.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * This file has definitions for the hub and snac interfaces.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (C) 1992 - 1997, 1999, 2000 Silcon Graphics, Inc.
9*4882a593Smuzhiyun  * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
10*4882a593Smuzhiyun  */
11*4882a593Smuzhiyun #ifndef _ASM_SGI_SN_AGENT_H
12*4882a593Smuzhiyun #define _ASM_SGI_SN_AGENT_H
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #include <asm/sn/addrs.h>
15*4882a593Smuzhiyun #include <asm/sn/arch.h>
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun #if defined(CONFIG_SGI_IP27)
18*4882a593Smuzhiyun #include <asm/sn/sn0/hub.h>
19*4882a593Smuzhiyun #elif defined(CONFIG_SGI_IP35)
20*4882a593Smuzhiyun #include <asm/sn/sn1/hub.h>
21*4882a593Smuzhiyun #endif	/* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun /*
24*4882a593Smuzhiyun  * NIC register macros
25*4882a593Smuzhiyun  */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #if defined(CONFIG_SGI_IP27)
28*4882a593Smuzhiyun #define HUB_NIC_ADDR(_cpuid)						   \
29*4882a593Smuzhiyun 	REMOTE_HUB_ADDR(cpu_to_node(_cpuid),				   \
30*4882a593Smuzhiyun 		MD_MLAN_CTL)
31*4882a593Smuzhiyun #endif
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #define SET_HUB_NIC(_my_cpuid, _val)					   \
34*4882a593Smuzhiyun 	(HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val)))
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #define SET_MY_HUB_NIC(_v)						   \
37*4882a593Smuzhiyun 	SET_HUB_NIC(cpuid(), (_v))
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #define GET_HUB_NIC(_my_cpuid)						   \
40*4882a593Smuzhiyun 	(HUB_L(HUB_NIC_ADDR(_my_cpuid)))
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #define GET_MY_HUB_NIC()						   \
43*4882a593Smuzhiyun 	GET_HUB_NIC(cpuid())
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun #endif /* _ASM_SGI_SN_AGENT_H */
46