UFS 6 - UAP – SCSI Commands(1)

UFS 6 - UAP – SCSI Commands

  • 1 Universal Flash Storage Command Layer (UCL) Introduction
    • 1.1 The Command Descriptor Block (CDB)
    • 1.2 Universal Flash Storage Native Commands (UNC)
    • 1.3 Universal Flash Storage SCSI Commands
    • 3.1 General information about SCSI commands in UFS
    • 3.2 INQUIRY Command
      • 3.2.1 VITAL PRODUCT DATA
      • 3.2.2 STANDARD INQUIRY DATA
      • 3.2.3 Inquiry Command Data Response
      • 3.2.4 Inquiry Response Data
      • 3.2.5 Inquiry Command Status Response

UFS 1-UFS架构简介1
UFS 2 -UFS架构简介2
UFS 3 - UFS RPMB
UFS 4 - UFS Boot
UFS 5 - UFS UIC Layer: MIPI M-PHY

UAP : UFS Application Layer

1 Universal Flash Storage Command Layer (UCL) Introduction

This chapter defines the mandatory commands set supported by the UFS device.
本章定义了 UFS 设备支持的强制命令集。
Commands may belong to the UFS Native command set or to the UFS SCSI command set.
This version of the standard does not define UFS native commands.These command set may be defined in the future to support specific flash storage or UFS native basic needs.
命令可能属于 UFS Native 命令集或 UFS SCSI 命令集。 该版本的标准没有定义UFS原生命令。未来可能会定义这些命令集以支持特定的闪存或UFS原生的基本需求。
The UFS SCSI command set (USC) consists of a selection of commands from SCSI Primary Commands [SPC], and SCSI Block Commands [SBC]. Both command types share similar command descriptor block (CDB) format.
UFS SCSI 命令集 (USC) 由从 SCSI 主命令 [SPC] 和 SCSI 块命令 [SBC] 中选择的命令组成。两种命令类型共享相似的命令描述符块 (CDB) 格式。

UFS 6 - UAP – SCSI Commands(1)_第1张图片

1.1 The Command Descriptor Block (CDB)

SCSI commands are communicated by sending the SCSI Command Descriptor Block (CDB) to the device. There are only fixed length CDB format for UFS, unlike SCSI which has additional Variable Length CDB format.
SCSI 命令通过向设备发送 SCSI 命令描述符块 (CDB) 来传达。 UFS 只有固定长度的 CDB 格式,不像 SCSI 有额外的可变长度 CDB 格式。
All UFS CDBs shall have an OPERATION CODE field as their first byte and these values shall be defined by each SCSI and UFS. Detail SCSI CDB usages and structure are defined in [SPC], section 4.3, The Command Descriptor Block (CDB).
The General Common CDB fields are defined in [SPC], section 4.3.5, Common CDB fields.
所有 UFS CDB 都应将操作代码字段作为其第一个字节,并且这些值应由每个 SCSI 和 UFS 定义。详细的 SCSI CDB 用法和结构在 [SPC],第 4.3 节,命令描述符块 (CDB) 中定义。 通用 CDB 字段在 [SPC] 第 4.3.5 节,通用 CDB 字段中定义。
Operation code
The first byte of a SCSI and USC CDB shall contain an operation code identifying the operation being requested by the CDB.
The OPERATION CODE of the CDB contains a GROUP CODE field and COMMAND CODE field. The GROUP CODE field provides eight groups of command codes and the COMMAND CODE provides thirty-two command codes in each group, see [SPC] for further details.
SCSI 和 USC CDB 的第一个字节应包含一个操作代码,用于标识 CDB 请求的操作。 CDB 的 OPERATION CODE 包含 GROUP CODE 字段和 COMMAND CODE 字段。 GROUP CODE 字段提供八组命令代码,COMMAND CODE 提供每组三十二个命令代码,详见[SPC]。

1.2 Universal Flash Storage Native Commands (UNC)

The UFS Native commands are not defined in this version of the standard, they may be defined in future versions if needed.
UFS Native 命令未在此版本的标准中定义,如果需要,它们可能会在未来的版本中定义。

1.3 Universal Flash Storage SCSI Commands

The Basic Universal Flash Storage (UFS) SCSI commands are compatible with SCSI Primary Commands - 4 [SPC] and SCSI Block Commands - 3 [SBC].
基本通用闪存 (UFS) SCSI 命令与 SCSI 主要命令 - 4 [SPC] 和 SCSI 块命令 - 3 [SBC] 兼容。
If enabled (bLUEnable = 01h), each logical unit shall support the commands defined as mandatory in Table 11.1.
如果启用(bLUEnable = 01h),每个逻辑单元应支持表 11.1 中定义为强制性的命令。
UFS 6 - UAP – SCSI Commands(1)_第2张图片
UFS 6 - UAP – SCSI Commands(1)_第3张图片

