All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Green <evgreen@chromium.org>
To: Andy Gross <andy.gross@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Kishon Vijay Abraham I <kishon@ti.com>
Cc: Can Guo <cang@codeaurora.org>,
	Douglas Anderson <dianders@chromium.org>,
	Asutosh Das <asutoshd@codeaurora.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Vivek Gautam <vivek.gautam@codeaurora.org>,
	Evan Green <evgreen@chromium.org>,
	devicetree@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v1 1/8] dt-bindings: phy-qcom-qmp: Add UFS PHY reset
Date: Fri, 11 Jan 2019 15:01:22 -0800	[thread overview]
Message-ID: <20190111230129.127037-2-evgreen@chromium.org> (raw)
In-Reply-To: <20190111230129.127037-1-evgreen@chromium.org>

Add a required reset to the SDM845 UFS phy to express the PHY reset
bit inside the UFS controller register space. Before this change, this
reset was not expressed in the DT, and the driver utilized two different
callbacks (phy_init and phy_poweron) to implement a two-phase
initialization procedure that involved deasserting this reset between
init and poweron. This abused the two callbacks and diluted their
purpose.

That scheme does not work as regulators cannot be turned off in
phy_poweroff because they were turned on in init, rather than poweron.
The net result is that regulators are left on in suspend that shouldn't
be.

This new scheme gives the UFS reset to the PHY, so that it can fully
initialize itself in a single callback. We can then turn regulators on
during poweron and off during poweroff.

Signed-off-by: Evan Green <evgreen@chromium.org>
---
I realize I'm not supposed to add a required property after the fact,
but given that the UFS DT nodes that would use this binding are not
yet upstream (and this would be the first), I was hoping to squeak by.

 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
index 41a1074228ba7..6b6ca4456dc7c 100644
--- a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
+++ b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
@@ -53,7 +53,8 @@ Required properties:
 	   one for each entry in reset-names.
  - reset-names: "phy" for reset of phy block,
 		"common" for phy common block reset,
-		"cfg" for phy's ahb cfg block reset.
+		"cfg" for phy's ahb cfg block reset,
+		"ufsphy" for the PHY reset in the UFS controller.
 
 		For "qcom,ipq8074-qmp-pcie-phy" must contain:
 			"phy", "common".
@@ -65,7 +66,8 @@ Required properties:
 			"phy", "common".
 		For "qcom,sdm845-qmp-usb3-uni-phy" must contain:
 			"phy", "common".
-		For "qcom,sdm845-qmp-ufs-phy": no resets are listed.
+		For "qcom,sdm845-qmp-ufs-phy": must contain:
+			"ufsphy".
 
  - vdda-phy-supply: Phandle to a regulator supply to PHY core block.
  - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block.
-- 
2.18.1


  reply	other threads:[~2019-01-11 23:01 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 23:01 [PATCH v1 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
2019-01-11 23:01 ` Evan Green [this message]
2019-01-22  0:21   ` [PATCH v1 1/8] dt-bindings: phy-qcom-qmp: Add UFS PHY reset Rob Herring
2019-01-22  0:21     ` Rob Herring
2019-01-11 23:01 ` [PATCH v1 2/8] dt-bindings: phy: qcom-ufs: Add resets property Evan Green
2019-01-16 21:29   ` Stephen Boyd
2019-01-16 21:29     ` Stephen Boyd
2019-01-22 18:34     ` Evan Green
2019-01-22  0:26   ` Rob Herring
2019-01-22  0:26     ` Rob Herring
2019-01-11 23:01 ` [PATCH v1 3/8] arm64: dts: sdm845: Add UFS PHY reset Evan Green
2019-01-18 22:20   ` Stephen Boyd
2019-01-18 22:20     ` Stephen Boyd
2019-01-22  0:25   ` Rob Herring
2019-01-22 18:13     ` Evan Green
2019-01-11 23:01 ` [PATCH v1 4/8] arm64: dts: msm8996: Add UFS PHY reset controller Evan Green
2019-01-18 22:20   ` Stephen Boyd
2019-01-18 22:20     ` Stephen Boyd
2019-01-11 23:01 ` [PATCH v1 5/8] scsi: ufs: qcom: Expose the reset controller for PHY Evan Green
2019-01-16  8:52   ` Kishon Vijay Abraham I
2019-01-16  8:52     ` Kishon Vijay Abraham I
2019-01-17  2:28     ` Martin K. Petersen
2019-01-17  2:28       ` Martin K. Petersen
2019-01-18 22:31   ` Stephen Boyd
2019-01-18 22:31     ` Stephen Boyd
2019-01-22 22:40     ` Evan Green
2019-01-11 23:01 ` [PATCH v1 6/8] phy: qcom-qmp: Utilize UFS reset controller Evan Green
2019-01-18 22:33   ` Stephen Boyd
2019-01-22 22:41     ` Evan Green
2019-01-11 23:01 ` [PATCH v1 7/8] phy: qcom-qmp: Move UFS phy to phy_poweron/off Evan Green
2019-01-18 22:39   ` Stephen Boyd
2019-01-22 22:42     ` Evan Green
2019-01-11 23:01 ` [PATCH v1 8/8] phy: qcom-ufs: Refactor all init steps into phy_poweron Evan Green
2019-01-18 23:50   ` Stephen Boyd
2019-01-22 22:44     ` Evan Green
2019-01-16 22:32 ` [PATCH v1 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Stephen Boyd
2019-01-16 22:32   ` Stephen Boyd

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=20190111230129.127037-2-evgreen@chromium.org \
    --to=evgreen@chromium.org \
    --cc=andy.gross@linaro.org \
    --cc=asutoshd@codeaurora.org \
    --cc=cang@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=swboyd@chromium.org \
    --cc=vivek.gautam@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.