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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
3,957 次查看
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.

标签 (5)
0 项奖励
回复
1 解答
2,287 次查看
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 项奖励
回复
3 回复数
2,287 次查看
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 项奖励
回复
2,288 次查看
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 项奖励
回复
2,287 次查看
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 项奖励
回复