Annotation of sys/arch/mvmeppc/dev/mainbus.c, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: mainbus.c,v 1.10 2004/11/18 16:10:43 miod Exp $ */
2:
3: /*
4: * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5: * All rights reserved.
6: *
7: * Author: Chris G. Demetriou
8: *
9: * Permission to use, copy, modify and distribute this software and
10: * its documentation is hereby granted, provided that both the copyright
11: * notice and this permission notice appear in all copies of the
12: * software, derivative works or modified versions, and any portions
13: * thereof, and that both notices appear in supporting documentation.
14: *
15: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17: * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18: *
19: * Carnegie Mellon requests users of this software to return to
20: *
21: * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22: * School of Computer Science
23: * Carnegie Mellon University
24: * Pittsburgh PA 15213-3890
25: *
26: * any improvements or extensions that they make and grant Carnegie the
27: * rights to redistribute these changes.
28: */
29:
30: #include <sys/param.h>
31: #include <sys/systm.h>
32: #include <sys/device.h>
33: #include <sys/reboot.h>
34:
35: #include <machine/autoconf.h>
36:
37: struct mainbus_softc {
38: struct device sc_dv;
39: struct bushook sc_bus;
40: };
41:
42: void mbattach(struct device *, struct device *, void *);
43: int mbmatch(struct device *, void *, void *);
44: int mbprint(void *, const char *);
45:
46: struct cfattach mainbus_ca = {
47: sizeof(struct mainbus_softc), mbmatch, mbattach
48: };
49: struct cfdriver mainbus_cd = {
50: NULL, "mainbus", DV_DULL
51: };
52:
53: int
54: mbmatch(struct device *parent, void *cfdata, void *aux)
55: {
56: return (1);
57: }
58:
59: void
60: mbattach(struct device *parent, struct device *self, void *aux)
61: {
62: struct mainbus_softc *sc = (struct mainbus_softc *)self;
63: struct confargs nca;
64: u_int8_t systype;
65: int cpu;
66: extern vaddr_t isaspace_va;
67:
68: /* Pretty print the system type */
69: printf(": ");
70: switch ((systype = *(u_int8_t *)(isaspace_va + MVME_STATUS_REG))) {
71: default:
72: printf("unknown system type %x", systype);
73: break;
74: case MVMETYPE_RESERVED:
75: /* if you ever have this one, please contact me -- miod */
76: printf("Dahu MVME");
77: break;
78: case MVMETYPE_2600_712:
79: cpu = ppc_mfpvr() >> 16;
80: if (cpu == PPC_CPU_MPC750)
81: printf("MVME2700 (712-compatible)");
82: else
83: printf("MVME2600 (712-compatible)");
84: break;
85: case MVMETYPE_2600_761:
86: cpu = ppc_mfpvr() >> 16;
87: if (cpu == PPC_CPU_MPC750)
88: printf("MVME2700 (761-compatible)");
89: else
90: printf("MVME2600 (761-compatible)");
91: break;
92: case MVMETYPE_3600_712:
93: printf("MVME3600 or MVME4600 (712-compatible)");
94: break;
95: case MVMETYPE_3600_761:
96: printf("MVME3600 or MVME4600 (761-compatible)");
97: break;
98: case MVMETYPE_1600:
99: printf("MVME1600");
100: break;
101: }
102: printf("\n");
103:
104: sc->sc_bus.bh_dv = (struct device *)sc;
105: sc->sc_bus.bh_type = BUS_MAIN;
106: sc->sc_bus.bh_intr_establish = NULL;
107: sc->sc_bus.bh_intr_disestablish = NULL;
108: sc->sc_bus.bh_matchname = NULL;
109:
110: /*
111: * Try to find and attach all of the CPUs in the machine.
112: * Right now only one CPU is supported, so this is simple.
113: * Need to change for real MVME4600 support.
114: */
115:
116: nca.ca_name = "cpu";
117: nca.ca_bus = &sc->sc_bus;
118: config_found(self, &nca, mbprint);
119:
120: /*
121: * Attach the BUG terminal services if necessary.
122: */
123: nca.ca_name = "bugtty";
124: nca.ca_bus = &sc->sc_bus;
125: config_found(self, &nca, mbprint);
126:
127: /*
128: * Find and attach the PCI Northbridge. It will find and attach
129: * everything.
130: */
131: nca.ca_name = "raven";
132: nca.ca_bus = &sc->sc_bus;
133: config_found(self, &nca, mbprint);
134: }
135:
136: int
137: mbprint(void *aux, const char *pnp)
138: {
139: if (pnp)
140: return (QUIET);
141: return (UNCONF);
142: }
CVSweb