The ConnectCore 8X system-on-module has one USB 2.0 OTG controller and one USB 3.0 controller that can work as USB 2.0 OTG. Refer to Universal Serial Bus (USB) for information on the naming of the USB controllers.

On the ConnectCore 8X SBC Express:

  • USB_OTG1 can be used as OTG (host or device).

  • USB_OTG2 can only be used as USB host.

On the ConnectCore 8X SBC Pro:

  • USB_OTG1 can only be used as USB host.

  • USB_OTG2 can only be used as USB host.

Kernel configuration

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

  • Support for Host-side USB (CONFIG_USB)

  • EHCI HCD (USB 2.0) support (CONFIG_USB_EHCI_HCD)

  • ChipIdea Highspeed Dual Role Controller (CONFIG_USB_CHIPIDEA)

  • ChipIdea device controller (CONFIG_USB_CHIPIDEA_UDC)

  • ChipIdea host controller (CONFIG_USB_CHIPIDEA_HOST)

  • Freescale MXS USB PHY support (CONFIG_USB_MXS_PHY)

  • OTG support (CONFIG_USB_OTG)

All of these kernel configuration options are enabled as built-in on the default ConnectCore 8X kernel configuration file.

The USB 2.0 device driver provides the functionality for the USB gadget drivers. The USB 2.0 gadget drivers implement one or more "functions", each providing a different capability.

The following gadget drivers are supported and enabled as loadable modules on the default ConnectCore 8X kernel configuration file.

  • Mass Storage Gadget (CONFIG_USB_MASS_STORAGE)

  • Ethernet Gadget with CDC Ethernet support (CONFIG_USB_ETH)

  • Serial Gadget with ACM and CDC OBEX support (CONFIG_USB_G_SERIAL)

Gadget drivers are enabled as loadable modules because only one gadget function can be used at a time. Before using a gadget driver, you must first make sure no other gadget driver is loaded.

Kernel driver

The i.MX8QXP universal serial bus (USB) 2.0 driver implements a standard Linux driver interface to the CHIPIDEA USB-HS On-The-Go (OTG) controller. The CHIPIDEA USB 2.0 controller is Enhanced Host Controller Interface (EHCI) compliant.

The i.MX8QXP USB 2.0 drivers are 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/otg.c

Chipidea OTG driver

chipidea/otg_fsm.c

Chipidea OTG HNP and SRP driver

chipidea/usbmisc_imx.c

i.MX SoC abstract layer

phy/phy-mxs-usb.c

i.MX USB physical driver

Device tree bindings and customization

The i.MX8QXP USB 2.0 controller device tree bindings are documented at Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt.

Example: ConnectCore 8X SBC Pro

USB_OTG1 controller is configured by default to work as host, while USB_OTG2 is configured as otg. This is selected via the dr_mode property on the device tree:

ConnectCore 8X SBC Pro device tree
/* USB_OTG1 */
&usbotg1 {
	/*
	 * To configure this USB controller as a device set dr_mode to "otg";
	 * to configure it as a host set to "host" instead.
	 */
	dr_mode = "host";
	disable-over-current;
	status = "okay";
};

/* USB_OTG2 */
&usbotg3 {
	dr_mode = "otg";
	extcon = <&typec_ptn5110>;
	status = "okay;
};

Using the USB 2.0 OTG controller

See the following topics for information on how to use the USB controller: