USB Host/On-The-Go

The i.MX6 universal serial bus (USB) driver implements a standard Linux driver interface to the CHIPIDEA USB-HS On-The-Go (OTG) controller. The CHIPIDEA USB controller is enhanced host controller interface (EHCI) compliant.

The ConnectCore 6 Plus system-on-module has one USB OTG port with integrated PHY and three USB Host ports.

Kernel configuration

You can manage the USB Host support through the kernel configuration options:

You can manage the USB OTG support through the kernel configuration option:

All kernel configuration options are enabled as built-in on the default ConnectCore 6 Plus kernel configuration file.

Platform driver mapping

The i.MX6 USB Host driver is located at drivers/usb/.

File Description
chipidea/core.c Chipidea IP core driver
chipidea/udc.c Chipidea peripheral driver
chipidea/host.c Chipidea host driver
chipidea/ci_hdrc_imx.c i.MX glue layer
chipidea/usbmisc_imx.c i.MX SoC abstract layer
phy/phy-mxs-usb.c i.MX USB physical driver

The USB OTG driver for the ConnectCore 6 Plus system-on-module includes the USB Host driver sources and the following sources located at driver/usb/chipidea.

File Description
otg.c Chipidea OTG driver
otg_fsm.c Chipidea OTG HNP and SRP driver

Device tree bindings and customization

USB Host

The i.MX6 USB Host interface device tree binding is documented at Documentation/devicetree/bindings/usb/fsl-usb.txt.

The USB Host interface is defined in the i.MX6 CPU and ConnectCore 6 Plus SBC device tree files.

Definition of the USB Host

Common i.MX6 device tree
usbh1: usb@02184200 {
        compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
        reg = <0x02184200 0x200>;
        interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clks IMX6QDL_CLK_USBOH3>;
        fsl,usbphy = <&usbphy2>;
        fsl,usbmisc = <&usbmisc 1>;
    dr_mode = "host";
    ahb-burst-config = <0x0>;
    tx-burst-size-dword = <0x10>;
    rx-burst-size-dword = <0x10>;
        status = "disabled";
};

IOMUX configuration

The USB Host uses dedicated pins for the USB Host interface. No IOMUX configuration is necessary.

USB host enabling and parameters

ConnectCore 6 Plus SBC device tree
&usbh1 {
    fsl,reset-gpio = <&gpio3 10 GPIO_ACTIVE_HIGH>;
};

USB OTG

The i.MX6 USB OTG interface device tree binding is documented at Documentation/devicetree/bindings/usb/usbmisc-imx.txt.

The USB OTG interface is defined in the i.MX6 CPU, ConnectCore 6 Plus system-on-module, and ConnectCore 6 Plus SBC device tree files.

Definition of the USB OTG

Common i.MX6 device tree
usbotg: usb@02184000 {
        compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
        reg = <0x02184000 0x200>;
        interrupts = <0 43 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clks IMX6QDL_CLK_USBOH3>;
        fsl,usbphy = <&usbphy1>;
        fsl,usbmisc = <&usbmisc 0>;
    ahb-burst-config = <0x0>;
    tx-burst-size-dword = <0x10>;
    rx-burst-size-dword = <0x10>;
        fsl,anatop = <&anatop>;
        status = "disabled";
};

IOMUX configuration

ConnectCore 6 Plus system-on-module device tree
usbotg {
        pinctrl_usbotg: usbotg {
            fsl,pins = <
                MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
                MX6QDL_PAD_EIM_D22__USB_OTG_PWR 0x17059
                MX6QDL_PAD_EIM_D21__USB_OTG_OC 0x17059
            >;
        };
};

USB OTG enabling and parameters

ConnectCore 6 Plus SBC device tree
&usbotg {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usbotg>;
        digi,power-line-active-high;
        fsl,over-current-polarity-active-low;
        status = "okay";
};