xyc
xyc_rqinit(struct xy_iorq *rq, struct xyc_softc *xyc, struct xy_softc *xy,
rq->xyc = xyc;
dp = dvma_kvtopa(iorq->dbuf, iorq->xyc->bustype);
xyc_unbusy(struct xyc *xyc, int del)
if ((xyc->xyc_csr & XYC_GBSY) == 0)
if ((xycsc->xyc->xyc_csr & XYC_GBSY) != 0) {
iopbaddr = xycsc->xyc->xyc_rsetup; /* RESET */
if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) ==
XYC_GO(xycsc->xyc, iopbaddr);
res = xyc_unbusy(xycsc->xyc, XYC_MAXTIME);
XYC_GO(xycsc->xyc, addr);
if ((xycsc->xyc->xyc_csr & XYC_GBSY) == 0)
del = xycsc->xyc->xyc_rsetup;
if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
xycsc->xyc->xyc_csr = XYC_IPND; /* clear IPND */
del = xycsc->xyc->xyc_rsetup;
del = xyc_unbusy(xycsc->xyc, XYC_RESETUSEC);
struct xyc *xyc = xycsc->xyc;
if (xyc->xyc_csr & XYC_DERR) {
if (xyc->xyc_csr & XYC_ERR) {
xyc->xyc_csr = XYC_ERR; /* clear error condition */
if (xyc->xyc_csr & XYC_IPND) {
xyc->xyc_csr = XYC_IPND; /* clear interrupt */
int xyc_unbusy(struct xyc *, int);
: device_xname(iorq->xyc->sc_dev));
CFATTACH_DECL_NEW(xyc, sizeof(struct xyc_softc),
struct xyc_softc *xyc = device_private(self);
xyc->sc_dev = self;
xyc->xyc = (struct xyc *)bus_mapin(ca->ca_bustype, ca->ca_paddr,
sizeof(struct xyc));
xyc->bustype = ca->ca_bustype;
xyc->ipl = ca->ca_intpri;
xyc->vector = ca->ca_intvec;
xyc->no_ols = 0; /* XXX should be from config */
xyc->sc_drives[lcv] = NULL;
xyc->iopbase = tmp;
xyc->dvmaiopb =
(struct xy_iopb *)dvma_kvtopa(xyc->iopbase, xyc->bustype);
xyc->reqs = kmem_zalloc(XYC_MAXIOPB * sizeof(struct xy_iorq),
xyc->xy_chain[lcv] = NULL;
xyc->reqs[lcv].iopb = &xyc->iopbase[lcv];
xyc->iopbase[lcv].asr = 1; /* always the same */
xyc->iopbase[lcv].eef = 1; /* always the same */
xyc->iopbase[lcv].ecm = XY_ECM; /* always the same */
xyc->iopbase[lcv].aud = 1; /* always the same */
xyc->iopbase[lcv].relo = 1; /* always the same */
xyc->iopbase[lcv].thro = XY_THRO;/* always the same */
xyc->ciorq = &xyc->reqs[XYC_CTLIOPB]; /* short hand name */
xyc->ciopb = &xyc->iopbase[XYC_CTLIOPB]; /* short hand name */
xyc->xy_hand = 0;
err = xyc_cmd(xyc, XYCMD_ST, 0, 0, 0, 0, 0, XY_SUB_POLL);
res = xyc->ciopb->ctyp;
XYC_DONE(xyc, err);
if (xyc->no_ols)
if ((xyc->xyc->xyc_csr & XYC_ADRM) == 0) {
isr_add_vectored(xycintr, xyc, ca->ca_intpri, ca->ca_intvec);
evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
callout_init(&xyc->sc_tick_ch, 0);
callout_reset(&xyc->sc_tick_ch, XYC_TICKCNT, xyc_tick, xyc);
struct xyc_softc *xyc = device_private(parent);
xy->parent = xyc;
xy->xyrq = &xyc->reqs[xa->driveno];
xyc->sc_drives[xa->driveno] = xy;
struct xyc_softc *xyc;
xyc = xy->parent;
err = xyc_cmd(xyc, XYCMD_RST, 0, xy->xy_drive, 0, 0, 0, fullmode);
XYC_DONE(xyc, err);
err = xyc_cmd(xyc, XYCMD_RD, 0, xy->xy_drive, 0, 1,
XYC_DONE(xyc, err);
oxy = xyc->sc_drives[lcv];
device_xname(xyc->sc_dev),
err = xyc_cmd(xyc, XYCMD_SDS, 0, xy->xy_drive, blk, 0, 0, fullmode);
XYC_DONE(xyc, err);
err = xyc_cmd(xyc, XYCMD_RD, 0, xy->xy_drive, blk, 1,
XYC_DONE(xyc, err);
struct xyc *xyc; /* vaddr of vme registers */
struct xyc_softc *xyc; /* who we are working with */
xyc_rqinit(struct xy_iorq *rq, struct xyc_softc *xyc, struct xy_softc *xy, int md, u_long blk, int cnt, void *db, struct buf *bp)
rq->xyc = xyc;
xyc_unbusy(struct xyc *xyc, int del)
if ((xyc->xyc_csr & XYC_GBSY) == 0)
if ((xycsc->xyc->xyc_csr & XYC_GBSY) != 0) {
(void)xycsc->xyc->xyc_rsetup; /* RESET */
if (xyc_unbusy(xycsc->xyc,XYC_RESETUSEC) == XY_ERR_FAIL)
XYC_GO(xycsc->xyc, dmaiopb);
res = xyc_unbusy(xycsc->xyc, XYC_MAXTIME);
int xyc_unbusy(struct xyc *, int);
XYC_GO(xycsc->xyc, xycsc->ciorq->dmaiopb);
if ((xycsc->xyc->xyc_csr & XYC_GBSY) == 0)
del = xycsc->xyc->xyc_rsetup;
if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
xycsc->xyc->xyc_csr = XYC_IPND; /* clear IPND */
del = xycsc->xyc->xyc_rsetup;
del = xyc_unbusy(xycsc->xyc, XYC_RESETUSEC);
struct xyc *xyc = xycsc->xyc;
if (xyc->xyc_csr & XYC_DERR) {
if (xyc->xyc_csr & XYC_ERR) {
xyc->xyc_csr = XYC_ERR; /* clear error condition */
if (xyc->xyc_csr & XYC_IPND) {
xyc->xyc_csr = XYC_IPND; /* clear interrupt */
CFATTACH_DECL_NEW(xyc, sizeof(struct xyc_softc),
: device_xname(iorq->xyc->sc_dev));
struct xyc *xyc = (void *)handle; /* XXX */
return ((xyc_unbusy(xyc, XYC_RESETUSEC) != XY_ERR_FAIL) ? 0 : EIO);
if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xyc), mod))
error = vme_probe(ct, va->r[0].offset, sizeof(struct xyc),
vme_space_free(va->va_vct, va->r[0].offset, sizeof(struct xyc), mod);
struct xyc_softc *xyc = device_private(self);
xyc->sc_dev = self;
if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xyc), mod))
if (vme_space_map(ct, va->r[0].offset, sizeof(struct xyc),
xyc->xyc = (struct xyc *) bh; /* XXX */
xyc->ipl = va->ilevel;
xyc->vector = va->ivector;
xyc->no_ols = 0; /* XXX should be from config */
xyc->sc_drives[lcv] = NULL;
&xyc->auxmap)) != 0) {
aprint_error_dev(xyc->sc_dev, "DMA buffer map create error %d\n",
&xyc->iopmap)) != 0) {
aprint_error_dev(xyc->sc_dev, "DMA buffer map create error %d\n",
if ((error = xy_dmamem_alloc(xyc->dmatag, xyc->iopmap, &seg, &rseg,
(void **)&xyc->iopbase,
aprint_error_dev(xyc->sc_dev, "DMA buffer alloc error %d\n",
xyc->dvmaiopb = (struct xy_iopb *)(u_long)BUS_ADDR_PADDR(busaddr);
memset(xyc->iopbase, 0, XYC_MAXIOPB * sizeof(struct xy_iopb));
xyc->reqs = malloc(XYC_MAXIOPB * sizeof(struct xy_iorq),
xyc->xy_chain[lcv] = NULL;
xyc->reqs[lcv].iopb = &xyc->iopbase[lcv];
xyc->reqs[lcv].dmaiopb = &xyc->dvmaiopb[lcv];
xyc->iopbase[lcv].asr = 1; /* always the same */
xyc->iopbase[lcv].eef = 1; /* always the same */
xyc->iopbase[lcv].ecm = XY_ECM; /* always the same */
xyc->iopbase[lcv].aud = 1; /* always the same */
xyc->iopbase[lcv].relo = 1; /* always the same */
xyc->iopbase[lcv].thro = XY_THRO;/* always the same */
&xyc->reqs[lcv].dmamap)) != 0) {
aprint_error_dev(xyc->sc_dev, "DMA buffer map create error %d\n",
xyc->ciorq = &xyc->reqs[XYC_CTLIOPB]; /* short hand name */
xyc->ciopb = &xyc->iopbase[XYC_CTLIOPB]; /* short hand name */
xyc->xy_hand = 0;
error = xyc_cmd(xyc, XYCMD_ST, 0, 0, 0, 0, 0, XY_SUB_POLL);
res = xyc->ciopb->ctyp;
XYC_DONE(xyc, error);
if (xyc->no_ols)
aprint_error_dev(xyc->sc_dev, "error: %s\n",
if ((xyc->xyc->xyc_csr & XYC_ADRM) == 0) {
device_xname(xyc->sc_dev));
vme_intr_establish(ct, ih, IPL_BIO, xycintr, xyc);
evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
device_xname(xyc->sc_dev), "intr");
callout_init(&xyc->sc_tick_ch, 0);
callout_reset(&xyc->sc_tick_ch, XYC_TICKCNT, xyc_tick, xyc);
struct xyc_softc *xyc = device_private(parent);
xy->parent = xyc;
xy->xyrq = &xyc->reqs[xa->driveno];
xyc->sc_drives[xa->driveno] = xy;
if ((error = xy_dmamem_alloc(xyc->dmatag, xyc->auxmap, &seg, &rseg,
aprint_error_dev(xyc->sc_dev, "DMA buffer alloc error %d\n",
error = xyc_cmd(xyc, XYCMD_RST, 0, xy->xy_drive, 0, 0, 0, fmode);
XYC_DONE(xyc, error);
error = xyc_cmd(xyc, XYCMD_RD, 0, xy->xy_drive, 0, 1,
XYC_DONE(xyc, error);
oxy = xyc->sc_drives[lcv];
device_xname(xyc->sc_dev), device_xname(xy->sc_dev),
error = xyc_cmd(xyc, XYCMD_SDS, 0, xy->xy_drive, blk, 0, 0, fmode);
XYC_DONE(xyc, error);
error = xyc_cmd(xyc, XYCMD_RD, 0, xy->xy_drive, blk, 1,
XYC_DONE(xyc, error);
xy_dmamem_free(xyc->dmatag, xyc->auxmap,
struct xyc *xyc; /* vaddr of vme registers */
struct xyc_softc *xyc; /* who we are working with */