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)(@.*)?$"
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    $ref: ../nvmem/nvmem.yaml#
47
48    description: |
49      An OTP memory region. Some flashes provide a one-time-programmable
50      memory whose content can either be programmed by a user or is already
51      pre-programmed by the factory. Some flashes might provide both.
52
53    properties:
54      compatible:
55        enum:
56          - user-otp
57          - factory-otp
58
59    required:
60      - compatible
61
62# This is a generic file other binding inherit from
63additionalProperties: true
64
65examples:
66  - |
67    spi {
68        #address-cells = <1>;
69        #size-cells = <0>;
70
71        flash@0 {
72            reg = <0>;
73            compatible = "jedec,spi-nor";
74            label = "System-firmware";
75        };
76    };
77
78  - |
79    spi {
80        #address-cells = <1>;
81        #size-cells = <0>;
82
83        flash@0 {
84            reg = <0>;
85            compatible = "jedec,spi-nor";
86
87            otp-1 {
88                compatible = "factory-otp";
89                #address-cells = <1>;
90                #size-cells = <1>;
91
92                electronic-serial-number@0 {
93                    reg = <0 8>;
94                };
95            };
96
97            otp-2 {
98                compatible = "user-otp";
99                #address-cells = <1>;
100                #size-cells = <1>;
101
102                mac-address@0 {
103                    reg = <0 6>;
104                };
105            };
106        };
107    };
108
109...
110