[PATCH v4 0/9] Improve Qualcomm EUD driver and platform support

From: Elson Serrao

Date: Fri May 01 2026 - 13:07:01 EST


Note: This v4 revision introduces a design change compared to v3.
Based on discussion and feedback, the binding adopts a child-node-based
model while preserving the legacy top-level 'ports' property. The
child-node approach is required because EUD needs a separate OF graph
per UTMI path to accurately describe per-path role switching.

Link to the discussion leading to this decision:
https://lore.kernel.org/all/20260324172916.804229-1-elson.serrao@xxxxxxxxxxxxxxxx/

---

The Embedded USB Debugger (EUD) is a High-Speed USB on-chip hub that
provides debug and trace capabilities on Qualcomm platforms. The current
EUD driver, however, lacks essential hardware resources such as PHY
references and support for multi-port configurations. This series
addresses those gaps and introduces the necessary device tree updates
to enable testing and validation of the enhanced functionality.

Below is a high-level block diagram showing the EUD and its connections.


EUD Block
+------------------------------+
| |
[Conn-0]-->[USB2PHY-0]---->|-------- Path 0 --------------|-->[USBCtrl-0]
| |
[Conn-1]-->[USB2PHY-1]---->|-------- Path 1 --------------|-->[USBCtrl-1]
| |
| +------------------+ |
| | EUD Debug Hub | |
| +------------------+ |
+------------------------------+

This work builds upon an earlier EUD driver submission:
https://lore.kernel.org/all/20240730222439.3469-1-quic_eserrao@xxxxxxxxxxx/
and extends it with support for multi-port use cases and proper handling
of EUD operation across different USB roles.

The series has been validated on the Qualcomm Dragonwing Q6 platform
(RB3 Gen2 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

---
Changes in v4:
- [Patch 0001] Restructure the flattened ports representation to a child-node
based model.
- Preserve the top-level 'ports' property and add per-path child nodes,
so that each role-switch path is described using its own OF graph.
(Dmitry).
- Link to the discussion leading to this design decision:
https://lore.kernel.org/all/20260324172916.804229-1-elson.serrao@xxxxxxxxxxxxxxxx/
- [Patch 0002] Use explicit port names when selecting the active EUD
port (Greg)
- [Patch 0003] Use a scoped iterator when looping over child nodes and
drop redundant EUD path validation checks (Konrad). Preserve support
for the legacy top-level ports description.
- [Patch 0004] Register role switch per path and forward the role switch
notifications to the USB controller.
- [Patch 0006] Add host mode co-ordination based on the role changes as
per the new design and drop the custom API that was used to get role
notifications.
- [Patch 0008] Described the UTMI path as a child node with role switch
capability.
- Link to v3: https://lore.kernel.org/all/20260309203337.803986-1-elson.serrao@xxxxxxxxxxxxxxxx/

Changes in RFC v3:
- Replaced the per-path (eud-path@N) model with a flattened ports
representation based on the feedback.
- Added port@2 and port@3 to support dual-port configurations.
- Removed the EUD-local 'phys' and 'usb-role-switch' properties since PHY
and role-switch information is obtained from walking the OF graph.
- Updated PHY discovery logic by fetching the PHY from the controller
node/fwnode, and exported a new API for the controller to report role
changes. The dwc3-qcom driver now uses this API to notify EUD on role
transitions.
- Updated the DTS structure by moving the EUD-to-controller port mapping
into the base SoC DTSI, enabling EUD by default, and adjusting all board
DTS files accordingly, including adding the usb-role-switch provider
link on connector nodes.
- Link to v2: https://lore.kernel.org/all/20260126233830.2193816-1-elson.serrao@xxxxxxxxxxxxxxxx/

Changes in v2:
- Improved commit message of patch 0001 and 0003 with historical context
on why EUD worked without PHY references on single-path systems.
Expanded the usb-role-switch property description in the bindings file.
- Link to v1: https://lore.kernel.org/all/20260116232106.2234978-1-elson.serrao@xxxxxxxxxxxxxxxx/
---

Elson Serrao (9):
dt-bindings: soc: qcom: eud: Add per-path child nodes for UTMI routing
usb: misc: qcom_eud: add sysfs attribute for port selection
usb: misc: qcom_eud: add per-path High-Speed PHY control
usb: misc: qcom_eud: add per-path role switch support
usb: misc: qcom_eud: improve enable_store API
usb: misc: qcom_eud: add host mode coordination
usb: misc: qcom_eud: fix virtual attach/detach event handling
arm64: dts: qcom: kodiak: Describe EUD UTMI path using child node
arm64: dts: qcom: Map USB connector to EUD on Kodiak boards

Documentation/ABI/testing/sysfs-driver-eud | 16 +
.../bindings/soc/qcom/qcom,eud.yaml | 55 ++-
arch/arm64/boot/dts/qcom/kodiak.dtsi | 35 +-
.../boot/dts/qcom/qcm6490-fairphone-fp5.dts | 10 +-
.../dts/qcom/qcm6490-particle-tachyon.dts | 10 +-
.../boot/dts/qcom/qcm6490-shift-otter.dts | 10 +-
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 10 +-
.../dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 10 +-
.../boot/dts/qcom/sm7325-nothing-spacewar.dts | 10 +-
drivers/usb/misc/qcom_eud.c | 346 ++++++++++++++++--
10 files changed, 446 insertions(+), 66 deletions(-)

--
2.34.1