Hi,
We have built a custom board based on a IMX6UL soc with two OTG USB ports and we are not able to make them work in Linux unless we run "usb start" in u-boot.
These are the changes made in our board file in u-boot:
static iomux_v3_cfg_t const usb_otg_pads[] = { /* OTG 1 */ MX6_PAD_GPIO1_IO04__USB_OTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), MX6_PAD_GPIO1_IO00__ANATOP_OTG1_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL), /* OTG 2 */ MX6_PAD_GPIO1_IO02__USB_OTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), MX6_PAD_GPIO1_IO05__ANATOP_OTG2_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL), };
After running "usb start" in our customized u-boot, we can boot Linux and it detects the devices. But if we boot directly to Linux the devices are not powered nor detected.This is our device tree (only the relevant parts are included):
pinctrl_usb_otg1: usbotg1grp { fsl,pins = < MX6UL_PAD_GPIO1_IO04__USB_OTG1_PWR 0x1b0b0 MX6UL_PAD_GPIO1_IO01__USB_OTG1_OC 0x1b0b0 MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID 0x17059 >; }; pinctrl_usb_otg2: usbotg2grp { fsl,pins = < MX6UL_PAD_GPIO1_IO02__USB_OTG2_PWR 0x1b0b0 MX6UL_PAD_GPIO1_IO03__USB_OTG2_OC 0x1b0b0 MX6UL_PAD_GPIO1_IO05__ANATOP_OTG2_ID 0x17059 >; }; ... &usbotg1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_otg1>; dr_mode = "otg"; srp-disable; hnp-disable; adp-disable; status = "okay"; }; &usbotg2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_otg2>; dr_mode = "host"; disable-over-current; status = "okay"; };
Neither of them is working, there is no power. Nevertheless if we configure the second one to use a vbus-supply controlled by a GPIO (MX6UL_PAD_ENET1_RX_EN__GPIO2_IO02) we can enable it and it detects properly any USB device.
Are we missing something? Is there some kind of initialization of the OTG USB ports that needs to be done always by U-boot?
Thanks in advance!
Hi Borja,
i think i had the same problem as you. The official NXP BSP doesn't provide a DT property to change the power pin polarity. So in case this is never changed the power pin polarity is active low and possibly wrong.
So is there a possibility to use the OTG2 as host only, without specifying a vbus-supply?
My configuration looks like this:
pinctrl_usb_otg: usbotggrp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID 0x17059
MX6UL_PAD_ENET2_RX_DATA0__USB_OTG1_PWR 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA1__USB_OTG1_OC 0x1b0b0
>;
};
pinctrl_usb_h1: usbh1grp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_DATA1__USB_OTG2_PWR 0x1b0b0
MX6UL_PAD_ENET2_TX_EN__USB_OTG2_OC 0x1b0b0
>;
};
&usbotg1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg>;
dr_mode = "otg";
srp-disable;
hnp-disable;
adp-disable;
status = "okay";
};
&usbotg2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_h1>;
dr_mode = "host";
disable-over-current;
status = "okay";
};
OTG1 works, but OTG2 gets no VDD.
Hi Borja
one can recheck configs using sect.39.2.3 Menu Configuration Options attached Linux Manual, also
what bsp used in the case, one can try nxp official releases described on
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
I have tried with the NXP official release (kernel&uboot) and the outcome is the same.
These are the signals we are using:
USB1_VBUS – Pad T12 signal USB_OTG1_VBUS
USB_OTG1_P – Pad U15 signal USB_OTG1_DP
USB_OTG1_N – Pad T15 signal USB_OTG1_DN
USB_OTG1_ID – Pad K13 signal GPIO1_IO00
USB_O1_OC – Pad L15 signal GPIO1_IO01
USB_O1_PWR – Pad M16 signal GPIO1_IO04
USB2_VBUS – Pad U12 signal USB_OTG2_VBUS
USB_OTG2_P – Pad U13 signal USB_OTG2_DP
USB_OTG2_N – Pad T13 signal USB_OTG2_DN
USB_OTG2_ID – Pad M17 signal GPIO1_IO05 (read only)
USB_OTG2_ID – Pad E16 signal ENET1_RX_EN (GPIO2 (IO02)) (write only, by default is 0 - master)
USB_O2_OC – Pad L17 signal GPIO1_IO03
USB_O2_PWR – Pad L14 signal GPIO1_IO02
Is specifying the ID pads enough or do I need to add some custom vbus regulators and configure them to look to some GPIOs?
Thanks!
could you check VDD_USB_CAP voltage with oscilloscope.
Best regards
igor