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!
-----------------------------------------------------------------------------------------------------------------------
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
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
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
Hi ZC
these codes are from former baremetal sdk, not more supported.
Best regards
igor