dt-bindings: nvmem: layouts: add fixed-layout
Subsystems (2)
PATCH v2 1/1 dt-bindings: nvmem: layouts: add fixed-layout
From: Rafał Miłecki <[email protected]>
With the introduction of NVMEM layouts we should prefer and support describing all NVMEM devices content in the "nvmem-layout" node. That inludes using it for fixed NVMEM cells (those with hardcoded offset & size).
This seems to be cleaner design and more explicit.
Introduce a binding allowing fixed NVMEM cells as a type of layout. To avoid code duplication put shared part in the fixed-cell.yaml.
---
V2: Use fixed-cell.yaml
--- .../bindings/nvmem/layouts/fixed-cell.yaml | 30 ++++++++++++ .../bindings/nvmem/layouts/fixed-layout.yaml | 49 +++++++++++++++++++ .../bindings/nvmem/layouts/nvmem-layout.yaml | 1 + .../devicetree/bindings/nvmem/nvmem.yaml | 18 +------ 4 files changed, 81 insertions(+), 17 deletions(-) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/fixed-layout.yaml
Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml new file +30 -0
@@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/layouts/fixed-cell.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Fixed offset & size NVMEM cell + +maintainers: + - Rafał Miłecki <[email protected]> + +properties: + reg: + maxItems: 1 + + bits: + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + - minimum: 0 + maximum: 7 + description: + Offset in bit within the address range specified by reg. + - minimum: 1 + description: + Size in bit within the address range specified by reg. + +required: + - reg + +additionalProperties: false
Documentation/devicetree/bindings/nvmem/layouts/fixed-layout.yaml new file +49 -0
49 lines not on this page · raw message
Documentation/devicetree/bindings/nvmem/layouts/nvmem-layout.yaml +1 -0
@@ -18,6 +18,7 @@ description: | perform their parsing. The nvmem-layout container is here to describe these. oneOf: + - $ref: fixed-layout.yaml - $ref: kontron,sl28-vpd.yaml - $ref: onie,tlv-layout.yaml
Documentation/devicetree/bindings/nvmem/nvmem.yaml +1 -17
@@ -49,23 +49,7 @@ properties: patternProperties: "@[0-9a-f]+(,[0-7])?$": type: object - - properties: - reg: - maxItems: 1 - description: - Offset and size in bytes within the storage device. - - bits: - $ref: /schemas/types.yaml#/definitions/uint32-array - items: - - minimum: 0 - maximum: 7 - description: - Offset in bit within the address range specified by reg. - - minimum: 1 - description: - Size in bit within the address range specified by reg. + $ref: layouts/fixed-cell.yaml additionalProperties: true
Signature · 1 line
2.34.1
Am 2023-03-09 12:39, schrieb Rafał Miłecki:
Quoted 7 lines
From: Rafał Miłecki <[email protected]>
With the introduction of NVMEM layouts we should prefer and support describing all NVMEM devices content in the "nvmem-layout" node. That inludes using it for fixed NVMEM cells (those with hardcoded offset & size).
Quoted 6 lines
This seems to be cleaner design and more explicit.
Introduce a binding allowing fixed NVMEM cells as a type of layout. To avoid code duplication put shared part in the
fixed-cell.yaml.Signed-off-by Rafał Miłecki <[email protected]>
I don't feel comfortable to add an acked-by or reviewed-by here because I don't do much with dt-bindings myself, but this looks good to me.
From a device tree binding POV, could there be a
nvmem-layout@0 {
reg = <0>;
compatible = "layout1";
};
nvmem-layout@1000 {
reg = <1000>;
compatible = "layout2";
};
for partitioned eeproms for example?
-michael
Quoted 10 lines · Michael Walle
Am 2023-03-09 12:39, schrieb Rafał Miłecki:
Quoted 9 lines
From: Rafał Miłecki <[email protected]>
With the introduction of NVMEM layouts we should prefer and support describing all NVMEM devices content in the "nvmem-layout" node. That inludes using it for fixed NVMEM cells (those with hardcoded offset & size).
This seems to be cleaner design and more explicit.
Quoted 8 lines
Quoted 4 lines
Introduce a binding allowing fixed NVMEM cells as a type of layout. To avoid code duplication put shared part in the
fixed-cell.yaml.Signed-off-by Rafał Miłecki <[email protected]>I don't feel comfortable to add an acked-by or reviewed-by here because I don't do much with dt-bindings myself, but this looks good to me.
Thank you!
Quoted 7 lines
From a device tree binding POV, could there be a
nvmem-layout@0 {
reg = <0>;
compatible = "layout1";
};
Quoted 6 lines
nvmem-layout@1000 {
reg = <1000>;
compatible = "layout2";
};for partitioned eeproms for example?
Maybe. Could you send a patch adding such binding with a proper explanation what devices need it, please? It's out of scope of this patch.