Improve Qualcomm EUD driver and platform support #542
Open
akakum-qualcomm wants to merge 9 commits intoqualcomm-linux:qcom-6.18.yfrom
Open
Improve Qualcomm EUD driver and platform support #542akakum-qualcomm wants to merge 9 commits intoqualcomm-linux:qcom-6.18.yfrom
akakum-qualcomm wants to merge 9 commits intoqualcomm-linux:qcom-6.18.yfrom
Conversation
…TMI routing The Qualcomm Embedded USB Debugger (EUD) can intercept one or two independent High-Speed UTMI paths, depending on the SoC configuration. Each path is distinct, with its own connector/controller connection and role-dependent UTMI routing. Because the EUD sits between the USB connector and the USB controller, it must relay role changes across the UTMI path. In device role, the EUD inserts its internal hub into the path to enable debug functionality. In host role, the path remains directly connected between the PHY and the USB controller, bypassing the EUD hub. These hardware constraints require per-path role awareness, as UTMI path roles may differ. The existing binding models only a single UTMI path and assumes a uniform routing model. While sufficient for simple device-role-only configurations, this representation does not accurately describe EUD hardware when role switching and/or multiple UTMI paths are involved. To address this limitation, per-path child nodes are introduced to describe individual UTMI paths through the EUD. Each path includes its own ports description, allowing controller and connector associations, as well as role-aware routing. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
EUD can be mapped to either the primary USB port or the secondary USB port depending on the value of the EUD_PORT_SEL register. Add a 'port' sysfs attribute to allow userspace to select which port EUD should operate on and update the ABI documentation. This is needed for systems with dual USB ports where EUD needs to be accessible on either port depending on the system configuration and use case. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
EUD hardware can support multiple High-Speed USB paths, each routed through its own PHY. The active path is selected in hardware via the EUD_PORT_SEL register. As a High-Speed hub, EUD requires access to the High-Speed PHY associated with the active path. To support this multi-path capability, the driver must manage PHY resources on a per-path basis, ensuring that the PHY for the currently selected path is properly initialized and powered. This patch restructures the driver to implement per-path PHY management. The driver now powers the appropriate PHY based on the selected and enabled UTMI path, ensuring correct operation when EUD is enabled. Historically, EUD appeared to work on single-path systems because the USB controller kept the PHY initialized. However, EUD is designed to operate independently of the USB controller and therefore requires explicit PHY control for proper operation. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
The EUD hardware can support multiple High-Speed USB paths, each connected to different USB controllers. The current implementation uses a single chip-level role switch, which cannot properly handle multi-path configurations where each path needs independent role management. Since EUD is physically present between the USB connector and the controller, it should also relay the role change requests from the connector. Restructure the driver to support per-path role switches and remove the chip-level role switch. Additionally, as EUD need not modify the USB role upon enabling, remove the unnecessary role switch call from enable_eud(). Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
Currently enable_store() allows operations irrespective of the EUD state, which can result in redundant operations. Avoid this by adding duplicate state checks to skip requests when EUD is already in the desired state. Additionally, improve error handling with explicit logging to provide better feedback. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
EUD functions by presenting itself as a USB device to the host PC for debugging, making it incompatible with USB host mode configurations. Enabling EUD while in host mode can also cause the USB controller to misbehave, as the EUD hub supports only a single upstream-facing port. Handle the following scenarios to prevent these conflicts: 1. Prevent the user from enabling EUD via sysfs when the USB port is in host mode. 2. Automatically disable EUD when the USB port switches to host mode, and re-enable it when exiting host mode. This ensures consistent state management without creating conflicts between the EUD debug hub and the USB controller. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
EUD provides virtual USB attach/detach events to simulate cable plug/unplug while maintaining the physical debug connection. However, the current implementation incorrectly sets the USB role to HOST on virtual detach, which doesn't represent the disconnected state. Fix the virtual detach handling by setting the USB role to NONE instead of HOST, correctly representing the disconnected state. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
…d node The existing EUD description uses a legacy single-path representation that assumes uniform UTMI routing. This was sufficient for minimal configurations where the USB port operated only in device mode and role switching was not considered. Update the description to explicitly model the topology using eud path child node and add a role-switch declaration to reflect role-dependent UTMI routing. Also on this SoC, the EUD hardware intercepts only the primary UTMI path. So remove the USB endpoint mapping to the secondary controller and associate it with the primary controller. With the UTMI path now accurately described, enable the EUD by default. The connector side of the path is left unspecified, allowing board-level DTS files to describe the physical connector mapping. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
On Kodiak-based boards, the primary USB connector is connected through the EUD on the High-Speed path. Update the board-level descriptions to map the USB connector endpoint to EUD, reflecting the intended hardware topology. Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/ Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com> Signed-off-by: Akash Kumar <akakum@qti.qualcomm.com>
0fd6bc3 to
219607d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
[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@quicinc.com/
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:
Link: https://lore.kernel.org/all/20260501170635.2641748-1-elson.serrao@oss.qualcomm.com/
CRs-Fixed: 4526131