Please report all spam threads, posts and suspicious members. We receive spam notifications and will take immediate action!
Results 1 to 8 of 8

Thread: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers




  1. #1
    Join Date
    Jan 2015
    Location
    N/A
    Posts
    12

    Question ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    I am having a bit of a frustrating problem related to USB on the ASRock X99 Extreme4 motherboard across both internal USB headers and external USB ports. I suspect this is the same across all of the ASRock Extreme series. In my case, attaching a USB device through virtualbox is what really brought this to my attention because I could only get devices to properly connect (and stay connected without errors) to the guest when connected through a USB 1.1 hub (IOGear GUH174), but then speed suffered substantially as a result. I also experienced various device compatibility issues which worked without issue on my older system (and work when I disable USB 3.0).

    When I purchased this motherboard, I expected the USB 2.0 (black) ports to be connected to the EHCI USB host controller when USB 3.0 for the blue ports is enabled. Unfortunately, it seems that when USB 3.0 is enabled, ALL ports are connected to the xHCI host controller and when it is disabled, ALL ports are connected to the EHCI host controller and I only get 30MBps transfer speeds on USB 3.0 devices as a result. Both the EHCI and xHCI controllers are available as devices when USB 3.0 is enabled, but no USB ports get attached through the EHCI controller. When USB 2.0 is enabled, the xHCI device is no longer present.

    Is it technically possible to tweak the UEFI settings such that the USB 2.0 (black) ports are connected to the EHCI host controller at the same time that the USB 3.0 ports (blue) are connected to the xHCI host controller for both backward-compatibility and performance? I tried varying a few things, but trying out every combination would be a chore. If this is not possible through the existing UEFI setting combinations, is this something that ASRock would have to change in the firmware to support and is it even possible at the chipset level to support something like this? I guess I would have to open a troubleshooting ticket to submit a request like this if the settings don't already support something like this.

    UEFI: USB 3.0 Disabled
    All USB ports (3.0 + 2.0) are mapped through the C610/X99 chipset EHCI host controller.

    UEFI: USB 3.0 Enabled
    All USB ports (3.0 + 2.0) are mapped through the Intel USB 3.0 extensible host controller (xHCI).

    To check this in windows 7/8/8.1, open up device manager and select View | Devices by Connection. In my case (8.1), the host controller is under ACPI x64-based PC | Microsoft ACPI-compliant system | PCI Express Root Complex.
    Reference Intel post about how to check: Intel® USB 3.0 eXtensible Host Controller Driver — How to Check Connected USB 3.0 Devices Status?

    Side note: it would also be nice to have some more detail of what the different USB options actually change under the covers in some posts or supporting documentation. Smart Auto vs Auto vs Enabled? USB Compatibility Patch?

  2. #2
    parsec's Avatar
    parsec is offline Senior Member
    Join Date
    Jun 2012
    Location
    Third stone from the sun
    Posts
    4,824

    Default Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    I've noticed what you described about the USB 3.0 and 2.0 ports being provided by the XHCI controller exclusively, with USB 3.0 enabled, but never thought much about it, until now.

    I found the following in the Intel X99 chipset datasheet. Other recent Intel chipsets like the Z97 are in general identical to this:

    ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers-x99-usb-specs-png

    The X99 chipset datasheet can be found here: Intel® X99 Chipset Platform Controller Hub Datasheet

    We get USB 3.0 ports only from the xHCI controller, which are apparently configured from multiple USB 2.0 data lanes. But the other surprise (to me) is the xHXI controller provides USB 2.0 support as well as 3.0 support simultaneously. It is also the default USB controller for X99 and other Intel chipsets.

    We also see that the EHCI controller only supports USB 2.0, which explains why USB 3.0 is lost when the EHCI controllers are active, the xHCI controller is disabled.

    I included in the picture the heading for Flexible IO, which allows configuration of PCIe lanes for various purposes. I didn't check that section for possibility of other USB 3.0 configurations.

    It seems that ASRock cannot be blamed for the general USB 3.0 and USB 2.0 configuration on their X99 and other boards. It is based upon what the chipset provides. Your question remains, can the EHCI controller be used simultaneously with the xHCI controller?

    The connections of the controllers themselves to the mother board may be the limitation. The switching between the EHCI and xHCI controllers may be internal to the chipset, and limited to one or the other. Using both controllers simultaneously may use more PCIe lanes than are available, the others allocated to SATA ports, etc. A shortage of PCIe lanes should not be an issue with an X99 chipset. The answer may be in the datasheet.

    Do I know of a BIOS option combination that will provide what you want? Nope.

    Would I like a better (anything would be better than what we get now) description of what the USB BIOS options do? Yep.

  3. #3
    Join Date
    May 2011
    Location
    Rudehen, Tehran, Iran
    Posts
    302

    Default Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    Quote Originally Posted by at34335 View Post
    Is it technically possible to tweak the UEFI settings such that the USB 2.0 (black) ports are connected to the EHCI host controller at the same time that the USB 3.0 ports (blue) are connected to the xHCI host controller for both backward-compatibility and performance? I tried varying a few things, but trying out every combination would be a chore. If this is not possible through the existing UEFI setting combinations, is this something that ASRock would have to change in the firmware to support and is it even possible at the chipset level to support something like this? I guess I would have to open a troubleshooting ticket to submit a request like this if the settings don't already support something like this.
    Sorry, I didn't understand! When a USB3.0 port automatically works at USB2.0 speed when such device is connected, why do you disable XHCI and select EHCI? Which incompatibility do you suffer from?

    Can an add-in USB2.0 card help? (e.g. on the 1x slot)

  4. #4
    Join Date
    Jan 2015
    Location
    N/A
    Posts
    12

    Default Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    That was a great idea and reference, parsec. I dug through the datasheet and found some interesting references which ultimately lead me to believe that this can be supported. Looking at the datasheet, the USB ports are 'routable' between the EHCI and xHCI controllers and they can be managed by the port disable mask (USB2PDO,USB3PDO) or port routing masks (USB3PRM ~17.1.39 in the datasheet). This support led me to believe that this is a UEFI limitation. Later, I discovered a comment by Intel (link below) saying that it is up to the motherboard manufacturer to support this hand-off and which controller manages the connection.

    I've also discovered much clearer descriptions of the smart auto/auto/enabled/disabled modes and how they pertain to the xHCI/EHCI hand-off options (see various links below, though the gigabyte manual is probably decent enough now that I have a better understanding of it based on the datasheet).

    Essentially, it seems that the xHCI controller should detect if it is a USB 3 or 2 device and then attach/route it to the correct controller. Unfortunately, it looks like the ASRock UEFI implementation is choosing to always route the ports to the xHCI controller (at least I haven't found the option to change this behavior). Smart Auto vs Auto vs Enabled seem to change how that USB 3 device detection takes place and persists across reboots and cold starts.

    I was able to do some more research based on that knowledge and discovered that the Gigabyte X99 UD4 motherboard has a XHCI MANUAL option along with much clearer options ("XHCI hand-off", "EHCI hand-off"). The MANUAL option seems to allow you to force the mode/route on a port by port basis, though I can't confirm this since I don't have that motherboard.

    I did try to mess with my configuration a little bit and was happy that I had a PS/2 keyboard sitting around when I accidentally disabled pre-boot USB support for the keyboard! Nothing conclusive yet, though. I am running the recently released P1.72 firmware.

    Another side note in case this helps somebody. I received five beeps at boot up when the USB keyboard wasn't detected. Once I connected the PS/2 keyboard or fixed the USB settings, the beeps went away. Everything still worked, it just gave me a no keyboard detected beep sequence before booting up.

    Reference Dump:(Gigabyte X99 UD4 Manual - PDF Page 62: XHCI Mode)
    GIGABYTE - Motherboard - Socket 2011-3 - GA-X99-UD4 (rev. 1.0)
    USB 3.0 on Gigabyte UEFI Motherboards- XHCI Mode Explained - Page 2
    https://communities.intel.com/message/259397#259397
    https://communities.intel.com/message/239511#239511
    How to set up the UEFI of your Hackintosh's Gigabyte motherboard
    https://gitorious.org/opensuse/kerne...04c7dccb448684
    USB 3.0 driver issue on Haswell Laptop

  5. #5
    Join Date
    Jan 2015
    Location
    N/A
    Posts
    12

    Default Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    I have experienced a lot of instability with the USB 2 devices (device terminated the connection) and lack of proper negotiation at USB 3 speed (drops back to USB 2 after a long negotiation period) in addition to the virtualbox xHCI compatibility issues.

    An add-in card would work if I have to resort to it, but that just seems unnecessary when this board has 4 internal ports + 4 external ports and the chipset should support it based on my research.

  6. #6
    parsec's Avatar
    parsec is offline Senior Member
    Join Date
    Jun 2012
    Location
    Third stone from the sun
    Posts
    4,824

    Default Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    You found some great links/info yourself. I'm grateful you got me into this situation. A few quick points before I dive into this some more and see what I find.

    It seems ASRock is not the only one that uses the USB controller configuration we have on our boards, such as the Asus Z97 board in the Intel forum post you posted the link to above.

    I hope you are using USBView, used in the Intel forum post I just mentioned to show the information about the USB controllers. Don't bother getting it from MS, they make it a pain, I got it from Softpedia in a 37K zip file.

    The options in the Gigabyte UEFI you mentioned remind me of my main problem with ASRock boards, their UEFI options are minimal and simplified in many instances. The options you mentioned are simply not found in our board's UEFI, or are named something that makes less sense than the actual name.

    Personally, this USB situation is not an issue for me, except for what I wrote just above. At least not an issue yet.

  7. #7
    tomhet is offline Junior Member
    Join Date
    Jul 2017
    Location
    Bg
    Posts
    1

    Default Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    Last week I bought a web camera and needed to pass it to some virtual machine in QubesOS, so I got in the situation described by at34335.
    Looking at the datasheet, the USB ports are 'routable' between the EHCI and xHCI controllers and they can be managed by the port disable mask (USB2PDO,USB3PDO) or port routing masks (USB3PRM ~17.1.39 in the datasheet).
    You almost found the solution. It is described here.

    Below I put some pieces, as backup, if above page page goes down.

    - Table 2.2 of specification (page 16 / 55 of pdf) shows usb port numbers in EHCI and xHCI controlers, which is useful, as we know whether concrete USB2 port will to EHCI #1 or #2 when not on xHCI.
    It also shows that usb3.0 ports cannot be mapped to EHCI controller at all (which seems contrary to described in this thread?)

    - Actual port routing happens via word register at D0h ( 17.1.36 XUSB2PR —xHC USB 2. 0 Port Routing Register (USB xHCI—D20:F0)).
    We set bitmask (0: port goes to EHCI, 1: to xHCI). USB2 ports are 14 in number, EHCI #1 have 8 ports and takes 1st byte. Next 6 bits are for EHCI #2 ports are last 2 bits are zeros.
    - Port routing is always done on xHCI pci device (address 00:14.0)
    - Setting register is done via setpci. You need to just prepare bitmask of which usb ports should be left on xHCI.

    For example, to move everything to the EHCI controllers:
    # setpci -s0:14.0 0xd0.W=0x0000

    And to move everything back to the xHCI controller:
    # setpci -s0:14.0 0xd0.W=0x3fff
    You can watch it realtime
    Code:
    watch -n 1 lsusb -t
    - Mentioned XUSB2PRM register at D4h shows BIOS's opinion of which ports *can* be routed via register D0h.
    Here we see that BIOS won't forbid me routing any port:
    Code:
    $ sudo setpci -v -s0:14 0xD4.W
    0000:00:14.0 @d4 = 7fff
    USB 2.0 Host Controller Selector Mask (USB2HCSELM) — R/WL.
    This bit field allows the BIOS
    to communicate to the OS which PCH USB 2.0 ports can be switched from the EHC controller to the xHC controller.
    When set to 1, the OS may switch the PCH USB 2.0 port between the EHCI and xHCI host controllers by modifying the corresponding USB2HCSEL bit (D20:F0:D0h, bit 3:0).
    When set to 0, The OS shall not modify the corresponding USB2HCSEL bit.
    - Next register D8 allows you to toggle USB3 on/off on per-port basis.
    You should not forget to see if BIOS would allow that in register DC.

  8. #8
    Join Date
    Oct 2017
    Location
    UA
    Posts
    1

    Cool Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

    Just in case someone has same issue and has no idea what "setpci" is - I've created Windows utility that is able to switch ports to EHCI during system startup using same method as described here.

    GitHub - Alexx999/IntelUsbSwitcher

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •