> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 UFS 参数配置设备

设备树指定 UFS 主机配置参数，例如 gear 和 lane 的数量、rate 值以及超时值。

设备树位于 `<workspace_root_path>/boot_images/boot/Settings/Soc/Kodiak/Core/Storage/UFS/ufs.dtsi`。

对于 Dragonwing IQ-9075，请参见 `<workspace_root_path>/boot_images/boot/Setting/soc/LeMans/Core/Storage/UFS/ufs.dtsi`。

下表列出了 UEFI 中的一个 UFS 设备树节点示例。

| 设备树节点/键                 | 子节点                    | 设备树值     | 说明                                          |
| ----------------------- | ---------------------- | -------- | ------------------------------------------- |
| `init_speed_params`     | `EnableHighSpeed`      | 1        | 启用高速模式                                      |
| `init_speed_params`     | `NumGears`             | 4        | 指定要使用的最大 gear                               |
| `init_speed_params`     | `NumLanes`             | 2        | UFS 设备中使用的 lane 数量                          |
| `init_speed_params`     | `Rate`                 | 2        | 取值：1 = HS\_RATE\_A，2 = HS\_RATE\_B          |
| `perf_speed_params`     | `EnableHighSpeed`      | 1        | 在 perf 模式下启用高速模式                            |
| `perf_speed_params`     | `NumGears`             | 4        | 指定在 perf 模式下要使用的最大 gear                     |
| `perf_speed_params`     | `NumLanes`             | 2        | perf 模式下 UFS 设备中使用的 lane 数量                 |
| `perf_speed_params`     | `Rate`                 | 2        | perf 模式下的系列：1 = HS\_RATE\_A，2 = HS\_RATE\_B |
| `timeout_values`        | `fDeviceInitTimeoutUs` | 2500000  | 表示设备初始化期间的超时（µs）                            |
| `timeout_values`        | `UTRDPollTimeoutUs`    | 30000000 | 表示 UTRD 的超时（µs）                             |
| `BatteryThresholdMv`    | –                      | 3600     | 切换到 Gear1 的电池阈值（单位 mV）                      |
| `LinkStartupRetryCount` | –                      | 5        | Link 启动的重试次数                                |
| `FUA_Value`             | –                      | 1        | 强制单元访问                                      |
| `EnableLogging`         | –                      | 0        | 在 loader 中启用 DT 串口调试日志：1 = 启用，0 = 禁用        |
| `RefClock`              | –                      | 19200000 | UFS 设备控制器参考时钟 19.2 MHz                      |
| `MphyInitTable`         | –                      | –        | 表示 `MphyInit` 表                             |
| `MphyInitEndTable`      | –                      | –        | 表示 `MphyInitEnd` 表                          |
| `MphyLaneInitTable`     | –                      | –        | 表示 `Mphy` 2-lane 初始化表                       |

将 `.dtsi` 中的所有更改编译到 `xbl_config.elf`，并将镜像重新刷写到设备。

Qualcomm® 会针对 UFS 设备 PHY 初始化调优 `MphyInitTable`、`MphyInitEndTable` 和 `MphyLaneInitTable` 配置的值。若要调试和调优任何 PHY 级别的问题，请仅在 Qualcomm 的指导下更改这些配置值。

默认值适用于符合 UFS 设备 3.1 规范的器件。对于符合 UFS 设备 2.x 规范的器件，`NumGears` 值应为 3。不要更改 UFS 设备 2.x 器件的其他参数。
