linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Cooper <alcooperx@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Al Cooper <alcooperx@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org,
	Florian Fainelli <f.fainelli@gmail.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	Srinath Mannam <srinath.mannam@broadcom.com>
Subject: [PATCH v2 resend 10/13] phy: usb: PHY's MDIO registers not accessible without device installed
Date: Mon,  9 Dec 2019 16:42:46 -0500	[thread overview]
Message-ID: <20191209214249.41137-11-alcooperx@gmail.com> (raw)
In-Reply-To: <20191209214249.41137-1-alcooperx@gmail.com>

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>
---
 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


  parent reply	other threads:[~2019-12-09 21:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 21:42 [PATCH v2 resend 00/13] phy: usb: Updates to Broadcom STB USB PHY driver Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 01/13] phy: usb: EHCI DMA may lose a burst of DMA data for 7255xA0 family Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 02/13] phy: usb: Get all drivers that use USB clks using correct enable/disable Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 03/13] phy: usb: Put USB phys into IDDQ on suspend to save power in S2 mode Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 04/13] phy: usb: Add "wake on" functionality Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 05/13] phy: usb: Restructure in preparation for adding 7216 USB support Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 06/13] dt-bindings: Add Broadcom STB USB PHY binding document Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 07/13] phy: usb: Add support for new Synopsis USB controller on the 7216 Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 08/13] phy: usb: Add support for new Synopsis USB controller on the 7211b0 Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 09/13] phy: usb: fix driver to defer on clk_get defer Al Cooper
2019-12-09 21:42 ` Al Cooper [this message]
2019-12-09 21:42 ` [PATCH v2 resend 11/13] phy: usb: bdc: Fix occasional failure with BDC on 7211 Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 12/13] phy: usb: USB driver is crashing during S3 resume on 7216 Al Cooper
2019-12-09 21:42 ` [PATCH v2 resend 13/13] phy: usb: Add support for wake and USB low power mode for 7211 S2/S5 Al Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191209214249.41137-11-alcooperx@gmail.com \
    --to=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=srinath.mannam@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).