Skip to contentSkip to conversation

arm64: dts: qcom: lemans: Enable eud support

PATCH In review Akash Kumar 4 participants 4 messages May 12 – May 13

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: qcom: lemans: Enable eud support

Add the EUD controller node in lemans.dtsi and update the USB HS endpoint routing on lemans-evk to pass through EUD instead of linking the connector directly to usb_0_dwc3_hs.

Wire the OF graph endpoints between the connector, EUD and DWC3 HS controller to enable the EUD path on lemans EVK.

This change is part of series "Improve Qualcomm EUD driver and platform support" and has been validated on the Qualcomm Dragonwing platform (RB8 board), confirming successful OpenOCD connectivity to the EUD interface. For detailed usage instructions, refer to Qualcomm’s Linux kernel debugging guide:
https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-12/debugging_linux_kernel.html#debug-using-openocd

---
 arch/arm64/boot/dts/qcom/lemans-evk.dts | 12 ++++++++++--
 arch/arm64/boot/dts/qcom/lemans.dtsi    | 26 +++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/lemans-evk.dts +10 -2
index c665db6a4595..96d316867c0e 100644
@@ -55,7 +55,7 @@ port@0 {
 				reg = <0>;
 
 				usb0_con_hs_ep: endpoint {
-					remote-endpoint = <&usb_0_dwc3_hs>;
+					remote-endpoint = <&eud_con>;
 				};
 			};
 
@@ -510,6 +510,14 @@ queue3 {
 	};
 };
 
+&eud_ep {
+	remote-endpoint = <&usb_0_dwc3_hs>;
+};
+
+&eud_con {
+	remote-endpoint = <&usb0_con_hs_ep>;
+};
+
 &gpi_dma0 {
 	status = "okay";
 };
@@ -985,7 +993,7 @@ &usb_0 {
 };
 
 &usb_0_dwc3_hs {
-	remote-endpoint = <&usb0_con_hs_ep>;
+	remote-endpoint = <&eud_ep>;
 };
 
 &usb_0_dwc3_ss {
arch/arm64/boot/dts/qcom/lemans.dtsi +26 -0
index fe6e76351823..a8ab11681476 100644
@@ -4003,6 +4003,32 @@ opp-384000000 {
 			};
 		};
 
