mbox series

[RFC,0/8] ARM: qcom: msm8960: support CPU frequency scaling

Message ID 20230702175045.122041-1-dmitry.baryshkov@linaro.org
Headers show
Series ARM: qcom: msm8960: support CPU frequency scaling | expand

Message

Dmitry Baryshkov July 2, 2023, 5:50 p.m. UTC
This is an RFC (or maybe it should be RFT), as I did not test this on
the actual hardware. The actual core and L2 setup is mostly the same as
APQ8064, so this is just a port of APQ8064 code and adaptation for small
MSM8960 peculiarities.

Note, msm-3.4 had separate optional AVS code for MSM8960, but as I don't
have the actual hardware, it is left untouched for now.

Dependencies: [1].

[1] https://lore.kernel.org/linux-arm-msm/20230702174246.121656-1-dmitry.baryshkov@linaro.org/

Dmitry Baryshkov (8):
  dt-bindings: nvmem: qfprom: add compatible for MSM8960
  cpufreq: qcom-nvmem: enable core voltage scaling for MSM8960
  cpufreq: qcom-nvmem: provide vmin constraint for early Kraits
  ARM: dts: qcom: msm8960-cdp: constraint cpufreq regulators
  ARM: dts: qcom: msm8960-samsung-expressatt: constraint cpufreq
    regulators
  ARM: dts: qcom: msm8960: add Krait clock controller
  ARM: dts: qcom: msm8960: add L2 cache scaling
  ARM: dts: qcom: apq8064: add simple CPUFreq support

 .../bindings/nvmem/qcom,qfprom.yaml           |   1 +
 arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts   |   9 +-
 .../qcom/qcom-msm8960-samsung-expressatt.dts  |   9 +-
 arch/arm/boot/dts/qcom/qcom-msm8960.dtsi      | 289 +++++++++++++++++-
 drivers/cpufreq/qcom-cpufreq-nvmem.c          |  69 ++++-
 5 files changed, 370 insertions(+), 7 deletions(-)

Comments

Conor Dooley July 3, 2023, 4:38 p.m. UTC | #1
On Sun, Jul 02, 2023 at 08:50:38PM +0300, Dmitry Baryshkov wrote:
> Add the QFPROM compatible for MSM8960.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.
Konrad Dybcio July 4, 2023, 1:03 p.m. UTC | #2
On 2.07.2023 19:50, Dmitry Baryshkov wrote:
> Add additional constraints to the CPUfreq-related regulators, it is
> better be safe than sorry there.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
I'm squinting quite hard at

https://github.com/LineageOS/sony-kernel-msm8960/blob/jb-dev/arch/arm/mach-msm/acpuclock-8960.c

but I can't figure out where these min values came from

Konrad
>  arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
> index 414881d34c60..cba0d1e460a1 100644
> --- a/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
> +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
> @@ -131,7 +131,7 @@ pm8921_s2: s2 {
>  		};
>  
>  		pm8921_s3: s3 {
> -			regulator-min-microvolt = <500000>;
> +			regulator-min-microvolt = <950000>;
>  			regulator-max-microvolt = <1150000>;
>  			qcom,switch-mode-frequency = <4800000>;
>  			bias-pull-down;
> @@ -287,7 +287,7 @@ pm8921_l23: l23 {
>  		};
>  
>  		pm8921_l24: l24 {
> -			regulator-min-microvolt = <750000>;
> +			regulator-min-microvolt = <1050000>;
>  			regulator-max-microvolt = <1150000>;
>  			bias-pull-down;
>  		};
Dmitry Baryshkov July 4, 2023, 1:34 p.m. UTC | #3
On Tue, 4 Jul 2023 at 16:03, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
> On 2.07.2023 19:50, Dmitry Baryshkov wrote:
> > Add additional constraints to the CPUfreq-related regulators, it is
> > better be safe than sorry there.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> I'm squinting quite hard at
>
> https://github.com/LineageOS/sony-kernel-msm8960/blob/jb-dev/arch/arm/mach-msm/acpuclock-8960.c
>
> but I can't figure out where these min values came from

These should be the minimum values for vdd_min and vdd_dig in
l2_freq_tbl_8960_kraitv2 (v1 is unsupported in mainline).
See below,

>
> Konrad
> >  arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
> > index 414881d34c60..cba0d1e460a1 100644
> > --- a/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
> > +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
> > @@ -131,7 +131,7 @@ pm8921_s2: s2 {
> >               };
> >
> >               pm8921_s3: s3 {
> > -                     regulator-min-microvolt = <500000>;
> > +                     regulator-min-microvolt = <950000>;

And this is obviously a c&p from 8064. This should be 1050000.

> >                       regulator-max-microvolt = <1150000>;
> >                       qcom,switch-mode-frequency = <4800000>;
> >                       bias-pull-down;
> > @@ -287,7 +287,7 @@ pm8921_l23: l23 {
> >               };
> >
> >               pm8921_l24: l24 {
> > -                     regulator-min-microvolt = <750000>;
> > +                     regulator-min-microvolt = <1050000>;
> >                       regulator-max-microvolt = <1150000>;
> >                       bias-pull-down;
> >               };
Konrad Dybcio July 4, 2023, 1:50 p.m. UTC | #4
On 4.07.2023 15:34, Dmitry Baryshkov wrote:
> On Tue, 4 Jul 2023 at 16:03, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>
>> On 2.07.2023 19:50, Dmitry Baryshkov wrote:
>>> Add additional constraints to the CPUfreq-related regulators, it is
>>> better be safe than sorry there.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>> I'm squinting quite hard at
>>
>> https://github.com/LineageOS/sony-kernel-msm8960/blob/jb-dev/arch/arm/mach-msm/acpuclock-8960.c
>>
>> but I can't figure out where these min values came from
> 
> These should be the minimum values for vdd_min and vdd_dig in
> l2_freq_tbl_8960_kraitv2 (v1 is unsupported in mainline).
> See below,
> 
>>
>> Konrad
>>>  arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
>>> index 414881d34c60..cba0d1e460a1 100644
>>> --- a/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
>>> +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-cdp.dts
>>> @@ -131,7 +131,7 @@ pm8921_s2: s2 {
>>>               };
>>>
>>>               pm8921_s3: s3 {
>>> -                     regulator-min-microvolt = <500000>;
>>> +                     regulator-min-microvolt = <950000>;
> 
> And this is obviously a c&p from 8064. This should be 1050000.
Okay, please remember to fix all other boards from this patchset too.

Konrad
> 
>>>                       regulator-max-microvolt = <1150000>;
>>>                       qcom,switch-mode-frequency = <4800000>;
>>>                       bias-pull-down;
>>> @@ -287,7 +287,7 @@ pm8921_l23: l23 {
>>>               };
>>>
>>>               pm8921_l24: l24 {
>>> -                     regulator-min-microvolt = <750000>;
>>> +                     regulator-min-microvolt = <1050000>;
>>>                       regulator-max-microvolt = <1150000>;
>>>                       bias-pull-down;
>>>               };
> 
> 
>