Save the "bustype" from our attach args in the controller "softc"
and use that instead of hard-coding BUS_VME32 everywhere. (The Sun3X needs a more specific bustype value.)
This commit is contained in:
parent
3ba1e07ef5
commit
faf4390c38
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xd.c,v 1.18 1998/01/12 20:32:27 thorpej Exp $ */
|
||||
/* $NetBSD: xd.c,v 1.19 1998/01/26 21:03:44 gwr Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -36,7 +36,7 @@
|
|||
* x d . c x y l o g i c s 7 5 3 / 7 0 5 3 v m e / s m d d r i v e r
|
||||
*
|
||||
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
|
||||
* id: $NetBSD: xd.c,v 1.18 1998/01/12 20:32:27 thorpej Exp $
|
||||
* id: &Id: xd.c,v 1.9 1995/09/25 20:12:44 chuck Exp &
|
||||
* started: 27-Feb-95
|
||||
* references: [1] Xylogics Model 753 User's Manual
|
||||
* part number: 166-753-001, Revision B, May 21, 1988.
|
||||
|
@ -385,8 +385,9 @@ xdcattach(parent, self, aux)
|
|||
|
||||
xdc->xdc = (struct xdc *)
|
||||
bus_mapin(ca->ca_bustype, ca->ca_paddr, sizeof(struct xdc));
|
||||
xdc->ipl = ca->ca_intpri;
|
||||
xdc->vector = ca->ca_intvec;
|
||||
xdc->bustype = ca->ca_bustype;
|
||||
xdc->ipl = ca->ca_intpri;
|
||||
xdc->vector = ca->ca_intvec;
|
||||
|
||||
for (lcv = 0; lcv < XDC_MAXDEV; lcv++)
|
||||
xdc->sc_drives[lcv] = (struct xd_softc *) 0;
|
||||
|
@ -401,7 +402,7 @@ xdcattach(parent, self, aux)
|
|||
dvma_malloc(XDC_MAXIOPB * sizeof(struct xd_iopb)); /* KVA */
|
||||
bzero(xdc->iopbase, XDC_MAXIOPB * sizeof(struct xd_iopb));
|
||||
xdc->dvmaiopb = (struct xd_iopb *)
|
||||
dvma_kvtopa(xdc->iopbase, BUS_VME32);
|
||||
dvma_kvtopa(xdc->iopbase, xdc->bustype);
|
||||
xdc->reqs = (struct xd_iorq *)
|
||||
malloc(XDC_MAXIOPB * sizeof(struct xd_iorq), M_DEVBUF, M_NOWAIT);
|
||||
if (xdc->reqs == NULL)
|
||||
|
@ -1272,7 +1273,7 @@ xdc_rqtopb(iorq, iopb, cmd, subfun)
|
|||
iopb->cylno = block;
|
||||
}
|
||||
iopb->daddr = dp = (iorq->dbuf == NULL) ? 0 :
|
||||
dvma_kvtopa(iorq->dbuf, BUS_VME32);
|
||||
dvma_kvtopa(iorq->dbuf, iorq->xdc->bustype);
|
||||
iopb->addrmod = XDC_ADDRMOD;
|
||||
}
|
||||
}
|
||||
|
@ -1525,7 +1526,7 @@ xdc_submit_iorq(xdcsc, iorqno, type)
|
|||
#endif /* XDC_DEBUG */
|
||||
|
||||
/* controller not busy, start command */
|
||||
iopbaddr = dvma_kvtopa(iorq->iopb, BUS_VME32);
|
||||
iopbaddr = dvma_kvtopa(iorq->iopb, xdcsc->bustype);
|
||||
XDC_GO(xdcsc->xdc, iopbaddr); /* go! */
|
||||
xdcsc->nrun++;
|
||||
/* command now running, wrap it up */
|
||||
|
@ -1901,7 +1902,7 @@ xdc_remove_iorq(xdcsc)
|
|||
iorq->xd->nhead;
|
||||
iopb->sectno = iorq->blockno % XDFM_BPS;
|
||||
iopb->daddr =
|
||||
dvma_kvtopa(iorq->dbuf, BUS_VME32);
|
||||
dvma_kvtopa(iorq->dbuf, xdcsc->bustype);
|
||||
XDC_HWAIT(xdcsc, rqno);
|
||||
xdc_start(xdcsc, 1); /* resubmit */
|
||||
continue;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xdvar.h,v 1.4 1997/10/17 03:47:56 gwr Exp $ */
|
||||
/* $NetBSD: xdvar.h,v 1.5 1998/01/26 21:03:43 gwr Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -140,10 +140,12 @@ struct xdc_softc {
|
|||
|
||||
struct xdc *xdc; /* vaddr of vme registers */
|
||||
|
||||
struct xd_softc *sc_drives[XDC_MAXDEV]; /* drives on this controller */
|
||||
int bustype; /* from attach args */
|
||||
int ipl; /* interrupt level */
|
||||
int vector; /* interrupt vector */
|
||||
|
||||
struct xd_softc *sc_drives[XDC_MAXDEV]; /* drives on this controller */
|
||||
|
||||
struct xd_iorq *reqs; /* i/o requests */
|
||||
struct xd_iopb *iopbase; /* iopb base addr (maps iopb->iorq) */
|
||||
struct xd_iopb *dvmaiopb; /* iopb base in DVMA space, not kvm */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xy.c,v 1.18 1998/01/12 20:32:28 thorpej Exp $ */
|
||||
/* $NetBSD: xy.c,v 1.19 1998/01/26 21:03:46 gwr Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -36,7 +36,7 @@
|
|||
* x y . c x y l o g i c s 4 5 0 / 4 5 1 s m d d r i v e r
|
||||
*
|
||||
* author: Chuck Cranor <chuck@ccrc.wustl.edu>
|
||||
* id: $NetBSD: xy.c,v 1.18 1998/01/12 20:32:28 thorpej Exp $
|
||||
* id: &Id: xy.c,v 1.1 1995/09/25 20:35:14 chuck Exp &
|
||||
* started: 14-Sep-95
|
||||
* references: [1] Xylogics Model 753 User's Manual
|
||||
* part number: 166-753-001, Revision B, May 21, 1988.
|
||||
|
@ -325,8 +325,9 @@ xycattach(parent, self, aux)
|
|||
|
||||
xyc->xyc = (struct xyc *)
|
||||
bus_mapin(ca->ca_bustype, ca->ca_paddr, sizeof(struct xyc));
|
||||
xyc->ipl = ca->ca_intpri;
|
||||
xyc->vector = ca->ca_intvec;
|
||||
xyc->bustype = ca->ca_bustype;
|
||||
xyc->ipl = ca->ca_intpri;
|
||||
xyc->vector = ca->ca_intvec;
|
||||
xyc->no_ols = 0; /* XXX should be from config */
|
||||
|
||||
for (lcv = 0; lcv < XYC_MAXDEV; lcv++)
|
||||
|
@ -354,7 +355,7 @@ xycattach(parent, self, aux)
|
|||
bzero(tmp, pbsz);
|
||||
xyc->iopbase = tmp;
|
||||
xyc->dvmaiopb = (struct xy_iopb *)
|
||||
dvma_kvtopa(xyc->iopbase, BUS_VME16);
|
||||
dvma_kvtopa(xyc->iopbase, xyc->bustype);
|
||||
xyc->reqs = (struct xy_iorq *)
|
||||
malloc(XYC_MAXIOPB * sizeof(struct xy_iorq), M_DEVBUF, M_NOWAIT);
|
||||
if (xyc->reqs == NULL)
|
||||
|
@ -1132,7 +1133,7 @@ xyc_rqtopb(iorq, iopb, cmd, subfun)
|
|||
iopb->dataa = 0;
|
||||
iopb->datar = 0;
|
||||
} else {
|
||||
dp = dvma_kvtopa(iorq->dbuf, BUS_VME16);
|
||||
dp = dvma_kvtopa(iorq->dbuf, iorq->xyc->bustype);
|
||||
iopb->dataa = (dp & 0xffff);
|
||||
iopb->datar = ((dp & 0xff0000) >> 16);
|
||||
}
|
||||
|
@ -1370,7 +1371,7 @@ xyc_submit_iorq(xycsc, iorq, type)
|
|||
return(XY_ERR_AOK);
|
||||
panic("xyc_submit_iorq: xyc_chain failed!\n");
|
||||
}
|
||||
iopbaddr = dvma_kvtopa(iopb, BUS_VME16);
|
||||
iopbaddr = dvma_kvtopa(iopb, xycsc->bustype);
|
||||
|
||||
XYC_GO(xycsc->xyc, iopbaddr);
|
||||
|
||||
|
@ -1401,10 +1402,8 @@ xyc_submit_iorq(xycsc, iorq, type)
|
|||
|
||||
struct xy_iopb *
|
||||
xyc_chain(xycsc, iorq)
|
||||
|
||||
struct xyc_softc *xycsc;
|
||||
struct xy_iorq *iorq;
|
||||
|
||||
struct xyc_softc *xycsc;
|
||||
struct xy_iorq *iorq;
|
||||
{
|
||||
int togo, chain, hand;
|
||||
struct xy_iopb *iopb, *prev_iopb;
|
||||
|
@ -1453,7 +1452,7 @@ struct xy_iorq *iorq;
|
|||
prev_iopb = xycsc->xy_chain[chain-1]->iopb;
|
||||
prev_iopb->chen = 1;
|
||||
prev_iopb->nxtiopb = 0xffff &
|
||||
dvma_kvtopa(iopb, BUS_VME16);
|
||||
dvma_kvtopa(iopb, xycsc->bustype);
|
||||
} else { /* head of chain */
|
||||
iorq = xycsc->xy_chain[chain];
|
||||
}
|
||||
|
@ -1546,7 +1545,7 @@ xyc_xyreset(xycsc, xysc)
|
|||
xycsc->ciopb->ien = 0;
|
||||
xycsc->ciopb->com = XYCMD_RST;
|
||||
xycsc->ciopb->unit = xysc->xy_drive;
|
||||
addr = dvma_kvtopa(xycsc->ciopb, BUS_VME16);
|
||||
addr = dvma_kvtopa(xycsc->ciopb, xycsc->bustype);
|
||||
|
||||
XYC_GO(xycsc->xyc, addr);
|
||||
|
||||
|
@ -1780,7 +1779,7 @@ xyc_remove_iorq(xycsc)
|
|||
(iorq->blockno / iorq->xy->nhead) %
|
||||
iorq->xy->nhead;
|
||||
iopb->sect = iorq->blockno % XYFM_BPS;
|
||||
addr = dvma_kvtopa(iorq->dbuf, BUS_VME16);
|
||||
addr = dvma_kvtopa(iorq->dbuf, xycsc->bustype);
|
||||
iopb->dataa = (addr & 0xffff);
|
||||
iopb->datar = ((addr & 0xff0000) >> 16);
|
||||
/* will resubit at end */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: xyvar.h,v 1.3 1997/10/17 03:48:02 gwr Exp $ */
|
||||
/* $NetBSD: xyvar.h,v 1.4 1998/01/26 21:03:45 gwr Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
|
@ -143,10 +143,12 @@ struct xyc_softc {
|
|||
|
||||
struct xyc *xyc; /* vaddr of vme registers */
|
||||
|
||||
struct xy_softc *sc_drives[XYC_MAXDEV]; /* drives on this controller */
|
||||
int bustype; /* from attach args */
|
||||
int ipl; /* interrupt level */
|
||||
int vector; /* interrupt vector */
|
||||
|
||||
struct xy_softc *sc_drives[XYC_MAXDEV]; /* drives on this controller */
|
||||
|
||||
struct xy_iorq *reqs; /* i/o requests */
|
||||
struct xy_iopb *iopbase; /* iopb base addr (maps iopb->iorq) */
|
||||
struct xy_iopb *dvmaiopb; /* iopb base in DVMA space, not kvm */
|
||||
|
|
Loading…
Reference in New Issue