The resynced core clears SUSPHY when it switches a DRD controller to
host mode. Linux sets it again in dwc3_xhci_plat_start(), but U-Boot
has no such hook and the bit stays off. The old code never cleared it.

Enable SUSPHY in the generic and layerscape host probe after
xhci_register(). That is a bit later than Linux. It is still before
any device is enumerated.

Signed-off-by: Anders Roxell <[email protected]>
---
 drivers/usb/dwc3/dwc3-generic.c    | 8 ++++++--
 drivers/usb/dwc3/dwc3-layerscape.c | 8 +++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 2406f8446179..cd4170bcb817 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -278,10 +278,14 @@ static int dwc3_generic_host_probe(struct udevice *dev)
                        HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
 
        rc = xhci_register(dev, hccr, hcor);
-       if (rc)
+       if (rc) {
                regulator_set_enable_if_allowed(priv->vbus_supply, false);
+               return rc;
+       }
 
-       return rc;
+       dwc3_enable_susphy(&priv->gen_priv.dwc3, true);
+
+       return 0;
 }
 
 static int dwc3_generic_host_remove(struct udevice *dev)
diff --git a/drivers/usb/dwc3/dwc3-layerscape.c 
b/drivers/usb/dwc3/dwc3-layerscape.c
index 108b44c67eb0..afa31c48be6c 100644
--- a/drivers/usb/dwc3/dwc3-layerscape.c
+++ b/drivers/usb/dwc3/dwc3-layerscape.c
@@ -153,7 +153,13 @@ static int dwc3_layerscape_host_probe(struct udevice *dev)
        hccr = priv->gen_priv.base;
        hcor = priv->gen_priv.base + HC_LENGTH(xhci_readl(&hccr->cr_capbase));
 
-       return xhci_register(dev, hccr, hcor);
+       rc = xhci_register(dev, hccr, hcor);
+       if (rc)
+               return rc;
+
+       dwc3_enable_susphy(&priv->gen_priv.dwc3, true);
+
+       return 0;
 }
 
 static int dwc3_layerscape_host_remove(struct udevice *dev)
-- 
2.53.0

Reply via email to