* [PATCH v3 1/8] dt-bindings: ufs: Add #reset-cells for Qualcomm controllers
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 2/8] dt-bindings: phy-qcom-qmp: Add UFS PHY reset Evan Green
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Evan Green @ 2019-02-05 18:58 UTC (permalink / raw)
To: Andy Gross, Kishon Vijay Abraham I
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Evan Green, Rob Herring,
devicetree, liwei, linux-kernel, Subhash Jadavani, Rob Herring,
Martin K. Petersen, Mark Rutland
Enable Qualcomm UFS controllers to expose the PHY reset via a reset
controller.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
---
Fixing up this aspect of it made me notice that this patch [1]
hasn't landed yet. It really ought to.
[1] https://lore.kernel.org/lkml/20181012213926.253765-1-dianders@chromium.org/T/#u
Changes in v3: None
Changes in v2: None
Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
index 8cf59452c675..e2460b666ae4 100644
--- a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
+++ b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
@@ -47,6 +47,8 @@ Optional properties:
-lanes-per-direction : number of lanes available per direction - either 1 or 2.
Note that it is assume same number of lanes is used both
directions at once. If not specified, default is 2 lanes per direction.
+- #reset-cells : Must be <1> for Qualcomm UFS controllers that expose
+ PHY reset from the UFS controller.
- resets : reset node register
- reset-names : describe reset node register, the "rst" corresponds to reset the whole UFS IP.
@@ -76,4 +78,5 @@ Example:
reset-names = "rst";
phys = <&ufsphy1>;
phy-names = "ufsphy";
+ #reset-cells = <1>;
};
--
2.20.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 2/8] dt-bindings: phy-qcom-qmp: Add UFS PHY reset
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 ` [PATCH v3 1/8] dt-bindings: ufs: Add #reset-cells for Qualcomm controllers Evan Green
@ 2019-02-05 18:58 ` Evan Green
2019-02-05 18:58 ` [PATCH v3 3/8] dt-bindings: phy: qcom-ufs: Add resets property Evan Green
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Evan Green @ 2019-02-05 18:58 UTC (permalink / raw)
To: Andy Gross, Kishon Vijay Abraham I
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Evan Green, Rob Herring,
devicetree, Mark Rutland, Rob Herring, linux-kernel
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
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 3/8] dt-bindings: phy: qcom-ufs: Add resets property
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 ` [PATCH v3 1/8] dt-bindings: ufs: Add #reset-cells for Qualcomm controllers Evan Green
2019-02-05 18:58 ` [PATCH v3 2/8] dt-bindings: phy-qcom-qmp: Add UFS PHY reset Evan Green
@ 2019-02-05 18:58 ` Evan Green
2019-02-05 18:58 ` [PATCH v3 4/8] arm64: dts: sdm845: Add UFS PHY reset Evan Green
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Evan Green @ 2019-02-05 18:58 UTC (permalink / raw)
To: Andy Gross, Kishon Vijay Abraham I
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Evan Green, Rob Herring,
devicetree, linux-kernel, Rob Herring, Mark Rutland
Add a resets property to the PHY that represents the PHY reset
register in the UFS controller itself. This better describes the
complete specification of the PHY, and allows the PHY to perform
its initialization in a single function, rather than relying on
back-channel sequencing of initialization through the PHY framework.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
---
Changes in v3: None
Changes in v2:
- Added resets to example (Stephen).
Documentation/devicetree/bindings/ufs/ufs-qcom.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/ufs/ufs-qcom.txt b/Documentation/devicetree/bindings/ufs/ufs-qcom.txt
index 21d9a93db2e9..fd59f93e9556 100644
--- a/Documentation/devicetree/bindings/ufs/ufs-qcom.txt
+++ b/Documentation/devicetree/bindings/ufs/ufs-qcom.txt
@@ -29,6 +29,7 @@ Optional properties:
- vdda-pll-max-microamp : specifies max. load that can be drawn from pll supply
- vddp-ref-clk-supply : phandle to UFS device ref_clk pad power supply
- vddp-ref-clk-max-microamp : specifies max. load that can be drawn from this supply
+- resets : specifies the PHY reset in the UFS controller
Example:
@@ -51,9 +52,11 @@ Example:
<&clock_gcc clk_ufs_phy_ldo>,
<&clock_gcc clk_gcc_ufs_tx_cfg_clk>,
<&clock_gcc clk_gcc_ufs_rx_cfg_clk>;
+ resets = <&ufshc 0>;
};
- ufshc@fc598000 {
+ ufshc: ufshc@fc598000 {
+ #reset-cells = <1>;
...
phys = <&ufsphy1>;
phy-names = "ufsphy";
--
2.20.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 4/8] arm64: dts: sdm845: Add UFS PHY reset
2019-02-05 18:58 [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
` (2 preceding siblings ...)
2019-02-05 18:58 ` [PATCH v3 3/8] dt-bindings: phy: qcom-ufs: Add resets property Evan Green
@ 2019-02-05 18:58 ` Evan Green
2019-02-05 18:58 ` [PATCH v3 5/8] arm64: dts: msm8996: Add UFS PHY reset controller Evan Green
2019-03-19 20:04 ` [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
5 siblings, 0 replies; 9+ messages in thread
From: Evan Green @ 2019-02-05 18:58 UTC (permalink / raw)
To: Andy Gross, Kishon Vijay Abraham I
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Evan Green, devicetree,
linux-arm-msm, linux-kernel, Rob Herring, David Brown,
Mark Rutland
Wire up the reset controller in the Qcom UFS controller for the PHY.
This will be used to toggle PHY reset during initialization of the PHY.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
---
This commit is based atop the series at [1]. Patches 1 and 2 of that
series have landed, but 3, 4, and 5 are still outstanding.
[1] https://lore.kernel.org/lkml/20181210192826.241350-1-evgreen@chromium.org/
Changes in v3: None
Changes in v2: None
arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index b29332b265d9..029ab66405cf 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -990,6 +990,7 @@
phy-names = "ufsphy";
lanes-per-direction = <2>;
power-domains = <&gcc UFS_PHY_GDSC>;
+ #reset-cells = <1>;
clock-names =
"core_clk",
@@ -1033,6 +1034,8 @@
clocks = <&gcc GCC_UFS_MEM_CLKREF_CLK>,
<&gcc GCC_UFS_PHY_PHY_AUX_CLK>;
+ resets = <&ufs_mem_hc 0>;
+ reset-names = "ufsphy";
status = "disabled";
ufs_mem_phy_lanes: lanes@1d87400 {
--
2.20.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 5/8] arm64: dts: msm8996: Add UFS PHY reset controller
2019-02-05 18:58 [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
` (3 preceding siblings ...)
2019-02-05 18:58 ` [PATCH v3 4/8] arm64: dts: sdm845: Add UFS PHY reset Evan Green
@ 2019-02-05 18:58 ` Evan Green
2019-03-19 20:04 ` [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
5 siblings, 0 replies; 9+ messages in thread
From: Evan Green @ 2019-02-05 18:58 UTC (permalink / raw)
To: Andy Gross, Kishon Vijay Abraham I
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Evan Green, devicetree,
linux-arm-msm, linux-kernel, Rob Herring, David Brown,
Mark Rutland
Add the reset controller for the UFS controller, and wire it up
so that the UFS PHY can initialize itself without relying on
implicit sequencing between the two drivers.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
---
Changes in v3: None
Changes in v2: None
arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 99b7495455a6..179f1988d45c 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -663,10 +663,11 @@
clock-names = "ref_clk_src", "ref_clk";
clocks = <&rpmcc RPM_SMD_LN_BB_CLK>,
<&gcc GCC_UFS_CLKREF_CLK>;
+ resets = <&ufshc 0>;
status = "disabled";
};
- ufshc@624000 {
+ ufshc: ufshc@624000 {
compatible = "qcom,ufshc";
reg = <0x624000 0x2500>;
interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
@@ -722,6 +723,7 @@
<0 0>;
lanes-per-direction = <1>;
+ #reset-cells = <1>;
status = "disabled";
ufs_variant {
--
2.20.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend
2019-02-05 18:58 [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
` (4 preceding siblings ...)
2019-02-05 18:58 ` [PATCH v3 5/8] arm64: dts: msm8996: Add UFS PHY reset controller Evan Green
@ 2019-03-19 20:04 ` Evan Green
2019-03-20 9:06 ` Kishon Vijay Abraham I
5 siblings, 1 reply; 9+ messages in thread
From: Evan Green @ 2019-03-19 20:04 UTC (permalink / raw)
To: Andy Gross, Kishon Vijay Abraham I
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Bjorn Andersson, Arnd Bergmann,
Grygorii Strashko, Rob Herring, Vinayak Holikatti, Jeffrey Hugo,
SCSI, David Brown, James E.J. Bottomley,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, liwei,
linux-arm-msm
On Tue, Feb 5, 2019 at 10:59 AM Evan Green <evgreen@chromium.org> wrote:
>
...
> Evan Green (8):
> dt-bindings: ufs: Add #reset-cells for Qualcomm controllers
> dt-bindings: phy-qcom-qmp: Add UFS PHY reset
> dt-bindings: phy: qcom-ufs: Add resets property
> arm64: dts: sdm845: Add UFS PHY reset
> arm64: dts: msm8996: Add UFS PHY reset controller
> scsi: ufs: qcom: Expose the reset controller for PHY
> phy: qcom: Utilize UFS reset controller
> phy: ufs-qcom: Refactor all init steps into phy_poweron
>
> .../devicetree/bindings/phy/qcom-qmp-phy.txt | 6 +-
> .../devicetree/bindings/ufs/ufs-qcom.txt | 5 +-
> .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 3 +
> arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 +-
> arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 +
> drivers/phy/qualcomm/phy-qcom-qmp.c | 117 +++++++++---------
> drivers/phy/qualcomm/phy-qcom-ufs-i.h | 5 +-
> drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c | 25 +---
> drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c | 25 +---
> drivers/phy/qualcomm/phy-qcom-ufs.c | 57 +++++++--
> drivers/scsi/ufs/Kconfig | 1 +
> drivers/scsi/ufs/ufs-qcom.c | 114 ++++++++++-------
> drivers/scsi/ufs/ufs-qcom.h | 4 +
> 13 files changed, 202 insertions(+), 167 deletions(-)
>
> --
Hi Kishon,
A gentle ping here now that rc1 is out. Are you able to take these? I
can also repost if needed.
-Evan
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend
2019-03-19 20:04 ` [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend Evan Green
@ 2019-03-20 9:06 ` Kishon Vijay Abraham I
2019-03-21 17:19 ` Evan Green
0 siblings, 1 reply; 9+ messages in thread
From: Kishon Vijay Abraham I @ 2019-03-20 9:06 UTC (permalink / raw)
To: Evan Green, Andy Gross
Cc: Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Bjorn Andersson, Arnd Bergmann,
Grygorii Strashko, Rob Herring, Vinayak Holikatti, Jeffrey Hugo,
SCSI, David Brown, James E.J. Bottomley,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, liwei,
linux-arm-msm
Hi Evan,
On 20/03/19 1:34 AM, Evan Green wrote:
> On Tue, Feb 5, 2019 at 10:59 AM Evan Green <evgreen@chromium.org> wrote:
>>
> ...
>> Evan Green (8):
>> dt-bindings: ufs: Add #reset-cells for Qualcomm controllers
>> dt-bindings: phy-qcom-qmp: Add UFS PHY reset
>> dt-bindings: phy: qcom-ufs: Add resets property
>> arm64: dts: sdm845: Add UFS PHY reset
>> arm64: dts: msm8996: Add UFS PHY reset controller
>> scsi: ufs: qcom: Expose the reset controller for PHY
>> phy: qcom: Utilize UFS reset controller
>> phy: ufs-qcom: Refactor all init steps into phy_poweron
>>
>> .../devicetree/bindings/phy/qcom-qmp-phy.txt | 6 +-
>> .../devicetree/bindings/ufs/ufs-qcom.txt | 5 +-
>> .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 3 +
>> arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 +-
>> arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 +
>> drivers/phy/qualcomm/phy-qcom-qmp.c | 117 +++++++++---------
>> drivers/phy/qualcomm/phy-qcom-ufs-i.h | 5 +-
>> drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c | 25 +---
>> drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c | 25 +---
>> drivers/phy/qualcomm/phy-qcom-ufs.c | 57 +++++++--
>> drivers/scsi/ufs/Kconfig | 1 +
>> drivers/scsi/ufs/ufs-qcom.c | 114 ++++++++++-------
>> drivers/scsi/ufs/ufs-qcom.h | 4 +
>> 13 files changed, 202 insertions(+), 167 deletions(-)
>>
>> --
>
> Hi Kishon,
> A gentle ping here now that rc1 is out. Are you able to take these? I
> can also repost if needed.
Can you repost with the updated tags please?
Thanks
Kishon
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 0/8] phy: qcom-ufs: Enable regulators to be off in suspend
2019-03-20 9:06 ` Kishon Vijay Abraham I
@ 2019-03-21 17:19 ` Evan Green
0 siblings, 0 replies; 9+ messages in thread
From: Evan Green @ 2019-03-21 17:19 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Andy Gross, Stephen Boyd, Marc Gonzalez, Can Guo, Vivek Gautam,
Douglas Anderson, Asutosh Das, Bjorn Andersson, Arnd Bergmann,
Grygorii Strashko, Rob Herring, Vinayak Holikatti, Jeffrey Hugo,
SCSI, David Brown, James E.J. Bottomley,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, liwei
On Wed, Mar 20, 2019 at 2:07 AM Kishon Vijay Abraham I <kishon@ti.com> wrote:
>
> Hi Evan,
>
> On 20/03/19 1:34 AM, Evan Green wrote:
> > On Tue, Feb 5, 2019 at 10:59 AM Evan Green <evgreen@chromium.org> wrote:
> >>
> > ...
> >> Evan Green (8):
> >> dt-bindings: ufs: Add #reset-cells for Qualcomm controllers
> >> dt-bindings: phy-qcom-qmp: Add UFS PHY reset
> >> dt-bindings: phy: qcom-ufs: Add resets property
> >> arm64: dts: sdm845: Add UFS PHY reset
> >> arm64: dts: msm8996: Add UFS PHY reset controller
> >> scsi: ufs: qcom: Expose the reset controller for PHY
> >> phy: qcom: Utilize UFS reset controller
> >> phy: ufs-qcom: Refactor all init steps into phy_poweron
> >>
> >> .../devicetree/bindings/phy/qcom-qmp-phy.txt | 6 +-
> >> .../devicetree/bindings/ufs/ufs-qcom.txt | 5 +-
> >> .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 3 +
> >> arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 +-
> >> arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 +
> >> drivers/phy/qualcomm/phy-qcom-qmp.c | 117 +++++++++---------
> >> drivers/phy/qualcomm/phy-qcom-ufs-i.h | 5 +-
> >> drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c | 25 +---
> >> drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c | 25 +---
> >> drivers/phy/qualcomm/phy-qcom-ufs.c | 57 +++++++--
> >> drivers/scsi/ufs/Kconfig | 1 +
> >> drivers/scsi/ufs/ufs-qcom.c | 114 ++++++++++-------
> >> drivers/scsi/ufs/ufs-qcom.h | 4 +
> >> 13 files changed, 202 insertions(+), 167 deletions(-)
> >>
> >> --
> >
> > Hi Kishon,
> > A gentle ping here now that rc1 is out. Are you able to take these? I
> > can also repost if needed.
>
> Can you repost with the updated tags please?
>
Sure, done!
https://lore.kernel.org/lkml/20190321171800.104681-1-evgreen@chromium.org/T/#t
^ permalink raw reply [flat|nested] 9+ messages in thread