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