[2/2] dt-bindings: devfreq: Document L2 Krait CPU Cache devfreq driver

Message ID 20200927160515.6480-2-ansuelsmth@gmail.com
State New
Headers show
Series
  • Untitled series #51837
Related show

Commit Message

Ansuel Smith Sept. 27, 2020, 4:05 p.m.
Document dedicated L2 Krait CPU Cache devfreq scaling driver.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 .../bindings/devfreq/krait-cache-devfreq.yaml | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml

Comments

Rob Herring Sept. 28, 2020, 6:03 p.m. | #1
On Sun, 27 Sep 2020 18:05:13 +0200, Ansuel Smith wrote:
> Document dedicated L2 Krait CPU Cache devfreq scaling driver.

> 

> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>

> ---

>  .../bindings/devfreq/krait-cache-devfreq.yaml | 77 +++++++++++++++++++

>  1 file changed, 77 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml

> 



My bot found errors running 'make dt_binding_check' on your patch:

./Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml: $id: relative path/filename doesn't match actual path or filename
	expected: http://devicetree.org/schemas/devfreq/krait-cache-devfreq.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.example.dt.yaml: qcom-krait-cache: clocks:0:1: missing phandle tag in 4
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.example.dt.yaml: qcom-krait-cache: clocks:0: [4294967295, 4] is too long
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.example.dt.yaml: qcom-krait-cache: 'voltage-tolerance' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml


See https://patchwork.ozlabs.org/patch/1372099

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.
Rob Herring Sept. 28, 2020, 6:08 p.m. | #2
On Sun, Sep 27, 2020 at 06:05:13PM +0200, Ansuel Smith wrote:
> Document dedicated L2 Krait CPU Cache devfreq scaling driver.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> ---
>  .../bindings/devfreq/krait-cache-devfreq.yaml | 77 +++++++++++++++++++
>  1 file changed, 77 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
> 
> diff --git a/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml b/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
> new file mode 100644
> index 000000000000..099ed978e022
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
> @@ -0,0 +1,77 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/cpufreq/krait-cache-devfreq.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: DEVFREQ driver for Krait L2 Cpu Cache Frequency Scaling

Bindings are for h/w devices, not collections of properties for some 
driver. Define a binding for L2 cache and add on to it what you need.

> +
> +maintainers:
> +  - Ansuel Smith <ansuelsmth@gmail.com>
> +
> +description: |
> +  This Scale the Krait CPU L2 Cache Frequency and optionally voltage
> +  when the Cpu Frequency is changed (using the cpufreq notifier).
> +
> +  Cache is scaled with the max frequency across all core and the cache
> +  frequency will scale based on the configured threshold in the dts.
> +
> +  The cache thresholds can be set to 3+ frequency bin, idle, nominal and
> +  high.
> +
> +properties:
> +  compatible:
> +    const: qcom,krait-cache
> +
> +  clocks:
> +    $ref: "/schemas/types.yaml#/definitions/phandle"

'clocks' already has a type defined. You just need how many and what 
each entry is.

> +    description: Phandle to the L2 CPU clock
> +
> +  clock-names:
> +    const: "l2"
> +
> +  voltage-tolerance:
> +    description: Same voltage tolerance of the Krait CPU

Needs a vendor prefix and unit suffix.

> +
> +  l2-cpufreq:
> +    description: |
> +      Threshold used by the driver to scale the L2 cache.
> +      If the max CPU Frequency is more than the set frequency,
> +      the driver will transition to the next frequency bin.
> +      Value is in kHz
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 3
> +    items:
> +      - description: idle
> +      - description: nominal
> +      - description: high
> +
> +  l2-supply:
> +    $ref: "/schemas/types.yaml#/definitions/phandle"
> +    description: Phandle to the L2 regulator supply.
> +
> +  opp-table: true
> +
> +required:
> +  - compatible
> +  - clocks
> +  - clock-names
> +  - voltage-tolerance
> +  - l2-cpufreq
> +
> +examples:
> +  - |
> +    qcom-krait-cache {
> +      compatible = "qcom,krait-cache";
> +      clocks = <&kraitcc 4>;
> +      clock-names = "l2";
> +      l2-cpufreq = <384000 600000 1200000>;
> +      l2-supply = <&smb208_s1a>;
> +
> +      operating-points = <

Not documented and generally deprecated.

> +        /* kHz    uV */
> +        384000  1100000
> +        1000000  1100000
> +        1200000  1150000
> +      >;
> +    };
> -- 
> 2.27.0
>
Ansuel Smith Sept. 28, 2020, 7:05 p.m. | #3
> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Monday, September 28, 2020 8:09 PM
> To: Ansuel Smith <ansuelsmth@gmail.com>
> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>; Kyungmin Park
> <kyungmin.park@samsung.com>; Chanwoo Choi
> <cw00.choi@samsung.com>; linux-pm@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] dt-bindings: devfreq: Document L2 Krait CPU
> Cache devfreq driver
> 
> On Sun, Sep 27, 2020 at 06:05:13PM +0200, Ansuel Smith wrote:
> > Document dedicated L2 Krait CPU Cache devfreq scaling driver.
> >
> > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > ---
> >  .../bindings/devfreq/krait-cache-devfreq.yaml | 77
> +++++++++++++++++++
> >  1 file changed, 77 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/devfreq/krait-
> cache-devfreq.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/devfreq/krait-cache-
> devfreq.yaml b/Documentation/devicetree/bindings/devfreq/krait-cache-
> devfreq.yaml
> > new file mode 100644
> > index 000000000000..099ed978e022
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/devfreq/krait-cache-
> devfreq.yaml
> > @@ -0,0 +1,77 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/cpufreq/krait-cache-devfreq.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: DEVFREQ driver for Krait L2 Cpu Cache Frequency Scaling
> 
> Bindings are for h/w devices, not collections of properties for some
> driver. Define a binding for L2 cache and add on to it what you need.
> 

Should I still document it in the devfreq directory or somewhere else?

> > +
> > +maintainers:
> > +  - Ansuel Smith <ansuelsmth@gmail.com>
> > +
> > +description: |
> > +  This Scale the Krait CPU L2 Cache Frequency and optionally voltage
> > +  when the Cpu Frequency is changed (using the cpufreq notifier).
> > +
> > +  Cache is scaled with the max frequency across all core and the cache
> > +  frequency will scale based on the configured threshold in the dts.
> > +
> > +  The cache thresholds can be set to 3+ frequency bin, idle, nominal
and
> > +  high.
> > +
> > +properties:
> > +  compatible:
> > +    const: qcom,krait-cache
> > +
> > +  clocks:
> > +    $ref: "/schemas/types.yaml#/definitions/phandle"
> 
> 'clocks' already has a type defined. You just need how many and what
> each entry is.
> 
> > +    description: Phandle to the L2 CPU clock
> > +
> > +  clock-names:
> > +    const: "l2"
> > +
> > +  voltage-tolerance:
> > +    description: Same voltage tolerance of the Krait CPU
> 
> Needs a vendor prefix and unit suffix.
> 
> > +
> > +  l2-cpufreq:
> > +    description: |
> > +      Threshold used by the driver to scale the L2 cache.
> > +      If the max CPU Frequency is more than the set frequency,
> > +      the driver will transition to the next frequency bin.
> > +      Value is in kHz
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    minItems: 3
> > +    items:
> > +      - description: idle
> > +      - description: nominal
> > +      - description: high
> > +
> > +  l2-supply:
> > +    $ref: "/schemas/types.yaml#/definitions/phandle"
> > +    description: Phandle to the L2 regulator supply.
> > +
> > +  opp-table: true
> > +
> > +required:
> > +  - compatible
> > +  - clocks
> > +  - clock-names
> > +  - voltage-tolerance
> > +  - l2-cpufreq
> > +
> > +examples:
> > +  - |
> > +    qcom-krait-cache {
> > +      compatible = "qcom,krait-cache";
> > +      clocks = <&kraitcc 4>;
> > +      clock-names = "l2";
> > +      l2-cpufreq = <384000 600000 1200000>;
> > +      l2-supply = <&smb208_s1a>;
> > +
> > +      operating-points = <
> 
> Not documented and generally deprecated.
> 

Ok will change to v2.

> > +        /* kHz    uV */
> > +        384000  1100000
> > +        1000000  1100000
> > +        1200000  1150000
> > +      >;
> > +    };
> > --
> > 2.27.0
> >

Patch

diff --git a/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml b/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
new file mode 100644
index 000000000000..099ed978e022
--- /dev/null
+++ b/Documentation/devicetree/bindings/devfreq/krait-cache-devfreq.yaml
@@ -0,0 +1,77 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/cpufreq/krait-cache-devfreq.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: DEVFREQ driver for Krait L2 Cpu Cache Frequency Scaling
+
+maintainers:
+  - Ansuel Smith <ansuelsmth@gmail.com>
+
+description: |
+  This Scale the Krait CPU L2 Cache Frequency and optionally voltage
+  when the Cpu Frequency is changed (using the cpufreq notifier).
+
+  Cache is scaled with the max frequency across all core and the cache
+  frequency will scale based on the configured threshold in the dts.
+
+  The cache thresholds can be set to 3+ frequency bin, idle, nominal and
+  high.
+
+properties:
+  compatible:
+    const: qcom,krait-cache
+
+  clocks:
+    $ref: "/schemas/types.yaml#/definitions/phandle"
+    description: Phandle to the L2 CPU clock
+
+  clock-names:
+    const: "l2"
+
+  voltage-tolerance:
+    description: Same voltage tolerance of the Krait CPU
+
+  l2-cpufreq:
+    description: |
+      Threshold used by the driver to scale the L2 cache.
+      If the max CPU Frequency is more than the set frequency,
+      the driver will transition to the next frequency bin.
+      Value is in kHz
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 3
+    items:
+      - description: idle
+      - description: nominal
+      - description: high
+
+  l2-supply:
+    $ref: "/schemas/types.yaml#/definitions/phandle"
+    description: Phandle to the L2 regulator supply.
+
+  opp-table: true
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - voltage-tolerance
+  - l2-cpufreq
+
+examples:
+  - |
+    qcom-krait-cache {
+      compatible = "qcom,krait-cache";
+      clocks = <&kraitcc 4>;
+      clock-names = "l2";
+      l2-cpufreq = <384000 600000 1200000>;
+      l2-supply = <&smb208_s1a>;
+
+      operating-points = <
+        /* kHz    uV */
+        384000  1100000
+        1000000  1100000
+        1200000  1150000
+      >;
+    };