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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
3,974件の閲覧回数
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,304件の閲覧回数
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,304件の閲覧回数
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,305件の閲覧回数
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,304件の閲覧回数
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 件の賞賛
返信