Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:

    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
    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:

    Click image for larger version

Name:	x99 usb specs.PNG
Views:	1
Size:	53.0 KB
ID:	754896

    The X99 chipset datasheet can be found here:

    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.

    Comment


    • #3
      Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

      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)

      Comment


      • #4
        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


        How to set up the UEFI of your Hackintosh's Gigabyte motherboard

        USB 3.0 driver issue on Haswell Laptop

        Comment


        • #5
          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.

          Comment


          • #6
            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.

            Comment


            • #7
              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
              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) 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.

              Comment


              • #8
                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

                Comment


                • #9
                  Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

                  Dear Alexx999,

                  Your app look interesting, but I install it and nothing happen (work on windows 7 x64, .net4.6 already installed on my system, and Smart Auto active in BIOS)

                  I am quite happy to find your page guys, you find lot of informations, but I don't know how to use them.
                  I spend hours on my usb2 problem. All my USB2 devices are not read by usb3 port on my Asrock X99 extreme6.
                  I see that setpci command exist for windows here: PCI Utilities (lspci, setpci) for Windows
                  but I don't know how to use it to fix my problem, and I don't want to go deep in problems.

                  All the details of my problems are described here (it starts on post #1409)

                  Forum - RE: USB 3.0/3.1 Drivers (original and modded) - 94
                  If someone know what can be done?
                  Thank you very much for your help,

                  Jean

                  Comment


                  • #10
                    Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

                    It's OK, I find the program, I will try it soon...

                    Jean

                    Comment


                    • #11
                      Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

                      OK, I try the app. the program works but when ports are switch to EHCI I can see that the device manager blink every 3 seconds (same behaviour when I disable Intel USB3.0 in the BIOS).
                      No USB2 devices works even with every ports switch to EHCI.....

                      I have no solution to make my USB2 devices working....

                      Comment


                      • #12
                        Re: ASRock X99 and USB 3.0/2.0 and the EHCI/xHCI host controllers

                        Originally posted by Alexx999 View Post
                        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
                        I only just discovered this thread yesterday, on a lark. Now singing your praises! Superb utility and fix.
                        Calm down, have some dip. - George Carlin

                        Comment

                        Working...
                        X