From: Peng Fan <[email protected]>

Add PTN5110 TCPCI node on I2C3 with USB-C connector configured as
sink-only. The sink PDOs advertise 5V/3A fixed and 5-20V/2.25A
variable, enabling PD negotiation up to 45W.

Enable TYPEC_TCPM, TYPEC_TCPCI and CMD_TCPM in defconfig.

Signed-off-by: Peng Fan <[email protected]>
---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 ++++++++++++++++++
 configs/imx8mp_evk_defconfig        |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 51c84383673..fc9e9da09dd 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -3,6 +3,7 @@
  * Copyright 2019, 2021 NXP
  */
 
+#include <dt-bindings/usb/pd.h>
 #include "imx8mp-u-boot.dtsi"
 
 / {
@@ -91,6 +92,23 @@
 
 &i2c3 {
        bootph-pre-ram;
+
+       tcpc_port2: i2c3-ptcpc@50 {
+               compatible = "nxp,ptn5110", "tcpci";
+               reg = <0x50>;
+
+               connector {
+                       compatible = "usb-c-connector";
+                       label = "USB-C-2";
+                       power-role = "sink";
+                       data-role = "device";
+                       try-power-role = "sink";
+                       sink-pdos =
+                               <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>,
+                               <PDO_VAR(5000, 20000, 2250)>;
+                       op-sink-microwatt = <15000000>;
+               };
+       };
 };
 
 &i2c4 {
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 7af538ee367..2849d910538 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -150,6 +150,9 @@ CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_MX7 is not set
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GENERIC=y
+CONFIG_TYPEC_TCPM=y
+CONFIG_TYPEC_TCPCI=y
+CONFIG_CMD_TCPM=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525

-- 
2.51.0

Reply via email to