xref: /netbsd-src/sys/arch/emips/emips/sysconf.c (revision 1d7f24ead849f206da1037b3b802e9b5f002b711)
1 /*	$NetBSD: sysconf.c,v 1.2 2012/02/12 16:34:07 matt 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/cdefs.h>
34 __KERNEL_RCSID(0, "$NetBSD: sysconf.c,v 1.2 2012/02/12 16:34:07 matt Exp $");
35 
36 #include <sys/param.h>
37 #include <sys/systm.h>
38 #include <machine/sysconf.h>
39 #include <emips/emips/emipstype.h>
40 
41 #include "opt_xilinx_ml40x.h"
42 #ifdef XILINX_ML40X
43   void	xilinx_ml40x_init (void);
44 #else
45 # define xilinx_ml40x_init	platform_not_configured
46 #endif
47 
48 #include "opt_xs_bee3.h"
49 #ifdef XS_BEE3
50   void	xs_bee3_init (void);
51 #else
52 # define xs_bee3_init	platform_not_configured
53 #endif
54 
55 /* Platform-specific configuration functions
56  */
57 struct sysinit sysinit[] = {
58 	sys_notsupp(NULL),			     			/*	 0: ??? */
59 	sys_init(xilinx_ml40x_init,"XILINX_ML40x"), /*   1: Xilinx ML50x (XUP), same as ML40x */
60 	sys_notsupp(NULL),			     			/*	 2: ??? */
61 	sys_notsupp(NULL),			     			/*	 3: ??? */
62 	sys_notsupp(NULL),			     			/*	 4: ??? */
63 	sys_notsupp(NULL),			     			/*	 5: ??? */
64 	sys_notsupp(NULL),			     			/*	 6: ??? */
65 	sys_notsupp(NULL),			     			/*	 7: ??? */
66 	sys_init(xilinx_ml40x_init,"XILINX_ML40x"), /*   8: Xilinx ML401/2 */
67 	sys_init(xs_bee3_init,"XS_BEE3"),	        /*   9: BeCube BE3 */
68 };
69 int nsysinit = (sizeof(sysinit) / sizeof(sysinit[0]));
70 
71 
72 void
platform_not_configured(void)73 platform_not_configured(void)
74 {
75 	printf("\n");
76 	printf("Support for system type %d is not present in this kernel.\n",
77 	    systype);
78 	printf("Please build a kernel with \"options %s\" and reboot.\n",
79 	    sysinit[systype].option);
80 	printf("\n");
81 	panic("platform not configured");
82 }
83 
84 void
platform_not_supported(void)85 platform_not_supported(void)
86 {
87 	const char *typestr = NULL;
88 
89 	if (systype < nsysinit)
90 		typestr = sysinit[systype].option;
91 
92 	printf("\n");
93 	printf("NetBSD does not (yet?) support system type %d (%s).\n", systype,
94 	     (typestr) ? typestr : "???");
95 	printf("\n");
96 	panic("platform not supported");
97 }
98 
99 void
noop(void)100 noop(void)
101 {
102 }
103