4.1.3. Definition
4.1.3.1. Command Issue Mechanism
The Serial ATA transmission protocol is sensitive to the state of the BSY bit in the Status shadow
register that provides write protection to the shared Shadow Register Block Registers. Since the
Shadow Register Block Registers can be safely written only when the BSY bit is cleared to zero,
the BSY bit conventions defined in Serial ATA 1.0 must be adhered to, and issuing a new
command shall only be attempted when the BSY bit is cleared to zero. When the BSY bit in the
Status shadow register is cleared to zero, another command may be issued to the device.
The state of the BSY bit in the Status shadow register shall be checked prior to attempting to
issue a new queued command. If the BSY bit is set to one, issuing the next command shall be
deferred until the BSY bit is cleared to zero. It is desirable to minimize such command issue
deferrals, so devices should clear the BSY bit to zero in a timely manner. Host controllers may
have internal designs that mitigate the need for host software to block on the state of the BSY bit.
The native queuing commands include a tag value that identifies the command. The tag value is
in the range 0 through 31 inclusive (the device queue depth is limited to 32 outstanding entries),
and is conveyed in the Register FIS when the command is issued. For devices that report
maximum queue depth less than 32 in their IDENTIFY DEVICE word 75, the host shall issue only
unique tag values that have a value less than the value reported. For example, for devices
reporting a maximum queue depth of 16, the host shall not issue a tag value greater than 15.
Upon issuing a new native queued command, the bit in the SActive register corresponding to the
tag value of the command being issued shall be set to one by the HBA prior to the command
being transmitted to the device. Section 5.1.1 describes the SActive register and the access
conventions for it.
4.1.3.2. Data Delivery Mechanism
The Serial ATA First Party DMA mechanism is used by the device to transmit (or receive) data for
an arbitrary queued command. The command’s tag value shall also be the DMA Buffer Identifier
used to uniquely identify the source/destination memory buffer for the transfer. The First Party
DMA mechanism defined in the Serial ATA 1.0 specification already specifies that the passed
buffer identifier is only a “token” and that it shall not be construed to be a physical address. Use of
the tag for the buffer identifier is therefore consistent with the existing Serial ATA specification.
The DMA Setup FIS is used by the device to select the proper transfer buffer prior to each data
transfer. Only a single DMA Setup FIS is required at the beginning of each transfer and if the
transfer spans multiple Data FISes a new DMA Setup FIS is not required before each Data FIS.
Serial ATA host controller hardware must account for the DMA Setup FIS buffer identifier being a
value between 0 and 31 and the host controller must select the proper transfer buffer based on
such an index.
For data transfers from the host to the device, an optimization to the First Party DMA mechanism
is included to eliminate one transaction by allowing the requested data to immediately be
transmitted to the device following such a request without the need for a subsequent DMA
Activate FIS for starting the flow of data. This optimization to the First Party DMA mechanism is
defined in section 3.1.
If non-zero buffer offsets in the DMA Setup FIS are not enabled (see section 4.3.4.1) or not
supported (see section 4.3.2), the data transfer for a command shall be satisfied to completion
following a DMA Setup FIS before data transfer for a different command may be started. Host
controllers are not required to preserve DMA engine context upon receipt of a new DMA Setup
FIS, and if non-zero buffer offsets are not enabled or not supported, it will not be possible for a
device to resume data transfer for a previously abandoned context at the point where it left off.
11