]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: ehci-mx6: move phy setup before register access
authorTim Harvey <tharvey@gateworks.com>
Fri, 28 Apr 2023 18:50:30 +0000 (11:50 -0700)
committerStefano Babic <sbabic@denx.de>
Tue, 2 May 2023 08:57:32 +0000 (10:57 +0200)
For the CONFIG_PHY case, move the PHY setup before the register access.

This avoids a hang when updating the imx8mm.dtsi which moves the
USB OTG power-domains to the PHY.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Fabio Estevam <festevam@denx.de>
drivers/usb/host/ehci-mx6.c

index 91633f013a553ecd25db5f85c422dfaeb1754901..fae20838c60aff8c49b419041a270a255ef99339 100644 (file)
@@ -703,6 +703,10 @@ static int ehci_usb_probe(struct udevice *dev)
        usb_internal_phy_clock_gate(priv->phy_addr, 1);
        usb_phy_enable(ehci, priv->phy_addr);
 #endif
+#else
+       ret = generic_setup_phy(dev, &priv->phy, 0);
+       if (ret)
+               goto err_regulator;
 #endif
 
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
@@ -725,12 +729,6 @@ static int ehci_usb_probe(struct udevice *dev)
 
        mdelay(10);
 
-#if defined(CONFIG_PHY)
-       ret = generic_setup_phy(dev, &priv->phy, 0);
-       if (ret)
-               goto err_regulator;
-#endif
-
        hccr = (struct ehci_hccr *)((uintptr_t)&ehci->caplength);
        hcor = (struct ehci_hcor *)((uintptr_t)hccr +
                        HC_LENGTH(ehci_readl(&(hccr)->cr_capbase)));