i.mx6 USB OTG host mode

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

i.mx6 USB OTG host mode

4,104 Views
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

Labels (2)
Tags (3)
0 Kudos
5 Replies

1,955 Views
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 Kudos

1,955 Views
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 Kudos

1,955 Views
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 Kudos

1,955 Views
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 Kudos

1,955 Views
igorpadykov
NXP Employee
NXP Employee

Hi ZC

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

Best regards

igor

0 Kudos