diff mbox series

[RFC,1/2] dt-bindings: Add the binding doc for xilinx APM

Message ID 20220921080623.22077-2-shubhrajyoti.datta@amd.com (mailing list archive)
State New, archived
Headers show
Series Add: Add Xilinx APM support | expand

Commit Message

Datta, Shubhrajyoti Sept. 21, 2022, 8:06 a.m. UTC
The LogiCORE™ IP AXI Performance Monitor core enables AXI system
performance measurement for multiple slots (AXI4/AXI3/AXI4-Stream/
AXI4-Lite) activity. Add the devicetree binding for xilinx APM.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
---
 .../bindings/perf/xlnx-axi-perf-monitor.yaml  | 137 ++++++++++++++++++
 1 file changed, 137 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml

Comments

Krzysztof Kozlowski Sept. 21, 2022, 9:02 a.m. UTC | #1
On 21/09/2022 10:06, Shubhrajyoti Datta wrote:
> The LogiCORE™ IP AXI Performance Monitor core enables AXI system
> performance measurement for multiple slots (AXI4/AXI3/AXI4-Stream/
> AXI4-Lite) activity. Add the devicetree binding for xilinx APM.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
> ---
>  .../bindings/perf/xlnx-axi-perf-monitor.yaml  | 137 ++++++++++++++++++
>  1 file changed, 137 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
> 
> diff --git a/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml b/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
> new file mode 100644
> index 000000000000..0b8ba96aa867
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml

Filename based on compatible (the same as compatible).

> @@ -0,0 +1,137 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/perf/xilinx-apm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Xilinx Axi Performance Monitor device tree bindings

Drop "device tree bindings".

> +
> +maintainers:
> +  - Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> +
> +properties:
> +  compatible:
> +    items:

You have one item, so no "items".

> +      - enum:
> +          - xlnx,axi-perf-monitor
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  xlnx,enable-profile:
> +    allOf:

No need for allOf.

> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [0, 1]

This is boolean.

> +    description:
> +      Enables the profile mode.

Explain what is "profile mode".

> +    maxItems: 1
> +
> +  xlnx,enable-trace:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [0, 1]

Ditto

> +    description:
> +      Enables trace mode.

Ditto

> +    maxItems: 1
> +
> +  xlnx,num-monitor-slots:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - minimum: 1
> +      - maximum: 8

No allOf.


All of such comments apply everywhere.

> +    description:
> +      Number of monitor slots.
> +
> +  xlnx,enable-event-count:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [0, 1]

boolean

> +    description:
> +      Enable event count.
> +
> +  xlnx,enable-event-log:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [0, 1]

boolean


> +    description:
> +      Enable event log.
> +
> +  xlnx,have-sampled-metric-cnt:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Sampled metric counters enabled in APM.

Description says: boolean

> +
> +  xlnx,metric-count-width:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [32, 64]
> +    description:
> +      Metric Counter width.
> +
> +  xlnx,metric-count-scale:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [1, 2, 4, 8]
> +    description:
> +      Metric Counter scale factor.
> +
> +  xlnx,num-of-counters:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Number of counters in APM.
> +
> +  xlnx,metrics-sample-count-width:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [32, 64]
> +    description:
> +      Sampled metric counter width.
> +
> +  xlnx,global-count-width:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [32, 64]
> +    description:
> +      Global Clock counter width.
> +
> +  xlnx,id-filter-32bit:
> +    description: APM is in 32-bit mode.
> +    type: boolean
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    apm@44a00000 {

Generic node names: pmu

> +        compatible = "xlnx,axi-perf-monitor";
> +        interrupt-parent = <&axi_intc_1>;
> +        interrupts = <1 2>;


Are these usual interrupt flags?

> +        reg = <0x44a00000 0x1000>;
> +        clocks = <&clkc 15>;
> +        xlnx,enable-profile = <0>;
> +        xlnx,enable-trace = <0>;
> +        xlnx,num-monitor-slots = <4>;
> +        xlnx,enable-event-count = <1>;
> +        xlnx,enable-event-log = <1>;
> +        xlnx,have-sampled-metric-cnt = <1>;
> +        xlnx,num-of-counters = <8>;
> +        xlnx,metric-count-width = <32>;
> +        xlnx,metrics-sample-count-width = <32>;
> +        xlnx,global-count-width = <32>;
> +        xlnx,metric-count-scale = <1>;
> +        xlnx,id-filter-32bit;
> +    };

