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

# 使用 UFS 参数配置设备

设备树指定 UFS 主机配置参数，例如挡位（gear）和通道数量、速率值和超时值。

设备树位于 `<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 | 指定要使用的最大挡位 |
| `init_speed_params` | `NumLanes` | 2 | UFS 设备使用的通道数量 |
| `init_speed_params` | `Rate` | 2 | 取值为：1 = HS\_RATE\_A，2 = HS\_RATE\_B |
| `perf_speed_params` | `EnableHighSpeed` | 1 | 在性能模式下启用高速模式 |
| `perf_speed_params` | `NumGears` | 4 | 指定性能模式下要使用的最大挡位 |
| `perf_speed_params` | `NumLanes` | 2 | 性能模式下 UFS 设备使用的通道数量 |
| `perf_speed_params` | `Rate` | 2 | 性能模式下的系列：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 | 链路启动的重试次数 |
| `FUA_Value` | – | 1 | 强制单元访问 |
| `EnableLogging` | – | 0 | 在加载器中启用 DT 串口调试日志：1 = 启用，0 = 禁用 |
| `RefClock` | – | 19200000 | UFS 设备控制器参考时钟 19.2 MHz |
| `MphyInitTable` | – | – | 表示 `MphyInit` 表 |
| `MphyInitEndTable` | – | – | 表示 `MphyInitEnd` 表 |
| `MphyLaneInitTable` | – | – | 表示 `Mphy` 2 通道初始化表 |

将 `.dtsi` 中的所有更改编译到 `xbl_config.elf`，然后将镜像重新烧录到设备。

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

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