Add support for specifying different register/mask/value combinations
for different types of reset.
In particular, update the binding to allow platforms to specify the
following reset modes: soft, warm, cold, hard.
Linux can perform different types of reset using its reboot= kernel
command line argument, and some platforms also wish to reset
differently based on whether or not e.g. contents of RAM should be
retained across the reboot.
The new properties match the existing properties, just prefixed with
one of the reset modes mentioned above.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
.../bindings/power/reset/syscon-reboot.yaml | 74 ++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml
index 19d3093e6cd2f7e39d94c56636dc202a4427ffc3..a34b1c08b7e0f34574a0257e13c02fceac0243ae 100644
--- a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml
+++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml
@@ -18,6 +18,11 @@ description: |+
parental dt-node. So the SYSCON reboot node should be represented as a
sub-node of a "syscon", "simple-mfd" node. Though the regmap property
pointing to the system controller node is also supported.
+ This also supports specification of separate sets of register/mask/value
+ pairs for different types of reset: cold, hard, soft and warm, using
+ the respective properties with the respective reset type prefix. If prefixed
+ properties are not specified for a reset type, the non-prefixed properties
+ will be used for that reset type.
properties:
compatible:
@@ -49,12 +54,41 @@ properties:
priority:
default: 192
+patternProperties:
+ "^(cold|hard|soft|warm)-(mask|offset|value)$":
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Optional alternative offset / mask / value combinations for specific
+ reboot modes. The mask is optional.
+
+ "^(cold|hard|soft|warm)-reg$":
+ description:
+ Optional alternative base address and size for the reboot register for
+ specific reboot modes.
+
oneOf:
- required:
- offset
- required:
- reg
+dependencies:
+ cold-mask: [ cold-value ]
+ cold-offset: [ cold-value ]
+ cold-reg: [ cold-value ]
+
+ hard-mask: [ hard-value ]
+ hard-offset: [ hard-value ]
+ hard-reg: [ hard-value ]
+
+ soft-mask: [ soft-value ]
+ soft-offset: [ soft-value ]
+ soft-reg: [ soft-value ]
+
+ warm-mask: [ warm-value ]
+ warm-offset: [ warm-value ]
+ warm-reg: [ warm-value ]
+
required:
- compatible
@@ -70,6 +104,46 @@ allOf:
required:
- value
+ - if:
+ required:
+ - cold-value
+ then:
+ oneOf:
+ - required:
+ - cold-offset
+ - required:
+ - cold-reg
+
+ - if:
+ required:
+ - hard-value
+ then:
+ oneOf:
+ - required:
+ - hard-offset
+ - required:
+ - hard-reg
+
+ - if:
+ required:
+ - soft-value
+ then:
+ oneOf:
+ - required:
+ - soft-offset
+ - required:
+ - soft-reg
+
+ - if:
+ required:
+ - warm-value
+ then:
+ oneOf:
+ - required:
+ - warm-offset
+ - required:
+ - warm-reg
+
examples:
- |
reboot {
--
2.48.1.658.g4767266eb4-goog
On Wed, 26 Feb 2025 14:08:20 +0000, André Draszik wrote: > Add support for specifying different register/mask/value combinations > for different types of reset. > > In particular, update the binding to allow platforms to specify the > following reset modes: soft, warm, cold, hard. > > Linux can perform different types of reset using its reboot= kernel > command line argument, and some platforms also wish to reset > differently based on whether or not e.g. contents of RAM should be > retained across the reboot. > > The new properties match the existing properties, just prefixed with > one of the reset modes mentioned above. > > Signed-off-by: André Draszik <andre.draszik@linaro.org> > --- > .../bindings/power/reset/syscon-reboot.yaml | 74 ++++++++++++++++++++++ > 1 file changed, 74 insertions(+) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:113:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:115:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:123:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:125:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:133:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:135:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:143:11: [warning] wrong indentation: expected 12 but found 10 (indentation) ./Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml:145:11: [warning] wrong indentation: expected 12 but found 10 (indentation) dtschema/dtc warnings/errors: doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250226-syscon-reboot-reset-mode-v1-1-91c1b62166ae@linaro.org The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. 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 after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Wed, 2025-02-26 at 09:29 -0600, Rob Herring (Arm) wrote: > > On Wed, 26 Feb 2025 14:08:20 +0000, André Draszik wrote: > > Add support for specifying different register/mask/value combinations > > for different types of reset. > > > > In particular, update the binding to allow platforms to specify the > > following reset modes: soft, warm, cold, hard. > > > > Linux can perform different types of reset using its reboot= kernel > > command line argument, and some platforms also wish to reset > > differently based on whether or not e.g. contents of RAM should be > > retained across the reboot. > > > > The new properties match the existing properties, just prefixed with > > one of the reset modes mentioned above. > > > > Signed-off-by: André Draszik <andre.draszik@linaro.org> > > --- > > .../bindings/power/reset/syscon-reboot.yaml | 74 ++++++++++++++++++++++ > > 1 file changed, 74 insertions(+) > > > > My bot found errors running 'make dt_binding_check' on your patch: oops, sorry - the script we usually run didn't cover this binding, I've updated things and will send a v2. Cheers, Andre'
On Wed, 2025-02-26 at 15:42 +0000, André Draszik wrote:
> On Wed, 2025-02-26 at 09:29 -0600, Rob Herring (Arm) wrote:
> >
> > On Wed, 26 Feb 2025 14:08:20 +0000, André Draszik wrote:
> > > Add support for specifying different register/mask/value combinations
> > > for different types of reset.
> > >
> > > In particular, update the binding to allow platforms to specify the
> > > following reset modes: soft, warm, cold, hard.
> > >
> > > Linux can perform different types of reset using its reboot= kernel
> > > command line argument, and some platforms also wish to reset
> > > differently based on whether or not e.g. contents of RAM should be
> > > retained across the reboot.
> > >
> > > The new properties match the existing properties, just prefixed with
> > > one of the reset modes mentioned above.
> > >
> > > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > > ---
> > > .../bindings/power/reset/syscon-reboot.yaml | 74 ++++++++++++++++++++++
> > > 1 file changed, 74 insertions(+)
> > >
> >
> > My bot found errors running 'make dt_binding_check' on your patch:
>
> oops, sorry - the script we usually run didn't cover this binding,
BTW, we did that, because it's easy to miss warnings due to
the amount of bindings and text scrolling past. Ideally make
would exit with != 0 in case of binding errors.
I can see in commit 3e95dfb315de ("dt-bindings: Don't error
out on yamllint and dt-doc-validate errors"), warnings are
never treated as errors.
Is that still relevant, can that commit be revert? Don't we
want the build to fail loudly on binding errors, so that people
don't even submit erroneous bindings in the first place?
Cheers,
Andre'
© 2016 - 2025 Red Hat, Inc.