Embedded Intel® Core™ Processors
Communicate Intel® Core™ Hardware, Software, Firmware, Graphics Concerns
1208 Discussions

Can I limit xHCI capabilities to only offer up to USB 5Gbps (3.1 Gen 1) from (linux) kernel space?

_actate
Beginner
600 Views

I have a question broadly concerning the xHCI driver but specifically concerning speed negotiation across different USB (3.1|3.2) generations.

Question in a nutshell:
Is there a way to modify (or quirk) the xHCI kernel driver such that I can limit the maximum offered host capability to be USB 5Gbps (3.2 Gen 1x1 | 3.1 Gen1) ?

My specific situation:
* Embedded device running (PREEMPT_RT patched) Linux 4.19
* Intel i7-8665UE which has a 300 series PCH which supports USB 3.2 Gen 2x1 (3.1 Gen 2) (i.e. 10Gbps)
* Hardware & physical port on the device is only rated to USB 3.2 Gen 1x1 (3.1 Gen 1) (i.e. 5Gbps)

In this situation inserting a 10gbps capable device will (usually) cause complete havoc with lots of device dropouts/resets and usually an xHCI controller reset. Connecting the same device with a 5Gbs hub shows no issues nor does connecting devices with only 5Gbps capability.

Since this is an embedded device (infrequently networked, portable, ~800+ in the wild) it is not trivial to recall & fix the hardware issue (flow on effects concerning EMC & IP ratings)

I believe my solution lies in the xHCI xECP implementation (Capability ID, Section 7 in the xHCI spec), specifically the Protocol Speed ID::Link Protocol field. It looks like this is the root of truth for whether a port can perform at SuperSpeed or SuperSpeedPlus. I would want to limit to SuperSpeed only but this field is RO.

If I look to modify `xhci_create_usb3_bos_desc` inside the kernel am I on the right track or is this a fools errand and the speed negotiation happens without kernel involvement?

0 Kudos
7 Replies
CarlosAM_INTEL
Moderator
582 Views

Hello,  @_actate:

Thank you for contacting Intel Embedded Community.

We received your request, but we want to address the following questions:

What is the Linux Operating System (OS) related to the reported situation?

Could you please confirm if the device related to this situation has been designed by you or a third-party developer? In case it is a third-party device, please let us know the name of the manufacturer and the part number of the device.

Where do you purchase the device related to the reported situation?

We are waiting for your answer to these questions.

Best regards,

@CarlosAM_INTEL.

0 Kudos
_actate
Beginner
557 Views

We use a modified version of Ubuntu Server LTS (running a modified 4.19 series Linux kernel).

This is an entirely in-house developed embedded machine using the intel i7-8665UE (which as far as I understand has a 300 series PCH onboard). We have a relatively generic AMI BIOS on it (provided by our SOM board manufacturer).

For various security reasons we are unable to modify BIOS parameters for already-released devices (the configuration forms part of the root of trust for a secure boot implementation). However we are able to modify our linux commandline arguments, any parts of our kernel and any userspace actions necessary.

 

I am aware we can entirely disable xhci and use ehci however that limits us to USB 2.0 speeds - it would be ideal if we could limit the xhci capabilities to only offer up to USB 3.1 Gen 1 (i.e USB 5Gbps)

0 Kudos
CarlosAM_INTEL
Moderator
541 Views

Hello,  @_actate:

Thanks for your clarification.

Your driver consultations are related to Ubuntu OS, you should address your questions through the channel stated on the following website:

https://askubuntu.com/

Best regards,

@CarlosAM_INTEL.

0 Kudos
_actate
Beginner
531 Views

It is not an Ubuntu question;

I am asking very specifically about the Intel xHCI controller on the PCH; the running software is irrelevant.

Is it possible to configure the Intel xHCI controller to limit its maximum offered capabilities?
This may be an XHCI standards question in disguise; which is still an Intel question as far as I can tell.

Right now the xHCI controller seems to tell things that it can do the following speeds [480, 5000, 10000] and I want to limit that set to [480, 5000] as the USB protocol doesn't gracefully down-grade speeds in the case of a non-compliant transport.

I believe it may be related to the PSIC register (7.2.2.1.2 here: https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf ) but I'm not familiar enough with the xHCI specification as to whether this can be manipulated for a given controller or not.



Shorter version; Internal physical connections do not support USB 10Gbps but the xHCI doesn't know this and happily explodes trying to do USB 10Gbps. How can I tell the xHCI to only go up to USB 5Gbps? Updating these internal physical connections is not possible in this case.

0 Kudos
CarlosAM_INTEL
Moderator
491 Views

Hello,  @_actate:

Thanks for your reply, but they are still some information that you did not provide to answer completely our first message. 

Due to this, we need to address the following consultation to understand the situation:

What is the place of purchase of the Intel® Core™ i7-8665UE Processors related to your request?

We are waiting for your reply.

Best regards,

@CarlosAM_INTEL.

0 Kudos
_actate
Beginner
420 Views

We purchase the processor as a SOM from a manufacturer I'm not able to disclose. We then build this into a more complex platform but the implementation is a typical IBM PC compatible format.

By digging into the kernel I have found a workable solution but I'd be interested if there's anyone with specific xHCI knowledge that would let me know if this is a bad idea.

I have prevented the xHCI from offering USB 10Gbps speeds in kernel 4.19 by preventing increases to the `bNumDeviceCaps` field in the usb_bos_descriptor (i.e. usb_bos_descriptor[4] == 1). To my understanding this effectively allows the hardware to enumerate as per usual in USB 3.1 mode (the maximum supported by kernel 4.19) but prevents it from offering any capabilities beyond "USB SuperSpeed" which is now called USB 5Gbps.

0 Kudos
CarlosAM_INTEL
Moderator
394 Views

Hello,  @_actate:

 

Thanks for your reply.

 

The information that may help you should be verified by the SOM manufacturer and is accessible when your account is an Intel Developer Zone Premier account. Due to this, you should update it by filling out the form stated on the following website:

 

https://www.intel.com/content/www/us/en/forms/support/my-intel-sign-on-support.html  

 

Your business email address is needed to avoid any inconvenience. The free email provider's address (such as the one provided by Hotmail, Gmail, Yahoo, or others) is not the proper one for this process. This information and more details can be found on the following website:

 

https://www.intel.com/content/www/us/en/support/articles/000058073/programs/resource-and-documentation-center.html

 

Best regards,

@CarlosAM_INTEL.

0 Kudos
Reply