# 修改 UFS 设备电源管理状态

要优化电源管理，请根据需要修改 UFS 设备电源管理状态。然而，改变状态可能会导致功耗发生变化。

Note

有关如何运行 SSH 的更多信息，请参见[使用 SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html) 一节。

UFS 设备电源管理状态

| 状态 | 说明 |
| --- | --- |
| Auto-hibern8 (AH8) | <ul><br><li><p>AH8 在 150 ms 空闲时间后自动将 PHY 链路转换为 Hibernate 状态。该值是可调的。</p></li><br><li><p>要确定 AH8 空闲持续时间值（以微秒为单位），请在主机上运行以下 SSH 命令。</p><br><div class="nohighlight docutils container"><br><div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>cat /sys/devices/platform/soc@0/1d84000.ufs/auto_hibern8<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></div><br></li><br><li><p>可以减小此值以降低功耗。</p></li><br></ul> |
| 时钟门控 | <ul><br><li><p>当 UFS 设备时钟由于用例而增加到最大频率时，时钟门控会在 50 ms 的空闲时间后进行。</p></li><br><li><p>如果时钟降低到最佳频率，时钟门控会在 10 ms 的空闲时间后进行。要检查时钟门控的启用/禁用状态，在主机计算机上运行以下 SSH 命令：</p><br><div class="nohighlight docutils container"><br><div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>cat /sys/devices/platform/soc@0/1d84000.ufs/clkgate_enable<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></div><br></li><br><li><p>默认情况下启用时钟门控。</p></li><br><li><p>要调试与时钟门控或解控相关的 UFS 设备问题并禁用时钟门控，请在主机上运行以下 SSH 命令。</p><br><blockquote><br><div><div class="nohighlight docutils container"><br><div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>echo 0 &gt; /sys/devices/platform/soc@0/1d84000.ufs/clkgate_enable<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></div><br></div></blockquote><br></li><br></ul> |
| 时钟缩放 | <ul><br><li><p>在 UFS 设备负载超过上阈值时，时钟频率设置为时钟增加后的最大频率。</p></li><br><li><p>当负载低于阈值时，会发生时钟降低。UFS 设备操作决定其负载情况。要检查时钟缩放状态，请在主机上运行以下 SSH 命令。</p><br><blockquote><br><div><div class="nohighlight docutils container"><br><div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>cat /sys/devices/platform/soc@0/1d84000.ufs/clkscale_enable<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></div><br></div></blockquote><br></li><br><li><p>默认情况下启用时钟缩放。</p></li><br><li><p>禁用时钟缩放可能会导致功耗增加。请在主机上运行以下 SSH 命令，以便调试与时钟缩放相关的任何问题。</p><br><div class="nohighlight docutils container"><br><div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>echo 0 &gt; /sys/devices/platform/soc@0/1d84000.ufs/clkscale_enable<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></div><br></li><br></ul> |
| Runtime suspend 或 resume | <ul class="simple"><br><li><p>3 秒钟不活动后，UFS 设备将进入 runtime suspend 状态。</p></li><br><li><p>Runtime resume 状态在下一个 UFS 设备操作时发生。该状态默认启用且不可配置。</p></li><br></ul> |
| 系统 suspend 或 resume | <ul class="simple"><br><li><p>UFS 设备通过 suspend 事件进入系统 suspend 状态。</p></li><br><li><p>UFS 设备 resume 状态随系统 resume 事件发生。</p></li><br><li><p>该状态默认启用且不可配置。</p></li><br></ul> |

# 修改 SD 卡电源管理状态

将标题更新为 SDHC，以统一 SD 卡和 eMMC 的表。

SD 卡电源管理状态

| 状态 | 说明 |
| --- | --- |
| Runtime suspend 或 resume | <ul class="simple"><br><li><p>SD 卡在 50 ms 不活动后进入 runtime suspend 状态。</p></li><br><li><p>下一次 SD 卡操作时会 resume。该状态默认启用且不可配置。</p></li><br><li><p>eMMC 在 50 毫秒无活动后进入 runtime suspend 状态。在下一次 I/O 操作时恢复。此功能始终启用，无法配置。</p></li><br></ul> |
| 系统 suspend 或 resume | <ul class="simple"><br><li><p>SD 卡通过 suspend 事件进入系统 suspend 状态。</p></li><br><li><p>SD 卡系统 resume 状态随系统 resume 事件发生。</p></li><br><li><p>该状态默认启用且不可配置。</p></li><br><li><p>eMMC 在接收到 suspend 事件时进入系统 suspend 模式，并在系统 resume 事件时恢复运行。此功能始终启用，无法配置。</p></li><br></ul> |

Last Published: Jul 23, 2025

[Previous Topic
使用内核配置启用 SDHCI](https://docs.qualcomm.com/bundle/publicresource/80-70020-6SC/topics/ufs-kernel-configuration.md) [Next Topic
使用 UFS 参数配置设备](https://docs.qualcomm.com/bundle/publicresource/80-70020-6SC/topics/bootloader-uefi-device-tree.md)