DESK-MX9-L/Peripherals/USB2 OTG

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2024/01/30

DESK-MX9-L-5.x.x release
2026/02/16 DESK-MX9-L-6.x.x release



Peripheral USB2 OTG[edit | edit source]

AURA SOM supports OTG/Host/Peripheral modes: on AURA Evaluation Kit the USB2 OTG port is configured as USB Host.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AURA SOM:

From kernel device tree imx93-aura.dtsi:

...
&usbotg2 {
	dr_mode = "otg";
	hnp-disable;
	srp-disable;
	adp-disable;
	disable-over-current;
	samsung,picophy-pre-emp-curr-control = <3>;
	samsung,picophy-dc-vol-level-adjust = <7>;
	status = "disabled";
};
...

From kernel device tree imx93-aura-sbcx.dtsi:

/ {
...
	regulators {
...
		reg_usb_pwr: usb_pwr {
			compatible = "regulator-fixed";
			regulator-name = "usb_pwr_en";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
			enable-active-high;
		};
...
	};
...
};
...
&usbotg2 {
	dr_mode = "host";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usb_pwr>;
	vbus-supply = <&reg_usb_pwr>;
	status = "okay";
};
...
&iomuxc {
...
	pinctrl_usb_pwr: usbpwrgrp {
		fsl,pins = <
			MX93_PAD_PDM_CLK__GPIO1_IO08			0x31e
		>;
	};
...
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

When a USB peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. xlass, vendor id, product id, etc.)

[ 1289.187877] usb 1-1: new high-speed USB device number 3 using ci_hdrc
[ 1289.352090] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1289.364286] scsi host0: usb-storage 1-1:1.0
[ 1290.398162] scsi 0:0:0:0: Direct-Access      USB      SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
[ 1290.417217] sd 0:0:0:0: [sda] 240353280 512-byte logical blocks: (123 GB/115 GiB)
[ 1290.425417] sd 0:0:0:0: [sda] Write Protect is off
[ 1290.431801] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[ 1290.438296] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1290.456304]  sda: sda1
[ 1290.459031] sd 0:0:0:0: [sda] Attached SCSI removable disk

Additional information[edit | edit source]

The root file system configuration automatically mounts the partition:

root@desk-mx93-rev1:~# lsblk /dev/sda
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    1 114.6G  0 disk
`-sda1   8:1    1 114.6G  0 part

The mount point directory name depends on the USB partition name.