Datasheet

ATA/ATAPI Interface Port
11−6
SLLS535E − March 2008TUSB6250
11.3 TUSB6250 ATA/ATAPI Controller Transfer Modes
The supported Universal Serial Bus Mass Storage Class Bulk-Only Transport protocol uses only the bulk
endpoint for the transport of command, data, and status. The transport command set used in the bulk-only
protocol is actually based on the SCSI transparent command set, which is wrapped with some information
related to the bulk-only protocol, to form the command block wrapper (CBW) for a specific transport.
At the command stage, the mass storage application at the host side sends a CBW to a USB mass storage
device. The TUSB6250, as a USB mass-storage bridge controller, performs analysis of the CBWCB received
from the host and translates the CBWCB into a sequence of command block register writes to the ATA/ATAPI
storage device connected to the TUSB6250 ATA/ATAPI interface. The storage device interprets the command
block register contents as a set of commands and prepares the following data transfer from the host, if there
is any.
A CBW consists of the following major elements:
dCBWSignature—This is used to help identify the data packet received from the host as a valid CBW.
dCBWTag—This is a tag associating a specific CBW and command status wrapper (CSW).
dCBWDataTransferLength—This specifies the number of bytes the host expects to transfer on the bulk-in
or bulk-out endpoint.
bmCBWFlags—This field contains the data transfer direction for the current CBW, which can be either
from the host to the mass storage device or vice versa.
bCBWLUN—This field specifies the logic unit number to which the command block is being sent.
bCBWCBLength—This field specifies the valid length of the CBWCB in bytes, which is the valid length
of the command block. The only legal values are 1 through 16.
CBWCB—This is the command block to be executed by the device. The device interprets the first
bCBWCBLength bytes in this field as a command block, as defined by the command set identified by
bInterfaceSubClass, which is the SCSI transparent command set.
At the status stage, a CSW is sent back to the host with the drive-status-related information. A valid CSW
consists of a valid dCSWSignature, dCSWTag, which is the same as the dCBWTag for a given CBW,
dCSWDataResidue, which is the difference of data amount between what the host expects and what the mass
storage device actually processed, and the bCSWStatus, which indicates the success or failure of the CBW.
For more detailed information, see the Universal Serial Bus Mass Storage Class Bulk-Only Transport
specification.
It should be noted that for the TUSB6250 ATA/ATAPI controller, the status stage is always processed by the
MCU, which adds valuable flexibility for the firmware when handling any ATA/ATAPI drive-related error
condition.
Because the TUSB6250 is equipped with an MCU, state machine, and DMA engine, it supports three kinds
of data transfer modes or schemes, based on the amount of involvement from the MCU and state machine:
fully-manual mode, semiautomatic mode, and fully automatic mode. These modes, different in the amount of
automation involved during the command stage and data stage, are the schemes used by the TUSB6250 for
a given CBW data transfer, which should not be confused with the PIO or UDMA transfer modes defined in
the ATA/ATAPI-5 specification.
Fully manual mode—In this mode, the MCU is responsible to handle all the data movement between the
4K byte EDB and the ATA/ATAPI interface for the command, data, and status stages. The sector FIFO
is not used. The firmware must use ATA/ATAPI access registers 0 to 3 (ATPACSREG0–ATPACSREG3)
to perform ATA/ATAPI drive register access. The data transfer throughput is low compared to the
semiautomatic and fully-automatic mode. In order to transfer one byte, the firmware must manually write
each data byte into the ATA/ATAPI access registers.