2019-03-26 17:06:26

by Evan Green

[permalink] [raw]
Subject: [PATCH] arm64: dts: msm8998: Add UFS phy reset

With the new refactoring at [1], the UFS phy now controls its own
destiny in toggling the phy reset bit within the UFS host controller.
Add the DT pieces needed to 1) expose the reset controller from the
HC, and 2) use it from the PHY. This series is based atop linux-next
plus Marc's series at [2].

Signed-off-by: Evan Green <[email protected]>

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

---
I haven't tested this. Marc, I'm hoping you'll test this out and hijack this
patch if it needs any fixups.

arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
index 3d0aeb3211de..d59a2c5fe83a 100644
--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
@@ -990,6 +990,7 @@
interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
phys = <&ufsphy_lanes>;
phy-names = "ufsphy";
+ #reset-cells = <1>;
lanes-per-direction = <2>;
power-domains = <&gcc UFS_GDSC>;

@@ -1039,6 +1040,7 @@
<&gcc GCC_UFS_CLKREF_CLK>,
<&gcc GCC_UFS_PHY_AUX_CLK>;

+ resets = <&ufshc 0>;
ufsphy_lanes: lanes@1da7400 {
reg = <0x01da7400 0x128>,
<0x01da7600 0x1fc>,
--
2.20.1



2019-03-26 17:16:34

by Marc Gonzalez

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: msm8998: Add UFS phy reset

On 26/03/2019 18:05, Evan Green wrote:

> With the new refactoring at [1], the UFS phy now controls its own
> destiny in toggling the phy reset bit within the UFS host controller.
> Add the DT pieces needed to 1) expose the reset controller from the
> HC, and 2) use it from the PHY. This series is based atop linux-next
> plus Marc's series at [2].
>
> Signed-off-by: Evan Green <[email protected]>
>
> [1] https://lore.kernel.org/lkml/[email protected]/
> [2] https://lore.kernel.org/lkml/[email protected]/
>
> ---
> I haven't tested this. Marc, I'm hoping you'll test this out and hijack this
> patch if it needs any fixups.
>
> arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> index 3d0aeb3211de..d59a2c5fe83a 100644
> --- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> @@ -990,6 +990,7 @@
> interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
> phys = <&ufsphy_lanes>;
> phy-names = "ufsphy";
> + #reset-cells = <1>;
> lanes-per-direction = <2>;
> power-domains = <&gcc UFS_GDSC>;
>
> @@ -1039,6 +1040,7 @@
> <&gcc GCC_UFS_CLKREF_CLK>,
> <&gcc GCC_UFS_PHY_AUX_CLK>;
>
> + resets = <&ufshc 0>;
> ufsphy_lanes: lanes@1da7400 {
> reg = <0x01da7400 0x128>,
> <0x01da7600 0x1fc>,
>

If it's OK with you, I plan to test this patch tomorrow, and simply squash it
into my UFS DT submission.

Regards.

2019-03-26 19:42:37

by Evan Green

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: msm8998: Add UFS phy reset

On Tue, Mar 26, 2019 at 10:14 AM Marc Gonzalez <[email protected]> wrote:
>
> On 26/03/2019 18:05, Evan Green wrote:
>
> > With the new refactoring at [1], the UFS phy now controls its own
> > destiny in toggling the phy reset bit within the UFS host controller.
> > Add the DT pieces needed to 1) expose the reset controller from the
> > HC, and 2) use it from the PHY. This series is based atop linux-next
> > plus Marc's series at [2].
> >
> > Signed-off-by: Evan Green <[email protected]>
> >
> > [1] https://lore.kernel.org/lkml/[email protected]/
> > [2] https://lore.kernel.org/lkml/[email protected]/
> >
> > ---
> > I haven't tested this. Marc, I'm hoping you'll test this out and hijack this
> > patch if it needs any fixups.
> >
> > arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > index 3d0aeb3211de..d59a2c5fe83a 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > @@ -990,6 +990,7 @@
> > interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
> > phys = <&ufsphy_lanes>;
> > phy-names = "ufsphy";
> > + #reset-cells = <1>;
> > lanes-per-direction = <2>;
> > power-domains = <&gcc UFS_GDSC>;
> >
> > @@ -1039,6 +1040,7 @@
> > <&gcc GCC_UFS_CLKREF_CLK>,
> > <&gcc GCC_UFS_PHY_AUX_CLK>;
> >
> > + resets = <&ufshc 0>;
> > ufsphy_lanes: lanes@1da7400 {
> > reg = <0x01da7400 0x128>,
> > <0x01da7600 0x1fc>,
> >
>
> If it's OK with you, I plan to test this patch tomorrow, and simply squash it
> into my UFS DT submission.

Sounds good, go ahead.

2019-04-01 14:39:35

by Marc Gonzalez

[permalink] [raw]
Subject: [PATCH v2 1/2] arm64: dts: msm8998: Add UFS phy reset

Fixup MSM8998 UFS DT nodes now that Evan's reset series has landed.
https://lore.kernel.org/lkml/[email protected]/

Signed-off-by: Marc Gonzalez <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8998.dtsi | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
index 893eeaaaedec..1cffa706c909 100644
--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
@@ -1085,6 +1085,7 @@
phy-names = "ufsphy";
lanes-per-direction = <2>;
power-domains = <&gcc UFS_GDSC>;
+ #reset-cells = <1>;

clock-names =
"core_clk",
@@ -1132,6 +1133,9 @@
<&gcc GCC_UFS_CLKREF_CLK>,
<&gcc GCC_UFS_PHY_AUX_CLK>;

+ reset-names = "ufsphy";
+ resets = <&ufshc 0>;
+
ufsphy_lanes: lanes@1da7400 {
reg = <0x01da7400 0x128>,
<0x01da7600 0x1fc>,
--
2.17.1

2019-04-01 14:43:30

by Marc Gonzalez

[permalink] [raw]
Subject: [PATCH v2 2/2] dt-bindings: phy-qcom-qmp: Tweak qcom,msm8998-qmp-ufs-phy

Fixup MSM8998 UFS binding now that Evan's reset series has landed.
https://lore.kernel.org/lkml/[email protected]/

Signed-off-by: Marc Gonzalez <[email protected]>
---
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
index 5fca57b12534..085fbd676cfc 100644
--- a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
+++ b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
@@ -73,7 +73,8 @@ Required properties:
"phy", "common".
For "qcom,msm8998-qmp-usb3-phy" must contain
"phy", "common".
- For "qcom,msm8998-qmp-ufs-phy": no resets are listed.
+ For "qcom,msm8998-qmp-ufs-phy": must contain:
+ "ufsphy".
For "qcom,msm8998-qmp-pcie-phy" must contain:
"phy", "common".
For "qcom,sdm845-qmp-usb3-phy" must contain:
--
2.17.1