summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorSteve Murphree <smurph@cvs.openbsd.org>1999-04-11 03:26:29 +0000
committerSteve Murphree <smurph@cvs.openbsd.org>1999-04-11 03:26:29 +0000
commit04af8df9079e2b38fd9e3e41e2d7fe6b592e9034 (patch)
tree61ec6a4e26dae125c98d06bb1839ed450b895fdf /sys/arch
parent7711e18860b6eafe8c9d1f16ce36bbcab0d52614 (diff)
Fix for 25 Mhz.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/dev/nvram.c27
-rw-r--r--sys/arch/mvme88k/include/bugio.h27
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c72
3 files changed, 98 insertions, 28 deletions
diff --git a/sys/arch/mvme88k/dev/nvram.c b/sys/arch/mvme88k/dev/nvram.c
index 61e9373411a..e231f8ef7ca 100644
--- a/sys/arch/mvme88k/dev/nvram.c
+++ b/sys/arch/mvme88k/dev/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.3 1999/01/11 05:11:43 millert Exp $ */
+/* $OpenBSD: nvram.c,v 1.4 1999/04/11 03:26:27 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -40,6 +40,7 @@
#include <sys/malloc.h>
#include <machine/psl.h>
#include <machine/autoconf.h>
+#include <machine/bugio.h>
#include <machine/cpu.h>
#include <machine/mioctl.h>
#include <machine/vmparam.h>
@@ -70,13 +71,31 @@ int
nvrammatch(parent, vcf, args)
struct device *parent;
void *vcf, *args;
- {
+{
+ int ret;
struct cfdata *cf = vcf;
struct confargs *ca = args;
-
+ struct bugrtc rtc;
/*X*/ if (ca->ca_vaddr == (void *)-1)
/*X*/ return (1);
- return (!badvaddr(ca->ca_vaddr, 1));
+
+#if 0
+ bugrtcrd(&rtc);
+ ret = badvaddr(IIOV(ca->ca_vaddr), 1);
+ if (ret != 0)
+ ret = badvaddr(IIOV(ca->ca_vaddr), 2);
+ if (ret != 0)
+ ret = badvaddr(IIOV(ca->ca_vaddr), 4);
+
+ if (ret != 0){
+ printf("==> nvram: address 0x%x failed check\n", ca->ca_vaddr);
+ return(0);
+ } else
+ return(1);
+#else
+ bugrtcrd(&rtc);
+ return(1);
+#endif
}
void
diff --git a/sys/arch/mvme88k/include/bugio.h b/sys/arch/mvme88k/include/bugio.h
index cb8acc2b609..da2d1a7dbef 100644
--- a/sys/arch/mvme88k/include/bugio.h
+++ b/sys/arch/mvme88k/include/bugio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugio.h,v 1.5 1999/02/09 06:36:25 smurph Exp $ */
+/* $OpenBSD: bugio.h,v 1.6 1999/04/11 03:26:28 smurph Exp $ */
#include "sys/cdefs.h"
struct bugdisk_io {
@@ -49,6 +49,21 @@ struct bugbrdid {
short type;
short dev;
int option;
+ char version[4];
+ char serial[12]; /* SBC serial number */
+ char id[16]; /* SBC id */
+ char pwa[16]; /* printed wiring assembly number */
+ char speed[4]; /* cpu speed */
+ char etheraddr[6]; /* mac address, all zero if no ether */
+ char fill[2];
+ char scsiid[2]; /* local SCSI id */
+ char sysid[8]; /* system id - nothing on mvme187 */
+ char brd1_pwb[8]; /* memory board 1 pwb */
+ char brd1_serial[8]; /* memory board 1 serial */
+ char brd2_pwb[8]; /* memory board 2 pwb */
+ char brd2_serial[8]; /* memory board 2 serial */
+ char reserved[153];
+ char cksum[1];
};
struct bugniocall {
@@ -57,11 +72,11 @@ struct bugniocall {
unsigned char ci;
unsigned char cd;
#define NETCTRL_INITDEVICE 0
-#define NETCTRL_GETHDW 1
-#define NETCTRL_TX 2
-#define NETCTRL_RX 3
-#define NETCTRL_FLUSH 4
-#define NETCTRL_RESET 5
+#define NETCTRL_GETHDW 1
+#define NETCTRL_TX 2
+#define NETCTRL_RX 3
+#define NETCTRL_FLUSH 4
+#define NETCTRL_RESET 5
unsigned long cid;
unsigned long memaddr;
unsigned long nbytes;
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 9c9272ef92f..33b121bdcb4 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.11 1999/02/09 06:36:29 smurph Exp $ */
+/* $OpenBSD: machdep.c,v 1.12 1999/04/11 03:26:28 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -83,6 +83,7 @@
#include <machine/board.h>
#include <machine/trap.h>
#include <machine/bug.h>
+#include <machine/prom.h>
#include <dev/cons.h>
@@ -309,11 +310,44 @@ size_memory(void)
return(trunc_page((unsigned)look));
}
+int
+getcpuspeed(void)
+{
+ struct bugbrdid 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;
+ }
+ speed = speed / 100;
+ return(speed);
+}
+
+int
+getscsiid(void)
+{
+ struct bugbrdid brdid;
+ int scsiid = 0;
+ int i, c;
+ bugbrdid(&brdid);
+ for (i=0; i<2; i++){
+ c=(unsigned char)brdid.scsiid[i];
+ c-= '0';
+ scsiid *=10;
+ scsiid +=c;
+ }
+ return(7);
+}
+
void
identifycpu()
{
- /* XXX -take this one out. It can be done in m187_bootstrap() */
- strcpy(cpu_model, "Motorola M88K");
+ cpuspeed = getcpuspeed();
+ sprintf(cpu_model, "Motorola MVME%x %dMhz", cputyp, cpuspeed);
printf("\nModel: %s\n", cpu_model);
}
@@ -333,9 +367,10 @@ identifycpu()
void
save_u_area(struct proc *p, vm_offset_t va)
{
- p->p_md.md_upte[0] = kvtopte(va)->bits;
- p->p_md.md_upte[1] = kvtopte(va + NBPG)->bits;
- p->p_md.md_upte[2] = kvtopte(va + NBPG + NBPG)->bits;
+ int i;
+ for (i=0; i<UPAGES; i++) {
+ p->p_md.md_upte[i] = kvtopte(va + (i * NBPG))->bits;
+ }
}
void
@@ -343,15 +378,14 @@ load_u_area(struct proc *p)
{
pte_template_t *t;
- t = kvtopte(UADDR);
- t->bits = p->p_md.md_upte[0];
- t = kvtopte(UADDR + NBPG);
- t->bits = p->p_md.md_upte[1];
- t = kvtopte(UADDR + NBPG + NBPG);
- t->bits = p->p_md.md_upte[2];
- cmmu_flush_tlb(1, UADDR, NBPG);
- cmmu_flush_tlb(1, UADDR + NBPG, NBPG);
- cmmu_flush_tlb(1, UADDR + NBPG + NBPG, NBPG);
+ int i;
+ for (i=0; i<UPAGES; i++) {
+ t = kvtopte(UADDR + (i * NBPG));
+ t->bits = p->p_md.md_upte[i];
+}
+ for (i=0; i<UPAGES; i++) {
+ cmmu_flush_tlb(1, UADDR + (i * NBPG), NBPG);
+ }
}
void
@@ -1516,8 +1550,10 @@ myetheraddr(cp)
u_char *cp;
{
struct bugniocall niocall;
- char *cp2 = (char*) 0xFFC1F2C; /* BBRAM Ethernet hw addr */
-
+ struct bugbrdid brdid;
+ bugbrdid(&brdid);
+ bcopy(&brdid.etheraddr, cp, 6);
+/*
niocall.clun = 0;
niocall.dlun = 0;
niocall.ci = 0;
@@ -1525,8 +1561,8 @@ myetheraddr(cp)
niocall.cid = NETCTRL_GETHDW;
niocall.memaddr = (unsigned long)cp;
niocall.nbytes = 6;
-
bugnetctrl(&niocall);
+*/
/* if (cp[0] == '\0') {
strncpy(cp, cp2, 6);