3.1 General information about SCSI commands in UFS

The remaining part of this section describes the SCSI commands used in UFS devices. A dedicated paragraph for each command provides: CDB table, brief command description, relevant command fields, details about mandatory and optional features, and some other fundamental information.
本节的其余部分描述了 UFS 设备中使用的 SCSI 命令。每个命令的专用段落提供:CDB 表、简要命令描述、相关命令字段、有关强制和可选功能的详细信息以及一些其他基本信息。
Fields that are not supported by UFS should be set to zero, and are documented using the notation “= 00h” (e.g., RDPROTECT = 000b). The device may ignore values in fields that are not supported by UFS.
UFS 不支持的字段应设置为零,并使用符号“= 00h”进行记录(例如,RDPROTECT = 000b)。设备可能会忽略 UFS 不支持的字段中的值。
NOTE The values enclosed in parenthesis are defined in SCSI standards and are not UFS specific (e.g., OPERATION CODE (12h)).
注意括号中的值是在 SCSI 标准中定义的,而不是特定于 UFS 的(例如,OPERATION CODE (12h))。
In the following some information that apply to all SCSI commands used in UFS.
以下是适用于 UFS 中使用的所有 SCSI 命令的一些信息。
CONTROL
The CONTROL byte is present in several CDB and it is defined in [SAM]. The CONTROL byte is not used in this standard: the CONTROL byte should be set to zero and it shall be ignored by UFS device. No vendor specific interpretation and Normal ACA are assumed.
CONTROL 字节存在于多个 CDB 中,并在 [SAM] 中定义。本标准未使用 CONTROL 字节:CONTROL 字节应设置为零,UFS 设备应忽略它。不假定供应商特定解释和正常 ACA。
Auto contingent allegiance (ACA)
Establishing an ACA condition the application client may request that the device server alter command processing when a command terminates with a CHECK CONDITION status.
建立 ACA 条件后,应用程序客户端可以请求设备服务器在命令以CHECK CONDITION状态终止时更改命令处理。
UFS device does not support ACA.
UFS 设备不支持 ACA。

3.2 INQUIRY Command

The INQUIRY command (see Table 11.2) is a request for information regarding the logical units and UFS target device be sent to the application client. Refer to [SPC] for more details regarding the INQUIRY command.
INQUIRY 命令(参见表 11.2)是一个关于逻辑单元和 UFS 目标设备的信息请求,被发送到应用程序客户端。有关 INQUIRY 命令的更多详细信息,请参阅 [SPC]。
UFS 6 - UAP – SCSI Commands(1)_第4张图片

3.2.1 VITAL PRODUCT DATA

When EVPD = 1, the device server shall return the vital product data specified by the PAGE CODE field as defined in [SPC]. Support for all vital product data except Mode Page Policy VPD is optional for UFS. Mode Page Policy VPD shall be supported by UFS device to provide information about Mode pages which are applicable to Device level or logical unit level. See [SPC] for data format definition of Mode Page Policy VPD page.
当 EVPD = 1 时,设备服务器应返回由 [SPC] 中定义的 PAGE CODE 字段指定的重要产品数据。 UFS 可选择支持除模式页面策略 VPD 之外的所有重要产品数据。模式页面策略 VPD 应由 UFS 设备支持,以提供有关适用于设备级别或逻辑单元级别的模式页面的信息。 Mode Page Policy VPD page的数据格式定义见[SPC]。

3.2.2 STANDARD INQUIRY DATA

