Skip to content

Commit fc430ae

Browse files
alcooperkishon
authored andcommitted
phy: usb: PHY's MDIO registers not accessible without device installed
When there is no device connected and FSM is enabled, the XHCI puts the PHY into suspend mode. When the PHY is put into suspend mode the USB LDO powers down the PHY. This causes the MDIO to be inaccessible and its registers reset to default. The fix is to disable FSM. Signed-off-by: Al Cooper <alcooperx@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
1 parent 89927fe commit fc430ae

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define USB_PHY_PLL_LDO_CTL 0x08
5757
#define USB_PHY_PLL_LDO_CTL_AFE_CORERDY_MASK 0x00000004
5858
#define USB_PHY_UTMI_CTL_1 0x04
59+
#define USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK 0x00000800
5960
#define USB_PHY_UTMI_CTL_1_PHY_MODE_MASK 0x0000000c
6061
#define USB_PHY_UTMI_CTL_1_PHY_MODE_SHIFT 2
6162
#define USB_PHY_STATUS 0x20
@@ -229,6 +230,14 @@ static void usb_init_common_7211b0(struct brcm_usb_init_params *params)
229230

230231
usb_init_common(params);
231232

233+
/*
234+
* Disable FSM, otherwise the PHY will auto suspend when no
235+
* device is connected and will be reset on resume.
236+
*/
237+
reg = brcm_usb_readl(usb_phy + USB_PHY_UTMI_CTL_1);
238+
reg &= ~USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK;
239+
brcm_usb_writel(reg, usb_phy + USB_PHY_UTMI_CTL_1);
240+
232241
usb2_eye_fix_7211b0(params);
233242
}
234243

0 commit comments

Comments
 (0)