Skip to contentSkip to conversation

usb: ehci-mx6: move phy setup before register access

PATCH New Tim Harvey 2 participants 2 messages Apr 28, 2023 – May 2, 2023

Subsystems (2)
lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 usb: ehci-mx6: move phy setup before register access

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.

---
 drivers/usb/host/ehci-mx6.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/usb/host/ehci-mx6.c +4 -6
index 91633f013a55..fae20838c60a 100644
@@ -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)));
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 usb: ehci-mx6: move phy setup before register access

Quoted 5 lines

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.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================