10 UFS TRANSPORT PROTOCOL (UTP) LAYER
10.1 Overview
The SCSI Architecture Model [SAM] is used as the general architectural model for UTP, and the SAM Task Management functions for task management. A task is generally a SCSI command or service request. While the model uses the SCSI command set as the command set, it is not necessary to use SCSI commands exclusively.
The SAM architecture is a client‐server model or more commonly a request‐response architecture. Clients are called Initiators and servers are called Targets. Initiators and Targets are mapped into UFS physical network devices. An Initiator issues commands or service requests to a Target that will perform the service requested. A Target is a Logical Unit (LU) contained within a UFS device. A UFS device will contain one or more Logical Units. A Logical Unit is an independent processing entity within the device.
A client request is directed to a single Logical Unit within a device. A Logical Unit will receive and process the client command or request. Each Logical Unit has an address within the Target device called a Logical Unit Number (LUN).
Communication between the Initiator and Target is divided into a series of messages. These messages are formatted into UFS Protocol Information Units (UPIU) as defined within this specification. There are a number of different UPIU types defined. All UPIU structures contain a common header area at the beginning of the data structure (lowest address). The remaining fields of the structure vary according to the type of UPIU.
A Task is a command or sequence of actions that perform a requested service. A Logical Unit contains a task queue that will support the processing of one or more Tasks. The Task queue is managed by the Logical Unit. A unique Initiator provided Task Tag is generated by the Initiator when building the Task. This Task Tag is used by the Target and the Initiator to distinguish between multiple Tasks. All transactions and sequences associated with a particular Task will contain that Task Tag in the transaction associated data structures.
Command structures consist of Command Descriptor Blocks (CDB) that contain a command opcode and related parameters, flags and attributes. The description of the CDB content and structure are defined in detail in [SAM], [SBC] and [SPC] INCITS T10 draft standards.
A command transaction consists of a Command, an optional Data Phase, and a Status Phase. These transactions are represented in the form of UPIU structures. The Command Phase delivers the command information and supporting parameters from the Initiator to the Target. If a Data Phase is required, the direction of data flow is relative to the Initiator (host). A data WRITE travels from Initiator to Target. A data READ travels from Target to Initiator. At the completion of the command request the Target will deliver a response to the Initiator during the Status Phase. The response will contain the status and a UFS response status indicating successful completion or failure of the command. If an error is indicated the response will contain additional detailed UFS error information.
10.2 UTP and UniPro Specific Overview
UTP will deliver commands, data and responses as standard message packets (T_SDU) over the UniPro network.
The UFS transactions will be grouped into data structures called UFS Protocol Information Units (UPIU).
There are UPIU’s defined for UFS SCSI commands, responses, data in and data out, task management, utility functions, vendor functions, transaction synchronization and control. The list is extensible for future additions.
For enumeration and configuration, UFS supports a system of Descriptors, Attributes and Flags that define and control the specifics of the device, including operating characteristics, interfaces, number of logical units, operating speeds, power profiles, etc. The system is a hierarchical tree of related elements. It is open to be expanded.
10.2.1 Phases
The SCSI based Command protocol requires that the UPIU packets follow the transitions required to execute a command. Briefly, a command execution requires the sending of a COMMAND UPIU, zero or more DATA IN UPIU or DATA OUT UPIU packets and terminates with a RESPONSE UPIU that contains the status.
10.2.2 Data Pacing
A device may have limited memory resources for buffering or limited processing throughput. During a Command that requires a large Data Out transaction the Target device can pace the Data Out phase by sending a READY TO TRANSFER UPIU when it is ready for the next DATA OUT UPIU. In addition, the READY TO TRANSFER UPIU contains an embedded transfer context that can be used initiate a DMA transfer on a per packet basis at the initiating device (the Host).
During the Data In phase, no READY TO TRANSFER UPIU is required as the initiating Host has the ability to specify the size of the Data In transfer and thereby is able to allocate in advance the appropriate memory resources for the incoming data. A device issued DATA IN UPIU packet also contains an embedded DMA context that can be used to initiate a DMA transfer on a per packet basis.
10.2.3 UniPro
In keeping with the requirements of the UniPro Protocol the UFS Initiator and Target will divide its transactions into UniPro messages that will contain UPIU’s. UniPro messages can handle T_SDU messages of theoretically unlimited size. UFS will impose a practicable limit on the maximum T_SDU message size. The limit is 65600 bytes which includes UPIU header, optional extended headers area and data segment. The minimum message size is determined by the basic header format, which is 32 bytes. There is a possibility that in the future this value will increase to allow a larger data segment area.
10.3 UFS Transport Protocol Transactions
10.3.1 Overview
UFS transactions consist of packets called UFS Protocol Information Units (UPIU) that travel between devices on the UniPro bus. A transaction begins between an Initiator and a Target in the form of a Request‐Response operation. The Initiator starts the sequence of transactions by sending a request to aTarget device and LUN. The Target will then respond with a series of transactions that eventually end in a response transaction.
All UFS UPIU’s consist of a single basic header segment, transaction specific fields, possibly one or more extended header segments and zero or more data segments.
A basic header segment has a fixed length of 12 bytes. The minimum UPIU size is 32 bytes which includes a basic header segment and transaction specific fields.
The maximum UPIU size is defined as being 65600 bytes.
The UPIU format is flexible enough to be easily extended to support future transactions and larger data segments and will allow the application of this protocol to network protocols other than UniPro.
10.4 Service Delivery Subsystem
The Service Delivery Subsystem is an I/O system that transmits service requests and responses between Initiators and logical units within Targets connected via a physical or logical bus. The UFS UTP attempts to define a protocol that is independent of the Service Delivery Subsystem. This will allow for the easy porting of UTP to different Service Delivery Subsystems.
Currently, UFS is using the MIPI UniPro bus and the MIPI M‐PHY as the Service Delivery Subsystem. For convenience and to aid in better understanding, portions of this specification will directly reference UniPro and M‐PHY. Regardless of these references, the UTP protocol is independent of the Service Delivery Subsystem and should be able to port to other I/O systems.
UPIU structures will be handed off to MIPI UniPro as UniPro Service Data Units (T_SDU). Currently, the UniPro T_SDU requires no additional headers or trailer wrapped around the UPIU structure. This means that the T_SDU size will be exactly the UPIU size. The minimum size T_SDU will be 32 bytes. The maximum T_SDU size will be 65600 bytes.
10.4.1 UPIU Transaction Codes
Every UPIU data structure contains a Transaction Code. This code defines the content and implied function or use of the UPIU data structure. The following chart lists currently defined transaction codes.
Table 10.1 — UPIU Transaction Codes
Initiator To Target | Transaction Code | Target to Initiator | Transaction Code |
---|---|---|---|
NOP OUT | 00 0000b | NOP IN | 10 0000b |
COMMAND | 00 0001b | RESPONSE | 10 0001b |
DATA OUT | 00 0010b | DATA IN | 10 0010b |
TASK MANAGEMENT REQUEST | 00 0100b | TASK MANAGEMENT RESPONSE | 10 0100b |
Reserved | 01 0001b | READY TO TRANSFER | 11 0001b |
QUERY REQUEST | 01 0110b | QUERY RESPONSE | 11 0110b |
Reserved | 01 1111b | REJECT UPIU | 11 1111b |
Reserved | Others | Reserved | Others |
NOTE 1 Bit 5 of the Transaction Code indicates the direction of flow and the originator of the UPIU: when equal ‘0’ the originator is the Host device , when equal ‘1’ the originator is the Target device.