public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Ilia Lin <ilia.lin@kernel.org>, Viresh Kumar <vireshk@kernel.org>,
	Nishanth Menon <nm@ti.com>, Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Georgi Djakov <djakov@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-clk@vger.kernel.org,
	Christian Marangi <ansuelsmth@gmail.com>,
	Stephan Gerhold <stephan@gerhold.net>
Subject: Re: [RFC PATCH 8/8] ARM: dts: qcom: apq8064: add simple CPUFreq support
Date: Tue, 4 Jul 2023 15:49:16 +0200	[thread overview]
Message-ID: <00ac128c-bfef-d370-240e-6ff03b87dab4@linaro.org> (raw)
In-Reply-To: <CAA8EJppUA+Ce9fzS8cq13VA0DKspzKY=8pCoy2BMW4zGkiY6rQ@mail.gmail.com>

On 4.07.2023 15:44, Dmitry Baryshkov wrote:
> On Tue, 4 Jul 2023 at 16:05, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>
>> On 2.07.2023 19:50, Dmitry Baryshkov wrote:
>>
>> Subject: wrong soc
>>
>>> Declare CPU frequency-scaling properties. Each CPU has its own clock,
>>> how all CPUs have the same OPP table. Voltage scaling is not (yet)
>>> enabled with this patch. It will be enabled later.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---Same concern as patch 4, can't see where these values came from.
> 
> Explained below.
> 
> Please use https://android.googlesource.com/kernel/msm/+/android-msm-hammerhead-3.4-marshmallow-mr2/arch/arm/mach-msm/acpuclock-8960.c
> as a reference.
> 
>>
>> Konrad
>>>  arch/arm/boot/dts/qcom/qcom-msm8960.dtsi | 147 +++++++++++++++++++++++
>>>  1 file changed, 147 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi
>>> index 48b3962dd4fb..995ea32f8d66 100644
>>> --- a/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi
>>> +++ b/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi
>>> @@ -8,6 +8,7 @@
>>>  #include <dt-bindings/clock/qcom,lcc-msm8960.h>
>>>  #include <dt-bindings/mfd/qcom-rpm.h>
>>>  #include <dt-bindings/soc/qcom,gsbi.h>
>>> +#include <dt-bindings/soc/qcom,krait-l2-cache.h>
>>>
>>>  / {
>>>       #address-cells = <1>;
>>> @@ -29,6 +30,13 @@ cpu@0 {
>>>                       next-level-cache = <&L2>;
>>>                       qcom,acc = <&acc0>;
>>>                       qcom,saw = <&saw0>;
>>> +                     clocks = <&kraitcc KRAIT_CPU_0>;
>>> +                     clock-names = "cpu";
>>> +                     clock-latency = <100000>;
>>> +                     vdd-core-supply = <&saw0_vreg>;
>>> +                     interconnects = <&L2 MASTER_KRAIT_L2 &L2 SLAVE_KRAIT_L2>;
>>> +                     operating-points-v2 = <&cpu_opp_table>;
>>> +                     #cooling-cells = <2>;
>>>               };
>>>
>>>               cpu@1 {
>>> @@ -39,6 +47,13 @@ cpu@1 {
>>>                       next-level-cache = <&L2>;
>>>                       qcom,acc = <&acc1>;
>>>                       qcom,saw = <&saw1>;
>>> +                     clocks = <&kraitcc KRAIT_CPU_0>;
>>> +                     clock-names = "cpu";
>>> +                     clock-latency = <100000>;
>>> +                     vdd-core-supply = <&saw1_vreg>;
>>> +                     interconnects = <&L2 MASTER_KRAIT_L2 &L2 SLAVE_KRAIT_L2>;
>>> +                     operating-points-v2 = <&cpu_opp_table>;
>>> +                     #cooling-cells = <2>;
>>>               };
>>>
>>>               L2: l2-cache {
>>> @@ -169,6 +184,127 @@ opp-1350000000 {
>>>               };
>>>       };
>>>
>>> +     cpu_opp_table: opp-table-cpu {
>>> +             compatible = "operating-points-v2-krait-cpu";
>>> +             nvmem-cells = <&speedbin_efuse>;
>>> +
>>> +             /*
>>> +              * Voltage thresholds are <target min max>
>>> +              */
>>> +             opp-384000000 {
>>> +                     opp-hz = /bits/ 64 <384000000>;
>>> +                     opp-peak-kBps = <384000>;
>>> +                     opp-microvolt-speed0-pvs0 = <950000 950000 950000>;
> 
> acpu_freq_tbl_slow, the voltage column.
> For the PVS_SLOW the pvs_tables doesn't list turbo boost, so all three
> voltages are the same.
> 
>>> +                     opp-microvolt-speed0-pvs1 = <925000 900000 950000>;
> 
> This comes from acpu_freq_tbl_nom. The voltage from the table becomes
> the middle value (min).
> For PVS_NOM the pvs_tables has the turbo value (25000), which
> acpuclock-krait applied by default, this becomes the first (target)
> value.
> For maximum I added another 25 mV to account for this exact value not
> being supported by the core (SAW) regulator.
And PVS3 seems to be correlated with acpu_freq_tbl_fast. Ok.
Makes sense now.

One nit below.
> 
> 
>>> +                     opp-microvolt-speed0-pvs3 = <875000 850000 900000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +                     /*
>>> +                      * higher latency as it requires switching between
>>> +                      * clock sources
>>> +                      */
>>> +                     clock-latency-ns = <244144>;
>>> +             };
>>> +
>>> +             opp-486000000 {
>>> +                     opp-hz = /bits/ 64 <486000000>;
>>> +                     opp-peak-kBps = <702000>;
>>> +                     opp-microvolt-speed0-pvs0 = <975000 975000 975000>;
>>> +                     opp-microvolt-speed0-pvs1 = <950000 925000 975000>;
>>> +                     opp-microvolt-speed0-pvs3 = <900000 875000 925000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-594000000 {
>>> +                     opp-hz = /bits/ 64 <594000000>;
>>> +                     opp-peak-kBps = <702000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1000000 1000000 1000000>;
>>> +                     opp-microvolt-speed0-pvs1 = <975000 950000 1000000>;
>>> +                     opp-microvolt-speed0-pvs3 = <925000 900000 950000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-702000000 {
>>> +                     opp-hz = /bits/ 64 <702000000>;
>>> +                     opp-peak-kBps = <702000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1025000 1025000 1025000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1000000 975000 1025000>;
>>> +                     opp-microvolt-speed0-pvs3 = <950000 925000 975000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-810000000 {
>>> +                     opp-hz = /bits/ 64 <810000000>;
>>> +                     opp-peak-kBps = <702000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1075000 1075000 1075000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1050000 1025000 1075000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1000000 975000 1025000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-918000000 {
>>> +                     opp-hz = /bits/ 64 <918000000>;
>>> +                     opp-peak-kBps = <702000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1100000 1100000 1100000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1075000 1050000 1100000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1025000 1000000 1050000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-1026000000 {
>>> +                     opp-hz = /bits/ 64 <1026000000>;
>>> +                     opp-peak-kBps = <702000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1125000 1125000 1125000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1100000 1075000 1125000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1050000 1025000 1075000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-1134000000 {
>>> +                     opp-hz = /bits/ 64 <1134000000>;
>>> +                     opp-peak-kBps = <1350000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1175000 1175000 1175000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1150000 1125000 1175000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1100000 1075000 1125000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-1242000000 {
>>> +                     opp-hz = /bits/ 64 <1242000000>;
>>> +                     opp-peak-kBps = <1350000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1200000 1200000 1200000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1175000 1150000 1200000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1125000 1100000 1150000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-1350000000 {
>>> +                     opp-hz = /bits/ 64 <1350000000>;
>>> +                     opp-peak-kBps = <1350000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1225000 1225000 1225000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1200000 1175000 1225000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1150000 1125000 1175000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-1458000000 {
>>> +                     opp-hz = /bits/ 64 <1458000000>;
>>> +                     opp-peak-kBps = <1350000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1237500 1237500 1237500>;
>>> +                     opp-microvolt-speed0-pvs1 = <1212500 1187500 1237500>;
>>> +                     opp-microvolt-speed0-pvs3 = <1162500 1137500 1187500>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +
>>> +             opp-1512000000 {
>>> +                     opp-hz = /bits/ 64 <1512000000>;
>>> +                     opp-peak-kBps = <1350000>;
>>> +                     opp-microvolt-speed0-pvs0 = <1250000 1250000 1250000>;
>>> +                     opp-microvolt-speed0-pvs1 = <1225000 1200000 1250000>;
>>> +                     opp-microvolt-speed0-pvs3 = <1175000 1150000 1200000>;
>>> +                     opp-supported-hw = <0x1>;
>>> +             };
>>> +     };
>>> +
>>>       memory {
>>>               device_type = "memory";
>>>               reg = <0x0 0x0>;
>>> @@ -266,6 +402,17 @@ msmgpio: pinctrl@800000 {
>>>                       reg = <0x800000 0x4000>;
>>>               };
>>>
>>> +             qfprom: qfprom@700000 {
>>> +                     compatible = "qcom,msm8960-qfprom", "qcom,qfprom";
>>> +                     reg = <0x00700000 0x1000>;
>>> +                     #address-cells = <1>;
>>> +                     #size-cells = <1>;
>>> +                     ranges;
Please add a newline before the subnode.

Konrad

>>> +                     speedbin_efuse: speedbin@c0 {
>>> +                             reg = <0x0c0 0x4>;
>>> +                     };
>>> +             };
>>> +
>>>               gcc: clock-controller@900000 {
>>>                       compatible = "qcom,gcc-msm8960";
>>>                       #clock-cells = <1>;
> 
> 
> 

      reply	other threads:[~2023-07-04 13:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 17:50 [RFC PATCH 0/8] ARM: qcom: msm8960: support CPU frequency scaling Dmitry Baryshkov
2023-07-02 17:50 ` [RFC PATCH 1/8] dt-bindings: nvmem: qfprom: add compatible for MSM8960 Dmitry Baryshkov
2023-07-03 16:38   ` Conor Dooley
2023-07-02 17:50 ` [RFC PATCH 2/8] cpufreq: qcom-nvmem: enable core voltage scaling " Dmitry Baryshkov
2023-07-02 17:50 ` [RFC PATCH 3/8] cpufreq: qcom-nvmem: provide vmin constraint for early Kraits Dmitry Baryshkov
2023-07-03 11:38   ` Konrad Dybcio
2023-07-02 17:50 ` [RFC PATCH 4/8] ARM: dts: qcom: msm8960-cdp: constraint cpufreq regulators Dmitry Baryshkov
2023-07-04 13:03   ` Konrad Dybcio
2023-07-04 13:34     ` Dmitry Baryshkov
2023-07-04 13:50       ` Konrad Dybcio
2023-07-02 17:50 ` [RFC PATCH 5/8] ARM: dts: qcom: msm8960-samsung-expressatt: " Dmitry Baryshkov
2023-07-02 17:50 ` [RFC PATCH 6/8] ARM: dts: qcom: msm8960: add Krait clock controller Dmitry Baryshkov
2023-07-02 17:50 ` [RFC PATCH 7/8] ARM: dts: qcom: msm8960: add L2 cache scaling Dmitry Baryshkov
2023-07-02 17:50 ` [RFC PATCH 8/8] ARM: dts: qcom: apq8064: add simple CPUFreq support Dmitry Baryshkov
2023-07-04 13:05   ` Konrad Dybcio
2023-07-04 13:44     ` Dmitry Baryshkov
2023-07-04 13:49       ` Konrad Dybcio [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=00ac128c-bfef-d370-240e-6ff03b87dab4@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djakov@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=ilia.lin@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=stephan@gerhold.net \
    --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