xref: /linux/Documentation/devicetree/bindings/mtd/mtd.yaml (revision 2d2802fb24de8cbacb4a2d6da2e002acc1c17143)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mtd/mtd.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: MTD (Memory Technology Device) Device Tree Bindings
8
9maintainers:
10  - Miquel Raynal <miquel.raynal@bootlin.com>
11  - Richard Weinberger <richard@nod.at>
12
13properties:
14  $nodename:
15    pattern: "^flash(@.*)?$"
16
17  label:
18    description:
19      User-defined MTD device name. Can be used to assign user friendly
20      names to MTD devices (instead of the flash model or flash controller
21      based name) in order to ease flash device identification and/or
22      describe what they are used for.
23
24patternProperties:
25  "^otp(-[0-9]+)?$":
26    type: object
27    $ref: ../nvmem/nvmem.yaml#
28
29    description: |
30      An OTP memory region. Some flashes provide a one-time-programmable
31      memory whose content can either be programmed by a user or is already
32      pre-programmed by the factory. Some flashes might provide both.
33
34    properties:
35      compatible:
36        enum:
37          - user-otp
38          - factory-otp
39
40    required:
41      - compatible
42
43additionalProperties: true
44
45examples:
46  - |
47    spi {
48        #address-cells = <1>;
49        #size-cells = <0>;
50
51        flash@0 {
52            reg = <0>;
53            compatible = "jedec,spi-nor";
54            label = "System-firmware";
55        };
56    };
57
58  - |
59    spi {
60        #address-cells = <1>;
61        #size-cells = <0>;
62
63        flash@0 {
64            reg = <0>;
65            compatible = "jedec,spi-nor";
66
67            otp-1 {
68                compatible = "factory-otp";
69                #address-cells = <1>;
70                #size-cells = <1>;
71
72                electronic-serial-number@0 {
73                    reg = <0 8>;
74                };
75            };
76
77            otp-2 {
78                compatible = "user-otp";
79                #address-cells = <1>;
80                #size-cells = <1>;
81
82                mac-address@0 {
83                    reg = <0 6>;
84                };
85            };
86        };
87    };
88
89...
90