summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/dev
diff options
context:
space:
mode:
authorSteve Murphree <smurph@cvs.openbsd.org>2001-12-19 07:04:43 +0000
committerSteve Murphree <smurph@cvs.openbsd.org>2001-12-19 07:04:43 +0000
commit8130d56a7bb2e09e2c8b782f3f4a54133a0bb161 (patch)
tree1dd36d374c7d72391551b03ca96630523b33efe7 /sys/arch/mvme88k/dev
parent0941b7f1f3dcc38dc20d2613943aa615d5b3c25b (diff)
Introduce brdtyp and change what cputyp means.
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r--sys/arch/mvme88k/dev/bussw.c6
-rw-r--r--sys/arch/mvme88k/dev/cl.c23
-rw-r--r--sys/arch/mvme88k/dev/clock.c4
-rw-r--r--sys/arch/mvme88k/dev/dart.c9
-rw-r--r--sys/arch/mvme88k/dev/mainbus.c4
-rw-r--r--sys/arch/mvme88k/dev/nvram.c18
-rw-r--r--sys/arch/mvme88k/dev/pcctwo.c62
-rw-r--r--sys/arch/mvme88k/dev/sram.c14
-rw-r--r--sys/arch/mvme88k/dev/syscon.c4
-rw-r--r--sys/arch/mvme88k/dev/vx.c4
10 files changed, 68 insertions, 80 deletions
diff --git a/sys/arch/mvme88k/dev/bussw.c b/sys/arch/mvme88k/dev/bussw.c
index 91989db7b58..53c9fe1f0d1 100644
--- a/sys/arch/mvme88k/dev/bussw.c
+++ b/sys/arch/mvme88k/dev/bussw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bussw.c,v 1.3 2001/12/19 04:02:25 smurph Exp $ */
+/* $OpenBSD: bussw.c,v 1.4 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -79,8 +79,8 @@ bussw_match(parent, vcf, args)
{
struct confargs *ca = args;
struct bussw_reg *bussw;
- /* Don't match if wrong cpu */
- if (cputyp != CPU_197) return (0);
+ /* Don't match if wrong cpu */
+ if (brdtyp != BRD_197) return (0); /* The only one... */
bussw = (struct bussw_reg *)(IIOV(ca->ca_paddr));
if (badvaddr((vm_offset_t)bussw, 4)) {
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c
index 2d7929327ed..a7c9cf885ac 100644
--- a/sys/arch/mvme88k/dev/cl.c
+++ b/sys/arch/mvme88k/dev/cl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.c,v 1.17 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: cl.c,v 1.18 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -217,8 +217,6 @@ int dopoll = 1;
#define CL_CHANNEL(x) (minor(x) & 3)
#define CL_TTY(x) (minor(x))
-extern int cputyp;
-
struct tty *cltty __P((dev_t dev));
struct tty *cltty(dev)
@@ -247,20 +245,17 @@ clprobe(parent, self, aux)
*/
struct clreg *cl_reg;
struct confargs *ca = aux;
- int ret;
- if (cputyp != CPU_187)
+
+ if (brdtyp == BRD_188)
return 0;
ca->ca_ipl = IPL_TTY;
- ca->ca_paddr = (void *)CD2400_BASE_ADDR;
+ ca->ca_vaddr = ca->ca_paddr = (void *)CD2400_BASE_ADDR;
cl_reg = (struct clreg *)ca->ca_vaddr;
-#if 0
- ret = !badvaddr(&cl_reg->cl_gfrcr,1);
-#else
- ret = 1;
-#endif
- return ret;
+ if (badvaddr((vm_offset_t)&cl_reg->cl_gfrcr,1))
+ return 0;
+ return 1;
}
void
@@ -928,7 +923,7 @@ clcnprobe(cp)
int maj;
/* bomb if it'a a MVME188 */
- if (cputyp == CPU_188) {
+ if (brdtyp == BRD_188) {
cp->cn_pri = CN_DEAD;
return 0;
}
@@ -948,7 +943,7 @@ clcninit(cp)
{
volatile struct clreg *cl_reg;
- cl_cons.cl_paddr = (void *)0xfff45000;
+ cl_cons.cl_paddr = (void *)CD2400_BASE_ADDR;
cl_cons.cl_vaddr = (struct clreg *)IIOV(cl_cons.cl_paddr);
cl_cons.pcctwoaddr = (void *)IIOV(0xfff42000);
cl_reg = cl_cons.cl_vaddr;
diff --git a/sys/arch/mvme88k/dev/clock.c b/sys/arch/mvme88k/dev/clock.c
index 6eb693c7a29..3d9f772e23c 100644
--- a/sys/arch/mvme88k/dev/clock.c
+++ b/sys/arch/mvme88k/dev/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.14 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.15 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
@@ -264,7 +264,7 @@ delay(us)
* Do not go to the real timer until vme device is present.
* Or, in the case of MVME188, not at all.
*/
- if (sys_vme2 == NULL || cputyp == CPU_188) {
+ if (sys_vme2 == NULL || brdtyp == BRD_188) {
c = 3 * us;
while (--c > 0);
return (0);
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c
index 243b5e53fdb..48e9b56e733 100644
--- a/sys/arch/mvme88k/dev/dart.c
+++ b/sys/arch/mvme88k/dev/dart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dart.c,v 1.14 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: dart.c,v 1.15 2001/12/19 07:04:41 smurph Exp $ */
/*
* Mach Operating System
@@ -185,10 +185,11 @@ dartmatch(parent, vcf, args)
union dartreg *addr;
/* Don't match if wrong cpu */
- if (cputyp != CPU_188) return (0);
+ if (brdtyp != BRD_188) return (0);
ca->ca_vaddr = ca->ca_paddr; /* 1:1 */
addr = (union dartreg *)ca->ca_vaddr;
- if (badvaddr((vaddr_t)addr, 2) <= 0) {
+
+ if (badvaddr((vaddr_t)addr, 2)) {
printf("==> dart: failed address check.\n");
return (0);
}
@@ -1138,7 +1139,7 @@ dartcnprobe(cp)
{
int maj;
- if (cputyp != CPU_188) {
+ if (brdtyp != BRD_188) {
cp->cn_pri = CN_DEAD;
return 0;
}
diff --git a/sys/arch/mvme88k/dev/mainbus.c b/sys/arch/mvme88k/dev/mainbus.c
index 29fd9af6b3f..3aef5680da7 100644
--- a/sys/arch/mvme88k/dev/mainbus.c
+++ b/sys/arch/mvme88k/dev/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.6 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: mainbus.c,v 1.7 2001/12/19 07:04:41 smurph Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr. */
#include <sys/param.h>
#include <sys/systm.h>
@@ -69,7 +69,7 @@ mainbus_attach(parent, self, args)
struct device *parent, *self;
void *args;
{
- printf (" machine type MVME%x\n", cputyp);
+ printf (" machine type MVME%x\n", brdtyp);
/* XXX
* should have a please-attach-first list for mainbus,
diff --git a/sys/arch/mvme88k/dev/nvram.c b/sys/arch/mvme88k/dev/nvram.c
index 814c635c214..f537cfbc9c4 100644
--- a/sys/arch/mvme88k/dev/nvram.c
+++ b/sys/arch/mvme88k/dev/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.15 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: nvram.c,v 1.16 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -102,13 +102,7 @@ nvrammatch(parent, vcf, args)
#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) {
+ if (badvaddr(IIOV(ca->ca_vaddr), 1)) {
printf("==> nvram: address 0x%x failed check\n", ca->ca_vaddr);
return (0);
} else
@@ -130,7 +124,7 @@ nvramattach(parent, self, args)
sc->sc_paddr = ca->ca_paddr;
sc->sc_vaddr = ca->ca_vaddr;
- if (cputyp == CPU_188) {
+ if (brdtyp == BRD_188) {
sc->sc_len = MK48T02_SIZE;
} else {
sc->sc_len = MK48T08_SIZE;
@@ -142,7 +136,7 @@ nvramattach(parent, self, args)
/*X*/ if (sc->sc_vaddr == NULL)
/*X*/ panic("failed to map!");
- if (cputyp != CPU_188) {
+ if (brdtyp != BRD_188) {
sc->sc_regs = (void *)(sc->sc_vaddr + sc->sc_len -
sizeof(struct clockreg));
} else {
@@ -322,7 +316,7 @@ inittodr(base)
base = 21*SECYR + 186*SECDAY + SECDAY/2;
badbase = 1;
}
- if (cputyp != CPU_188) {
+ if (brdtyp != BRD_188) {
register struct clockreg *cl = (struct clockreg *)sc->sc_regs;
cl->cl_csr |= CLK_READ; /* enable read (stop time) */
sec = cl->cl_sec;
@@ -378,7 +372,7 @@ void resettodr()
{
struct nvramsoftc *sc = (struct nvramsoftc *) nvram_cd.cd_devs[0];
struct chiptime c;
- if (cputyp != CPU_188) {
+ if (brdtyp != BRD_188) {
register struct clockreg *cl = (struct clockreg *)sc->sc_regs;
if (!time.tv_sec || cl == NULL)
diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c
index fc4a589aa28..42b0abd49b7 100644
--- a/sys/arch/mvme88k/dev/pcctwo.c
+++ b/sys/arch/mvme88k/dev/pcctwo.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: pcctwo.c,v 1.12 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: pcctwo.c,v 1.13 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -81,32 +81,32 @@ int pcctwo_scan __P((struct device *parent, void *child, void *args));
int
pcctwomatch(parent, vcf, args)
- struct device *parent;
- void *vcf, *args;
+struct device *parent;
+void *vcf, *args;
{
struct confargs *ca = args;
struct pcctworeg *pcc2;
/* Bomb if wrong cpu */
- switch (cputyp) {
- case CPU_187:
- pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr) + PCC2_PCC2CHIP_OFF);
- break;
- case CPU_197: /* pcctwo is a child of buswitch XXX smurph */
- pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr));
- break;
- default:
- /* Bomb if wrong cpu */
- return (0);
- }
-
- if (badvaddr((vm_offset_t)pcc2, 4) <= 0){
- printf("==> pcctwo: failed address check.\n");
- return (0);
+ switch (brdtyp) {
+ case BRD_187:
+ pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr) + PCC2_PCC2CHIP_OFF);
+ break;
+ case BRD_197: /* pcctwo is a child of buswitch XXX smurph */
+ pcc2 = (struct pcctworeg *)(IIOV(ca->ca_paddr));
+ break;
+ default:
+ /* Bomb if wrong board */
+ return (0);
+ }
+
+ if (badvaddr((vm_offset_t)pcc2, 4) <= 0) {
+ printf("==> pcctwo: failed address check.\n");
+ return (0);
}
- if (pcc2->pcc2_chipid != PCC2_CHIPID){
- printf("==> pcctwo: wrong chip id %x.\n", pcc2->pcc2_chipid);
- return (0);
+ if (pcc2->pcc2_chipid != PCC2_CHIPID) {
+ printf("==> pcctwo: wrong chip id %x.\n", pcc2->pcc2_chipid);
+ return (0);
}
return (1);
}
@@ -160,8 +160,8 @@ pcctwo_scan(parent, child, args)
void
pcctwoattach(parent, self, args)
- struct device *parent, *self;
- void *args;
+struct device *parent, *self;
+void *args;
{
struct confargs *ca = args;
struct pcctwosoftc *sc = (struct pcctwosoftc *)self;
@@ -175,14 +175,14 @@ pcctwoattach(parent, self, args)
*/
sc->sc_paddr = ca->ca_paddr;
sc->sc_vaddr = (void *)IIOV(sc->sc_paddr);
- switch (cputyp) {
- case CPU_187:
- sc->sc_pcc2 = (struct pcctworeg *)(sc->sc_vaddr + PCC2_PCC2CHIP_OFF);
- break;
- case CPU_197: /* pcctwo is a child of buswitch XXX smurph */
- sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr;
- break;
- }
+ switch (brdtyp) {
+ case BRD_187:
+ sc->sc_pcc2 = (struct pcctworeg *)(sc->sc_vaddr + PCC2_PCC2CHIP_OFF);
+ break;
+ case BRD_197: /* pcctwo is a child of buswitch XXX smurph */
+ sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr;
+ break;
+ }
sys_pcc2 = sc->sc_pcc2;
printf(": rev %d\n", sc->sc_pcc2->pcc2_chiprev);
diff --git a/sys/arch/mvme88k/dev/sram.c b/sys/arch/mvme88k/dev/sram.c
index 84d530d5aaa..b2d73c92d80 100644
--- a/sys/arch/mvme88k/dev/sram.c
+++ b/sys/arch/mvme88k/dev/sram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sram.c,v 1.6 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: sram.c,v 1.7 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -72,7 +72,7 @@ srammatch(parent, vcf, args)
struct confargs *ca = args;
int ret;
- if (cputyp != CPU_187)
+ if (brdtyp != BRD_187) /* The only one... */
return (0);
ca->ca_paddr = (void *)0xffe00000;
@@ -101,20 +101,20 @@ sramattach(parent, self, args)
struct mcreg *mc;
int i;
- switch (cputyp) {
+ switch (brdtyp) {
#ifdef MVME167
- case CPU_167:
- case CPU_166:
+ case BRD_167:
+ case BRD_166:
sc->sc_len = 128*1024; /* always 128K */
break;
#endif
#ifdef MVME177
- case CPU_177:
+ case BRD_177:
sc->sc_len = 128*1024; /* always 128K */
break;
#endif
#ifdef MVME187
- case CPU_187:
+ case BRD_187:
sc->sc_len = 128*1024; /* always 128K */
break;
#endif
diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c
index 6ae58882c04..afdefa919d7 100644
--- a/sys/arch/mvme88k/dev/syscon.c
+++ b/sys/arch/mvme88k/dev/syscon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscon.c,v 1.7 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: syscon.c,v 1.8 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -117,7 +117,7 @@ sysconmatch(parent, vcf, args)
struct sysconreg *syscon;
/* Don't match if wrong cpu */
- if (cputyp != CPU_188) return (0);
+ if (brdtyp != BRD_188) return (0); /* The only one... */
/* Uh, MVME188 better have on of these, so always match if it
* is a MVME188... */
syscon = (struct sysconreg *)(IIOV(ca->ca_paddr));
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c
index e851eb4cd96..af00446df81 100644
--- a/sys/arch/mvme88k/dev/vx.c
+++ b/sys/arch/mvme88k/dev/vx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vx.c,v 1.14 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: vx.c,v 1.15 2001/12/19 07:04:41 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -197,8 +197,6 @@ vxmatch(parent, self, aux)
struct vxreg *vx_reg;
struct confargs *ca = aux;
- if (cputyp != CPU_187)
- return 0;
#ifdef OLD_MAPPINGS
ca->ca_vaddr = ca->ca_paddr;
#endif