cpuconf.c revision 1.7 1 1.7 mjacob /* $NetBSD: cpuconf.c,v 1.7 1997/09/23 23:15:43 mjacob Exp $ */
2 1.1 cgd
3 1.1 cgd /*
4 1.1 cgd * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 1.1 cgd *
6 1.1 cgd * Redistribution and use in source and binary forms, with or without
7 1.1 cgd * modification, are permitted provided that the following conditions
8 1.1 cgd * are met:
9 1.1 cgd * 1. Redistributions of source code must retain the above copyright
10 1.1 cgd * notice, this list of conditions and the following disclaimer.
11 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 cgd * notice, this list of conditions and the following disclaimer in the
13 1.1 cgd * documentation and/or other materials provided with the distribution.
14 1.1 cgd * 3. All advertising materials mentioning features or use of this software
15 1.1 cgd * must display the following acknowledgement:
16 1.1 cgd * This product includes software developed by Christopher G. Demetriou
17 1.1 cgd * for the NetBSD Project.
18 1.1 cgd * 4. The name of the author may not be used to endorse or promote products
19 1.1 cgd * derived from this software without specific prior written permission
20 1.1 cgd *
21 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 cgd * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 cgd * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 cgd * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 cgd * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 cgd * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 cgd * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 cgd * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 cgd * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 cgd * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 cgd */
32 1.1 cgd
33 1.1 cgd #include <sys/param.h>
34 1.1 cgd #include <sys/device.h>
35 1.7 mjacob #include <sys/systm.h>
36 1.1 cgd #include <machine/cpuconf.h>
37 1.7 mjacob #include <machine/rpb.h>
38 1.7 mjacob
39 1.7 mjacob #include "dec_3000_500.h"
40 1.7 mjacob #if NDEC_3000_500 > 0
41 1.7 mjacob extern void dec_3000_500_init __P((void));
42 1.7 mjacob #else
43 1.7 mjacob #define dec_3000_500_init nocpu
44 1.7 mjacob #endif
45 1.1 cgd
46 1.1 cgd #include "dec_3000_300.h"
47 1.7 mjacob #if NDEC_3000_300 > 0
48 1.7 mjacob extern void dec_3000_300_init __P((void));
49 1.7 mjacob #else
50 1.7 mjacob #define dec_3000_300_init nocpu
51 1.7 mjacob #endif
52 1.7 mjacob
53 1.1 cgd #include "dec_axppci_33.h"
54 1.7 mjacob #if NDEC_AXPPCI_33 > 0
55 1.7 mjacob extern void dec_axppci_33_init __P((void));
56 1.7 mjacob #else
57 1.7 mjacob #define dec_axppci_33_init nocpu
58 1.7 mjacob #endif
59 1.7 mjacob
60 1.7 mjacob #include "dec_kn8ae.h"
61 1.7 mjacob #if NDEC_KN8AE > 0
62 1.7 mjacob extern void dec_kn8ae_init __P((void));
63 1.7 mjacob #else
64 1.7 mjacob #define dec_kn8ae_init nocpu
65 1.7 mjacob #endif
66 1.7 mjacob
67 1.7 mjacob #include "dec_2100_a50.h"
68 1.7 mjacob #if NDEC_2100_A50 > 0
69 1.7 mjacob extern void dec_2100_a50_init __P((void));
70 1.7 mjacob #else
71 1.7 mjacob #define dec_2100_a50_init nocpu
72 1.7 mjacob #endif
73 1.7 mjacob
74 1.7 mjacob #include "dec_kn20aa.h"
75 1.7 mjacob #if NDEC_KN20AA > 0
76 1.7 mjacob extern void dec_kn20aa_init __P((void));
77 1.7 mjacob #else
78 1.7 mjacob #define dec_kn20aa_init nocpu
79 1.7 mjacob #endif
80 1.7 mjacob
81 1.7 mjacob #include "dec_eb64plus.h"
82 1.7 mjacob #if NDEC_EB64PLUS > 0
83 1.7 mjacob extern void dec_eb64plus_init __P((void));
84 1.7 mjacob #else
85 1.7 mjacob #define dec_eb64plus_init nocpu
86 1.7 mjacob #endif
87 1.7 mjacob
88 1.1 cgd #include "dec_eb164.h"
89 1.7 mjacob #if NDEC_EB164 > 0
90 1.7 mjacob extern void dec_eb164_init __P((void));
91 1.7 mjacob #else
92 1.7 mjacob #define dec_eb164_init nocpu
93 1.7 mjacob #endif
94 1.1 cgd
95 1.7 mjacob void (*cpuinit[]) __P((void)) = {
96 1.7 mjacob nocpu, /* 0: ??? */
97 1.7 mjacob nocpu, /* 1: ST_ADU */
98 1.7 mjacob nocpu, /* 2: ST_DEC_4000 */
99 1.7 mjacob nocpu, /* 3: ST_DEC_7000 */
100 1.7 mjacob dec_3000_500_init, /* 4: ST_DEC_3000_500 */
101 1.7 mjacob nocpu, /* 5: ??? */
102 1.7 mjacob nocpu, /* 6: ST_DEC_2000_300 */
103 1.7 mjacob dec_3000_300_init, /* 7: ST_DEC_3000_300 */
104 1.7 mjacob nocpu, /* 8: ??? */
105 1.7 mjacob nocpu, /* 9: ST_DEC_2100_A500 */
106 1.7 mjacob nocpu, /* 10: ST_DEC_APXVME_64 */
107 1.7 mjacob dec_axppci_33_init, /* 11: ST_DEC_AXPPCI_33 */
108 1.7 mjacob dec_kn8ae_init, /* 12: ST_DEC_21000 */
109 1.7 mjacob dec_2100_a50_init, /* 13: ST_DEC_2100_A50 */
110 1.7 mjacob nocpu, /* 14: ST_DEC_MUSTANG */
111 1.7 mjacob dec_kn20aa_init, /* 15: ST_DEC_KN20AA */
112 1.7 mjacob nocpu, /* 16: ??? */
113 1.7 mjacob nocpu, /* 17: ST_DEC_1000 */
114 1.7 mjacob nocpu, /* 18: ??? */
115 1.7 mjacob nocpu, /* 19: ST_EB66 */
116 1.7 mjacob dec_eb64plus_init, /* 20: ST_EB64P */
117 1.7 mjacob nocpu, /* 21: ??? */
118 1.7 mjacob nocpu, /* 22: ST_DEC_4100 */
119 1.7 mjacob nocpu, /* 23: ST_DEC_EV45_PBP */
120 1.7 mjacob nocpu, /* 24: ST_DEC_2100A_A500 */
121 1.7 mjacob nocpu, /* 25: ??? */
122 1.7 mjacob dec_eb164_init /* 26: ST_EB164 */
123 1.1 cgd };
124 1.7 mjacob int ncpuinit = (sizeof (cpuinit) / sizeof (cpuinit[0]));
125 1.7 mjacob
126 1.7 mjacob void
127 1.7 mjacob nocpu()
128 1.7 mjacob {
129 1.7 mjacob extern int cputype;
130 1.7 mjacob printf("\n");
131 1.7 mjacob printf("Support for system type %d is not present in this kernel.\n",
132 1.7 mjacob cputype);
133 1.7 mjacob if (unknown_cpu(cputype)) {
134 1.7 mjacob printf("NetBSD doesn't support this platform yet.\n");
135 1.7 mjacob } else {
136 1.7 mjacob char *o;
137 1.7 mjacob switch (cputype) {
138 1.7 mjacob case ST_DEC_3000_500:
139 1.7 mjacob o = "DEC_3000_500";
140 1.7 mjacob break;
141 1.7 mjacob case ST_DEC_3000_300:
142 1.7 mjacob o = "DEC_3000_300";
143 1.7 mjacob break;
144 1.7 mjacob case ST_DEC_AXPPCI_33:
145 1.7 mjacob o = "DEC_AXPPCI_33";
146 1.7 mjacob break;
147 1.7 mjacob case ST_DEC_21000:
148 1.7 mjacob o = "DEC_KN8AE";
149 1.7 mjacob break;
150 1.7 mjacob case ST_DEC_2100_A50:
151 1.7 mjacob o = "DEC_2100_A50";
152 1.7 mjacob break;
153 1.7 mjacob case ST_DEC_KN20AA:
154 1.7 mjacob o = "DEC_KN20AA";
155 1.7 mjacob break;
156 1.7 mjacob case ST_EB64P:
157 1.7 mjacob o = "DEC_EB64PLUS";
158 1.7 mjacob break;
159 1.7 mjacob case ST_EB164:
160 1.7 mjacob o = "DEC_EB164";
161 1.7 mjacob break;
162 1.7 mjacob default:
163 1.7 mjacob o = "JESUS_KNOWS";
164 1.7 mjacob break;
165 1.7 mjacob }
166 1.7 mjacob printf("Build a kernel with \"options %s\" and reboot.\n", o);
167 1.7 mjacob }
168 1.7 mjacob printf("\n");
169 1.7 mjacob panic("support for system not present");
170 1.7 mjacob /* NOTREACHED */
171 1.7 mjacob }
172