mtd.yaml 2.39 KB
Newer Older
1 2 3 4 5 6
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/mtd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

7
title: MTD (Memory Technology Device)
8 9 10 11 12 13 14

maintainers:
  - Miquel Raynal <miquel.raynal@bootlin.com>
  - Richard Weinberger <richard@nod.at>

properties:
  $nodename:
15
    pattern: "^(flash|.*sram|nand)(@.*)?$"
16 17 18 19 20 21 22 23

  label:
    description:
      User-defined MTD device name. Can be used to assign user friendly
      names to MTD devices (instead of the flash model or flash controller
      based name) in order to ease flash device identification and/or
      describe what they are used for.

24 25 26 27 28 29 30 31 32
  '#address-cells':
    deprecated: true

  '#size-cells':
    deprecated: true

  partitions:
    $ref: /schemas/mtd/partitions/partitions.yaml

33 34 35
    required:
      - compatible

36
patternProperties:
37 38 39 40 41 42 43 44
  "@[0-9a-f]+$":
    $ref: partitions/partition.yaml
    deprecated: true

  "^partition@[0-9a-f]+":
    $ref: partitions/partition.yaml
    deprecated: true

45 46
  "^otp(-[0-9]+)?$":
    $ref: ../nvmem/nvmem.yaml#
47
    unevaluatedProperties: false
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

    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

63
# This is a generic file other binding inherit from
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
additionalProperties: true

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        flash@0 {
            reg = <0>;
            compatible = "jedec,spi-nor";
            label = "System-firmware";
        };
    };

79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
  - |
    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>;
                };
            };
        };
    };

110
...