AnsweredAssumed Answered

USB OTG ports in IMX6UL

Question asked by borjatornero on Dec 14, 2017
Latest reply on Mar 15, 2018 by lategoodbye

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!

Outcomes