xref: /linux/Documentation/devicetree/bindings/mtd/partitions/partition.yaml (revision f48d2d6ebd3bde515f4725a88e53953cd6eccc29)
164185220SRafał Miłecki# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
264185220SRafał Miłecki%YAML 1.2
364185220SRafał Miłecki---
464185220SRafał Miłecki$id: http://devicetree.org/schemas/mtd/partitions/partition.yaml#
564185220SRafał Miłecki$schema: http://devicetree.org/meta-schemas/core.yaml#
664185220SRafał Miłecki
764185220SRafał Miłeckititle: Partition
864185220SRafał Miłecki
964185220SRafał Miłeckidescription: |
1064185220SRafał Miłecki  This binding describes a single flash partition. Each partition must have its
1164185220SRafał Miłecki  relative offset and size specified. Depending on partition function extra
1264185220SRafał Miłecki  properties can be used.
1364185220SRafał Miłecki
14118f3fbeSChristian Marangi  A partition may be dynamically allocated by a specific parser at runtime.
15118f3fbeSChristian Marangi  In this specific case, a specific suffix is required to the node name.
16118f3fbeSChristian Marangi  Everything after 'partition-' will be used as the partition name to compare
17118f3fbeSChristian Marangi  with the one dynamically allocated by the specific parser.
18118f3fbeSChristian Marangi  If the partition contains invalid char a label can be provided that will
19118f3fbeSChristian Marangi  be used instead of the node name to make the comparison.
20118f3fbeSChristian Marangi  This is used to assign an OF node to the dynamiccally allocated partition
21118f3fbeSChristian Marangi  so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
22118f3fbeSChristian Marangi  The OF node will be assigned only if the partition label declared match the
23118f3fbeSChristian Marangi  one assigned by the parser at runtime.
24118f3fbeSChristian Marangi
2564185220SRafał Miłeckimaintainers:
2664185220SRafał Miłecki  - Rafał Miłecki <rafal@milecki.pl>
2764185220SRafał Miłecki
2864185220SRafał Miłeckiproperties:
2964185220SRafał Miłecki  reg:
3064185220SRafał Miłecki    description: partition's offset and size within the flash
3164185220SRafał Miłecki    maxItems: 1
3264185220SRafał Miłecki
3364185220SRafał Miłecki  label:
3464185220SRafał Miłecki    description: The label / name for this partition. If omitted, the label
3564185220SRafał Miłecki      is taken from the node name (excluding the unit address).
3664185220SRafał Miłecki
3764185220SRafał Miłecki  read-only:
3864185220SRafał Miłecki    description: This parameter, if present, is a hint that this partition
3964185220SRafał Miłecki      should only be mounted read-only. This is usually used for flash
4064185220SRafał Miłecki      partitions containing early-boot firmware images or data which should
4164185220SRafał Miłecki      not be clobbered.
4264185220SRafał Miłecki    type: boolean
4364185220SRafał Miłecki
4464185220SRafał Miłecki  lock:
4564185220SRafał Miłecki    description: Do not unlock the partition at initialization time (not
4664185220SRafał Miłecki      supported on all devices)
4764185220SRafał Miłecki    type: boolean
4864185220SRafał Miłecki
4964185220SRafał Miłecki  slc-mode:
5064185220SRafał Miłecki    description: This parameter, if present, allows one to emulate SLC mode
5164185220SRafał Miłecki      on a partition attached to an MLC NAND thus making this partition
5264185220SRafał Miłecki      immune to paired-pages corruptions
5364185220SRafał Miłecki    type: boolean
5464185220SRafał Miłecki
552b9a31d7SRafał Miłecki  linux,rootfs:
562b9a31d7SRafał Miłecki    description: Marks partition that contains root filesystem to mount and boot
572b9a31d7SRafał Miłecki      user space from
58a5e393c1SRob Herring    type: boolean
592b9a31d7SRafał Miłecki
60d8d42d47SSimon Glass  align:
61d8d42d47SSimon Glass    $ref: /schemas/types.yaml#/definitions/uint32
62d8d42d47SSimon Glass    minimum: 2
63d8d42d47SSimon Glass    maximum: 0x80000000
64d8d42d47SSimon Glass    multipleOf: 2
65d8d42d47SSimon Glass    description:
66d8d42d47SSimon Glass      This sets the alignment of the entry in bytes.
67d8d42d47SSimon Glass
68d8d42d47SSimon Glass      The entry offset is adjusted so that the entry starts on an aligned
69d8d42d47SSimon Glass      boundary within the containing section or image. For example ‘align =
70d8d42d47SSimon Glass      <16>’ means that the entry will start on a 16-byte boundary. This may
71d8d42d47SSimon Glass      mean that padding is added before the entry. The padding is part of
72d8d42d47SSimon Glass      the containing section but is not included in the entry, meaning that
73d8d42d47SSimon Glass      an empty space may be created before the entry starts. Alignment
74d8d42d47SSimon Glass      must be a power of 2. If ‘align’ is not provided, no alignment is
75d8d42d47SSimon Glass      performed.
76d8d42d47SSimon Glass
77d8d42d47SSimon Glass  align-size:
78d8d42d47SSimon Glass    $ref: /schemas/types.yaml#/definitions/uint32
79d8d42d47SSimon Glass    minimum: 2
80d8d42d47SSimon Glass    maximum: 0x80000000
81d8d42d47SSimon Glass    multipleOf: 2
82d8d42d47SSimon Glass    description:
83d8d42d47SSimon Glass      This sets the alignment of the entry size in bytes. It must be a power
84d8d42d47SSimon Glass      of 2.
85d8d42d47SSimon Glass
86d8d42d47SSimon Glass      For example, to ensure that the size of an entry is a multiple of 64
87d8d42d47SSimon Glass      bytes, set this to 64. While this does not affect the content of the
88d8d42d47SSimon Glass      entry itself (the padding is performed only when its parent section is
89d8d42d47SSimon Glass      assembled), the end result is that the entry ends with the padding
90d8d42d47SSimon Glass      bytes, so may grow. If ‘align-size’ is not provided, no alignment is
91d8d42d47SSimon Glass      performed.
92d8d42d47SSimon Glass
93d8d42d47SSimon Glass  align-end:
94d8d42d47SSimon Glass    $ref: /schemas/types.yaml#/definitions/uint32
95d8d42d47SSimon Glass    minimum: 2
96d8d42d47SSimon Glass    maximum: 0x80000000
97d8d42d47SSimon Glass    multipleOf: 2
98d8d42d47SSimon Glass    description:
99d8d42d47SSimon Glass      This sets the alignment (in bytes) of the end of an entry with respect
100d8d42d47SSimon Glass      to the containing section. It must be a power of 2.
101d8d42d47SSimon Glass
102d8d42d47SSimon Glass      Some entries require that they end on an alignment boundary,
103d8d42d47SSimon Glass      regardless of where they start. This does not move the start of the
104d8d42d47SSimon Glass      entry, so the content of the entry will still start at the beginning.
105d8d42d47SSimon Glass      But there may be padding at the end. While this does not affect the
106d8d42d47SSimon Glass      content of the entry itself (the padding is performed only when its
107d8d42d47SSimon Glass      parent section is assembled), the end result is that the entry ends
108d8d42d47SSimon Glass      with the padding bytes, so may grow. If ‘align-end’ is not provided,
109d8d42d47SSimon Glass      no alignment is performed.
110d8d42d47SSimon Glass
111118f3fbeSChristian Marangiif:
112118f3fbeSChristian Marangi  not:
113118f3fbeSChristian Marangi    required: [ reg ]
114118f3fbeSChristian Marangithen:
115118f3fbeSChristian Marangi  properties:
116118f3fbeSChristian Marangi    $nodename:
117118f3fbeSChristian Marangi      pattern: '^partition-.*$'
11864185220SRafał Miłecki
119d85cebfbSMiquel Raynal# This is a generic file other binding inherit from and extend
12064185220SRafał MiłeckiadditionalProperties: true
121*f48d2d6eSSimon Glass
122*f48d2d6eSSimon Glassexamples:
123*f48d2d6eSSimon Glass  - |
124*f48d2d6eSSimon Glass    partitions {
125*f48d2d6eSSimon Glass        compatible = "fixed-partitions";
126*f48d2d6eSSimon Glass        #address-cells = <1>;
127*f48d2d6eSSimon Glass        #size-cells = <1>;
128*f48d2d6eSSimon Glass
129*f48d2d6eSSimon Glass        partition@100000 {
130*f48d2d6eSSimon Glass            compatible = "u-boot";
131*f48d2d6eSSimon Glass            reg = <0x100000 0xf00000>;
132*f48d2d6eSSimon Glass            align-size = <0x1000>;
133*f48d2d6eSSimon Glass            align-end = <0x10000>;
134*f48d2d6eSSimon Glass        };
135*f48d2d6eSSimon Glass
136*f48d2d6eSSimon Glass        partition@200000 {
137*f48d2d6eSSimon Glass            compatible = "tfa-bl31";
138*f48d2d6eSSimon Glass            reg = <0x200000 0x100000>;
139*f48d2d6eSSimon Glass            align = <0x4000>;
140*f48d2d6eSSimon Glass        };
141*f48d2d6eSSimon Glass    };
142