I have a custom board with an i.MX6DL on it. Given the current setup, I'm not seeing any reaction in the kernel when I plug in devices to the USB OTG port.
When my USB device is in the port and the board is in U-Boot, it seems to work. i.e.:
U-Boot# usb start
starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
USB1: USB EHCI 1.00
scanning bus 1 for devices... 1 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
scanning usb for ethernet devices... 0 Ethernet Device(s) found
U-Boot#
However when I'm in the kernel and plug a device in to the USB OTG (USB1) port there is NO reaction what so ever:
root@imx6dlboard:~# // Inserted the USB device here
I included all the kernel config options for USB debugging and verbose messaging, but whenever I plug into the USB OTG port on the board, there's no reaction.
Any hints or thoughts on what to do here?
My USB OTG device tree input:
pinctrl_usbotg: usbotggrp {
fsl,pins = <
MX6QDL_PAD_KEY_COL4__USB_OTG_OC ( PAD_CTL_STD_INPUT | PAD_CTL_HYS )
MX6QDL_PAD_KEY_ROW4__USB_OTG_PWR PAD_CTL_STD_OUTPUT_SWAP_DS(PAD_CTL_DSE_88ohm)
>;
};
&usbotg {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usbotg>;
vbus-supply = <&vbat>;
disable-over-current;
srp-disable;
hnp-disable;
adp-disable;
status = "okay";
};
Hi Michael,
So, it is a custom board, and the OTG port is used isn’t it? On the i.MX6DL SABRE board, the available USB port is OTG, but it has both Host and Device functionality, depending of the ID pin status, and the BSP consider this for a proper USB stack initialization.
Are you considering this pin connection and/or functionality on your custom hardware?
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
CarlosCasillas sorry for not clarifying this. On our board, the OTG is being used in Host mode only, the USB_OTG_ID pin is not being used. It appears to correctly be in Host mode:
root@imx6dlicomv2cib:~# devregs 0x021841a8
USB_UOG_USBMODE:0x021841a8 =0x00000003
But the USB flash devices aren't being detected by the port.
-Mike
Hi Michael,
You could try pulling down the ID pin, in order to force the Host mode on the OTG port; otherwise, a floating ID pin on a OTG port means it will be used as Device.
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I've reconfigured the pin to be:
MX6QDL_PAD_GPIO_1__USB_OTG_ID
and I pulled it to ground, but there is still no indication of the USB device being inserted into the OTG (configured as host) USB port.
Other thoughts?
Hi Michael,
Have you verified the voltage level of Vbus pins? Are you using external circuits for Vbus control/detection?
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I am looking into options to move the SD card detect line (GPIO1) to ground so I can use it for USB_OTG_ID, but it may take some time to work this out.
In the mean time, could you point out where in the code I could start looking for the driver code which checks this line and picks Host or Device mode? In theory I could remove that check and hardcode the driver to always be a "host" device, correct?
Hi Michael,
I have internally checked the issue, and I found a previous response from AE team:
For config OTG port as host mode, just a need to config USBMODE[CM] register. Additionally, Host mode configuration is NOT related with ID value.
If the user does not config ID pin, it only affect the Vbus status and id value at OTGSC.
So, although ID pin doesn’t affect the USB functionality from the software side, if the Vbus is not applied to the port, the connected Devices will not be powered, and therefore, not recognized.
Finally, if you are using the OTG port just in Host mode, have you considering using one of the Host-only controllers of the i.MX
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I was under the impression, based on this post that it was not required to pull the pin down.
Our design us currently using USB_OTG_ID ALT0 (ENET_RX_ER) for ethernet and USB_OTG_ID ALT3 (GPIO_1) for a SD card detect signal. This is why my pinctrl structure in the device tree doesn't enumerate anything for a "USB_OTG_ID" line.
Is it correct that this can be done totally in software since we don't have a line dedicated for USB_OTG_ID? Doesn't the USBMODE (above) show that we are in fact in a host-only mode?
Thanks.
-Mike