Home | History | Annotate | Download | only in ic

Lines Matching refs:phase

51  * Gordon Ross integrated the message phase code, added lots of
120 #define ACT_CONTINUE 0x00 /* No flags: expect another phase */
179 /* This one is used when waiting for a phase change. (X100uS.) */
226 /* Ask the target for a MSG_OUT phase. */
243 ncr5380_pio_out(struct ncr5380_softc *sc, int phase, int count, uint8_t *data)
264 if (SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr)) != phase)
301 ncr5380_pio_in(struct ncr5380_softc *sc, int phase, int count, uint8_t *data)
319 /* A phase change is not valid until AFTER REQ rises! */
320 if (SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr)) != phase)
453 * The remaining documented interrupt causes are phase mismatch and
980 * Device reset is special (only uses MSG_OUT phase).
981 * Normal commands start in MSG_OUT phase where we will
982 * send and IDENDIFY message, and then expect CMD phase.
1019 * at the beginning of COMMAND phase.
1024 * the SCSI bus into any DATA phase.
1073 int target, lun, phase, timo;
1195 /* Wait for REQ before reading bus phase. */
1202 phase = SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr));
1203 if (phase != PHASE_MSG_IN) {
1204 printf("%s: reselect, phase=%d\n",
1205 device_xname(sc->sc_dev), phase);
1253 * target puts the SCSI bus into any DATA phase.
1322 * Set phase bits to 0, otherwise the 5380 won't drive the bus during
1440 * ask the target for a message out phase.
1514 * Functions to handle each info. transfer phase:
1547 * The SCSI bus is already in the MSGI phase and there is a message byte
1551 * will expect to see another REQ (and possibly phase change).
1558 int n, phase;
1562 /* acknowledge phase change */
1575 /* This is a new MESSAGE IN phase. Clean up our state. */
1585 * message, we have to assert ATN during the message transfer phase
1591 * First, check BSY, REQ, phase...
1604 phase = SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr));
1605 if (phase != PHASE_MSG_IN) {
1613 /* Still in MESSAGE IN phase, and REQ is asserted. */
1778 * having changed phase in between it really asks for a
1798 int act_flags, n, phase, progress;
1801 /* acknowledge phase change */
1821 * phase. Section 5.1.9.2 of the SCSI 2 spec indicates
1932 * First check BSY, REQ, phase...
1942 phase = SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr));
1943 if (phase != PHASE_MSG_OUT) {
1948 NCR_TRACE("msg_out: new phase=%d\n", phase);
1995 * message transmitted (in case the target switches to MESSAGE IN phase
1997 * this time around (in case the target stays in MESSAGE OUT phase to
2014 * Handle command phase.
2023 /* acknowledge phase change */
2027 /* XXX: Do this using DMA, and get a phase change intr? */
2054 ncr5380_data_xfer(struct ncr5380_softc *sc, int phase)
2062 * When aborting a command, disallow any data phase.
2065 printf("%s: aborting, but phase=%s (reset)\n",
2066 device_xname(sc->sc_dev), phase_names[phase & 7]);
2070 /* Validate expected phase (data_in or data_out) */
2073 if (phase != expected_phase) {
2074 printf("%s: data phase error\n", device_xname(sc->sc_dev));
2081 if (phase == PHASE_DATA_IN)
2082 ncr5380_pio_in(sc, phase, 4096, NULL);
2084 ncr5380_pio_out(sc, phase, 4096, NULL);
2085 /* Make sure that caused a phase change. */
2086 if (SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr)) == phase) {
2105 * (Acknowledge the phase change there, not here.)
2118 /* acknowledge phase change */
2119 NCR5380_WRITE(sc, sci_tcmd, phase); /* XXX: OK for PDMA? */
2120 if (phase == PHASE_DATA_OUT) {
2121 len = (*sc->sc_pio_out)(sc, phase, sc->sc_datalen,
2124 len = (*sc->sc_pio_in)(sc, phase, sc->sc_datalen,
2147 /* acknowledge phase change */
2162 * This is the big state machine that follows SCSI phase changes.
2175 int act_flags, phase, timo;
2209 * Wait for REQ before reading the phase.
2224 printf("%s: no REQ for next phase, abort\n",
2233 phase = SCI_BUS_PHASE(NCR5380_READ(sc, sci_bus_csr));
2234 NCR_TRACE("machine: phase=%s\n",
2235 (long) phase_names[phase & 7]);
2239 * so any phase is good.
2244 * XXX: Do not ACK the phase yet! do it later...
2245 * XXX: ... each phase routine does that itself.
2248 NCR5380_WRITE(sc, sci_tcmd, phase); /* acknowledge phase change */
2251 switch (phase) {
2255 act_flags = ncr5380_data_xfer(sc, phase);
2275 printf("%s: Unexpected phase 0x%x\n", __func__, phase);
2281 sc->sc_prevphase = phase;