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