Skip to contentSkip to conversation

phy: usb: Toggle the PHY power during init

PATCH Applied Justin Chen 3 participants 3 messages Oct 24, 2024 – Dec 8, 2024

Subsystems (2)
lore
Share & tools
lore

Justin Chen

author maintainer
#0 lore raw

PATCH 1/1 phy: usb: Toggle the PHY power during init

When bringing up the PHY, it might be in a bad state if left powered. One case is we lose the PLL lock if the PLL is gated while the PHY is powered. Toggle the PHY power so we can start from a known state.

Fixes 4e5b9c9a73b3 ("phy: usb: Add support for new Synopsys USB controller on the 7216")
---
 drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c +6 -0
index 4c10cafded4e..530b571607c0 100644
@@ -323,6 +323,12 @@ static void usb_init_common_7216(struct brcm_usb_init_params *params)
 	void __iomem *ctrl = params->regs[BRCM_REGS_CTRL];
 
 	USB_CTRL_UNSET(ctrl, USB_PM, XHC_S2_CLK_SWITCH_EN);
+
+	/*
+	 * The PHY might be in a bad state if it is already powered
+	 * up. Toggle the power just in case.
+	 */
+	USB_CTRL_SET(ctrl, USB_PM, USB_PWRDN);
 	USB_CTRL_UNSET(ctrl, USB_PM, USB_PWRDN);
 
 	/* 1 millisecond - for USB clocks to settle down */
Signature · 7 lines
2.34.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Justin Chen

When bringing up the PHY, it might be in a bad state if left powered. One case is we lose the PLL lock if the PLL is gated while the PHY is powered. Toggle the PHY power so we can start from a known state.

Fixes 4e5b9c9a73b3 ("phy: usb: Add support for new Synopsys USB controller on the 7216")

Vinod, can you take this one? Thanks!

Signature · 7 lines
Florian


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
maintainer Applied
#2 lore raw
In reply to Justin Chen
Quoted 5 lines · Justin Chen

When bringing up the PHY, it might be in a bad state if left powered. One case is we lose the PLL lock if the PLL is gated while the PHY is powered. Toggle the PHY power so we can start from a known state.

Applied, thanks!

[1/1] phy: usb: Toggle the PHY power during init

      commit: 0a92ea87bdd6f77ca4e17fe19649882cf5209edd

Best regards,

Signature · 8 lines
~Vinod



-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy