USB能接几个外设

USB能接几个外设
技术整理:landy 来源:国外权威芯片公司

一些使用多个Acroname的客户(品牌:首字母缩写产地:美国 集线器)USBHub3+集线器与我们共享,他们不能向其系统添加两个以上的USBHub3+集线器,或者他们的USB资源不足。碰巧,这不是USBHub3+本身的限制,而是主机USB控制器和主机实现USB控制器的限制。让我们深入潜水,了解这种限制来自何处:
USB规范在USB树拓扑中定义了两种不同的连接类型:层或层的数量和端点或功能的数量。请注意,端点与设备不同。
USB层
USB层源于集线器的使用,实际上,每个集线器都是自己的USB设备,也是新一层USB设备的开始。USB 2.0规范(第4.1.1节,图4-1)包括下图以说明USB拓扑。

在这里插入图片描述

主机和根集线器位于第一层,与集线器的连接将添加另一层。任何USB设备的层号都是连接链中非根集线器的数量加上2。USB规格限制为最多7层。因此,因为存在5个菊花链集线器的硬限制(不包括根集线器)。大多数主机系统只有一个集成在主机系统芯片组中的USB控制器。在这里,您可以看到一个典型的PC架构图。我们已展开该图以展开USB部分,显示USB A型连接器:
在这里插入图片描述

通常不知道的是,许多主机在内部使用集线器芯片来扩展可用USB连接器的数量。因此,主机上的USB接口可能已经在整个USB树中有一层甚至两层了:
在这里插入图片描述

因此,在使用内部集线器的主机上,菊花链连接外部集线器的能力降低。请记住,许多低成本USB扩展卡只是添加了一个内部集线器。
USB端点
每个USB设备最多可定义32个端点(16个输入和16个输出,但其中一个必须是控制端点),但大多数设备仅定义2或3个端点(例如数据输入、数据输出和控制端点)。集线器本身还至少定义一个控制端点。每个USB控制器实现都可能有自己的层或端点限制。大多数现代USB 3.0主机使用可扩展主机控制器接口(XHCI)USB控制器。XHCI规范允许使用大量7906 端点!但是,XHCI控制器的常见实现对端点总数施加了自己的限制,限制为96个。这些英特尔系列8体系结构中最臭名昭著的。这意味着使用3个端点可连接到Intel series 8 XHCI主机控制器的公共设备的最大数量实际上是96个端点/3个端点/每个设备=32个设备。这是基于Intel的XHCI控制器的已知限制:
communities.intel.com/thread/52417 - unfortunately Intel removed this thread
https://community.intel.com/t5/Embedded-Intel-Core-Processors/Hardware-limitations-on-USB-endpoints-XHCI/td-p/264556 - mentions a 64 endpoint limit
更糟糕的是,USB 3.0总线与USB 2.0设备存在着奇怪的双重存在。也就是说,它们与USB 2.0设备并行地生活在类似但独立的树结构中,但它们在XHCI控制器上共享相同的端点。USB 3.0设备可以在USB 3.0和2.0总线上实现端点。这甚至将进一步减少可连接到单个XHCI主机控制器的设备数量。
USB限制和 Acroname USBHub3+
在体系结构上,8端口USB集线器通过内部级联2端口和4端口USB集线器芯片来实现其8端口配置。每个集线器芯片都包含一个USB 2.0设备和一个USB 3.0设备。USBHub3+没有什么不同,我们可以在USBHub3+数据表中清楚地看到这种架构:
在这里插入图片描述

