linux - 链路电源管理中的 L2 状态

标签 linux usb power-management suspend

我有一项任务需要在链路电源管理中实现 L2 挂起状态。我使用的开发板具有与 PHY 接口(interface)的 DWC3 usb Controller 。基本上我们的板子使用 Linux usb DWC3 驱动程序并连接到主机。

我的理解是 USB Controller 在总线不活动 3.125 毫秒后生成 SUSPEND 信号。 谁能告诉我如何配置此 Controller 以实现 L2 挂起状态?

最佳答案

在您当前的设置中,您的开发板处于设备/小工具模式并且您已连接到主机。 请记住,USB 设备无法驱动挂起信号。它应该由 Host 启动。

USB 2.0设备suspend的过程-

1 - USB host has no data to send and currently its sending SOF frames
2 - Host SW suspends the device by setting suspend/U3 in EHCI/XHCI controller
3 - Now the USB device sees idle state in the bus where there is no SOF
4 - After approx 3 ms, the device hardware starts to suspend itself by removing its termination to the ground and connecting the internal pull up register
5 - Then the device again poll the lines to see whether the host has removed its termination or not.
6 - Since host has removed the termination, the device will go to suspend

USB 3.0 设备挂起过程 -

1 - USB host has no data to send
2 - Host SW suspends the device by setting U3 in XHCI controller
3 - Host starts sending LGO_U3 link commands to initiate the suspend signalling
4 - After device receives LGO_U3 command, it will acknowledge and start suspend

总而言之,您无法从 USB 设备启动挂起信号。您只能设置设备堆栈的内部状态。

编辑 1 - 此挂起过程适用于 USB 2.0/高速设备。如果您的开发板是通过 SS 端口连接到主机的超高速/USB 3.0 设备,那么链接级别的过程会略有不同,但从用户的角度来看没有区别。
编辑 2 - 我现在已经用 USB 2.0 和 USB 3.0 设备的挂起过程更新了答案

关于linux - 链路电源管理中的 L2 状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45026962/

相关文章:

python - 从文件夹中的现有 jar 创建类路径

c - 当数据从套接字传入时如何将数据打印到终端

linux - 仅查找从当前目录开始且设置了 setuid 位的文件

linux - 我想在没有硬件的情况下运行基于 Linux 的设备应用程序

linux - Linux 中的信号量和共享内存

java - Android USB 转串口接收错误

android - Android 手机中的 USB 主机或串行功能

android - 如何找出Android设备中每个应用程序的电池消耗

c# - 如何拦截 Windows 中物理电源按钮的按下?

Windows Phone 7 中的性能监控(电源和 FPS)