From 13c9c975e79b73626507702cc2117b7efa3abe9a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 28 Nov 2025 07:46:47 +0100 Subject: [PATCH 1/3] usb: xhci: avoid noisy 'Starting the controller' message. We should avoid overwhelming users with non-essential messages. The message 'Starting the controller' is not written for EHCI. We should not write it for XHCI either. Adjust the Python test accordingly. Signed-off-by: Heinrich Schuchardt Reviewed-by: Mattijs Korpershoek --- drivers/usb/host/xhci.c | 2 +- test/py/tests/test_usb.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index d59804580f1..c3986dac3e8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -158,7 +158,7 @@ static int xhci_start(struct xhci_hcor *hcor) u32 temp; int ret; - puts("Starting the controller\n"); + debug("Starting the controller\n"); temp = xhci_readl(&hcor->or_usbcmd); temp |= (CMD_RUN); xhci_writel(&hcor->or_usbcmd, temp); diff --git a/test/py/tests/test_usb.py b/test/py/tests/test_usb.py index 1dcd0834f55..9226d1c174d 100644 --- a/test/py/tests/test_usb.py +++ b/test/py/tests/test_usb.py @@ -58,7 +58,7 @@ def test_usb_start(ubman): assert 'USB init failed' not in output assert 'starting USB...' in output - if 'Starting the controller' in output: + if ubman.config.buildconfig.get('config_usb_xhci_hcd'): assert 'USB XHCI' in output output = ubman.run_command('echo $?') @@ -104,7 +104,7 @@ def test_usb_reset(ubman): assert 'USB init failed' not in output assert 'resetting USB...' in output - if 'Starting the controller' in output: + if ubman.config.buildconfig.get('config_usb_xhci_hcd'): assert 'USB XHCI' in output output = ubman.run_command('echo $?') From 218ad7ba3f13f98788cc4abaa057a249fdb3d4f1 Mon Sep 17 00:00:00 2001 From: Kaustabh Chakraborty Date: Thu, 8 Jan 2026 18:03:44 +0530 Subject: [PATCH 2/3] usb: dwc3-generic: allow fallback of dr_mode property to "otg" Documentation [1] states that the default value of the dr_mode property is "otg". It also isn't marked a mandatory node, so it may or may not be set. So, accordingly if dr_mode is not mentioned in the devicetree node, OTG mode must be assumed. In this driver however, this case is not handled. If dr_mode is not mentioned, USB_DR_MODE_UNKNOWN is set. The logic implemented raises an error, instead of falling back to USB_DR_MODE_OTG. Correct this to conform to the specification. Link: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/tree/Bindings/usb/usb-drd.yaml?h=v6.18-dts [1] Reviewed-by: Marek Vasut Signed-off-by: Kaustabh Chakraborty --- drivers/usb/dwc3/dwc3-generic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index c09014aec60..c15eda19e8f 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -173,8 +174,8 @@ static int dwc3_generic_of_to_plat(struct udevice *dev) node = dev_ofnode(dev->parent); plat->dr_mode = usb_get_dr_mode(node); if (plat->dr_mode == USB_DR_MODE_UNKNOWN) { - pr_err("Invalid usb mode setup\n"); - return -ENODEV; + dev_info(dev, "No USB mode specified. Using 'otg'\n"); + plat->dr_mode = USB_DR_MODE_OTG; } } @@ -516,6 +517,10 @@ static int dwc3_glue_bind_common(struct udevice *parent, ofnode node) if (!dr_mode) dr_mode = usb_get_dr_mode(node); + /* usb mode must fallback to peripheral if not known */ + if (dr_mode == USB_DR_MODE_UNKNOWN) + dr_mode = USB_DR_MODE_OTG; + if (CONFIG_IS_ENABLED(DM_USB_GADGET) && (dr_mode == USB_DR_MODE_PERIPHERAL || dr_mode == USB_DR_MODE_OTG)) { debug("%s: dr_mode: OTG or Peripheral\n", __func__); From 14d9e84fc54b008ab1ad667bef73578b443dda73 Mon Sep 17 00:00:00 2001 From: Kaustabh Chakraborty Date: Thu, 8 Jan 2026 18:03:45 +0530 Subject: [PATCH 3/3] usb: dwc3-generic: add support for exynos7870 Exynos7870's DWC3 glue layer is quite simple, consisting of a few clocks, which is handled by this driver. Add the compatible string in here. Reviewed-by: Marek Vasut Signed-off-by: Kaustabh Chakraborty --- drivers/usb/dwc3/dwc3-generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index c15eda19e8f..bb11613a587 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -711,6 +711,7 @@ static const struct udevice_id dwc3_glue_ids[] = { { .compatible = "fsl,imx8mp-dwc3", .data = (ulong)&imx8mp_ops }, { .compatible = "fsl,imx8mq-dwc3" }, { .compatible = "intel,tangier-dwc3" }, + { .compatible = "samsung,exynos7870-dwusb3" }, { .compatible = "samsung,exynos850-dwusb3" }, { } };