Universal serial bus (USB)
The i.MX6UL 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 6UL system-on-module has two USB OTG ports with integrated PHY.
ConnectCore 6UL SBC Express
USB_OTG1 is available at:
- Stackable dual USB A-type connector on the top side of the board (bottom port). It can be used as USB host.
- Micro AB-type connector on the bottom side of the board (below the stackable USB A-type connector). It can be used as USB OTG (either host or device)
CAUTION! The USB device shares the USB_OTG1 instance of the i.MX6UL processor with the lower USB host port of the stacked connector. Connecting two devices to the USB_OTG1 port at the same time will cause a short circuit in the differential data pair.
USB port 2 is available at:
- Stackable dual USB A-type connector on the top side of the board (top port). It can be used as USB host.
Kernel configuration
You can manage the USB 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 kernel configuration options are enabled as built-in on the default ConnectCore 6UL kernel configuration file.
The USB device driver provides the functionality upon which the USB gadget drivers work. The USB 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 6UL 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)
Note 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.
Platform driver mapping
The i.MX6UL USB driver is located at drivers/usb/.
File |
Description |
---|---|
Chipidea IP core driver |
|
Chipidea peripheral driver |
|
Chipidea host driver |
|
i.MX glue layer |
|
Chipidea OTG driver |
|
Chipidea OTG HNP and SRP driver |
|
i.MX SoC abstract layer |
|
i.MX USB physical driver |
Device tree bindings and customization
The i.MX6UL USB interface device tree binding is documented at Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt.
SBC Express
On the ConnectCore 6UL SBC Express, both OTG USB ports are configured by default to work as host functionality. This is selected by property dr_mode on the device tree:
SBC Express device tree
&usbotg1 { dr_mode = "host"; fsl,power-line-polarity-active-high; disable-over-current; }; &usbotg2 { dr_mode = "host"; fsl,power-line-polarity-active-high; disable-over-current; };
With this default configuration both ports are accessible as USB host on the stackable dual USB A-type connector on the top side of the board.
SBC Pro
On the ConnectCore 6UL SBC Pro, USB port 1 is configured as on-the-go, while USB port 2 is configured as host. This is selected by property dr_mode on the device tree.
The ConnectCore 6UL SBC Pro uses:
- Pad GPIO0 (GPIO1_IO0) as OTG1 ID
- Pad GPIO1 (GPIO1_IO1) as OTG1 Overcurrent
- Pad GPIO4 (GPIO1_IO4) as OTG1 power enable
ConnectCore 6UL SBC Pro device tree
&usbotg1 { dr_mode = "otg"; vbus-supply = <®_usb_otg1_vbus>; pinctrl-0 = <&pinctrl_usbotg1>; fsl,over-current-polarity-active-low; fsl,power-line-polarity-active-high; }; &usbotg2 { dr_mode = "host"; fsl,power-line-polarity-active-high; disable-over-current; }; &iomuxc { imx6ul-ccimx6ul { pinctrl_usbotg1: usbotg1grp { fsl,pins = < MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID 0x17059 MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x17059 /* USBOTG1 PWR */ MX6UL_PAD_GPIO1_IO01__USB_OTG1_OC 0x17059 >; }; }; };
USB port 1 is accessible on a micro AB-type connector on the bottom side of the board.
USB port 2 is connected to a USB hub on the ConnectCore 6UL SBC Pro board which has two ports connected to a stackable dual USB A-type connector on the top side of the board.