UFS 13 - Logical Unit Management

news/2024/11/30 7:56:10/

UFS 13 - Logical Unit Management

  • 1 Introduction
  • 2 Logical Unit features
  • 3 Logical Unit Configuration

基于UFS 3.1 标准文档阐述
UFS 1-UFS架构简介1
UFS 2 -UFS架构简介2
UFS 3 - UFS RPMB
UFS 4 - UFS Boot
UFS 5 - UFS UIC Layer: MIPI M-PHY
UFS 6 - UAP – SCSI Commands(1)
UFS 7 - UAP – SCSI Commands(2)
UFS 8 - UAP – SCSI Commands(3)
UFS 9 - UAP – SCSI Commands(4)
UFS 10 - UAP – SCSI Commands(5)
UFS 11 - UFS RPMB分区功能验证

1 Introduction

The functionality aims to provide a mechanism to let an external application define and use a virtual memory organization which could easily fit different usage models in a versatile way.
该功能旨在提供一种机制,让外部应用程序定义和使用虚拟内存组织,该组织可以轻松地以多种方式适应不同的使用模型。
Besides segmenting the available addressable space, the mechanism introduces the possibility of differentiating each logical unit through dedicated functionalities and features.
除了对可用的可寻址空间进行分段之外,该机制还引入了通过专用功能和特性来区分每个逻辑单元的可能性。
This section describes the procedure to configure the UFS device in terms of: number of logical units, logical unit size, logical unit memory type, etc. Security features can be configured as described in clause 12, UFS Security.
本节从以下方面描述配置 UFS 设备的过程:逻辑单元数量、逻辑单元大小、逻辑单元内存类型等。安全功能可以按照第 12 条“UFS 安全”中的描述进行配置。
A UFS device can be organized in different logical units. Each one represents an autonomous computing entity with independent logical address ranges and singularly accessible.
UFS 设备可以组织为不同的逻辑单元。每一个都代表一个具有独立逻辑地址范围且可单独访问的自治计算实体。
Moreover, each logical unit can be defined for a specified use and with peculiar attributes (i.e., memory type) in order to be adapted to different UFS host usage models and operating systems requirements.
此外,每个逻辑单元可以针对指定用途进行定义,并具有特定的属性(即内存类型),以便适应不同的 UFS 主机使用模型和操作系统要求。

2 Logical Unit features

UFS device address space is organized in several memory areas configurable by the user. In particular, such memory areas are denoted as logical units and characterized by the fact that they have independent logical addressable spaces starting from the logical address zero.
UFS 设备地址空间组织在多个可由用户配置的存储区域中。特别地,这样的存储器区域被表示为逻辑单元并且其特征在于它们具有从逻辑地址零开始的独立的逻辑可寻址空间。
In addition to the logical units, the UFS device supports the following well known logical units for specific purposes: UFS Device, REPORT LUNS, Boot and RPMB. Logical units are addressed by the LUN (logical unit number), while well known logical unit are addressed by the W-LUN (well known logical unit number).
除了逻辑单元之外,UFS 设备还支持以下用于特定用途的众所周知的逻辑单元:UFS 设备、REPORT LUN、Boot 和 RPMB。逻辑单元由LUN(逻辑单元号)寻址,而众所周知的逻辑单元由W-LUN(众所周知的逻辑单元号)寻址。
在这里插入图片描述
NOTE 1 The figure shows an example of device configuration in which LU 0 and LU 1 are used as boot logical units, and the logical units 3, 4 and 7 for code and data storage. LU 1 is the boot active logical unit and it may be accessed in read using the W-LUN = 30h (LUN field in UPIU = B0h).
注: 该图显示了设备配置示例,其中 LU 0 和 LU 1 用作引导逻辑单元,逻辑单元 3、4 和 7 用于代码和数据存储。 LU 1 是引导活动逻辑单元,可以使用 W-LUN = 30h(UPIU 中的 LUN 字段 = B0h)以读取方式对其进行访问。
Each logical unit will have a physical implementation on the non-volatile storage media.
每个逻辑单元将在非易失性存储介质上具有物理实现。
In particular, the UFS device shall support:
特别是,UFS 设备应支持:

  • The number of logical units specified by bMaxNumberLU. Each of them configurable as boot logical units with a maximum of two.
  • bMaxNumberLU 指定的逻辑单元数。它们中的每一个都可配置为引导逻辑单元,最多有两个。
  • One RPMB well known logical unit (W-LUN = 44h, LUN field in UPIU = C4h). RPMB well known logical unit may be further configured into up to four separate RPMB regions (RPMB region 0 - RPMB region 3).
  • 1 个 RPMB 众所周知的逻辑单元(W-LUN = 44h,UPIU 中的 LUN 字段 = C4h)。 RPMB众所周知的逻辑单元可以进一步被配置成多达四个单独的RPMB区域(RPMB区域0-RPMB区域3)。

