summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2021-04-24 13:06:06 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-05-10 12:42:51 +0200
commit74ae3663b110d8d3e5d41dd4b05f4fa6bd79d49d (patch)
treeafbbfce69e75d7093e8cb36dda67afcea95f27fd
parente6aed6717cd429a48995d2c6533fdde9f88d8cf1 (diff)
downloadlinux-74ae3663b110d8d3e5d41dd4b05f4fa6bd79d49d.tar.bz2
dt-bindings: mtd: add OTP bindings
Flash devices can have one-time-programmable regions. Add a nvmem binding so they can be used as a nvmem provider. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210424110608.15748-4-michael@walle.cc
-rw-r--r--Documentation/devicetree/bindings/mtd/mtd.yaml50
1 files changed, 50 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mtd/mtd.yaml b/Documentation/devicetree/bindings/mtd/mtd.yaml
index 086b0ecd1604..376b679cfc70 100644
--- a/Documentation/devicetree/bindings/mtd/mtd.yaml
+++ b/Documentation/devicetree/bindings/mtd/mtd.yaml
@@ -21,6 +21,25 @@ properties:
based name) in order to ease flash device identification and/or
describe what they are used for.
+patternProperties:
+ "^otp(-[0-9]+)?$":
+ type: object
+ $ref: ../nvmem/nvmem.yaml#
+
+ description: |
+ An OTP memory region. Some flashes provide a one-time-programmable
+ memory whose content can either be programmed by a user or is already
+ pre-programmed by the factory. Some flashes might provide both.
+
+ properties:
+ compatible:
+ enum:
+ - user-otp
+ - factory-otp
+
+ required:
+ - compatible
+
additionalProperties: true
examples:
@@ -36,4 +55,35 @@ examples:
};
};
+ - |
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ flash@0 {
+ reg = <0>;
+ compatible = "jedec,spi-nor";
+
+ otp-1 {
+ compatible = "factory-otp";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ electronic-serial-number@0 {
+ reg = <0 8>;
+ };
+ };
+
+ otp-2 {
+ compatible = "user-otp";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ mac-address@0 {
+ reg = <0 6>;
+ };
+ };
+ };
+ };
+
...