cpuconf.c revision 1.22 1 1.22 ross /* $NetBSD: cpuconf.c,v 1.22 1999/06/29 06:50:41 ross 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.8 thorpej #include "opt_dec_3000_500.h"
40 1.8 thorpej #ifdef DEC_3000_500
41 1.7 mjacob extern void dec_3000_500_init __P((void));
42 1.7 mjacob #else
43 1.8 thorpej #define dec_3000_500_init platform_not_configured
44 1.7 mjacob #endif
45 1.1 cgd
46 1.8 thorpej #include "opt_dec_3000_300.h"
47 1.8 thorpej #ifdef DEC_3000_300
48 1.7 mjacob extern void dec_3000_300_init __P((void));
49 1.7 mjacob #else
50 1.8 thorpej #define dec_3000_300_init platform_not_configured
51 1.7 mjacob #endif
52 1.7 mjacob
53 1.8 thorpej #include "opt_dec_axppci_33.h"
54 1.8 thorpej #ifdef DEC_AXPPCI_33
55 1.7 mjacob extern void dec_axppci_33_init __P((void));
56 1.7 mjacob #else
57 1.8 thorpej #define dec_axppci_33_init platform_not_configured
58 1.7 mjacob #endif
59 1.7 mjacob
60 1.8 thorpej #include "opt_dec_kn8ae.h"
61 1.8 thorpej #ifdef DEC_KN8AE
62 1.7 mjacob extern void dec_kn8ae_init __P((void));
63 1.7 mjacob #else
64 1.8 thorpej #define dec_kn8ae_init platform_not_configured
65 1.7 mjacob #endif
66 1.7 mjacob
67 1.8 thorpej #include "opt_dec_2100_a50.h"
68 1.8 thorpej #ifdef DEC_2100_A50
69 1.7 mjacob extern void dec_2100_a50_init __P((void));
70 1.7 mjacob #else
71 1.8 thorpej #define dec_2100_a50_init platform_not_configured
72 1.7 mjacob #endif
73 1.7 mjacob
74 1.8 thorpej #include "opt_dec_kn20aa.h"
75 1.8 thorpej #ifdef DEC_KN20AA
76 1.7 mjacob extern void dec_kn20aa_init __P((void));
77 1.7 mjacob #else
78 1.8 thorpej #define dec_kn20aa_init platform_not_configured
79 1.7 mjacob #endif
80 1.7 mjacob
81 1.8 thorpej #include "opt_dec_eb64plus.h"
82 1.8 thorpej #ifdef DEC_EB64PLUS
83 1.7 mjacob extern void dec_eb64plus_init __P((void));
84 1.7 mjacob #else
85 1.8 thorpej #define dec_eb64plus_init platform_not_configured
86 1.7 mjacob #endif
87 1.7 mjacob
88 1.8 thorpej #include "opt_dec_eb164.h"
89 1.8 thorpej #ifdef DEC_EB164
90 1.7 mjacob extern void dec_eb164_init __P((void));
91 1.7 mjacob #else
92 1.8 thorpej #define dec_eb164_init platform_not_configured
93 1.7 mjacob #endif
94 1.1 cgd
95 1.9 ross #include "opt_avalon_a12.h"
96 1.9 ross #ifdef AVALON_A12
97 1.9 ross extern void avalon_a12_init __P((void));
98 1.9 ross #else
99 1.9 ross #define avalon_a12_init platform_not_configured
100 1.9 ross #endif
101 1.9 ross
102 1.11 mjacob #include "opt_dec_kn300.h"
103 1.11 mjacob #ifdef DEC_KN300
104 1.11 mjacob extern void dec_kn300_init __P((void));
105 1.11 mjacob #else
106 1.12 thorpej #define dec_kn300_init platform_not_configured
107 1.11 mjacob #endif
108 1.11 mjacob
109 1.14 thorpej #include "opt_dec_550.h"
110 1.14 thorpej #ifdef DEC_550
111 1.14 thorpej extern void dec_550_init __P((void));
112 1.14 thorpej #else
113 1.14 thorpej #define dec_550_init platform_not_configured
114 1.14 thorpej #endif
115 1.14 thorpej
116 1.17 ross #include "opt_dec_1000.h"
117 1.15 ross #include "opt_dec_1000a.h"
118 1.17 ross #if defined(DEC_1000) || defined(DEC_1000A)
119 1.15 ross extern void dec_1000a_init __P((void));
120 1.15 ross #else
121 1.15 ross #define dec_1000a_init platform_not_configured
122 1.15 ross #endif
123 1.15 ross
124 1.16 thorpej #include "opt_dec_alphabook1.h"
125 1.16 thorpej #ifdef DEC_ALPHABOOK1
126 1.16 thorpej extern void dec_alphabook1_init __P((void));
127 1.16 thorpej #else
128 1.16 thorpej #define dec_alphabook1_init platform_not_configured
129 1.16 thorpej #endif
130 1.16 thorpej
131 1.18 thorpej #include "opt_dec_eb66.h"
132 1.18 thorpej #ifdef DEC_EB66
133 1.18 thorpej extern void dec_eb66_init __P((void));
134 1.18 thorpej #else
135 1.18 thorpej #define dec_eb66_init platform_not_configured
136 1.18 thorpej #endif
137 1.18 thorpej
138 1.22 ross #include "opt_dec_6600.h"
139 1.22 ross #ifdef DEC_6600
140 1.22 ross extern void dec_6600_init __P((void));
141 1.22 ross #else
142 1.22 ross #define dec_6600_init platform_not_configured
143 1.22 ross #endif
144 1.22 ross
145 1.8 thorpej struct cpuinit cpuinit[] = {
146 1.8 thorpej cpu_notsupp("???"), /* 0: ??? */
147 1.8 thorpej cpu_notsupp("ST_ADU"), /* 1: ST_ADU */
148 1.8 thorpej cpu_notsupp("ST_DEC_4000"), /* 2: ST_DEC_4000 */
149 1.8 thorpej cpu_notsupp("ST_DEC_7000"), /* 3: ST_DEC_7000 */
150 1.8 thorpej cpu_init(dec_3000_500_init,"DEC_3000_500"), /* 4: ST_DEC_3000_500 */
151 1.8 thorpej cpu_notsupp("???"), /* 5: ??? */
152 1.8 thorpej cpu_notsupp("ST_DEC_2000_300"), /* 6: ST_DEC_2000_300 */
153 1.8 thorpej cpu_init(dec_3000_300_init,"DEC_3000_300"), /* 7: ST_DEC_3000_300 */
154 1.19 drochner cpu_init(avalon_a12_init,"AVALON_A12"), /* 8: ST_AVALON_A12 */
155 1.8 thorpej cpu_notsupp("ST_DEC_2100_A500"), /* 9: ST_DEC_2100_A500 */
156 1.8 thorpej cpu_notsupp("ST_DEC_APXVME_64"), /* 10: ST_DEC_APXVME_64 */
157 1.8 thorpej cpu_init(dec_axppci_33_init,"DEC_AXPPCI_33"),/* 11: ST_DEC_AXPPCI_33 */
158 1.8 thorpej cpu_init(dec_kn8ae_init,"DEC_KN8AE"), /* 12: ST_DEC_21000 */
159 1.8 thorpej cpu_init(dec_2100_a50_init,"DEC_2100_A50"), /* 13: ST_DEC_2100_A50 */
160 1.8 thorpej cpu_notsupp("ST_DEC_MUSTANG"), /* 14: ST_DEC_MUSTANG */
161 1.8 thorpej cpu_init(dec_kn20aa_init,"DEC_KN20AA"), /* 15: ST_DEC_KN20AA */
162 1.8 thorpej cpu_notsupp("???"), /* 16: ??? */
163 1.19 drochner cpu_init(dec_1000a_init,"DEC_1000"), /* 17: ST_DEC_1000 */
164 1.8 thorpej cpu_notsupp("???"), /* 18: ??? */
165 1.18 thorpej cpu_init(dec_eb66_init,"DEC_EB66"), /* 19: ST_EB66 */
166 1.8 thorpej cpu_init(dec_eb64plus_init,"DEC_EB64PLUS"), /* 20: ST_EB64P */
167 1.16 thorpej cpu_init(dec_alphabook1_init,"DEC_ALPHABOOK1"),/* 21: ST_ALPHABOOK1 */
168 1.19 drochner cpu_init(dec_kn300_init,"DEC_KN300"), /* 22: ST_DEC_4100 */
169 1.8 thorpej cpu_notsupp("ST_DEC_EV45_PBP"), /* 23: ST_DEC_EV45_PBP */
170 1.8 thorpej cpu_notsupp("ST_DEC_2100A_A500"), /* 24: ST_DEC_2100A_A500 */
171 1.8 thorpej cpu_notsupp("???"), /* 25: ??? */
172 1.8 thorpej cpu_init(dec_eb164_init,"DEC_EB164"), /* 26: ST_EB164 */
173 1.19 drochner cpu_init(dec_1000a_init, "DEC_1000A"), /* 27: ST_DEC_1000A */
174 1.10 thorpej cpu_notsupp("ST_DEC_ALPHAVME_224"), /* 28: ST_DEC_ALPHAVME_224 */
175 1.10 thorpej cpu_notsupp("???"), /* 29: ??? */
176 1.19 drochner cpu_init(dec_550_init,"DEC_550"), /* 30: ST_DEC_550 */
177 1.10 thorpej cpu_notsupp("???"), /* 31: ??? */
178 1.10 thorpej cpu_notsupp("ST_DEC_EV56_PBP"), /* 32: ST_DEC_EV56_PBP */
179 1.10 thorpej cpu_notsupp("ST_DEC_ALPHAVME_320"), /* 33: ST_DEC_ALPHAVME_320 */
180 1.22 ross cpu_init(dec_6600_init,"DEC_6600"), /* 34: ST_6600 */
181 1.1 cgd };
182 1.8 thorpej int ncpuinit = (sizeof(cpuinit) / sizeof(cpuinit[0]));
183 1.7 mjacob
184 1.7 mjacob void
185 1.8 thorpej platform_not_configured()
186 1.7 mjacob {
187 1.8 thorpej
188 1.7 mjacob printf("\n");
189 1.7 mjacob printf("Support for system type %d is not present in this kernel.\n",
190 1.7 mjacob cputype);
191 1.8 thorpej printf("Please build a kernel with \"options %s\" and reboot.\n",
192 1.8 thorpej cpuinit[cputype].option);
193 1.7 mjacob printf("\n");
194 1.8 thorpej panic("platform not configured\n");
195 1.8 thorpej }
196 1.8 thorpej
197 1.8 thorpej void
198 1.8 thorpej platform_not_supported()
199 1.8 thorpej {
200 1.8 thorpej const char *typestr;
201 1.8 thorpej
202 1.8 thorpej if (cputype >= ncpuinit)
203 1.8 thorpej typestr = "???";
204 1.8 thorpej else
205 1.8 thorpej typestr = cpuinit[cputype].option;
206 1.8 thorpej
207 1.8 thorpej printf("\n");
208 1.8 thorpej printf("NetBSD does not yet support system type %d (%s).\n", cputype,
209 1.8 thorpej typestr);
210 1.8 thorpej printf("\n");
211 1.8 thorpej panic("platform not supported");
212 1.7 mjacob }
213