The STM32MP15 CPU has one USB 2.0 OTG port with integrated PHY.

USB interfaces on the ConnectCore MP15

On the ConnectCore MP15 system-on-module both USB OTG ports are available for peripheral use.

On the ConnectCore MP15 Development Kit:

  • USB1, which is host, is connected to a four-port USB hub.

  • USB2, which is OTG, is available at the micro AB-type connector.

    • both ports of the stackable dual USB A-type connector on the top side of the board.

    • the PCIe connector.

    • the XBee socket (also available on an expansion connector).

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)

  • DesignWare USB2 DRD Core Support (CONFIG_USB_DWC2)

  • ChipIdea device controller (CONFIG_USB_CHIPIDEA_UDC)

  • ChipIdea host controller (CONFIG_USB_CHIPIDEA_HOST)

  • STM USB PHY support (CONFIG_PHY_STM32_USBPHYC)

  • OTG support (CONFIG_USB_OTG)

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

The USB device driver provides the functionality for the USB gadget drivers. 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 MP15 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 STM32MP15 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 STM32MP15 USB 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/otg.c

Chipidea OTG driver

chipidea/otg_fsm.c

Chipidea OTG HNP and SRP driver

phy/st/phy-stm32-usbphyc.c

STM USB physical driver

Device tree bindings and customization

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

Example: ConnectCore MP15 Development Kit

The USB OTG port is configured by default to work as otg. This can be selected via the dr_mode property on the device tree: If the dr_mode is not specified the default is otg.

The ConnectCore MP15 Development Kit uses:

  • Pad Port A GPIO 10 as OTG1 ID

ConnectCore MP15 Development Kit device tree
&usbh_ehci {
	phys = <&usbphyc_port0>;
	phy-names = "usb";
	status = "okay";
};

&usbotg_hs {
	pinctrl-0 = <&usbotg_hs_pins_a>;
	pinctrl-names = "default";
	dr_mode = "otg";
	phy-names = "usb2-phy";
	phys = <&usbphyc_port1 0>;
	status = "okay";
	vbus-supply = <&vbus_otg>;
};

&usbphyc_port0 {
	phy-supply = <&vdd_usb>;
	st,phy-tuning = <&usb_phy_tuning>;
};

&usbphyc_port1 {
	phy-supply = <&vdd_usb>;
	st,phy-tuning = <&usb_phy_tuning>;
};

&pinctrl {
	...
	usbotg_hs_pins_a: usbotg-hs-0 {
		pins {
			pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* OTG_ID */
		};
	};
	...
};

Using the USB port

See the following topics for information on how to use the USB port.