USB 3.0 Rx Detect之超速U盘的识别

1 USB超速SerDes原理介绍
1.1 SerDes Rx.Detect
SerDes Rx.Detect的原理比较简单,就是通过一个逻辑电路比较RC时间常数的大小。
- 当Rx不存在时,RC时间常数较小。
- 当Rx存在时,RC时间常数较大。
下面将详细描述其原理。
Figure 1-1 USB 3.0电缆

Center
USB 3.0的接口比USB 2.0接口多了5根线,这5根线分别是Shield、SSRX+/-和SSTX+/-,即是屏蔽地、超速发送差分对和接收差分对。因此一个支持USB 3.0的U盘插到电脑上我们有必要搞清楚是D+/D-传递数据还是SSRX+/-和SSTX+/-传递数据。
Figure 1-2 超速引脚

Center

Figure 1-2中USB主机和设备通过电缆连接后,会在USB主机和设备端的Receiver SSRX+/-上产生一个等效下拉电阻R_Term(其范围在18-30欧姆,由SSRX+/-上各一个50欧姆的等效下拉电阻并联而成)。
Figure 1-3 等效下拉电阻R_Term

Center

设备连接前的充放电时间常数T = R_Detect * C_Parasitic
设备连接后的充放电时间常数T = (R_Detect + R_Term) * (C_AC + C_Parasitic)
Probe SSTX+, you can see the 500mV Rx.Detect pulse without connecting device, its period is 13.75ms (72Hz), pulse width is less than 40us.

1.2 Redriver Rx.Detect
If Redriver detects receiver on its transmitter, then it assumes there is a valid termination. In this case, Redriver turns on its own Rx 50-ohm termination, this signals the xHCI to start Rx.Detect. Redriver does not include LTSSM, but Retimer includes LTSSM.

1.3 Electrical Idle
Electrical Idle means the differential voltage applied to the link is 0mV (no signaling). If there is 0mV differential, then the Rx cannot recover a clock and bit/symbol lock is lost.
In Logical Idle the Rx maintains bit/symbol lock because the Tx will send IDLE symbols. The IDLE symbols do not contain data and are thrown away by the Rx.

1.4 APL xHCI LTSSM stuck issue
not warm reset yet, waiting 200ms
not enabled, trying warm reset again

This log shows ss port stuck issue.
Disable USB3 roothub port: Clear power Feature and Set BH_Reset Feature.
In Hex format.
23 01 0008 port1 0000
23 03 001c port1 0000
Disable USB3 non roothub port: Set Rx.disabled Feature.
​​​​​​​In Hex format.
23 03 0005 0400|port1 0000
Add # define DEBUG at the first line of the hub.c file (above the header files) for enabling Linux dynamic debug log.

2 PIPE PHY数据线宽度
DWC_usb3_databook_2.50a.pdf
USB3 PIPE PHY的数据线宽度是可以设置的,最大宽度分别是Tx 32bit、Rx 32bit,需要根据PIPE PHY的接口频率来设置数据线宽度。如果PIPE PHY运行在128MHz,那么Tx和Rx的数据线宽度都是32bit;如果PIPE PHY运行在256MHz,那么Tx和Rx的数据线宽度都是16bit。

USB3 Gen1的速度5Gbps,是指Tx和Rx的速率都是5Gbps(128MHz x 4bytes或者256MHz x 2bytes)。
USB 3.0 Tx或者Rx的传输速率虽然是5Gbps,但实际上数字信号的方波频率是2.5GHz(传输2个bit对应一个方波)。

Intel APL (Gen9, A39X0) 8-port MPH xHCI的物理层名字是ModPHY(High Speed I/O Modular Physical Layer for Intel USB 3.0)。

3 xHCI PORTSC端口状态控制寄存器
drivers/usb/host/xhci-hub.c 
xhci_get_ports()

