Skip to contentSkip to conversation

schemas: add NVMEM cell with #nvmem-cell-cells

PATCH New Rafał Miłecki 1 participant 1 message Nov 21, 2022 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 schemas: add NVMEM cell with #nvmem-cell-cells

From: Rafał Miłecki <[email protected]>

Some NVMEM cells may provide more than 1 value. An example can be base MAC address that is used for calculating multiple MACs (for few different devices). For specifying value to read phandle needs to be used with an argument.

Cc Srinivas Kandagatla" <[email protected]>
Cc Michael Walle <[email protected]>

---
V2: Drop redundant quotes (thanks Krzysztof)

Please note there is ongoing work by Michael who chose to modify meta-schema in his work: https://github.com/devicetree-org/dt-schema/pull/89

This bit is required for moving forward with the [PATCH v2 00/20] nvmem: core: introduce NVMEM layouts
https://lore.kernel.org/linux-arm-kernel/[email protected]/

As pointed out by Rob #nvmem-cell-cells should be added to the dt-schema and not a Linux binding:
Re: [PATCH v2 15/20] dt-bindings: nvmem: add YAML schema for the sl28 vpd layout
https://lore.kernel.org/linux-arm-kernel/[email protected]/

sl28 is one example that needs #nvmem-cell-cells
u-boot,env is another one

---
 dtschema/schemas/nvmem/nvmem-cell.yaml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 dtschema/schemas/nvmem/nvmem-cell.yaml
dtschema/schemas/nvmem/nvmem-cell.yaml new file +23 -0
new file mode 100644
index 0000000..1a1741d
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: BSD-2-Clause
+$id: http://devicetree.org/schemas/nvmem/nvmem-cell.yaml#
+$schema: http://devicetree.org/meta-schemas/base.yaml#
+
+title: NVMEM Cell Common Properties
+description: Schema for NVMEM cell devicetree bindings
+maintainers:
+  - Rafał Miłecki <[email protected]>
+  - Srinivas Kandagatla <[email protected]>
+
+# always select the core schema
+select: true
+
+properties:
+  "#nvmem-cell-cells":
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: >
+      Some NVMEM cells may consist of raw data that requires some extra
+      processing. They may provide more than 1 value.
+
+      Passing extra argument(s) allows selecting data to access.
+
+additionalProperties: true
Signature · 1 line
2.34.1