summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/dwc3/dwc3-generic.c10
-rw-r--r--drivers/usb/host/xhci.c2
-rw-r--r--test/py/tests/test_usb.py4
3 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index c09014aec60..bb11613a587 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <reset.h>
#include <asm/gpio.h>
+#include <dm/device_compat.h>
#include <dm/lists.h>
#include <linux/delay.h>
#include <linux/usb/gadget.h>
@@ -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__);
@@ -706,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" },
{ }
};
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 $?')