From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: vireshk@kernel.org, nm@ti.com, sboyd@kernel.org,
myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
cw00.choi@samsung.com, andersson@kernel.org,
konrad.dybcio@linaro.org, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
jejb@linux.ibm.com, martin.petersen@oracle.com,
alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org,
linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
quic_asutoshd@quicinc.com, quic_cang@quicinc.com,
quic_nitirawa@quicinc.com, quic_narepall@quicinc.com,
quic_bhaskarv@quicinc.com, quic_richardp@quicinc.com,
quic_nguyenb@quicinc.com, quic_ziqichen@quicinc.com,
bmasney@redhat.com, krzysztof.kozlowski@linaro.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 6/6] arm64: dts: qcom: sm8250: Add OPP table support to UFSHC
Date: Wed, 4 Oct 2023 11:55:18 +0530 [thread overview]
Message-ID: <20231004062518.GB7298@thinkpad> (raw)
In-Reply-To: <CAA8EJppOuAnVsnV0tYLyGqyJy3xVt2ToTZ+r9hyNd=VgK1Ez8Q@mail.gmail.com>
On Tue, Oct 03, 2023 at 06:25:22PM +0300, Dmitry Baryshkov wrote:
> On Tue, 3 Oct 2023 at 14:16, Manivannan Sadhasivam
> <manivannan.sadhasivam@linaro.org> wrote:
> >
> > UFS host controller, when scaling gears, should choose appropriate
> > performance state of RPMh power domain controller along with clock
> > frequency. So let's add the OPP table support to specify both clock
> > frequency and RPMh performance states replacing the old "freq-table-hz"
> > property.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > arch/arm64/boot/dts/qcom/sm8250.dtsi | 39 +++++++++++++++++++++-------
> > 1 file changed, 30 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> > index a4e58ad731c3..33abd84aae53 100644
> > --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> > @@ -2198,21 +2198,42 @@ ufs_mem_hc: ufshc@1d84000 {
> > <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
> > <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
> > <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
> > - freq-table-hz =
> > - <37500000 300000000>,
> > - <0 0>,
> > - <0 0>,
> > - <37500000 300000000>,
> > - <0 0>,
> > - <0 0>,
> > - <0 0>,
> > - <0 0>;
> > +
> > + operating-points-v2 = <&ufs_opp_table>;
> >
> > interconnects = <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI_CH0 0>,
> > <&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_UFS_MEM_CFG 0>;
> > interconnect-names = "ufs-ddr", "cpu-ufs";
> >
> > status = "disabled";
> > +
> > + ufs_opp_table: opp-table {
> > + compatible = "operating-points-v2";
> > +
> > + opp-37500000 {
> > + opp-hz = /bits/ 64 <37500000>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <37500000>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>;
>
> I must say I still consider this to be uglier than hard coding clock
> names in the driver.
>
It is all about choosing the less uglier one... First of all, it is not a good
practice to hardcode clk names in the driver as the driver has to trust what is
being supplied from DT. Also, the OPP support is added in the generic
"ufshcd-platfrm" driver. Now for getting the clk names, I need to introduce a
method to pass the names from the vendor drivers. There are already many such
methods going between these two drivers making it messy and adding one more
would only add up the worse.
So I'd like to stick to this approach.
- Mani
> > + required-opps = <&rpmhpd_opp_low_svs>;
> > + };
> > +
> > + opp-300000000 {
> > + opp-hz = /bits/ 64 <300000000>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <300000000>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>,
> > + /bits/ 64 <0>;
> > + required-opps = <&rpmhpd_opp_nom>;
> > + };
> > + };
> > };
> >
> > ufs_mem_phy: phy@1d87000 {
> > --
> > 2.25.1
> >
>
>
> --
> With best wishes
> Dmitry
--
மணிவண்ணன் சதாசிவம்
prev parent reply other threads:[~2023-10-04 6:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 11:12 [PATCH v4 0/6] UFS: Add OPP support Manivannan Sadhasivam
2023-10-03 11:12 ` [PATCH v4 1/6] dt-bindings: ufs: common: add OPP table Manivannan Sadhasivam
2023-10-03 12:16 ` Rob Herring
2023-10-03 12:44 ` Manivannan Sadhasivam
2023-10-03 11:12 ` [PATCH v4 2/6] PM / devfreq: Switch to dev_pm_opp_find_freq_{ceil/floor}_indexed() APIs Manivannan Sadhasivam
2023-10-06 15:24 ` Chanwoo Choi
2023-10-03 11:12 ` [PATCH v4 3/6] scsi: ufs: core: Add OPP support for scaling clocks and regulators Manivannan Sadhasivam
2023-10-03 11:12 ` [PATCH v4 4/6] scsi: ufs: host: Add support for parsing OPP Manivannan Sadhasivam
2023-10-03 11:12 ` [PATCH v4 5/6] arm64: dts: qcom: sdm845: Add OPP table support to UFSHC Manivannan Sadhasivam
2023-10-03 11:12 ` [PATCH v4 6/6] arm64: dts: qcom: sm8250: " Manivannan Sadhasivam
2023-10-03 15:25 ` Dmitry Baryshkov
2023-10-04 6:25 ` Manivannan Sadhasivam [this message]
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=20231004062518.GB7298@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=andersson@kernel.org \
--cc=avri.altman@wdc.com \
--cc=bmasney@redhat.com \
--cc=bvanassche@acm.org \
--cc=conor+dt@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=jejb@linux.ibm.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=myungjoo.ham@samsung.com \
--cc=nm@ti.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_bhaskarv@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_narepall@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=quic_nitirawa@quicinc.com \
--cc=quic_richardp@quicinc.com \
--cc=quic_ziqichen@quicinc.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=vireshk@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).