Two logical units can be configured as boot logical unit, with only one of them active and readable through the Boot well known logical unit (W-LUN = 30h) for the execution of the system boot (see 13.1, UFS Boot). The RPMB well known logical unit is accessed by authenticated operations by a well defined security algorithm (see 12.4, RPMB). The other logical units will be used to fulfill other use cases.
可以将两个逻辑单元配置为引导逻辑单元,其中只有一个逻辑单元处于活动状态并可通过引导众所周知的逻辑单元 (W-LUN = 30h) 进行读取,以执行系统引导(请参阅 13.1,UFS 引导)。 RPMB 众所周知的逻辑单元由经过明确定义的安全算法(参见 12.4,RPMB)的认证操作进行访问。其他逻辑单元将用于完成其他用例。
Common features of each logical unit are:

  • independent logical addressable spaces (starting from logical address zero up to the logical unit size),
  • Configurable logical unit size.
    The size of each logical unit is determined by the number of allocation units assigned to it:
    dNumAllocUnits parameter value of the Configuration Descriptor. The dNumAllocUnits is expressed in terms of allocation unit size (bAllocationUnitSize).
    Moreover each logical unit is characterized by the memory type parameter which can be configured.
    Examples of memory types to differentiate logical unit properties are the following ones:
  • Default type – regular memory characteristic
  • System Code type – a logical unit that is rarely updated (e.g., system files or binary code executable files or the host operating system image and other system data structures)
  • Non-Persistent type – a logical unit that is used for temporary information (e.g., swap file extend the host virtual memory space)
  • Enhanced Memory type – vendor specific attribute
    The definition of the Enhanced Memory type is left open in order to accomplish different needs and vendor specific implementations.
    Mechanisms of write protection can be configured for each logical unit. Write protection feature types are:
  • Permanent write protection (permanent read only)
  • Power on write protection (write protection can be cleared with a power cycle or a hardware reset event)
    Write protection is not available in the RPMB well known logical unit.

3 Logical Unit Configuration

The user shall configure the logical units of the UFS device according to the following rules:

  • Maximum number of logical units is specified by bMaxNumberLU
  • One or two logical units can be configured as boot logical units.
    When a UFS device is shipped only the following well known logical units will be available: UFS Device, REPORT LUNS and the RPMB. All other logical units shall be configured before they can be accessed.
    The RPMB well known logical unit shall be configured by the device manufacturer before shipping the device. Only RPMB region 0 shall be enabled and bRPMBRegion0Size shall be set to the same size as the total RPMB well known logical unit size before shipping the device.
    Logical units and RPMB regions may be configured writing the Configuration Descriptors, see 14.1.3, Accessing Descriptors and Device Configuration, for details. RPMB regions may be configured multiple times until the Configuration Descriptor is locked by setting bConfigDescrLock attribute value to 01h. RPMB key may be programmed any time when the target RPMB region is enabled, and may be programmed independent to whether the value of bConfigDescrLock attribute is set or not. When RPMB regions are re-configured with different configuration setting, the data which was previously written to any RPMB region shall be erased while RPMB key and RPMB write counter are maintained. To keep the compatibility to the previous version of the standard, RPMB region 0 is always enabled independent of 5493
    configuration value of bRPMBRegionEnable.
    The configuration of each logical unit and the configuration of RPMB regions may be retrieved by reading the corresponding Unit Descriptor.
    It is recommended to execute logical unit configuration and RPMB region configuration during the system manufacturing phase.

