Quick: USB kernel things

Quick USB testing post

While pondering how to get USB3/PCI-E(via QMP PHY) to work on mainline Linux(instead of our own Qcom/Codeaurora-based 4.9), we ran a quick test to check which phys are critical to get peripheral mode working(host is for another day, OTG comes later).

First, check which usb controller is involved:

kagura:/ $ getprop sys.usb.controller

That gives us 6a00000 via DWC3.

To find out which phy(≙ Physical layer) is needed for baseline USB connectivity, we turned them off one by one: First <&qusb_phy0>, then <&ssphy>.


&soc {
    usb3: ssusb@6a00000{
        dwc3@6a00000 {
            compatible = "snps,dwc3";
            // TEST: Set:
            //dr_mode = "peripheral";

            reg = <0x06a00000 0xc8d0>;
            interrupt-parent = <&intc>;
            interrupts = <0 131 0>;

            usb-phy = <&qusb_phy0>, <&ssphy>;
            //TEST: Set only one of the two:
            //usb-phy = <&qusb_phy0>;
            //usb-phy = <&ssphy>;

            snps,hird-threshold = /bits/ 8 <0x0>;

Turns out that both are needed on Kernel 4.9 though.

In general, one can see that the Qcom DWC3 implementation is a hacked-together beast that takes possession of the whole PHY layer, as opposed to the mainline DWC3 framework.


Published by

Edit source on Github