diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 2001-12-13 08:55:53 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 2001-12-13 08:55:53 +0000 |
commit | 473b535f76f86533ee5e407fe116de57f486b4ab (patch) | |
tree | 4f23697fe5a745e7407f507f3b3a3e82e9bd7150 /sys/arch/mvme88k/dev | |
parent | 73fa188e07813a02c13455459ffa53a64e277416 (diff) |
Support for MVME197 completed. Fix SPL defs.
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r-- | sys/arch/mvme88k/dev/bugtty.c | 17 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/busswfunc.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/busswitch.c | 153 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/busswitchreg.h | 10 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/cl.c | 41 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/clock.c | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/dart.c | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/if_ie.c | 19 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/if_ve.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/mainbus.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/nvram.c | 18 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwo.c | 75 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctwofunc.h | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/pcctworeg.h | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sclock.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sram.c | 14 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/ssh.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sshdma.c | 95 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/syscon.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vme.c | 27 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vsdma.c | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vx.c | 14 |
23 files changed, 192 insertions, 365 deletions
diff --git a/sys/arch/mvme88k/dev/bugtty.c b/sys/arch/mvme88k/dev/bugtty.c index 99750a59e81..b751d32d2e3 100644 --- a/sys/arch/mvme88k/dev/bugtty.c +++ b/sys/arch/mvme88k/dev/bugtty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bugtty.c,v 1.7 2001/03/09 05:44:38 smurph Exp $ */ +/* $OpenBSD: bugtty.c,v 1.8 2001/12/13 08:55:51 smurph Exp $ */ /* Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. * All rights reserved. @@ -476,21 +476,6 @@ bugttycnprobe(cp) return (0); } -#if 0 - switch (cputyp) { - case CPU_147: - case CPU_162: - cp->cn_pri = CN_NORMAL; - return (0); - default: - break; - } -#endif -#if 0 - cp->cn_pri = CN_NORMAL; - return (0); -#endif /* 0 */ - /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) if (cdevsw[maj].d_open == bugttyopen) diff --git a/sys/arch/mvme88k/dev/busswfunc.h b/sys/arch/mvme88k/dev/busswfunc.h new file mode 100644 index 00000000000..9e298b4ddab --- /dev/null +++ b/sys/arch/mvme88k/dev/busswfunc.h @@ -0,0 +1,9 @@ +/* $OpenBSD: busswfunc.h,v 1.1 2001/12/13 08:55:51 smurph Exp $ */ + +#ifndef _MVME88K_BUSSWF_H_ +#define _MVME88K_BUSSWF_H_ + +int busswintr_establish __P((int vec, struct intrhand *ih)); + +#endif /* _MVME88K_PCCTWO_H_ */ + diff --git a/sys/arch/mvme88k/dev/busswitch.c b/sys/arch/mvme88k/dev/busswitch.c deleted file mode 100644 index 8be2af870e3..00000000000 --- a/sys/arch/mvme88k/dev/busswitch.c +++ /dev/null @@ -1,153 +0,0 @@ -/* $OpenBSD: busswitch.c,v 1.4 2001/03/09 05:44:38 smurph Exp $ */ - -/* - * Copyright (c) 1999 Steve Murphree, Jr. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed under OpenBSD by - * Theo de Raadt for Willowglen Singapore. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/kernel.h> -#include <sys/ioctl.h> -#include <sys/device.h> -#include <sys/systm.h> -#include <sys/uio.h> -#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> - -#include <mvme88k/dev/busswitchreg.h> - -struct busswitchsoftc { - struct device sc_dev; - void * sc_paddr; - void * sc_vaddr; - int sc_len; - struct busswitchreg * sc_busswitch; -}; - -void busswitchattach __P((struct device *, struct device *, void *)); -int busswitchmatch __P((struct device *, void *, void *)); - -struct cfattach busswitch_ca = { - sizeof(struct busswitchsoftc), busswitchmatch, busswitchattach -}; - -struct cfdriver busswitch_cd = { - NULL, "busswitch", DV_DULL, 0 -}; - -int busswitch_print __P((void *args, const char *bus)); -int busswitch_scan __P((struct device *parent, void *child, void *args)); - -int -busswitchmatch(parent, vcf, args) - struct device *parent; - void *vcf, *args; -{ - struct confargs *ca = args; - struct busswitchreg *busswitch; - /* Don't match if wrong cpu */ - if (cputyp != CPU_197) return (0); - - busswitch = (struct busswitchreg *)(IIOV(ca->ca_paddr)); - if (badvaddr((vm_offset_t)busswitch, 4) <= 0){ - printf("==> busswitch: failed address check.\n"); - return (0); - } - return (1); -} - -void -busswitchattach(parent, self, args) - struct device *parent, *self; - void *args; -{ - struct confargs *ca = args; - struct busswitchsoftc *sc = (struct busswitchsoftc *)self; - - sc->sc_paddr = ca->ca_paddr; - sc->sc_vaddr = ca->ca_vaddr; - - /* - printf(": rev %d\n", sc->sc_busswitch->chiprev); - */ - printf(": rev %d\n", 0); -} - -int -busswitch_print(args, bus) - void *args; - const char *bus; -{ - struct confargs *ca = args; - - if (ca->ca_offset != -1) - printf(" offset 0x%x", ca->ca_offset); - if (ca->ca_ipl > 0) - printf(" ipl %d", ca->ca_ipl); - return (UNCONF); -} - -int -busswitch_scan(parent, child, args) - struct device *parent; - void *child, *args; -{ - struct cfdata *cf = child; - struct busswitchsoftc *sc = (struct busswitchsoftc *)parent; - struct confargs oca; - - if (parent->dv_cfdata->cf_driver->cd_indirect) { - printf(" indirect devices not supported\n"); - return 0; - } - - bzero(&oca, sizeof oca); - oca.ca_offset = cf->cf_loc[0]; - oca.ca_ipl = cf->cf_loc[1]; - if (((int)oca.ca_offset != -1) && ISIIOVA(sc->sc_vaddr + oca.ca_offset)) { - oca.ca_vaddr = sc->sc_vaddr + oca.ca_offset; - oca.ca_paddr = sc->sc_paddr + oca.ca_offset; - } else { - oca.ca_vaddr = (void *)-1; - oca.ca_paddr = (void *)-1; - } - oca.ca_bustype = BUS_BUSSWITCH; - oca.ca_master = (void *)sc->sc_busswitch; - oca.ca_name = cf->cf_driver->cd_name; - if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0) - return (0); - config_attach(parent, cf, &oca, busswitch_print); - return (1); -} - diff --git a/sys/arch/mvme88k/dev/busswitchreg.h b/sys/arch/mvme88k/dev/busswitchreg.h deleted file mode 100644 index d1f95c717a2..00000000000 --- a/sys/arch/mvme88k/dev/busswitchreg.h +++ /dev/null @@ -1,10 +0,0 @@ -/* $OpenBSD: busswitchreg.h,v 1.1 1999/09/27 18:43:22 smurph Exp $ */ - -/* - * Memory map for BusSwitch chip found in mvme197 boards. - */ - -struct busswitchreg { - unsigned start; -}; - diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c index 8fbcb608af8..ec3152e3b33 100644 --- a/sys/arch/mvme88k/dev/cl.c +++ b/sys/arch/mvme88k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.14 2001/08/31 01:05:44 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.15 2001/12/13 08:55:51 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(&cl_reg->cl_gfrcr,1)) + return 0; + return 1; } void @@ -401,10 +396,10 @@ cl_initchannel(sc, channel) cl_reg->cl_cor5 = 0xec; cl_reg->cl_cor6 = 0x00; cl_reg->cl_cor7 = 0x00; - cl_reg->cl_schr1 = 0x00; - cl_reg->cl_schr2 = 0x00; - cl_reg->cl_schr3 = 0x00; - cl_reg->cl_schr4 = 0x00; + cl_reg->cl_schr1 = 0x00; + cl_reg->cl_schr2 = 0x00; + cl_reg->cl_schr3 = 0x00; + cl_reg->cl_schr4 = 0x00; cl_reg->cl_scrl = 0x00; cl_reg->cl_scrh = 0x00; cl_reg->cl_lnxt = 0x00; @@ -413,10 +408,10 @@ cl_initchannel(sc, channel) cl_reg->cl_tbpr = 0x40; /* 9600 */ cl_reg->cl_tcor = 0x01 << 5; /* console port should be 0x88 already */ - cl_reg->cl_msvr_rts = 0x00; - cl_reg->cl_msvr_dtr = 0x00; - cl_reg->cl_rtprl = CL_RX_TIMEOUT; - cl_reg->cl_rtprh = 0x00; + cl_reg->cl_msvr_rts = 0x00; + cl_reg->cl_msvr_dtr = 0x00; + cl_reg->cl_rtprl = CL_RX_TIMEOUT; + cl_reg->cl_rtprh = 0x00; } sc->cl_reg->cl_ccr = 0x20; while (sc->cl_reg->cl_ccr != 0) { @@ -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; } @@ -938,7 +933,7 @@ clcnprobe(cp) break; cp->cn_dev = makedev (maj, 0); cp->cn_pri = CN_NORMAL; - + return 1; } @@ -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 c6893fd14f0..9dd6150e516 100644 --- a/sys/arch/mvme88k/dev/clock.c +++ b/sys/arch/mvme88k/dev/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.11 2001/10/28 00:57:20 miod Exp $ */ +/* $OpenBSD: clock.c,v 1.12 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -191,7 +191,7 @@ clockattach(parent, self, args) sc->sc_profih.ih_ipl = ca->ca_ipl; prof_reset = ca->ca_ipl | PCC2_IRQ_IEN | PCC2_IRQ_ICLR; pcctwointr_establish(PCC2V_TIMER1, &sc->sc_profih); - mdfp.clock_init_func = &sbc_initclock; + md.clock_init_func = sbc_initclock; printf(": VME1x7"); break; #endif /* NPCCTWO */ @@ -202,7 +202,7 @@ clockattach(parent, self, args) sc->sc_profih.ih_wantframe = 1; sc->sc_profih.ih_ipl = ca->ca_ipl; sysconintr_establish(SYSCV_TIMER1, &sc->sc_profih); - mdfp.clock_init_func = &m188_initclock; + md.clock_init_func = m188_initclock; printf(": VME188"); break; #endif /* NSYSCON */ @@ -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 e552e970f58..35c3df8dce2 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.12 2001/08/31 08:18:24 miod Exp $ */ +/* $OpenBSD: dart.c,v 1.13 2001/12/13 08:55:51 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/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c index 25b1e7a0422..43a1d46c71d 100644 --- a/sys/arch/mvme88k/dev/if_ie.c +++ b/sys/arch/mvme88k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.16 2001/11/28 16:13:28 art Exp $ */ +/* $OpenBSD: if_ie.c,v 1.17 2001/12/13 08:55:51 smurph Exp $ */ /*- * Copyright (c) 1998 Steve Murphree, Jr. @@ -282,7 +282,7 @@ int in_ierint = 0; int in_ietint = 0; #endif -int iematch __P((struct device *, void *, void *)); +int iematch __P((struct device *, void *, void *)); void ieattach __P((struct device *, struct device *, void *)); struct cfattach ie_ca = { @@ -352,9 +352,8 @@ iematch(parent, vcf, args) void *vcf, *args; { struct confargs *ca = args; - int ret; - if ((ret = badvaddr((unsigned)IIOV(ca->ca_vaddr), 1)) <=0){ + if (badvaddr((unsigned)IIOV(ca->ca_vaddr), 1)){ return(0); } return(1); @@ -540,7 +539,7 @@ ieintr(v) register u_short status; status = sc->scb->ie_status; -/*printf("I");*/ +/* printf("I"); */ loop: /* Ack interrupts FIRST in case we receive more during the ISR. */ @@ -889,11 +888,11 @@ iexmit(sc) #endif #if 0 -printf("iexmit base %x cmd %x bfd %x to %x\n", -sc->sc_maddr, -sc->xmit_cmds[sc->xctail], -sc->xmit_buffs[sc->xctail], -sc->xmit_cbuffs[sc->xctail]); + printf("iexmit base %x cmd %x bfd %x to %x\n", + sc->sc_maddr, + sc->xmit_cmds[sc->xctail], + sc->xmit_buffs[sc->xctail], + sc->xmit_cbuffs[sc->xctail]); #endif sc->xmit_buffs[sc->xctail]->ie_xmit_flags |= IE_XMIT_LAST; sc->xmit_buffs[sc->xctail]->ie_xmit_next = 0xffffffff; diff --git a/sys/arch/mvme88k/dev/if_ve.c b/sys/arch/mvme88k/dev/if_ve.c index c075274a554..a90e89fcbcf 100644 --- a/sys/arch/mvme88k/dev/if_ve.c +++ b/sys/arch/mvme88k/dev/if_ve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ve.c,v 1.11 2001/11/06 19:53:15 miod Exp $ */ +/* $OpenBSD: if_ve.c,v 1.12 2001/12/13 08:55:51 smurph Exp $ */ /*- * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1982, 1992, 1993 @@ -71,7 +71,7 @@ #include <machine/autoconf.h> #include <machine/cpu.h> #include <machine/bugio.h> -#include <machine/mmu.h> /* DMA_CACHE_SYNC, etc... */ +#include <machine/cmmu.h> /* DMA_CACHE_SYNC, etc... */ #include <mvme88k/dev/if_vereg.h> #include <mvme88k/dev/if_vevar.h> @@ -247,11 +247,9 @@ vematch(parent, vcf, args) { struct confargs *ca = args; - if (!badvaddr((unsigned)ca->ca_vaddr, 1)) { - return (1); - } else { + if (badvaddr((unsigned)ca->ca_vaddr, 1)) return (0); - } + return (1); } /* diff --git a/sys/arch/mvme88k/dev/mainbus.c b/sys/arch/mvme88k/dev/mainbus.c index ccda4910b1a..d8d08d2edfe 100644 --- a/sys/arch/mvme88k/dev/mainbus.c +++ b/sys/arch/mvme88k/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.4 2001/08/26 02:37:07 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.5 2001/12/13 08:55:51 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 0c75d10c2c8..ae3f4260206 100644 --- a/sys/arch/mvme88k/dev/nvram.c +++ b/sys/arch/mvme88k/dev/nvram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvram.c,v 1.13 2001/11/06 00:30:38 art Exp $ */ +/* $OpenBSD: nvram.c,v 1.14 2001/12/13 08:55:51 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 6cd485df2a2..6cf93f58b29 100644 --- a/sys/arch/mvme88k/dev/pcctwo.c +++ b/sys/arch/mvme88k/dev/pcctwo.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcctwo.c,v 1.10 2001/03/08 00:03:14 miod Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.11 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -56,6 +56,8 @@ #include <mvme88k/dev/pcctwofunc.h> #include <mvme88k/dev/pcctworeg.h> +#include "bussw.h" + struct pcctwosoftc { struct device sc_dev; void *sc_vaddr; /* PCC2 space */ @@ -76,6 +78,8 @@ struct cfdriver pcctwo_cd = { struct pcctworeg *sys_pcc2 = NULL; +int pcc2bus; + int pcctwo_print __P((void *args, const char *bus)); int pcctwo_scan __P((struct device *parent, void *child, void *args)); @@ -88,25 +92,25 @@ pcctwomatch(parent, vcf, 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); - } + 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 (badvaddr((vm_offset_t)pcc2, 4)) { + 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); } @@ -175,14 +179,27 @@ 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; - } + + pcc2bus = ca->ca_bustype; + + switch (pcc2bus) { + case BUS_MAIN: + sc->sc_pcc2 = (struct pcctworeg *)(sc->sc_vaddr + PCC2_PCC2CHIP_OFF); + break; +#if NBUSSW > 0 + case BUS_BUSSWITCH: + sc->sc_pcc2 = (struct pcctworeg *)sc->sc_vaddr; + /* + * fake up our address so that pcc2 child devices + * are offeset of 0xFFF00000 - XXX smurph + */ + sc->sc_paddr -= PCC2_PCC2CHIP_OFF; + sc->sc_vaddr -= PCC2_PCC2CHIP_OFF; + /* make sure the bus is mc68040 compatible */ + sc->sc_pcc2->pcc2_genctl |= PCC2_GENCTL_C040; + break; +#endif + } sys_pcc2 = sc->sc_pcc2; printf(": rev %d\n", sc->sc_pcc2->pcc2_chiprev); @@ -193,8 +210,10 @@ pcctwoattach(parent, self, args) /* * Set pcc2intr_mask and pcc2intr_ipl. */ - pcc2intr_ipl = (u_char *)&(sc->sc_pcc2->pcc2_ipl); - pcc2intr_mask = (u_char *)&(sc->sc_pcc2->pcc2_mask); +#if 0 + md.intr_mask = (u_char *)&(sc->sc_pcc2->pcc2_mask); + md.intr_ipl = (u_char *)&(sc->sc_pcc2->pcc2_ipl); +#endif config_search(pcctwo_scan, self, args); } diff --git a/sys/arch/mvme88k/dev/pcctwofunc.h b/sys/arch/mvme88k/dev/pcctwofunc.h index dfb2a52cf2d..b41aad29b53 100644 --- a/sys/arch/mvme88k/dev/pcctwofunc.h +++ b/sys/arch/mvme88k/dev/pcctwofunc.h @@ -1,7 +1,7 @@ -/* $OpenBSD: pcctwofunc.h,v 1.1 2001/03/08 00:03:14 miod Exp $ */ +/* $OpenBSD: pcctwofunc.h,v 1.2 2001/12/13 08:55:51 smurph Exp $ */ -#ifndef _MVME88K_PCCTWO_H_ -#define _MVME88K_PCCTWO_H_ +#ifndef _MVME88K_PCCTWOF_H_ +#define _MVME88K_PCCTWOF_H_ int pcctwointr_establish __P((int vec, struct intrhand *ih)); diff --git a/sys/arch/mvme88k/dev/pcctworeg.h b/sys/arch/mvme88k/dev/pcctworeg.h index 3a4cbbb1f2f..697a921b27a 100644 --- a/sys/arch/mvme88k/dev/pcctworeg.h +++ b/sys/arch/mvme88k/dev/pcctworeg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcctworeg.h,v 1.2 1998/12/15 05:52:30 smurph Exp $ */ +/* $OpenBSD: pcctworeg.h,v 1.3 2001/12/13 08:55:51 smurph Exp $ */ /* * Memory map for PCC2 chip found in mvme1x7 boards. @@ -55,6 +55,7 @@ struct pcctworeg { volatile u_short pcc2_speed; /* DO NOT USE */ volatile u_short pcc2_prtdat; volatile u_short :16; + /* The following regs are not valid on MVME197 */ volatile u_char pcc2_ipl; volatile u_char pcc2_mask; }; diff --git a/sys/arch/mvme88k/dev/sclock.c b/sys/arch/mvme88k/dev/sclock.c index 1611102b33a..12936f62fc2 100644 --- a/sys/arch/mvme88k/dev/sclock.c +++ b/sys/arch/mvme88k/dev/sclock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sclock.c,v 1.6 2001/08/26 02:37:07 miod Exp $ */ +/* $OpenBSD: sclock.c,v 1.7 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * @@ -191,7 +191,7 @@ sclockattach(parent, self, args) sc->sc_statih.ih_ipl = ca->ca_ipl; stat_reset = ca->ca_ipl | PCC2_IRQ_IEN | PCC2_IRQ_ICLR; pcctwointr_establish(PCC2V_TIMER2, &sc->sc_statih); - mdfp.statclock_init_func = &sbc_initstatclock; + md.statclock_init_func = &sbc_initstatclock; printf(": VME1x7"); break; #endif /* NPCCTWO */ @@ -202,7 +202,7 @@ sclockattach(parent, self, args) sc->sc_statih.ih_wantframe = 1; sc->sc_statih.ih_ipl = ca->ca_ipl; sysconintr_establish(SYSCV_TIMER2, &sc->sc_statih); - mdfp.statclock_init_func = &m188_initstatclock; + md.statclock_init_func = &m188_initstatclock; printf(": VME188"); break; #endif /* NSYSCON */ diff --git a/sys/arch/mvme88k/dev/sram.c b/sys/arch/mvme88k/dev/sram.c index 5e8bc3b168b..7b36cbca3cc 100644 --- a/sys/arch/mvme88k/dev/sram.c +++ b/sys/arch/mvme88k/dev/sram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sram.c,v 1.4 2001/11/06 19:53:15 miod Exp $ */ +/* $OpenBSD: sram.c,v 1.5 2001/12/13 08:55:51 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/ssh.c b/sys/arch/mvme88k/dev/ssh.c index c89376326e6..0e39c96b16e 100644 --- a/sys/arch/mvme88k/dev/ssh.c +++ b/sys/arch/mvme88k/dev/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.8 2001/11/06 19:53:15 miod Exp $ */ +/* $OpenBSD: ssh.c,v 1.9 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -55,7 +55,7 @@ #include <uvm/uvm_pmap.h> #include <machine/autoconf.h> -#include <machine/mmu.h> +#include <machine/cmmu.h> #include <machine/pmap.h> #include <scsi/scsi_all.h> diff --git a/sys/arch/mvme88k/dev/sshdma.c b/sys/arch/mvme88k/dev/sshdma.c index 8a6b48604ee..a44cf025bad 100644 --- a/sys/arch/mvme88k/dev/sshdma.c +++ b/sys/arch/mvme88k/dev/sshdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshdma.c,v 1.7 2001/11/06 19:53:15 miod Exp $ */ +/* $OpenBSD: sshdma.c,v 1.8 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur @@ -66,10 +66,10 @@ int afscmatch __P((struct device *, void *, void *)); void afscattach __P((struct device *, struct device *, void *)); -int afscprint __P((void *auxp, char *)); -int sshintr __P((struct ssh_softc *)); -int afsc_dmaintr __P((void *)); -void sshinitialize __P((struct ssh_softc *)); +int afscprint __P((void *auxp, char *)); +int sshintr __P((struct ssh_softc *)); +int afsc_dmaintr __P((void *)); +void sshinitialize __P((struct ssh_softc *)); struct scsi_adapter afsc_scsiswitch = { ssh_scsicmd, @@ -86,24 +86,22 @@ struct scsi_device afsc_scsidev = { }; struct cfattach ssh_ca = { - sizeof(struct ssh_softc), afscmatch, afscattach, + sizeof(struct ssh_softc), afscmatch, afscattach, }; - + struct cfdriver ssh_cd = { - NULL, "ssh", DV_DULL, 0 + NULL, "ssh", DV_DULL, 0 }; int afscmatch(pdp, vcf, args) - struct device *pdp; - void *vcf, *args; +struct device *pdp; +void *vcf, *args; { struct confargs *ca = args; - int ret; - if ((ret = badvaddr((vm_offset_t)IIOV(ca->ca_vaddr), 4)) <=0){ - printf("==> ssh: failed address check returning %ld.\n", ret); - return(0); + if (badvaddr((vm_offset_t)IIOV(ca->ca_vaddr), 4)) { + return (0); } return (1); @@ -111,8 +109,8 @@ afscmatch(pdp, vcf, args) void afscattach(parent, self, auxp) - struct device *parent, *self; - void *auxp; +struct device *parent, *self; +void *auxp; { struct ssh_softc *sc = (struct ssh_softc *)self; struct confargs *ca = auxp; @@ -128,14 +126,17 @@ afscattach(parent, self, auxp) * XXX does the clock frequency change for the 33MHz processors? */ sc->sc_clock_freq = cpuspeed * 2; - sc->sc_dcntl = SSH_DCNTL_EA; + sc->sc_dcntl = SSH_DCNTL_EA; /*X*/ if (sc->sc_clock_freq <= 25) /*X*/ sc->sc_dcntl |= (2 << 6); -/*X*/ else if (sc->sc_clock_freq <= 37) +/*X*/ + else if (sc->sc_clock_freq <= 37) /*X*/ sc->sc_dcntl |= (1 << 6); -/*X*/ else if (sc->sc_clock_freq <= 50) +/*X*/ + else if (sc->sc_clock_freq <= 50) /*X*/ sc->sc_dcntl |= (0 << 6); -/*X*/ else +/*X*/ + else /*X*/ sc->sc_dcntl |= (3 << 6); sc->sc_ctest0 = SSH_CTEST0_BTD | SSH_CTEST0_EAN; @@ -161,27 +162,25 @@ afscattach(parent, self, auxp) switch (ca->ca_bustype) { #if NPCCTWO > 0 case BUS_PCCTWO: - { - /* - * Disable caching for the softc. Actually, I want - * to disable cache for acb structures, but they are - * part of softc, and I am disabling the entire softc - * just in case. - */ - - struct pcctworeg *pcc2 = (struct pcctworeg *)ca->ca_master; - - pmap_cache_ctrl(pmap_kernel(), trunc_page((vm_offset_t)sc), - round_page((vm_offset_t)sc + sizeof(*sc)), - CACHE_INH); - - pcctwointr_establish(PCC2V_NCR, &sc->sc_ih); -/* intr_establish(PCC2_VECT + SCSIIRQ, &sc->sc_ih);*/ - /* enable interrupts at ca_ipl */ - pcc2->pcc2_ncrirq = ca->ca_ipl | PCC2_IRQ_IEN; -/* pcc2->pcc2_scsiirq = ca->ca_ipl | PCC2_SCSIIRQ_IEN;*/ - break; - } + { + /* + * Disable caching for the softc. Actually, I want + * to disable cache for acb structures, but they are + * part of softc, and I am disabling the entire softc + * just in case. + */ + + struct pcctworeg *pcc2 = (struct pcctworeg *)ca->ca_master; + + pmap_cache_ctrl(pmap_kernel(), trunc_page((vm_offset_t)sc), + round_page((vm_offset_t)sc + sizeof(*sc)), + CACHE_INH); + + pcctwointr_establish(PCC2V_NCR, &sc->sc_ih); + /* enable interrupts at ca_ipl */ + pcc2->pcc2_ncrirq = ca->ca_ipl | PCC2_IRQ_IEN; + break; + } #endif } @@ -192,18 +191,18 @@ afscattach(parent, self, auxp) * (see dk_establish). */ tmp = bootpart; - if (ca->ca_paddr != bootaddr) - bootpart = -1; /* invalid flag to dk_establish */ + if (ca->ca_paddr != bootaddr) + bootpart = -1; /* invalid flag to dk_establish */ config_found(self, &sc->sc_link, scsiprint); - bootpart = tmp; /* restore old value */ + bootpart = tmp; /* restore old value */ } /* * print diag if pnp is NULL else just extra */ int afscprint(auxp, pnp) - void *auxp; - char *pnp; +void *auxp; +char *pnp; { if (pnp == NULL) return (UNCONF); @@ -212,12 +211,12 @@ afscprint(auxp, pnp) int afsc_dmaintr(arg) - void *arg; +void *arg; { struct ssh_softc *sc = arg; ssh_regmap_p rp; - u_char istat; + u_char istat; rp = sc->sc_sshp; istat = rp->ssh_istat; diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c index 8a00619e570..213d06d09e0 100644 --- a/sys/arch/mvme88k/dev/syscon.c +++ b/sys/arch/mvme88k/dev/syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscon.c,v 1.5 2001/03/09 05:44:39 smurph Exp $ */ +/* $OpenBSD: syscon.c,v 1.6 2001/12/13 08:55:51 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/vme.c b/sys/arch/mvme88k/dev/vme.c index 3d797eb2919..967f6bafb11 100644 --- a/sys/arch/mvme88k/dev/vme.c +++ b/sys/arch/mvme88k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.16 2001/11/07 22:31:57 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.17 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -408,7 +408,6 @@ vme2chip_init(sc) { struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vaddr; u_long ctl; - /* turn off SYSFAIL LED */ vme2->vme2_tctl &= ~VME2_TCTL_SYSFAIL; @@ -462,18 +461,18 @@ vme2chip_init(sc) * Map the Software VME irq levels to the cpu level 7. */ vme2->vme2_irql3 = (7 << VME2_IRQL3_SW7SHIFT) | (7 << VME2_IRQL3_SW6SHIFT) | - (7 << VME2_IRQL3_SW5SHIFT) | (7 << VME2_IRQL3_SW4SHIFT) | - (7 << VME2_IRQL3_SW3SHIFT) | (7 << VME2_IRQL3_SW2SHIFT) | - (7 << VME2_IRQL3_SW1SHIFT) | (7 << VME2_IRQL3_SW0SHIFT); - /* - * pseudo driver, abort interrupt handler - */ - sc->sc_abih.ih_fn = vme2abort; - sc->sc_abih.ih_arg = 0; - sc->sc_abih.ih_wantframe = 1; - sc->sc_abih.ih_ipl = IPL_NMI; - intr_establish(110, &sc->sc_abih); - vme2->vme2_irqen |= VME2_IRQ_AB; + (7 << VME2_IRQL3_SW5SHIFT) | (7 << VME2_IRQL3_SW4SHIFT) | + (7 << VME2_IRQL3_SW3SHIFT) | (7 << VME2_IRQL3_SW2SHIFT) | + (7 << VME2_IRQL3_SW1SHIFT) | (7 << VME2_IRQL3_SW0SHIFT); + /* + * pseudo driver, abort interrupt handler + */ + sc->sc_abih.ih_fn = vme2abort; + sc->sc_abih.ih_arg = 0; + sc->sc_abih.ih_wantframe = 1; + sc->sc_abih.ih_ipl = IPL_NMI; + intr_establish(110, &sc->sc_abih); + vme2->vme2_irqen |= VME2_IRQ_AB; vme2->vme2_irqen |= VME2_IRQ_ACF; } #endif /* NPCCTWO */ diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index 0f5e21006a1..06ef4456540 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.11 2001/11/06 00:30:38 art Exp $ */ +/* $OpenBSD: vs.c,v 1.12 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. @@ -56,6 +56,7 @@ #include <machine/autoconf.h> #include <machine/param.h> +#include <machine/cmmu.h> #if defined(mvme88k) #include <mvme88k/dev/vsreg.h> diff --git a/sys/arch/mvme88k/dev/vsdma.c b/sys/arch/mvme88k/dev/vsdma.c index e486117f1e1..dc36f93977b 100644 --- a/sys/arch/mvme88k/dev/vsdma.c +++ b/sys/arch/mvme88k/dev/vsdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsdma.c,v 1.6 2001/03/27 01:16:25 miod Exp $ */ +/* $OpenBSD: vsdma.c,v 1.7 2001/12/13 08:55:51 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -93,11 +93,9 @@ vsmatch(pdp, vcf, args) void *vcf, *args; { struct confargs *ca = args; - if (!badvaddr((unsigned)ca->ca_vaddr, 1)) { - return (1); - } else { + if (badvaddr((unsigned)ca->ca_vaddr, 1)) return (0); - } + return (1); } void diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index 6fc4c3a4402..c93b92ab0c0 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.12 2001/10/28 00:57:38 miod Exp $ */ +/* $OpenBSD: vx.c,v 1.13 2001/12/13 08:55:51 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 @@ -207,15 +205,9 @@ vxmatch(parent, self, aux) vx_reg = (struct vxreg *)ca->ca_vaddr; board_addr = (unsigned int)ca->ca_vaddr; - if (!badvaddr((unsigned)&vx_reg->ipc_cr, 1)) { - if (ca->ca_vec & 0x03) { - printf("xvt: bad vector 0x%x\n", ca->ca_vec); - return (0); - } - return (1); - } else { + if (badvaddr((unsigned)&vx_reg->ipc_cr, 1)) return (0); - } + return (1); } void |