Table 13.3 summarizes the configurable parameters per logical unit. See 14.1.4, Descriptor Definitions, for details about these parameters.
在这里插入图片描述
The following Geometry Descriptor parameters provide relevant information for configuring the logical units:

  • qTotalRawDeviceCapacity (total raw device density in unit of 512 bytes)
  • dSegmentSize
  • bAllocationUnitSize (Allocation Unit Size, value expressed in number of segments)
  • wSupportedMemoryTypes
  • Maximum number of allocation unit for each memory type (dSystemCodeMaxNAllocU, dNonPersistMaxNAllocU, etc.)
  • Capacity Adjustment Factor for each memory type (wSystemCodeCapAdjFac, wNonPersistCapAdjFac, etc.)
  • bMinAddrBlockSize (this parameter indicates a value equal or greater than 4Kbyte)
  • bOptimalReadBlockSize and bOptimalWriteBlockSize
  • bMaxInBufferSize
  • bMaxOutBufferSize
    To enable the access to a logical unit, the user shall configure Unit Descriptor parameters as described in the following:
  • bLUEnable
    bLUEnable shall be set to 01h to enable the logical unit. If bLUEnable is equal to 00h the logical unit is disabled and all Unit Descriptor parameters are don’t care.
  • bMemoryType
    bMemoryType shall be set to value corresponding to the desired memory type. The wSupportedMemoryTypes parameter in the Geometry Descriptor indicates which memory types are supported by the device.
  • bLogicalBlockSize
    bLogicalBlockSize value shall adhere to the following rules:
    在这里插入图片描述
    To optimize the device performance, it is recommended to configure the logical block size (bLogicalBlockSize) to represent the value indicated by dOptimalLogicalBlockSize for the specific logical unit memory type.
    Supported bLogicalBlockSize values are device specific, refer to the vendor datasheet for further information.
  • dNumAllocUnits
    在这里插入图片描述
    Assuming that the medium of the UFS device is composed by NAND flash memories which support 2 bit-per-cell and 1 bit-per-cell operation modes. The 2 bit-per-cell operation mode may be associated with the Normal memory type, while the 1 bit-per-cell operation mode may be associated with the Enhanced memory type 1.
    The Capacity Adjustment Factor for the Enhanced memory type 1 will be equal to 2.
    If:
    o dSegmentSize = 1024
    o bAllocationUnitSize = 8
    Then dNumAllocUnits for LU 1 and LU 4 are:
    在这里插入图片描述
    The logical unit capacity can be retrieved by either reading the qLogicalBlockCount parameter in the Unit Descriptor or issuing the READ CAPACITY command.
    In particular, the relations between the parameters returned by READ CAPACITY (RETURNED LOGICAL BLOCK ADDRESS and LOGICAL BLOCK LENGTH IN BYTES), and bLogicalBlockSize and qLogicalBlockCount parameters in Unit Descriptors are:
    在这里插入图片描述
    在这里插入图片描述
    RPMB well known logical unit may be divided in multiple RPMB regions configuring the parameters described in the following.
    The total size of the RPMB well known logical unit is indicated by qLogicalBlockCount of RPMB Unit Descriptor. An attempt to configure the device setting the RPMB regions with total size that exceeds the value indicated by qLogicalBlockCount shall fail. An attempt to configure the device setting a RPMB Region with enable bit to one and size to zero shall fail. An attempt to configure the device setting a RPMB Region with enable bit to zero and size greater than zero shall fail.
    在这里插入图片描述
    在这里插入图片描述

http://www.ppmy.cn/news/575968.html

相关文章

AI+算力=最强龙头

AI与算力相辅相成 随着人工智能技术的飞速发展,“AI算力”的结合应用已成为科技行业的热点话题,甚至诞生出“AI算力最强龙头“的网络热门等式。该组合不仅可以提高计算效率,还可以为各行各业带来更强大的数据处理和分析能力,从而…

rust abc(3): 布尔和字符类型的使用并与C/C++对比

文章目录 1. 目的2. 布尔类型2.1 只能赋值为小写的 true, false2.2 不能把数字赋值给bool类型变量2.3 正确写法汇总 3. 字符类型3.1 UTF-8 编码3.2 字符的意思是单个字符,多个字符不能用单引号 4. 总结 1. 目的 继续熟悉 rust 语言的基本数据类型, 感受 rust 编译期…

刷机一直请求shsh_爱思助手刷机时提示请求SHSH失败的解决技巧

有那么一部份多朋友还不熟悉红米爱思助手怎么会刷机时提示请求SHSH失败的操作,下面小编就讲解爱思助手刷机时提示请求SHSH失败的解决技巧,希望对你们有所帮助哦。 爱思助手刷机时提示请求SHSH失败的解决技巧 问题:iPhoneXS Max系统想刷机到iO…

【MySQL实战】笔记

1、MySQL的基本架构组成 MySQL的基本架构组成包括以下几个部分: 连接器(Connection Manager):负责与客户端建立连接,并处理客户端发送的请求。连接器会验证客户端的身份、分配线程和缓存等资源,并将请求转…

基于前后端交互的论坛系统(课设高分必过)

目录 前言概述 一.前期准备 项目演示 用户注册 用户登录 主页面 发帖页面 个人信息及修改 用户主帖 站内信 需求分析 技术选型 二.建表分析 三.环境搭建 技术环境的检查与安装 检查JDK ​编辑 检查数据库 检查Maven 检查git ​编辑 项目启动的通用配置 新…

JAVA中XML读写

XML作为全球通用的结构化语言,越来越受人们青睐,各种开发平台(比如Microsoft Studio系列、Oracle系列、Inprise Borland系列等)也都把支持XML开发作为宣传口号之一 。由于笔者所从事的电子政务开发较早的引入了XML,所以尝到了许…

Python奇技淫巧

本文用作记录,在使用python过程中遇到的一些奇技淫巧,有些代码是本人所写,有些则是python内置函数,有些则取之互联网。在此记录,只为备份以及遗忘时方便查找。 本文将会持续更新,内容仅限记录一些常用好用却…

2-css-1

一 CSS 初体验 CSS 定义:层叠样式表 (Cascading Style Sheets,缩写为 CSS),是一种样式表语言,用来描述HTML文档的呈现(美化内容) CSS 书写在什么位置? title 标签下方哪个标签里面…