Home | History | Annotate | Line # | Download | only in alpha
cpuconf.c revision 1.23
      1 /*	$NetBSD: cpuconf.c,v 1.23 1999/12/07 21:51:53 thorpej Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. All advertising materials mentioning features or use of this software
     15  *    must display the following acknowledgement:
     16  *      This product includes software developed by Christopher G. Demetriou
     17  *	for the NetBSD Project.
     18  * 4. The name of the author may not be used to endorse or promote products
     19  *    derived from this software without specific prior written permission
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  */
     32 
     33 #include <sys/param.h>
     34 #include <sys/device.h>
     35 #include <sys/systm.h>
     36 #include <machine/cpuconf.h>
     37 #include <machine/rpb.h>
     38 
     39 #include "opt_dec_3000_500.h"
     40 #ifdef DEC_3000_500
     41 extern void dec_3000_500_init __P((void));
     42 #else
     43 #define	dec_3000_500_init	platform_not_configured
     44 #endif
     45 
     46 #include "opt_dec_3000_300.h"
     47 #ifdef DEC_3000_300
     48 extern void dec_3000_300_init __P((void));
     49 #else
     50 #define	dec_3000_300_init	platform_not_configured
     51 #endif
     52 
     53 #include "opt_dec_axppci_33.h"
     54 #ifdef DEC_AXPPCI_33
     55 extern void dec_axppci_33_init __P((void));
     56 #else
     57 #define	dec_axppci_33_init	platform_not_configured
     58 #endif
     59 
     60 #include "opt_dec_kn8ae.h"
     61 #ifdef DEC_KN8AE
     62 extern void dec_kn8ae_init __P((void));
     63 #else
     64 #define	dec_kn8ae_init		platform_not_configured
     65 #endif
     66 
     67 #include "opt_dec_2100_a50.h"
     68 #ifdef DEC_2100_A50
     69 extern void dec_2100_a50_init __P((void));
     70 #else
     71 #define	dec_2100_a50_init	platform_not_configured
     72 #endif
     73 
     74 #include "opt_dec_kn20aa.h"
     75 #ifdef DEC_KN20AA
     76 extern void dec_kn20aa_init __P((void));
     77 #else
     78 #define	dec_kn20aa_init		platform_not_configured
     79 #endif
     80 
     81 #include "opt_dec_eb64plus.h"
     82 #ifdef DEC_EB64PLUS
     83 extern void dec_eb64plus_init __P((void));
     84 #else
     85 #define	dec_eb64plus_init	platform_not_configured
     86 #endif
     87 
     88 #include "opt_dec_eb164.h"
     89 #ifdef DEC_EB164
     90 extern void dec_eb164_init __P((void));
     91 #else
     92 #define	dec_eb164_init		platform_not_configured
     93 #endif
     94 
     95 #include "opt_avalon_a12.h"
     96 #ifdef AVALON_A12
     97 extern void avalon_a12_init __P((void));
     98 #else
     99 #define	avalon_a12_init		platform_not_configured
    100 #endif
    101 
    102 #include "opt_dec_kn300.h"
    103 #ifdef	DEC_KN300
    104 extern void dec_kn300_init __P((void));
    105 #else
    106 #define	dec_kn300_init		platform_not_configured
    107 #endif
    108 
    109 #include "opt_dec_550.h"
    110 #ifdef DEC_550
    111 extern void dec_550_init __P((void));
    112 #else
    113 #define	dec_550_init		platform_not_configured
    114 #endif
    115 
    116 #include "opt_dec_1000.h"
    117 #include "opt_dec_1000a.h"
    118 #if defined(DEC_1000) || defined(DEC_1000A)
    119 extern void dec_1000a_init __P((void));
    120 #else
    121 #define	dec_1000a_init		platform_not_configured
    122 #endif
    123 
    124 #include "opt_dec_alphabook1.h"
    125 #ifdef DEC_ALPHABOOK1
    126 extern void dec_alphabook1_init __P((void));
    127 #else
    128 #define	dec_alphabook1_init	platform_not_configured
    129 #endif
    130 
    131 #include "opt_dec_eb66.h"
    132 #ifdef DEC_EB66
    133 extern void dec_eb66_init __P((void));
    134 #else
    135 #define	dec_eb66_init		platform_not_configured
    136 #endif
    137 
    138 #include "opt_dec_6600.h"
    139 #ifdef DEC_6600
    140 extern void dec_6600_init __P((void));
    141 #else
    142 #define	dec_6600_init		platform_not_configured
    143 #endif
    144 
    145 #include "opt_dec_2100_a500.h"
    146 #ifdef DEC_2100_A500
    147 extern void dec_2100_a500_init __P((void));
    148 #else
    149 #define	dec_2100_a500_init	platform_not_configured
    150 #endif
    151 
    152 struct cpuinit cpuinit[] = {
    153 	cpu_notsupp("???"),			     /*  0: ??? */
    154 	cpu_notsupp("ST_ADU"),			     /*  1: ST_ADU */
    155 	cpu_notsupp("ST_DEC_4000"),		     /*  2: ST_DEC_4000 */
    156 	cpu_notsupp("ST_DEC_7000"),		     /*  3: ST_DEC_7000 */
    157 	cpu_init(dec_3000_500_init,"DEC_3000_500"),  /*  4: ST_DEC_3000_500 */
    158 	cpu_notsupp("???"),			     /*  5: ??? */
    159 	cpu_notsupp("ST_DEC_2000_300"),		     /*  6: ST_DEC_2000_300 */
    160 	cpu_init(dec_3000_300_init,"DEC_3000_300"),  /*  7: ST_DEC_3000_300 */
    161 	cpu_init(avalon_a12_init,"AVALON_A12"),      /*  8: ST_AVALON_A12 */
    162 	cpu_init(dec_2100_a500_init,"DEC_2100_A500"),/*  9: ST_DEC_2100_A500 */
    163 	cpu_notsupp("ST_DEC_APXVME_64"),	     /* 10: ST_DEC_APXVME_64 */
    164 	cpu_init(dec_axppci_33_init,"DEC_AXPPCI_33"),/* 11: ST_DEC_AXPPCI_33 */
    165 	cpu_init(dec_kn8ae_init,"DEC_KN8AE"),	     /* 12: ST_DEC_21000 */
    166 	cpu_init(dec_2100_a50_init,"DEC_2100_A50"),  /* 13: ST_DEC_2100_A50 */
    167 	cpu_notsupp("ST_DEC_MUSTANG"),		     /* 14: ST_DEC_MUSTANG */
    168 	cpu_init(dec_kn20aa_init,"DEC_KN20AA"),	     /* 15: ST_DEC_KN20AA */
    169 	cpu_notsupp("???"),			     /* 16: ??? */
    170 	cpu_init(dec_1000a_init,"DEC_1000"),	     /* 17: ST_DEC_1000 */
    171 	cpu_notsupp("???"),			     /* 18: ??? */
    172 	cpu_init(dec_eb66_init,"DEC_EB66"),	     /* 19: ST_EB66 */
    173 	cpu_init(dec_eb64plus_init,"DEC_EB64PLUS"),  /* 20: ST_EB64P */
    174 	cpu_init(dec_alphabook1_init,"DEC_ALPHABOOK1"),/* 21: ST_ALPHABOOK1 */
    175 	cpu_init(dec_kn300_init,"DEC_KN300"),	     /* 22: ST_DEC_4100 */
    176 	cpu_notsupp("ST_DEC_EV45_PBP"),		     /* 23: ST_DEC_EV45_PBP */
    177 	cpu_notsupp("ST_DEC_2100A_A500"),	     /* 24: ST_DEC_2100A_A500 */
    178 	cpu_notsupp("???"),			     /* 25: ??? */
    179 	cpu_init(dec_eb164_init,"DEC_EB164"),	     /* 26: ST_EB164 */
    180 	cpu_init(dec_1000a_init, "DEC_1000A"),    /* 27: ST_DEC_1000A */
    181 	cpu_notsupp("ST_DEC_ALPHAVME_224"),	   /* 28: ST_DEC_ALPHAVME_224 */
    182 	cpu_notsupp("???"),			     /* 29: ??? */
    183 	cpu_init(dec_550_init,"DEC_550"),	     /* 30: ST_DEC_550 */
    184 	cpu_notsupp("???"),			     /* 31: ??? */
    185 	cpu_notsupp("ST_DEC_EV56_PBP"),		     /* 32: ST_DEC_EV56_PBP */
    186 	cpu_notsupp("ST_DEC_ALPHAVME_320"),	   /* 33: ST_DEC_ALPHAVME_320 */
    187 	cpu_init(dec_6600_init,"DEC_6600"),	     /* 34: ST_6600 */
    188 };
    189 int ncpuinit = (sizeof(cpuinit) / sizeof(cpuinit[0]));
    190 
    191 void
    192 platform_not_configured()
    193 {
    194 
    195 	printf("\n");
    196 	printf("Support for system type %d is not present in this kernel.\n",
    197 	    cputype);
    198 	printf("Please build a kernel with \"options %s\" and reboot.\n",
    199 	    cpuinit[cputype].option);
    200 	printf("\n");
    201 	panic("platform not configured\n");
    202 }
    203 
    204 void
    205 platform_not_supported()
    206 {
    207 	const char *typestr;
    208 
    209 	if (cputype >= ncpuinit)
    210 		typestr = "???";
    211 	else
    212 		typestr = cpuinit[cputype].option;
    213 
    214 	printf("\n");
    215 	printf("NetBSD does not yet support system type %d (%s).\n", cputype,
    216 	     typestr);
    217 	printf("\n");
    218 	panic("platform not supported");
    219 }
    220