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