nexus.h revision 1.16 1 /* $NetBSD: nexus.h,v 1.16 2000/01/24 02:40:32 matt Exp $ */
2
3 /*-
4 * Copyright (c) 1982, 1986 The Regents of the University of California.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)nexus.h 7.3 (Berkeley) 5/9/91
36 */
37
38 #ifndef _VAX_NEXUS_H_
39 #define _VAX_NEXUS_H_
40
41 #ifdef _KERNEL
42 #include "opt_vax8600.h"
43 #include "opt_vax780.h"
44 #include "opt_vax750.h"
45 #include "opt_vax730.h"
46 #endif
47 /*
48 * Different definitions for nicer autoconf probing.
49 */
50 enum bustypes {
51 VAX_SBIBUS, /* SBI parent (780) */
52 VAX_CMIBUS, /* CMI backplane (750) */
53 VAX_UNIBUS, /* Direct backplane (730) */
54 VAX_ABUS, /* SBI placeholder (8600) */
55 VAX_BIBUS, /* BI bus (8200) */
56 VAX_NBIBUS, /* NBI backplane (8800) */
57 VAX_VSBUS, /* Virtual vaxstation bus */
58 VAX_IBUS, /* Internal Microvax bus */
59 VAX_XMIBUS, /* XMI master bus (6000) */
60 };
61 /*
62 * Information about nexus's.
63 *
64 * Each machine has an address of backplane slots (nexi).
65 * Each nexus is some type of adapter, whose code is the low
66 * byte of the first word of the adapter address space.
67 * At boot time the system looks through the array of available
68 * slots and finds the interconnects for the machine.
69 */
70 #define IO_CMI750 2
71 #define MAXNMCR 1
72
73 #define NNEXSBI 16
74 #if VAX8600
75 #define NNEX8600 NNEXSBI
76 #define NEXA8600 ((struct nexus *)(0x20000000))
77 #define NEXB8600 ((struct nexus *)(0x22000000))
78 #endif
79 #if VAX780
80 #define NNEX780 NNEXSBI
81 #define NEX780 ((struct nexus *)0x20000000)
82 #endif
83 #if VAX730
84 #define NNEX730 NNEXSBI
85 #define NEX730 ((struct nexus *)0xf20000)
86 #endif
87 #define NEXSIZE 0x2000
88
89 #if VAX8600
90 #define MAXNNEXUS (2 * NNEXSBI)
91 #else
92 #define MAXNNEXUS NNEXSBI
93 #endif
94
95 #ifdef _KERNEL
96
97 struct nexus {
98 union nexcsr {
99 long nex_csr;
100 u_char nex_type;
101 } nexcsr;
102 long nex_pad[NEXSIZE / sizeof (long) - 1];
103 };
104
105 struct sbi_attach_args {
106 u_int nexnum; /* This nexus TR number */
107 u_int type; /* This nexus type */
108 int nexinfo; /* Some info sent between attach & match */
109 void *nexaddr; /* Virtual address of this nexus */
110 };
111
112 /* Memory device struct. This should be somewhere else */
113 struct mem_softc {
114 struct device sc_dev;
115 caddr_t sc_memaddr;
116 int sc_memtype;
117 int sc_memnr;
118 };
119
120 struct bp_conf {
121 char *type;
122 int num;
123 int partyp;
124 int bp_addr;
125 };
126
127 extern caddr_t *nex_vec;
128 #define nex_vec_num(ipl, nexnum) nex_vec[(ipl-14)*16+nexnum]
129
130 #endif
131
132 /*
133 * Bits in high word of nexus's.
134 */
135 #define SBI_PARFLT (1<<31) /* sbi parity fault */
136 #define SBI_WSQFLT (1<<30) /* write sequence fault */
137 #define SBI_URDFLT (1<<29) /* unexpected read data fault */
138 #define SBI_ISQFLT (1<<28) /* interlock sequence fault */
139 #define SBI_MXTFLT (1<<27) /* multiple transmitter fault */
140 #define SBI_XMTFLT (1<<26) /* transmit fault */
141
142 #define NEX_CFGFLT (0xfc000000)
143
144 #ifndef _LOCORE
145 #if VAX780 || VAX8600
146 #define NEXFLT_BITS \
147 "\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT"
148 #endif
149 #endif
150
151 #define NEX_APD (1<<23) /* adaptor power down */
152 #define NEX_APU (1<<22) /* adaptor power up */
153
154 #define MBA_OT (1<<21) /* overtemperature */
155
156 #define UBA_UBINIT (1<<18) /* unibus init */
157 #define UBA_UBPDN (1<<17) /* unibus power down */
158 #define UBA_UBIC (1<<16) /* unibus initialization complete */
159
160 /*
161 * Types for nex_type.
162 */
163 #define NEX_ANY 0 /* pseudo for handling 11/750 */
164 #define NEX_MEM4 0x08 /* 4K chips, non-interleaved mem */
165 #define NEX_MEM4I 0x09 /* 4K chips, interleaved mem */
166 #define NEX_MEM16 0x10 /* 16K chips, non-interleaved mem */
167 #define NEX_MEM16I 0x11 /* 16K chips, interleaved mem */
168 #define NEX_MBA 0x20 /* Massbus adaptor */
169 #define NEX_UBA0 0x28 /* Unibus adaptor */
170 #define NEX_UBA1 0x29 /* 4 flavours for 4 addr spaces */
171 #define NEX_UBA2 0x2a
172 #define NEX_UBA3 0x2b
173 #define NEX_DR32 0x30 /* DR32 user i'face to SBI */
174 #define NEX_CI 0x38 /* CI adaptor */
175 #define NEX_MPM0 0x40 /* Multi-port mem */
176 #define NEX_MPM1 0x41 /* Who knows why 4 different ones ? */
177 #define NEX_MPM2 0x42
178 #define NEX_MPM3 0x43
179 #define NEX_MEM64L 0x68 /* 64K chips, non-interleaved, lower */
180 #define NEX_MEM64LI 0x69 /* 64K chips, ext-interleaved, lower */
181 #define NEX_MEM64U 0x6a /* 64K chips, non-interleaved, upper */
182 #define NEX_MEM64UI 0x6b /* 64K chips, ext-interleaved, upper */
183 #define NEX_MEM64I 0x6c /* 64K chips, interleaved */
184 #define NEX_MEM256L 0x70 /* 256K chips, non-interleaved, lower */
185 #define NEX_MEM256LI 0x71 /* 256K chips, ext-interleaved, lower */
186 #define NEX_MEM256U 0x72 /* 256K chips, non-interleaved, upper */
187 #define NEX_MEM256UI 0x73 /* 256K chips, ext-interleaved, upper */
188 #define NEX_MEM256I 0x74 /* 256K chips, interleaved */
189
190 /* Memory classes */
191 #define M780C 0
192 #define M780EL 1
193 #define M780EU 2
194
195 /* Memory recover defines */
196 #define MCHK_PANIC -1
197 #define MCHK_RECOVERED 0
198
199 #endif /* _VAX_NEXUS_H_ */
200