aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/sn
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/sn')
-rw-r--r--include/asm-mips/sn/addrs.h27
-rw-r--r--include/asm-mips/sn/fru.h (renamed from include/asm-mips/sn/sn0/sn0_fru.h)8
-rw-r--r--include/asm-mips/sn/klconfig.h89
-rw-r--r--include/asm-mips/sn/kldir.h34
-rw-r--r--include/asm-mips/sn/sn0/addrs.h87
-rw-r--r--include/asm-mips/sn/sn0/arch.h17
-rw-r--r--include/asm-mips/sn/sn0/hub.h4
-rw-r--r--include/asm-mips/sn/sn0/hubio.h16
-rw-r--r--include/asm-mips/sn/sn0/hubmd.h2
-rw-r--r--include/asm-mips/sn/sn0/hubpi.h18
-rw-r--r--include/asm-mips/sn/sn0/ip27.h9
11 files changed, 20 insertions, 291 deletions
diff --git a/include/asm-mips/sn/addrs.h b/include/asm-mips/sn/addrs.h
index 2b5cef1ba37f..6c8a5577ddf1 100644
--- a/include/asm-mips/sn/addrs.h
+++ b/include/asm-mips/sn/addrs.h
@@ -27,13 +27,8 @@
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29 29
30#if defined(CONFIG_SGI_IO) /* FIXME */
31#define PS_UINT_CAST (__psunsigned_t)
32#define UINT64_CAST (__uint64_t)
33#else /* CONFIG_SGI_IO */
34#define PS_UINT_CAST (unsigned long) 30#define PS_UINT_CAST (unsigned long)
35#define UINT64_CAST (unsigned long) 31#define UINT64_CAST (unsigned long)
36#endif /* CONFIG_SGI_IO */
37 32
38#define HUBREG_CAST (volatile hubreg_t *) 33#define HUBREG_CAST (volatile hubreg_t *)
39 34
@@ -253,14 +248,6 @@
253 * for _x. 248 * for _x.
254 */ 249 */
255 250
256#ifdef _STANDALONE
257
258/* DO NOT USE THESE DIRECTLY IN THE KERNEL. SEE BELOW. */
259#define LOCAL_HUB(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
260#define REMOTE_HUB(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
261 0x800000 + (_x)))
262#endif /* _STANDALONE */
263
264/* 251/*
265 * WARNING: 252 * WARNING:
266 * When certain Hub chip workaround are defined, it's not sufficient 253 * When certain Hub chip workaround are defined, it's not sufficient
@@ -327,20 +314,6 @@
327 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET) 314 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET)
328#define ARCS_SPB_SIZE 0x0400 315#define ARCS_SPB_SIZE 0x0400
329 316
330#ifdef _STANDALONE
331
332#define ARCS_TVECTOR_OFFSET 0x2800
333#define ARCS_PVECTOR_OFFSET 0x2c00
334
335/*
336 * These addresses are used by the master CPU to install the transfer
337 * and private vectors. All others use the SPB to find them.
338 */
339#define TVADDR (NODE_CAC_BASE(get_nasid()) + ARCS_TVECTOR_OFFSET)
340#define PVADDR (NODE_CAC_BASE(get_nasid()) + ARCS_PVECTOR_OFFSET)
341
342#endif /* _STANDALONE */
343
344#define KLDIR_OFFSET 0x2000 317#define KLDIR_OFFSET 0x2000
345#define KLDIR_ADDR(nasid) \ 318#define KLDIR_ADDR(nasid) \
346 TO_NODE_UNCAC((nasid), KLDIR_OFFSET) 319 TO_NODE_UNCAC((nasid), KLDIR_OFFSET)
diff --git a/include/asm-mips/sn/sn0/sn0_fru.h b/include/asm-mips/sn/fru.h
index 82c6377c275a..b3e3606723b7 100644
--- a/include/asm-mips/sn/sn0/sn0_fru.h
+++ b/include/asm-mips/sn/fru.h
@@ -6,10 +6,10 @@
6 * Derived from IRIX <sys/SN/SN0/sn0_fru.h> 6 * Derived from IRIX <sys/SN/SN0/sn0_fru.h>
7 * 7 *
8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc. 8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 9 * Copyright (C) 1999, 2006 Ralf Baechle (ralf@linux-mips)
10 */ 10 */
11#ifndef _ASM_SN_SN0_SN0_FRU_H 11#ifndef __ASM_SN_FRU_H
12#define _ASM_SN_SN0_SN0_FRU_H 12#define __ASM_SN_FRU_H
13 13
14#define MAX_DIMMS 8 /* max # of dimm banks */ 14#define MAX_DIMMS 8 /* max # of dimm banks */
15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */ 15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */
@@ -41,4 +41,4 @@ typedef struct kf_pci_bus_s {
41 /* confidence level that the pci dev is bad */ 41 /* confidence level that the pci dev is bad */
42} kf_pci_bus_t; 42} kf_pci_bus_t;
43 43
44#endif /* _ASM_SN_SN0_SN0_FRU_H */ 44#endif /* __ASM_SN_FRU_H */
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
index 9709ff701d9b..dc706268d2cf 100644
--- a/include/asm-mips/sn/klconfig.h
+++ b/include/asm-mips/sn/klconfig.h
@@ -37,7 +37,7 @@
37//#include <sys/SN/router.h> 37//#include <sys/SN/router.h>
38// XXX Stolen from <sys/SN/router.h>: 38// XXX Stolen from <sys/SN/router.h>:
39#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */ 39#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */
40#include <asm/sn/sn0/sn0_fru.h> 40#include <asm/sn/fru.h>
41//#include <sys/graph.h> 41//#include <sys/graph.h>
42//#include <sys/xtalk/xbow.h> 42//#include <sys/xtalk/xbow.h>
43 43
@@ -54,32 +54,21 @@
54#include <asm/sn/agent.h> 54#include <asm/sn/agent.h>
55#include <asm/arc/types.h> 55#include <asm/arc/types.h>
56#include <asm/arc/hinv.h> 56#include <asm/arc/hinv.h>
57#if defined(CONFIG_SGI_IO) || defined(CONFIG_SGI_IP35) 57#if defined(CONFIG_SGI_IP35)
58// The hack file has to be before vector and after sn0_fru.... 58// The hack file has to be before vector and after sn0_fru....
59#include <asm/hack.h> 59#include <asm/hack.h>
60#include <asm/sn/vector.h> 60#include <asm/sn/vector.h>
61#include <asm/xtalk/xtalk.h> 61#include <asm/xtalk/xtalk.h>
62#endif /* CONFIG_SGI_IO || CONFIG_SGI_IP35 */ 62#endif /* CONFIG_SGI_IP35 */
63#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ 63#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */
64 64
65#define KLCFGINFO_MAGIC 0xbeedbabe 65#define KLCFGINFO_MAGIC 0xbeedbabe
66 66
67#ifdef FRUTEST
68typedef u64 klconf_off_t;
69#else
70typedef s32 klconf_off_t; 67typedef s32 klconf_off_t;
71#endif
72 68
73/* 69/*
74 * Some IMPORTANT OFFSETS. These are the offsets on all NODES. 70 * Some IMPORTANT OFFSETS. These are the offsets on all NODES.
75 */ 71 */
76#if 0
77#define RAMBASE 0
78#define ARCSSPB_OFF 0x1000 /* shift it to sys/arcs/spb.h */
79
80#define OFF_HWGRAPH 0
81#endif
82
83#define MAX_MODULE_ID 255 72#define MAX_MODULE_ID 255
84#define SIZE_PAD 4096 /* 4k padding for structures */ 73#define SIZE_PAD 4096 /* 4k padding for structures */
85/* 74/*
@@ -134,15 +123,9 @@ typedef s32 klconf_off_t;
134 123
135 124
136typedef struct console_s { 125typedef struct console_s {
137#if defined(CONFIG_SGI_IO) /* FIXME */
138 __psunsigned_t uart_base;
139 __psunsigned_t config_base;
140 __psunsigned_t memory_base;
141#else
142 unsigned long uart_base; 126 unsigned long uart_base;
143 unsigned long config_base; 127 unsigned long config_base;
144 unsigned long memory_base; 128 unsigned long memory_base;
145#endif
146 short baud; 129 short baud;
147 short flag; 130 short flag;
148 int type; 131 int type;
@@ -174,10 +157,6 @@ typedef struct kl_config_hdr {
174 157
175 158
176#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid))) 159#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
177#if 0
178#define KL_CONFIG_MALLOC_HDR(_nasid) \
179 (KL_CONFIG_HDR(_nasid)->ch_malloc_hdr)
180#endif
181#define KL_CONFIG_INFO_OFFSET(_nasid) \ 160#define KL_CONFIG_INFO_OFFSET(_nasid) \
182 (KL_CONFIG_HDR(_nasid)->ch_board_info) 161 (KL_CONFIG_HDR(_nasid)->ch_board_info)
183#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \ 162#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \
@@ -197,23 +176,13 @@ typedef struct kl_config_hdr {
197 176
198/* --- New Macros for the changed kl_config_hdr_t structure --- */ 177/* --- New Macros for the changed kl_config_hdr_t structure --- */
199 178
200#if defined(CONFIG_SGI_IO)
201#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
202 ((__psunsigned_t)_k + (_k->ch_malloc_hdr_off)))
203#else
204#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\ 179#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
205 (unsigned long)_k + (_k->ch_malloc_hdr_off))) 180 (unsigned long)_k + (_k->ch_malloc_hdr_off)))
206#endif
207 181
208#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n)) 182#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
209 183
210#if defined(CONFIG_SGI_IO)
211#define PTR_CH_CONS_INFO(_k) ((console_t *)\
212 ((__psunsigned_t)_k + (_k->ch_cons_off)))
213#else
214#define PTR_CH_CONS_INFO(_k) ((console_t *)\ 184#define PTR_CH_CONS_INFO(_k) ((console_t *)\
215 ((unsigned long)_k + (_k->ch_cons_off))) 185 ((unsigned long)_k + (_k->ch_cons_off)))
216#endif
217 186
218#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n)) 187#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
219 188
@@ -490,14 +459,6 @@ typedef struct lboard_s {
490#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts) 459#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
491#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module) 460#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module)
492 461
493#ifdef FRUTEST
494
495#define KLCF_NEXT(_brd) ((_brd)->brd_next ? (lboard_t *)((_brd)->brd_next): NULL)
496#define KLCF_COMP(_brd, _ndx) (klinfo_t *)((_brd)->brd_compts[(_ndx)])
497#define KLCF_COMP_ERROR(_brd, _comp) (_brd = _brd , (_comp)->errinfo)
498
499#else
500
501#define KLCF_NEXT(_brd) \ 462#define KLCF_NEXT(_brd) \
502 ((_brd)->brd_next ? \ 463 ((_brd)->brd_next ? \
503 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\ 464 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\
@@ -509,8 +470,6 @@ typedef struct lboard_s {
509#define KLCF_COMP_ERROR(_brd, _comp) \ 470#define KLCF_COMP_ERROR(_brd, _comp) \
510 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo)) 471 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo))
511 472
512#endif
513
514#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type) 473#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type)
515#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */ 474#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */
516 475
@@ -631,18 +590,6 @@ typedef struct klport_s {
631 klconf_off_t port_offset; 590 klconf_off_t port_offset;
632} klport_t; 591} klport_t;
633 592
634#if 0
635/*
636 * This is very similar to the klport_s but instead of having a componant
637 * offset it has a board offset.
638 */
639typedef struct klxbow_port_s {
640 nasid_t port_nasid;
641 unsigned char port_flag;
642 klconf_off_t board_offset;
643} klxbow_port_t;
644#endif
645
646typedef struct klcpu_s { /* CPU */ 593typedef struct klcpu_s { /* CPU */
647 klinfo_t cpu_info; 594 klinfo_t cpu_info;
648 unsigned short cpu_prid; /* Processor PRID value */ 595 unsigned short cpu_prid; /* Processor PRID value */
@@ -945,36 +892,6 @@ extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
945extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class); 892extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
946 893
947 894
948#if defined(CONFIG_SGI_IO)
949extern xwidgetnum_t nodevertex_widgetnum_get(vertex_hdl_t node_vtx);
950extern vertex_hdl_t nodevertex_xbow_peer_get(vertex_hdl_t node_vtx);
951extern lboard_t *find_gfxpipe(int pipenum);
952extern void setup_gfxpipe_link(vertex_hdl_t vhdl,int pipenum);
953extern lboard_t *find_lboard_module_class(lboard_t *start, moduleid_t mod,
954 unsigned char brd_class);
955extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
956extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
957extern lboard_t *find_lboard_modslot(lboard_t *start, moduleid_t mod, slotid_t slot);
958extern lboard_t *find_lboard_module(lboard_t *start, moduleid_t mod);
959extern lboard_t *get_board_name(nasid_t nasid, moduleid_t mod, slotid_t slot, char *name);
960extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
961extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
962extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
963extern klcpu_t *get_cpuinfo(cpuid_t cpu);
964extern int update_klcfg_cpuinfo(nasid_t, int);
965extern void board_to_path(lboard_t *brd, char *path);
966extern moduleid_t get_module_id(nasid_t nasid);
967extern void nic_name_convert(char *old_name, char *new_name);
968extern int module_brds(nasid_t nasid, lboard_t **module_brds, int n);
969extern lboard_t *brd_from_key(ulong_t key);
970extern void device_component_canonical_name_get(lboard_t *,klinfo_t *,
971 char *);
972extern int board_serial_number_get(lboard_t *,char *);
973extern int is_master_baseio(nasid_t,moduleid_t,slotid_t);
974extern nasid_t get_actual_nasid(lboard_t *brd) ;
975extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
976#else /* CONFIG_SGI_IO */
977extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu); 895extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
978#endif /* CONFIG_SGI_IO */
979 896
980#endif /* _ASM_SN_KLCONFIG_H */ 897#endif /* _ASM_SN_KLCONFIG_H */
diff --git a/include/asm-mips/sn/kldir.h b/include/asm-mips/sn/kldir.h
index f0efab1672ec..97ad52e3cbc7 100644
--- a/include/asm-mips/sn/kldir.h
+++ b/include/asm-mips/sn/kldir.h
@@ -13,10 +13,6 @@
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15 15
16#if defined(CONFIG_SGI_IO)
17#include <asm/hack.h>
18#endif
19
20/* 16/*
21 * The kldir memory area resides at a fixed place in each node's memory and 17 * The kldir memory area resides at a fixed place in each node's memory and
22 * provides pointers to most other IP27 memory areas. This allows us to 18 * provides pointers to most other IP27 memory areas. This allows us to
@@ -136,8 +132,6 @@
136#define KLDIR_OFF_STRIDE 0x28 132#define KLDIR_OFF_STRIDE 0x28
137#endif /* __ASSEMBLY__ */ 133#endif /* __ASSEMBLY__ */
138 134
139#if !defined(CONFIG_SGI_IO)
140
141/* 135/*
142 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what 136 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
143 * we define here. Since it's set up in the prom. We can't redefine it later 137 * we define here. Since it's set up in the prom. We can't redefine it later
@@ -147,7 +141,7 @@
147 */ 141 */
148#define SYMMON_STACK_SIZE 0x8000 142#define SYMMON_STACK_SIZE 0x8000
149 143
150#if defined (PROM) || defined (SABLE) 144#if defined (PROM)
151 145
152/* 146/*
153 * These defines are prom version dependent. No code other than the IP27 147 * These defines are prom version dependent. No code other than the IP27
@@ -184,7 +178,7 @@
184#define IP27_FREEMEM_COUNT 1 178#define IP27_FREEMEM_COUNT 1
185#define IP27_FREEMEM_STRIDE 0 179#define IP27_FREEMEM_STRIDE 0
186 180
187#endif /* PROM || SABLE*/ 181#endif /* PROM */
188/* 182/*
189 * There will be only one of these in a partition so the IO6 must set it up. 183 * There will be only one of these in a partition so the IO6 must set it up.
190 */ 184 */
@@ -207,17 +201,11 @@
207#define KLDIR_ENT_SIZE 0x40 201#define KLDIR_ENT_SIZE 0x40
208#define KLDIR_MAX_ENTRIES (0x400 / 0x40) 202#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
209 203
210#endif /* !CONFIG_SGI_IO */
211
212#ifndef __ASSEMBLY__ 204#ifndef __ASSEMBLY__
213typedef struct kldir_ent_s { 205typedef struct kldir_ent_s {
214 u64 magic; /* Indicates validity of entry */ 206 u64 magic; /* Indicates validity of entry */
215 off_t offset; /* Offset from start of node space */ 207 off_t offset; /* Offset from start of node space */
216#if defined(CONFIG_SGI_IO) /* FIXME */
217 __psunsigned_t pointer; /* Pointer to area in some cases */
218#else
219 unsigned long pointer; /* Pointer to area in some cases */ 208 unsigned long pointer; /* Pointer to area in some cases */
220#endif
221 size_t size; /* Size in bytes */ 209 size_t size; /* Size in bytes */
222 u64 count; /* Repeat count if array, 1 if not */ 210 u64 count; /* Repeat count if array, 1 if not */
223 size_t stride; /* Stride if array, 0 if not */ 211 size_t stride; /* Stride if array, 0 if not */
@@ -227,22 +215,4 @@ typedef struct kldir_ent_s {
227} kldir_ent_t; 215} kldir_ent_t;
228#endif /* !__ASSEMBLY__ */ 216#endif /* !__ASSEMBLY__ */
229 217
230#if defined(CONFIG_SGI_IO)
231
232#define KLDIR_ENT_SIZE 0x40
233#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
234
235/*
236 * The actual offsets of each memory area are machine-dependent
237 */
238#ifdef CONFIG_SGI_IP27
239// Not yet #include <asm/sn/sn0/kldir.h>
240#elif defined(CONFIG_SGI_IP35)
241#include <asm/sn/sn1/kldir.h>
242#else
243#error "kldir.h is currently defined for IP27 and IP35 platforms only"
244#endif
245
246#endif /* CONFIG_SGI_IO */
247
248#endif /* _ASM_SN_KLDIR_H */ 218#endif /* _ASM_SN_KLDIR_H */
diff --git a/include/asm-mips/sn/sn0/addrs.h b/include/asm-mips/sn/sn0/addrs.h
index 398815639fb8..2c4b758f6736 100644
--- a/include/asm-mips/sn/sn0/addrs.h
+++ b/include/asm-mips/sn/sn0/addrs.h
@@ -49,7 +49,7 @@
49 * so for now we just use defines bracketed by an ifdef. 49 * so for now we just use defines bracketed by an ifdef.
50 */ 50 */
51 51
52#ifdef CONFIG_SGI_SN0_N_MODE 52#ifdef CONFIG_SGI_SN_N_MODE
53 53
54#define NODE_SIZE_BITS 31 54#define NODE_SIZE_BITS 31
55#define BWIN_SIZE_BITS 28 55#define BWIN_SIZE_BITS 28
@@ -63,7 +63,7 @@
63#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10) 63#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10)
64#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3) 64#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3)
65 65
66#else /* !defined(CONFIG_SGI_SN0_N_MODE), assume that M-mode is desired */ 66#else /* !defined(CONFIG_SGI_SN_N_MODE), assume that M-mode is desired */
67 67
68#define NODE_SIZE_BITS 32 68#define NODE_SIZE_BITS 32
69#define BWIN_SIZE_BITS 29 69#define BWIN_SIZE_BITS 29
@@ -77,7 +77,7 @@
77#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10) 77#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10)
78#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3) 78#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3)
79 79
80#endif /* !defined(CONFIG_SGI_SN0_N_MODE) */ 80#endif /* !defined(CONFIG_SGI_SN_N_MODE) */
81 81
82#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS) 82#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS)
83 83
@@ -85,15 +85,15 @@
85#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ 85#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \
86 NASID_SHFT) & NASID_BITMASK) 86 NASID_SHFT) & NASID_BITMASK)
87 87
88#if !defined(__ASSEMBLY__) && !defined(_STANDALONE) 88#if !defined(__ASSEMBLY__)
89 89
90#define NODE_SWIN_BASE(nasid, widget) \ 90#define NODE_SWIN_BASE(nasid, widget) \
91 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ 91 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \
92 : RAW_NODE_SWIN_BASE(nasid, widget)) 92 : RAW_NODE_SWIN_BASE(nasid, widget))
93#else /* __ASSEMBLY__ || _STANDALONE */ 93#else /* __ASSEMBLY__ */
94#define NODE_SWIN_BASE(nasid, widget) \ 94#define NODE_SWIN_BASE(nasid, widget) \
95 (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS)) 95 (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS))
96#endif /* __ASSEMBLY__ || _STANDALONE */ 96#endif /* __ASSEMBLY__ */
97 97
98/* 98/*
99 * The following definitions pertain to the IO special address 99 * The following definitions pertain to the IO special address
@@ -143,12 +143,7 @@
143#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid))) 143#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid)))
144 144
145/* Turn on sable logging for the processors whose bits are set. */ 145/* Turn on sable logging for the processors whose bits are set. */
146#ifdef SABLE
147#define SABLE_LOG_TRIGGER(_map) \
148 *((volatile hubreg_t *)(IO_BASE + 0x17ffff0)) = (_map)
149#else
150#define SABLE_LOG_TRIGGER(_map) 146#define SABLE_LOG_TRIGGER(_map)
151#endif /* SABLE */
152 147
153#ifndef __ASSEMBLY__ 148#ifndef __ASSEMBLY__
154#define KERN_NMI_ADDR(nasid, slice) \ 149#define KERN_NMI_ADDR(nasid, slice) \
@@ -281,76 +276,6 @@
281 276
282#define _ARCSPROM 277#define _ARCSPROM
283 278
284#ifdef _STANDALONE
285
286/*
287 * The PROM needs to pass the device base address and the
288 * device pci cfg space address to the device drivers during
289 * install. The COMPONENT->Key field is used for this purpose.
290 * Macros needed by SN0 device drivers to convert the
291 * COMPONENT->Key field to the respective base address.
292 * Key field looks as follows:
293 *
294 * +----------------------------------------------------+
295 * |devnasid | widget |pciid |hubwidid|hstnasid | adap |
296 * | 2 | 1 | 1 | 1 | 2 | 1 |
297 * +----------------------------------------------------+
298 * | | | | | | |
299 * 64 48 40 32 24 8 0
300 *
301 * These are used by standalone drivers till the io infrastructure
302 * is in place.
303 */
304
305#ifndef __ASSEMBLY__
306
307#define uchar unsigned char
308
309#define KEY_DEVNASID_SHFT 48
310#define KEY_WIDID_SHFT 40
311#define KEY_PCIID_SHFT 32
312#define KEY_HUBWID_SHFT 24
313#define KEY_HSTNASID_SHFT 8
314
315#define MK_SN0_KEY(nasid, widid, pciid) \
316 ((((__psunsigned_t)nasid)<< KEY_DEVNASID_SHFT |\
317 ((__psunsigned_t)widid) << KEY_WIDID_SHFT) |\
318 ((__psunsigned_t)pciid) << KEY_PCIID_SHFT)
319
320#define ADD_HUBWID_KEY(key,hubwid)\
321 (key|=((__psunsigned_t)hubwid << KEY_HUBWID_SHFT))
322
323#define ADD_HSTNASID_KEY(key,hstnasid)\
324 (key|=((__psunsigned_t)hstnasid << KEY_HSTNASID_SHFT))
325
326#define GET_DEVNASID_FROM_KEY(key) ((short)(key >> KEY_DEVNASID_SHFT))
327#define GET_WIDID_FROM_KEY(key) ((uchar)(key >> KEY_WIDID_SHFT))
328#define GET_PCIID_FROM_KEY(key) ((uchar)(key >> KEY_PCIID_SHFT))
329#define GET_HUBWID_FROM_KEY(key) ((uchar)(key >> KEY_HUBWID_SHFT))
330#define GET_HSTNASID_FROM_KEY(key) ((short)(key >> KEY_HSTNASID_SHFT))
331
332#define PCI_64_TARGID_SHFT 60
333
334#define GET_PCIBASE_FROM_KEY(key) (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
335 GET_WIDID_FROM_KEY(key))\
336 | BRIDGE_DEVIO(GET_PCIID_FROM_KEY(key)))
337
338#define GET_PCICFGBASE_FROM_KEY(key) \
339 (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
340 GET_WIDID_FROM_KEY(key))\
341 | BRIDGE_TYPE0_CFG_DEV(GET_PCIID_FROM_KEY(key)))
342
343#define GET_WIDBASE_FROM_KEY(key) \
344 (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
345 GET_WIDID_FROM_KEY(key)))
346
347#define PUT_INSTALL_STATUS(c,s) c->Revision = s
348#define GET_INSTALL_STATUS(c) c->Revision
349
350#endif /* !__ASSEMBLY__ */
351
352#endif /* _STANDALONE */
353
354#if defined (HUB_ERR_STS_WAR) 279#if defined (HUB_ERR_STS_WAR)
355 280
356#define ERR_STS_WAR_REGISTER IIO_IIBUSERR 281#define ERR_STS_WAR_REGISTER IIO_IIBUSERR
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h
index fb78773a5efe..f7c43fa24aa8 100644
--- a/include/asm-mips/sn/sn0/arch.h
+++ b/include/asm-mips/sn/sn0/arch.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15 15
16#ifndef SABLE
17
18#ifndef SN0XXL /* 128 cpu SMP max */ 16#ifndef SN0XXL /* 128 cpu SMP max */
19/* 17/*
20 * This is the maximum number of nodes that can be part of a kernel. 18 * This is the maximum number of nodes that can be part of a kernel.
@@ -54,25 +52,16 @@
54 */ 52 */
55#define MAX_PARTITIONS MAX_REGIONS 53#define MAX_PARTITIONS MAX_REGIONS
56 54
57
58#else
59
60#define MAX_COMPACT_NODES 4
61#define MAX_NASIDS 4
62#define MAXCPUS 8
63
64#endif
65
66#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8) 55#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8)
67 56
68/* 57/*
69 * Slot constants for SN0 58 * Slot constants for SN0
70 */ 59 */
71#ifdef CONFIG_SGI_SN0_N_MODE 60#ifdef CONFIG_SGI_SN_N_MODE
72#define MAX_MEM_SLOTS 16 /* max slots per node */ 61#define MAX_MEM_SLOTS 16 /* max slots per node */
73#else /* !CONFIG_SGI_SN0_N_MODE, assume M_MODE */ 62#else /* !CONFIG_SGI_SN_N_MODE, assume CONFIG_SGI_SN_M_MODE */
74#define MAX_MEM_SLOTS 32 /* max slots per node */ 63#define MAX_MEM_SLOTS 32 /* max slots per node */
75#endif /* defined(N_MODE) */ 64#endif /* CONFIG_SGI_SN_M_MODE */
76 65
77#define SLOT_SHIFT (27) 66#define SLOT_SHIFT (27)
78#define SLOT_MIN_MEM_SIZE (32*1024*1024) 67#define SLOT_MIN_MEM_SIZE (32*1024*1024)
diff --git a/include/asm-mips/sn/sn0/hub.h b/include/asm-mips/sn/sn0/hub.h
index f5dbba6f4610..3e228f8e7969 100644
--- a/include/asm-mips/sn/sn0/hub.h
+++ b/include/asm-mips/sn/sn0/hub.h
@@ -31,10 +31,6 @@
31#include <asm/sn/sn0/hubni.h> 31#include <asm/sn/sn0/hubni.h>
32//#include <asm/sn/sn0/hubcore.h> 32//#include <asm/sn/sn0/hubcore.h>
33 33
34#ifdef SABLE
35#define IP27_NO_HUBUART_INT 1
36#endif
37
38/* Translation of uncached attributes */ 34/* Translation of uncached attributes */
39#define UATTR_HSPEC 0 35#define UATTR_HSPEC 0
40#define UATTR_IO 1 36#define UATTR_IO 1
diff --git a/include/asm-mips/sn/sn0/hubio.h b/include/asm-mips/sn/sn0/hubio.h
index f314da21b970..ef91b3363554 100644
--- a/include/asm-mips/sn/sn0/hubio.h
+++ b/include/asm-mips/sn/sn0/hubio.h
@@ -486,22 +486,6 @@ typedef union h1_icrba_u {
486#define ICRBN_A_CERR_SHFT 54 486#define ICRBN_A_CERR_SHFT 54
487#define ICRBN_A_ERR_MASK 0x3ff 487#define ICRBN_A_ERR_MASK 0x3ff
488 488
489#if 0 /* Disabled, this causes namespace polution and break allmodconfig */
490/*
491 * Easy access macros.
492 */
493#define a_error icrba_fields_s.error
494#define a_ecode icrba_fields_s.ecode
495#define a_lnetuce icrba_fields_s.lnetuce
496#define a_mark icrba_fields_s.mark
497#define a_xerr icrba_fields_s.xerr
498#define a_sidn icrba_fields_s.sidn
499#define a_tnum icrba_fields_s.tnum
500#define a_addr icrba_fields_s.addr
501#define a_valid icrba_fields_s.valid
502#define a_iow icrba_fields_s.iow
503#endif
504
505#endif /* !__ASSEMBLY__ */ 489#endif /* !__ASSEMBLY__ */
506 490
507#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */ 491#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */
diff --git a/include/asm-mips/sn/sn0/hubmd.h b/include/asm-mips/sn/sn0/hubmd.h
index a66def4e0ba0..1006aa26d771 100644
--- a/include/asm-mips/sn/sn0/hubmd.h
+++ b/include/asm-mips/sn/sn0/hubmd.h
@@ -92,7 +92,7 @@
92#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */ 92#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */
93#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */ 93#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */
94 94
95#ifdef CONFIG_SGI_SN0_N_MODE 95#ifdef CONFIG_SGI_SN_N_MODE
96#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */ 96#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */
97#else 97#else
98#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */ 98#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */
diff --git a/include/asm-mips/sn/sn0/hubpi.h b/include/asm-mips/sn/sn0/hubpi.h
index 355bba8552e3..e39f5f9da040 100644
--- a/include/asm-mips/sn/sn0/hubpi.h
+++ b/include/asm-mips/sn/sn0/hubpi.h
@@ -398,24 +398,6 @@ typedef u64 rtc_time_t;
398 398
399/* PI_RT_FILTER_CTRL mask and shift definitions */ 399/* PI_RT_FILTER_CTRL mask and shift definitions */
400 400
401#if 0
402/*
403 * XXX - This register's definition has changed, but it's only implemented
404 * in Hub 2.
405 */
406#define PRFC_DROP_COUNT_SHFT 27
407#define PRFC_DROP_COUNT_MASK (UINT64_CAST 0x3ff << 27)
408#define PRFC_DROP_CTR_SHFT 18
409#define PRFC_DROP_CTR_MASK (UINT64_CAST 0x1ff << 18)
410#define PRFC_MASK_ENABLE_SHFT 10
411#define PRFC_MASK_ENABLE_MASK (UINT64_CAST 0x7f << 10)
412#define PRFC_MASK_CTR_SHFT 2
413#define PRFC_MASK_CTR_MASK (UINT64_CAST 0xff << 2)
414#define PRFC_OFFSET_SHFT 0
415#define PRFC_OFFSET_MASK (UINT64_CAST 3)
416#endif /* 0 */
417
418
419/* 401/*
420 * Bits for NACK_CNT_A/B and NACK_CMP 402 * Bits for NACK_CNT_A/B and NACK_CMP
421 */ 403 */
diff --git a/include/asm-mips/sn/sn0/ip27.h b/include/asm-mips/sn/sn0/ip27.h
index ade0e974dd78..3c97e0855c8d 100644
--- a/include/asm-mips/sn/sn0/ip27.h
+++ b/include/asm-mips/sn/sn0/ip27.h
@@ -6,7 +6,7 @@
6 * Derived from IRIX <sys/SN/SN0/IP27.h>. 6 * Derived from IRIX <sys/SN/SN0/IP27.h>.
7 * 7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. 8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle 9 * Copyright (C) 1999, 2006 by Ralf Baechle
10 */ 10 */
11#ifndef _ASM_SN_SN0_IP27_H 11#ifndef _ASM_SN_SN0_IP27_H
12#define _ASM_SN_SN0_IP27_H 12#define _ASM_SN_SN0_IP27_H
@@ -82,11 +82,4 @@
82#define SEND_NMI(_nasid, _slice) \ 82#define SEND_NMI(_nasid, _slice) \
83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1) 83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1)
84 84
85/* Sanity hazzard ... Below all the Origin hacks are following. */
86
87#define SN00_BRIDGE 0x9200000008000000
88#define SN00I_BRIDGE0 0x920000000b000000
89#define SN00I_BRIDGE1 0x920000000e000000
90#define SN00I_BRIDGE2 0x920000000f000000
91
92#endif /* _ASM_SN_SN0_IP27_H */ 85#endif /* _ASM_SN_SN0_IP27_H */