Best regards,
Krzysztof
Krzysztof Kozlowski Sept. 21, 2022, 1:27 p.m. UTC | #2
On Wed, 21 Sep 2022 13:36:22 +0530, Shubhrajyoti Datta wrote:
> The LogiCORE™ IP AXI Performance Monitor core enables AXI system
> performance measurement for multiple slots (AXI4/AXI3/AXI4-Stream/
> AXI4-Lite) activity. Add the devicetree binding for xilinx APM.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
> ---
>  .../bindings/perf/xlnx-axi-perf-monitor.yaml  | 137 ++++++++++++++++++
>  1 file changed, 137 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
./Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml: $id: relative path/filename doesn't match actual path or filename
	expected: http://devicetree.org/schemas/perf/xlnx-axi-perf-monitor.yaml#

doc reference errors (make refcheckdocs):

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

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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

pip3 install dtschema --upgrade

Please check and re-submit.
Datta, Shubhrajyoti Sept. 21, 2022, 1:30 p.m. UTC | #3
[AMD Official Use Only - General]



> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Wednesday, September 21, 2022 2:33 PM
> To: Datta, Shubhrajyoti <shubhrajyoti.datta@amd.com>; linux-arm-
> kernel@lists.infradead.org
> Cc: git (AMD-Xilinx) <git@amd.com>; devicetree@vger.kernel.org;
> michal.simek@xilinx.com; mark.rutland@arm.com; will@kernel.org;
> robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org
> Subject: Re: [RFC PATCH 1/2] dt-bindings: Add the binding doc for xilinx APM
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> On 21/09/2022 10:06, Shubhrajyoti Datta wrote:
> > The LogiCORE(tm) IP AXI Performance Monitor core enables AXI system
> > performance measurement for multiple slots (AXI4/AXI3/AXI4-Stream/
> > AXI4-Lite) activity. Add the devicetree binding for xilinx APM.
> >
> > Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
> > ---
> >  .../bindings/perf/xlnx-axi-perf-monitor.yaml  | 137
> > ++++++++++++++++++
> >  1 file changed, 137 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
> >
> > diff --git
> > a/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
> > b/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
> > new file mode 100644
> > index 000000000000..0b8ba96aa867
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/perf/xlnx-axi-perf-
> monitor.yam
> > +++ l
> 
> Filename based on compatible (the same as compatible).
> 
> > @@ -0,0 +1,137 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause %YAML 1.2
> > +---
> > +$id:
> >
> +https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > +cetree.org%2Fschemas%2Fperf%2Fxilinx-
> apm.yaml%23&amp;data=05%7C01%7Cs
> >
> +hubhrajyoti.datta%40amd.com%7Cd56ba4a2db68463526ae08da9bb0115b%
> 7C3dd8
> >
> +961fe4884e608e11a82d994e183d%7C0%7C0%7C637993477764913369%7CUn
> known%7
> >
> +CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
> wiLCJX
> >
> +VCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=wSUA%2B3vm%2FlClUxr2
> wqrZwHIvXUWQ
> > +wPlqE8qzEJolS38%3D&amp;reserved=0
> > +$schema:
> >
> +https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > +cetree.org%2Fmeta-
> schemas%2Fcore.yaml%23&amp;data=05%7C01%7Cshubhrajy
> >
> +oti.datta%40amd.com%7Cd56ba4a2db68463526ae08da9bb0115b%7C3dd89
> 61fe488
> >
> +4e608e11a82d994e183d%7C0%7C0%7C637993477764913369%7CUnknown%
> 7CTWFpbGZ
> >
> +sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6
> Mn0%
> >
> +3D%7C3000%7C%7C%7C&amp;sdata=C%2B2tuHCF6%2FtKg0uL3WtA9Fgp0y
> tr2z5Xglr4
> > +YZAvmjo%3D&amp;reserved=0
> > +
> > +title: Xilinx Axi Performance Monitor device tree bindings
> 
> Drop "device tree bindings".
Will fix in next version.

> 
> > +
> > +maintainers:
> > +  - Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> > +
> > +properties:
> > +  compatible:
> > +    items:
> 
> You have one item, so no "items".

Will update 
> 
> > +      - enum:
> > +          - xlnx,axi-perf-monitor
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  xlnx,enable-profile:
> > +    allOf:
> 
> No need for allOf.

Will update.

