lkml.org 
[lkml]   [2020]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/4] dt-bindings: mtd: partition: Document use of nvmem-provider
Date
Document the use of this 2 new bindings, nvmem-provider and nvmem-cell,
used to describe the nvmem cell that the subpartition provide to the
nvmem api and the system. Nvmem cell are direct subnode of the
subpartition and are skipped by the 'fixed-partitions' parser if they
contain the 'nvmem-cell' tag. The subpartition must have the
'nvmem-provider' tag or the subpartition will not register the cell to
the nvmem api.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
.../devicetree/bindings/mtd/partition.txt | 59 +++++++++++++++++++
1 file changed, 59 insertions(+)

diff --git a/Documentation/devicetree/bindings/mtd/partition.txt b/Documentation/devicetree/bindings/mtd/partition.txt
index 4a39698221a2..66d3a3f0a021 100644
--- a/Documentation/devicetree/bindings/mtd/partition.txt
+++ b/Documentation/devicetree/bindings/mtd/partition.txt
@@ -64,6 +64,16 @@ Optional properties:
- slc-mode: This parameter, if present, allows one to emulate SLC mode on a
partition attached to an MLC NAND thus making this partition immune to
paired-pages corruptions
+- nvmem-provider : Optionally a subpartition can be set as a nvmem-provider. This can
+ be very useful if some data like the mac-address is stored in a special partition
+ at a specific offset. Subpartition that describe nvmem-cell must have set the
+ 'nvmem-cell' of they will be treated as a subpartition and not skipped and registred
+ as nvmem cells. In this specific case '#address-cells' and '#size-cells' must be
+ provided.
+- nvmem-cell : A direct subnode of a subpartition can be described as a nvmem-cell and
+ skipped by the fixed-partition parser and registred as a nvmem-cell of the registred
+ nvmem subpartition IF it does contain the 'nvmem-provider tag. If the subpartition
+ lacks of such tag the subnode will be skipped and the nvmem api won't register them.

Examples:

@@ -158,3 +168,52 @@ flash@3 {
};
};
};
+
+flash@0 {
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0000000 0x100000>;
+ read-only;
+ };
+
+ art: art@1200000 {
+ label = "art";
+ reg = <0x1200000 0x0140000>;
+ read-only;
+ nvmem-provider;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_gmac1: macaddr_gmac1@0 {
+ nvmem-cell;
+ reg = <0x0 0x6>;
+ };
+
+ macaddr_gmac2: macaddr_gmac2@6 {
+ nvmem-cell;
+ reg = <0x6 0x6>;
+ };
+
+ macaddr_wifi: macaddr_wifi@6 {
+ nvmem-cell;
+ reg = <0x6 0x6>;
+ };
+
+ pre_cal_24g: pre_cal_24g@1000 {
+ nvmem-cell;
+ reg = <0x1000 0x2f20>;
+ };
+
+ pre_cal_5g: pre_cal_5g@5000{
+ nvmem-cell;
+ reg = <0x5000 0x2f20>;
+ };
+ };
+ };
+};
\ No newline at end of file
--
2.27.0
\
 
 \ /
  Last update: 2020-09-20 11:58    [W:0.085 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site