1 From fc430aea02068150d053ef24bc424db3dd1357d4 Mon Sep 17 00:00:00 2001
2 From: Al Cooper <alcooperx@gmail.com>
3 Date: Fri, 3 Jan 2020 13:18:08 -0500
4 Subject: [PATCH] phy: usb: PHY's MDIO registers not accessible without device
7 When there is no device connected and FSM is enabled, the XHCI puts
8 the PHY into suspend mode. When the PHY is put into suspend mode
9 the USB LDO powers down the PHY. This causes the MDIO to be
10 inaccessible and its registers reset to default. The fix is to
13 Signed-off-by: Al Cooper <alcooperx@gmail.com>
14 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
15 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
17 drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c | 9 +++++++++
18 1 file changed, 9 insertions(+)
20 --- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
21 +++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
23 #define USB_PHY_PLL_LDO_CTL 0x08
24 #define USB_PHY_PLL_LDO_CTL_AFE_CORERDY_MASK 0x00000004
25 #define USB_PHY_UTMI_CTL_1 0x04
26 +#define USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK 0x00000800
27 #define USB_PHY_UTMI_CTL_1_PHY_MODE_MASK 0x0000000c
28 #define USB_PHY_UTMI_CTL_1_PHY_MODE_SHIFT 2
29 #define USB_PHY_STATUS 0x20
30 @@ -229,6 +230,14 @@ static void usb_init_common_7211b0(struc
32 usb_init_common(params);
35 + * Disable FSM, otherwise the PHY will auto suspend when no
36 + * device is connected and will be reset on resume.
38 + reg = brcm_usb_readl(usb_phy + USB_PHY_UTMI_CTL_1);
39 + reg &= ~USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK;
40 + brcm_usb_writel(reg, usb_phy + USB_PHY_UTMI_CTL_1);
42 usb2_eye_fix_7211b0(params);