The STM32MP13 CPU has one USB 2.0 OTG port with integrated PHY.
USB interfaces on the ConnectCore MP13
On the ConnectCore MP13 system-on-module both USB OTG ports are available for peripheral use.
On the ConnectCore MP13 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 MP13 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 MP13 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 STM32MP13 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 STM32MP13 USB drivers are located at drivers/usb/
.
File | Description |
---|---|
Chipidea IP core driver |
|
Chipidea peripheral driver |
|
Chipidea host driver |
|
Chipidea OTG driver |
|
Chipidea OTG HNP and SRP driver |
|
STM USB physical driver |
Device tree bindings and customization
The STM32MP13 USB controller device tree bindings are documented at Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
.
Example: ConnectCore MP13 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 MP13 Development Kit uses:
-
Pad Port A GPIO 10 as OTG1 ID
&usbh_ehci {
phys = <&usbphyc_port0>;
status = "okay";
};
&usbotg_hs {
pinctrl-0 = <&ccmp13_usbotg_hs_pins>;
pinctrl-names = "default";
dr_mode = "otg";
phy-names = "usb2-phy";
phys = <&usbphyc_port1 0>;
status = "okay";
vbus-supply = <&scmi_vbus_otg>;
};
&usbphyc {
status = "okay";
};
&usbphyc_port0 {
phy-supply = <&scmi_vdd_usb>;
st,current-boost-microamp = <1000>;
st,decrease-hs-slew-rate;
st,tune-hs-dc-level = <2>;
st,enable-hs-rftime-reduction;
st,trim-hs-current = <11>;
st,trim-hs-impedance = <2>;
st,tune-squelch-level = <1>;
st,enable-hs-rx-gain-eq;
st,no-hs-ftime-ctrl;
st,no-lsfs-sc;
/*
* Hack to keep hub active if wakeup source is enabled
* otherwise the hub will wakeup the port0 as soon as the v3v3_sw is disabled
*/
connector {
compatible = "usb-a-connector";
vbus-supply = <&scmi_v3v3_sw>;
};
};
&usbphyc_port1 {
phy-supply = <&scmi_vdd_usb>;
st,current-boost-microamp = <1000>;
st,decrease-hs-slew-rate;
st,tune-hs-dc-level = <2>;
st,enable-hs-rftime-reduction;
st,trim-hs-current = <11>;
st,trim-hs-impedance = <2>;
st,tune-squelch-level = <1>;
st,enable-hs-rx-gain-eq;
st,no-hs-ftime-ctrl;
st,no-lsfs-sc;
};
Using the USB port
See the following topics for information on how to use the USB port.