+		eud: eud@88e1000 {
+			compatible = "qcom,sc7280-eud", "qcom,eud";
+			reg = <0 0x88e1000 0 0x2000>,
+				<0 0x88e3000 0 0x1000>;
+			interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+			port@0 {
+					reg = <0>;
+
+					eud_ep: endpoint {
+					};
+			};
+
+				port@1 {
+					reg = <1>;
+
+					eud_con: endpoint {
+					};
+				};
+			};
+		};
+
 		usb_0_hsphy: phy@88e4000 {
 			compatible = "qcom,sa8775p-usb-hs-phy",
 				     "qcom,usb-snps-hs-5nm-phy";
Signature · 4 lines
2.43.0

base-commit: https://lore.kernel.org/all/[email protected]/
change-id: Improve Qualcomm EUD driver and platform support
#1 lore raw
Quoted 34 lines · Akash Kumar

Add the EUD controller node in lemans.dtsi and update the USB HS endpoint routing on lemans-evk to pass through EUD instead of linking the connector directly to usb_0_dwc3_hs.

Wire the OF graph endpoints between the connector, EUD and DWC3 HS controller to enable the EUD path on lemans EVK.

This change is part of series "Improve Qualcomm EUD driver and platform support" and has been validated on the Qualcomm Dragonwing platform (RB8 board), confirming successful OpenOCD connectivity to the EUD interface. For detailed usage instructions, refer to Qualcomm’s Linux kernel debugging guide:
https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-12/debugging_linux_kernel.html#debug-using-openocd

---
 arch/arm64/boot/dts/qcom/lemans-evk.dts | 12 ++++++++++--
 arch/arm64/boot/dts/qcom/lemans.dtsi    | 26 +++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/lemans-evk.dts +1 -1
index c665db6a4595..96d316867c0e 100644
@@ -55,7 +55,7 @@ port@0 {
 				reg = <0>;
 
 				usb0_con_hs_ep: endpoint {
-					remote-endpoint = <&usb_0_dwc3_hs>;
+					remote-endpoint = <&eud_con>;
 				};
 			};
 

arch/arm64/boot/dts/qcom/lemans-evk.dts queue3 { · line 515

Quoted 6 lines
arch/arm64/boot/dts/qcom/lemans-evk.dts +3 -0
@@ -510,6 +510,14 @@ queue3 {
 	};
 };
 
+&eud_ep {
+	remote-endpoint = <&usb_0_dwc3_hs>;
+};

If this is a static binding, this should be a part of the lemans.dtsi.

Quoted 9 lines
arch/arm64/boot/dts/qcom/lemans-evk.dts +5 -0
+
+&eud_con {
+	remote-endpoint = <&usb0_con_hs_ep>;
+};
+
 &gpi_dma0 {
 	status = "okay";
 };

arch/arm64/boot/dts/qcom/lemans-evk.dts &usb_0 { · line 996

Quoted 5 lines
arch/arm64/boot/dts/qcom/lemans-evk.dts +1 -1
@@ -985,7 +993,7 @@ &usb_0 {
 };
 
 &usb_0_dwc3_hs {
-	remote-endpoint = <&usb0_con_hs_ep>;
+	remote-endpoint = <&eud_ep>;

The same, this should go to lemans.dtsi.

arch/arm64/boot/dts/qcom/lemans.dtsi opp-384000000 { · line 4007

Quoted 13 lines
arch/arm64/boot/dts/qcom/lemans-evk.dts +0 -0
 };
 
 &usb_0_dwc3_ss {
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -0
index fe6e76351823..a8ab11681476 100644
@@ -4003,6 +4003,32 @@ opp-384000000 {
 			};
 		};
 
+		eud: eud@88e1000 {
+			compatible = "qcom,sc7280-eud", "qcom,eud";

There should be a platform-specific compat too. The lemans.dtsi is not sc7280.

arch/arm64/boot/dts/qcom/lemans.dtsi opp-384000000 { · line 4009

Quoted 2 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -0
+			reg = <0 0x88e1000 0 0x2000>,
+				<0 0x88e3000 0 0x1000>;

0x0 instead of just 0.

arch/arm64/boot/dts/qcom/lemans.dtsi opp-384000000 { · line 4021

Quoted 12 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +12 -0
+			interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+			port@0 {
+					reg = <0>;
+
+					eud_ep: endpoint {
+					};
+			};

Incorrect indentation.

Quoted 18 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +10 -0
+
+				port@1 {
+					reg = <1>;
+
+					eud_con: endpoint {
+					};
+				};
+			};
+		};
+
 		usb_0_hsphy: phy@88e4000 {
 			compatible = "qcom,sa8775p-usb-hs-phy",
 				     "qcom,usb-snps-hs-5nm-phy";
Signature · 4 lines
2.43.0

base-commit: https://lore.kernel.org/all/[email protected]/
change-id: Improve Qualcomm EUD driver and platform support
Signature · 2 lines
With best wishes
Dmitry
maintainer
#2 lore raw
In reply to Akash Kumar
Quoted 7 lines · Akash Kumar

Add the EUD controller node in lemans.dtsi and update the USB HS endpoint routing on lemans-evk to pass through EUD instead of linking the connector directly to usb_0_dwc3_hs.

Wire the OF graph endpoints between the connector, EUD and DWC3 HS controller to enable the EUD path on lemans EVK.

Quoted 8 lines

This change is part of series "Improve Qualcomm EUD driver and platform support" and has been validated on the Qualcomm Dragonwing platform (RB8 board), confirming successful OpenOCD connectivity to the EUD interface. For detailed usage instructions, refer to Qualcomm’s Linux kernel debugging guide:
https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-12/debugging_linux_kernel.html#debug-using-openocd

Is this based on the work by Elson at
https://lore.kernel.org/all/[email protected]/#t
?

Help Elson to conclude (get merged) his efforts by code reviewing and adopting the improved bindings before reposting this.

Regards,
Bjorn

Quoted 84 lines
---
 arch/arm64/boot/dts/qcom/lemans-evk.dts | 12 ++++++++++--
 arch/arm64/boot/dts/qcom/lemans.dtsi    | 26 +++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/lemans-evk.dts +10 -2
index c665db6a4595..96d316867c0e 100644
@@ -55,7 +55,7 @@ port@0 {
 				reg = <0>;
 
 				usb0_con_hs_ep: endpoint {
-					remote-endpoint = <&usb_0_dwc3_hs>;
+					remote-endpoint = <&eud_con>;
 				};
 			};
 
@@ -510,6 +510,14 @@ queue3 {
 	};
 };
 
+&eud_ep {
+	remote-endpoint = <&usb_0_dwc3_hs>;
+};
+
+&eud_con {
+	remote-endpoint = <&usb0_con_hs_ep>;
+};
+
 &gpi_dma0 {
 	status = "okay";
 };
@@ -985,7 +993,7 @@ &usb_0 {
 };
 
 &usb_0_dwc3_hs {
-	remote-endpoint = <&usb0_con_hs_ep>;
+	remote-endpoint = <&eud_ep>;
 };
 
 &usb_0_dwc3_ss {
arch/arm64/boot/dts/qcom/lemans.dtsi +26 -0
index fe6e76351823..a8ab11681476 100644
@@ -4003,6 +4003,32 @@ opp-384000000 {
 			};
 		};
 
+		eud: eud@88e1000 {
+			compatible = "qcom,sc7280-eud", "qcom,eud";
+			reg = <0 0x88e1000 0 0x2000>,
+				<0 0x88e3000 0 0x1000>;
+			interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+			port@0 {
+					reg = <0>;
+
+					eud_ep: endpoint {
+					};
+			};
+
+				port@1 {
+					reg = <1>;
+
+					eud_con: endpoint {
+					};
+				};
+			};
+		};
+
 		usb_0_hsphy: phy@88e4000 {
 			compatible = "qcom,sa8775p-usb-hs-phy",
 				     "qcom,usb-snps-hs-5nm-phy";
Signature · 4 lines
2.43.0

base-commit: https://lore.kernel.org/all/[email protected]/
change-id: Improve Qualcomm EUD driver and platform support
#3 lore raw
In reply to Akash Kumar
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] EUD OF graph insertion breaks Type-C dual-role discovery and creates uncoordinated role switch…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] EUD OF graph insertion breaks Type-C dual-role discovery and creates uncoordinated role switch contention.
- [Medium] Missing status = "disabled"; for the eud node in the SoC .dtsi.
- [Low] Missing SoC-specific compatible string for SA8775P.
- [Low] Incorrect Device Tree indentation in the eud ports block.
--

commit eb22943ea779d0aae264ce0f40299849c69660cb
Author: Akash Kumar <[email protected]>

arm64: dts: qcom: lemans: Enable eud support

This commit adds the EUD controller node in lemans.dtsi and updates the USB HS endpoint routing on lemans-evk to pass through EUD instead of linking the connector directly to the DWC3 HS controller.

Quoted 2 lines
arch/arm64/boot/dts/qcom/lemans-evk.dts +0 -0

[ ... ]

arch/arm64/boot/dts/qcom/lemans-evk.dts port@0 { · line 58

Quoted 7 lines
arch/arm64/boot/dts/qcom/lemans-evk.dts +1 -1
@@ -54,7 +54,7 @@ port@0 {
 				reg = <0>;
 
 				usb0_con_hs_ep: endpoint {
-					remote-endpoint = <&usb_0_dwc3_hs>;
+					remote-endpoint = <&eud_con>;
 				};

By inserting the EUD node between the Type-C connector's High-Speed endpoint and the DWC3 controller, the DWC3 controller is no longer an immediate neighbor of the connector.

Standard Type-C role switch discovery (e.g., via fwnode_usb_role_switch_get()) only checks immediate remote parents. Because the EUD driver does not register a proxy role switch, does this cause discovery via the HS path to fail?

While the Type-C Port Controller (hd3ss3220) on the EVK bypasses this failure by finding the DWC3 role switch via the directly-connected SuperSpeed endpoint, both the EUD driver and the Type-C controller will independently acquire and attempt to control the same DWC3 role switch.

Since the EUD driver unconditionally requests its interrupt handlers during probe, will an EUD disconnect event force the role switch to USB_ROLE_HOST, clobbering the Type-C controller's state without synchronization and breaking standard OTG functionality?

Quoted 2 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +0 -0

[ ... ]

arch/arm64/boot/dts/qcom/lemans.dtsi opp-384000000 { · line 4007

Quoted 6 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -0
@@ -4003,6 +4003,32 @@ opp-384000000 {
 			};
 		};
 
+		eud: eud@88e1000 {
+			compatible = "qcom,sc7280-eud", "qcom,eud";

Device Tree binding rules for Qualcomm platforms strongly require providing the exact SoC-specific compatible string first.

Should this include "qcom,sa8775p-eud" before the fallback compatibles to allow for future SoC-specific driver quirks?

arch/arm64/boot/dts/qcom/lemans.dtsi opp-384000000 { · line 4010

Quoted 3 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +3 -0
+			reg = <0 0x88e1000 0 0x2000>,
+				<0 0x88e3000 0 0x1000>;
+			interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>;

Hardware controllers that depend on board-level physical routing (such as the EUD, which requires Type-C connector OF graph wiring) are typically disabled by default in the SoC .dtsi file.

Leaving the eud node globally enabled in lemans.dtsi means the qcom_eud driver will unnecessarily probe on all downstream SA8775P boards, consuming resources for unwired hardware.

Should this default to status = "disabled"; here and be explicitly overridden in lemans-evk.dts?

arch/arm64/boot/dts/qcom/lemans.dtsi opp-384000000 { · line 4021

Quoted 11 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +11 -0
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+			port@0 {
+					reg = <0>;
+
+					eud_ep: endpoint {
+					};
+			};

This isn't a bug, but there is irregular indentation here. The port@0 block and its closing brace use 3 tabs, while the reg assignment uses 5 tabs, misaligning it with the correctly formatted port@1 block below.

Quoted 9 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +9 -0
+
+				port@1 {
+					reg = <1>;
+
+					eud_con: endpoint {
+					};
+				};
+			};
+		};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1