USB Client doesn't work on i.MX53 in mainline u-boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Client doesn't work on i.MX53 in mainline u-boot

Jump to solution
1,263 Views
compmas2
Contributor V

I have a custom board loosely based off the i.MX53 QSB with a dedicated USB client port.  I am trying to get USB client functionality working in mainline u-boot 2015.04.  I have verified that USB client/gadget functionality works when booted into Linux on the board.  In u-boot I have tried testing USB client with USB Mass Storage, DFU, and FastBoot and none of them seem to work.

Here is my USB client #defines from my config header file:

#define CONFIG_CI_UDC

#define CONFIG_USBD_HS

#define CONFIG_USB_GADGET_DUALSPEED

#define CONFIG_USB_GADGET

#define CONFIG_CMD_USB_MASS_STORAGE

#define CONFIG_USB_GADGET_MASS_STORAGE

#define CONFIG_USBDOWNLOAD_GADGET

#define CONFIG_USB_GADGET_VBUS_DRAW     2

#define CONFIG_USB_ETHER

#define CONFIG_USB_ETH_CDC

#define CONFIG_G_DNL_VENDOR_NUM         0x0525

#define CONFIG_G_DNL_PRODUCT_NUM        0xa4a5

#define CONFIG_G_DNL_MANUFACTURER       "FSL"

#define CONFIG_SYS_CACHELINE_SIZE       64

When I run the 'ums 0 mmc 0' command, I get the following:

UMS: disk start sector: 0x0, count: 0xe88000

and then I get an infinite spinning progress indicator.  At this point when I connect the USB cable to a Host PC, I see nothing on the host PC side (Windows or Liunx).

Any ideas on what I am missing to get USB client working or any hints on how to debug this further.

Labels (2)
0 Kudos
1 Solution
767 Views
compmas2
Contributor V

I looks like the current i.MX5x USB support in u-boot 2015.04 only supports one USB port at a time.  To enable support for the USB OTG port, you would need to use the following line in the board configuration header:

#define CONFIG_MXC_USB_PORT 0

To enable support for the first USB Host port, the following line in the board configuration header is needed:

#define CONFIG_MXC_USB_PORT 1

View solution in original post

0 Kudos
4 Replies
767 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Matthew,

This is how I got ums working on the imx6 warp board:

git.denx.de Git - u-boot/u-boot-imx.git/commitdiff http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=09ac7b5961396ffb8644e180180b33008e0b6b35

Maybe you missed board_usb_phy_mode().

int board_usb_phy_mode(int port)

  {

          if (port == 1)

                  return USB_INIT_HOST;

          else

                  return USB_INIT_DEVICE;

  }

Regards,

Fabio Estevam

0 Kudos
767 Views
compmas2
Contributor V

Fabio,

I did not have a board_usb_phy_mode() function in my board file.  I added one like how you implemented it and tried again.  I am getting the same results as before with no response from the host PC.

Here is my board file content related to USB:

#ifdef CONFIG_USB_EHCI_MX5

static void setup_usb(void)

{

        imx_iomux_v3_setup_pad(MX53_PAD_GPIO_0__GPIO1_0);

}

int board_ehci_hcd_init(int port)

{

        /* Enable USB_H1_VBUS power with GPIO1_0 */

        gpio_direction_output(IMX_GPIO_NR(1, 0), 1);

        return 0;

}

#endif

int board_usb_phy_mode(int port)

{      

        if (port == 1)

                return USB_INIT_HOST;

        else   

                return USB_INIT_DEVICE;

}

Then later on in board_init(), I have:

#ifdef CONFIG_USB_EHCI_MX5

        setup_usb();

#endif

Additionally here are my #defines for the USB host functionality:

/* USB Host Configs */

#define CONFIG_CMD_USB

#define CONFIG_USB_EHCI

#define CONFIG_USB_EHCI_MX5

#define CONFIG_USB_STORAGE

#define CONFIG_USB_HOST_ETHER

#define CONFIG_USB_ETHER_ASIX

#define CONFIG_USB_ETHER_MCS7830

#define CONFIG_USB_ETHER_SMSC95XX

#define CONFIG_MXC_USB_PORT     1

#define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)

#define CONFIG_MXC_USB_FLAGS    0

Anything else that I can try out?

Regards,

Matthew Starr

0 Kudos
767 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Matthew,

I don't have my mx53qsb handy to try. I would suggest starting a thread at the U-boot mailing list about this topic.

Regards,

Fabio Estevam

0 Kudos
768 Views
compmas2
Contributor V

I looks like the current i.MX5x USB support in u-boot 2015.04 only supports one USB port at a time.  To enable support for the USB OTG port, you would need to use the following line in the board configuration header:

#define CONFIG_MXC_USB_PORT 0

To enable support for the first USB Host port, the following line in the board configuration header is needed:

#define CONFIG_MXC_USB_PORT 1

0 Kudos