When EVPD = 0 and Page Code = 0, the Standard INQUIRY DATA is responded to INQUIRY command. The standard INQUIRY data format is shown on Table 11.3, INQUIRY data shall contain at least 36 bytes. Table 11.4 defines the INQUIRY response data for UFS.
当 EVPD = 0 且Page Code = 0 时,标准 INQUIRY DATA 响应 INQUIRY 命令。标准查询数据格式如表 11.3 所示,查询数据至少包含 36 个字节。表 11.4 定义了 UFS 的 INQUIRY 响应数据。
The INQUIRY command requests that information regarding the logical unit and SCSI target device be sent to the Application Client.
INQUIRY 命令请求将有关逻辑单元和 SCSI 目标设备的信息发送到 Application Client。
The INQUIRY command may be used by an Application Client after a hard reset or power on condition to determine information about the device for system configuration. If a INQUIRY command is received with a pending UNIT ATTENTION condition (i.e., before the device server reports CHECK CONDITION status), the device server shall perform the INQUIRY command.
INQUIRY information is returned in standard INQUIRY response data structure (see Table 11.3).
INQUIRY 命令可由应用程序客户端在硬重置或开机条件后使用以确定有关系统配置的设备的信息。如果收到带有未决 UNIT ATTENTION 条件的 INQUIRY 命令(即,在设备服务器报告 CHECK CONDITION 状态之前),设备服务器应执行 INQUIRY 命令。 INQUIRY 信息以标准 INQUIRY 响应数据结构返回(见表 11.3)。

  •  Client requests number of bytes to return
  • 客户端请求返回的字节数
  •  First 36 bytes are defined for UFS as standard
  • 前 36 个字节是为 UFS 定义的标准
  •  Requesting zero byte is valid
  • 请求零字节有效
  •  Requesting 36 bytes will result in the device returning the complete record
  • 请求 36 个字节将导致设备返回完整记录
  •  Requesting more bytes than defined will result in truncation to max number device has defined
  • 请求比定义更多的字节将导致截断到最大设备数已定义
    The Device Server should process the INQUIRY command even when an error occurs that prohibits normal command completion
    设备服务器应该处理 INQUIRY 命令,即使发生了阻止正常命令完成的错误
  •  When in UNIT ATTENTION
  • 当处于 UNIT ATTENTION 时
  •  During other conditions that may affect medium access
  • 在其他可能影响媒体访问的情况下
    The Command CDB shall be sent in a single COMMAND UPIU
    命令 CDB 应在单个命令 UPIU 中发送
    UFS 6 - UAP – SCSI Commands(1)_第5张图片

3.2.3 Inquiry Command Data Response

  •  Data returned from an INQUIRY command will be transferred to the Application Client in a single DATA IN UPIU
  • 从 INQUIRY 命令返回的数据将在单个 DATA IN UPIU 中传输到应用程序客户端
  •  The Device Server will transfer the Response Data in the Data Segment area of a DATA IN UPIU
  • 设备服务器将在 DATA IN UPIU 的数据段区域传输响应数据
  •  An Allocation Length of zero specifies that no data shall be transferred. This condition shall not be considered as an error, and DATA IN UPIU shall not be generated.
  • 零分配长度指定不应传输任何数据。这种情况不应被视为错误,并且不应生成 DATA IN UPIU。
  •  No DATA IN UPIU will be transferred if an error occurs
  • 如果发生错误,则不会传输 UPIU 中的数据
  •  For Standard INQUIRY Data,
    • o the Device Server shall return a number of bytes equal to the minimum between 36 and the value specified in the Allocation Length.
    • 设备服务器应返回等于 36 和分配长度中指定值之间的最小值的字节数。
    • o Standard INQUIRY Response Data is shown in Table 11.4.
    • 标准 INQUIRY 响应数据如表 11.4 所示。

3.2.4 Inquiry Response Data

UFS 6 - UAP – SCSI Commands(1)_第6张图片
The 4-byte PRODUCT REVISION LEVEL in the Inquiry Response Data shall identify the firmware version of the UFS device and shall be uniquely encoded for any firmware modification implemented by the UFS device vendor.
查询响应数据中的 4 字节PRODUCT REVISION LEVEL应标识 UFS 设备的固件版本,并应针对 UFS 设备供应商实施的任何固件修改进行唯一编码。

3.2.5 Inquiry Command Status Response

  •  STATUS response will be sent in a single RESPONSE UPIU
  • STATUS 响应将在单个 RESPONSE UPIU 中发送
  •  If the requested data is successfully transferred, the INQUIRY command will terminate with a STATUS response of GOOD
  • 如果成功传输请求的数据,INQUIRY 命令将以 GOOD 的 STATUS 响应终止
  •  If the unit is not ready to accept a new command (e.g., still processing previous command) a STATUS response of BUSY will be returned
  • 如果设备未准备好接受新命令(例如,仍在处理之前的命令),将返回 BUSY 状态响应
  •  When the INQUIRY command fails a STATUS response of CHECK CONDITION will be returned along with an appropriate SENSE KEY, such as
  • 当 INQUIRY 命令失败时,将返回 CHECK CONDITION 的 STATUS 响应以及适当的 SENSE KEY,例如
    • o ILLEGAL REQUEST (range or CDB errors)
    • 非法请求(范围或 CDB 错误)
    • o HARDWARE ERROR (hardware failure)
    • HARDWARE ERROR(硬件故障)
  •  Will not fail due to a pending UNIT ATTENTION condition
  • 不会因未决的 UNIT ATTENTION 条件而失败

你可能感兴趣的:(UFS专栏,UFS,UFS,5,-,UAP,SCSI,Commands)