Add version to PATCH_LOG and LAST_LOG.
[linux-flexiantxendom0-3.2.10.git] / include / asm-ia64 / sn / sn1 / slotnum.h
1 /* $Id$
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-2001 Silicon Graphics, Inc. All rights reserved.
8  */
9
10 #ifndef _ASM_IA64_SN_SN1_SLOTNUM_H
11 #define _ASM_IA64_SN_SN1_SLOTNUM_H
12
13 #define SLOTNUM_MAXLENGTH       16
14
15 /*
16  * This file attempts to define a slot number space across all slots.
17  *
18  *      Node slots
19  *      Router slots
20  *      Crosstalk slots
21  *
22  *      Other slots are children of their parent crosstalk slot:
23  *              PCI slots
24  *              VME slots
25  *
26  *      The PCI class has been added since the XBridge ASIC on SN-MIPS
27  *      has built-in PCI bridges (2). On IBricks, widget E & F serve
28  *      PCI busses, and on PBricks all widgets serve as PCI busses
29  *      with the use of the super-bridge mode of the XBridge ASIC.
30  */
31
32 #define SLOTNUM_NODE_CLASS      0x00    /* Node   */
33 #define SLOTNUM_ROUTER_CLASS    0x10    /* Router */
34 #define SLOTNUM_XTALK_CLASS     0x20    /* Xtalk  */
35 #define SLOTNUM_MIDPLANE_CLASS  0x30    /* Midplane */
36 #define SLOTNUM_XBOW_CLASS      0x40    /* Xbow  */
37 #define SLOTNUM_KNODE_CLASS     0x50    /* Kego node */
38 #define SLOTNUM_PCI_CLASS       0x60    /* PCI widgets on XBridge */
39 #define SLOTNUM_INVALID_CLASS   0xf0    /* Invalid */
40
41 #define SLOTNUM_CLASS_MASK      0xf0
42 #define SLOTNUM_SLOT_MASK       0x0f
43
44 #define SLOTNUM_GETCLASS(_sn)   ((_sn) & SLOTNUM_CLASS_MASK)
45 #define SLOTNUM_GETSLOT(_sn)    ((_sn) & SLOTNUM_SLOT_MASK)
46
47 /* This determines module to pnode mapping. */
48 /* NODESLOTS_PER_MODULE has changed from 4 to 6
49  * to support the 12P 4IO configuration. This change
50  * helps in minimum  number of changes to code which
51  * depend on the number of node boards within a module.
52  */
53 #define NODESLOTS_PER_MODULE            6
54 #define NODESLOTS_PER_MODULE_SHFT       2
55
56 #define HIGHEST_I2C_VISIBLE_NODESLOT    4
57 #define RTRSLOTS_PER_MODULE             2
58
59 #if __KERNEL__
60 #include <asm/sn/xtalk/xtalk.h>
61
62 extern slotid_t xbwidget_to_xtslot(int crossbow, int widget);
63 extern slotid_t hub_slotbits_to_slot(slotid_t slotbits);
64 extern slotid_t hub_slot_to_crossbow(slotid_t hub_slot);
65 extern slotid_t router_slotbits_to_slot(slotid_t slotbits);
66 extern slotid_t get_node_slotid(nasid_t nasid);
67 extern slotid_t get_my_slotid(void);
68 extern slotid_t get_node_crossbow(nasid_t);
69 extern xwidgetnum_t hub_slot_to_widget(slotid_t);
70 extern void get_slotname(slotid_t, char *);
71 extern void get_my_slotname(char *);
72 extern slotid_t get_widget_slotnum(int xbow, int widget);
73 extern void get_widget_slotname(int, int, char *);
74 extern void router_slotbits_to_slotname(int, char *);
75 extern slotid_t meta_router_slotbits_to_slot(slotid_t) ;
76 extern slotid_t hub_slot_get(void);
77
78 extern int node_can_talk_to_elsc(void);
79
80 extern int  slot_to_widget(int) ;
81 #define MAX_IO_SLOT_NUM         12
82 #define MAX_NODE_SLOT_NUM       4
83 #define MAX_ROUTER_SLOTNUM      2
84
85 #endif /* __KERNEL__ */
86
87 #endif /* _ASM_IA64_SN_SN1_SLOTNUM_H */