Home | History | Annotate | Download | only in boot

Lines Matching defs:adp

98 siop_setuptables(struct siop_adapter *adp, struct siop_xfer *xfer,
104 htoc32((adp->clock_div << 24) | (xs->target << 16));
126 siop_ma(struct siop_adapter *adp, struct scsi_xfer *xs)
137 offset = readb(adp->addr + SIOP_SCRATCHA + 1);
142 dbc = readl(adp->addr + SIOP_DBC) & 0x00ffffff;
147 siop_sdp(struct siop_adapter *adp, struct siop_xfer *xfer, struct scsi_xfer *xs,
171 siop_update_resid(adp, xfer, xs, offset);
201 siop_update_resid(struct siop_adapter *adp, struct siop_xfer *xfer,
230 #define CALL_SCRIPT(ent) writel(adp->addr + SIOP_DSP, scriptaddr + ent);
233 siop_intr(struct siop_adapter *adp)
237 u_long scriptaddr = local_to_PCI((u_long)adp->script);
243 istat = readb(adp->addr + SIOP_ISTAT);
248 writeb(adp->addr + SIOP_ISTAT, ISTAT_INTF);
253 writeb(adp->addr + SIOP_ISTAT, 0);
255 dsa = readl(adp->addr + SIOP_DSA);
256 if (dsa >= local_to_PCI((u_long)adp->xfer) &&
257 dsa < local_to_PCI((u_long)adp->xfer) + SIOP_TABLE_SIZE) {
258 dsa -= local_to_PCI((u_long)adp->xfer);
259 siop_xfer = adp->xfer;
262 xs = adp->xs;
266 dstat = readb(adp->addr + SIOP_DSTAT);
274 sist = readw(adp->addr + SIOP_SIST0);
275 sstat1 = readb(adp->addr + SIOP_SSTAT1);
281 dstat = readb(adp->addr + SIOP_DSTAT);
286 writel(adp->addr + SIOP_DSA,
288 scratcha0 = readb(adp->addr + SIOP_SCRATCHA);
299 siop_ma(adp, xs);
302 // siop_clearfifo(adp);
312 siop_ma(adp, xs);
315 // siop_clearfifo(adp);
316 writeb(adp->addr + SIOP_SCRATCHA,
340 readl(adp->addr + SIOP_DSP) - scriptaddr);
355 irqcode = readl(adp->addr + SIOP_DSPS);
371 readl(adp->addr + SIOP_DSP) - scriptaddr);
382 target = readb(adp->addr + SIOP_SCRATCHA) & 0xf;
383 lun = readb(adp->addr + SIOP_SCRATCHA + 1);
384 tag = readb(adp->addr + SIOP_SCRATCHA + 2);
385 if (target != adp->xs->target ||
386 lun != adp->xs->lun ||
393 siop_xfer = adp->xfer;
395 writel(adp->addr + SIOP_DSP,
404 offset = readb(adp->addr + SIOP_SCRATCHA + 1);
405 siop_sdp(adp, siop_xfer, xs, offset);
419 local_to_PCI((u_long)adp->xfer));
423 offset = readb(adp->addr + SIOP_SCRATCHA + 1);
435 siop_update_resid(adp, siop_xfer, xs, offset);
460 writel(adp->addr + SIOP_DSP, scriptaddr + Ent_script_sched);
463 siop_scsicmd_end(adp, xs);
465 writel(adp->addr + SIOP_DSP, scriptaddr + Ent_script_sched);
471 siop_scsicmd_end(struct siop_adapter *adp, struct scsi_xfer *xs)
506 siop_scsi_request(struct siop_adapter *adp, struct scsi_xfer *xs)
508 void *xfer = adp->xfer;
511 if (adp->sel_t != xs->target) {
514 void *scriptaddr = (void *)local_to_PCI((u_long)adp->script);
516 if (adp->sel_t != -1)
517 adp->script[Ent_resel_targ0 / 4 + adp->sel_t * 2] =
521 adp->script[free_lo + i] = htoc32(lun_switch[i]);
522 adp->script[free_lo + E_abs_lunsw_return_Used[0]] =
525 siop_add_reselsw(adp, xs->target, free_lo);
527 adp->sel_t = xs->target;
532 siop_setuptables(adp, xfer, xs);
540 siop_start(adp, xs);
542 adp->xs = xs;
546 siop_intr(adp);
556 scsi_request_sense(adp, xs);
561 error = scsi_interpret_sense(adp, xs);
603 siop_start(struct siop_adapter *adp, struct scsi_xfer *xs)
605 struct siop_xfer *siop_xfer = adp->xfer;
606 uint32_t dsa, *script = adp->script;
622 slot = adp->currschedslot;
630 slot = adp->currschedslot = 0;
669 adp->currschedslot = slot;
674 writeb(adp->addr + SIOP_ISTAT, ISTAT_SIGP);
722 siop_add_reselsw(struct siop_adapter *adp, int target, int lunsw_off)
724 uint32_t *script = adp->script;
726 void *scriptaddr = (void *)local_to_PCI((u_long)adp->script);
743 siop_update_scntl3(adp, target, lunsw_off);
748 siop_update_scntl3(struct siop_adapter *adp, int target, int lunsw_off)
750 uint32_t *script = adp->script;
754 htoc32(0x78030000 | ((adp->clock_div >> 16) & 0x0000ff00));
767 _scsi_inquire(struct siop_adapter *adp, int t, int l, int buflen, void *buf)
769 struct scsipi_inquiry *cmd = (struct scsipi_inquiry *)adp->cmd;
771 (struct scsipi_inquiry_data *)adp->data;
792 error = siop_scsi_request(adp, &xs);
801 scsi_request_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
803 struct scsi_request_sense *cmd = adp->sense;
804 struct scsi_sense_data *data = (struct scsi_sense_data *)adp->data;
825 error = siop_scsi_request(adp, &sense);
863 scsi_interpret_sense(struct siop_adapter *adp, struct scsi_xfer *xs)
892 if (adp->sd->sc_flags & FLAGS_REMOVABLE)
893 adp->sd->sc_flags &= ~FLAGS_MEDIA_LOADED;
928 if (adp->sd->sc_flags & FLAGS_REMOVABLE)
929 adp->sd->sc_flags &= ~FLAGS_MEDIA_LOADED;
944 if (adp->sd->sc_flags & FLAGS_REMOVABLE)
945 adp->sd->sc_flags &= ~FLAGS_MEDIA_LOADED;
946 if (!(adp->sd->sc_flags & FLAGS_REMOVABLE))
1013 scsi_probe(struct siop_adapter *adp)
1024 if (t == adp->id)
1027 if (_scsi_inquire(adp, t, l,
1051 struct siop_adapter *adp;
1058 adp = &adapt;
1060 adp->sd = sd;
1061 error = _scsi_inquire(adp, sd->sc_target, sd->sc_lun, buflen, buf);
1062 adp->sd = NULL;
1091 struct siop_adapter *adp;
1099 adp = &adapt;
1101 memcpy(adp->cmd, cmd, cmdlen);
1102 adp->sd = sd;
1108 xs.cmd = adp->cmd;
1110 xs.data = adp->data;
1116 error = siop_scsi_request(adp, &xs);
1117 adp->sd = NULL;
1122 memcpy(data, adp->data, datalen);