iMX6 OTG 'wait otg vbus change timeout!'

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

iMX6 OTG 'wait otg vbus change timeout!'

Jump to solution
1,096 Views
frédéric
Contributor III

Hi,

We are using a spinoff of a Boundary Nitrogen6x, kernel 3.0.35. When I plug a mouse on the OTG it is detected and work fine.

However we changed the uboot (was 2013.10, now 2014.04) to have support for signed kernel and now when I plug a mouse on OTG I have this message in kernel:

wait otg vbus change timeout!

and it does not work. We have not changed the kernel, so it looks like the previous uboot configured something about OTG that we are missing.

I put this in my new uboot:

       imx_iomux_v3_setup_pad(MX6_PAD_ENET_RX_ER__USB_OTG_ID);

       imx_iomux_v3_setup_pad(MX6_PAD_EIM_D22__GPIO3_IO22);

       /* USB_OTG_PWR = 0 */

       gpio_direction_output(USB_OTG_PWR, 0);

But it is still not working in kernel.

Any clues? If I have no support for USB-OTG in uboot, what is missing in the kernel to configure it? I see in my dmesg that the module is loaded

Freescale USB OTG Driver loaded, $Revision: 1.55 $

In the kernel (our board.c support file) has this code for OTG:

static void board_usbotg_vbus(bool on)

{

  if (on)

  gpio_set_value(BOARD_USB_OTG_PWR, 1);

  else

  gpio_set_value(BOARD_USB_OTG_PWR, 0);

}

static void __init board_init_usb(void)

{

  int ret = 0;

  imx_otg_base = MX6_IO_ADDRESS(MX6Q_USB_OTG_BASE_ADDR);

  /* disable external charger detect,

  * or it will affect signal quality at dp .

  */

  ret = gpio_request(BOARD_USB_OTG_PWR, "usb-pwr");

  if (ret) {

  pr_err("failed to get GPIO BOARD_USB_OTG_PWR: %d\n",

  ret);

  return;

  }

  gpio_direction_output(BOARD_USB_OTG_PWR, 0);

  mxc_iomux_set_gpr_register(1, 13, 1, 1);

  mx6_set_otghost_vbus_func(board_usbotg_vbus);

}

EDIT: note that when fully booted in android, device mode is still working because ADB works fine, it is only host that does not work anymore

Tags (1)
0 Kudos
1 Solution
720 Views
frédéric
Contributor III

I somehow missed this in our new uboot:

NEW_PAD_CTRL(MX6_PAD_EIM_D22__GPIO3_IO22, OUTPUT_40OHM),

Now it is working, but instead of modifying uboot I will try to put the pad settings in kernel where they should belongs to make OTG working

View solution in original post

0 Kudos
3 Replies
721 Views
frédéric
Contributor III

I somehow missed this in our new uboot:

NEW_PAD_CTRL(MX6_PAD_EIM_D22__GPIO3_IO22, OUTPUT_40OHM),

Now it is working, but instead of modifying uboot I will try to put the pad settings in kernel where they should belongs to make OTG working

0 Kudos
720 Views
BiyongSUN
NXP Employee
NXP Employee

The otg power switch is handled by SOC internal, which is using the USB_OTG_PWR_EN and determined by otg id.

The GPIO could not guarantee the timing.

The hardware design could refer to the i.MX6Q SDB board reference design.

Untitled.png

0 Kudos
720 Views
frédéric
Contributor III

We wil double-check the schematic, but as I wrote, it works fine with Nitrogen6x uboot 2013.10, but not with 2014.04, so something is initialized differently.

0 Kudos