Skip to content

Commit 118f3fb

Browse files
Ansuelmiquelraynal
authored andcommitted
dt-bindings: mtd: partitions: support label/name only partition
Document new partition nodes that declare only the label/name instead of the reg used to provide an OF node for partition registred at runtime by parsers. This is required for nvmem system to declare and detect nvmem-cells. With these special partitions, the reg / offset is not required and a 'partition-' prefix is needed. The node name with the 'partition-' prefix stripped, is used to match the partition allocated by the parser at runtime and the parser will provide reg and offset of the mtd. If the partition to match contains invalid char for a node name, the label binding can be used to declare the partition name. NVMEM will use the data from the parser and provide the NVMEM cells declared in the DTS, "connecting" the dynamic partition with a static declaration of cells in them. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220622010628.30414-2-ansuelsmth@gmail.com
1 parent ac4f834 commit 118f3fb

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Documentation/devicetree/bindings/mtd/partitions/partition.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ description: |
1111
relative offset and size specified. Depending on partition function extra
1212
properties can be used.
1313
14+
A partition may be dynamically allocated by a specific parser at runtime.
15+
In this specific case, a specific suffix is required to the node name.
16+
Everything after 'partition-' will be used as the partition name to compare
17+
with the one dynamically allocated by the specific parser.
18+
If the partition contains invalid char a label can be provided that will
19+
be used instead of the node name to make the comparison.
20+
This is used to assign an OF node to the dynamiccally allocated partition
21+
so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
22+
The OF node will be assigned only if the partition label declared match the
23+
one assigned by the parser at runtime.
24+
1425
maintainers:
1526
- Rafał Miłecki <rafal@milecki.pl>
1627

@@ -41,7 +52,12 @@ properties:
4152
immune to paired-pages corruptions
4253
type: boolean
4354

44-
required:
45-
- reg
55+
if:
56+
not:
57+
required: [ reg ]
58+
then:
59+
properties:
60+
$nodename:
61+
pattern: '^partition-.*$'
4662

4763
additionalProperties: true

0 commit comments

Comments
 (0)