[PATCH v2 2/6] dt-bindings: firmware: add i.MX SCMI Extension protocol

Peng Fan (OSS) posted 6 patches 1 year, 10 months ago
There is a newer version of this series
[PATCH v2 2/6] dt-bindings: firmware: add i.MX SCMI Extension protocol
Posted by Peng Fan (OSS) 1 year, 10 months ago
From: Peng Fan <peng.fan@nxp.com>

Add i.MX SCMI Extension protocols bindings for:
 - Battery Backed Secure Module(BBSM)
 - MISC settings such as General Purpose Registers settings.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../devicetree/bindings/firmware/imx,scmi.yaml     | 80 ++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/Documentation/devicetree/bindings/firmware/imx,scmi.yaml b/Documentation/devicetree/bindings/firmware/imx,scmi.yaml
new file mode 100644
index 000000000000..7ee19a661d83
--- /dev/null
+++ b/Documentation/devicetree/bindings/firmware/imx,scmi.yaml
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2024 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/imx,scmi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX System Control and Management Interface(SCMI) Vendor Protocols Extension
+
+maintainers:
+  - Peng Fan <peng.fan@nxp.com>
+
+allOf:
+  - $ref: arm,scmi.yaml#
+
+properties:
+  protocol@81:
+    $ref: 'arm,scmi.yaml#/$defs/protocol-node'
+    unevaluatedProperties: false
+    description:
+      The BBM Protocol is for managing Battery Backed Secure Module (BBSM) RTC
+      and the ON/OFF Key
+
+    properties:
+      reg:
+        const: 0x81
+
+    required:
+      - reg
+
+  protocol@84:
+    $ref: 'arm,scmi.yaml#/$defs/protocol-node'
+    unevaluatedProperties: false
+    description:
+      The MISC Protocol is for managing SoC Misc settings, such as GPR settings
+
+    properties:
+      reg:
+        const: 0x84
+
+      wakeup-sources:
+        description:
+          Each entry consists of 2 integers, represents the source and electric signal edge
+        items:
+          items:
+            - description: the wakeup source
+            - description: the wakeup electric signal edge
+        $ref: /schemas/types.yaml#/definitions/uint32-matrix
+
+    required:
+      - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    firmware {
+        scmi {
+            compatible = "arm,scmi";
+            mboxes = <&mu2 5 0>, <&mu2 3 0>, <&mu2 3 1>;
+            shmem = <&scmi_buf0>, <&scmi_buf1>;
+
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            protocol@81 {
+                reg = <0x81>;
+            };
+
+            protocol@84 {
+                reg = <0x84>;
+                wakeup-sources = <0x8000 1
+                                  0x8001 1
+                                  0x8002 1
+                                  0x8003 1
+                                  0x8004 1>;
+            };
+         };
+    };
+...

-- 
2.37.1
Re: [PATCH v2 2/6] dt-bindings: firmware: add i.MX SCMI Extension protocol
Posted by Rob Herring 1 year, 10 months ago
On Fri, Apr 05, 2024 at 08:39:24PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add i.MX SCMI Extension protocols bindings for:
>  - Battery Backed Secure Module(BBSM)
>  - MISC settings such as General Purpose Registers settings.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/firmware/imx,scmi.yaml     | 80 ++++++++++++++++++++++
>  1 file changed, 80 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/firmware/imx,scmi.yaml b/Documentation/devicetree/bindings/firmware/imx,scmi.yaml
> new file mode 100644
> index 000000000000..7ee19a661d83
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/firmware/imx,scmi.yaml
> @@ -0,0 +1,80 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2024 NXP
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/firmware/imx,scmi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: i.MX System Control and Management Interface(SCMI) Vendor Protocols Extension
> +
> +maintainers:
> +  - Peng Fan <peng.fan@nxp.com>
> +
> +allOf:
> +  - $ref: arm,scmi.yaml#

This needs to be the other way around. Add a ref to this file in 
arm,scmi.yaml under an 'anyOf' entry.

