Skip to contentSkip to conversation

phy: phy-brcm-usb-init: Fix power down USB 3.0 PHY when XHCI reenabled

PATCH In review Jaedon Shin 2 participants 2 messages Jun 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: phy-brcm-usb-init: Fix power down USB 3.0 PHY when XHCI reenabled

Unset is required to enable USB 3.0 PHY when XHCI reenabled in response to setting PHY3_IDDQ_OVERRIDE in uninit().

Fixes cd6f769fdea7 ("phy: phy-brcm-usb-init: Power down USB 3.0 PHY when XHCI disabled")
---
 drivers/phy/broadcom/phy-brcm-usb-init.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/phy/broadcom/phy-brcm-usb-init.c +4 -0
index 1b7febc43da9..29d2c3b1913a 100644
@@ -962,6 +962,10 @@ void brcm_usb_init_xhci(struct brcm_usb_init_params *params)
 {
 	void __iomem *ctrl = params->ctrl_regs;
 
+	USB_CTRL_UNSET(ctrl, USB30_PCTL, PHY3_IDDQ_OVERRIDE);
+	/* 1 millisecond - for USB clocks to settle down */
+	usleep_range(1000, 2000);
+
 	if (BRCM_ID(params->family_id) == 0x7366) {
 		/*
 		 * The PHY3_SOFT_RESETB bits default to the wrong state.
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Jaedon Shin

Unset is required to enable USB 3.0 PHY when XHCI reenabled in response to setting PHY3_IDDQ_OVERRIDE in uninit().

Fixes cd6f769fdea7 ("phy: phy-brcm-usb-init: Power down USB 3.0 PHY when XHCI disabled")

This does look valid, Al, can you review this as well? Thanks!

Quoted 20 lines
---
 drivers/phy/broadcom/phy-brcm-usb-init.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/phy/broadcom/phy-brcm-usb-init.c +4 -0
index 1b7febc43da9..29d2c3b1913a 100644
@@ -962,6 +962,10 @@ void brcm_usb_init_xhci(struct brcm_usb_init_params *params)
 {
 	void __iomem *ctrl = params->ctrl_regs;
 
+	USB_CTRL_UNSET(ctrl, USB30_PCTL, PHY3_IDDQ_OVERRIDE);
+	/* 1 millisecond - for USB clocks to settle down */
+	usleep_range(1000, 2000);
+
 	if (BRCM_ID(params->family_id) == 0x7366) {
 		/*
 		 * The PHY3_SOFT_RESETB bits default to the wrong state.
Signature · 1 line
Florian