Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX8M-L/Peripherals/USB-C

2,009 bytes added, 15:08, 16 February 2023
no edit summary
In Linux you can use the dual-role data mode (DRD).
For more information, refer to the example in X[[DESK-MX8M-L/Pheripherals/USB2_OTG | USB2 OTG]].
The connector that is inserted in this port works in both verses.
 
====Device tree configuration====
From <code>imx8mp-mito8mplus.dtsi</code>:
<pre>
&iomuxc {
...
...
pinctrl_typec: typec1grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO13__GPIO1_IO13 0x1c4
>;
};
 
pinctrl_typec_mux: typec1muxgrp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12 0x16
>;
};
...
...
</pre>
 
From <code>imx8mp-mito8mplus-cb1001.dts</code>:
<pre>
...
...
ptn36043 {
compatible = "nxp,ptn36043";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_typec_mux>;
switch-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
orientation-switch;
/* this must be left disabled to avoid conflicts with ptn36043_gpio
* see usb_dwc3_0 for more details */
status = "disabled";
 
port {
usb3_data_ss: endpoint {
remote-endpoint = <&typec_con_ss>;
};
};
};
...
...
ptn5110: tcpc@50 {
compatible = "nxp,ptn5110";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_typec>;
reg = <0x50>;
interrupt-parent = <&gpio1>;
interrupts = <13 8>;
 
/* disable this node to prevent blackout on boot
*/
status = "disabled";
 
port {
typec_dr_sw: endpoint {
remote-endpoint = <&usb3_drd_sw>;
};
};
 
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
power-role = "dual";
data-role = "dual";
try-power-role = "sink";
source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
PDO_VAR(5000, 12000, 3000)>;
op-sink-microwatt = <15000000>;
self-powered;
 
ports {
#address-cells = <1>;
#size-cells = <0>;
 
port@1 {
reg = <1>;
typec_con_ss: endpoint {
remote-endpoint = <&usb3_data_ss>;
};
};
};
};
};
 
extcon_usbotg2: typec@3d {
compatible = "nxp,ptn5150";
reg = <0x3d>;
int-gpios = <&gpio1 00 GPIO_ACTIVE_LOW>;
vbus-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ptn5150>;
status = "okay";
};
...
...
 
</pre>
 
 
 
<section end=Body/>
----
[[Category:ORCA]] [[Category:MITO 8M Mini]]
dave_user
424
edits