> +
> +properties:
> +  protocol@81:
> +    $ref: 'arm,scmi.yaml#/$defs/protocol-node'
> +    unevaluatedProperties: false
> +    description:
> +      The BBM Protocol is for managing Battery Backed Secure Module (BBSM) RTC
> +      and the ON/OFF Key
> +
> +    properties:
> +      reg:
> +        const: 0x81
> +
> +    required:
> +      - reg
> +
> +  protocol@84:
> +    $ref: 'arm,scmi.yaml#/$defs/protocol-node'
> +    unevaluatedProperties: false
> +    description:
> +      The MISC Protocol is for managing SoC Misc settings, such as GPR settings
> +
> +    properties:
> +      reg:
> +        const: 0x84
> +
> +      wakeup-sources:
> +        description:
> +          Each entry consists of 2 integers, represents the source and electric signal edge
> +        items:
> +          items:
> +            - description: the wakeup source
> +            - description: the wakeup electric signal edge

No constraints on the entry values?

> +        $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +
> +    required:
> +      - reg
> +
> +additionalProperties: false

And then this can be true.

Rob
Re: [PATCH v2 2/6] dt-bindings: firmware: add i.MX SCMI Extension protocol
Posted by Krzysztof Kozlowski 1 year, 10 months ago
On 05/04/2024 14:39, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add i.MX SCMI Extension protocols bindings for:
>  - Battery Backed Secure Module(BBSM)

Which is what?

>  - MISC settings such as General Purpose Registers settings.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../devicetree/bindings/firmware/imx,scmi.yaml     | 80 ++++++++++++++++++++++
>  1 file changed, 80 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/firmware/imx,scmi.yaml b/Documentation/devicetree/bindings/firmware/imx,scmi.yaml
> new file mode 100644
> index 000000000000..7ee19a661d83
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/firmware/imx,scmi.yaml
> @@ -0,0 +1,80 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2024 NXP
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/firmware/imx,scmi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: i.MX System Control and Management Interface(SCMI) Vendor Protocols Extension
> +
> +maintainers:
> +  - Peng Fan <peng.fan@nxp.com>
> +
> +allOf:
> +  - $ref: arm,scmi.yaml#

Sorry, but arm,scmi is a final schema. Is your plan to define some
common part?

> +
> +properties:
> +  protocol@81:
> +    $ref: 'arm,scmi.yaml#/$defs/protocol-node'
> +    unevaluatedProperties: false
> +    description:
> +      The BBM Protocol is for managing Battery Backed Secure Module (BBSM) RTC
> +      and the ON/OFF Key
> +
> +    properties:
> +      reg:
> +        const: 0x81
> +
> +    required:
> +      - reg
> +
> +  protocol@84:
> +    $ref: 'arm,scmi.yaml#/$defs/protocol-node'
> +    unevaluatedProperties: false
> +    description:
> +      The MISC Protocol is for managing SoC Misc settings, such as GPR settings

Genera register is not a setting... this is a pleonasm. Please be more
specific what is the GPR, MISC protocol etc.

> +
> +    properties:
> +      reg:
> +        const: 0x84
> +
> +      wakeup-sources:
> +        description:
> +          Each entry consists of 2 integers, represents the source and electric signal edge

Can you answer questions from reviewers?

> +        items:
> +          items:
> +            - description: the wakeup source
> +            - description: the wakeup electric signal edge
> +        $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +
> +    required:
> +      - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    firmware {
> +        scmi {
> +            compatible = "arm,scmi";

> +            mboxes = <&mu2 5 0>, <&mu2 3 0>, <&mu2 3 1>;
> +            shmem = <&scmi_buf0>, <&scmi_buf1>;
> +
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            protocol@81 {
> +                reg = <0x81>;
> +            };
> +
> +            protocol@84 {
> +                reg = <0x84>;
> +                wakeup-sources = <0x8000 1
> +                                  0x8001 1
> +                                  0x8002 1
> +                                  0x8003 1
> +                                  0x8004 1>;

Nothing improved... If you are going to ignore reviews, then you will
only get NAKed.

Best regards,
Krzysztof