# Partition

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Mtd bindings / partitions_

> Device-tree binding reference for Partition.

<!-- SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;mtd&#47;partitions&#47;partition&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">This binding describes a single flash partition. Each partition must have its
relative offset and size specified. Depending on partition function extra
properties can be used.</p>
<p style="white-space: pre-wrap">A partition may be dynamically allocated by a specific parser at runtime.
In this specific case, a specific suffix is required to the node name.
Everything after 'partition-' will be used as the partition name to compare
with the one dynamically allocated by the specific parser.
If the partition contains invalid char a label can be provided that will
be used instead of the node name to make the comparison.
This is used to assign an OF node to the dynamiccally allocated partition
so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
The OF node will be assigned only if the partition label declared match the
one assigned by the parser at runtime.</p>
</div>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Rafał Miłecki &#60;rafal&#64;milecki&#46;pl&#62;&#34;</code></span>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-9c1635fdb65d87e33d77"></a>

### <code>reg</code> — not listed as required here

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">partition's offset and size within the flash</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</code></span>

<a id="dt-0c6076cd9d6f109c5cc6"></a>

### <code>label</code> — not listed as required here

<div id="dt-f7c1a813bb0d2e9dd066">
<p style="white-space: pre-wrap">The label / name for this partition. If omitted, the label is taken from the node name (excluding the unit address).</p>
</div>

<a id="dt-3e517a41ee334bf80ca6"></a>

### <code>read&#45;only</code> — not listed as required here

<div id="dt-888756e946e88a297fcf">
<p style="white-space: pre-wrap">This parameter, if present, is a hint that this partition should only be mounted read-only. This is usually used for flash partitions containing early-boot firmware images or data which should not be clobbered.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-710ccbe79441516d7a72"><code>&#34;boolean&#34;</code></span>

<a id="dt-b5a9e060de024e7970f6"></a>

### <code>lock</code> — not listed as required here

<div id="dt-8e0ef40b5f0d49afd1e7">
<p style="white-space: pre-wrap">Do not unlock the partition at initialization time (not supported on all devices)</p>
</div>

**Value type (<code>type</code>):** <span id="dt-38df1713345581b3149c"><code>&#34;boolean&#34;</code></span>

<a id="dt-20b6386e596569cd5023"></a>

### <code>slc&#45;mode</code> — not listed as required here

<div id="dt-da2074b48b9aeeb78483">
<p style="white-space: pre-wrap">This parameter, if present, allows one to emulate SLC mode on a partition attached to an MLC NAND thus making this partition immune to paired-pages corruptions</p>
</div>

**Value type (<code>type</code>):** <span id="dt-04fc3992a42990a11e47"><code>&#34;boolean&#34;</code></span>

<a id="dt-70d57469748c3a70af66"></a>

### <code>linux&#44;rootfs</code> — not listed as required here

<div id="dt-1666eece2dd6b94fb317">
<p style="white-space: pre-wrap">Marks partition that contains root filesystem to mount and boot user space from</p>
</div>

**Value type (<code>type</code>):** <span id="dt-1b3835ea37254e095258"><code>&#34;boolean&#34;</code></span>

<a id="dt-e3003ba5ccab077557cb"></a>

### <code>align</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-57c03345c3b36d04cd63">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Minimum value (<code>minimum</code>):** <span id="dt-a0ab7b9c7ca89f3f21d3"><code>2</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-47ffd40c213335f511b2"><code>2147483648</code></span>

**Multiple of (<code>multipleOf</code>):** <span id="dt-8846ac03a57f4a2830d2"><code>2</code></span>

<div id="dt-b8ee80c54eef14d6701e">
<p style="white-space: pre-wrap">This sets the alignment of the entry in bytes.
The entry offset is adjusted so that the entry starts on an aligned boundary within the containing section or image. For example ‘align = &lt;16&gt;’ means that the entry will start on a 16-byte boundary. This may mean that padding is added before the entry. The padding is part of the containing section but is not included in the entry, meaning that an empty space may be created before the entry starts. Alignment must be a power of 2. If ‘align’ is not provided, no alignment is performed.</p>
</div>

<a id="dt-ea4fd760514cfe3b4e1b"></a>

### <code>align&#45;size</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-aeb48670fd9a2cb94fed">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Minimum value (<code>minimum</code>):** <span id="dt-a55feb7627aed01ec545"><code>2</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-99cbeb7767b905b85b77"><code>2147483648</code></span>

**Multiple of (<code>multipleOf</code>):** <span id="dt-c2857d2421b8dc7de994"><code>2</code></span>

<div id="dt-b5ddfcab9021dc92911b">
<p style="white-space: pre-wrap">This sets the alignment of the entry size in bytes. It must be a power of 2.
For example, to ensure that the size of an entry is a multiple of 64 bytes, set this to 64. While this does not affect the content of the entry itself (the padding is performed only when its parent section is assembled), the end result is that the entry ends with the padding bytes, so may grow. If ‘align-size’ is not provided, no alignment is performed.</p>
</div>

<a id="dt-41a44b5b648f9e59d3d3"></a>

### <code>align&#45;end</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-eedb85c397329e16e52c">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Minimum value (<code>minimum</code>):** <span id="dt-d8834bdc3cc53410c4cd"><code>2</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-cbc549b47e00e645d5e7"><code>2147483648</code></span>

**Multiple of (<code>multipleOf</code>):** <span id="dt-b68c8121d6416a1960bd"><code>2</code></span>

