usb stick detected in userspace but not detected by u-boot

huangapple go评论71阅读模式
英文:

usb stick detected in userspace but not detected by u-boot

问题

I need that u-boot recognize my USB stick when i plug it to my custom board based on iMX8M plus. In my linux userspace USB stick is recognized.

When i type usb start the following error is displayed:

u-boot=> usb start
starting USB...
Bus dwc3@38100000: probe failed, error -110
Bus dwc3@38200000: probe failed, error -110
No working controllers found

I found that the error above was in this file: drivers/usb/host/usb-uclass.c

Basically inside usb_init function we have the following bloc of code:

        ret = device_probe(bus);
        if (ret == -ENODEV) {   /* No such device. */
                puts("Port not available.\n");
                controllers_initialized++;
                continue;
        }

        if (ret) {              /* Other error. */
                printf("probe failed, error %d\n", ret); // THIS IS THE ERROR DISPLAYED 
                continue;
        }
        controllers_initialized++;
        usb_started = true;
}

...

/* if we were not able to find at least one working bus, bail out */
if (controllers_initialized == 0)
        printf("No working controllers found\n"); // THIS IS THE ERROR DISPLAYED

return usb_started ? 0 : -1;

So far i managed to fix my device tree: some node related to USB function were commented:
vbus-power-supply and some node to USB Integrated Circuits such as CBTL04GP and ptn5110.

I also checked arch/arm/dts/imx8mp.dtsi I noted that the driver (phy-fsl-imx8mq-usb.c ) of the following node is absent from my uboot sources but is present in kernel sources tree:

            usb3_phy0: usb-phy@381f0040 {
                    compatible = "fsl,imx8mp-usb-phy";
                    reg = <0x381f0040 0x40>;
                    clocks = <&clk IMX8MP_CLK_USB_PHY_ROOT>;
                    clock-names = "phy";
                    assigned-clocks = <&clk IMX8MP_CLK_USB_PHY_REF>;
                    assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
                    #phy-cells = <0>;
                    status = "disabled";
            };

When i remove this driver from my kernel sources. My usb sticks is no more recognized in userspace.

Should I try to implement this driver in my uboot sources despite header inclusion hell ?

英文:

I need that u-boot recognize my USB stick when i plug it to my custom board based on iMX8M plus. In my linux userspace USB stick is recognized.

When i type usb start the following error is displayed:

u-boot=&gt; usb start
starting USB...
Bus dwc3@38100000: probe failed, error -110
Bus dwc3@38200000: probe failed, error -110
No working controllers found

I found that the error above was in this file : drivers/usb/host/usb-uclass.c

Basically inside usb_init function we have the following bloc of code:

        ret = device_probe(bus);
        if (ret == -ENODEV) {   /* No such device. */
                puts(&quot;Port not available.\n&quot;);
                controllers_initialized++;
                continue;
        }

        if (ret) {              /* Other error. */
                printf(&quot;probe failed, error %d\n&quot;, ret); // THIS IS THE ERROR DISPLAYED 
                continue;
        }
        controllers_initialized++;
        usb_started = true;
}

...

/* if we were not able to find at least one working bus, bail out */
if (controllers_initialized == 0)
        printf(&quot;No working controllers found\n&quot;); // THIS IS THE ERROR DISPLAYED

return usb_started ? 0 : -1;

So far i managed to fix my device tree: some node related to USB function were commented:
vbus-power-supply and some node to USB Integrated Circuits such as CBTL04GP and ptn5110.

I also checked arch/arm/dts/imx8mp.dtsi I noted that the driver (phy-fsl-imx8mq-usb.c ) of the following node is absent from my uboot sources but is present in kernel sources tree:

            usb3_phy0: usb-phy@381f0040 {
                    compatible = &quot;fsl,imx8mp-usb-phy&quot;;
                    reg = &lt;0x381f0040 0x40&gt;;
                    clocks = &lt;&amp;clk IMX8MP_CLK_USB_PHY_ROOT&gt;;
                    clock-names = &quot;phy&quot;;
                    assigned-clocks = &lt;&amp;clk IMX8MP_CLK_USB_PHY_REF&gt;;
                    assigned-clock-parents = &lt;&amp;clk IMX8MP_CLK_24M&gt;;
                    #phy-cells = &lt;0&gt;;
                    status = &quot;disabled&quot;;
            };

When i remove this driver from my kernel sources. My usb sticks is no more recognized in userspace.

Should I try to implement this driver in my uboot sources despite header inclusion hell ?

答案1

得分: 0

我必须实现这个驱动程序 phy-imx8mq-usb.c
然后,我必须在设备树中描述的drivers/clk/imx/clk-imx8mp.c文件中配置相应的24MHz时钟,如下所示:

clk_dm(IMX8MP_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev));
英文:

I had to implement this driver phy-imx8mq-usb.c
Then i had to configure the corresponding 24Mhz clock described in device tree in the following filedrivers/clk/imx/clk-imx8mp.c as below:

clk_dm(IMX8MP_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev));

huangapple
  • 本文由 发表于 2023年3月3日 21:54:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75627968.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定