2ec567d54984c6a659a496cf2c734804c3aac44f
[linux-flexiantxendom0-3.2.10.git] / arch / ia64 / sn / io / sn1 / ip37.c
1 /* 
2  *
3  * This file is subject to the terms and conditions of the GNU General Public
4  * License.  See the file "COPYING" in the main directory of this archive
5  * for more details.
6  *
7  * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved.
8  */
9
10 /*
11  * ip37.c
12  *      Support for IP35/IP37 machines
13  */
14
15 #include <linux/types.h>
16
17 #include <asm/sn/sgi.h>
18 #include <asm/sn/io.h>
19 #include <asm/sn/klconfig.h>
20 #include <asm/sn/pci/bridge.h>     /* for bridge_t */
21
22
23 xwidgetnum_t
24 hub_widget_id(nasid_t nasid)
25 {
26         hubii_wcr_t     ii_wcr; /* the control status register */
27                 
28         ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid,IIO_WCR);
29
30         return ii_wcr.wcr_fields_s.wcr_widget_id;
31 }
32
33 int
34 is_fine_dirmode(void)
35 {
36         return (((LOCAL_HUB_L(LB_REV_ID) & LRI_SYSTEM_SIZE_MASK)
37                 >> LRI_SYSTEM_SIZE_SHFT) == SYSTEM_SIZE_SMALL);
38
39 }
40
41
42 void
43 ni_reset_port(void)
44 {
45         LOCAL_HUB_S(NI_RESET_ENABLE, NRE_RESETOK);
46         LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
47 }