summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic7xxx/aic7xxx.reg
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2000-10-31 18:43:29 +0000
committergibbs <gibbs@FreeBSD.org>2000-10-31 18:43:29 +0000
commitd90f7ca9c778b9495b410824dac2511cbba19051 (patch)
tree8b484eae5ed9347fe2b10b653c75ddf7cd4a4809 /sys/dev/aic7xxx/aic7xxx.reg
parent15c60e990b191bec55656110ed41eaf4bc45dc15 (diff)
downloadFreeBSD-src-d90f7ca9c778b9495b410824dac2511cbba19051.zip
FreeBSD-src-d90f7ca9c778b9495b410824dac2511cbba19051.tar.gz
aic7xxx.c:
Filter incoming transfer negotiation requests to ensure they never exceed the settings specified by the user. In restart sequencer attempt to deal with a bug in the aic7895. If a third party reset occurs at just the right time, the stack register can lock up. When restarting the sequencer after handling the SCSI reset, poke SEQADDR1 before resting the sequencers program counter. When something strange happens, dump the card's transaction state via ahc_dump_card_state(). This should aid in debugging. Handle request sense transactions via the QINFIFO instead of attaching them to the waiting queue directly. The waiting queue consumes card SCB resources and, in the pathological case of every target on the bus beating our selection attemps and issuing a check condition, could have caused us to run out of SCBs. I have never seen this happen, and only early cards with 3 or 4 SCBs had any real chance of ever getting into this state. Add additional sequencer interrupt codes to support firmware diagnostics. The diagnostic code is enabled with the AHC_DEBUG_SEQUENCER kernel option. Make it possible to switch into and out of target mode on the fly. The card comes up by default as an initiator but will switch into target mode as soon as an enable lun operation is performed. As always, target mode behavior is gated by the AHC_TMODE_ENABLE kernel option so most users will not be affected by this change. In ahc_update_target_msg_request(), also issue a new request if the ppr_options have changed. Never issue a PPR as a target. It is forbidden by the spec. Correct a bug in ahc_parse_msg() that prevented us from responding to PPR messages as a target. Mark SCBs that are on the untagged queue with a flag instead of checking several fields in the SCB to see if the SCB should be on the queue. This makes it easier for things like automatic request sense requests to be queued without touching the untagged queues even though they are untagged requests. When dealing with ignore wide residue messages that occur in the middle of a transfer, reset HADDR, not SHADDR for non-ultra2 chips. Although SHADDR is where the firmware fetches the ending transfer address for a save data pointers request, it is readonly. Setting HADDR has the side effect of also updating SHADDR. Cleanup the output of ahc_dump_card_state() by nulling out the free scb list in the non-paging case. The free list is only used if we must page SCBs. Correct the transmission of cdbs > 12 bytes in length. When swapping HSCBs prior to notifing the sequencer of the new transaction, the bus address pointer for the cdb must also be recalculated to reflect its new location. We now defer the calculation of the cdb address until just before queing it to the card. When pulling transfer negotiation settings out of scratch ram, convert 5MHz/clock doubled settings to 10MHz. Add a new function ahc_qinfifo_requeue_tail() for use by error recovery actions and auto-request sense operations. These operations always occur when the sequencer is paused, so we can avoid the extra expense incurred in the normal SCB queue method. Use the BMOV instruction for all single byte moves on controllers that support it. The bmov instruction is twice as fast as an AND with an immediate of 0xFF as is used on older controllers. Correct a few bugs in ahc_dump_card_state(). If we have hardware assisted queue registers, use them to get the sequencer's idea of the head of the queue. When enumerating the untagged queue, it helps to use the correct index for the queue. aic7xxx.h: Indicate via a feature flag, which controllers can take on both the target and the initiator role at the same time. Add the AHC_SEQUENCER_DEBUG flag. Add the SCB_CDB32_PTR flag used for dealing with cdbs with lengths between 13 and 32 bytes. Add new prototypes. aic7xxx.reg: Allow the SCSIBUSL register to be written to. This is required to fix a selection timeout problem on the 7892/99. Cleanup the sequencer interrupt codes so that all debugging codes are grouped at the end of the list. Correct the definition of the ULTRA_ENB and DISC_DSB locations in scratch ram. This prevented the driver from properly honoring these settings when no serial eeprom was available. Remove an unused sequencer flag. aic7xxx.seq: Just before a potential select-out, clear the SCSIBUSL register. Occasionally, during a selection timeout, the contents of the register may be presented on the bus, causing much confusion. Add sequencer diagnostic code to detect software and or hardware bugs. The code attempts to verify most list operations so any corruption is caught before it occurs. We also track information about why a particular reconnection request was rejected. Don't clobber the digital REQ/ACK filter setting in SXFRCTL0 when clearing the channel. Fix a target mode bug that would cause us to return busy status instead of queue full in respnse to a tagged transaction. Cleanup the overrun case. It turns out that by simply butting the chip in bitbucket mode, it will ack any bytes until the phase changes. This drasticaly simplifies things. Prior to leaving the data phase, make sure that the S/G preload queue is empty. Remove code to place a request sense request on the waiting queue. This is all handled by the kernel now. Change the semantics of "findSCB". In the past, findSCB ensured that a freshly paged in SCB appeared on the disconnected list. The problem with this is that there is no guarantee that the paged in SCB is for a disconnected transation. We now defer any list manipulation to the caller who usually discards the SCB via the free list. Inline some busy target table operations. Add a critical section to protect adding an SCB to the disconnected list. aic7xxx_freebsd.c: Handle changes in the transfer negotiation setting API to filter incoming requests. No filtering is necessary for "goal" requests from the XPT. Set the SCB_CDB32_PTR flag when queing a transaction with a large cdb. In ahc_timeout, only take action if the active SCB is the timedout SCB. This deals with the case of two transactions to the same device with different timeout values. Use ahc_qinfifo_requeu_tail() instead of home grown version. aic7xxx_inline.h: Honor SCB_CDB32_PTR when queuing a new request. aic7xxx_pci.c: Use the maximum data fifo threshold for all chips.
Diffstat (limited to 'sys/dev/aic7xxx/aic7xxx.reg')
-rw-r--r--sys/dev/aic7xxx/aic7xxx.reg79
1 files changed, 55 insertions, 24 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg
index d83ad22..ed27284 100644
--- a/sys/dev/aic7xxx/aic7xxx.reg
+++ b/sys/dev/aic7xxx/aic7xxx.reg
@@ -382,12 +382,12 @@ register SIMODE1 {
*/
register SCSIBUSL {
address 0x012
- access_mode RO
+ access_mode RW
}
register SCSIBUSH {
address 0x013
- access_mode RO
+ access_mode RW
}
/*
@@ -702,6 +702,7 @@ register BUSSPD {
mask STBOFF 0x38
mask STBON 0x07
mask DFTHRSH_100 0xc0
+ mask DFTHRSH_75 0x80
}
/* aic7850/55/60/70/80/95 only */
@@ -779,10 +780,8 @@ register INTSTAT {
mask NO_IDENT 0x20|SEQINT /* no IDENTIFY after reconnect*/
mask NO_MATCH 0x30|SEQINT /* no cmd match for reconnect */
mask IGN_WIDE_RES 0x40|SEQINT /* Complex IGN Wide Res Msg */
- mask BAD_STATUS 0x70|SEQINT /* Bad status from target */
- mask RESIDUAL 0x80|SEQINT /* Residual byte count != 0 */
- mask TRACEPOINT2 0x90|SEQINT
- mask HOST_MSG_LOOP 0xa0|SEQINT /*
+ mask RESIDUAL 0x50|SEQINT /* Residual byte count != 0 */
+ mask HOST_MSG_LOOP 0x60|SEQINT /*
* The bus is ready for the
* host to perform another
* message transaction. This
@@ -791,17 +790,41 @@ register INTSTAT {
* that require a kernel based
* message state engine.
*/
- mask PERR_DETECTED 0xb0|SEQINT /*
+ mask BAD_STATUS 0x70|SEQINT /* Bad status from target */
+ mask PERR_DETECTED 0x80|SEQINT /*
* Either the phase_lock
* or inb_next routine has
* noticed a parity error.
*/
- mask TRACEPOINT 0xd0|SEQINT
- mask DATA_OVERRUN 0xf0|SEQINT /*
+ mask DATA_OVERRUN 0x90|SEQINT /*
* Target attempted to write
* beyond the bounds of its
* command.
*/
+ mask BOGUS_TAG 0xa0|SEQINT /*
+ * Sequencer given an SCB with
+ * a Tag value of 0xFF.
+ */
+ mask SCBPTR_MISMATCH 0xb0|SEQINT /*
+ * In the SCB paging case, our
+ * SCBPTR is not the same as
+ * we originally set prior to
+ * download of a new scb.
+ */
+ mask SCB_MISMATCH 0xc0|SEQINT /*
+ * Downloaded SCB's tag does
+ * not match the entry we
+ * intended to download.
+ */
+ mask ABORT_QINSCB 0xd0|SEQINT /*
+ * An SCB was aborted
+ * during download.
+ * Informational.
+ */
+ mask NO_FREE_SCB 0xe0|SEQINT /*
+ * get_free_or_disc_scb failed.
+ */
+ mask OUT_OF_RANGE 0xf0|SEQINT
mask SEQINT_MASK 0xf0|SEQINT /* SEQINT Status Codes */
mask INT_PEND (BRKADRINT|SEQINT|SCSIINT|CMDCMPLT)
@@ -1214,7 +1237,29 @@ scratch_ram {
size 8
}
BUSY_TARGETS {
- size 16
+ size 8
+ }
+ /*
+ * Bit vector of targets that have ULTRA enabled as set by
+ * the BIOS. The Sequencer relies on a per-SCB field to
+ * control whether to enable Ultra transfers or not. During
+ * initialization, we read this field and reuse it for 2
+ * entries in the busy target table.
+ */
+ ULTRA_ENB {
+ size 2
+ }
+ /*
+ * Bit vector of targets that have disconnection disabled as set by
+ * the BIOS. The Sequencer relies in a per-SCB field to control the
+ * disconnect priveldge. During initialization, we read this field
+ * and reuse it for 2 entries in the busy target table.
+ */
+ DISC_DSB {
+ size 2
+ }
+ BUSY_TARGETS_TAIL {
+ size 4
}
/*
* Partial transfer past cacheline end to be
@@ -1222,11 +1267,6 @@ scratch_ram {
*/
MWI_RESIDUAL {
size 1
- /*
- * Bit vector of targets that have ULTRA enabled as set by * the BIOS. The Sequencer relies on a per-SCB field to
- * control whether to enable Ultra transfers or not.
- */
- alias ULTRA_ENB
}
/*
* SCBID of the next SCB to be started by the controller.
@@ -1235,14 +1275,6 @@ scratch_ram {
size 1
}
/*
- * Bit vector of targets that have disconnection disabled as set by
- * the BIOS. The Sequencer relies in a per-SCB field to control the
- * disconnect priveldge.
- */
- DISC_DSB {
- size 2
- }
- /*
* Single byte buffer used to designate the type or message
* to send to a target.
*/
@@ -1266,7 +1298,6 @@ scratch_ram {
SEQ_FLAGS {
size 1
bit IDENTIFY_SEEN 0x80
- bit SCBPTR_VALID 0x40
bit TARGET_CMD_IS_TAGGED 0x40
bit DPHASE 0x20
/* Target flags */
OpenPOWER on IntegriCloud