All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Green <evgreen@chromium.org>
To: Andy Gross <andy.gross@linaro.org>,
	Kishon Vijay Abraham I <kishon@ti.com>
Cc: Stephen Boyd <swboyd@chromium.org>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>,
	Can Guo <cang@codeaurora.org>,
	Vivek Gautam <vivek.gautam@codeaurora.org>,
	Douglas Anderson <dianders@chromium.org>,
	Asutosh Das <asutoshd@codeaurora.org>,
	Evan Green <evgreen@chromium.org>, Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/8] dt-bindings: phy-qcom-qmp: Add UFS PHY reset
Date: Tue,  5 Feb 2019 10:58:56 -0800	[thread overview]
Message-ID: <20190205185902.106085-3-evgreen@chromium.org> (raw)
In-Reply-To: <20190205185902.106085-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>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephen Boyd <swboyd@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.

Changes in v3: None
Changes in v2: None

 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 4ff26dbf4310..49b8a5eed3cd 100644
--- a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
+++ b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
@@ -56,7 +56,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".
@@ -70,7 +71,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.20.1


  parent reply	other threads:[~2019-02-05 18:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 18:58 [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
2019-02-05 18:58 ` Evan Green
2019-02-05 18:58 ` [PATCH v3 1/8] dt-bindings: ufs: Add #reset-cells for Qualcomm controllers Evan Green
2019-02-05 18:58 ` Evan Green [this message]
2019-02-05 18:58 ` [PATCH v3 3/8] dt-bindings: phy: qcom-ufs: Add resets property Evan Green
2019-02-05 18:58 ` [PATCH v3 4/8] arm64: dts: sdm845: Add UFS PHY reset Evan Green
2019-02-05 18:58 ` [PATCH v3 5/8] arm64: dts: msm8996: Add UFS PHY reset controller Evan Green
2019-02-05 18:59 ` [PATCH v3 6/8] scsi: ufs: qcom: Expose the reset controller for PHY Evan Green
2019-02-06 11:42   ` Kishon Vijay Abraham I
2019-02-06 11:42     ` Kishon Vijay Abraham I
2019-02-06 11:54     ` Marc Gonzalez
2019-02-06 12:12       ` Kishon Vijay Abraham I
2019-02-06 13:57     ` Avri Altman
2019-02-06 19:48       ` Stephen Boyd
2019-02-06 21:04   ` Stephen Boyd
2019-02-06 21:04     ` Stephen Boyd
2019-02-05 18:59 ` [PATCH v3 7/8] phy: qcom: Utilize UFS reset controller Evan Green
2019-02-06 21:33   ` Stephen Boyd
2019-02-06 21:33     ` Stephen Boyd
2019-02-08 18:59     ` Evan Green
2019-02-05 18:59 ` [PATCH v3 8/8] phy: ufs-qcom: Refactor all init steps into phy_poweron Evan Green
2019-02-06 22:04   ` Stephen Boyd
2019-02-06 22:04     ` Stephen Boyd
2019-03-19 20:04 ` [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
2019-03-19 20:04   ` Evan Green
2019-03-20  9:06   ` Kishon Vijay Abraham I
2019-03-20  9:06     ` Kishon Vijay Abraham I
2019-03-21 17:19     ` Evan Green
2019-03-21 17:19       ` Evan Green

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=20190205185902.106085-3-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=marc.w.gonzalez@free.fr \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@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.