xref: /netbsd/sys/arch/mipsco/mipsco/mainbus.c (revision bf9ec67e)
1 /*	$NetBSD: mainbus.c,v 1.2 2001/03/30 23:52:05 wdk Exp $	*/
2 
3 /*
4  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5  * All rights reserved.
6  *
7  * Author: Chris G. Demetriou
8  * DECstation port: Jonathan Stone
9  *
10  * Permission to use, copy, modify and distribute this software and
11  * its documentation is hereby granted, provided that both the copyright
12  * notice and this permission notice appear in all copies of the
13  * software, derivative works or modified versions, and any portions
14  * thereof, and that both notices appear in supporting documentation.
15  *
16  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19  *
20  * Carnegie Mellon requests users of this software to return to
21  *
22  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
23  *  School of Computer Science
24  *  Carnegie Mellon University
25  *  Pittsburgh PA 15213-3890
26  *
27  * any improvements or extensions that they make and grant Carnegie the
28  * rights to redistribute these changes.
29  */
30 
31 #include <sys/param.h>
32 #include <sys/systm.h>
33 #include <sys/device.h>
34 #include <sys/reboot.h>
35 
36 #include <machine/autoconf.h>
37 
38 struct mainbus_softc {
39 	struct device sc_dev;
40 };
41 
42 /* Definition of the mainbus driver. */
43 static int	mbmatch __P((struct device *, struct cfdata *, void *));
44 static void	mbattach __P((struct device *, struct device *, void *));
45 static int	mbprint __P((void *, const char *));
46 
47 struct cfattach mainbus_ca = {
48 	sizeof(struct mainbus_softc), mbmatch, mbattach
49 };
50 
51 static int
52 mbmatch(parent, cfdata, aux)
53 	struct device *parent;
54 	struct cfdata *cfdata;
55 	void *aux;
56 {
57 	struct cfdata *cf = cfdata;
58 
59 	if (cf->cf_unit > 0)
60 		return 0;
61 
62 	return 1;
63 }
64 
65 static void
66 mbattach(parent, self, aux)
67 	struct device *parent;
68 	struct device *self;
69 	void *aux;
70 {
71 	register struct device *mb = self;
72 	struct confargs nca;
73 
74 	printf("\n");
75 
76 	nca.ca_name = "cpu";
77 	nca.ca_addr = 0;
78 	config_found(mb, &nca, mbprint);
79 
80 	nca.ca_name = "obio";
81 	nca.ca_addr = 0;
82 	config_found(self, &nca, NULL);
83 
84 	nca.ca_name = "isabus";		/* XXX */
85 	nca.ca_addr = 0;
86 	config_found(self, &nca, NULL);
87 
88 }
89 
90 static int
91 mbprint(aux, pnp)
92 	void *aux;
93 	const char *pnp;
94 {
95 
96 	if (pnp)
97 		return QUIET;
98 	return UNCONF;
99 }
100