public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] usb: xhci-dwc3: Bail out if "dr_mode" is "peripheral"
@ 2024-12-06 11:04 Siddharth Vadapalli
  2024-12-09 13:20 ` Roger Quadros
  0 siblings, 1 reply; 5+ messages in thread
From: Siddharth Vadapalli @ 2024-12-06 11:04 UTC (permalink / raw)
  To: trini, marex, bmeng.cn, mkorpershoek, rogerq, jonas
  Cc: u-boot, srk, s-vadapalli

Since the compatible "snps,dwc3" can be specified in the device-tree for
the Designware USB Controller configured for not only Host and OTG modes
of operation, but also for Peripheral mode of operation, bail out if
"dr_mode" is "peripheral".

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---

Hello,

This patch is based on commit
448add55297 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-pmic
of the master branch of U-Boot.

Regards,
Siddharth.

 drivers/usb/host/xhci-dwc3.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index e3e0ceff43e..7b1311503fe 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -208,6 +208,9 @@ static int xhci_dwc3_probe(struct udevice *dev)
 	writel(reg, &dwc3_reg->g_usb2phycfg[0]);
 
 	dr_mode = usb_get_dr_mode(dev_ofnode(dev));
+	if (dr_mode == USB_DR_MODE_PERIPHERAL)
+		return -ENODEV;
+
 	if (dr_mode == USB_DR_MODE_OTG &&
 	    dev_read_bool(dev, "usb-role-switch")) {
 		dr_mode = usb_get_role_switch_default_mode(dev_ofnode(dev));
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-16 10:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06 11:04 [PATCH] usb: xhci-dwc3: Bail out if "dr_mode" is "peripheral" Siddharth Vadapalli
2024-12-09 13:20 ` Roger Quadros
2025-01-16  9:36   ` Mattijs Korpershoek
2025-01-16 10:18     ` Siddharth Vadapalli
2025-01-16 10:28       ` Mattijs Korpershoek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox