Open main menu

DAVE Developer's Wiki β

DESK-MX9-L/Peripherals/USB2 OTG

< DESK-MX9-L
Revision as of 09:39, 1 February 2024 by U0007 (talk | contribs)

History
Issue Date Notes
2024/01/30 DESK-MX9-L-5.0.0 release



Contents

Peripheral USB2 OTGEdit

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

Device tree configurationEdit

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-cb2001.dts:

/ {
...
	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 peripheralEdit

Linux messages at boot timeEdit

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.)

[ 1272.354409] usb 1-1: new high-speed USB device number 3 using ci_hdrc
[ 1272.521077] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1272.527735] scsi host0: usb-storage 1-1:1.0
[ 1273.539755] scsi 0:0:0:0: Direct-Access      USB      SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
[ 1273.550783] sd 0:0:0:0: [sda] 60125184 512-byte logical blocks: (30.8 GB/28.7 GiB)
[ 1273.560595] sd 0:0:0:0: [sda] Write Protect is off
[ 1273.567632] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1273.592520]  sda: sda1
[ 1273.601008] sd 0:0:0:0: [sda] Attached SCSI removable disk

Additional informationEdit

The root file system configuration does automatically mount the partition:

root@desk-mx93:~# lsblk /dev/sda
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda      8:0    1 28.7G  0 disk 
`-sda1   8:1    1 28.7G  0 part /run/media/<name-usb-partition>-sda1

The directory name mounted depend from usb name partition.