diff options
author | Tom Rini <trini@konsulko.com> | 2021-06-09 15:20:36 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-06-09 15:20:36 +0300 |
commit | 46704165f53a7e324b95313e20e928c3a8b93261 (patch) | |
tree | 6f853e05202c0ff4e9a3aea61b2f33e3cc487ca4 | |
parent | 5e425a31d33f679549b85776f55181fc3cd3e3b2 (diff) | |
parent | dcd2bbe0510d7d47d745eeea063496a83cb3b08e (diff) | |
download | u-boot-46704165f53a7e324b95313e20e928c3a8b93261.tar.xz |
Merge https://source.denx.de/u-boot/custodians/u-boot-usb
- dwc2 and cdns3 fixes
-rw-r--r-- | drivers/usb/cdns3/cdns3-ti.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/dwc2.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index 7b205c5656..43171678ee 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -101,7 +101,7 @@ static int cdns_ti_probe(struct udevice *dev) if (!data->usbss) return -EINVAL; - ret = clk_get_by_name(dev, "usb2_refclk", &usb2_refclk); + ret = clk_get_by_name(dev, "ref", &usb2_refclk); if (ret) { dev_err(dev, "Failed to get usb2_refclk\n"); return ret; diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index ec643e9f45..43cc2e0433 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -21,6 +21,7 @@ #include <asm/io.h> #include <dm/device_compat.h> #include <linux/delay.h> +#include <linux/usb/otg.h> #include <power/regulator.h> #include <reset.h> @@ -1204,7 +1205,13 @@ static int dwc2_init_common(struct udevice *dev, struct dwc2_priv *priv) #endif dwc_otg_core_init(dev); - dwc_otg_core_host_init(dev, regs); + + if (usb_get_dr_mode(dev_ofnode(dev)) == USB_DR_MODE_PERIPHERAL) { + dev_dbg(dev, "USB device %s dr_mode set to %d. Skipping host_init.\n", + dev->name, usb_get_dr_mode(dev_ofnode(dev))); + } else { + dwc_otg_core_host_init(dev, regs); + } clrsetbits_le32(®s->hprt0, DWC2_HPRT0_PRTENA | DWC2_HPRT0_PRTCONNDET | DWC2_HPRT0_PRTENCHNG | |