This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM623: usb probe fail

Part Number: AM623

Hi, TI expert! 

I have such an operation: insert a USB device into an AM62 board and power it on; repeat this operation about 20 times, and there is one occurrence of the following error.

[  163.463354] xhci-hcd xhci-hcd.1.auto: can't setup: -110
[  163.463411] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[  163.463544] xhci-hcd: probe of xhci-hcd.1.auto failed with error -110 

When encountering the above error, I tried rebooting the board by entering the 'reboot' command in the Linux terminal, after reboot, the error still persists. Whenever the above error occurs, it appears again after every reboot.

However, by powering off the board and then powering on it,  the above error disappear.

I want to know what caused this problem and how to solve it?

Regards,

Li

  • Hi Li,

    The following kernel device tree patch should fix the issue.

    diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    index 510775e9a88f..aa4e24261881 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    @@ -586,6 +586,7 @@ usb0: usb@31000000 {
                            interrupt-names = "host", "peripheral";
                            maximum-speed = "high-speed";
                            dr_mode = "otg";
    +                       snps,dis_u2_susphy_quirk;
                    };
            };
     
    @@ -608,6 +609,7 @@ usb1: usb@31100000 {
                            interrupt-names = "host", "peripheral";
                            maximum-speed = "high-speed";
                            dr_mode = "otg";
    +                       snps,dis_u2_susphy_quirk;
                    };
            };

  • After adding the 'snps,dis_u2_susphy_quirk' attributes in DTS, the issue still persists.

    I repeated the testing process, and on the 64th test, the error described above occurred.

  • Hi Li,

    Please provide the output of the following commands from your board after applied the kernel patch.

    # ls /sys/firmware/devicetree/base/bus@f0000/dwc3-usb@f900000/usb@31000000/
    # ls /sys/firmware/devicetree/base/bus@f0000/dwc3-usb@f910000/usb@31100000/

  • Hi,

    The test results are as follows:

    root@am62xx:/# ll /sys/firmware/devicetree/base/bus@f0000/dwc3-usb@f900000/usb@31000000/
    -r--r--r--    1 root     root            10 Oct 21 14:40 compatible
    -r--r--r--    1 root     root             5 Oct 21 14:40 dr_mode
    -r--r--r--    1 root     root            16 Oct 21 14:40 interrupt-names
    -r--r--r--    1 root     root            24 Oct 21 14:40 interrupts
    -r--r--r--    1 root     root            11 Oct 21 14:40 maximum-speed
    -r--r--r--    1 root     root             4 Oct 21 14:40 name
    -r--r--r--    1 root     root             4 Oct 21 14:40 phandle
    -r--r--r--    1 root     root             4 Oct 21 14:40 pinctrl-0
    -r--r--r--    1 root     root             8 Oct 21 14:40 pinctrl-names
    -r--r--r--    1 root     root            16 Oct 21 14:40 reg
    
    
    
    root@am62xx:/# ll /sys/firmware/devicetree/base/bus@f0000/dwc3-usb@f910000/usb@31100000/
    -r--r--r--    1 root     root             4 Oct 21 14:40 #address-cells
    -r--r--r--    1 root     root             4 Oct 21 14:40 #size-cells
    -r--r--r--    1 root     root            10 Oct 21 14:40 compatible
    -r--r--r--    1 root     root             4 Oct 21 14:40 dr_mode
    -r--r--r--    1 root     root            16 Oct 21 14:40 interrupt-names
    -r--r--r--    1 root     root            24 Oct 21 14:40 interrupts
    -r--r--r--    1 root     root            11 Oct 21 14:40 maximum-speed
    -r--r--r--    1 root     root             4 Oct 21 14:40 name
    -r--r--r--    1 root     root             4 Oct 21 14:40 phandle
    drwxr-xr-x    3 root     root             0 Oct 21 14:40 port@1
    -r--r--r--    1 root     root            16 Oct 21 14:40 reg
    -r--r--r--    1 root     root             0 Oct 21 14:40 snps,dis_u2_susphy_quirk
    -r--r--r--    1 root     root             5 Oct 21 14:40 status
    -r--r--r--    1 root     root             0 Oct 21 14:40 usb-role-switch

  • Hi Li,

    On which USB port are you running the test, @f900000 or @f910000? I see you only added the code change on the second port.

  • Hi,

    I  running the test on dwc3-usb@f910000

  • Hi Li,

    It is expected the kernel device tree patch should solve the issue.

    But can you please apply the kernel patch attached below to see it resolves the issue?

    diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    index 510775e9a88f..0572fa4d2a99 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    @@ -569,7 +569,7 @@ gpu: gpu@fd00000 {
     
     	usbss0: dwc3-usb@f900000 {
     		compatible = "ti,am62-usb";
    -		reg = <0x00 0x0f900000 0x00 0x800>;
    +		reg = <0x00 0x0f900000 0x00 0x800>, <0x00 0x0f908000 0x00 0x400>;
     		clocks = <&k3_clks 161 3>;
     		clock-names = "ref";
     		ti,syscon-phy-pll-refclk = <&wkup_conf 0x4008>;
    @@ -591,7 +591,7 @@ usb0: usb@31000000 {
     
     	usbss1: dwc3-usb@f910000 {
     		compatible = "ti,am62-usb";
    -		reg = <0x00 0x0f910000 0x00 0x800>;
    +		reg = <0x00 0x0f910000 0x00 0x800>, <0x00 0x0f918000 0x00 0x400>;
     		clocks = <&k3_clks 162 3>;
     		clock-names = "ref";
     		ti,syscon-phy-pll-refclk = <&wkup_conf 0x4018>;
    diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
    index a2f148d58758..725769c26a24 100644
    --- a/drivers/usb/dwc3/dwc3-am62.c
    +++ b/drivers/usb/dwc3/dwc3-am62.c
    @@ -42,6 +42,8 @@
     #define USBSS_DEBUG_DATA		0x70c
     #define USBSS_HOST_HUB_CTRL		0x714
     
    +#define PHY_PLL_REG12			0x130
    +
     /* PHY CONFIG register bits */
     #define USBSS_PHY_VBUS_SEL_MASK		GENMASK(2, 1)
     #define USBSS_PHY_VBUS_SEL_SHIFT	1
    @@ -105,6 +107,7 @@
     struct dwc3_data {
     	struct device *dev;
     	void __iomem *usbss;
    +	void __iomem *usbphy;
     	struct clk *usb2_refclk;
     	int rate_code;
     	struct regmap *syscon;
     static int dwc3_ti_probe(struct platform_device *pdev)
     {
     	struct device *dev = &pdev->dev;
    @@ -193,6 +206,16 @@ static int dwc3_ti_probe(struct platform_device *pdev)
     		return PTR_ERR(data->usbss);
     	}
     
    +	data->usbphy = devm_platform_ioremap_resource(pdev, 1);
    +	if (IS_ERR(data->usbphy)) {
    +		dev_err(dev, "can't map IOMEM resource\n");
    +		return PTR_ERR(data->usbphy);
    +	}
    +
     	data->usb2_refclk = devm_clk_get(dev, "ref");
     	if (IS_ERR(data->usb2_refclk)) {
     		dev_err(dev, "can't get usb2_refclk\n");
    @@ -227,6 +250,7 @@ static int dwc3_ti_probe(struct platform_device *pdev)
     		reg |= 1 << USBSS_PHY_VBUS_SEL_SHIFT;
     
     	dwc3_ti_writel(data, USBSS_PHY_CONFIG, reg);
    +	writel(0x30, data->usbphy + PHY_PLL_REG12);
     
     	pm_runtime_set_active(dev);
     	pm_runtime_enable(dev);