diff mbox series

[v5,2/4] dt-bindings: opp: opp-v2-kryo-cpu: Document named opp-microvolt property

Message ID 20230930102218.229613-2-robimarko@gmail.com (mailing list archive)
State New, archived
Delegated to: viresh kumar
Headers show
Series [v5,1/4] cpufreq: qcom-nvmem: add support for IPQ8074 | expand

Commit Message

Robert Marko Sept. 30, 2023, 10:21 a.m. UTC
From: Christian Marangi <ansuelsmth@gmail.com>

Document named opp-microvolt property for opp-v2-kryo-cpu schema.
This property is used to declare multiple voltage ranges selected on the
different values read from efuses. The selection is done based on the
speed pvs values and the named opp-microvolt property is selected by the
qcom-cpufreq-nvmem driver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
Changes v5:
* Fix typo in opp items

Changes v4:
* Address comments from Rob (meaning of pvs, drop of
  driver specific info, drop of legacy single voltage OPP,
  better specify max regulators supported)

 .../bindings/opp/opp-v2-kryo-cpu.yaml         | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)

Comments

Rob Herring (Arm) Oct. 2, 2023, 7:02 p.m. UTC | #1
On Sat, 30 Sep 2023 12:21:17 +0200, Robert Marko wrote:
> From: Christian Marangi <ansuelsmth@gmail.com>
> 
> Document named opp-microvolt property for opp-v2-kryo-cpu schema.
> This property is used to declare multiple voltage ranges selected on the
> different values read from efuses. The selection is done based on the
> speed pvs values and the named opp-microvolt property is selected by the
> qcom-cpufreq-nvmem driver.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> ---
> Changes v5:
> * Fix typo in opp items
> 
> Changes v4:
> * Address comments from Rob (meaning of pvs, drop of
>   driver specific info, drop of legacy single voltage OPP,
>   better specify max regulators supported)
> 
>  .../bindings/opp/opp-v2-kryo-cpu.yaml         | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Dmitry Baryshkov Oct. 2, 2023, 7:07 p.m. UTC | #2
On Sat, 30 Sept 2023 at 13:22, Robert Marko <robimarko@gmail.com> wrote:
>
> From: Christian Marangi <ansuelsmth@gmail.com>
>
> Document named opp-microvolt property for opp-v2-kryo-cpu schema.
> This property is used to declare multiple voltage ranges selected on the
> different values read from efuses. The selection is done based on the
> speed pvs values and the named opp-microvolt property is selected by the
> qcom-cpufreq-nvmem driver.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> ---
> Changes v5:
> * Fix typo in opp items
>
> Changes v4:
> * Address comments from Rob (meaning of pvs, drop of
>   driver specific info, drop of legacy single voltage OPP,
>   better specify max regulators supported)
>
>  .../bindings/opp/opp-v2-kryo-cpu.yaml         | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
> index 27ea7eca73e5..8d2a47e9a854 100644
> --- a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
> +++ b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
> @@ -65,6 +65,12 @@ patternProperties:
>            5:  MSM8996SG, speedbin 1
>            6:  MSM8996SG, speedbin 2
>            7-31:  unused
> +
> +          Bitmap for IPQ806X SoC:
> +          0:  IPQ8062
> +          1:  IPQ8064/IPQ8066/IPQ8068
> +          2:  IPQ8065/IPQ8069
> +          3-31:  unused
>          enum: [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
>                 0x9, 0xd, 0xe, 0xf,
>                 0x10, 0x20, 0x30, 0x70]
> @@ -73,6 +79,23 @@ patternProperties:
>
>        required-opps: true
>
> +    patternProperties:
> +      '^opp-microvolt-speed[0-9]+-pvs[0-9]+$':
> +        description: |
> +          Named opp-microvolt property following the same generic
> +          binding for named opp-microvolt.
> +
> +          The correct voltage range is selected based on the values
> +          in the efuse for the speed and the pvs (power variable
> +          scaling).

I suppose that simple 'true' schema should be enough since this is
already mostly described in opp/opp-v2-base.yaml

> +        minItems: 1
> +        maxItems: 4 # Up to 4 regulators: Core, Mem, Dig and HFPLL
> +        items:
> +          items:
> +            - description: nominal voltage
> +            - description: minimum voltage
> +            - description: maximum voltage
> +
>      required:
>        - opp-hz
>
> @@ -258,6 +281,22 @@ examples:
>              };
>          };
>
> +        /* Dummy opp table to give example for named opp-microvolt */
> +        opp-table-2 {
> +            compatible = "operating-points-v2-kryo-cpu";
> +            nvmem-cells = <&speedbin_efuse>;
> +
> +            opp-384000000 {
> +                opp-hz = /bits/ 64 <384000000>;
> +                opp-microvolt-speed0-pvs0 = <1000000 950000 1050000>;
> +                opp-microvolt-speed0-pvs1 = <925000 878750 971250>;
> +                opp-microvolt-speed0-pvs2 = <875000 831250 918750>;
> +                opp-microvolt-speed0-pvs3 = <800000 760000 840000>;
> +                opp-supported-hw = <0x7>;
> +                clock-latency-ns = <100000>;
> +            };
> +        };
> +
>          smem {
>              compatible = "qcom,smem";
>              memory-region = <&smem_mem>;
> --
> 2.41.0
>
Christian Marangi Oct. 2, 2023, 7:10 p.m. UTC | #3
On Mon, Oct 02, 2023 at 10:07:44PM +0300, Dmitry Baryshkov wrote:
> On Sat, 30 Sept 2023 at 13:22, Robert Marko <robimarko@gmail.com> wrote:
> >
> > From: Christian Marangi <ansuelsmth@gmail.com>
> >
> > Document named opp-microvolt property for opp-v2-kryo-cpu schema.
> > This property is used to declare multiple voltage ranges selected on the
> > different values read from efuses. The selection is done based on the
> > speed pvs values and the named opp-microvolt property is selected by the
> > qcom-cpufreq-nvmem driver.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > Signed-off-by: Robert Marko <robimarko@gmail.com>
> > ---
> > Changes v5:
> > * Fix typo in opp items
> >
> > Changes v4:
> > * Address comments from Rob (meaning of pvs, drop of
> >   driver specific info, drop of legacy single voltage OPP,
> >   better specify max regulators supported)
> >
> >  .../bindings/opp/opp-v2-kryo-cpu.yaml         | 39 +++++++++++++++++++
> >  1 file changed, 39 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
> > index 27ea7eca73e5..8d2a47e9a854 100644
> > --- a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
> > +++ b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
> > @@ -65,6 +65,12 @@ patternProperties:
> >            5:  MSM8996SG, speedbin 1
> >            6:  MSM8996SG, speedbin 2
> >            7-31:  unused
> > +
> > +          Bitmap for IPQ806X SoC:
> > +          0:  IPQ8062
> > +          1:  IPQ8064/IPQ8066/IPQ8068
> > +          2:  IPQ8065/IPQ8069
> > +          3-31:  unused
> >          enum: [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
> >                 0x9, 0xd, 0xe, 0xf,
> >                 0x10, 0x20, 0x30, 0x70]
> > @@ -73,6 +79,23 @@ patternProperties:
> >
> >        required-opps: true
> >
> > +    patternProperties:
> > +      '^opp-microvolt-speed[0-9]+-pvs[0-9]+$':
> > +        description: |
> > +          Named opp-microvolt property following the same generic
> > +          binding for named opp-microvolt.
> > +
> > +          The correct voltage range is selected based on the values
> > +          in the efuse for the speed and the pvs (power variable
> > +          scaling).
> 
> I suppose that simple 'true' schema should be enough since this is
> already mostly described in opp/opp-v2-base.yaml
>

Mhhh an example of the following implementation?

> > +        minItems: 1
> > +        maxItems: 4 # Up to 4 regulators: Core, Mem, Dig and HFPLL
> > +        items:
> > +          items:
> > +            - description: nominal voltage
> > +            - description: minimum voltage
> > +            - description: maximum voltage
> > +
> >      required:
> >        - opp-hz
> >
> > @@ -258,6 +281,22 @@ examples:
> >              };
> >          };
> >
> > +        /* Dummy opp table to give example for named opp-microvolt */
> > +        opp-table-2 {
> > +            compatible = "operating-points-v2-kryo-cpu";
> > +            nvmem-cells = <&speedbin_efuse>;
> > +
> > +            opp-384000000 {
> > +                opp-hz = /bits/ 64 <384000000>;
> > +                opp-microvolt-speed0-pvs0 = <1000000 950000 1050000>;
> > +                opp-microvolt-speed0-pvs1 = <925000 878750 971250>;
> > +                opp-microvolt-speed0-pvs2 = <875000 831250 918750>;
> > +                opp-microvolt-speed0-pvs3 = <800000 760000 840000>;
> > +                opp-supported-hw = <0x7>;
> > +                clock-latency-ns = <100000>;
> > +            };
> > +        };
> > +
> >          smem {
> >              compatible = "qcom,smem";
> >              memory-region = <&smem_mem>;
> > --
> > 2.41.0
> >
> 
> 
> -- 
> With best wishes
> Dmitry
Viresh Kumar Oct. 10, 2023, 7:14 a.m. UTC | #4
On 02-10-23, 21:10, Christian Marangi wrote:
> On Mon, Oct 02, 2023 at 10:07:44PM +0300, Dmitry Baryshkov wrote:
> > On Sat, 30 Sept 2023 at 13:22, Robert Marko <robimarko@gmail.com> wrote:
> > I suppose that simple 'true' schema should be enough since this is
> > already mostly described in opp/opp-v2-base.yaml
> >
> 
> Mhhh an example of the following implementation?

Documentation/devicetree/bindings/opp/allwinner,sun50i-h6-operating-points.yaml
Viresh Kumar Oct. 10, 2023, 7:18 a.m. UTC | #5
On 02-10-23, 22:07, Dmitry Baryshkov wrote:
> I suppose that simple 'true' schema should be enough since this is
> already mostly described in opp/opp-v2-base.yaml

Dmitry, Konrad,

Can you guys review the other patches in the series, since you are
also actively working on this driver ?
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
index 27ea7eca73e5..8d2a47e9a854 100644
--- a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
+++ b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
@@ -65,6 +65,12 @@  patternProperties:
           5:  MSM8996SG, speedbin 1
           6:  MSM8996SG, speedbin 2
           7-31:  unused
+
+          Bitmap for IPQ806X SoC:
+          0:  IPQ8062
+          1:  IPQ8064/IPQ8066/IPQ8068
+          2:  IPQ8065/IPQ8069
+          3-31:  unused
         enum: [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
                0x9, 0xd, 0xe, 0xf,
                0x10, 0x20, 0x30, 0x70]
@@ -73,6 +79,23 @@  patternProperties:
 
       required-opps: true
 
+    patternProperties:
+      '^opp-microvolt-speed[0-9]+-pvs[0-9]+$':
+        description: |
+          Named opp-microvolt property following the same generic
+          binding for named opp-microvolt.
+
+          The correct voltage range is selected based on the values
+          in the efuse for the speed and the pvs (power variable
+          scaling).
+        minItems: 1
+        maxItems: 4 # Up to 4 regulators: Core, Mem, Dig and HFPLL
+        items:
+          items:
+            - description: nominal voltage
+            - description: minimum voltage
+            - description: maximum voltage
+
     required:
       - opp-hz
 
@@ -258,6 +281,22 @@  examples:
             };
         };
 
+        /* Dummy opp table to give example for named opp-microvolt */
+        opp-table-2 {
+            compatible = "operating-points-v2-kryo-cpu";
+            nvmem-cells = <&speedbin_efuse>;
+
+            opp-384000000 {
+                opp-hz = /bits/ 64 <384000000>;
+                opp-microvolt-speed0-pvs0 = <1000000 950000 1050000>;
+                opp-microvolt-speed0-pvs1 = <925000 878750 971250>;
+                opp-microvolt-speed0-pvs2 = <875000 831250 918750>;
+                opp-microvolt-speed0-pvs3 = <800000 760000 840000>;
+                opp-supported-hw = <0x7>;
+                clock-latency-ns = <100000>;
+            };
+        };
+
         smem {
             compatible = "qcom,smem";
             memory-region = <&smem_mem>;