[PATCH 01/13] dt-bindings: soc: amlogic: Add clk-measure related properties

Chuan Liu via B4 Relay posted 13 patches 1 month, 2 weeks ago
[PATCH 01/13] dt-bindings: soc: amlogic: Add clk-measure related properties
Posted by Chuan Liu via B4 Relay 1 month, 2 weeks ago
From: Chuan Liu <chuan.liu@amlogic.com>

Add three properties to clk-measure: 'clkmsr-indices', 'clkmsr-names',
and 'clkmsr-reg-v2' for describing measurable channels and register
offsets in DT.

Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
---
 .../soc/amlogic/amlogic,meson-gx-clk-measure.yaml  | 54 +++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml
index 39d4637c2d08..1c9d37eef5f0 100644
--- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml
+++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml
@@ -6,7 +6,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Amlogic Internal Clock Measurer
 
-description:
+description: |
   The Amlogic SoCs contains an IP to measure the internal clocks.
   The precision is multiple of MHz, useful to debug the clock states.
 
@@ -28,15 +28,67 @@ properties:
   reg:
     maxItems: 1
 
+  clkmsr-indices:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description: |
+      Supported channel IDs for clk-measure.
+    minItems: 1
+    maxItems: 256
+
+  clkmsr-names:
+    $ref: /schemas/types.yaml#/definitions/string-array
+    description: |
+      The channel ID names supported by clk-measure correspond one-to-one with
+      the IDs specified in 'clkmsr-indices'.
+
+      Therefore, the defined 'clkmsr-indices' and 'clkmsr-names' must have
+      matching counts and maintain strict correspondence.
+    minItems: 1
+    maxItems: 256
+
+  clkmsr-reg-v2:
+    type: boolean
+    description: |
+      Specify whether the register address offset for clk-measure corresponds
+      to version V2.
+
 required:
   - compatible
   - reg
+  - clkmsr-indices
+  - clkmsr-names
 
 unevaluatedProperties: false
 
 examples:
   - |
+    /*
+     * Example 1: clk-measure uses the original version of register address
+     * offsets.
+     */
     clock-measure@8758 {
         compatible = "amlogic,meson-gx-clk-measure";
         reg = <0x8758 0x10>;
+        clkmsr-indices = <0>,
+                         <1>,
+                         <2>;
+        clkmsr-names = "ring_osc_out_ee0",
+                       "ring_osc_out_ee1",
+                       "ring_osc_out_ee2";
+    };
+
+  - |
+    /*
+     * Example 2: clk-measure uses V2 version register address offsets.
+     */
+    clock-measure@48000 {
+        compatible = "amlogic,c3-clk-measure";
+        reg = <0x48000 0x1c>;
+        clkmsr-reg-v2;
+        clkmsr-indices = <0>,
+                         <1>,
+                         <2>;
+        clkmsr-names = "sys_clk",
+                       "axi_clk",
+                       "rtc_clk";
     };

-- 
2.42.0
Re: [PATCH 01/13] dt-bindings: soc: amlogic: Add clk-measure related properties
Posted by Krzysztof Kozlowski 1 month, 2 weeks ago
On Fri, Aug 15, 2025 at 04:37:27PM +0800, Chuan Liu wrote:
> Add three properties to clk-measure: 'clkmsr-indices', 'clkmsr-names',
> and 'clkmsr-reg-v2' for describing measurable channels and register
> offsets in DT.
> 
> Signed-off-by: Chuan Liu <chuan.liu@amlogic.com>
> ---
>  .../soc/amlogic/amlogic,meson-gx-clk-measure.yaml  | 54 +++++++++++++++++++++-
>  1 file changed, 53 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml
> index 39d4637c2d08..1c9d37eef5f0 100644
> --- a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml
> +++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-clk-measure.yaml
> @@ -6,7 +6,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
>  title: Amlogic Internal Clock Measurer
>  
> -description:
> +description: |

Why?

>    The Amlogic SoCs contains an IP to measure the internal clocks.
>    The precision is multiple of MHz, useful to debug the clock states.
>  
> @@ -28,15 +28,67 @@ properties:
>    reg:
>      maxItems: 1
>  
> +  clkmsr-indices:
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    description: |

Why | ?

> +      Supported channel IDs for clk-measure.
> +    minItems: 1
> +    maxItems: 256

Nothing - neither this nor commit msg - explains why you need it and
what this is.

> +
> +  clkmsr-names:
> +    $ref: /schemas/types.yaml#/definitions/string-array
> +    description: |
> +      The channel ID names supported by clk-measure correspond one-to-one with
> +      the IDs specified in 'clkmsr-indices'.
> +
> +      Therefore, the defined 'clkmsr-indices' and 'clkmsr-names' must have
> +      matching counts and maintain strict correspondence.
> +    minItems: 1
> +    maxItems: 256
> +
> +  clkmsr-reg-v2:
> +    type: boolean
> +    description: |
> +      Specify whether the register address offset for clk-measure corresponds
> +      to version V2.

No, compatible defines this.

> +
>  required:
>    - compatible
>    - reg
> +  - clkmsr-indices
> +  - clkmsr-names

That's ABI break. Again, nothing explains it.

Best regards,
Krzysztof