* [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support
@ 2026-03-09 20:33 Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 01/10] dt-bindings: soc: qcom: eud: Add support for dual-port configuration Elson Serrao
` (9 more replies)
0 siblings, 10 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
Note: Marking v3 as RFC for the following reasons:
1)The driver design has changed since v2. The earlier multi-path
child-node approach has been replaced with a flattened representation.
2)Patch 10 depends on below patch that is currently under review.
https://lore.kernel.org/all/20260223191042.825136-1-elson.serrao@oss.qualcomm.com/
Requesting feedback on the updated design.
Although below three patches in v2 had Reviewed-by tags and remain
unchanged here, the tags have been intentionally dropped in v3 due
to the RFC nature of this revision:
- [PATCH 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
- [PATCH 05/10] usb: misc: qcom_eud: improve enable_store API
- [PATCH 06/10] usb: misc: qcom_eud: fix virtual attach/detach event handling
---
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.
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:
https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-12/debugging_linux_kernel.html#debug-using-openocd
---
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@oss.qualcomm.com/
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@oss.qualcomm.com/
---
Elson Serrao (10):
dt-bindings: soc: qcom: eud: Add support for dual-port configuration
usb: misc: qcom_eud: add sysfs attribute for port selection
usb: misc: qcom_eud: add per-port High-Speed PHY control
usb: misc: qcom_eud: add per-port role switch support
usb: misc: qcom_eud: improve enable_store API
usb: misc: qcom_eud: fix virtual attach/detach event handling
usb: misc: qcom_eud: add host mode coordination
usb: dwc3: qcom: notify EUD driver of role changes
arm64: dts: qcom: kodiak: Fix EUD USB controller connection
arm64: dts: qcom: Map USB connector to EUD for kodiak boards
Documentation/ABI/testing/sysfs-driver-eud | 16 +
.../bindings/soc/qcom/qcom,eud.yaml | 19 +-
arch/arm64/boot/dts/qcom/kodiak.dtsi | 19 +-
.../boot/dts/qcom/qcm6490-fairphone-fp5.dts | 11 +-
.../dts/qcom/qcm6490-particle-tachyon.dts | 11 +-
.../boot/dts/qcom/qcm6490-shift-otter.dts | 11 +-
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 11 +-
.../dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 11 +-
.../boot/dts/qcom/sm7325-nothing-spacewar.dts | 11 +-
drivers/usb/dwc3/Kconfig | 1 +
drivers/usb/dwc3/dwc3-qcom.c | 10 +
drivers/usb/misc/Kconfig | 1 +
drivers/usb/misc/qcom_eud.c | 322 +++++++++++++++++-
include/linux/usb/qcom_eud.h | 21 ++
14 files changed, 414 insertions(+), 61 deletions(-)
create mode 100644 include/linux/usb/qcom_eud.h
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH RFC v3 01/10] dt-bindings: soc: qcom: eud: Add support for dual-port configuration
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
` (8 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
EUD hardware supports debugging on up to two USB ports depending on the
SoC configuration. Debugging can be selected on either the primary or
secondary USB port as controlled by the EUD_PORT_SELECT register.
Extend the binding to support dual-port configurations by adding port@2
and port@3 for secondary USB controller and Type-C connector connections.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
.../bindings/soc/qcom/qcom,eud.yaml | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml
index 84218636c0d8..af89b9e0be6f 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml
@@ -32,18 +32,27 @@ properties:
ports:
$ref: /schemas/graph.yaml#/properties/ports
description:
- These ports is to be attached to the endpoint of the DWC3 controller node
- and type C connector node. The controller has the "usb-role-switch"
- property.
+ These ports attach to endpoints of DWC3 controller nodes and Type-C
+ connector nodes. The controller has the "usb-role-switch" property.
+ EUD supports up to 2 USB ports. For single-port configurations, use
+ port@0 and port@1. For dual-port configurations, use all four ports.
properties:
port@0:
$ref: /schemas/graph.yaml#/properties/port
- description: This port is to be attached to the DWC3 controller.
+ description: This port is to be attached to the primary DWC3 controller.
port@1:
$ref: /schemas/graph.yaml#/properties/port
- description: This port is to be attached to the type C connector.
+ description: This port is to be attached to the primary Type-C connector.
+
+ port@2:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: This port is to be attached to the secondary DWC3 controller.
+
+ port@3:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: This port is to be attached to the secondary Type-C connector.
required:
- compatible
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 01/10] dt-bindings: soc: qcom: eud: Add support for dual-port configuration Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-11 13:16 ` Greg Kroah-Hartman
2026-03-09 20:33 ` [PATCH RFC v3 03/10] usb: misc: qcom_eud: add per-port High-Speed PHY control Elson Serrao
` (7 subsequent siblings)
9 siblings, 1 reply; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
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.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
Documentation/ABI/testing/sysfs-driver-eud | 16 ++++++++
drivers/usb/misc/qcom_eud.c | 43 ++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI/testing/sysfs-driver-eud
index 2bab0db2d2f0..67223f73ee60 100644
--- a/Documentation/ABI/testing/sysfs-driver-eud
+++ b/Documentation/ABI/testing/sysfs-driver-eud
@@ -7,3 +7,19 @@ Description:
EUD based on a 1 or a 0 value. By enabling EUD,
the user is able to activate the mini-usb hub of
EUD for debug and trace capabilities.
+
+What: /sys/bus/platform/drivers/qcom_eud/.../port
+Date: January 2026
+Contact: Elson Serrao <elson.serrao@oss.qualcomm.com>
+Description:
+ Selects which USB port the Embedded USB Debugger (EUD)
+ is mapped to on platforms providing multiple High-Speed
+ USB ports.
+
+ Valid values:
+ 0 - Primary USB port
+ 1 - Secondary USB port
+
+ The attribute is writable only while EUD is disabled.
+ Reading the attribute returns the currently selected
+ USB port number.
diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index 926419ca560f..1a136f8f1ae5 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -23,8 +23,11 @@
#define EUD_REG_VBUS_INT_CLR 0x0080
#define EUD_REG_CSR_EUD_EN 0x1014
#define EUD_REG_SW_ATTACH_DET 0x1018
+#define EUD_REG_PORT_SEL 0x1028
#define EUD_REG_EUD_EN2 0x0000
+#define EUD_MAX_PORTS 2
+
#define EUD_ENABLE BIT(0)
#define EUD_INT_PET_EUD BIT(0)
#define EUD_INT_VBUS BIT(2)
@@ -40,6 +43,7 @@ struct eud_chip {
int irq;
bool enabled;
bool usb_attached;
+ u8 port_idx;
};
static int enable_eud(struct eud_chip *priv)
@@ -104,8 +108,47 @@ static ssize_t enable_store(struct device *dev,
static DEVICE_ATTR_RW(enable);
+static ssize_t port_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct eud_chip *chip = dev_get_drvdata(dev);
+
+ return sysfs_emit(buf, "%u\n", chip->port_idx);
+}
+
+static ssize_t port_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct eud_chip *chip = dev_get_drvdata(dev);
+ u8 port;
+ int ret;
+
+ ret = kstrtou8(buf, 0, &port);
+ if (ret)
+ return ret;
+
+ /* Only port 0 and port 1 are valid */
+ if (port >= EUD_MAX_PORTS)
+ return -EINVAL;
+
+ /* Port selection must be done before enabling EUD */
+ if (chip->enabled) {
+ dev_err(chip->dev, "Cannot change port while EUD is enabled\n");
+ return -EBUSY;
+ }
+
+ writel(port, chip->base + EUD_REG_PORT_SEL);
+ chip->port_idx = port;
+
+ return count;
+}
+
+static DEVICE_ATTR_RW(port);
+
static struct attribute *eud_attrs[] = {
&dev_attr_enable.attr,
+ &dev_attr_port.attr,
NULL,
};
ATTRIBUTE_GROUPS(eud);
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 03/10] usb: misc: qcom_eud: add per-port High-Speed PHY control
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 01/10] dt-bindings: soc: qcom: eud: Add support for dual-port configuration Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 04/10] usb: misc: qcom_eud: add per-port role switch support Elson Serrao
` (6 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
EUD hardware can support multiple High-Speed USB ports, each routed
through its own PHY. The active port 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 port. To support this
multi-port capability, the driver must manage PHY resources on a
per-port basis, ensuring that the PHY for the currently selected
port is properly initialized and powered.
This patch adds per-port PHY management to the driver. The driver
now powers the appropriate PHY based on the selected and enabled
port, ensuring correct operation when EUD is enabled.
Historically, EUD appeared to work on single-port 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.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/usb/misc/Kconfig | 1 +
drivers/usb/misc/qcom_eud.c | 103 +++++++++++++++++++++++++++++++++++-
2 files changed, 103 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index 0b56b773dbdf..2d9190c756f9 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -147,6 +147,7 @@ config USB_APPLEDISPLAY
config USB_QCOM_EUD
tristate "QCOM Embedded USB Debugger(EUD) Driver"
depends on ARCH_QCOM || COMPILE_TEST
+ depends on OF
select QCOM_SCM
select USB_ROLE_SWITCH
help
diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index 1a136f8f1ae5..b042e01c6ca2 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -11,6 +11,8 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_graph.h>
+#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
@@ -37,23 +39,75 @@
struct eud_chip {
struct device *dev;
struct usb_role_switch *role_sw;
+ struct phy *phy[EUD_MAX_PORTS];
void __iomem *base;
phys_addr_t mode_mgr;
unsigned int int_status;
int irq;
bool enabled;
bool usb_attached;
+ bool phy_enabled;
u8 port_idx;
};
+static int eud_phy_enable(struct eud_chip *chip)
+{
+ struct phy *phy;
+ int ret;
+
+ if (chip->phy_enabled)
+ return 0;
+
+ phy = chip->phy[chip->port_idx];
+
+ ret = phy_init(phy);
+ if (ret) {
+ dev_err(chip->dev, "Failed to initialize USB2 PHY for port %u: %d\n",
+ chip->port_idx, ret);
+ return ret;
+ }
+
+ ret = phy_power_on(phy);
+ if (ret) {
+ dev_err(chip->dev, "Failed to power on USB2 PHY for port %u: %d\n",
+ chip->port_idx, ret);
+ phy_exit(phy);
+ return ret;
+ }
+
+ chip->phy_enabled = true;
+
+ return 0;
+}
+
+static void eud_phy_disable(struct eud_chip *chip)
+{
+ struct phy *phy;
+
+ if (!chip->phy_enabled)
+ return;
+
+ phy = chip->phy[chip->port_idx];
+
+ phy_power_off(phy);
+ phy_exit(phy);
+ chip->phy_enabled = false;
+}
+
static int enable_eud(struct eud_chip *priv)
{
int ret;
- ret = qcom_scm_io_writel(priv->mode_mgr + EUD_REG_EUD_EN2, 1);
+ ret = eud_phy_enable(priv);
if (ret)
return ret;
+ ret = qcom_scm_io_writel(priv->mode_mgr + EUD_REG_EUD_EN2, 1);
+ if (ret) {
+ eud_phy_disable(priv);
+ return ret;
+ }
+
writel(EUD_ENABLE, priv->base + EUD_REG_CSR_EUD_EN);
writel(EUD_INT_VBUS | EUD_INT_SAFE_MODE,
priv->base + EUD_REG_INT1_EN_MASK);
@@ -70,6 +124,8 @@ static int disable_eud(struct eud_chip *priv)
return ret;
writel(0, priv->base + EUD_REG_CSR_EUD_EN);
+ eud_phy_disable(priv);
+
return 0;
}
@@ -132,6 +188,11 @@ static ssize_t port_store(struct device *dev,
if (port >= EUD_MAX_PORTS)
return -EINVAL;
+ if (!chip->phy[port]) {
+ dev_err(chip->dev, "EUD not supported on selected port\n");
+ return -EOPNOTSUPP;
+ }
+
/* Port selection must be done before enabling EUD */
if (chip->enabled) {
dev_err(chip->dev, "Cannot change port while EUD is enabled\n");
@@ -224,6 +285,35 @@ static irqreturn_t handle_eud_irq_thread(int irq, void *data)
return IRQ_HANDLED;
}
+static int eud_parse_dt_port(struct eud_chip *chip, u8 port_id)
+{
+ struct device_node *controller_node;
+ struct phy *phy;
+
+ /*
+ * Multiply port_id by 2 to get controller port number:
+ * port_id 0 -> port@0 (primary USB controller)
+ * port_id 1 -> port@2 (secondary USB controller)
+ */
+ controller_node = of_graph_get_remote_node(chip->dev->of_node,
+ port_id * 2, -1);
+ if (!controller_node)
+ return dev_err_probe(chip->dev, -ENODEV,
+ "failed to get controller node for port %u\n", port_id);
+
+ phy = devm_of_phy_get_by_index(chip->dev, controller_node, 0);
+ if (IS_ERR(phy)) {
+ of_node_put(controller_node);
+ return dev_err_probe(chip->dev, PTR_ERR(phy),
+ "failed to get HS PHY for port %u\n", port_id);
+ }
+ chip->phy[port_id] = phy;
+
+ of_node_put(controller_node);
+
+ return 0;
+}
+
static void eud_role_switch_release(void *data)
{
struct eud_chip *chip = data;
@@ -243,6 +333,17 @@ static int eud_probe(struct platform_device *pdev)
chip->dev = &pdev->dev;
+ /*
+ * Parse the DT resources for primary port.
+ * This is the default EUD port and is mandatory.
+ */
+ ret = eud_parse_dt_port(chip, 0);
+ if (ret)
+ return ret;
+
+ /* Secondary port is optional */
+ eud_parse_dt_port(chip, 1);
+
chip->role_sw = usb_role_switch_get(&pdev->dev);
if (IS_ERR(chip->role_sw))
return dev_err_probe(chip->dev, PTR_ERR(chip->role_sw),
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 04/10] usb: misc: qcom_eud: add per-port role switch support
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (2 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 03/10] usb: misc: qcom_eud: add per-port High-Speed PHY control Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 05/10] usb: misc: qcom_eud: improve enable_store API Elson Serrao
` (5 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
The EUD hardware can support multiple High-Speed USB ports, each
connected to different USB controllers. The current implementation
uses a single chip-level role switch, which cannot properly handle
multi-port configurations where each USB port can operate in
different role.
Restructure the driver to support per-port role switches.
Additionally, remove the unnecessary role switch call from
enable_eud() as EUD need not modify the USB role upon enabling.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/usb/misc/qcom_eud.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index b042e01c6ca2..1936b45791d2 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -38,7 +38,7 @@
struct eud_chip {
struct device *dev;
- struct usb_role_switch *role_sw;
+ struct usb_role_switch *role_sw[EUD_MAX_PORTS];
struct phy *phy[EUD_MAX_PORTS];
void __iomem *base;
phys_addr_t mode_mgr;
@@ -112,7 +112,7 @@ static int enable_eud(struct eud_chip *priv)
writel(EUD_INT_VBUS | EUD_INT_SAFE_MODE,
priv->base + EUD_REG_INT1_EN_MASK);
- return usb_role_switch_set_role(priv->role_sw, USB_ROLE_DEVICE);
+ return 0;
}
static int disable_eud(struct eud_chip *priv)
@@ -272,9 +272,9 @@ static irqreturn_t handle_eud_irq_thread(int irq, void *data)
int ret;
if (chip->usb_attached)
- ret = usb_role_switch_set_role(chip->role_sw, USB_ROLE_DEVICE);
+ ret = usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE_DEVICE);
else
- ret = usb_role_switch_set_role(chip->role_sw, USB_ROLE_HOST);
+ ret = usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE_HOST);
if (ret)
dev_err(chip->dev, "failed to set role switch\n");
@@ -289,6 +289,7 @@ static int eud_parse_dt_port(struct eud_chip *chip, u8 port_id)
{
struct device_node *controller_node;
struct phy *phy;
+ struct usb_role_switch *role_sw;
/*
* Multiply port_id by 2 to get controller port number:
@@ -309,16 +310,31 @@ static int eud_parse_dt_port(struct eud_chip *chip, u8 port_id)
}
chip->phy[port_id] = phy;
+ /* Only fetch role switch if usb-role-switch property exists */
+ if (!of_property_read_bool(controller_node, "usb-role-switch")) {
+ of_node_put(controller_node);
+ return 0;
+ }
+
+ role_sw = usb_role_switch_find_by_fwnode(of_fwnode_handle(controller_node));
of_node_put(controller_node);
+ if (IS_ERR(role_sw))
+ return dev_err_probe(chip->dev, PTR_ERR(role_sw),
+ "failed to get role switch for port %u\n", port_id);
+
+ chip->role_sw[port_id] = role_sw;
+
return 0;
}
static void eud_role_switch_release(void *data)
{
struct eud_chip *chip = data;
+ int i;
- usb_role_switch_put(chip->role_sw);
+ for (i = 0; i < EUD_MAX_PORTS; i++)
+ usb_role_switch_put(chip->role_sw[i]);
}
static int eud_probe(struct platform_device *pdev)
@@ -344,11 +360,6 @@ static int eud_probe(struct platform_device *pdev)
/* Secondary port is optional */
eud_parse_dt_port(chip, 1);
- chip->role_sw = usb_role_switch_get(&pdev->dev);
- if (IS_ERR(chip->role_sw))
- return dev_err_probe(chip->dev, PTR_ERR(chip->role_sw),
- "failed to get role switch\n");
-
ret = devm_add_action_or_reset(chip->dev, eud_role_switch_release, chip);
if (ret)
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 05/10] usb: misc: qcom_eud: improve enable_store API
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (3 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 04/10] usb: misc: qcom_eud: add per-port role switch support Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 06/10] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
` (4 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
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.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/usb/misc/qcom_eud.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index 1936b45791d2..4fd08962d4fb 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -148,18 +148,27 @@ static ssize_t enable_store(struct device *dev,
if (kstrtobool(buf, &enable))
return -EINVAL;
+ /* Skip operation if already in desired state */
+ if (chip->enabled == enable)
+ return count;
+
if (enable) {
ret = enable_eud(chip);
- if (!ret)
- chip->enabled = enable;
- else
- disable_eud(chip);
-
+ if (ret) {
+ dev_err(chip->dev, "failed to enable eud\n");
+ return ret;
+ }
} else {
ret = disable_eud(chip);
+ if (ret) {
+ dev_err(chip->dev, "failed to disable eud\n");
+ return ret;
+ }
}
- return ret < 0 ? ret : count;
+ chip->enabled = enable;
+
+ return count;
}
static DEVICE_ATTR_RW(enable);
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 06/10] usb: misc: qcom_eud: fix virtual attach/detach event handling
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (4 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 05/10] usb: misc: qcom_eud: improve enable_store API Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 07/10] usb: misc: qcom_eud: add host mode coordination Elson Serrao
` (3 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
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.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/usb/misc/qcom_eud.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index 4fd08962d4fb..3a71a0d27b5e 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -280,10 +280,26 @@ static irqreturn_t handle_eud_irq_thread(int irq, void *data)
struct eud_chip *chip = data;
int ret;
+ /*
+ * EUD virtual attach/detach event handling for low power debugging:
+ *
+ * When EUD is enabled in debug mode, the device remains physically
+ * connected to the PC throughout the debug session, keeping the USB
+ * controller active. This prevents testing of low power scenarios that
+ * require USB disconnection.
+ *
+ * EUD solves this by providing virtual USB attach/detach events while
+ * maintaining the physical connection. These events are triggered from
+ * the Host PC via the enumerated EUD control interface and delivered
+ * to the EUD driver as interrupts.
+ *
+ * These notifications are forwarded to the USB controller through role
+ * switch framework.
+ */
if (chip->usb_attached)
ret = usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE_DEVICE);
else
- ret = usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE_HOST);
+ ret = usb_role_switch_set_role(chip->role_sw[chip->port_idx], USB_ROLE_NONE);
if (ret)
dev_err(chip->dev, "failed to set role switch\n");
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 07/10] usb: misc: qcom_eud: add host mode coordination
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (5 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 06/10] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 08/10] usb: dwc3: qcom: notify EUD driver of role changes Elson Serrao
` (2 subsequent siblings)
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
EUD functions by presenting itself as a USB device to the host PC for
debugging, making it incompatible with USB host mode configurations.
Handle below two scenarios to prevent these conflicts:
1. Prevent user from enabling EUD via sysfs when the USB port is
in host mode.
2. Automatically disable EUD when USB port switches to host mode
and re-enable it when exiting host mode. This is achieved via
the exported qcom_eud_usb_role_notify() API that allows the USB
controller driver to notify EUD of role changes.
This ensures consistent state management without creating conflicts
between the EUD debug hub and the USB controller.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/usb/misc/qcom_eud.c | 110 ++++++++++++++++++++++++++++++++++-
include/linux/usb/qcom_eud.h | 21 +++++++
2 files changed, 130 insertions(+), 1 deletion(-)
create mode 100644 include/linux/usb/qcom_eud.h
diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
index 3a71a0d27b5e..e01605e1dac8 100644
--- a/drivers/usb/misc/qcom_eud.c
+++ b/drivers/usb/misc/qcom_eud.c
@@ -12,11 +12,13 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
+#include <linux/of_platform.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/usb/role.h>
+#include <linux/usb/qcom_eud.h>
#include <linux/firmware/qcom/qcom_scm.h>
#define EUD_REG_INT1_EN_MASK 0x0024
@@ -42,11 +44,14 @@ struct eud_chip {
struct phy *phy[EUD_MAX_PORTS];
void __iomem *base;
phys_addr_t mode_mgr;
+ /* serializes EUD control operations */
+ struct mutex state_lock;
unsigned int int_status;
int irq;
bool enabled;
bool usb_attached;
bool phy_enabled;
+ bool eud_disabled_for_host;
u8 port_idx;
};
@@ -142,17 +147,43 @@ static ssize_t enable_store(struct device *dev,
const char *buf, size_t count)
{
struct eud_chip *chip = dev_get_drvdata(dev);
+ enum usb_role role;
bool enable;
int ret;
if (kstrtobool(buf, &enable))
return -EINVAL;
+ guard(mutex)(&chip->state_lock);
+
/* Skip operation if already in desired state */
if (chip->enabled == enable)
return count;
+ /*
+ * Handle double-disable scenario: User is disabling EUD that was already
+ * disabled due to host mode. Since the hardware is already disabled, we
+ * only need to clear the host-disabled flag to prevent unwanted re-enabling
+ * when exiting host mode. This respects the user's explicit disable request.
+ */
+ if (!enable && chip->eud_disabled_for_host) {
+ chip->eud_disabled_for_host = false;
+ chip->enabled = false;
+ return count;
+ }
+
if (enable) {
+ /*
+ * EUD functions by presenting itself as a USB device to the host PC for
+ * debugging, making it incompatible with USB host mode configuration.
+ * Prevent enabling EUD in this configuration to avoid hardware conflicts.
+ */
+ role = usb_role_switch_get_role(chip->role_sw[chip->port_idx]);
+ if (role == USB_ROLE_HOST) {
+ dev_err(chip->dev, "Cannot enable EUD: USB port is in host mode\n");
+ return -EBUSY;
+ }
+
ret = enable_eud(chip);
if (ret) {
dev_err(chip->dev, "failed to enable eud\n");
@@ -353,6 +384,75 @@ static int eud_parse_dt_port(struct eud_chip *chip, u8 port_id)
return 0;
}
+/**
+ * qcom_eud_usb_role_notify - Notify EUD of USB role change
+ * @eud_node: Device node of the EUD device
+ * @phy: HSUSB PHY of the port changing role
+ * @role: New role being set
+ *
+ * Notifies EUD that a USB port is changing roles. EUD will disable itself
+ * if the port is switching to HOST mode, as EUD is incompatible with host
+ * mode operation. This API should be called by the USB controller driver
+ * when it switches the USB role.
+ *
+ * The PHY parameter is used to identify which physical USB port is changing
+ * roles. This is important in multi-port systems where EUD may be active on
+ * one port while another port changes roles.
+ *
+ * This is a best-effort notification - failures are logged but do not affect
+ * the role change operation.
+ */
+void qcom_eud_usb_role_notify(struct device_node *eud_node, struct phy *phy,
+ enum usb_role role)
+{
+ struct platform_device *pdev;
+ struct eud_chip *chip;
+ int ret;
+
+ if (!of_device_is_compatible(eud_node, "qcom,eud"))
+ return;
+
+ pdev = of_find_device_by_node(eud_node);
+ if (!pdev)
+ return;
+
+ chip = platform_get_drvdata(pdev);
+ if (!chip)
+ goto put_dev;
+
+ mutex_lock(&chip->state_lock);
+
+ /* Only act if this notification is for the currently active EUD port */
+ if (!chip->enabled || chip->phy[chip->port_idx] != phy) {
+ mutex_unlock(&chip->state_lock);
+ goto put_dev;
+ }
+
+ /*
+ * chip->enabled preserves user's sysfs configuration and is not modified
+ * during host mode transitions to preserve user intent.
+ */
+ if (role == USB_ROLE_HOST && !chip->eud_disabled_for_host) {
+ ret = disable_eud(chip);
+ if (ret)
+ dev_err(chip->dev, "Failed to disable EUD for host mode: %d\n", ret);
+ else
+ chip->eud_disabled_for_host = true;
+ } else if (role != USB_ROLE_HOST && chip->eud_disabled_for_host) {
+ ret = enable_eud(chip);
+ if (ret)
+ dev_err(chip->dev, "Failed to re-enable EUD after host mode: %d\n", ret);
+ else
+ chip->eud_disabled_for_host = false;
+ }
+
+ mutex_unlock(&chip->state_lock);
+
+put_dev:
+ platform_device_put(pdev);
+}
+EXPORT_SYMBOL_GPL(qcom_eud_usb_role_notify);
+
static void eud_role_switch_release(void *data)
{
struct eud_chip *chip = data;
@@ -374,6 +474,8 @@ static int eud_probe(struct platform_device *pdev)
chip->dev = &pdev->dev;
+ mutex_init(&chip->state_lock);
+
/*
* Parse the DT resources for primary port.
* This is the default EUD port and is mandatory.
@@ -418,8 +520,14 @@ static void eud_remove(struct platform_device *pdev)
{
struct eud_chip *chip = platform_get_drvdata(pdev);
- if (chip->enabled)
+ platform_set_drvdata(pdev, NULL);
+
+ mutex_lock(&chip->state_lock);
+ if (chip->enabled) {
disable_eud(chip);
+ chip->enabled = false;
+ }
+ mutex_unlock(&chip->state_lock);
device_init_wakeup(&pdev->dev, false);
disable_irq_wake(chip->irq);
diff --git a/include/linux/usb/qcom_eud.h b/include/linux/usb/qcom_eud.h
new file mode 100644
index 000000000000..57e86056303c
--- /dev/null
+++ b/include/linux/usb/qcom_eud.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __LINUX_USB_QCOM_EUD_H
+#define __LINUX_USB_QCOM_EUD_H
+
+#include <linux/usb/role.h>
+
+#if IS_ENABLED(CONFIG_USB_QCOM_EUD)
+void qcom_eud_usb_role_notify(struct device_node *eud_node, struct phy *phy,
+ enum usb_role role);
+#else
+static inline void qcom_eud_usb_role_notify(struct device_node *eud_node, struct phy *phy,
+ enum usb_role role)
+{
+}
+#endif
+
+#endif /* __LINUX_USB_QCOM_EUD_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 08/10] usb: dwc3: qcom: notify EUD driver of role changes
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (6 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 07/10] usb: misc: qcom_eud: add host mode coordination Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 09/10] arm64: dts: qcom: kodiak: Fix EUD USB controller connection Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 10/10] arm64: dts: qcom: Map USB connector to EUD for kodiak boards Elson Serrao
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
The EUD driver needs USB role information to control its operation as
it is incompatible with host mode. Notify the EUD driver when role
changes occur so it can manage its state accordingly.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/usb/dwc3/Kconfig | 1 +
drivers/usb/dwc3/dwc3-qcom.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 240b15bc52cb..1a2d7c883b50 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -132,6 +132,7 @@ config USB_DWC3_QCOM
depends on ARCH_QCOM || COMPILE_TEST
depends on EXTCON || !EXTCON
depends on OF
+ depends on USB_QCOM_EUD || !USB_QCOM_EUD
default USB_DWC3
help
Some Qualcomm SoCs use DesignWare Core IP for USB2/3
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 9ac75547820d..b51fd97521df 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -9,6 +9,7 @@
#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/of_clk.h>
+#include <linux/of_graph.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/interconnect.h>
@@ -19,6 +20,7 @@
#include <linux/iopoll.h>
#include <linux/usb/hcd.h>
#include <linux/usb.h>
+#include <linux/usb/qcom_eud.h>
#include "core.h"
#include "glue.h"
@@ -561,6 +563,7 @@ static int dwc3_qcom_setup_irq(struct dwc3_qcom *qcom, struct platform_device *p
static void dwc3_qcom_set_role_notifier(struct dwc3 *dwc, enum usb_role next_role)
{
struct dwc3_qcom *qcom = to_dwc3_qcom(dwc);
+ struct device_node *eud_node;
if (qcom->current_role == next_role)
return;
@@ -570,6 +573,13 @@ static void dwc3_qcom_set_role_notifier(struct dwc3 *dwc, enum usb_role next_rol
return;
}
+ /* Notify EUD of role change */
+ eud_node = of_graph_get_remote_node(qcom->dev->of_node, 0, -1);
+ if (eud_node) {
+ qcom_eud_usb_role_notify(eud_node, dwc->usb2_generic_phy[0], next_role);
+ of_node_put(eud_node);
+ }
+
if (qcom->current_role == USB_ROLE_DEVICE)
dwc3_qcom_vbus_override_enable(qcom, false);
else if (qcom->current_role != USB_ROLE_DEVICE)
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 09/10] arm64: dts: qcom: kodiak: Fix EUD USB controller connection
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (7 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 08/10] usb: dwc3: qcom: notify EUD driver of role changes Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 10/10] arm64: dts: qcom: Map USB connector to EUD for kodiak boards Elson Serrao
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
The EUD node is currently mapped to the secondary USB controller. This
SoC only supports EUD on the primary High-Speed USB path.
Fix the graph connections to properly map EUD to the primary USB
controller. Add an empty connector endpoint for board DTS files to
complete the connection. Also enable EUD so debug is available by
default on this SoC.
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/kodiak.dtsi | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
index 6079e67ea829..24483ff2d5ce 100644
--- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
+++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
@@ -4294,12 +4294,6 @@ usb_2: usb@8c00000 {
phy-names = "usb2-phy";
maximum-speed = "high-speed";
usb-role-switch;
-
- port {
- usb2_role_switch: endpoint {
- remote-endpoint = <&eud_ep>;
- };
- };
};
qspi: spi@88dc000 {
@@ -4623,16 +4617,22 @@ eud: eud@88e0000 {
<0 0x88e2000 0 0x1000>;
interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>;
- status = "disabled";
-
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
+
eud_ep: endpoint {
- remote-endpoint = <&usb2_role_switch>;
+ remote-endpoint = <&usb_1_dwc3_hs>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ eud_con: endpoint {
};
};
};
@@ -4858,6 +4858,7 @@ port@0 {
reg = <0>;
usb_1_dwc3_hs: endpoint {
+ remote-endpoint = <&eud_ep>;
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH RFC v3 10/10] arm64: dts: qcom: Map USB connector to EUD for kodiak boards
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
` (8 preceding siblings ...)
2026-03-09 20:33 ` [PATCH RFC v3 09/10] arm64: dts: qcom: kodiak: Fix EUD USB controller connection Elson Serrao
@ 2026-03-09 20:33 ` Elson Serrao
9 siblings, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-09 20:33 UTC (permalink / raw)
To: Greg Kroah-Hartman, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury
Cc: linux-arm-msm, devicetree, linux-usb, linux-kernel
Map the USB connector HS endpoint to EUD for debug functionality on all
boards using kodiak.dtsi. Since the controller is no longer a direct
neighbor of the connector, add usb-role-switch phandle to map the USB
role switch provider for this connector.
Depends-on: 20260223191042.825136-2-elson.serrao@oss.qualcomm.com
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 11 ++++++-----
arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts | 11 ++++++-----
arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts | 11 ++++++-----
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 11 ++++++-----
.../boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 11 ++++++-----
arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts | 11 ++++++-----
6 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 455e5c9bb072..dbd968967dd5 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -88,6 +88,7 @@ connector@0 {
reg = <0>;
power-role = "dual";
data-role = "dual";
+ usb-role-switch = <&usb_1>;
ports {
#address-cells = <1>;
@@ -97,7 +98,7 @@ port@0 {
reg = <0>;
pmic_glink_hs_in: endpoint {
- remote-endpoint = <&usb_1_dwc3_hs>;
+ remote-endpoint = <&eud_con>;
};
};
@@ -1433,10 +1434,6 @@ &usb_1 {
status = "okay";
};
-&usb_1_dwc3_hs {
- remote-endpoint = <&pmic_glink_hs_in>;
-};
-
&usb_1_hsphy {
vdda-pll-supply = <&vreg_l10c>;
vdda18-supply = <&vreg_l1c>;
@@ -1476,3 +1473,7 @@ &wifi {
qcom,calibration-variant = "Fairphone_5";
status = "okay";
};
+
+&eud_con {
+ remote-endpoint = <&pmic_glink_hs_in>;
+};
diff --git a/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts b/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts
index bf18c4852081..ca9c1a09ca73 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts
@@ -65,6 +65,7 @@ connector@0 {
reg = <0>;
power-role = "dual";
data-role = "dual";
+ usb-role-switch = <&usb_1>;
ports {
#address-cells = <1>;
@@ -74,7 +75,7 @@ port@0 {
reg = <0>;
pmic_glink_hs_in: endpoint {
- remote-endpoint = <&usb_1_dwc3_hs>;
+ remote-endpoint = <&eud_con>;
};
};
@@ -826,10 +827,6 @@ &usb_1 {
status = "okay";
};
-&usb_1_dwc3_hs {
- remote-endpoint = <&pmic_glink_hs_in>;
-};
-
&usb_1_hsphy {
vdda-pll-supply = <&vreg_l10c_0p88>;
vdda33-supply = <&vreg_l2b_3p072>;
@@ -862,3 +859,7 @@ &usb_2_hsphy {
&usb_dp_qmpphy_out {
remote-endpoint = <&pmic_glink_ss_in>;
};
+
+&eud_con {
+ remote-endpoint = <&pmic_glink_hs_in>;
+};
diff --git a/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts b/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts
index 797f37596bf1..eb7e228787c2 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts
@@ -75,6 +75,7 @@ connector@0 {
reg = <0>;
power-role = "dual";
data-role = "dual";
+ usb-role-switch = <&usb_1>;
ports {
#address-cells = <1>;
@@ -84,7 +85,7 @@ port@0 {
reg = <0>;
pmic_glink_hs_in: endpoint {
- remote-endpoint = <&usb_1_dwc3_hs>;
+ remote-endpoint = <&eud_con>;
};
};
@@ -952,10 +953,6 @@ &usb_1 {
status = "okay";
};
-&usb_1_dwc3_hs {
- remote-endpoint = <&pmic_glink_hs_in>;
-};
-
&usb_1_hsphy {
vdda-pll-supply = <&vreg_l10c>;
vdda18-supply = <&vreg_l1c>;
@@ -986,6 +983,10 @@ &usb_dp_qmpphy_out {
remote-endpoint = <&pmic_glink_ss_in>;
};
+&eud_con {
+ remote-endpoint = <&pmic_glink_hs_in>;
+};
+
&venus {
firmware-name = "qcom/qcm6490/SHIFT/otter/venus.mbn";
diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
index e3d2f01881ae..3cb7494b16f7 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
@@ -185,6 +185,7 @@ connector@0 {
reg = <0>;
power-role = "dual";
data-role = "dual";
+ usb-role-switch = <&usb_1>;
ports {
#address-cells = <1>;
@@ -194,7 +195,7 @@ port@0 {
reg = <0>;
pmic_glink_hs_in: endpoint {
- remote-endpoint = <&usb_1_dwc3_hs>;
+ remote-endpoint = <&eud_con>;
};
};
@@ -1303,14 +1304,14 @@ &usb_1 {
status = "okay";
};
-&usb_1_dwc3_hs {
- remote-endpoint = <&pmic_glink_hs_in>;
-};
-
&usb_1_dwc3_ss {
remote-endpoint = <&usb_dp_qmpphy_usb_ss_in>;
};
+&eud_con {
+ remote-endpoint = <&pmic_glink_hs_in>;
+};
+
&usb_1_hsphy {
vdda-pll-supply = <&vreg_l10c_0p88>;
vdda33-supply = <&vreg_l2b_3p072>;
diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
index 0b64a0b91202..a75b8e118deb 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
@@ -84,6 +84,7 @@ connector@0 {
reg = <0>;
power-role = "dual";
data-role = "dual";
+ usb-role-switch = <&usb_1>;
ports {
#address-cells = <1>;
@@ -93,7 +94,7 @@ port@0 {
reg = <0>;
pmic_glink_hs_in: endpoint {
- remote-endpoint = <&usb_1_dwc3_hs>;
+ remote-endpoint = <&eud_con>;
};
};
@@ -1090,10 +1091,6 @@ &usb_1 {
status = "okay";
};
-&usb_1_dwc3_hs {
- remote-endpoint = <&pmic_glink_hs_in>;
-};
-
&usb_1_hsphy {
vdda-pll-supply = <&vreg_l10c_0p88>;
vdda33-supply = <&vreg_l2b_3p072>;
@@ -1127,6 +1124,10 @@ &usb_dp_qmpphy_out {
remote-endpoint = <&pmic_glink_ss_in>;
};
+&eud_con {
+ remote-endpoint = <&pmic_glink_hs_in>;
+};
+
&ufs_mem_hc {
reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
vcc-supply = <&vreg_l7b_2p952>;
diff --git a/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts b/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts
index cb59c122f6f6..f99a47334452 100644
--- a/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts
+++ b/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts
@@ -90,6 +90,7 @@ connector@0 {
reg = <0>;
power-role = "dual";
data-role = "dual";
+ usb-role-switch = <&usb_1>;
ports {
#address-cells = <1>;
@@ -99,7 +100,7 @@ port@0 {
reg = <0>;
pmic_glink_hs_in: endpoint {
- remote-endpoint = <&usb_1_dwc3_hs>;
+ remote-endpoint = <&eud_con>;
};
};
@@ -1440,10 +1441,6 @@ &usb_1 {
status = "okay";
};
-&usb_1_dwc3_hs {
- remote-endpoint = <&pmic_glink_hs_in>;
-};
-
&usb_1_hsphy {
vdda-pll-supply = <&vdd_a_usbhs_core>;
vdda18-supply = <&vdd_a_usbhs_1p8>;
@@ -1459,3 +1456,7 @@ &venus {
&wifi {
status = "okay";
};
+
+&eud_con {
+ remote-endpoint = <&pmic_glink_hs_in>;
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
2026-03-09 20:33 ` [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
@ 2026-03-11 13:16 ` Greg Kroah-Hartman
2026-03-11 22:57 ` Elson Serrao
2026-03-13 12:10 ` Konrad Dybcio
0 siblings, 2 replies; 16+ messages in thread
From: Greg Kroah-Hartman @ 2026-03-11 13:16 UTC (permalink / raw)
To: Elson Serrao
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Souradeep Chowdhury, linux-arm-msm, devicetree,
linux-usb, linux-kernel
On Mon, Mar 09, 2026 at 01:33:29PM -0700, Elson Serrao wrote:
> 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.
>
> Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
> ---
> Documentation/ABI/testing/sysfs-driver-eud | 16 ++++++++
> drivers/usb/misc/qcom_eud.c | 43 ++++++++++++++++++++++
> 2 files changed, 59 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI/testing/sysfs-driver-eud
> index 2bab0db2d2f0..67223f73ee60 100644
> --- a/Documentation/ABI/testing/sysfs-driver-eud
> +++ b/Documentation/ABI/testing/sysfs-driver-eud
> @@ -7,3 +7,19 @@ Description:
> EUD based on a 1 or a 0 value. By enabling EUD,
> the user is able to activate the mini-usb hub of
> EUD for debug and trace capabilities.
> +
> +What: /sys/bus/platform/drivers/qcom_eud/.../port
> +Date: January 2026
> +Contact: Elson Serrao <elson.serrao@oss.qualcomm.com>
> +Description:
> + Selects which USB port the Embedded USB Debugger (EUD)
> + is mapped to on platforms providing multiple High-Speed
> + USB ports.
> +
> + Valid values:
> + 0 - Primary USB port
> + 1 - Secondary USB port
Why not use "primary" and "secondary" as values instead? That makes
this much simpler to understand.
> +
> + The attribute is writable only while EUD is disabled.
> + Reading the attribute returns the currently selected
> + USB port number.
> diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
> index 926419ca560f..1a136f8f1ae5 100644
> --- a/drivers/usb/misc/qcom_eud.c
> +++ b/drivers/usb/misc/qcom_eud.c
> @@ -23,8 +23,11 @@
> #define EUD_REG_VBUS_INT_CLR 0x0080
> #define EUD_REG_CSR_EUD_EN 0x1014
> #define EUD_REG_SW_ATTACH_DET 0x1018
> +#define EUD_REG_PORT_SEL 0x1028
> #define EUD_REG_EUD_EN2 0x0000
>
> +#define EUD_MAX_PORTS 2
> +
> #define EUD_ENABLE BIT(0)
> #define EUD_INT_PET_EUD BIT(0)
> #define EUD_INT_VBUS BIT(2)
> @@ -40,6 +43,7 @@ struct eud_chip {
> int irq;
> bool enabled;
> bool usb_attached;
> + u8 port_idx;
> };
>
> static int enable_eud(struct eud_chip *priv)
> @@ -104,8 +108,47 @@ static ssize_t enable_store(struct device *dev,
>
> static DEVICE_ATTR_RW(enable);
>
> +static ssize_t port_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct eud_chip *chip = dev_get_drvdata(dev);
> +
> + return sysfs_emit(buf, "%u\n", chip->port_idx);
Wait, you are returning a 0/1 here, yet using a u8? How can that work?
confused,
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
2026-03-11 13:16 ` Greg Kroah-Hartman
@ 2026-03-11 22:57 ` Elson Serrao
2026-03-13 12:10 ` Konrad Dybcio
1 sibling, 0 replies; 16+ messages in thread
From: Elson Serrao @ 2026-03-11 22:57 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Souradeep Chowdhury, linux-arm-msm, devicetree,
linux-usb, linux-kernel
On 3/11/2026 6:16 AM, Greg Kroah-Hartman wrote:
[...]
>> +
>> +What: /sys/bus/platform/drivers/qcom_eud/.../port
>> +Date: January 2026
>> +Contact: Elson Serrao <elson.serrao@oss.qualcomm.com>
>> +Description:
>> + Selects which USB port the Embedded USB Debugger (EUD)
>> + is mapped to on platforms providing multiple High-Speed
>> + USB ports.
>> +
>> + Valid values:
>> + 0 - Primary USB port
>> + 1 - Secondary USB port
>
> Why not use "primary" and "secondary" as values instead? That makes
> this much simpler to understand.
>
[...]
>>
>> +static ssize_t port_show(struct device *dev,
>> + struct device_attribute *attr, char *buf)
>> +{
>> + struct eud_chip *chip = dev_get_drvdata(dev);
>> +
>> + return sysfs_emit(buf, "%u\n", chip->port_idx);
>
> Wait, you are returning a 0/1 here, yet using a u8? How can that work?
>
Thanks for the review, Greg.
I’ll switch the sysfs attribute to use "primary"/"secondary" values
(instead of numeric 0/1) as suggested and update the ABI doc and driver.
This should also resolve the ambiguity around the current 0/1 output.
Regards,
Elson
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
2026-03-11 13:16 ` Greg Kroah-Hartman
2026-03-11 22:57 ` Elson Serrao
@ 2026-03-13 12:10 ` Konrad Dybcio
2026-03-13 12:45 ` Greg Kroah-Hartman
1 sibling, 1 reply; 16+ messages in thread
From: Konrad Dybcio @ 2026-03-13 12:10 UTC (permalink / raw)
To: Greg Kroah-Hartman, Elson Serrao
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Souradeep Chowdhury, linux-arm-msm, devicetree,
linux-usb, linux-kernel
On 3/11/26 2:16 PM, Greg Kroah-Hartman wrote:
> On Mon, Mar 09, 2026 at 01:33:29PM -0700, Elson Serrao wrote:
>> 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.
>>
>> Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
>> ---
>> Documentation/ABI/testing/sysfs-driver-eud | 16 ++++++++
>> drivers/usb/misc/qcom_eud.c | 43 ++++++++++++++++++++++
>> 2 files changed, 59 insertions(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI/testing/sysfs-driver-eud
>> index 2bab0db2d2f0..67223f73ee60 100644
>> --- a/Documentation/ABI/testing/sysfs-driver-eud
>> +++ b/Documentation/ABI/testing/sysfs-driver-eud
>> @@ -7,3 +7,19 @@ Description:
>> EUD based on a 1 or a 0 value. By enabling EUD,
>> the user is able to activate the mini-usb hub of
>> EUD for debug and trace capabilities.
>> +
>> +What: /sys/bus/platform/drivers/qcom_eud/.../port
>> +Date: January 2026
>> +Contact: Elson Serrao <elson.serrao@oss.qualcomm.com>
>> +Description:
>> + Selects which USB port the Embedded USB Debugger (EUD)
>> + is mapped to on platforms providing multiple High-Speed
>> + USB ports.
>> +
>> + Valid values:
>> + 0 - Primary USB port
>> + 1 - Secondary USB port
>
> Why not use "primary" and "secondary" as values instead? That makes
> this much simpler to understand.
It's not inconceivable that future iterations of this hardware will let
one mux between more than two USB PHYs/ports (there are already a multitude
of SoCs where we have 4 or more USB controllers and >= that ports)
Konrad
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
2026-03-13 12:10 ` Konrad Dybcio
@ 2026-03-13 12:45 ` Greg Kroah-Hartman
2026-03-13 12:50 ` Konrad Dybcio
0 siblings, 1 reply; 16+ messages in thread
From: Greg Kroah-Hartman @ 2026-03-13 12:45 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Elson Serrao, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury,
linux-arm-msm, devicetree, linux-usb, linux-kernel
On Fri, Mar 13, 2026 at 01:10:10PM +0100, Konrad Dybcio wrote:
> On 3/11/26 2:16 PM, Greg Kroah-Hartman wrote:
> > On Mon, Mar 09, 2026 at 01:33:29PM -0700, Elson Serrao wrote:
> >> 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.
> >>
> >> Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
> >> ---
> >> Documentation/ABI/testing/sysfs-driver-eud | 16 ++++++++
> >> drivers/usb/misc/qcom_eud.c | 43 ++++++++++++++++++++++
> >> 2 files changed, 59 insertions(+)
> >>
> >> diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI/testing/sysfs-driver-eud
> >> index 2bab0db2d2f0..67223f73ee60 100644
> >> --- a/Documentation/ABI/testing/sysfs-driver-eud
> >> +++ b/Documentation/ABI/testing/sysfs-driver-eud
> >> @@ -7,3 +7,19 @@ Description:
> >> EUD based on a 1 or a 0 value. By enabling EUD,
> >> the user is able to activate the mini-usb hub of
> >> EUD for debug and trace capabilities.
> >> +
> >> +What: /sys/bus/platform/drivers/qcom_eud/.../port
> >> +Date: January 2026
> >> +Contact: Elson Serrao <elson.serrao@oss.qualcomm.com>
> >> +Description:
> >> + Selects which USB port the Embedded USB Debugger (EUD)
> >> + is mapped to on platforms providing multiple High-Speed
> >> + USB ports.
> >> +
> >> + Valid values:
> >> + 0 - Primary USB port
> >> + 1 - Secondary USB port
> >
> > Why not use "primary" and "secondary" as values instead? That makes
> > this much simpler to understand.
>
> It's not inconceivable that future iterations of this hardware will let
> one mux between more than two USB PHYs/ports (there are already a multitude
> of SoCs where we have 4 or more USB controllers and >= that ports)
Great, and how will that be defined? As a number? Name? Something
else?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection
2026-03-13 12:45 ` Greg Kroah-Hartman
@ 2026-03-13 12:50 ` Konrad Dybcio
0 siblings, 0 replies; 16+ messages in thread
From: Konrad Dybcio @ 2026-03-13 12:50 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Elson Serrao, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Souradeep Chowdhury,
linux-arm-msm, devicetree, linux-usb, linux-kernel
On 3/13/26 1:45 PM, Greg Kroah-Hartman wrote:
> On Fri, Mar 13, 2026 at 01:10:10PM +0100, Konrad Dybcio wrote:
>> On 3/11/26 2:16 PM, Greg Kroah-Hartman wrote:
>>> On Mon, Mar 09, 2026 at 01:33:29PM -0700, Elson Serrao wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
>>>> ---
>>>> Documentation/ABI/testing/sysfs-driver-eud | 16 ++++++++
>>>> drivers/usb/misc/qcom_eud.c | 43 ++++++++++++++++++++++
>>>> 2 files changed, 59 insertions(+)
>>>>
>>>> diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI/testing/sysfs-driver-eud
>>>> index 2bab0db2d2f0..67223f73ee60 100644
>>>> --- a/Documentation/ABI/testing/sysfs-driver-eud
>>>> +++ b/Documentation/ABI/testing/sysfs-driver-eud
>>>> @@ -7,3 +7,19 @@ Description:
>>>> EUD based on a 1 or a 0 value. By enabling EUD,
>>>> the user is able to activate the mini-usb hub of
>>>> EUD for debug and trace capabilities.
>>>> +
>>>> +What: /sys/bus/platform/drivers/qcom_eud/.../port
>>>> +Date: January 2026
>>>> +Contact: Elson Serrao <elson.serrao@oss.qualcomm.com>
>>>> +Description:
>>>> + Selects which USB port the Embedded USB Debugger (EUD)
>>>> + is mapped to on platforms providing multiple High-Speed
>>>> + USB ports.
>>>> +
>>>> + Valid values:
>>>> + 0 - Primary USB port
>>>> + 1 - Secondary USB port
>>>
>>> Why not use "primary" and "secondary" as values instead? That makes
>>> this much simpler to understand.
>>
>> It's not inconceivable that future iterations of this hardware will let
>> one mux between more than two USB PHYs/ports (there are already a multitude
>> of SoCs where we have 4 or more USB controllers and >= that ports)
>
> Great, and how will that be defined? As a number? Name? Something
> else?
Perhaps it makes more sense to me, since if I look at the other
computer, the controllers are named USB0, USB1 and so on.. We follow
this naming in DT too, so it felt natural
How they end up mapping to physical connectors is of course up to the
implementer.
Ultimately, I don't mind either
Konrad
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-03-13 12:51 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 20:33 [PATCH RFC v3 00/10] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 01/10] dt-bindings: soc: qcom: eud: Add support for dual-port configuration Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 02/10] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
2026-03-11 13:16 ` Greg Kroah-Hartman
2026-03-11 22:57 ` Elson Serrao
2026-03-13 12:10 ` Konrad Dybcio
2026-03-13 12:45 ` Greg Kroah-Hartman
2026-03-13 12:50 ` Konrad Dybcio
2026-03-09 20:33 ` [PATCH RFC v3 03/10] usb: misc: qcom_eud: add per-port High-Speed PHY control Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 04/10] usb: misc: qcom_eud: add per-port role switch support Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 05/10] usb: misc: qcom_eud: improve enable_store API Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 06/10] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 07/10] usb: misc: qcom_eud: add host mode coordination Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 08/10] usb: dwc3: qcom: notify EUD driver of role changes Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 09/10] arm64: dts: qcom: kodiak: Fix EUD USB controller connection Elson Serrao
2026-03-09 20:33 ` [PATCH RFC v3 10/10] arm64: dts: qcom: Map USB connector to EUD for kodiak boards Elson Serrao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox