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.

Linux/AM3517: Unable to access Ethernet gadget driver

Part Number: AM3517

Tool/software: Linux

Hi , 

I am working on  am3517 sitara target board and  using "drivers/usb/musb/am35x.c"  driver of 4.9 kernel which support both  host and peripheral devices. I am using g_ether gadget device but unable to access on linux host. On target I can see both musb and  g_ether drivers are initialized  fine and I can find usb0 ethernet port on target.  But same  usb0 is not enumerating on host machine. I am getting below mentioned error on host machine.  
hub 1-1:1.0: unable to enumerate USB device on port 2
usb 1-1.2: new high-speed USB device number 6 using ehci-pci
usb 1-1.2: device descriptor read/64, error -71
 usb 1-1.2: device descriptor read/64, error -71
 usb 1-1.2: new high-speed USB device number 7 using ehci-pci
 usb 1-1.2: device descriptor read/64, error -71
usb 1-1.2: device descriptor read/64, error -71
 
Any pointer, what could be the reason for this failure ? Anything need to update in dts file "arch/arm/boot/dts/am3517.dtsi" ?  TIA !!
For reference please find below dts entry of am35x usb driver. 

am35x_otg_hs: am35x_otg_hs@5c040000 {
compatible = "ti,am35x-musb";
ti,hwmods = "am35x_otg_hs";
multipoint = <1>;
clocks = <&hsotgusb_ick_am35xx>, <&hsotgusb_fck_am35xx>;
clock-names = "ick", "fck";
reg = <0x5c040000 0x8000>;
interrupts = <71>;
interrupt-names = "mc";
mode = <2>;
interface-type = <1>;
num-eps = <16>;
ram-bits = <12>;
power = <500>;
};

Regards,
Pankaj Pandey
  • Pankaj,

    TI doesn't support kernel v4.9 for AM3517, so I am not sure what causes the failure you see. The last SDK/kernel TI supports for AM3517 is AMSDK v6.0 which has kernel v3.2. You can download it from the link below.

    software-dl.ti.com/.../index_FDS.html

    If AMSDK 6.0 can make usb working on your board, it tells you don't have hardware design issue, then I recommend you ask for v4.9 support (probably better for the latest kerenl v4.15 or v4.16-rc) on the kernel community mailing list.
  • Hi  Bin,

    Thanks for your quick response.  I have TI am3517 sdk which contains  linux-2.6.37 and here i am able to access g_ether gadget driver on Linux host.  So this is correct that am3517 did not have any hardware issue.

    Now as per investigation on 4.9 kernel am35x driver access issue is related to power supply which is not initialized or not proper to  am35x driver in gadget case.  

    Here I need your help to identify the mux settings which initialized the VCC or power supply for am35x in linux-2.6.37 kernel.  TIA!!

    Regards,

    Pankaj Pandey

  • Pankaj,

    Sorry I don't have a AM3517 platform to help you identify the settings, since current Processor SDKs don't support AM3517.
    You can try to read the AM3517 TRM to figure it out.
  • Hi , 

    I found the fix, Below changes are required to support USB OTG  in am35xx based target boards in 4.4 kernel.  
    I am just sharing the detail to assume it may help  others who are facing similar issue in "drivers/usb/musb/am35x.c" otg driver.
    diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
    index 648a60f..f1b7db3 100644
    --- a/arch/arm/mach-omap2/omap_phy_internal.c
    +++ b/arch/arm/mach-omap2/omap_phy_internal.c
    @@ -95,8 +95,10 @@ void am35x_musb_phy_power(u8 on)
                     */
                    devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
     
    -               devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
    -               devconf2 |= CONF2_PHY_PLLON;
    +               devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN |
    +                               CONF2_OTGMODE | CONF2_REFFREQ | CONF2_PHY_GPIOMODE);
    +               devconf2 |= CONF2_SESENDEN | CONF2_VBDTCTEN | CONF2_PHY_PLLON |
    +                               CONF2_REFFREQ_13MHZ | CONF2_DATPOL;
     
                    omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
    Regards,
    Pankaj Pandey