summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohns <johns@cvs.openbsd.org>1998-02-26 10:39:05 +0000
committerjohns <johns@cvs.openbsd.org>1998-02-26 10:39:05 +0000
commitf50101df174e981772285e379b639fe656e45543 (patch)
tree45ac70a24ec01f0ccb27dc724b5f131c6e8c8a80
parent6ee5c235ff91760acdd291bab17ce8b35ed40042 (diff)
Backout of Jason's cpu init changes, causes an immediate panic on sun4m
machines..
-rw-r--r--sys/arch/sparc/sparc/autoconf.c34
-rw-r--r--sys/arch/sparc/sparc/cpu.c16
-rw-r--r--sys/arch/sparc/sparc/machdep.c5
3 files changed, 36 insertions, 19 deletions
diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c
index 7811e9e8b1a..114d4d07441 100644
--- a/sys/arch/sparc/sparc/autoconf.c
+++ b/sys/arch/sparc/sparc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.24 1998/02/26 08:00:14 jason Exp $ */
+/* $OpenBSD: autoconf.c,v 1.25 1998/02/26 10:38:58 johns Exp $ */
/* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */
/*
@@ -1143,6 +1143,11 @@ mainbus_attach(parent, dev, aux)
#if defined(SUN4)
if (CPU_ISSUN4) {
+ /* Configure the CPU. */
+ bzero(&oca, sizeof(oca));
+ oca.ca_ra.ra_name = "cpu";
+ (void)config_found(dev, (void *)&oca, mbprint);
+
/* Start at the beginning of the bootpath */
bzero(&oca, sizeof(oca));
oca.ca_ra.ra_bp = bootpath;
@@ -1172,6 +1177,33 @@ mainbus_attach(parent, dev, aux)
node = ca->ca_ra.ra_node; /* i.e., the root node */
+ /* the first early device to be configured is the cpu */
+ if (CPU_ISSUN4M) {
+ /* XXX - what to do on multiprocessor machines? */
+ register const char *cp;
+
+ for (node = firstchild(node); node; node = nextsibling(node)) {
+ cp = getpropstring(node, "device_type");
+ if (strcmp(cp, "cpu") == 0) {
+ bzero(&oca, sizeof(oca));
+ oca.ca_ra.ra_node = node;
+ oca.ca_ra.ra_name = "cpu";
+ oca.ca_ra.ra_paddr = 0;
+ oca.ca_ra.ra_nreg = 0;
+ config_found(dev, (void *)&oca, mbprint);
+ }
+ }
+ } else if (CPU_ISSUN4C) {
+ bzero(&oca, sizeof(oca));
+ oca.ca_ra.ra_node = node;
+ oca.ca_ra.ra_name = "cpu";
+ oca.ca_ra.ra_paddr = 0;
+ oca.ca_ra.ra_nreg = 0;
+ config_found(dev, (void *)&oca, mbprint);
+ }
+
+ node = ca->ca_ra.ra_node; /* re-init root node */
+
if (promvec->pv_romvec_vers <= 2)
/* remember which frame buffer, if any, is to be /dev/fb */
fbnode = getpropint(node, "fb", 0);
diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c
index 5014fdeefe6..73ab3308abe 100644
--- a/sys/arch/sparc/sparc/cpu.c
+++ b/sys/arch/sparc/sparc/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.11 1998/02/26 08:00:17 jason Exp $ */
+/* $OpenBSD: cpu.c,v 1.12 1998/02/26 10:39:01 johns Exp $ */
/* $NetBSD: cpu.c,v 1.56 1997/09/15 20:52:36 pk Exp $ */
/*
@@ -93,7 +93,6 @@ char *fsrtoname __P((int, int, int, char *));
void cache_print __P((struct cpu_softc *));
void cpu_spinup __P((struct cpu_softc *));
void fpu_init __P((struct cpu_softc *));
-void identifycpu __P((void));
#define IU_IMPL(psr) ((u_int)(psr) >> 28)
#define IU_VERS(psr) (((psr) >> 24) & 0xf)
@@ -152,18 +151,6 @@ cpu_match(parent, vcf, aux)
return (strcmp(cf->cf_driver->cd_name, ca->ca_ra.ra_name) == 0);
}
-void
-identifycpu()
-{
- struct cpu_softc sc;
- struct confargs ca;
-
- sc.node = 0;
- ca.ca_ra.ra_node = 0;
- strcpy(sc.dv.dv_xname, "cpu0");
- cpu_attach(NULL, (struct device *)&sc, &ca);
-}
-
/*
* Attach the CPU.
* Discover interesting goop about the virtual address cache
@@ -195,7 +182,6 @@ cpu_attach(parent, self, aux)
}
if (sc->master) {
- printf("%s", sc->dv.dv_xname);
/*
* Gross, but some things in cpuinfo may already have
* been setup by early routines like pmap_bootstrap().
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index cb2c35004ff..2a492b1cea5 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.30 1998/02/26 08:00:19 jason Exp $ */
+/* $OpenBSD: machdep.c,v 1.31 1998/02/26 10:39:04 johns Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -142,7 +142,6 @@ static int ndvmamap; /* # of entries in dvmamap */
caddr_t allocsys __P((caddr_t));
void dumpsys __P((void));
void stackdump __P((void));
-void identifycpu __P((void));
/*
* Machine-dependent startup code
@@ -172,7 +171,7 @@ cpu_startup()
* Good {morning,afternoon,evening,night}.
*/
printf(version);
- identifycpu();
+ /*identifycpu();*/
#ifndef MACHINE_NONCONTIG
physmem = btoc(avail_end);
#endif