您现在可以看到,每个USBHub3+单元实际上由两个内部集线器层中的三个集线器芯片组成:一个层上的集线器A和第二层上的Hub1/Hub2。请记住,每个集线器芯片本身包含一个USB 2.0和一个USB 3.0设备,它们将添加到系统USB树中。给定这3个内部集线器芯片,每个USBHub3+在USB树中添加2层。每个集线器芯片定义一个控制端点,而脑干控制器本身又增加了3个端点,每个USBHub3+总共有9个端点。
回到上一个常见的基于Intel XHCI的主机系统示例,集成控制器最多支持96个端点。我们需要统计活动端点的总数(假设每个下游设备有3个端点-输入、输出、控制),以确定可以使用多少个USBHub3+集线器端口:
1 Acroname USBHub3+ (9 endpoints) + 8 Downstream Devices (8 x 3 = 24 endpoints) = 33 endpoints
如果连接3个完全填充的USBHub3+集线器,则99个端点将与24个典型USB设备一起使用。通过删除一个设备(总共23个),我们将减少到96个端点。然而,许多主机内部使用USB作为内置外围设备,包括网络摄像头、触摸屏和触摸板。因此,每个系统可以连接的外部设备的数量是不同的。
同样开始变得清晰的是,由于USBHub3+向USB树添加了2层,通过菊花链连接3个USBHub3+单元,您将超过系统中的最大USB层数。如果主机上的USB连接器已经由内部集线器扩展,则此数字可能会进一步受到影响。我们已经创建了一篇后续博客文章,其中包含一个建议的拓扑结构,以达到最大菊花链潜力。
SOLUTIONS
Those are the limitations… so what are the solutions?
Force your system to use EHCI instead of XHCI (Linux)
Thanks to Marc Merlins for pointing out the magic to force your system to use EHCI instead of XHCI. Unfortunately, this will limit all devices to USB 2.0 speeds.
More information on the limitations of Intel’s XHCI
More information on Linux driver
Force your system to use EHCI instead of XHCI (Windows)
Similar to the method above for Linux, Alexx999 made a tool to set BIOS flags to use the EHCI controller on Windows systems: Intel USB Controller Switcher
Use a USB 2.0 cable from your host to USBHub3+
If you need to add more than 18 total devices to your XHCI system and you do not need USB 3.0 performance, the simplest solution is to use a USB 2.0 host cable to connect your host to USBHub3+. Since the USBHub3+ is now connected only with USB 2.0, there will not be any enumeration of USB 3.0 devices, including the USB 3.0 hub chips internal to USBHub3+. This will effectively reduce the USBHub3+ footprint in your USB tree from 6 devices to 3 devices.
Add a discrete USB controller to your host
If you need to add substantially more USB devices to your host, the main limitation is likely the integrated Intel XHCI USB host controller. Discrete USB host controllers do not typically have this limitation. Adding a discrete USB host controller in a PCIe expansion slot is a great way to expand the total tree and number of devices available.
Remove unneeded internal devices
Find where and what devices are attached to your host controller:
https://www.intel.com/content/www/us/en/support/articles/000005622/software/chipset-software.html
Then disable ones you aren’t using such as Bluetooth, audio devices, finger print readers, cameras, etc.
Add new comment
What a great presentation!
Anonymous (not verified) on Thu, 2021-06-24 23:41
Thank you for this complete but clear explanation. So theoric limits of 127 and 255 devices for USB 2.0 and 3.0 USB host controllers respectively are a kind of dream that can never be achieved in any implementation. Unless you could attach all devices in the first tier! Cheers from France.
reply
Sort of possible…
Anonymous (not verified) on Fri, 2021-06-25 19:20
It is technically possible to hit 127 devices, but it is very very unlikely. Besides the tier limit, you also have the end point limit to contend with. Even worse, macOS has some other limitations which come into play when making a hackintosh.
reply
So adding a pci usb hub will
Anonymous (not verified) on Thu, 2021-09-30 16:45
So adding a pci usb hub will add end points ?
reply
Adding a PCIe USB expansion card
Anonymous (not verified) on Tue, 2021-10-05 10:39
Adding a PCIe expansion card may allow for more end points. At the least, an expansion card will not have all the built-in devices and hubbing that many computers come with. The firmware expansion card and drivers in the OS determine the number of end points available.

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值