[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191107141339.6079-11-alcooperx@gmail.com>
Date: Thu, 7 Nov 2019 09:13:36 -0500
From: Al Cooper <alcooperx@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Al Cooper <alcooperx@...il.com>,
bcm-kernel-feedback-list@...adcom.com, devicetree@...r.kernel.org,
Florian Fainelli <f.fainelli@...il.com>,
Kishon Vijay Abraham I <kishon@...com>,
linux-arm-kernel@...ts.infradead.org,
Mark Rutland <mark.rutland@....com>,
Rob Herring <robh+dt@...nel.org>,
Srinath Mannam <srinath.mannam@...adcom.com>
Subject: [PATCH 10/13] 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@...il.com>
---
drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c b/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c
index bf138867efb1..fe3f653c64a7 100644
--- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c
+++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c
@@ -56,6 +56,7 @@
#define USB_PHY_PLL_LDO_CTL 0x08
#define USB_PHY_PLL_LDO_CTL_AFE_CORERDY_MASK 0x00000004
#define USB_PHY_UTMI_CTL_1 0x04
+#define USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK 0x00000800
#define USB_PHY_UTMI_CTL_1_PHY_MODE_MASK 0x0000000c
#define USB_PHY_UTMI_CTL_1_PHY_MODE_SHIFT 2
#define USB_PHY_STATUS 0x20
@@ -229,6 +230,14 @@ static void usb_init_common_7211b0(struct brcm_usb_init_params *params)
usb_init_common(params);
+ /*
+ * Disable FSM, otherwise the PHY will auto suspend when no
+ * device is connected and will be reset on resume.
+ */
+ reg = brcm_usb_readl(usb_phy + USB_PHY_UTMI_CTL_1);
+ reg &= ~USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK;
+ brcm_usb_writel(reg, usb_phy + USB_PHY_UTMI_CTL_1);
+
usb2_eye_fix_7211b0(params);
}
--
2.17.1
Powered by blists - more mailing lists