summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-09-16 20:46:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-09-16 20:46:12 +0000
commit58aa4929953eab56922da16e08705e1fa947a8e7 (patch)
treec323f2799b4db3c160590d9058600dd0752437aa /sys/arch
parent6565661b6c60a33d7f6a1beff0e32263b2686915 (diff)
Provide more information about the CPU/CMMU configuration in the dmesg
output. Also, if the board configuration parameter area is invalid, warn the user and assume safe values - this is likely caused by a dead NVRAM battery.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/dev/mainbus.c12
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110.c20
-rw-r--r--sys/arch/mvme88k/mvme88k/m8820x.c63
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c75
4 files changed, 109 insertions, 61 deletions
diff --git a/sys/arch/mvme88k/dev/mainbus.c b/sys/arch/mvme88k/dev/mainbus.c
index d6ecbea9516..cdbd3c1ec5d 100644
--- a/sys/arch/mvme88k/dev/mainbus.c
+++ b/sys/arch/mvme88k/dev/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.8 2002/03/14 01:26:39 millert Exp $ */
+/* $OpenBSD: mainbus.c,v 1.9 2003/09/16 20:46:08 miod Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr. */
#include <sys/param.h>
#include <sys/systm.h>
@@ -7,6 +7,7 @@
#include <sys/device.h>
#include <sys/disklabel.h>
+#include <machine/cmmu.h>
#include <machine/cpu.h>
#include <machine/autoconf.h>
@@ -69,7 +70,14 @@ mainbus_attach(parent, self, args)
struct device *parent, *self;
void *args;
{
- printf (" machine type MVME%x\n", brdtyp);
+ extern char cpu_model[];
+
+ printf(": %s\n", cpu_model);
+
+ /*
+ * Display cpu/mmu details. Only for the master CPU so far.
+ */
+ cpu_configuration_print(1);
/* XXX
* should have a please-attach-first list for mainbus,
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c
index d3e837d8363..d9c26fbcfc6 100644
--- a/sys/arch/mvme88k/mvme88k/m88110.c
+++ b/sys/arch/mvme88k/mvme88k/m88110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.c,v 1.7 2003/08/20 20:33:47 miod Exp $ */
+/* $OpenBSD: m88110.c,v 1.8 2003/09/16 20:46:11 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* All rights reserved.
@@ -310,12 +310,18 @@ m88110_cpu_configuration_print(int master)
simple_lock(&print_lock);
- printf("Processor %d: ", cpu);
- if (proctype)
- printf("Architectural Revision 0x%x UNKNOWN CPU TYPE Version 0x%x\n",
- proctype, procvers);
- else
- printf("M88110 Version 0x%x\n", procvers);
+ printf("cpu%d: ", cpu);
+ if (proctype != 1) {
+ printf("unknown model arch 0x%x version 0x%x\n",
+ proctype, procvers);
+ simple_unlock(&print_lock);
+ return;
+ }
+
+ printf("M88110 version 0x%x", procvers);
+ if (mc88410_present())
+ printf(", external M88410 cache controller");
+ printf("\n");
simple_unlock(&print_lock);
CMMU_UNLOCK;
diff --git a/sys/arch/mvme88k/mvme88k/m8820x.c b/sys/arch/mvme88k/mvme88k/m8820x.c
index 59b3978fba8..20bbb639e8c 100644
--- a/sys/arch/mvme88k/mvme88k/m8820x.c
+++ b/sys/arch/mvme88k/mvme88k/m8820x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x.c,v 1.16 2003/08/21 20:45:43 miod Exp $ */
+/* $OpenBSD: m8820x.c,v 1.17 2003/09/16 20:46:11 miod Exp $ */
/*
* Copyright (c) 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -771,35 +771,56 @@ m8820x_cpu_configuration_print(master)
simple_lock(&print_lock);
- printf("Processor %d: ", cpu);
- if (proctype)
- printf("Architectural Revision 0x%x UNKNOWN CPU TYPE Version 0x%x\n",
- proctype, procvers);
- else
- printf("M88100 Version 0x%x\n", procvers);
+ printf("cpu%d: ", cpu);
+ if (proctype != 0) {
+ printf("unknown model arch 0x%x rev 0x%x\n",
+ proctype, procvers);
+ simple_unlock(&print_lock);
+ return;
+ }
-#ifndef ERRATA__XXX_USR
- if (procvers < 2)
- printf("WARNING: M88100 bug workaround code not enabled!!!\n");
+ printf("M88100 rev 0x%x", procvers);
+#if 0 /* not useful yet */
+ if (brdtyp == BRD_188)
+ printf(", %s", master ? "master" : "slave");
#endif
+ printf(", %d CMMU", cpu_cmmu_ratio);
- for (mmu = cpu*cpu_cmmu_ratio; mmu < (cpu+1)*cpu_cmmu_ratio; mmu++) {
+ for (mmu = cpu * cpu_cmmu_ratio; mmu < (cpu + 1) * cpu_cmmu_ratio;
+ mmu++) {
int idr = m8820x_cmmu_get(mmu, CMMU_IDR);
int mmuid = (0xe00000 & idr)>>21;
+ int access = m8820x_cmmu[mmu].cmmu_access;
+
+ if ((mmu - cpu * cpu_cmmu_ratio) % 2 == 0)
+ printf("\ncpu%d: ", cpu);
+ else
+ printf(", ");
- printf(" %s %s Cache: ",
- (m8820x_cmmu[mmu].cmmu_access == CMMU_ACS_BOTH) ? "Spv and User" :
- ((m8820x_cmmu[mmu].cmmu_access == CMMU_ACS_USER) ? "User " :
- "Supervisor "),
- (m8820x_cmmu[mmu].which == INST_CMMU) ? "Instruction" :
- "Data ");
if (mmutypes[mmuid][0] == 'U')
- printf("Type 0x%x ", mmuid);
+ printf("unknown model id 0x%x", mmuid);
else
- printf("%s ", mmutypes[mmuid]);
- printf("Version 0x%x\n", (idr & 0x1f0000)>>16);
+ printf("%s", mmutypes[mmuid]);
+ printf(" rev 0x%x, %s %scache",
+ (idr & 0x1f0000) >> 16,
+ access == CMMU_ACS_BOTH ? "global" :
+ (access == CMMU_ACS_USER ? "user" : "sup"),
+ m8820x_cmmu[mmu].which == INST_CMMU ? "I" : "D");
+ }
+ printf("\n");
+
+#ifndef ERRATA__XXX_USR
+ {
+ static int errata_warn = 0;
+
+ if (proctype != 0 && procvers < 2) {
+ if (!errata_warn++)
+ printf("WARNING: M88100 bug workaround code "
+ "not enabled.\nPlease recompile the kernel "
+ "with option ERRATA__XXX_USR !\n");
+ }
}
- printf (" Configured as %s and started\n", master ? "master" : "slave");
+#endif
simple_unlock(&print_lock);
}
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index e4f1070ce1b..0736f31bf81 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.110 2003/09/08 20:44:52 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.111 2003/09/16 20:46:11 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -243,8 +243,8 @@ int boothowto; /* set in locore.S */
int bootdev; /* set in locore.S */
int cputyp; /* set in locore.S */
int brdtyp; /* set in locore.S */
-int cpumod = 0; /* set in mvme_bootstrap() */
-int cpuspeed = 25; /* 25 MHZ XXX should be read from NVRAM */
+int cpumod; /* set in mvme_bootstrap() */
+int cpuspeed;
vm_offset_t first_addr = 0;
vm_offset_t last_addr = 0;
@@ -383,32 +383,29 @@ getcpuspeed()
struct mvmeprom_brdid brdid;
int speed = 0;
int i, c;
+
bugbrdid(&brdid);
- for (i=0; i<4; i++) {
- c=(unsigned char)brdid.speed[i];
- c-= '0';
- speed *=10;
- speed +=c;
+
+ for (i = 0; i < 4; i++) {
+ c = (unsigned char)brdid.speed[i];
+ if (c == ' ')
+ c = '0';
+ else if (c > '9' || c < '0')
+ goto fail;
+ speed = speed * 10 + (c - '0');
}
speed = speed / 100;
return (speed);
-}
-int
-getscsiid()
-{
- struct mvmeprom_brdid brdid;
- int scsiid = 0;
- int i, c;
- bugbrdid(&brdid);
- for (i=0; i<2; i++) {
- c=(unsigned char)brdid.scsiid[i];
- scsiid *=10;
- c-= '0';
- scsiid +=c;
- }
- printf("SCSI ID = %d\n", scsiid);
- return (7); /* hack! */
+fail:
+ /*
+ * If we end up here, the board information block is
+ * damaged and we can't trust it.
+ * Suppose we are running at 25MHz and hope for the best.
+ */
+ printf("WARNING: Board Configuration Data invalid, "
+ "replace NVRAM and restore values\n");
+ return (25);
}
void
@@ -417,7 +414,6 @@ identifycpu()
cpuspeed = getcpuspeed();
snprintf(cpu_model, sizeof cpu_model,
"Motorola MVME%x, %dMHz", brdtyp, cpuspeed);
- printf("Model: %s\n", cpu_model);
}
/*
@@ -2326,8 +2322,10 @@ mvme_bootstrap()
brdtyp = brdid.model;
/* to support the M8120. It's based off of MVME187 */
- if (brdtyp == BRD_8120)
+ if (brdtyp == BRD_8120) {
brdtyp = BRD_187;
+ /* XXX Need to flag the 8120 has a second cl(4) device on-board */
+ }
/*
* set up interrupt and fp exception handlers
@@ -2405,17 +2403,32 @@ mvme_bootstrap()
cmmu_init();
master_cpu = cmmu_cpu_number();
set_cpu_number(master_cpu);
- printf("CPU%d is master CPU\n", master_cpu);
-#ifdef notevenclose
- if (brdtyp == BRD_188 && (boothowto & RB_MINIROOT)) {
+ /*
+ * If we have more than one CPU, mention which one is the master.
+ * We will also want to spin up slave CPUs on the long run...
+ */
+ switch (brdtyp) {
+ case BRD_188:
+ printf("CPU%d is master CPU\n", master_cpu);
+
+#if 0
int i;
- for (i=0; i<MAX_CPUS; i++) {
+ for (i = 0; i < MAX_CPUS; i++) {
if (!spin_cpu(i))
printf("CPU%d started\n", i);
}
- }
#endif
+ break;
+ case BRD_197:
+ /*
+ * In the 197DP case, mention which CPU is the master
+ * there too...
+ * XXX TBD
+ */
+ break;
+ }
+
avail_start = first_addr;
avail_end = last_addr;
/*