Skip to contentSkip to conversation

arm64: dts: ti: k3-am625: Enable Type-C dual-role

PATCH Superseded Roger Quadros 1 participant 5 messages Mar 30, 2023 – Apr 5, 2023

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover arm64: dts: ti: k3-am625: Enable Type-C dual-role

Hi,

This series enables Type-C port on USB0 for both am625-sk and am62-lp-sk. Series is based on [1]

cheers,
-roger

Changelog:
v3:
- include Type-C support for am62-lp-sk
- split interrupts properties for Type-C chip into am625-sk

v2:
- rebase off [1]
- add fixes tag to patch 1

[1] - https://lore.kernel.org/all/[email protected]/

cheers,
-roger

Dhruva Gole (1):
arm64: dts: ti: k3-am625-sk: Add ti,vbus-divider property to usbss1

Roger Quadros (2):
arm64: dts: ti: k3-am625: Enable Type-C port for USB0
arm64: dts: ti: k3-am625: Use interrupt line for Type-C chip

 arch/arm64/boot/dts/ti/k3-am625-sk.dts        |  8 ++++-
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 36 ++++++++++++++++++-
 2 files changed, 42 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/3 arm64: dts: ti: k3-am625-sk: Add ti,vbus-divider property to usbss1

From: Dhruva Gole <[email protected]>

The property "ti,vbus-divider" is needed for both usbss0 and usbss1 as both USB0 and USB1 have the same external voltage divider circuit.

Fixes 2d94dfc43885 ("arm64: dts: ti: k3-am625-sk: Add support for USB")
---
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +1 -0
index 54318a07d50c..80e8b9b9a5f5 100644
@@ -261,6 +261,7 @@ &usbss0 {
 
 &usbss1 {
 	status = "okay";
+	ti,vbus-divider;
 };
 
 &usb0 {
Signature · 1 line
2.34.1
#2 lore raw

PATCH v3 2/3 arm64: dts: ti: k3-am625: Enable Type-C port for USB0

In reply to Roger Quadros

USB0 is a Type-C port with dual data role and power sink.

---
 arch/arm64/boot/dts/ti/k3-am625-sk.dts        |  2 +-
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 35 ++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am625-sk.dts +1 -1
index cdc0858dd1b2..467e17e28916 100644
@@ -150,7 +150,7 @@ exp1: gpio@22 {
 				   "UART1_FET_BUF_EN", "WL_LT_EN",
 				   "GPIO_HDMI_RSTn", "CSI_GPIO1",
 				   "CSI_GPIO2", "PRU_3V3_EN",
-				   "HDMI_INTn", "TEST_GPIO2",
+				   "HDMI_INTn", "PD_I2C_IRQ",
 				   "MCASP1_FET_EN", "MCASP1_BUF_BT_EN",
 				   "MCASP1_FET_SEL", "UART1_FET_SEL",
 				   "TSINT#", "IO_EXP_TEST_LED";
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +34 -1
index 80e8b9b9a5f5..db7fa20e8fe2 100644
@@ -198,6 +198,30 @@ &main_i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&main_i2c0_pins_default>;
 	clock-frequency = <400000>;
+
+	typec_pd0: tps6598x@3f {
+		compatible = "ti,tps6598x";
+		reg = <0x3f>;
+
+		connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+			self-powered;
+			data-role = "dual";
+			power-role = "sink";
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					usb_con_hs: endpoint {
+						remote-endpoint = <&usb0_hs_ep>;
+					};
+				};
+			};
+		};
+	};
 };
 
 &main_i2c1 {
@@ -265,7 +289,16 @@ &usbss1 {
 };
 
 &usb0 {
-	dr_mode = "peripheral";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	usb-role-switch;
+
+	port@0 {
+		reg = <0>;
+		usb0_hs_ep: endpoint {
+		    remote-endpoint = <&usb_con_hs>;
+	       };
+	};
 };
 
 &usb1 {
Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 3/3 arm64: dts: ti: k3-am625: Use interrupt line for Type-C chip

In reply to Roger Quadros

Since revision 1.3 the Type-C chip's interrupt line is available. This will break Type-C role swap on older boards, and it will remain in Peripheral mode.

---
 arch/arm64/boot/dts/ti/k3-am625-sk.dts | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/ti/k3-am625-sk.dts +6 -0
index 467e17e28916..5d899b56aed6 100644
@@ -256,3 +256,9 @@ partition@3fc0000 {
 		};
 	};
 };
+
+&typec_pd0 {
+	interrupt-parent = <&exp1>;
+	interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
+	interrupt-names = "irq";
+};
Signature · 1 line
2.34.1
#4 lore raw
In reply to Roger Quadros

Hi Nishanth,

Quoted 17 lines · Roger Quadros

Hi,

This series enables Type-C port on USB0 for both am625-sk and am62-lp-sk. Series is based on [1]

cheers,
-roger

Changelog:
v3:
- include Type-C support for am62-lp-sk
- split interrupts properties for Type-C chip into am625-sk

v2:
- rebase off [1]
- add fixes tag to patch 1

Quoted 7 lines

[1] - https://lore.kernel.org/all/[email protected]/

cheers,
-roger

Dhruva Gole (1):
arm64: dts: ti: k3-am625-sk: Add ti,vbus-divider property to usbss1

This one was picked from v2 series, so please ignore.

Quoted 3 lines

Roger Quadros (2):
arm64: dts: ti: k3-am625: Enable Type-C port for USB0

Could you please queue the above patch? Thanks!

Quoted 1 line

arm64: dts: ti: k3-am625: Use interrupt line for Type-C chip

This one is up to you/TI if you want to maintain support of 1.2 Boards or not. Feel free to drop this if Rev1.2 boards need to be supported.

Quoted 5 lines
 arch/arm64/boot/dts/ti/k3-am625-sk.dts        |  8 ++++-
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 36 ++++++++++++++++++-
 2 files changed, 42 insertions(+), 2 deletions(-)

cheers,
-roger