Professional Documents
Culture Documents
1G CONFIDENTIAL
SAMSUNG
UFS
RING BUFFER
SPECIFICATION
Version 1.0.1G
UFS Ring Buffer Specification 1.0.1G [텍스트 입력] CONFIDENTIAL
Revision History
Version Date Amendment
1 SCOPE 4
2 NORMATIVE REFERENCE 4
3 TERMS AND DEFINITIONS 4
4 INTRODUCTION 4
4.1 Overview 4
5 FUNCTIONAL DESCRIPTION 6
5.1 Command History Record 6
5.2 Checking Ring Buffer Supportability 8
5.3 Configuring Command History Record 8
5.4 Vendor Command 8
5.5 Initialization Condition 9
5.6 Store for Preserve Command History Data 10
5.7 Configuring RTC 11
6 COMMAND AND RESPONSE FOR RING BUFFER 12
6.1 READ BUFFER Command 12
6.1.1 Ring Buffer Mode (MODE = 1Dh) 12
6.1.1.1 COMMAND HISTORY parameter list 15
6.1.1.2 COMMAND HISTORY block descriptor 15
6.1.1.3 Retrieving command history with the READ BUFFER command 16
6.1.1.4 Read Buffer Command Status Response 17
7 UFS DESCRIPTORS, FLAGS AND ATTRIBUTES 18
7.1 DEVICE DESCRIPTOR for Ring Buffer 18
7.2 GEOMETRY DESCRIPTOR for Ring Buffer 19
7.3 FLAGS for Ring Buffer 19
7.4 ATTRIBUTES for Ring Buffer 20
UFS Ring Buffer Specification 1.0.1G [텍스트 입력] CONFIDENTIAL
FIGURES
Figure 4.1.1 Concept of Command History Record ..................................................................................... 5
Figure 5.1.1 Command History Record Sequence Diagram ......................................................................... 7
Figure 5.5.1 Initialize Command History Data ............................................................................................. 9
Figure 5.6.1 Store Command History Data................................................................................................. 10
Figure 5.7 Configuring RTC ....................................................................................................................... 11
TABLES
Table 5.4.1 Vendor Command Operation Code............................................................................................ 8
Table 6.1.1 READ BUFFER command ...................................................................................................... 12
Table 6.1.2 Read Buffer Command Mode Field Values ............................................................................. 12
Table 6.1.3 Buffer ID Field for Ring Buffer Mode..................................................................................... 13
UFS Ring Buffer Specification 1.0.1G [텍스트 입력] CONFIDENTIAL
1 SCOPE
This document describes the Samsung UFS’s additional feature called Ring Buffer that is based on an
Universal Flash Storage interface. In detail, it deals with the method to receive command information
required for protocol analysis between UFS device and Device.
2 NORMATIVE REFERENCE
The following normative documents contain provisions that, through reference in this text, constitute
provisions of this standard. For dated references, subsequent amendments to, or revisions of, any of these
publications do not apply. However, parties to agreements based on this standard are encouraged to
investigate the possibility of applying the most recent editions of the normative documents listed. For
undated references, the latest edition of the normative document referred to applies.
[JESD220D], JEDEC standard for Universal Flash Storage (UFS), Version 3.0
For the purposes of this standard, the terms and definitions given in the document included in clause 2,
Normative Reference.
4 INTRODUCTION
4.1 Overview
In UFS device, if the command response result is not success, there were various causes. They can be
originated with an invalid request of the host or an abnormal operation of the UFS device. However, since
the UFS host typically requests commands expected to be processed normally, it is highly likely that the
UFS device will not be able to process the host request if a failure occurs. In UFS devices, command
processing procedures or results may affect the cause of these abnormal operations. In other words,
processing of one command may affect other commands. Therefore, in the event of UFS failure, the host
will analyze the history of all commands processed by the UFS device for debugging. However, the
interface for delivering commands history is not defined in the UFS specification. Because of this
problem, protocol analyzer that can capture data transmitted between the UFS device and the UFS device
is used, but it cannot be utilized in all situations due to equipment and environment constraints.
The Ring Buffer feature enables the host to retrieve the command execution history from the UFS device.
Thus, the Ring Buffer may be utilized instead of using protocol analyzer or command log on the host side.
This specification describes the transaction protocol between an UFS host and a UFS device for activating
command logging and getting the stored command history. In detail, this protocol includes an interface,
such as identifying functionality support and host user authentication for using Ring Buffer.
UFS Ring Buffer Specification 1.0.1G11 [텍스트 입력] CONFIDENTIAL
5 FUNCTIONAL DESCRIPTION
Bit
7 6 5 4 3 2 1 0
Byte
1 Reserved MODE
2 BUFFER ID
3 (MSB)
4 BUFFER OFFSET
5 (LSB)
6 (MSB)
7 ALLOCATION LENGTH
8 (LSB)
9 CONTROL = 00h
Table 6.1.1 READ BUFFER command
MODE DESCRIPTION
00h Not used in UFS
01h Vendor Specific
02h Data
03h-1Bh Not used in UFS
1Ch Error history
1Dh Ring Buffer
1Eh-1Fh Reserved
Table 6.1.2 Read Buffer Command Mode Field Values
The UFS device shall support the MODE value of 1Dh, indicating Ring Buffer Mode. The
device operation of this mode depends on BUFFER ID field.
UFS Ring Buffer Specification 1.0.1G11 [텍스트 입력] CONFIDENTIAL
The BUFFER ID field specifies the action that the UFS device shall perform, and the parameter
data, if any, that the UFS device shall return.
The returned command history may be real time contents or may be the contents captured at
a vendor specific point in time.
The BUFFER OFFSET field specifies the byte offset from the start of the buffer specified
by the BUFFER ID field from which the UFS device shall return data.
The UFS device will read up to Allocation Length number of data bytes from the specified
Buffer Offset in Command History Record Buffer and transfer them to a buffer in the UFS
host.
Less than Allocation Length will be transferred if UFS device contains less byte.
Data will be transferred from the UFS device to the UFS host via a series of DATA IN
UPIU’s.
The data transferred from the UFS device will be contained within the Data Segment of
the DATA IN UPIU.
Bit
7 6 5 4 3 2 1 0
Byte
0 (MSB)
2 (LSB)
… Reserved
15
16
65
n-49
n
Table 6.1.4 1 COMMAND HISTORY parameter list
UFS Ring Buffer Specification 1.0.1G11 [텍스트 입력] CONFIDENTIAL
The COMMAND HISTORY DATA LENGTH field specifies the length in bytes of the
following data that is available to be transferred from the data-in buffer. The command history
data length does not include the number of bytes in the COMMAND HISTORY DATA
LENGTH field. The command history data length shall be a multiple of COMMAND HISTORY
block descriptor size. If the COMMAND HISTORY DATA LENGTH is set to zero, then no
command history block descriptors are included in the COMMAND HISTORY parameter data.
This condition shall not be considered an error.
Bit
7 6 5 4 3 2 1 0
Byte
0 (MSB)
… HOST TIME A
3 (LSB)
4 (MSB)
… HOST TIME B
7 (LSB)
8 (MSB)
… DEVICE TIME
11 (LSB)
12 COMMAND STATE
13 RESPONSE
14 STATUS
16 ASC
17 ASCQ
18
UPIU
…
UFS Ring Buffer Specification 1.0.1G [텍스트 입력] CONFIDENTIAL
49
Table 6.1.4 2 COMMNAD HISTORY block descriptor
The HOST TIME A field contains a value of dRingBufferRTCA and The HOST TIME B field
contains a value of dRingBufferRTCB. See [5.7] for details.
The DEVICE TIME field contains the time set based on the UFS device’s internal timer when
command received. Due to internal operations of the UFS device, there is a possibility of
inaccurate time information. In the case of a UFS device without an internal timer, the value
shall be set to an Invalid Value (FFFF FFFFh).
The RESPONSE field contains response value in COMMAND UPIU, QUERY REQUEST
UPIU, TASK MANAGEMENT UPIU.
The RESPONSE, STATUS fields are valid only when COMMAND STATE is END (FFh).
The ASC(ADDITIONAL SENSE CODE) field contains more specific error code.
The ASCQ(ADDITIONAL SENSE CODE QUALIFIER) field qualifies the Additional Sense
Code.
The STATUS, SENSE KEY, ASC, ASCQ fields are valid only when the transaction code of
UPIU is COMMAND.
The SENSE KEY, ASC, ASCQ fields are valid only when the STATUS is CHECK
CONDITION (02h).
The UPIU field contains the UPIU which is transferred by the host.
2) Host retrieves the command history by sending a READ BUFFER command as follow: MODE =
UFS Ring Buffer Specification 1.0.1G11 [텍스트 입력] CONFIDENTIAL
1Dh, BUFFER ID = 00h or 01h, BUFFER OFFSET = Start offset in byte, ALLOCATION LEN
GTH = Transferred Data length.
3) Host sends one or more READ BUFFER commands with BUFFER OFFSET set to the start byte
offset. During the command history retrieval, it is recommended that host does not send any nor
mal request other than READ BUFFER command because the other normal request could change
the command history information which is being retrieved.
4) I f t h e r e i s n o c o m ma n d history a t t h e t i me o f R E A D B U F F E R r e q u e s t , t h e
COMMAND HISTORY DATA LENGTH shall be set zero.
DEVICE DESCRIPTOR
User
Offset Size Name MDV Description
Conf.
00h 1 bLength 5Fh No Size of this descriptor
Extended UFS Features Support
This field indicates which features are
supported by the device. A feature is
supported if the related bit is set to one.
bit[0]: Field Firmware Update (FFU)
bit[1]: Production State Awareness (PSA)
bit[2]: Device Life Span
bit[3]: Refresh Operation
bit[4]: TOO_HIGH_TEMPERATURE
dExtendedUFS Device
4Fh 4 No bit[5]: TOO_LOW_TEMPERATURE
FeaturesSupport specific
bit[6]: Extended Temperature
bit[7]: Host-aware Performance Booster
(HPB)
bit[8]: Turbo Write
bit[9]: Performance Throttling
bit[10]: Host Initiated Defrag
bit[11]: Ring Buffer
bit[12]: Chip Crack Detection
bit[13~31] : reserved
Ring Buffer Specification Version
bits[15:8] = Major Version in BCD format
wRingBuffer Device
5Bh 2 No bits[7:4] = Minor Version in BCD format
Version specific
bits[3:0] = Version suffix in BCD format
Example: version 1.00 = 0100h
5Dh 2 Reserved Reserved for Samsung Extended Features
UFS Ring Buffer Specification 1.0.1G11 [텍스트 입력] CONFIDENTIAL
7.2 GEOMETRY DESCRIPTOR for Ring Buffer
To get the parameter related with Ring Buffer, the host must set the SELECTOR = 01h when reading the
geometry descriptor.
GEOMETRY DESCRIPTOR
FLAGS
Type1
IDN Name Type # Ind.2 Default Description Notes
3
# Sel.
Command History Record
Enable.
This flag shall only be set when
the command queue of all logical
units are empty. The UFS device
shall set
fCommandHistoryRecordEn to
fCommand History Read / zero in the event of power cycle
12h D 0 or hardware reset. 𝑁𝑜𝑡𝑒 2
RecordEn Volatile
0b: The UFS device shall not
record command log for the
host during executing
command.
1b: The UFS device shall recor
d command log for the host du
ring executing command.
NOTE 1 The type “D” identifies a device level flag, while the type “A” identifies an array of flags. If Type = “D”, the flag is
addressed setting INDEX = 00h and SELECTOR = 00h.
NOTE 2 Operations to access this field shall request with Selector = 01h in Query Request
UFS Ring Buffer Specification 1.0.1G [텍스트 입력] CONFIDENTIAL
ATTRIBUTES
Access
IDN Name Size Type1 MDV2 Description Notes
Property
RTC set by Host
dRingBuffer Write only / 4 This value is set to Host Time
22h D 0000h 𝑁𝑜𝑡𝑒 3
RTCA Volatile bytes A in COMMAND HISTORY
block descriptor
RTC set by Host
dRingBuffer Write only / 4 This value is set to Host Time
23h D 0000h 𝑁𝑜𝑡𝑒 3
RTCB Volatile bytes B in COMMAND HISTORY
block descriptor
NOTE 1 The type “D” identifies a device level attribute, while the type “A” identifies an array of attributes. If Type = “D”, the
attribute is addressed setting INDEX = 00h and SELECTOR = 00h.
NOTE 2 The column “MDV” (Manufacturer Default Value) specifies attribute values after device manufacturing.
NOTE 3 Operations to access this field shall request with Selector = 01h in Query Request.
UFS Ring Buffer Specification 1.0.1G11 [텍스트 입력] CONFIDENTIAL
SAMSUNG