]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/alpha/alpha/cpuconf.c
merge fix for boot-time hang on centos' xen
[FreeBSD/FreeBSD.git] / sys / alpha / alpha / cpuconf.c
1 /*-
2  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  * 3. All advertising materials mentioning features or use of this software
13  *    must display the following acknowledgement:
14  *      This product includes software developed by Christopher G. Demetriou
15  *      for the NetBSD Project.
16  * 4. The name of the author may not be used to endorse or promote products
17  *    derived from this software without specific prior written permission
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  *      $NetBSD: cpuconf.c,v 1.10 1998/03/20 21:48:21 thorpej Exp $
31  */
32
33 #include <sys/cdefs.h>
34 __FBSDID("$FreeBSD$");
35
36 #include "opt_cpu.h"
37
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/bus.h>
41
42 #include <machine/cpuconf.h>
43 #include <machine/md_var.h>
44 #include <machine/rpb.h>
45
46 #ifdef DEC_AXPPCI_33
47 extern void dec_axppci_33_init(int);
48 #else
49 #define dec_axppci_33_init      platform_not_configured
50 #endif
51
52 #ifdef DEC_KN8AE
53 extern void dec_kn8ae_init(int);
54 #else
55 #define dec_kn8ae_init          platform_not_configured
56 #endif
57
58 #ifdef DEC_2100_A50
59 extern void dec_2100_a50_init(int);
60 #else
61 #define dec_2100_a50_init       platform_not_configured
62 #endif
63
64 #ifdef DEC_KN20AA
65 extern void dec_kn20aa_init(int);
66 #else
67 #define dec_kn20aa_init         platform_not_configured
68 #endif
69
70 #ifdef DEC_EB64PLUS
71 extern void dec_eb64plus_init(int);
72 #else
73 #define dec_eb64plus_init       platform_not_configured
74 #endif
75
76 #ifdef DEC_EB164
77 extern void dec_eb164_init(int);
78 #else
79 #define dec_eb164_init          platform_not_configured
80 #endif
81
82 #ifdef DEC_KN300
83 extern void dec_kn300_init(int);
84 #else
85 #define dec_kn300_init          platform_not_configured
86 #endif
87
88 #ifdef AVALON_A12
89 extern void avalon_a12_init(int);
90 #else
91 #define avalon_a12_init         platform_not_configured
92 #endif
93
94 #ifdef DEC_ST550
95 extern void st550_init(int);
96 #else
97 #define st550_init              platform_not_configured
98 #endif
99
100 #ifdef DEC_ST6600
101 extern void st6600_init(int);
102 #else
103 #define st6600_init             platform_not_configured
104 #endif
105
106 #ifdef DEC_1000A
107 extern void dec_1000a_init(int);
108 #else
109 #define dec_1000a_init          platform_not_configured
110 #endif
111
112 #ifdef DEC_2100_A500
113 extern void dec_2100_a500_init(int);
114 #else
115 #define dec_2100_a500_init     platform_not_configured
116 #endif
117
118 #ifdef API_UP1000
119 extern void api_up1000_init(int);
120 #else
121 #define     api_up1000_init platform_not_configured
122 #endif
123
124 struct cpuinit cpuinit[] = {
125         cpu_notsupp("???"),                             /*  0: ??? */
126         cpu_notsupp("ST_ADU"),                          /*  1: ADU */
127         cpu_notsupp("ST_DEC_4000"),                     /*  2: Cobra */
128         cpu_notsupp("ST_DEC_7000"),                     /*  3: Ruby */
129         cpu_notsupp("DEC_3000_500"),                    /*  4: Flamingo */
130         cpu_notsupp("???"),                             /*  5: simulator */
131         cpu_notsupp("ST_DEC_2000_300"),                 /*  6: Jensen */
132         cpu_notsupp("DEC_3000_300"),                    /*  7: Pelican */
133         cpu_init(avalon_a12_init,"ST_AVALON_A12"),      /*  8: AVALON */
134         cpu_init(dec_2100_a500_init, "ST_DEC_2100_A500"), /*  9: Sable */
135         cpu_notsupp("ST_DEC_APXVME_64"),                /* 10: AXPvme */
136         cpu_init(dec_axppci_33_init,"DEC_AXPPCI_33"),   /* 11: NoName */
137         cpu_init(dec_kn8ae_init,"DEC_KN8AE"),           /* 12: Turbolaser */
138         cpu_init(dec_2100_a50_init,"DEC_2100_A50"),     /* 13: Avanti */
139         cpu_notsupp("ST_DEC_MUSTANG"),                  /* 14: Mustang */
140         cpu_init(dec_kn20aa_init,"DEC_KN20AA"),         /* 15: Alcor */
141         cpu_notsupp("cancelled"),                       /* 16: cancelled */
142         cpu_init(dec_1000a_init, "ST_DEC_1000"),        /* 17: Mikasa */
143         cpu_notsupp("ST_DEC_EB64"),                     /* 18: EB64 */
144         cpu_notsupp("ST_EB66"),                         /* 19: EB66 */
145         cpu_init(dec_eb64plus_init,"DEC_EB64PLUS"),     /* 20: EB64+ */
146         cpu_notsupp("ST_ALPHABOOK1"),                   /* 21: AlphaBook */
147         cpu_init(dec_kn300_init,"DEC_KN300"),           /* 22: Rawhide */
148         cpu_notsupp("ST_DEC_EV45_PBP"),                 /* 23: K2 */
149         cpu_init(dec_2100_a500_init, "ST_DEC_2100A_A500"), /* 24: Lynx */
150         cpu_notsupp("ST_DEC_ALPHAXL"),                  /* 25: AlphaXL */
151         cpu_init(dec_eb164_init,"DEC_EB164"),           /* 26: EB164 */
152         cpu_init(dec_1000a_init,"ST_DEC_1000A"),        /* 27: Noritake */
153         cpu_notsupp("ST_DEC_ALPHAVME_224"),             /* 28: Cortex */
154         cpu_notsupp("unused"),                          /* 29: unused */
155         cpu_init(st550_init,"DEC_ST550"),               /* 30: Miata */
156         cpu_notsupp("ST_DEC_XXM"),                      /* 31: XXM */
157         cpu_notsupp("ST_DEC_EV56_PBP"),                 /* 32: Takara */
158         cpu_notsupp("ST_DEC_ALPHAVME_320"),             /* 33: Yukon */
159         cpu_init(st6600_init, "ST_DEC_ST6600"),         /* 34: Tsunami */
160         cpu_notsupp("ST_DEC_WILDFIRE"),                 /* 35: Wildfire */
161         cpu_notsupp("ST_DEC_CUSCO"),                    /* 36: Cusco */
162         cpu_notsupp("ST_DEC_EIGER"),                    /* 37: Eiger */
163         cpu_notsupp("ST_DEC_TITAN"),                    /* 38: Titan */
164         cpu_notsupp("ST_DEC_MARVEL")                    /* 39: Marvel */
165 };
166 int ncpuinit = (sizeof(cpuinit) / sizeof(cpuinit[0]));
167
168 struct cpuinit api_cpuinit[] = {
169         cpu_notsupp("???"),                          /*  0: ??? */
170         cpu_init(api_up1000_init,"API_UP1000"),      /*  1: ST_API_UP1000 */
171 };
172 int napi_cpuinit = (sizeof(api_cpuinit) / sizeof(api_cpuinit[0]));
173
174
175 void
176 platform_not_configured(int cputype)
177 {
178         struct cpuinit *cpu;
179         int cpuidx;
180
181         cputype = hwrpb->rpb_type;
182
183         if (cputype < 1)
184                 cputype *= -1;
185         
186         if (cputype >= API_ST_BASE) {
187                 cpuidx = cputype - API_ST_BASE;
188                 cpu = api_cpuinit;
189         } else {
190                 cpuidx = cputype;
191                 cpu = cpuinit;
192         }
193
194         printf("\n");
195         printf("Support for system type %d is not present in this kernel.\n",
196             cputype);
197         printf("Please build a kernel with \"options %s\" and reboot.\n",
198             cpu[cpuidx].option);
199         printf("\n");   
200         panic("platform not configured\n");
201 }
202
203 void
204 platform_not_supported(int cputype)
205 {
206         const char *typestr;
207
208         cputype = hwrpb->rpb_type;
209
210         if (cputype < 1)
211                 cputype *= -1;
212
213         if (cputype >= ncpuinit)
214                 typestr = "???";
215         else
216                 typestr = cpuinit[cputype].option;
217
218         printf("\n");
219         printf("FreeBSD does not yet support system type %d (%s).\n", cputype,
220              typestr);
221         printf("\n");
222         panic("platform not supported");
223 }