I.MX6 : Using USB OTG without dynamic VBUS pin ?

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

I.MX6 : Using USB OTG without dynamic VBUS pin ?

Jump to solution
2,924 Views
frederic_coiffi
Contributor II

On our design based in i.MX6Q, we're using USB OTG (as host or as device). On this design, we have a OTG ID pin on i.MX6 (GPIO1) but no dynamic VBUS pin : this one is set to +5V.

With our previous Linux kernel (3.0.35), it wasn't a problem. But with the new 3.10.31, it seems that the USB ChipIdea driver monitors the changes of VBUS pin in the OTG stage machine :

} else if (otg_int_src & OTGSC_AVVIS) {

  hw_write_otgsc(ci, OTGSC_AVVIS, OTGSC_AVVIS);

  if (otgsc & OTGSC_AVV) {

    fsm->a_vbus_vld = 1;

  } else {

    fsm->a_vbus_vld = 0;

    fsm->b_conn = 0;

  }

}

With this kernel, the USB device is disconnected few milliseconds after detecting it, as the condition 'fsm->a_vbus_vld = 1' cannot be generated as there is no change on VBUS.

So is there a way to get a working OTG with VBUS pin connected to +5V ?

I made this workaround in ci_hdrc_otg_fsm_init() :

ci->fsm.a_vbus_vld = hw_read_otgsc(ci, OTGSC_AVV) ? 1 : 0;

So like this, 'fsm->a_vbus_vld' reflects the correct state of VBUS.

Labels (5)
0 Kudos
1 Solution
1,254 Views
frederic_coiffi
Contributor II

Hi Weidong,

Thank you for your answer. I agree with your hardware approach but in our case as the hardware is already done, my question was essentially about the Linux 3.10 support of this configuration.

However, my workaround gives me a good behaviour. So except if you have a better proposal, I think this question can be closed.

View solution in original post

0 Kudos
3 Replies
1,254 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Frederic ,

     Generally speaking, during hardware design, USB OTG VBUS should be connected to +5V, because it will work at dual role(Host or device).

Host :

    VBUS pin on CPU side can be connected to 5V or not.

Device :

    VBUS pin on CPU side must be connected to 5V from external USB host.

In software, user can get status of VBUS by reading corresponding bit in register.

  So I think your handing way on it is no problem .

Regards,

Weidong

0 Kudos
1,255 Views
frederic_coiffi
Contributor II

Hi Weidong,

Thank you for your answer. I agree with your hardware approach but in our case as the hardware is already done, my question was essentially about the Linux 3.10 support of this configuration.

However, my workaround gives me a good behaviour. So except if you have a better proposal, I think this question can be closed.

0 Kudos
1,254 Views
weidong_sun
NXP TechSupport
NXP TechSupport

OK, Frederic,

    you can press "correct " or "helpful" button, then the question will be signed as "closed".

    Thanks!

Regards,

Weidong

0 Kudos