Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-L/Peripherals/USB OTG

782 bytes removed, 10:40, 16 July 2021
no edit summary
==Peripheral USB OTG ==
The USB OTG ports can be configured as Host or Device mode depending on the device tree configuration. In OTG mode they can be easily tested using the Mass Storage Gadget, which lets the device export a file as a mass storage device to the connected PC.
In {{ImportantMessage|text=The USB OTG mode they can be easily tested using the Mass Storage Gadget, which lets the device export a file peripheral is not available - ''as a mass storage device to default option'' - on [[AXEL_ULite_SOM/AXEL_ULite_Evaluation_Kit | AXEL ULite EVK]]. Please contact [mailto:sales@dave.eu Sales department] for this option}}This peripheral is available on the connected PCi.MX6UL standard product [[SBC_Lynx_SBC | SBCLynx]]}}
=== Device tree configuration ===
Here below an example of device tree configuration used on standard DAVE's kit for the [[AXEL ULite SOM]] where USB OTG1 is configured as ''otg'' while the USB OTG2 port is configured in ''host'' mode:
From <code>imx6ul-lynxaxelulite-som0013cb003a.dtsidts</code>:
<pre>
&usbotg1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg1_id>;
vbus-supply = <&reg_usb_otg1_vbus>;
dr_mode = "otg";
srp-disable;
hnp-disable;
adp-disable;
status = "disabled";
};
 
&usbotg2 {
vbus-supply = <&reg_usb_otg2_vbus>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg2_id>;
disable-over-current;
dr_mode = "host";
status = "disabled";
};
...
...
&iomuxc {
...
...
pinctrl_usb_otg1_id: usbotg1idgrp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID 0x17059
>;
};
 
pinctrl_usb_otg1: usbotg1grp {
fsl,pins = <
MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08 0x10b0 /* OTG1 PWR */
MX6UL_PAD_ENET2_RX_DATA1__GPIO2_IO09 0x17059 /* OTG1_OC */
>;
};
 
pinctrl_usb_otg1_oc: usbotg1grp1 {
fsl,pins = <
MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08 0x10b0 /* OTG1 PWR */
MX6UL_PAD_ENET2_RX_DATA1__USB_OTG1_OC 0x17059 /* OTG1_OC */
>;
};
 
pinctrl_usb_otg2: usbotg2grp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_DATA1__GPIO2_IO12 0x17059 /* OTG2_PWR */
MX6UL_PAD_ENET2_TX_EN__USB_OTG2_OC 0x17059 /* OTG2_OC */
>;
};
 
pinctrl_usb_otg2_1: usbotg2grp-1 {
fsl,pins = <
MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x17059 /* OTG2_PWR */
MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x17059 /* OTG2_OC */
>;
};
 
</pre>
 
From <code>imx6ul-lynx-som0013-cb002f.dts</code>:
 
<pre>
&reg_usb_otg1_vbus {
pinctrl-0 = <&pinctrl_usb_otg1_oc>;
};
 
&usbotg1 {
over-current-active-low;
status = "okay";
};
 
&usbotg2 {
over-current-active-low;
status = "okay";
};
 
...
...
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog_gpios>;
 
imx6ul-lynx {
...
...
usb { pinctrl_usb_otg1pinctrl_usb_otg2_id: usbotg1grp usbotg2idgrp {
fsl,pins = <
MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08 0x10b0 /* OTG1 PWR */ MX6UL_PAD_ENET2_RX_DATA1__USB_OTG1_OC MX6UL_PAD_ENET2_TX_CLK__ANATOP_OTG2_ID 0x17059 /* OTG1_OC OTG ID */
>;
};
 
pinctrl_usb_otg2: usbotg2grp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_DATA1__GPIO2_IO12 MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0x17059 /* OTG2_PWR OTG PWR */ MX6UL_PAD_ENET2_TX_EN__USB_OTG2_OC MX6UL_PAD_UART2_CTS_B__GPIO1_IO22 0x17059 0x10b0 /* OTG2_OC OTG OC */
>;
};
};
</pre>
 
===Accessing the peripheral===
...
...
[ 1.939073] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002[ 1.945990] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1[ 1.953298] usb usb2: Product: EHCI Host Controller[ 1.387128958211] usb_otg1_vbususb usb2: supplied by SWBSTManufacturer: Linux 4.14.98-desk-mx6ul-l-1.0.1 ehci_hcd[ 1.965426] usb usb2: SerialNumber: ci_hdrc.1[ 3.418986667157] usb_otg2_vbususbcore: supplied by SWBSTregistered new interface driver usbhid[ 53.245408672771] usb_otg1_vbususbhid: disablingUSB HID core driver
...
...
<pre class="workstation-terminal">
root@desk-mx6ul-axelulite:~# [ 431 40.623145533219] usb 12-1: new high-speed USB device number 2 using ci_hdrc[ 431 40.865699775605] usb 12-1: New USB device found, idVendor=0951, idProduct=1665[ 431 40.872537782554] usb 12-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3[ 431 40.883302797569] usb 12-1: Product: DataTraveler 2.0[ 431 40.887825802174] usb 12-1: Manufacturer: Kingston[ 431 40.892114813793] usb 12-1: SerialNumber: 50E549C202681071F97202CB[ 431 40.910893827294] usb-storage 12-1:1.0: USB Mass Storage device detected[ 431 40.928942850364] scsi host0: usb-storage 12-1:1.0[ 432 41.966408926319] scsi 0:0:0:0: Direct-Access Kingston DataTraveler 2.0 0000 PQ: 0 ANSI: 4[ 432 41.995263953445] sd 0:0:0:0: [sda] 15151168 512-byte logical blocks: (7.76 GB/7.22 GiB)[ 433 41.015350976216] sd 0:0:0:0: [sda] Write Protect is off[ 433 41.981055] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00[ 42.031915003870] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA[ 433 42.067380040175] sda: sda1[ 433 42.089246063618] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@desk-mx6ul-axelulite:~#
8,221
edits