All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Rajendra Nayak <rnayak@codeaurora.org>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>,
	MSM <linux-arm-msm@vger.kernel.org>,
	Niklas Cassel <niklas.cassel@linaro.org>,
	Nicolas Dechesne <nicolas.dechesne@linaro.org>,
	Andy Gross <andy.gross@linaro.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: WIP: UFS on apq8098
Date: Mon, 3 Dec 2018 08:09:05 -0800	[thread overview]
Message-ID: <20181203160905.GR2225@minitux> (raw)
In-Reply-To: <7d588806-5699-2d87-e95e-f1388de01a74@codeaurora.org>

On Mon 03 Dec 07:47 PST 2018, Jeffrey Hugo wrote:

> On 12/3/2018 8:27 AM, Jeffrey Hugo wrote:
> > On 12/3/2018 8:18 AM, Marc Gonzalez wrote:
> > > Hello,
> > > 
> > > I'm trying to enable UFS on apq8098. Just wanted to share my progress
> > > so far, in case someone spots any glaring mistakes.
> > 
> > Excellent.  This was down on my todo list.  I'm glad its getting some
> > attention.
> > 
> > > 
> > > (WIP patch provided at message's end.)
> > > 
> > > rpm_smd_clk_probe() runs successfully, and returns 0.
> > > 
> > > qcom_qmp_phy_probe() fails:
> > > 
> > > [    0.913707] qcom-qmp-phy 1da7000.phy: Failed to get clk 'ref': -2
> > > [    0.913761] qcom-qmp-phy: probe of 1da7000.phy failed with error -2
> > > 
> > > ufs_qcom_probe() also fails (which may be caused by PHY failure)
> > > 
> > > [    2.368486] ufshcd-qcom 1da4000.ufshc: ufshcd_get_vreg: vdd-hba
> > > get failed, err=-517
> > > [    2.370673] ufshcd-qcom 1da4000.ufshc: Initialization failed
> > > [    2.412908] ufshcd-qcom 1da4000.ufshc: ufshcd_pltfrm_init()
> > > failed -517
> > > 
> > > I'll investigate the PHY init.
> > > 
> > > Regards.
> > > 
> > > 
> > > diff --git a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > index b4276da1fb0d..ad7542f461af 100644
> > > --- a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > @@ -241,3 +241,26 @@
> > >           };
> > >       };
> > >   };
> > > +
> > > +&ufshc {
> > > +    status = "ok";
> > > +    vdd-hba-supply = <&gcc UFS_GDSC>;
> > > +    vdd-hba-fixed-regulator;
> > > +    vcc-supply = <&vreg_l20a_2p95>;
> > > +    vccq-supply = <&vreg_l26a_1p2>;
> > > +    vccq2-supply = <&vreg_s4a_1p8>;
> > > +    vcc-max-microamp = <750000>;
> > > +    vccq-max-microamp = <560000>;
> > > +    vccq2-max-microamp = <750000>;
> > > +};
> > > +
> > > +&ufsphy {
> > > +    status = "ok";
> > > +    vdda-phy-supply = <&vreg_l1a_0p875>;
> > > +    vdda-pll-supply = <&vreg_l2a_1p2>;
> > > +    vddp-ref-clk-supply = <&vreg_l26a_1p2>;
> > > +    vdda-phy-max-microamp = <51400>;
> > > +    vdda-pll-max-microamp = <14600>;
> > > +    vddp-ref-clk-max-microamp = <100>;
> > > +    vddp-ref-clk-always-on;
> > > +};
> > > diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > index d291b4713c33..10e7b8a55b8a 100644
> > > --- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > @@ -264,6 +264,11 @@
> > >           rpm_requests: rpm-requests {
> > >               compatible = "qcom,rpm-msm8998";
> > >               qcom,glink-channels = "rpm_requests";
> > > +
> > > +            rpmcc: qcom,rpmcc {
> > > +                compatible = "qcom,rpmcc-msm8998";
> > > +                #clock-cells = <1>;
> > > +            };
> > >           };
> > >       };
> > > @@ -686,5 +691,79 @@
> > >               redistributor-stride = <0x0 0x20000>;
> > >               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
> > >           };
> > > +
> > > +        ufshc: ufshc@1da4000 {
> > > +            compatible = "qcom,msm8998-ufshc", "qcom,ufshc",
> > > +                     "jedec,ufs-2.0";
> > > +            reg = <0x1da4000 0x2500>;
> > > +            interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
> > > +            phys = <&ufsphy_lanes>;
> > > +            phy-names = "ufsphy";
> > > +            lanes-per-direction = <2>;
> > > +            power-domains = <&gcc UFS_GDSC>;
> > > +
> > > +            clock-names =
> > > +                "core_clk",
> > > +                "bus_aggr_clk",
> > > +                "iface_clk",
> > > +                "core_clk_unipro",
> > > +                "core_clk_ice",
> > > +                "ref_clk",
> > > +                "tx_lane0_sync_clk",
> > > +                "rx_lane0_sync_clk",
> > > +                "rx_lane1_sync_clk";
> > > +            clocks =
> > > +                <&gcc GCC_UFS_AXI_CLK>,
> > > +                <&gcc GCC_AGGRE1_UFS_AXI_CLK>,
> > > +                <&gcc GCC_UFS_AHB_CLK>,
> > > +                <&gcc GCC_UFS_UNIPRO_CORE_CLK>,
> > > +                <&gcc GCC_UFS_ICE_CORE_CLK>,
> > > +                <&rpmcc 0>,
> > > +                <&gcc GCC_UFS_TX_SYMBOL_0_CLK>,
> > > +                <&gcc GCC_UFS_RX_SYMBOL_0_CLK>,
> > > +                <&gcc GCC_UFS_RX_SYMBOL_1_CLK>;
> > > +            freq-table-hz =
> > > +                <50000000 200000000>,
> > > +                <0 0>,
> > > +                <0 0>,
> > > +                <37500000 150000000>,
> > > +                <75000000 300000000>,
> > > +                <0 0>,
> > > +                <0 0>,
> > > +                <0 0>,
> > > +                <0 0>;
> > > +
> > > +            resets = <&gcc GCC_UFS_BCR>;
> > 
> > I dunno how much this factors into your issues, but the resets defined
> > in gcc-msm8998.c are wrong.  I'm posting a patch later today.  I know
> > this was a problem for me with USB.
> > 
> > > +            reset-names = "rst";
> > > +
> > > +            status = "disabled";
> > > +        };
> > > +
> > > +        ufsphy: phy@1da7000 {
> > > +            compatible = "qcom,sdm845-qmp-ufs-phy";
> > > +            reg = <0x1da7000 0x18c>;
> > > +            #address-cells = <1>;
> > > +            #size-cells = <1>;
> > > +            ranges;
> > > +            clock-names =
> > > +                "ref_clk_src",
> > > +                "ref_clk",
> > > +                "ref_aux_clk";
> > > +            clocks =
> > > +                <&rpmcc 0>,
> > > +                <&gcc GCC_UFS_CLKREF_CLK>,
> 
> Also, "GCC_UFS_CLKREF_CLK" is not defined in
> include/dt-bindings/clock/qcom,gcc-msm8998.h which is probably the cause of
> your -2 error listed above.
> 

I agree, this would cause the problem you're seeing.

Please find this clock at:

https://lore.kernel.org/lkml/20181130065259.26497-4-bjorn.andersson@linaro.org/

I will respin patch 1 and post the series again in a few hours.

Regards,
Bjorn

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Rajendra Nayak <rnayak@codeaurora.org>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>,
	MSM <linux-arm-msm@vger.kernel.org>,
	Niklas Cassel <niklas.cassel@linaro.org>,
	Nicolas Dechesne <nicolas.dechesne@linaro.org>,
	Andy Gross <andy.gross@linaro.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: WIP: UFS on apq8098
Date: Mon, 3 Dec 2018 08:09:05 -0800	[thread overview]
Message-ID: <20181203160905.GR2225@minitux> (raw)
In-Reply-To: <7d588806-5699-2d87-e95e-f1388de01a74@codeaurora.org>

On Mon 03 Dec 07:47 PST 2018, Jeffrey Hugo wrote:

> On 12/3/2018 8:27 AM, Jeffrey Hugo wrote:
> > On 12/3/2018 8:18 AM, Marc Gonzalez wrote:
> > > Hello,
> > > 
> > > I'm trying to enable UFS on apq8098. Just wanted to share my progress
> > > so far, in case someone spots any glaring mistakes.
> > 
> > Excellent.  This was down on my todo list.  I'm glad its getting some
> > attention.
> > 
> > > 
> > > (WIP patch provided at message's end.)
> > > 
> > > rpm_smd_clk_probe() runs successfully, and returns 0.
> > > 
> > > qcom_qmp_phy_probe() fails:
> > > 
> > > [    0.913707] qcom-qmp-phy 1da7000.phy: Failed to get clk 'ref': -2
> > > [    0.913761] qcom-qmp-phy: probe of 1da7000.phy failed with error -2
> > > 
> > > ufs_qcom_probe() also fails (which may be caused by PHY failure)
> > > 
> > > [    2.368486] ufshcd-qcom 1da4000.ufshc: ufshcd_get_vreg: vdd-hba
> > > get failed, err=-517
> > > [    2.370673] ufshcd-qcom 1da4000.ufshc: Initialization failed
> > > [    2.412908] ufshcd-qcom 1da4000.ufshc: ufshcd_pltfrm_init()
> > > failed -517
> > > 
> > > I'll investigate the PHY init.
> > > 
> > > Regards.
> > > 
> > > 
> > > diff --git a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > index b4276da1fb0d..ad7542f461af 100644
> > > --- a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
> > > @@ -241,3 +241,26 @@
> > >           };
> > >       };
> > >   };
> > > +
> > > +&ufshc {
> > > +    status = "ok";
> > > +    vdd-hba-supply = <&gcc UFS_GDSC>;
> > > +    vdd-hba-fixed-regulator;
> > > +    vcc-supply = <&vreg_l20a_2p95>;
> > > +    vccq-supply = <&vreg_l26a_1p2>;
> > > +    vccq2-supply = <&vreg_s4a_1p8>;
> > > +    vcc-max-microamp = <750000>;
> > > +    vccq-max-microamp = <560000>;
> > > +    vccq2-max-microamp = <750000>;
> > > +};
> > > +
> > > +&ufsphy {
> > > +    status = "ok";
> > > +    vdda-phy-supply = <&vreg_l1a_0p875>;
> > > +    vdda-pll-supply = <&vreg_l2a_1p2>;
> > > +    vddp-ref-clk-supply = <&vreg_l26a_1p2>;
> > > +    vdda-phy-max-microamp = <51400>;
> > > +    vdda-pll-max-microamp = <14600>;
> > > +    vddp-ref-clk-max-microamp = <100>;
> > > +    vddp-ref-clk-always-on;
> > > +};
> > > diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > index d291b4713c33..10e7b8a55b8a 100644
> > > --- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
> > > @@ -264,6 +264,11 @@
> > >           rpm_requests: rpm-requests {
> > >               compatible = "qcom,rpm-msm8998";
> > >               qcom,glink-channels = "rpm_requests";
> > > +
> > > +            rpmcc: qcom,rpmcc {
> > > +                compatible = "qcom,rpmcc-msm8998";
> > > +                #clock-cells = <1>;
> > > +            };
> > >           };
> > >       };
> > > @@ -686,5 +691,79 @@
> > >               redistributor-stride = <0x0 0x20000>;
> > >               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
> > >           };
> > > +
> > > +        ufshc: ufshc@1da4000 {
> > > +            compatible = "qcom,msm8998-ufshc", "qcom,ufshc",
> > > +                     "jedec,ufs-2.0";
> > > +            reg = <0x1da4000 0x2500>;
> > > +            interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
> > > +            phys = <&ufsphy_lanes>;
> > > +            phy-names = "ufsphy";
> > > +            lanes-per-direction = <2>;
> > > +            power-domains = <&gcc UFS_GDSC>;
> > > +
> > > +            clock-names =
> > > +                "core_clk",
> > > +                "bus_aggr_clk",
> > > +                "iface_clk",
> > > +                "core_clk_unipro",
> > > +                "core_clk_ice",
> > > +                "ref_clk",
> > > +                "tx_lane0_sync_clk",
> > > +                "rx_lane0_sync_clk",
> > > +                "rx_lane1_sync_clk";
> > > +            clocks =
> > > +                <&gcc GCC_UFS_AXI_CLK>,
> > > +                <&gcc GCC_AGGRE1_UFS_AXI_CLK>,
> > > +                <&gcc GCC_UFS_AHB_CLK>,
> > > +                <&gcc GCC_UFS_UNIPRO_CORE_CLK>,
> > > +                <&gcc GCC_UFS_ICE_CORE_CLK>,
> > > +                <&rpmcc 0>,
> > > +                <&gcc GCC_UFS_TX_SYMBOL_0_CLK>,
> > > +                <&gcc GCC_UFS_RX_SYMBOL_0_CLK>,
> > > +                <&gcc GCC_UFS_RX_SYMBOL_1_CLK>;
> > > +            freq-table-hz =
> > > +                <50000000 200000000>,
> > > +                <0 0>,
> > > +                <0 0>,
> > > +                <37500000 150000000>,
> > > +                <75000000 300000000>,
> > > +                <0 0>,
> > > +                <0 0>,
> > > +                <0 0>,
> > > +                <0 0>;
> > > +
> > > +            resets = <&gcc GCC_UFS_BCR>;
> > 
> > I dunno how much this factors into your issues, but the resets defined
> > in gcc-msm8998.c are wrong.  I'm posting a patch later today.  I know
> > this was a problem for me with USB.
> > 
> > > +            reset-names = "rst";
> > > +
> > > +            status = "disabled";
> > > +        };
> > > +
> > > +        ufsphy: phy@1da7000 {
> > > +            compatible = "qcom,sdm845-qmp-ufs-phy";
> > > +            reg = <0x1da7000 0x18c>;
> > > +            #address-cells = <1>;
> > > +            #size-cells = <1>;
> > > +            ranges;
> > > +            clock-names =
> > > +                "ref_clk_src",
> > > +                "ref_clk",
> > > +                "ref_aux_clk";
> > > +            clocks =
> > > +                <&rpmcc 0>,
> > > +                <&gcc GCC_UFS_CLKREF_CLK>,
> 
> Also, "GCC_UFS_CLKREF_CLK" is not defined in
> include/dt-bindings/clock/qcom,gcc-msm8998.h which is probably the cause of
> your -2 error listed above.
> 

I agree, this would cause the problem you're seeing.

Please find this clock at:

https://lore.kernel.org/lkml/20181130065259.26497-4-bjorn.andersson@linaro.org/

I will respin patch 1 and post the series again in a few hours.

Regards,
Bjorn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2018-12-03 16:09 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 15:18 WIP: UFS on apq8098 Marc Gonzalez
2018-12-03 15:18 ` Marc Gonzalez
2018-12-03 15:27 ` Jeffrey Hugo
2018-12-03 15:27   ` Jeffrey Hugo
2018-12-03 15:47   ` Jeffrey Hugo
2018-12-03 15:53     ` Marc Gonzalez
2018-12-03 16:03       ` Jeffrey Hugo
2018-12-03 16:13         ` Marc Gonzalez
2018-12-03 16:18           ` Jeffrey Hugo
2018-12-03 16:22             ` Marc Gonzalez
2018-12-03 16:22               ` Marc Gonzalez
2018-12-03 16:09     ` Bjorn Andersson [this message]
2018-12-03 16:09       ` Bjorn Andersson
2018-12-03 16:53 ` Marc Gonzalez
2018-12-03 16:53   ` Marc Gonzalez
2018-12-04 15:23   ` Marc Gonzalez
2018-12-04 15:23     ` Marc Gonzalez
2018-12-04 15:45     ` Jeffrey Hugo
2018-12-04 15:45       ` Jeffrey Hugo
2018-12-04 16:14       ` Jeffrey Hugo
2018-12-04 16:17     ` Marc Gonzalez
2018-12-04 16:17       ` Marc Gonzalez
2018-12-04 16:35       ` Jeffrey Hugo
2018-12-04 16:35         ` Jeffrey Hugo
2018-12-04 17:03         ` Marc Gonzalez
2018-12-04 17:03           ` Marc Gonzalez
2018-12-04 17:05           ` Jeffrey Hugo
2018-12-04 17:05             ` Jeffrey Hugo
2018-12-04 17:11             ` Marc Gonzalez
2018-12-04 17:11               ` Marc Gonzalez
2018-12-04 17:21               ` Jeffrey Hugo
2018-12-04 17:21                 ` Jeffrey Hugo
2018-12-04 17:31                 ` Jeffrey Hugo
2018-12-06 16:15                   ` Marc Gonzalez
2018-12-06 16:15                     ` Marc Gonzalez
2018-12-06 16:45                     ` Evan Green
2018-12-06 16:45                       ` Evan Green
2018-12-07  8:57                       ` Marc Gonzalez
2018-12-07  8:57                         ` Marc Gonzalez
2018-12-07  9:29                         ` Marc Gonzalez
2018-12-07  9:29                           ` Marc Gonzalez
2018-12-07 12:10                       ` Marc Gonzalez
2018-12-07 12:10                         ` Marc Gonzalez
2018-12-07 17:14                         ` Evan Green
2018-12-07 17:14                           ` Evan Green
2018-12-12 17:34 ` Marc Gonzalez
2018-12-12 17:34   ` Marc Gonzalez
2018-12-13 10:51   ` Marc Gonzalez
2018-12-13 10:51     ` Marc Gonzalez

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=20181203160905.GR2225@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=jhugo@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    --cc=nicolas.dechesne@linaro.org \
    --cc=niklas.cassel@linaro.org \
    --cc=rnayak@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.