diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-02 17:57:33 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-02 17:57:33 +0000 |
commit | 6d17e46779590d85228dfab86c00fd2ca968fa31 (patch) | |
tree | 3097714167fa8f2f165cfcac672803d327dace96 /sys/arch | |
parent | f8970b7c5d896f4ad492d9bd802ea350e715efb5 (diff) |
Kill ca_master in autoconf structures. Drivers either only attach to one
specific bus (mc/pcc/pcctwo), or they know it from the ca_bustype value,
and can use the globals sys_busname variables.
This also allows for some code simplifications.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme68k/dev/cl.c | 21 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/fooip.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_ie.c | 54 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_le.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_levar.h | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/ipic.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/lp.c | 7 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/mc.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/pcc.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/pcctwo.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sbicdma.c | 50 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sbicvar.h | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sshdma.c | 26 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vme.c | 7 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/wdsc.c | 57 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/wl.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/zs.c | 44 | ||||
-rw-r--r-- | sys/arch/mvme68k/include/autoconf.h | 4 |
18 files changed, 124 insertions, 176 deletions
diff --git a/sys/arch/mvme68k/dev/cl.c b/sys/arch/mvme68k/dev/cl.c index e7fdda6e0b7..f84d4aec2b1 100644 --- a/sys/arch/mvme68k/dev/cl.c +++ b/sys/arch/mvme68k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.34 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.35 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -127,11 +127,11 @@ struct clsoftc { struct intrhand sc_ih_m; struct intrhand sc_ih_t; struct intrhand sc_ih_r; - struct pcctworeg *sc_pcctwo; int sc_flags; int ssir; }; -struct { + +const struct { u_int speed; u_char divisor; u_char clock; @@ -264,7 +264,6 @@ clattach(parent, self, aux) int i; sc->cl_reg = (struct clreg *)ca->ca_vaddr; - sc->sc_pcctwo = ca->ca_master; if (ca->ca_paddr == cl_cons.cl_paddr) { /* if this device is configured as console, @@ -366,18 +365,16 @@ clattach(parent, self, aux) sc->sc_ih_r.ih_wantframe = 0; switch (ca->ca_bustype) { case BUS_PCCTWO: - dopoll = 0; pcctwointr_establish(PCC2V_SCC_RXE,&sc->sc_ih_e); pcctwointr_establish(PCC2V_SCC_M,&sc->sc_ih_m); pcctwointr_establish(PCC2V_SCC_TX,&sc->sc_ih_t); pcctwointr_establish(PCC2V_SCC_RX,&sc->sc_ih_r); - sc->sc_pcctwo = (void *)ca->ca_master; - sc->sc_pcctwo->pcc2_sccerr = 0x01; /* clear errors */ + sys_pcc2->pcc2_sccerr = 0x01; /* clear errors */ /* enable all interrupts at ca_ipl */ - sc->sc_pcctwo->pcc2_sccirq = PCC2_IRQ_IEN | (ca->ca_ipl & 0x7); - sc->sc_pcctwo->pcc2_scctx = PCC2_IRQ_IEN | (ca->ca_ipl & 0x7); - sc->sc_pcctwo->pcc2_sccrx = PCC2_IRQ_IEN | (ca->ca_ipl & 0x7); + sys_pcc2->pcc2_sccirq = PCC2_IRQ_IEN | (ca->ca_ipl & 0x7); + sys_pcc2->pcc2_scctx = PCC2_IRQ_IEN | (ca->ca_ipl & 0x7); + sys_pcc2->pcc2_sccrx = PCC2_IRQ_IEN | (ca->ca_ipl & 0x7); break; } @@ -1201,12 +1198,12 @@ clgetc(sc, channel) struct clreg *cl_reg; volatile struct pcctworeg *pcc2_base; u_char val, reoir, licr, isrl, fifo_cnt, data; - if (0 == sc) { + if (sc == NULL) { cl_reg = cl_cons.cl_vaddr; pcc2_base = cl_cons.pcctwoaddr; } else { cl_reg = sc->cl_reg; - pcc2_base = sc->sc_pcctwo; + pcc2_base = sys_pcc2; } val = cl_reg->cl_rir; /* if no receive interrupt pending wait */ diff --git a/sys/arch/mvme68k/dev/fooip.c b/sys/arch/mvme68k/dev/fooip.c index 8e3a2c445e4..980cf73774a 100644 --- a/sys/arch/mvme68k/dev/fooip.c +++ b/sys/arch/mvme68k/dev/fooip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fooip.c,v 1.7 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: fooip.c,v 1.8 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -88,7 +88,7 @@ fooipattach(parent, self, args) struct fooipsoftc *sc = (struct fooipsoftc *)self; struct confargs *ca = args; - sc->sc_ipicsc = (struct ipicsoftc *)ca->ca_master; + sc->sc_ipicsc = (struct ipicsoftc *)parent; sc->sc_regs = (struct fooipregs *)(ca->ca_vaddr + IPIC_IP_REGOFFSET); sc->sc_slot = ca->ca_offset; diff --git a/sys/arch/mvme68k/dev/if_ie.c b/sys/arch/mvme68k/dev/if_ie.c index 4dfc4018fee..d58984791cf 100644 --- a/sys/arch/mvme68k/dev/if_ie.c +++ b/sys/arch/mvme68k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.24 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: if_ie.c,v 1.25 2004/07/02 17:57:29 miod Exp $ */ /*- * Copyright (c) 1999 Steve Murphree, Jr. @@ -230,12 +230,6 @@ struct ie_softc { #ifdef IEDEBUG int sc_debug; #endif -#if NMC > 0 - struct mcreg *sc_mc; -#endif -#if NPCCTWO > 0 - struct pcctworeg *sc_pcc2; -#endif }; void ie_obreset(void *); @@ -487,36 +481,34 @@ ieattach(parent, self, aux) #if NMC > 0 case BUS_MC: mcintr_establish(MCV_IE, &sc->sc_ih); - sc->sc_mc = (struct mcreg *)ca->ca_master; - sc->sc_mc->mc_ieirq = pri | MC_SC_SNOOP | MC_IRQ_IEN | + sys_mc->mc_ieirq = pri | MC_SC_SNOOP | MC_IRQ_IEN | MC_IRQ_ICLR; mcintr_establish(MCV_IEFAIL, &sc->sc_failih); - sc->sc_mc->mc_iefailirq = pri | MC_IRQ_IEN | MC_IRQ_ICLR; + sys_mc->mc_iefailirq = pri | MC_IRQ_IEN | MC_IRQ_ICLR; break; #endif #if NPCCTWO > 0 case BUS_PCCTWO: pcctwointr_establish(PCC2V_IE, &sc->sc_ih); - sc->sc_pcc2 = (struct pcctworeg *)ca->ca_master; - switch (cputyp) { + switch (cputyp) { #ifdef MVME172 - case CPU_172: + case CPU_172: #endif #ifdef MVME177 - case CPU_177: + case CPU_177: #endif #if defined(MVME172) || defined(MVME177) - /* no snooping on 68060 */ - sc->sc_pcc2->pcc2_ieirq = pri | PCC2_SC_SNOOP | - PCC2_IRQ_IEN | PCC2_IRQ_ICLR; - break; + /* no snooping on 68060 */ + sys_pcc2->pcc2_ieirq = pri | PCC2_SC_INHIBIT | + PCC2_IRQ_IEN | PCC2_IRQ_ICLR; + break; #endif - default: - sc->sc_pcc2->pcc2_ieirq = pri | PCC2_SC_SNOOP | - PCC2_IRQ_IEN | PCC2_IRQ_ICLR; - } + default: + sys_pcc2->pcc2_ieirq = pri | PCC2_SC_SNOOP | + PCC2_IRQ_IEN | PCC2_IRQ_ICLR; + } pcctwointr_establish(PCC2V_IEFAIL, &sc->sc_failih); - sc->sc_pcc2->pcc2_iefailirq = pri | PCC2_IRQ_IEN | + sys_pcc2->pcc2_iefailirq = pri | PCC2_IRQ_IEN | PCC2_IRQ_ICLR; break; #endif @@ -550,16 +542,16 @@ void *v; switch (sc->sc_bustype) { #if NMC > 0 case BUS_MC: - sc->sc_mc->mc_ieirq |= MC_IRQ_ICLR; /* safe: clear irq */ - sc->sc_mc->mc_iefailirq |= MC_IRQ_ICLR; /* clear failure */ - sc->sc_mc->mc_ieerr = MC_IEERR_SCLR; /* reset error */ + sys_mc->mc_ieirq |= MC_IRQ_ICLR; /* safe: clear irq */ + sys_mc->mc_iefailirq |= MC_IRQ_ICLR; /* clear failure */ + sys_mc->mc_ieerr = MC_IEERR_SCLR; /* reset error */ break; #endif #if NPCCTWO > 0 case BUS_PCCTWO: - sc->sc_pcc2->pcc2_ieirq |= PCC2_IRQ_ICLR; /* safe: clear irq */ - sc->sc_pcc2->pcc2_iefailirq |= PCC2_IRQ_ICLR; /* clear failure */ - sc->sc_pcc2->pcc2_ieerr = PCC2_IEERR_SCLR; /* reset error */ + sys_pcc2->pcc2_ieirq |= PCC2_IRQ_ICLR; /* safe: clear irq */ + sys_pcc2->pcc2_iefailirq |= PCC2_IRQ_ICLR; /* clear failure */ + sys_pcc2->pcc2_ieerr = PCC2_IEERR_SCLR; /* reset error */ break; #endif } @@ -587,12 +579,12 @@ loop: switch (sc->sc_bustype) { #if NMC > 0 case BUS_MC: - sc->sc_mc->mc_ieirq |= MC_IRQ_ICLR; /* clear irq */ + sys_mc->mc_ieirq |= MC_IRQ_ICLR; /* clear irq */ break; #endif #if NPCCTWO > 0 case BUS_PCCTWO: - sc->sc_pcc2->pcc2_ieirq |= PCC2_IRQ_ICLR; /* clear irq */ + sys_pcc2->pcc2_ieirq |= PCC2_IRQ_ICLR; /* clear irq */ break; #endif } diff --git a/sys/arch/mvme68k/dev/if_le.c b/sys/arch/mvme68k/dev/if_le.c index df91845d4b2..e08b1f059a6 100644 --- a/sys/arch/mvme68k/dev/if_le.c +++ b/sys/arch/mvme68k/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.26 2004/04/29 06:23:44 miod Exp $ */ +/* $OpenBSD: if_le.c,v 1.27 2004/07/02 17:57:29 miod Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 @@ -416,7 +416,7 @@ leattach(parent, self, aux) lesc->sc_ih.ih_arg = sc; lesc->sc_ih.ih_ipl = pri; pccintr_establish(PCCV_LE, &lesc->sc_ih); - ((struct pccreg *)ca->ca_master)->pcc_leirq = pri | PCC_IRQ_IEN; + sys_pcc->pcc_leirq = pri | PCC_IRQ_IEN; break; #endif } diff --git a/sys/arch/mvme68k/dev/if_levar.h b/sys/arch/mvme68k/dev/if_levar.h index 4887216e0f9..c293507713c 100644 --- a/sys/arch/mvme68k/dev/if_levar.h +++ b/sys/arch/mvme68k/dev/if_levar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_levar.h,v 1.4 2003/06/02 23:27:50 millert Exp $ */ +/* $OpenBSD: if_levar.h,v 1.5 2004/07/02 17:57:29 miod Exp $ */ /* $NetBSD: if_levar.h,v 1.5 1996/05/07 01:27:32 thorpej Exp $ */ /*- @@ -50,7 +50,6 @@ struct le_softc { u_short csr; /* Control/Status reg image */ struct evcnt sc_intrcnt; struct evcnt sc_errcnt; - struct vme2reg *sc_vme2; u_char sc_ipl; u_char sc_vec; }; diff --git a/sys/arch/mvme68k/dev/ipic.c b/sys/arch/mvme68k/dev/ipic.c index 7959776c5b9..fae6327b70b 100644 --- a/sys/arch/mvme68k/dev/ipic.c +++ b/sys/arch/mvme68k/dev/ipic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipic.c,v 1.13 2004/01/14 20:52:49 miod Exp $ */ +/* $OpenBSD: ipic.c,v 1.14 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -131,7 +131,6 @@ ipicscan(parent, child, args) if (oca.ca_ipl > 0 && oca.ca_vec == -1) oca.ca_vec = intr_findvec(255, 0); - oca.ca_master = (void *)sc; oca.ca_name = cf->cf_driver->cd_name; if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0) { diff --git a/sys/arch/mvme68k/dev/lp.c b/sys/arch/mvme68k/dev/lp.c index 2b0b3f8f390..d82e7e77214 100644 --- a/sys/arch/mvme68k/dev/lp.c +++ b/sys/arch/mvme68k/dev/lp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lp.c,v 1.8 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: lp.c,v 1.9 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -46,7 +46,6 @@ struct lpsoftc { struct device sc_dev; struct intrhand sc_ih; - struct pccreg *sc_pcc; }; void lpattach(struct device *, struct device *, void *); @@ -82,8 +81,6 @@ lpattach(parent, self, args) struct lpsoftc *sc = (struct lpsoftc *)self; struct confargs *ca = args; - sc->sc_pcc = (struct pccreg *)ca->ca_master; - printf(": unsupported\n"); sc->sc_ih.ih_fn = lpintr; @@ -91,7 +88,7 @@ lpattach(parent, self, args) sc->sc_ih.ih_ipl = ca->ca_ipl; pccintr_establish(PCCV_PRINTER, &sc->sc_ih); - sc->sc_pcc->pcc_lpirq = ca->ca_ipl | PCC_IRQ_IEN | PCC_LPIRQ_ACK; + sys_pcc->pcc_lpirq = ca->ca_ipl | PCC_IRQ_IEN | PCC_LPIRQ_ACK; } int diff --git a/sys/arch/mvme68k/dev/mc.c b/sys/arch/mvme68k/dev/mc.c index d0f400a6df5..5fe4dd4a604 100644 --- a/sys/arch/mvme68k/dev/mc.c +++ b/sys/arch/mvme68k/dev/mc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mc.c,v 1.14 2004/01/14 20:52:49 miod Exp $ */ +/* $OpenBSD: mc.c,v 1.15 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -118,7 +118,6 @@ mc_scan(parent, child, args) oca.ca_vaddr = (void *)-1; } oca.ca_bustype = BUS_MC; - oca.ca_master = (void *)sc->sc_mc; oca.ca_name = cf->cf_driver->cd_name; if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0) return (0); diff --git a/sys/arch/mvme68k/dev/pcc.c b/sys/arch/mvme68k/dev/pcc.c index 94f8250a6ee..cffe31650c2 100644 --- a/sys/arch/mvme68k/dev/pcc.c +++ b/sys/arch/mvme68k/dev/pcc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcc.c,v 1.12 2004/01/14 20:52:49 miod Exp $ */ +/* $OpenBSD: pcc.c,v 1.13 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -117,7 +117,6 @@ pcc_scan(parent, child, args) oca.ca_paddr = (void *)-1; } oca.ca_bustype = BUS_PCC; - oca.ca_master = (void *)sc->sc_pcc; oca.ca_name = cf->cf_driver->cd_name; if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0) return (0); diff --git a/sys/arch/mvme68k/dev/pcctwo.c b/sys/arch/mvme68k/dev/pcctwo.c index ab7ce7c3cff..dbb4089d6b9 100644 --- a/sys/arch/mvme68k/dev/pcctwo.c +++ b/sys/arch/mvme68k/dev/pcctwo.c @@ -1,5 +1,5 @@ -/* $OpenBSD: pcctwo.c,v 1.12 2004/01/14 20:52:49 miod Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.13 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -120,7 +120,6 @@ pcctwo_scan(parent, child, args) oca.ca_paddr = (void *)-1; } oca.ca_bustype = BUS_PCCTWO; - oca.ca_master = (void *)sc->sc_pcc2; oca.ca_name = cf->cf_driver->cd_name; if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0) return (0); diff --git a/sys/arch/mvme68k/dev/sbicdma.c b/sys/arch/mvme68k/dev/sbicdma.c index ea6622acde9..bde1e079715 100644 --- a/sys/arch/mvme68k/dev/sbicdma.c +++ b/sys/arch/mvme68k/dev/sbicdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbicdma.c,v 1.9 2003/11/03 06:54:25 david Exp $ */ +/* $OpenBSD: sbicdma.c,v 1.10 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -101,10 +101,8 @@ sbicdmaattach(parent, self, args) void *args; { struct sbic_softc *sc = (struct sbic_softc *)self; - struct pccreg *pcc; struct confargs *ca = args; - sc->sc_cregs = (struct pccreg *)ca->ca_master; sc->sc_dmafree = sbicdma_dmafree; sc->sc_dmago = sbicdma_dmago; sc->sc_dmanext = sbicdma_dmanext; @@ -135,9 +133,8 @@ sbicdmaattach(parent, self, args) sc->sc_dmaih.ih_ipl = ca->ca_ipl; pccintr_establish(PCCV_DMA, &sc->sc_dmaih); - pcc = (struct pccreg *)sc->sc_cregs; - pcc->pcc_dmairq = sc->sc_dmaih.ih_ipl | PCC_IRQ_INT; - pcc->pcc_sbicirq = sc->sc_ih.ih_ipl | PCC_SBIC_RESETIRQ; + sys_pcc->pcc_dmairq = sc->sc_dmaih.ih_ipl | PCC_IRQ_INT; + sys_pcc->pcc_sbicirq = sc->sc_ih.ih_ipl | PCC_SBIC_RESETIRQ; sbicreset(sc); @@ -166,7 +163,6 @@ sbicdma_dmago(sc, va, count, flags) char *va; int count, flags; { - struct pccreg *pcc = (struct pccreg *)sc->sc_cregs; u_char csr; u_long pa; @@ -178,20 +174,20 @@ sbicdma_dmago(sc, va, count, flags) #endif sc->sc_flags |= SBICF_INTR; - pcc->pcc_dmadaddr = (u_long)pa; + sys_pcc->pcc_dmadaddr = (u_long)pa; if (count & PCC_DMABCNT_CNTMASK) { printf("%s: dma count 0x%x too large\n", sc->sc_dev.dv_xname, count); return (0); } - pcc->pcc_dmabcnt = (PCC_DMABCNT_MAKEFC(FC_USERD)) | + sys_pcc->pcc_dmabcnt = (PCC_DMABCNT_MAKEFC(FC_USERD)) | (count & PCC_DMABCNT_CNTMASK); /* make certain interrupts are disabled first, and reset */ - pcc->pcc_dmairq = sc->sc_dmaih.ih_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; - pcc->pcc_sbicirq = sc->sc_ih.ih_ipl | PCC_SBIC_RESETIRQ | PCC_IRQ_IEN; - pcc->pcc_dmacsr = 0; - pcc->pcc_dmacsr = PCC_DMACSR_DEN | + sys_pcc->pcc_dmairq = sc->sc_dmaih.ih_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_sbicirq = sc->sc_ih.ih_ipl | PCC_SBIC_RESETIRQ | PCC_IRQ_IEN; + sys_pcc->pcc_dmacsr = 0; + sys_pcc->pcc_dmacsr = PCC_DMACSR_DEN | ((flags & DMAGO_READ) == 0) ? PCC_DMACSR_TOSCSI : 0; return (sc->sc_tcnt); @@ -201,16 +197,17 @@ int sbicdma_dmaintr(sc) struct sbic_softc *sc; { - struct pccreg *pcc = (struct pccreg *)sc->sc_cregs; u_char stat; int ret = 0; /* DMA done */ - stat = pcc->pcc_dmacsr; + stat = sys_pcc->pcc_dmacsr; +#ifdef DEBUG printf("dmaintr%d ", stat); +#endif if (stat & PCC_DMACSR_DONE) { - pcc->pcc_dmacsr = 0; - pcc->pcc_dmairq = 0; /* ack and remove intr */ + sys_pcc->pcc_dmacsr = 0; + sys_pcc->pcc_dmairq = 0; /* ack and remove intr */ if (stat & PCC_DMACSR_ERR8BIT) { printf("%s: 8 bit error\n", sc->sc_dev.dv_xname); } @@ -227,18 +224,19 @@ int sbicdma_scintr(sc) struct sbic_softc *sc; { - struct pccreg *pcc = (struct pccreg *)sc->sc_cregs; u_char stat; int ret = 0; +#ifdef DEBUG printf("scintr%d ", stat); - stat = pcc->pcc_sbicirq; +#endif + stat = sys_pcc->pcc_sbicirq; if (stat & PCC_SBIC_RESETIRQ) { printf("%s: scintr: a scsi device pulled reset\n", sc->sc_dev.dv_xname); - pcc->pcc_sbicirq = pcc->pcc_sbicirq | PCC_SBIC_RESETIRQ; + sys_pcc->pcc_sbicirq = sys_pcc->pcc_sbicirq | PCC_SBIC_RESETIRQ; } else if (stat & PCC_IRQ_INT) { - pcc->pcc_sbicirq = 0; + sys_pcc->pcc_sbicirq = 0; sbicintr(sc); ret = 1; sc->sc_intrcnt.ev_count++; @@ -250,7 +248,9 @@ void sbicdma_dmastop(sc) struct sbic_softc *sc; { +#ifdef DEBUG printf("sbicdma_dmastop called\n"); +#endif /* XXX do nothing */ } @@ -258,16 +258,18 @@ int sbicdma_dmanext(sc) struct sbic_softc *sc; { +#ifdef DEBUG printf("sbicdma_dmanext called\n"); +#endif } void sbicdma_dmafree(sc) struct sbic_softc *sc; { - struct pccreg *pcc = (struct pccreg *)sc->sc_cregs; - +#ifdef DEBUG printf("sbicdma_dmafree called\n"); +#endif /* make certain interrupts are disabled first, reset */ - pcc->pcc_dmairq = 0; + sys_pcc->pcc_dmairq = 0; } diff --git a/sys/arch/mvme68k/dev/sbicvar.h b/sys/arch/mvme68k/dev/sbicvar.h index f684d1d72a4..44875db2c43 100644 --- a/sys/arch/mvme68k/dev/sbicvar.h +++ b/sys/arch/mvme68k/dev/sbicvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sbicvar.h,v 1.6 2003/06/02 23:27:50 millert Exp $ */ +/* $OpenBSD: sbicvar.h,v 1.7 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -99,7 +99,6 @@ struct sbic_softc { u_char lun; struct scsi_link sc_link; /* proto for sub devices */ sbic_regmap_p sc_sbicp; /* the SBIC */ - void *sc_cregs; /* driver specific regs */ int sc_ipl; /* Lists of command blocks */ diff --git a/sys/arch/mvme68k/dev/sshdma.c b/sys/arch/mvme68k/dev/sshdma.c index b9eada44929..5658f87b702 100644 --- a/sys/arch/mvme68k/dev/sshdma.c +++ b/sys/arch/mvme68k/dev/sshdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshdma.c,v 1.8 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: sshdma.c,v 1.9 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -154,24 +154,16 @@ void *auxp; switch (ca->ca_bustype) { #if NMC > 0 - case BUS_MC: - { - struct mcreg *mc = (struct mcreg *)ca->ca_master; - - mcintr_establish(MCV_NCR, &sc->sc_ih); - mc->mc_ncrirq = ca->ca_ipl | MC_IRQ_IEN; - break; - } + case BUS_MC: + mcintr_establish(MCV_NCR, &sc->sc_ih); + sys_mc->mc_ncrirq = ca->ca_ipl | MC_IRQ_IEN; + break; #endif #if NPCCTWO > 0 - case BUS_PCCTWO: - { - struct pcctworeg *pcc2 = (struct pcctworeg *)ca->ca_master; - - pcctwointr_establish(PCC2V_NCR, &sc->sc_ih); - pcc2->pcc2_ncrirq = ca->ca_ipl | PCC2_IRQ_IEN; - break; - } + case BUS_PCCTWO: + pcctwointr_establish(PCC2V_NCR, &sc->sc_ih); + sys_pcc2->pcc2_ncrirq = ca->ca_ipl | PCC2_IRQ_IEN; + break; #endif } diff --git a/sys/arch/mvme68k/dev/vme.c b/sys/arch/mvme68k/dev/vme.c index 844ae9db77d..ebe470f3cfc 100644 --- a/sys/arch/mvme68k/dev/vme.c +++ b/sys/arch/mvme68k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.19 2004/01/14 20:52:49 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.20 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -89,9 +89,7 @@ vmematch(parent, cf, args) struct confargs *ca = args; if (ca->ca_bustype == BUS_MC) { - struct mcreg *mc = (struct mcreg *)ca->ca_master; - - if (mc->mc_ver & MC_VER_NOVME) + if (sys_mc->mc_ver & MC_VER_NOVME) return (0); } #endif @@ -323,7 +321,6 @@ vmescan(parent, child, args, bustype) oca.ca_vaddr = vmemap(sc, oca.ca_paddr, oca.ca_len, oca.ca_bustype); if (!oca.ca_vaddr) oca.ca_vaddr = (void *)-1; - oca.ca_master = (void *)sc; oca.ca_name = cf->cf_driver->cd_name; if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0) { if (oca.ca_vaddr != (void *)-1) diff --git a/sys/arch/mvme68k/dev/wdsc.c b/sys/arch/mvme68k/dev/wdsc.c index 162baa27e8f..d598f6f7417 100644 --- a/sys/arch/mvme68k/dev/wdsc.c +++ b/sys/arch/mvme68k/dev/wdsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdsc.c,v 1.9 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: wdsc.c,v 1.10 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1996 Steve Woodford @@ -112,7 +112,6 @@ wdscattach(pdp, dp, auxp) { struct sbic_softc *sc = (struct sbic_softc *)dp; struct confargs *ca = auxp; - struct pccreg *pcc = (struct pccreg *)ca->ca_master; int tmp; sc->sc_enintr = wdsc_enintr; @@ -129,7 +128,6 @@ wdscattach(pdp, dp, auxp) printf(": target %d\n", sc->sc_link.adapter_target); - sc->sc_cregs = (void *)pcc; sc->sc_sbicp = (sbic_regmap_p)ca->ca_vaddr; /* @@ -151,9 +149,9 @@ wdscattach(pdp, dp, auxp) sc->sc_ipl = ca->ca_ipl; - pcc->pcc_sbicirq = ca->ca_ipl | PCC_IRQ_INT; - pcc->pcc_dmairq = ca->ca_ipl | PCC_IRQ_INT; - pcc->pcc_dmacsr = 0; + sys_pcc->pcc_sbicirq = ca->ca_ipl | PCC_IRQ_INT; + sys_pcc->pcc_dmairq = ca->ca_ipl | PCC_IRQ_INT; + sys_pcc->pcc_dmacsr = 0; /* * Fix up the interrupts @@ -168,7 +166,7 @@ wdscattach(pdp, dp, auxp) sc->sc_sbicih.ih_ipl = ca->ca_ipl; pccintr_establish(PCCV_SBIC, &sc->sc_sbicih); - pcc->pcc_sbicirq = ca->ca_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_sbicirq = ca->ca_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; /* * Attach all scsi units on us, watching for boot device @@ -188,11 +186,9 @@ void wdsc_enintr(dev) struct sbic_softc *dev; { - struct pccreg *pcc = dev->sc_cregs; - dev->sc_flags |= SBICF_INTR; - pcc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; } /* @@ -204,8 +200,6 @@ wdsc_dmago(dev, addr, count, flags) char *addr; int count, flags; { - volatile struct pccreg *pc = dev->sc_cregs; - /* * Set up the command word based on flags */ @@ -222,11 +216,11 @@ wdsc_dmago(dev, addr, count, flags) * Note, it's probably not necessary to do this here, since dmanext * is called just prior to the actual transfer. */ - pc->pcc_dmacsr = 0; - pc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; - pc->pcc_dmadaddr = (unsigned long)dev->sc_cur->dc_addr; - pc->pcc_dmabcnt = (unsigned long)dev->sc_tcnt | (1 << 24); - pc->pcc_dmacsr = dev->sc_dmacmd; + sys_pcc->pcc_dmacsr = 0; + sys_pcc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_dmadaddr = (unsigned long)dev->sc_cur->dc_addr; + sys_pcc->pcc_dmabcnt = (unsigned long)dev->sc_tcnt | (1 << 24); + sys_pcc->pcc_dmacsr = dev->sc_dmacmd; return(dev->sc_tcnt); } @@ -238,8 +232,6 @@ int wdsc_dmanext(dev) struct sbic_softc *dev; { - volatile struct pccreg *pc = dev->sc_cregs; - if ( dev->sc_cur > dev->sc_last ) { /* * Shouldn't happen !! @@ -254,11 +246,11 @@ wdsc_dmanext(dev) /* * Load the next DMA address */ - pc->pcc_dmacsr = 0; - pc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; - pc->pcc_dmadaddr = (unsigned long)dev->sc_cur->dc_addr; - pc->pcc_dmabcnt = (unsigned long)dev->sc_tcnt | (1 << 24); - pc->pcc_dmacsr = dev->sc_dmacmd; + sys_pcc->pcc_dmacsr = 0; + sys_pcc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_dmadaddr = (unsigned long)dev->sc_cur->dc_addr; + sys_pcc->pcc_dmabcnt = (unsigned long)dev->sc_tcnt | (1 << 24); + sys_pcc->pcc_dmacsr = dev->sc_dmacmd; return(dev->sc_tcnt); } @@ -270,13 +262,12 @@ void wdsc_dmastop(dev) struct sbic_softc *dev; { - volatile struct pccreg *pc = dev->sc_cregs; int s; s = splbio(); - pc->pcc_dmacsr = 0; - pc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_INT; + sys_pcc->pcc_dmacsr = 0; + sys_pcc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_INT; splx(s); } @@ -289,23 +280,22 @@ wdsc_dmaintr(arg) void *arg; { struct sbic_softc *dev = (struct sbic_softc *)arg; - volatile struct pccreg *pc = dev->sc_cregs; int found = 0; /* * Really a DMA interrupt? */ - if ( (pc->pcc_dmairq & PCC_IRQ_INT) == 0 ) + if ( (sys_pcc->pcc_dmairq & PCC_IRQ_INT) == 0 ) return(0); /* * Was it a completion interrupt? * XXXSCW Note: Support for other DMA interrupts is required, eg. buserr */ - if ( pc->pcc_dmacsr & DMAC_CSR_DONE ) { + if ( sys_pcc->pcc_dmacsr & DMAC_CSR_DONE ) { ++found; - pc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_dmairq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; } return(found); @@ -319,13 +309,12 @@ wdsc_scsiintr(arg) void *arg; { struct sbic_softc *dev = (struct sbic_softc *)arg; - volatile struct pccreg *pc = dev->sc_cregs; int found; /* * Really a SCSI interrupt? */ - if ( (pc->pcc_sbicirq & PCC_IRQ_INT) == 0 ) + if ( (sys_pcc->pcc_sbicirq & PCC_IRQ_INT) == 0 ) return(0); /* @@ -336,7 +325,7 @@ wdsc_scsiintr(arg) /* * Acknowledge and clear the interrupt */ - pc->pcc_sbicirq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; + sys_pcc->pcc_sbicirq = dev->sc_ipl | PCC_IRQ_IEN | PCC_IRQ_INT; return(found); } diff --git a/sys/arch/mvme68k/dev/wl.c b/sys/arch/mvme68k/dev/wl.c index dcdf9020d7e..ce4b62b0f3e 100644 --- a/sys/arch/mvme68k/dev/wl.c +++ b/sys/arch/mvme68k/dev/wl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wl.c,v 1.14 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: wl.c,v 1.15 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -131,7 +131,6 @@ struct wlsoftc { struct intrhand sc_ih_m; struct intrhand sc_ih_t; struct intrhand sc_ih_r; - struct vme2reg *sc_vme2; u_char sc_vec; int sc_flags; }; @@ -250,7 +249,6 @@ wlattach(parent, self, aux) int i, j, s; sc->cl_reg = (struct clreg *)&clb->chips[0].clreg; - sc->sc_vme2 = ca->ca_master; sc->sc_vec = ca->ca_vec; sc->sc_memv = 0xa5 + 0; diff --git a/sys/arch/mvme68k/dev/zs.c b/sys/arch/mvme68k/dev/zs.c index af689399930..307feccb7a1 100644 --- a/sys/arch/mvme68k/dev/zs.c +++ b/sys/arch/mvme68k/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.15 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: zs.c,v 1.16 2004/07/02 17:57:29 miod Exp $ */ /* * Copyright (c) 2000 Steve Murphree, Jr. @@ -109,12 +109,6 @@ struct zssoftc { struct zs sc_zs[2]; struct evcnt sc_intrcnt; struct intrhand sc_ih; -#if NPCC > 0 - struct pccreg *sc_pcc; -#endif -#if NMC > 0 - struct mcreg *sc_mc; -#endif int sc_flags; }; #define ZSSF_85230 1 @@ -217,23 +211,21 @@ zsattach(parent, self, args) sc->sc_ih.ih_ipl = zs_level; switch (ca->ca_bustype) { #if NPCC > 0 - case BUS_PCC: - pccintr_establish(PCCV_ZS, &sc->sc_ih); - sc->sc_pcc = (struct pccreg *)ca->ca_master; - break; + case BUS_PCC: + pccintr_establish(PCCV_ZS, &sc->sc_ih); + break; #endif #if NMC > 0 - case BUS_MC: - if (sys_mc->mc_chiprev == 0x01) - /* - * MC rev 0x01 has a bug and can not access scc regs directly. - * Macros will do the right thing based on the value of - * mc_rev1_bug - XXX smurph - */ - mc_rev1_bug = 1; /* defined in scc.h */ - mcintr_establish(MCV_ZS, &sc->sc_ih); - sc->sc_mc = (struct mcreg *)ca->ca_master; - break; + case BUS_MC: + if (sys_mc->mc_chiprev == 0x01) + /* + * MC rev 0x01 has a bug and can not access scc regs directly. + * Macros will do the right thing based on the value of + * mc_rev1_bug - XXX smurph + */ + mc_rev1_bug = 1; /* defined in scc.h */ + mcintr_establish(MCV_ZS, &sc->sc_ih); + break; #endif } @@ -287,22 +279,22 @@ zsattach(parent, self, args) switch (ca->ca_bustype) { #if NPCC > 0 case BUS_PCC: - ir = sc->sc_pcc->pcc_zsirq; + ir = sys_pcc->pcc_zsirq; if ((ir & PCC_IRQ_IPL) != 0 && (ir & PCC_IRQ_IPL) != zs_level) panic("zs configured at different IPLs"); if (initirq) break; - sc->sc_pcc->pcc_zsirq = zs_level | PCC_IRQ_IEN | PCC_ZS_PCCVEC; + sys_pcc->pcc_zsirq = zs_level | PCC_IRQ_IEN | PCC_ZS_PCCVEC; break; #endif #if NMC > 0 case BUS_MC: - ir = sc->sc_mc->mc_zsirq; + ir = sys_mc->mc_zsirq; if ((ir & MC_IRQ_IPL) != 0 && (ir & MC_IRQ_IPL) != zs_level) panic("zs configured at different IPLs"); if (initirq) break; - sc->sc_mc->mc_zsirq = zs_level | MC_IRQ_IEN; + sys_mc->mc_zsirq = zs_level | MC_IRQ_IEN; break; #endif } diff --git a/sys/arch/mvme68k/include/autoconf.h b/sys/arch/mvme68k/include/autoconf.h index 1a114ca1743..4a3a7be2549 100644 --- a/sys/arch/mvme68k/include/autoconf.h +++ b/sys/arch/mvme68k/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.8 2003/06/02 05:09:14 deraadt Exp $ */ +/* $OpenBSD: autoconf.h,v 1.9 2004/07/02 17:57:32 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -37,8 +37,6 @@ struct confargs { int ca_ipl; int ca_vec; char *ca_name; - - void *ca_master; /* points to bus-dependent data */ }; #define BUS_MAIN 1 |