diff mbox series

[v3,2/4] dt-bindings: arm: Document reboot mode magic

Message ID 20240515-arm-psci-system_reset2-vendor-reboots-v3-2-16dd4f9c0ab4@quicinc.com
State Changes Requested
Headers show
Series Implement vendor resets for PSCI SYSTEM_RESET2 | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Elliot Berman May 15, 2024, 11:09 p.m. UTC
Add bindings to describe vendor-specific reboot modes. Values here
correspond to valid parameters to vendor-specific reset types in PSCI
SYSTEM_RESET2 call.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
---
 Documentation/devicetree/bindings/arm/psci.yaml | 43 +++++++++++++++++++++++--
 1 file changed, 41 insertions(+), 2 deletions(-)

Comments

Rob Herring (Arm) May 20, 2024, 7:44 p.m. UTC | #1
On Wed, May 15, 2024 at 04:09:45PM -0700, Elliot Berman wrote:
> Add bindings to describe vendor-specific reboot modes. Values here
> correspond to valid parameters to vendor-specific reset types in PSCI
> SYSTEM_RESET2 call.
> 
> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
> ---
>  Documentation/devicetree/bindings/arm/psci.yaml | 43 +++++++++++++++++++++++--
>  1 file changed, 41 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentation/devicetree/bindings/arm/psci.yaml
> index cbb012e217ab..47b5bbe540ce 100644
> --- a/Documentation/devicetree/bindings/arm/psci.yaml
> +++ b/Documentation/devicetree/bindings/arm/psci.yaml
> @@ -137,8 +137,34 @@ allOf:
>        required:
>          - cpu_off
>          - cpu_on
> -
> -additionalProperties: false
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: arm,psci-1.0
> +    then:
> +      properties:
> +        reset-types:

The normal structure is declare all properties and nodes at the top 
level (outside of if/then schemas) and then add restrictions with 
if/then schemas. 

> +          type: object
> +          $ref: /schemas/power/reset/reboot-mode.yaml#

             additionalProperties: false

and a blank line

> +          properties:
> +            # "mode-normal" is just SYSTEM_RESET
> +            mode-normal: false
> +          patternProperties:
> +            "^mode-.*$":
> +              items:
> +                maxItems: 2
> +              description: |
> +                Describes a vendor-specific reset type. The string after "mode-"
> +                maps a reboot mode to the parameters in the PSCI SYSTEM_RESET2 call.
> +
> +                Parameters are named mode-xxx = <type[, cookie]>, where xxx
> +                is the name of the magic reboot mode, type is the lower 31 bits
> +                of the reset_type, and, optionally, the cookie value. If the cookie
> +                is not provided, it is defaulted to zero.
> +                The 31st bit (vendor-resets) will be implicitly set by the driver.
> +
> +unevaluatedProperties: false
>  
>  examples:
>    - |+
> @@ -261,4 +287,17 @@ examples:
>          domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWRDN>;
>        };
>      };
> +
> +  - |+
> +
> +    // Case 5: SYSTEM_RESET2 vendor resets
> +    psci {
> +      compatible = "arm,psci-1.0";
> +      method = "smc";
> +
> +      reset-types {
> +        mode-edl = <0>;
> +        mode-bootloader = <1 2>;
> +      };
> +    };
>  ...
> 
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentation/devicetree/bindings/arm/psci.yaml
index cbb012e217ab..47b5bbe540ce 100644
--- a/Documentation/devicetree/bindings/arm/psci.yaml
+++ b/Documentation/devicetree/bindings/arm/psci.yaml
@@ -137,8 +137,34 @@  allOf:
       required:
         - cpu_off
         - cpu_on
-
-additionalProperties: false
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: arm,psci-1.0
+    then:
+      properties:
+        reset-types:
+          type: object
+          $ref: /schemas/power/reset/reboot-mode.yaml#
+          properties:
+            # "mode-normal" is just SYSTEM_RESET
+            mode-normal: false
+          patternProperties:
+            "^mode-.*$":
+              items:
+                maxItems: 2
+              description: |
+                Describes a vendor-specific reset type. The string after "mode-"
+                maps a reboot mode to the parameters in the PSCI SYSTEM_RESET2 call.
+
+                Parameters are named mode-xxx = <type[, cookie]>, where xxx
+                is the name of the magic reboot mode, type is the lower 31 bits
+                of the reset_type, and, optionally, the cookie value. If the cookie
+                is not provided, it is defaulted to zero.
+                The 31st bit (vendor-resets) will be implicitly set by the driver.
+
+unevaluatedProperties: false
 
 examples:
   - |+
@@ -261,4 +287,17 @@  examples:
         domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWRDN>;
       };
     };
+
+  - |+
+
+    // Case 5: SYSTEM_RESET2 vendor resets
+    psci {
+      compatible = "arm,psci-1.0";
+      method = "smc";
+
+      reset-types {
+        mode-edl = <0>;
+        mode-bootloader = <1 2>;
+      };
+    };
 ...