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.

AM3358: USB Host without DRVVUS

Part Number: AM3358

Hi,

This issue is similar to the previous thread https://e2e.ti.com/support/processors/f/791/t/472060

On our circuit board, the VBUS is connected to 5V always. We tried the instruction described in the thread mentioned above, still could not make the host work----VBUS_ERROR is reported.

The SDK is 5.02. The log is listed below.  Should we make additional changes?  Thanks,

[   22.939089] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

[   27.969522] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator

[   28.284010] musb-hdrc musb-hdrc.0: MUSB HDRC host driver

[   28.360761] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1

[   28.518771] hub 1-0:1.0: USB hub found

[   28.544942] hub 1-0:1.0: 1 port detected

[   28.583772] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator

[   28.663786] musb-hdrc musb-hdrc.1: MUSB HDRC host driver

[   28.740669] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2

[   28.789861] pruss 4a300000.pruss: creating PRU cores and other child platform devices

[   28.859745] hub 2-0:1.0: USB hub found

[   28.888777] hub 2-0:1.0: 1 port detected

[   29.071592] remoteproc remoteproc1: 4a334000.pru is available

[   29.120359] pru-rproc 4a334000.pru: PRU rproc node /ocp/pruss_soc_bus@4a326004/pruss@0/pru@34000 probed successfully

[   29.177838] remoteproc remoteproc2: 4a338000.pru is available

[   29.183803] pru-rproc 4a338000.pru: PRU rproc node /ocp/pruss_soc_bus@4a326004/pruss@0/pru@38000 probed successfully

[   29.194511] musb-hdrc musb-hdrc.0: VBUS_ERROR in a_wait_vrise (80, <SessEnd), retry #3, port1 0008010c

  • Hi,

    Is AM3358 USBx_VBUS pin connected to the 5V as well? Please share the USB portion of the schematics.

  • Hi, Liu Bin,

    AM3358 USBx_VBUS is switched on to 5V (e.g. USB0_SW_PWR in the attached schematic) before the USB ports initialization.

  • Hi, Liu Bin,

    USB0_DRVVBUS is configured as GPIO, not the control signal as DRVVBUS.

  • Hi Peng,

    It seems the schematic has no issue.

    Did you set USB0 dr_mode to 'host' in your board device tree file?

  • Hi, Liu Bin,

    We set the dr_mode to host.

  • Hi Peng,

    Please apply the kernel patch attached below and let me know if it solves the issue.

    From b88e0f4a5ceddb673b9567ef2db7394e8da1d5e3 Mon Sep 17 00:00:00 2001
    From: Bin Liu <b-liu@ti.com>
    Date: Wed, 16 Jan 2019 11:54:07 -0600
    Subject: [PATCH] usb: phy: am335x: fix race condition in _probe
    
    power off the phy should be done before populate the phy. Otherwise,
    am335x_init() could be called by the phy owner to power on the phy first,
    then am335x_phy_probe() turns off the phy again without the caller knowing
    it.
    
    Fixes: 2fc711d76352 ("usb: phy: am335x: Enable USB remote wakeup using PHY wakeup")
    Cc: stable@vger.kernel.org # v3.18+
    Signed-off-by: Bin Liu <b-liu@ti.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    ---
     drivers/usb/phy/phy-am335x.c | 5 +----
     1 file changed, 1 insertion(+), 4 deletions(-)
    
    diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c
    index 7e5aece769da..cb1382a52765 100644
    --- a/drivers/usb/phy/phy-am335x.c
    +++ b/drivers/usb/phy/phy-am335x.c
    @@ -60,9 +60,6 @@ static int am335x_phy_probe(struct platform_device *pdev)
     	if (ret)
     		return ret;
     
    -	ret = usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
    -	if (ret)
    -		return ret;
     	am_phy->usb_phy_gen.phy.init = am335x_init;
     	am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown;
     
    @@ -81,7 +78,7 @@ static int am335x_phy_probe(struct platform_device *pdev)
     	device_set_wakeup_enable(dev, false);
     	phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false);
     
    -	return 0;
    +	return usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
     }
     
     static int am335x_phy_remove(struct platform_device *pdev)
    -- 
    2.17.1
    
    

  • Hi, Liu Bin,

    Our SDK is Rev 5.2. So are there any patches applied to SDK 5.2?

    Thanks,

  • Hi Peng,

    Yes, the kernel attached above is for the kernel in SDK v5.2. Do you run into any issue when applying this patch?

  • Have you checked the mentioned 3 patches are already in the SDK v5.2 kernel.