xref: /openbmc/linux/arch/mips/include/asm/sn/agent.h (revision c95baf12f5077419db01313ab61c2aac007d40cd)
1384740dcSRalf Baechle /*
2384740dcSRalf Baechle  * This file is subject to the terms and conditions of the GNU General Public
3384740dcSRalf Baechle  * License.  See the file "COPYING" in the main directory of this archive
4384740dcSRalf Baechle  * for more details.
5384740dcSRalf Baechle  *
6384740dcSRalf Baechle  * This file has definitions for the hub and snac interfaces.
7384740dcSRalf Baechle  *
8384740dcSRalf Baechle  * Copyright (C) 1992 - 1997, 1999, 2000 Silcon Graphics, Inc.
9384740dcSRalf Baechle  * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
10384740dcSRalf Baechle  */
11384740dcSRalf Baechle #ifndef _ASM_SGI_SN_AGENT_H
12384740dcSRalf Baechle #define _ASM_SGI_SN_AGENT_H
13384740dcSRalf Baechle 
14384740dcSRalf Baechle #include <asm/sn/addrs.h>
15384740dcSRalf Baechle #include <asm/sn/arch.h>
16384740dcSRalf Baechle 
17384740dcSRalf Baechle #if defined(CONFIG_SGI_IP27)
18384740dcSRalf Baechle #include <asm/sn/sn0/hub.h>
19384740dcSRalf Baechle #elif defined(CONFIG_SGI_IP35)
20384740dcSRalf Baechle #include <asm/sn/sn1/hub.h>
21384740dcSRalf Baechle #endif	/* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
22384740dcSRalf Baechle 
23384740dcSRalf Baechle /*
24384740dcSRalf Baechle  * NIC register macros
25384740dcSRalf Baechle  */
26384740dcSRalf Baechle 
27384740dcSRalf Baechle #if defined(CONFIG_SGI_IP27)
28384740dcSRalf Baechle #define HUB_NIC_ADDR(_cpuid)						   \
29*4bf841ebSThomas Bogendoerfer 	REMOTE_HUB_ADDR(cpu_to_node(_cpuid),				   \
30384740dcSRalf Baechle 		MD_MLAN_CTL)
31384740dcSRalf Baechle #endif
32384740dcSRalf Baechle 
33384740dcSRalf Baechle #define SET_HUB_NIC(_my_cpuid, _val)					   \
34384740dcSRalf Baechle 	(HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val)))
35384740dcSRalf Baechle 
36384740dcSRalf Baechle #define SET_MY_HUB_NIC(_v)						   \
37384740dcSRalf Baechle 	SET_HUB_NIC(cpuid(), (_v))
38384740dcSRalf Baechle 
39384740dcSRalf Baechle #define GET_HUB_NIC(_my_cpuid)						   \
40384740dcSRalf Baechle 	(HUB_L(HUB_NIC_ADDR(_my_cpuid)))
41384740dcSRalf Baechle 
42384740dcSRalf Baechle #define GET_MY_HUB_NIC()						   \
43384740dcSRalf Baechle 	GET_HUB_NIC(cpuid())
44384740dcSRalf Baechle 
45384740dcSRalf Baechle #endif /* _ASM_SGI_SN_AGENT_H */
46