<div id="dt-7fda3f4b347c06a35607">
<p style="white-space: pre-wrap">This sets the alignment (in bytes) of the end of an entry with respect to the containing section. It must be a power of 2.
Some entries require that they end on an alignment boundary, regardless of where they start. This does not move the start of the entry, so the content of the entry will still start at the beginning. But there may be padding at the end. While this does not affect the content of the entry itself (the padding is performed only when its parent section is assembled), the end result is that the entry ends with the padding bytes, so may grow. If ‘align-end’ is not provided, no alignment is performed.</p>
</div>

<a id="dt-6782463a05678b22ad29"></a>

### <code>compression</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-78dbbbd1e53be251c076">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;string</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2c695d502852c3a1e1b7>)</span>

<div id="dt-4848d0f443821cbb81ae">
<p style="white-space: pre-wrap">Compression algorithm used to store the data in this partition, chosen
from a list of well-known algorithms.</p>
<p style="white-space: pre-wrap">The contents are compressed using this algorithm.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-f0f0c98fa46c062486e2"></a> <span id="dt-3fb91dd371e4d0918dfd"><code>&#34;none&#34;</code></span>, <span id="dt-00358d5ac2fb240ec399"><code>&#34;bzip2&#34;</code></span>, <span id="dt-74851fbeccb743a4cd73"><code>&#34;gzip&#34;</code></span>, <span id="dt-8c6b882c42ae0854ffeb"><code>&#34;lzop&#34;</code></span>, <span id="dt-733be5b6604369a0a97d"><code>&#34;lz4&#34;</code></span>, <span id="dt-edefc034ee4c5d009ca6"><code>&#34;lzma&#34;</code></span>, <span id="dt-096e33f7f16aaf3f5194"><code>&#34;xz&#34;</code></span>, <span id="dt-69f327f588eed300fd89"><code>&#34;zstd&#34;</code></span>

<a id="dt-ce78a66e67e2d028b333"></a>

### <code>sercomm&#44;scpart&#45;id</code> — not listed as required here

<div id="dt-da46fe1d326051265091">
<p style="white-space: pre-wrap">Partition id in Sercomm partition map. Mtd parser uses this id to find a record in the partition map containing offset and size of the current partition. The values from partition map overrides partition offset and size defined in reg property of the dts. Frequently these values are the same, but may differ if device has bad eraseblocks on a flash.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-cb692e88f89c7fc88e6e">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<a id="dt-471cf9e1db75cd15a4c6"></a>

### <code>nvmem&#45;layout</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-afa21dd3acda23c4c1d4">[<code>&#47;schemas&#47;nvmem&#47;layouts&#47;nvmem&#45;layout&#46;yaml</code>](</kernel/hardware/devicetree-bindings/dt-nvmem/layouts/nvmem-layout.md#dt-root>)</span>

<a id="dt-158e3f6339df9dc0e448"></a>

## Condition (<code>if</code>)

> <a id="dt-3bfe73d6d5d592adab9c"></a>
>
> ### This rule must not match (<code>not</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-c5548ec7af287083fcce"></a> <span id="dt-86d1fed7a8a2cf122d8e"><code>&#34;reg&#34;</code></span>

<a id="dt-94d3067a06aec87aad7f"></a>

## When the condition matches (<code>then</code>)

> <a id="dt-d3da345ec82b9041251c"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-82b238e9fd5af4b4a62c"></a>
>
> #### <code>&#36;nodename</code> — not listed as required here
>
> **String pattern (<code>pattern</code>):** <span id="dt-ddad8464dc5253625ba7"><code>&#34;&#94;partitions&#63;&#40;&#45;&#46;&#43;&#41;&#63;&#36;&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>true</code>

Allowed by this rule.

<a id="dt-7fcd144dee0d1b44122a"></a>

## Reusable definitions (<code>&#36;defs</code>)

<a id="dt-b43252f69d556623c54c"></a>

### <code>partition&#45;node</code>

**Value type (<code>type</code>):** <span id="dt-2fa508b5b2f04a901019"><code>&#34;object&#34;</code></span>

<a id="dt-2c9bef3f79e391d4dc38"></a>

#### Condition (<code>if</code>)

> <a id="dt-11fc3eef9bf25d1dda17"></a>
>
> **This rule must not match (<code>not</code>)**
>
> > **Required in this object (<code>required</code>):** <a id="dt-54373c943c525733e8d5"></a> <span id="dt-bbf0adf0aa9b7643a8b6"><code>&#34;compatible&#34;</code></span>

<a id="dt-241a2f9c2f6a9ec87c2d"></a>

#### When the condition matches (<code>then</code>)

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-fee9cfce9699a8af863f">[<code>&#35;</code>](<#dt-root>)</span>
>
> <a id="dt-48ed4ab3849273e88176"></a>
>
> **Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)**
>
> <code>false</code>
>
> Not allowed by this rule.

<a id="dt-093fb1c403f9c71d8950"></a>

#### When the condition does not match (<code>else</code>)

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-ccfa2cfb5a28450db4b3">[<code>&#35;</code>](<#dt-root>)</span>

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">partitions {
    compatible = "fixed-partitions";
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;

    partition@100000 {
        compatible = "u-boot";
        reg = &lt;0x100000 0xf00000&gt;;
        align-size = &lt;0x1000&gt;;
        align-end = &lt;0x10000&gt;;
    };

    partition@200000 {
        compatible = "tfa-bl31";
        reg = &lt;0x200000 0x100000&gt;;
        align = &lt;0x4000&gt;;
    };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause</span></p>

<p id="dt-comment-1"><strong>Line 149:</strong> <span> This is a generic file other binding inherit from and extend</span></p>

</details>
