xref: /original-bsd/sys/vax/vax/cpudata.c (revision 1d767c41)
1 /*
2  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)cpudata.c	7.6 (Berkeley) 12/16/90
7  */
8 
9 #include "../include/pte.h"
10 
11 #include "sys/param.h"
12 
13 #include "../include/cpu.h"
14 #include "nexus.h"
15 #include "ioa.h"
16 #include "../bi/bireg.h"
17 #include "../uba/ubareg.h"
18 
19 /*
20  * Initialization of per-cpu data structures.
21  */
22 
23 /*
24  * These are the (fixed) physical addresses of the
25  * unibus memory for each of the possible unibus adapters.
26  * Note that on some machines the unibus memory addresses
27  * are actually indexed by the unibus adapter type code.
28  */
29 #if VAX8600
30 caddr_t umaddr8600a[4] = {
31 	(caddr_t) UMEMA8600(0),	(caddr_t) UMEMA8600(1),
32 	(caddr_t) UMEMA8600(2),	(caddr_t) UMEMA8600(3),
33 };
34 caddr_t umaddr8600b[4] = {
35 	(caddr_t) UMEMB8600(0),	(caddr_t) UMEMB8600(1),
36 	(caddr_t) UMEMB8600(2),	(caddr_t) UMEMB8600(3),
37 };
38 #endif
39 #if VAX780
40 caddr_t	umaddr780[4] = {
41 	(caddr_t) UMEM780(0), (caddr_t) UMEM780(1),
42 	(caddr_t) UMEM780(2), (caddr_t) UMEM780(3)
43 };
44 #endif
45 #if VAX750
46 caddr_t	umaddr750[2] = {
47 	(caddr_t) UMEM750(0), (caddr_t) UMEM750(1),
48 };
49 #endif
50 #if VAX730
51 caddr_t	umaddr730[1] = {
52 	(caddr_t) UMEM730
53 };
54 #endif
55 
56 /*
57  * Information to patch around the stupidity of configuration
58  * registers not returning types on some of the processors.
59  */
60 #if VAX750
61 short	nexty750[NNEX750] = {
62 	NEX_MEM16,	NEX_MEM16,	NEX_MEM16,	NEX_MEM16,
63 	NEX_MBA,	NEX_MBA,	NEX_MBA,	NEX_MBA,
64 	NEX_UBA0,	NEX_UBA1,	NEX_ANY,	NEX_ANY,
65 	NEX_ANY,	NEX_ANY,	NEX_ANY,	NEX_ANY
66 };
67 #endif
68 #if VAX730
69 short	nexty730[NNEX730] = {
70 	NEX_MEM16,	NEX_ANY,	NEX_ANY,	NEX_ANY,
71 	NEX_ANY,	NEX_ANY,	NEX_ANY,	NEX_ANY,
72 };
73 #endif
74 
75 #if VAX8800
76 /* I think this is how the thing is shaped: */
77 struct bibus bi8800[] = {
78 	{ BI_BASE(0) },
79 	{ BI_BASE(1) },
80 };
81 struct iobus io8800 = {
82 	{ IO_BIA, somewhere, somesize, (caddr_t)&bi8800[0] },
83 	{ IO_BIA, somewhere, somesize, (caddr_t)&bi8800[1] },
84 };
85 /* but you will have to make it work yourself (sorry) */
86 #endif
87 
88 #if VAX8600
89 struct nexusconnect sbi8600[] = {
90 	{ NNEX8600, NEXA8600, DW780, NBDP8600, umaddr8600a, 0 },
91 	{ NNEX8600, NEXB8600, DW780, NBDP8600, umaddr8600b, 0 },
92 };
93 struct iobus io8600[] = {
94 	{ IO_ABUS, IOA8600(0), IOAMAPSIZ, (caddr_t)&sbi8600[0] },
95 	{ IO_ABUS, IOA8600(1), IOAMAPSIZ, (caddr_t)&sbi8600[1] },
96 };
97 #endif
98 
99 #if VAX8200
100 /* BEWARE, this is all limited to one BI for now */
101 struct bibus bi8200[] = {
102 	{ BI_BASE(0) },
103 };
104 struct iobus io8200[] = {
105 	{ IO_BI, 0, 0, (caddr_t)&bi8200[0] },
106 };
107 #endif
108 
109 #if VAX780
110 struct nexusconnect sbi780 = {
111 	NNEX780, NEX780, DW780, NBDP780, umaddr780, 0,
112 };
113 struct iobus io780[] = { IO_SBI780, 0, 0, (caddr_t)&sbi780 };
114 #endif
115 
116 #if VAX750
117 struct nexusconnect cmi750 = {
118 	NNEX750, NEX750, DW750, NBDP750, umaddr750, nexty750,
119 };
120 struct iobus io750[] = { IO_CMI750, 0, 0, (caddr_t)&cmi750 };
121 #endif
122 
123 #if VAX730
124 struct nexusconnect xxx730 = {
125 	NNEX730, NEX730, DW730, NBDP730, umaddr730, nexty730,
126 };
127 struct iobus io730[] = { IO_XXX730, 0, 0, (caddr_t)&xxx730 };
128 #endif
129 #if VAX630 || VAX650
130 struct qbus qbus630 = {
131 	QBA, QBAPAGES, QBAMAP630, (caddr_t)QMEM630, (caddr_t)QIOPAGE630
132 };
133 struct iobus io630[] = { IO_QBUS, 0, 0, (caddr_t)&qbus630 };
134 #endif
135 
136 /*
137  * Clock info
138  */
139 #if VAX8600 || VAX780 || VAX750 || VAX730
140 int vaxstd_clkstartrt(), vaxstd_clkread(), vaxstd_clkwrite();
141 struct clockops vaxstd_clockops = {
142 	vaxstd_clkstartrt, vaxstd_clkread, vaxstd_clkwrite
143 };
144 #endif
145 
146 #if VAX8200
147 int vaxstd_clkstartrt(), ka820_clkread(), ka820_clkwrite();
148 struct clockops ka820_clockops = {
149 	vaxstd_clkstartrt, ka820_clkread, ka820_clkwrite
150 };
151 #endif
152 
153 #if VAX630
154 int ka630_clkstartrt(), ka630_clkread(), ka630_clkwrite();
155 struct clockops ka630_clockops = {
156 	ka630_clkstartrt, ka630_clkread, ka630_clkwrite
157 };
158 #endif
159 
160 #if VAX650
161 int ka650_clkstartrt(), vaxstd_clkread(), vaxstd_clkwrite();
162 struct clockops ka650_clockops = {
163 	ka650_clkstartrt, vaxstd_clkread, vaxstd_clkwrite
164 };
165 #endif
166 
167 /*
168  * CPU dependent routines.
169  */
170 #if VAX8600
171 int	ka860_memenable(), ka860_memerr(), ka860_mchk();
172 struct	cpuops ka860_ops = {
173 	&vaxstd_clockops, ka860_memenable, ka860_memerr, ka860_mchk, NULL
174 };
175 #endif
176 
177 #if VAX8200
178 int	ka820_memenable(), ka820_memerr(), ka820_mchk(), ka820_init();
179 struct	cpuops ka820_ops = {
180 	&ka820_clockops, ka820_memenable, ka820_memerr, ka820_mchk, ka820_init
181 };
182 #endif
183 
184 #if VAX780
185 int	ka780_memenable(), ka780_memerr(), ka780_mchk();
186 struct	cpuops ka780_ops = {
187 	&vaxstd_clockops, ka780_memenable, ka780_memerr, ka780_mchk, NULL
188 };
189 #endif
190 
191 #if VAX750
192 int	ka750_memenable(), ka750_memerr(), ka750_mchk();
193 struct	cpuops ka750_ops = {
194 	&vaxstd_clockops, ka750_memenable, ka750_memerr, ka750_mchk, NULL
195 };
196 #endif
197 
198 #if VAX730
199 int	ka730_memenable(), ka730_memerr(), ka730_mchk();
200 struct	cpuops ka730_ops = {
201 	&vaxstd_clockops, ka730_memenable, ka730_memerr, ka730_mchk, NULL
202 };
203 #endif
204 
205 #if VAX630
206 int	ka630_memnop(), ka630_mchk(), ka630_init();
207 struct	cpuops ka630_ops = {
208 	&ka630_clockops, ka630_memnop, ka630_memnop, ka630_mchk, ka630_init
209 };
210 #endif
211 
212 #if VAX650
213 int	ka650_memnop(), ka650_memerr(), ka650_mchk(), ka650_init();
214 struct	cpuops ka650_ops = {
215 	&ka650_clockops, ka650_memnop, ka650_memerr, ka650_mchk, ka650_init
216 };
217 #endif
218 
219 struct percpu percpu[] = {
220 #if VAX8600
221 	{ VAX_8600, 6, 2, io8600, &ka860_ops },
222 #endif
223 #if VAX8200
224 	{ VAX_8200, 2, 1, io8200, &ka820_ops },
225 #endif
226 #if VAX780
227 	{ VAX_780, 2, 1, io780, &ka780_ops },
228 #endif
229 #if VAX750
230 	{ VAX_750, 1, 1, io750, &ka750_ops },
231 #endif
232 #if VAX730
233 	{ VAX_730, 1, 1, io730, &ka730_ops },
234 #endif
235 #if VAX630
236 	{ VAX_630, 2, 1, io630, &ka630_ops },
237 #endif
238 #if VAX650
239 	{ VAX_650, 4, 1, io630, &ka650_ops },
240 #endif
241 	0,
242 };
243