Lines Matching defs:xyc
96 * XYC_GO: start iopb ADDR (DVMA addr in a u_long) on XYC
98 #define XYC_GO(XYC, ADDR) { \
100 (XYC)->xyc_addr_lo = ((addr) & 0xff); \
102 (XYC)->xyc_addr_hi = ((addr) & 0xff); \
104 (XYC)->xyc_reloc_lo = ((addr) & 0xff); \
106 (XYC)->xyc_reloc_hi = (addr); \
107 (XYC)->xyc_csr = XYC_GBSY; /* go! */ \
169 int xyc_unbusy(struct xyc *, int);
193 CFATTACH_DECL_NEW(xyc, sizeof(struct xyc_softc),
366 * xycmatch: determine if xyc is present or not. we do a
367 * soft reset to detect the xyc.
372 struct xyc *xyc = (void *)handle; /* XXX */
374 return ((xyc_unbusy(xyc, XYC_RESETUSEC) != XY_ERR_FAIL) ? 0 : EIO);
386 if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xyc), mod))
389 error = vme_probe(ct, va->r[0].offset, sizeof(struct xyc),
391 vme_space_free(va->va_vct, va->r[0].offset, sizeof(struct xyc), mod);
402 struct xyc_softc *xyc = device_private(self);
416 xyc->sc_dev = self;
423 if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xyc), mod))
424 panic("xyc: vme alloc");
426 if (vme_space_map(ct, va->r[0].offset, sizeof(struct xyc),
428 panic("xyc: vme_map");
430 xyc->xyc = (struct xyc *) bh; /* XXX */
431 xyc->ipl = va->ilevel;
432 xyc->vector = va->ivector;
433 xyc->no_ols = 0; /* XXX should be from config */
436 xyc->sc_drives[lcv] = NULL;
455 &xyc->auxmap)) != 0) {
457 aprint_error_dev(xyc->sc_dev, "DMA buffer map create error %d\n",
473 &xyc->iopmap)) != 0) {
475 aprint_error_dev(xyc->sc_dev, "DMA buffer map create error %d\n",
481 if ((error = xy_dmamem_alloc(xyc->dmatag, xyc->iopmap, &seg, &rseg,
483 (void **)&xyc->iopbase,
485 aprint_error_dev(xyc->sc_dev, "DMA buffer alloc error %d\n",
489 xyc->dvmaiopb = (struct xy_iopb *)(u_long)BUS_ADDR_PADDR(busaddr);
491 memset(xyc->iopbase, 0, XYC_MAXIOPB * sizeof(struct xy_iopb));
493 xyc->reqs = malloc(XYC_MAXIOPB * sizeof(struct xy_iorq),
502 xyc->xy_chain[lcv] = NULL;
503 xyc->reqs[lcv].iopb = &xyc->iopbase[lcv];
504 xyc->reqs[lcv].dmaiopb = &xyc->dvmaiopb[lcv];
505 xyc->iopbase[lcv].asr = 1; /* always the same */
506 xyc->iopbase[lcv].eef = 1; /* always the same */
507 xyc->iopbase[lcv].ecm = XY_ECM; /* always the same */
508 xyc->iopbase[lcv].aud = 1; /* always the same */
509 xyc->iopbase[lcv].relo = 1; /* always the same */
510 xyc->iopbase[lcv].thro = XY_THRO;/* always the same */
522 &xyc->reqs[lcv].dmamap)) != 0) {
524 aprint_error_dev(xyc->sc_dev, "DMA buffer map create error %d\n",
529 xyc->ciorq = &xyc->reqs[XYC_CTLIOPB]; /* short hand name */
530 xyc->ciopb = &xyc->iopbase[XYC_CTLIOPB]; /* short hand name */
531 xyc->xy_hand = 0;
535 error = xyc_cmd(xyc, XYCMD_ST, 0, 0, 0, 0, 0, XY_SUB_POLL);
536 res = xyc->ciopb->ctyp;
537 XYC_DONE(xyc, error);
545 if (xyc->no_ols)
549 aprint_error_dev(xyc->sc_dev, "error: %s\n",
553 if ((xyc->xyc->xyc_csr & XYC_ADRM) == 0) {
555 device_xname(xyc->sc_dev));
563 vme_intr_establish(ct, ih, IPL_BIO, xycintr, xyc);
564 evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
565 device_xname(xyc->sc_dev), "intr");
567 callout_init(&xyc->sc_tick_ch, 0);
577 callout_reset(&xyc->sc_tick_ch, XYC_TICKCNT, xyc_tick, xyc);
611 struct xyc_softc *xyc = device_private(parent);
634 xy->parent = xyc;
640 xy->xyrq = &xyc->reqs[xa->driveno];
645 xyc->sc_drives[xa->driveno] = xy;
667 if ((error = xy_dmamem_alloc(xyc->dmatag, xyc->auxmap, &seg, &rseg,
671 aprint_error_dev(xyc->sc_dev, "DMA buffer alloc error %d\n",
678 error = xyc_cmd(xyc, XYCMD_RST, 0, xy->xy_drive, 0, 0, 0, fmode);
679 XYC_DONE(xyc, error);
706 error = xyc_cmd(xyc, XYCMD_RD, 0, xy->xy_drive, 0, 1,
708 XYC_DONE(xyc, error);
750 oxy = xyc->sc_drives[lcv];
756 device_xname(xyc->sc_dev), device_xname(xy->sc_dev),
768 error = xyc_cmd(xyc, XYCMD_SDS, 0, xy->xy_drive, blk, 0, 0, fmode);
769 XYC_DONE(xyc, error);
785 error = xyc_cmd(xyc, XYCMD_RD, 0, xy->xy_drive, blk, 1,
787 XYC_DONE(xyc, error);
816 xy_dmamem_free(xyc->dmatag, xyc->auxmap,
1274 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)
1276 rq->xyc = xyc;
1335 * xyc_unbusy: wait for the xyc to go unbusy, or timeout.
1339 xyc_unbusy(struct xyc *xyc, int del)
1342 if ((xyc->xyc_csr & XYC_GBSY) == 0)
1508 if ((xycsc->xyc->xyc_csr & XYC_GBSY) != 0) {
1510 printf("xyc_submit_iorq: XYC not ready (BUSY)\n");
1523 (void)xycsc->xyc->xyc_rsetup; /* RESET */
1524 if (xyc_unbusy(xycsc->xyc,XYC_RESETUSEC) == XY_ERR_FAIL)
1525 panic("xyc_submit_iorq: stuck xyc");
1541 XYC_GO(xycsc->xyc, dmaiopb);
1652 res = xyc_unbusy(xycsc->xyc, XYC_MAXTIME);
1695 * xyc_xyreset: reset one drive. NOTE: assumes xyc was just reset.
1715 XYC_GO(xycsc->xyc, xycsc->ciorq->dmaiopb);
1719 if ((xycsc->xyc->xyc_csr & XYC_GBSY) == 0)
1728 del = xycsc->xyc->xyc_rsetup;
1729 if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
1732 xycsc->xyc->xyc_csr = XYC_IPND; /* clear IPND */
1754 del = xycsc->xyc->xyc_rsetup;
1755 del = xyc_unbusy(xycsc->xyc, XYC_RESETUSEC);
1852 struct xyc *xyc = xycsc->xyc;
1858 if (xyc->xyc_csr & XYC_DERR) {
1877 if (xyc->xyc_csr & XYC_ERR) {
1878 xyc->xyc_csr = XYC_ERR; /* clear error condition */
1880 if (xyc->xyc_csr & XYC_IPND) {
1881 xyc->xyc_csr = XYC_IPND; /* clear interrupt */
2005 : device_xname(iorq->xyc->sc_dev));
2102 /* reduce ttl for each request if one goes to zero, reset xyc */