4 USB Bulk传输速度计算
- Full-speed
每个frame最大可以传输19个Bulk包,每个Bulk包最大是64 Bytes,所以其最大传输速率是:19 x 64 x 1000 = 1.16 MB/s。
- High-speed
USB 2.0在每个微帧中最大可传输13个Bulk包,每个Bulk包最大是512 Bytes,而每个微帧长固定为125 μs,所以其最大传输速率为:13 x 512 x 8 x 1000 = 51 MB/s。
- Super-speed
USB 3.0在每个微帧中最大可传输13个Bulk包,每个Bulk包最大是1024 Bytes,而每个微帧长固定为125 μs,所以其最大传输速率为:13 x 1024 x 8 x 1000 = 102 MB/s。

5 Standalone SerDes
Freescale MC92610
STM C65SPACE-HSSL SerDes, HSSL stands for High Speed Serial Link

6 Abbreviations
ARC:Argonant RISC Core
AT91SAM9260:SAM means Smart ARM-based Microcontroller
ATMEL SAMBA:ATMEL Smart ARM-based Microcontroller Boot Assistant
bdi:Linux backing device info
HUB3CV:USB 3 Hub Command Verifier Ver. 2.1.12.1
ISP1161:Philips' Integrated host Solution Pairs 1161,“Firms introduce USB host controllers”,https://www.eetimes.com/document.asp?doc_id=1290054
MPH:USB Multi-Port Host,Intel APL 8-port MPH xHCI的Port1作为OTG使用,和DWC3(仅作为slave)使用一个MUX开关来控制Host还是UDC连接到该Port1
SL811HS:Cypress/ScanLogic 811 Host/Slave,性能上与ISP1161(Integrated host Solution Pairs 1161)相当
SPH:USB Single-Port Host
TDI:TransDimension Inc.,该公司首先发明了将TT集成到EHCI RootHub中的方法,这样对于嵌入式系统来说,就省去了OHCI/UHCI的硬件,同时降低了成本,作为对该公司的纪念,Linux内核定义了宏ehci_is_TDI(ehci);产品UHC124表示USB Host Controller;收购了ARC USB技术;现已被chipidea收购,chipidea又被mips收购
TT:Transaction Translator(事务转换器,将USB2.0的包转换成USB1.1的包)
TUR:Test Unit Ready,sd_spinup_disk()执行该命令,底层排队函数usb_stor_host_template.queuecommand()和ufshcd_queuecommand()
USB BH reset:Bigger Hammer or Brad Hosler,表示warm reset;you may be confused why the USB 3.0 spec calls the same type of reset "warm reset" in some places and "BH reset" in other places. "BH" reset is supposed to stand for "Big Hammer" reset, but it also stands for "Brad Hosler". Brad died shortly after the USB 3.0 bus specification was started, and they decided to name the reset after him. The suggestion was made shortly before the spec was finalized, so the wording is a bit inconsistent.
xECP:xHCI Extended Capabilities Pointer

  • 3
    点赞
  • 80
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
USB detect是指计算机或设备检测到USB接口连接的动作。当插入USB设备时,计算机会自动检测到设备的连接并进行相关操作。 首先,当USB设备插入计算机的USB接口时,接口会立即发送信号给计算机的操作系统,告知有新的设备连接。 操作系统会根据设备的类型和属性来做出相应的反应。如果该设备是一个存储设备,操作系统会分配一个驱动器号码,并在文件资源管理器中显示出该驱动器。用户可以通过这个驱动器进行文件的读取和写入操作。 如果设备是一个输入设备,例如键盘或鼠标,操作系统会检测到这些输入设备并使其可用。用户可以通过键盘输入字符或通过鼠标点击进行操作。 除了存储设备和输入设备,其他类型的USB设备,如打印机、摄像头、音频设备等也会被检测到。根据设备类型的不同,操作系统会加载相应的驱动程序来管理设备的功能。 另外,操作系统还会为每个设备分配一个设备号码,以便在需要的时候能够与设备进行通信。 当设备拔出时,操作系统会检测到设备的断开,并相应地进行处理。存储设备的驱动器号码会被移除,输入设备会被禁用,其他设备会被停止运行并从系统中移除。 总而言之,USB detect是计算机检测到USB设备连接或断开的过程。操作系统会根据设备的类型和属性来对设备进行相应的处理和管理,使得用户可以方便地使用USB设备。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值