[PATCH 1/2] dt-bindings: nvmem: add byte-mask property for non-contiguous byte selection
From: Hongmei Xu
Date: Fri Nov 13 2026 - 03:12:22 EST
Add the byte-mask property to the fixed-cell binding. This allows
selecting non-contiguous physical bytes from an NVMEM region to form
a logical cell value.
Bit N set in byte-mask means physical byte N relative to the cell's
base offset is included in the output; selected bytes are packed into
the output buffer in ascending byte order. If fewer bytes are selected
than the cell's logical size given by reg, the remaining output bytes
are zero-filled. The number of set bits must not exceed the cell's
logical size given by reg. byte-mask and bits are mutually exclusive.
Signed-off-by: Hongmei Xu <hongmei.xu@xxxxxxxxxxxxxxxx>
---
.../bindings/nvmem/layouts/fixed-cell.yaml | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml b/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml
index 38e3ad50ff4f..cddda3f70691 100644
--- a/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml
+++ b/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml
@@ -34,6 +34,21 @@ properties:
description:
Size in bit within the address range specified by reg.
+ byte-mask:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 1
+ description: >
+ Bitmask selecting which physical bytes within the NVMEM device region
+ contribute to this cell's output. Bit N set means physical byte N
+ relative to the cell's base offset is included; selected bytes are
+ packed into the output buffer in ascending byte order. If fewer bytes
+ are selected than the cell's logical size given by reg, the remaining
+ output bytes are zero-filled. Byte positions are relative to the cell's
+ base offset and limited to a 32-byte window. The highest set bit must
+ not reference a byte beyond the device size. The number of set bits must
+ not exceed the cell's logical size given by reg. Cannot be used
+ together with bits.
+
allOf:
- if:
properties:
@@ -48,6 +63,13 @@ allOf:
const: 1
required:
- "#nvmem-cell-cells"
+ - if:
+ required: [ byte-mask ]
+ then:
+ properties:
+ bits: false
+ description:
+ byte-mask and bits are mutually exclusive.
required:
- reg
--
2.34.1