i.mx6 USB OTG host mode

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

i.mx6 USB OTG host mode

4,295件の閲覧回数
zc_tee
Contributor III

Hi all,

I am trying to use the i.mx6 USB OTG port at host mode only

Is it possible to do so by changing the register USBMODE[1:0] to 0x03 (HOST CONTROLLER) only and not switching the USBOTG_ID pin to GND?

Thank you.


Regards,ZC

ラベル(2)
タグ(3)
0 件の賞賛
返信
5 返答(返信)

2,146件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi ZC

in general yes, for host only mode one can make just

software moficiations in driver, to ignore USBOTG_ID state.

Just for reference one can look at attached host codes from sdk.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

2,146件の閲覧回数
bobosv
Contributor II

Hi Igor!

Got curious of your reply!

I have a design without the ID pin, and as such USB OTG will not be able to work, as it relies on the ID pin and it's interrupt!

We would however want be able to select host or device!Is it possible to select USB Host or USB device from linux userspace?

/Bo

0 件の賞賛
返信

2,146件の閲覧回数
bobosv
Contributor II

It actually was easier than i first believed, since USB_OTG_ID pin is unused, i can controll PUS of the pin in the PAD_CTL register

Activating Pull down and device will be detected as host when power is applied to USB

Activating pull up and usb acts as device!

/Bo

0 件の賞賛
返信

2,146件の閲覧回数
zc_tee
Contributor III

Hi Igor,

Thanks for the reply.

May i know which version of sdk is the code extract from?

I am using linux 3.0.101, but i do not see any similiar coding around.

After doing some seaching, i found out that in /driver/usb/otg/fsl_otg.c, there is a part of code in function usb_otg_start:

     if (le32_to_cpu(p_otg->dr_mem_map->otgsc) & OTGSC_STS_USB_ID)

          p_otg->fsm.id = 1;

     else

          p_otg->fsm.id = 0;

It seems like this part of code checks for the ID STATUS bit in the USB OTGSC register.

I tried to force the p_otg->fsm.id to 0 without checking for this status bit, and it works (i plugged in my thumb drive and the USB OTG port success in enumerate the port)

However, may i know will there be any unexpected behaviour by just changing this part of code and do not check for the ID bit?

Thank you.

Regards,

ZC

0 件の賞賛
返信

2,146件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi ZC

these codes are from former baremetal sdk, not more supported.

Best regards

igor

0 件の賞賛
返信