Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: ilia.lin@kernel.org, agross@kernel.org,
	bjorn.andersson@linaro.org, rafael@kernel.org,
	viresh.kumar@linaro.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, linux-pm@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [RESEND PATCH 4/5] cpufreq: qcom-cpufreq-nvmem: Rename qcs404 data to cpr_genpd
Date: Wed, 29 Jun 2022 21:11:16 +0200	[thread overview]
Message-ID: <Yryj1Nv/Yu8wShzo@gerhold.net> (raw)
In-Reply-To: <20220629130303.3288306-5-bryan.odonoghue@linaro.org>

On Wed, Jun 29, 2022 at 02:03:02PM +0100, Bryan O'Donoghue wrote:
> At the moment the CPR genpd based code is named after the qcs404 however
> msm8936, msm8939 and other antecedent processors of the qcs404 can also
> make use of this data.
> 
> Rename it to reflect a more generic use.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

There is another power domain that needs to be scaled together with the
CPU frequency on MSM8916 and MSM8939: (VDD)MX. How do you handle that?

In downstream this is part of the CPR driver and specified as follows:

	qcom,vdd-mx-corner-map = <4 5 7>;
	qcom,vdd-mx-vmin-method = <4>;
	vdd-mx-supply = <&pm8916_l3_corner_ao>;
	qcom,vdd-mx-vmax = <7>;
	qcom,cpr-corner-map = <1 1 2 2 3 3 3 3 3>; /* MSM8916 */
	qcom,cpr-corner-map = <1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3
			       3 3 3 3 3 3 3 3>; /* MSM8939 */

On MSM8916 this means to vote for MX corner 4 (&rpmpd_opp_svs_soc) for
the first two frequencies, then corner 5 (&rpmpd_opp_nominal) and corner 7
(&rpmpd_opp_super_turbo) for the remaining CPU frequencies. It's similar
for MSM8939, you just have more OPPs there.

There was a semi-related discussion about this in [1] (a bit mixed with
potential ways how to do CPU frequency scaling without CPR). It's been a
while but I think the conclusion back then was that it's easiest to
attach both "mx" and "cpr" in this driver and then scale it as part of
the OPP table.

[1]: https://lore.kernel.org/linux-arm-msm/20200403013119.GB20625@builder.lan/

I'll attach an excerpt of the changes that I used on MSM8916 at the end
of the mail. Note that it does not actually work as-is: IIRC at the
moment there is still nothing that actually enables the power domains
listed for CPUs. The CPR driver does not check that, but rpmpd does and
just ignores the votes.

I submitted a possible patch for this but it just got stuck at some
point because of all the complexity involved:
https://lore.kernel.org/linux-pm/20200826093328.88268-1-stephan@gerhold.net/

Shortly said: I think you do not just want "cpr" here but also "mx".

Thanks,
Stephan

static const char *msm8916_genpd_names[] = { "mx", "cpr", NULL };

cpu@0 {
	power-domains = <&CPU_PD0>, <&rpmpd MSM8916_VDDMX_AO>, <&cpr>;
	power-domain-names = "psci", "mx", "cpr";
};

cpu_opp_table: cpu-opp-table {
	compatible = "operating-points-v2-kryo-cpu";
	opp-shared;

	opp-200000000 {
		opp-hz = /bits/ 64 <200000000>;
		required-opps = <&rpmpd_opp_svs_soc>, <&cpr_opp1>;
	};
	opp-400000000 {
		opp-hz = /bits/ 64 <400000000>;
		required-opps = <&rpmpd_opp_svs_soc>, <&cpr_opp2>;
	};
	opp-533333000 {
		opp-hz = /bits/ 64 <533333000>;
		required-opps = <&rpmpd_opp_nominal>, <&cpr_opp3>;
	};
	opp-800000000 {
		opp-hz = /bits/ 64 <800000000>;
		required-opps = <&rpmpd_opp_nominal>, <&cpr_opp4>;
	};
	opp-998400000 {
		opp-hz = /bits/ 64 <998400000>;
		required-opps = <&rpmpd_opp_super_turbo>, <&cpr_opp5>;
	};
	opp-1094400000 {
		opp-hz = /bits/ 64 <1094400000>;
		required-opps = <&rpmpd_opp_super_turbo>, <&cpr_opp6>;
	};
	opp-1152000000 {
		opp-hz = /bits/ 64 <1152000000>;
		required-opps = <&rpmpd_opp_super_turbo>, <&cpr_opp7>;
	};
	opp-1209600000 {
		opp-hz = /bits/ 64 <1209600000>;
		required-opps = <&rpmpd_opp_super_turbo>, <&cpr_opp8>;
	};
	opp-1363200000 {
		opp-hz = /bits/ 64 <1363200000>;
		required-opps = <&rpmpd_opp_super_turbo>, <&cpr_opp9>;
	};
};

  reply	other threads:[~2022-06-29 19:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 13:02 [RESEND PATCH 0/5] qcom-cpufreq-nvmem: Add msm8939 with some fixups Bryan O'Donoghue
2022-06-29 13:02 ` [RESEND PATCH 1/5] dt-bindings: opp: Add missing compat devices Bryan O'Donoghue
2022-06-29 18:19   ` Krzysztof Kozlowski
2022-06-29 22:36   ` Rob Herring
2022-06-30  4:10     ` Bryan O'Donoghue
2022-06-30 21:16       ` Rob Herring
2022-06-30 21:16   ` Rob Herring
2022-06-29 13:03 ` [RESEND PATCH 2/5] dt-bindings: opp: Add msm8939 to the compatible list Bryan O'Donoghue
2022-06-29 18:20   ` Krzysztof Kozlowski
2022-06-29 13:03 ` [RESEND PATCH 3/5] cpufreq: blocklist Qualcomm msm8939 in cpufreq-dt-platdev Bryan O'Donoghue
2022-06-29 13:03 ` [RESEND PATCH 4/5] cpufreq: qcom-cpufreq-nvmem: Rename qcs404 data to cpr_genpd Bryan O'Donoghue
2022-06-29 19:11   ` Stephan Gerhold [this message]
2022-06-30  4:05     ` Bryan O'Donoghue
2022-06-30 18:25       ` Stephan Gerhold
2022-07-13 13:50   ` Dmitry Baryshkov
2022-07-13 14:52     ` Bryan O'Donoghue
2022-06-29 13:03 ` [RESEND PATCH 5/5] cpufreq: qcom-cpufreq-nvmem: Add msm8939 as cpr_genpd Bryan O'Donoghue

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=Yryj1Nv/Yu8wShzo@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=ilia.lin@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=viresh.kumar@linaro.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