> 
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [0, 1]
> 
> This is boolean.
> 
> > +    description:
> > +      Enables the profile mode.
> 
> Explain what is "profile mode".
> 
> > +    maxItems: 1
> > +
> > +  xlnx,enable-trace:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [0, 1]
> 
> Ditto
> 
> > +    description:
> > +      Enables trace mode.
> 
> Ditto
> 
> > +    maxItems: 1
> > +
> > +  xlnx,num-monitor-slots:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - minimum: 1
> > +      - maximum: 8
> 
> No allOf.
> 
Will update.

> 
> All of such comments apply everywhere.
> 
> > +    description:
> > +      Number of monitor slots.
> > +
> > +  xlnx,enable-event-count:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [0, 1]
> 
> Boolean
Will update
> 
> > +    description:
> > +      Enable event count.
> > +
> > +  xlnx,enable-event-log:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [0, 1]
> 
> Boolean

Will change.
> 
> 
> > +    description:
> > +      Enable event log.
> > +
> > +  xlnx,have-sampled-metric-cnt:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      Sampled metric counters enabled in APM.
> 
> Description says: boolean
> 
> > +
> > +  xlnx,metric-count-width:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [32, 64]
> > +    description:
> > +      Metric Counter width.
> > +
> > +  xlnx,metric-count-scale:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [1, 2, 4, 8]
> > +    description:
> > +      Metric Counter scale factor.
> > +
> > +  xlnx,num-of-counters:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      Number of counters in APM.
> > +
> > +  xlnx,metrics-sample-count-width:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [32, 64]
> > +    description:
> > +      Sampled metric counter width.
> > +
> > +  xlnx,global-count-width:
> > +    allOf:
> > +      - $ref: /schemas/types.yaml#/definitions/uint32
> > +      - enum: [32, 64]
> > +    description:
> > +      Global Clock counter width.
> > +
> > +  xlnx,id-filter-32bit:
> > +    description: APM is in 32-bit mode.
> > +    type: boolean
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - interrupts
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    apm@44a00000 {
> 
> Generic node names: pmu

Will update
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml b/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
new file mode 100644
index 000000000000..0b8ba96aa867
--- /dev/null
+++ b/Documentation/devicetree/bindings/perf/xlnx-axi-perf-monitor.yaml
@@ -0,0 +1,137 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/perf/xilinx-apm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Axi Performance Monitor device tree bindings
+
+maintainers:
+  - Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - xlnx,axi-perf-monitor
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  xlnx,enable-profile:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [0, 1]
+    description:
+      Enables the profile mode.
+    maxItems: 1
+
+  xlnx,enable-trace:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [0, 1]
+    description:
+      Enables trace mode.
+    maxItems: 1
+
+  xlnx,num-monitor-slots:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - minimum: 1
+      - maximum: 8
+    description:
+      Number of monitor slots.
+
+  xlnx,enable-event-count:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [0, 1]
+    description:
+      Enable event count.
+
+  xlnx,enable-event-log:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [0, 1]
+    description:
+      Enable event log.
+
+  xlnx,have-sampled-metric-cnt:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Sampled metric counters enabled in APM.
+
+  xlnx,metric-count-width:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [32, 64]
+    description:
+      Metric Counter width.
+
+  xlnx,metric-count-scale:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [1, 2, 4, 8]
+    description:
+      Metric Counter scale factor.
+
+  xlnx,num-of-counters:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Number of counters in APM.
+
+  xlnx,metrics-sample-count-width:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [32, 64]
+    description:
+      Sampled metric counter width.
+
+  xlnx,global-count-width:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [32, 64]
+    description:
+      Global Clock counter width.
+
+  xlnx,id-filter-32bit:
+    description: APM is in 32-bit mode.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    apm@44a00000 {
+        compatible = "xlnx,axi-perf-monitor";
+        interrupt-parent = <&axi_intc_1>;
+        interrupts = <1 2>;
+        reg = <0x44a00000 0x1000>;
+        clocks = <&clkc 15>;
+        xlnx,enable-profile = <0>;
+        xlnx,enable-trace = <0>;
+        xlnx,num-monitor-slots = <4>;
+        xlnx,enable-event-count = <1>;
+        xlnx,enable-event-log = <1>;
+        xlnx,have-sampled-metric-cnt = <1>;
+        xlnx,num-of-counters = <8>;
+        xlnx,metric-count-width = <32>;
+        xlnx,metrics-sample-count-width = <32>;
+        xlnx,global-count-width = <32>;
+        xlnx,metric-count-scale = <1>;
+        xlnx,id-filter-32bit;
+    };