2024-01-19 13:25:50

by Oleksij Rempel

[permalink] [raw]
Subject: [RFC PATCH v1 3/7] dt-bindings: power: reset: add bindings for NVMEM hardware storing PSCR Data

Add device tree bindings that describe hardware implementations of
Non-Volatile Memory (NVMEM) used for storing Power State Change Reasons (PSCR).

Signed-off-by: Oleksij Rempel <[email protected]>
---
.../bindings/power/reset/pscr-nvmem.yaml | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml

diff --git a/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml b/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml
new file mode 100644
index 000000000000..0642b470af41
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/state-change/pscr-nvmem.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic NVMEM Power State Change Reason storage
+
+maintainers:
+ - Oleksij Rempel <[email protected]>
+
+description: This binding describes the Non-Volatile Memory (NVMEM) hardware
+ that stores Power State Change Reasons (PSCR).
+
+allOf:
+ - $ref: pse-controller.yaml#
+
+properties:
+ compatible:
+ const: pscr-nvmem
+
+ nvmem-cells:
+ description: |
+ A phandle pointing to the nvmem-cells node where the power state change
+ reasons are stored.
+ maxItems: 1
+
+ nvmem-cell-names:
+ items:
+ - const: pscr
+
+ pscr-unknown:
+ pscr-under-voltage:
+ pscr-over-current:
+ pscr-over-temperature:
+
+required:
+ - compatible
+ - nvmem-cells
+ - nvmem-cell-names
+
+additionalProperties: false
+
+examples:
+ - |
+ power-state-change-reason {
+ compatible = "pscr-nvmem";
+ nvmem-cells = <&pscr_cell>;
+ nvmem-cell-names = "pscr";
+ pscr-unknown = <1>;
+ pscr-under-voltage = <2>;
+ pscr-over-temperature = <3>;
+ };
+...
--
2.39.2



2024-01-19 14:51:23

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [RFC PATCH v1 3/7] dt-bindings: power: reset: add bindings for NVMEM hardware storing PSCR Data


On Fri, 19 Jan 2024 14:25:17 +0100, Oleksij Rempel wrote:
> Add device tree bindings that describe hardware implementations of
> Non-Volatile Memory (NVMEM) used for storing Power State Change Reasons (PSCR).
>
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
> .../bindings/power/reset/pscr-nvmem.yaml | 54 +++++++++++++++++++
> 1 file changed, 54 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/power/reset/pscr-nvmem.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:
/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml:32:16: [error] empty value in block mapping (empty-values)
/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml:33:22: [error] empty value in block mapping (empty-values)
/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml:34:21: [error] empty value in block mapping (empty-values)
/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml:35:25: [error] empty value in block mapping (empty-values)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-unknown: None is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-over-current: None is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-under-voltage: None is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-over-temperature: None is not of type 'object', 'boolean'
from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-unknown: None is not of type 'object', 'boolean'
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-over-current: None is not of type 'object', 'boolean'
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-under-voltage: None is not of type 'object', 'boolean'
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: properties:pscr-over-temperature: None is not of type 'object', 'boolean'
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename
$id: http://devicetree.org/schemas/power/state-change/pscr-nvmem.yaml
file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/power/reset/pscr-nvmem.yaml: ignoring, error in schema: properties: pscr-under-voltage
Documentation/devicetree/bindings/power/reset/pscr-nvmem.example.dtb: /example-0/power-state-change-reason: failed to match any schema with compatible: ['pscr-nvmem']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.