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)
8
9maintainers:
10  - Miquel Raynal <miquel.raynal@bootlin.com>
11  - Richard Weinberger <richard@nod.at>
12
13properties:
14  $nodename:
15    pattern: "^(flash|.*sram|nand)(@.*)?$"
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
24  '#address-cells':
25    deprecated: true
26
27  '#size-cells':
28    deprecated: true
29
30  partitions:
31    $ref: /schemas/mtd/partitions/partitions.yaml
32
33    required:
34      - compatible
35
36patternProperties:
37  "@[0-9a-f]+$":
38    $ref: partitions/partition.yaml
39    deprecated: true
40
41  "^partition@[0-9a-f]+":
42    $ref: partitions/partition.yaml
43    deprecated: true
44
45  "^otp(-[0-9]+)?$":
46    type: object
47
48    allOf:
49      - $ref: ../nvmem/nvmem.yaml#
50      - $ref: ../nvmem/nvmem-deprecated-cells.yaml#
51
52    unevaluatedProperties: false
53
54    description: |
55      An OTP memory region. Some flashes provide a one-time-programmable
56      memory whose content can either be programmed by a user or is already
57      pre-programmed by the factory. Some flashes might provide both.
58
59    properties:
60      compatible:
61        enum:
62          - user-otp
63          - factory-otp
64
65    required:
66      - compatible
67
68# This is a generic file other binding inherit from
69additionalProperties: true
70
71examples:
72  - |
73    spi {
74        #address-cells = <1>;
75        #size-cells = <0>;
76
77        flash@0 {
78            reg = <0>;
79            compatible = "jedec,spi-nor";
80            label = "System-firmware";
81        };
82    };
83
84  - |
85    spi {
86        #address-cells = <1>;
87        #size-cells = <0>;
88
89        flash@0 {
90            reg = <0>;
91            compatible = "jedec,spi-nor";
92
93            otp-1 {
94                compatible = "factory-otp";
95                #address-cells = <1>;
96                #size-cells = <1>;
97
98                electronic-serial-number@0 {
99                    reg = <0 8>;
100                };
101            };
102
103            otp-2 {
104                compatible = "user-otp";
105                #address-cells = <1>;
106                #size-cells = <1>;
107
108                mac-address@0 {
109                    reg = <0 6>;
110                };
111            };
112        };
113    };
114
115...
116