# SPI NOR flash ST M25Pxx (and similar) serial flash chips

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

> Device-tree binding reference for SPI NOR flash ST M25Pxx (and similar) serial flash chips.

<!-- SPDX-License-Identifier: GPL-2.0-only -->


<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;jedec&#44;spi&#45;nor&#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>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Rob Herring &#60;robh&#64;kernel&#46;org&#62;&#34;</code></span>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

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

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>mtd&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-mtd/mtd.md#dt-root>)</span>

<a id="dt-22ca5ec5b89308748ecc"></a>

### Rule 2

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-8549616abc3b04702c51">[<code>&#47;schemas&#47;spi&#47;spi&#45;peripheral&#45;props&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-spi/spi-peripheral-props.md#dt-root>)</span>

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

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

<a id="dt-5c1d81699dcbe840de83"></a>

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

<a id="dt-39566f01414e34c67b85"></a>

#### Exactly one of these rules must match (<code>oneOf</code>)

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

**Rule 1**

> <a id="dt-07409cc9508405f48983"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-822691c82c9797f7b1f9"></a>
>
> **Item 1**
>
> > **String pattern (<code>pattern</code>):** <span id="dt-693b4372baab773d14c8"><code>&#34;&#94;&#40;&#40;&#40;&#40;micron&#124;spansion&#124;st&#41;&#44;&#41;&#63;&#40;m25p&#40;40&#124;80&#124;16&#124;32&#124;64&#124;128&#41;&#124;n25q&#40;32b&#124;064&#124;128a11&#124;128a13&#124;256a&#124;512a&#124;164k&#41;&#41;&#41;&#124;atmel&#44;at&#40;25&#124;26&#41;df&#40;321a&#124;641&#124;081a&#41;&#124;everspin&#44;mr25h&#40;10&#124;40&#124;128&#124;256&#41;&#124;&#40;mxicy&#124;macronix&#41;&#44;mx25l&#40;4005a&#124;1606e&#124;6405d&#124;8005&#124;12805d&#124;25635e&#41;&#124;&#40;mxicy&#124;macronix&#41;&#44;mx25u&#40;4033&#124;4035&#41;&#124;&#40;spansion&#44;&#41;&#63;s25fl&#40;128s&#124;256s1&#124;512s&#124;008k&#124;064k&#124;164k&#41;&#124;&#40;sst&#124;microchip&#41;&#44;sst25vf&#40;016b&#124;032b&#124;040b&#41;&#124;&#40;sst&#44;&#41;&#63;sst26wf016b&#124;&#40;sst&#44;&#41;&#63;sst25wf&#40;040b&#124;080&#41;&#124;winbond&#44;w25x&#40;80&#124;32&#41;&#124;&#40;winbond&#44;&#41;&#63;w25q&#40;16&#124;32&#40;w&#124;dw&#41;&#63;&#124;64&#40;dw&#41;&#63;&#124;80bl&#124;128&#40;fw&#41;&#63;&#124;256&#41;&#41;&#36;&#34;</code></span>
>
> <a id="dt-bc83d1191bdc72da8559"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-1da74b37131fdcec1073"><code>&#34;jedec&#44;spi&#45;nor&#34;</code></span>

<a id="dt-7482b6e745c4f056161a"></a>

**Rule 2**

> <a id="dt-4c3e118873fbaedb5de2"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-b02d8860067795c00ae4"></a>
>
> **Item 1**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-aa1230b5a2b80f9fb387"></a> <span id="dt-49b534c9c8948cfc8034"><code>&#34;issi&#44;is25lp016d&#34;</code></span>, <span id="dt-93451931f534c9a92fb4"><code>&#34;micron&#44;mt25qu02g&#34;</code></span>, <span id="dt-bdca084879537277097b"><code>&#34;mxicy&#44;mx25r1635f&#34;</code></span>, <span id="dt-922f7901d25b667972ac"><code>&#34;mxicy&#44;mx25u6435f&#34;</code></span>, <span id="dt-eb61ad381053476dae55"><code>&#34;mxicy&#44;mx25v8035f&#34;</code></span>, <span id="dt-05b29c21ca38ad337d53"><code>&#34;spansion&#44;s25sl12801&#34;</code></span>, <span id="dt-93c2763ada782db7e26c"><code>&#34;spansion&#44;s25fs512s&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;jedec&#44;spi&#45;nor&#34;</code></span>

<a id="dt-39cb5b72c94e12bd53ea"></a>

**Rule 3**

> **Exact value (<code>const</code>):** <span id="dt-710bc579d54b8b6b1f6c"><code>&#34;jedec&#44;spi&#45;nor&#34;</code></span>

<div id="dt-e84064a2d568e9bcb9c3">
<p style="white-space: pre-wrap">SPI NOR flashes compatible with the JEDEC SFDP standard or which may be identified with the READ ID opcode (0x9F) do not deserve a specific compatible. They should instead only be matched against the generic "jedec,spi-nor" compatible.</p>
</div>

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

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

**Minimum number of items (<code>minItems</code>):** <span id="dt-4b3e7791b11b96c3db87"><code>1</code></span>

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

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

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

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

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

### <code>m25p&#44;fast&#45;read</code> — not listed as required here

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

<div id="dt-607f2902927d8fddde3c">
<p style="white-space: pre-wrap">Use the "fast read" opcode to read data from the chip instead of the usual "read" opcode. This opcode is not supported by all chips and support for it can not be detected at runtime. Refer to your chips' datasheet to check if this is supported by your chip.</p>
</div>

<a id="dt-373bcb761b537c9f4180"></a>

### <code>broken&#45;flash&#45;reset</code> — not listed as required here

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

<div id="dt-852dae478c75dffaaa2a">
<p style="white-space: pre-wrap">Some flash devices utilize stateful addressing modes (e.g., for 32-bit addressing) which need to be managed carefully by a system. Because these sorts of flash don't have a standardized software reset command, and because some systems don't toggle the flash RESET# pin upon system reset (if the pin even exists at all), there are systems which cannot reboot properly if the flash is left in the "wrong" state. This boolean flag can be used on such systems, to denote the absence of a reliable reset mechanism.</p>
</div>

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

### <code>no&#45;wp</code> — not listed as required here

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

<div id="dt-b33fc3a0bcdf140a3acb">
<p style="white-space: pre-wrap">The status register write disable (SRWD) bit in status register, combined with the WP# signal, provides hardware data protection for the device. When the SRWD bit is set to 1, and the WP# signal is either driven LOW or hard strapped to LOW, the status register nonvolatile bits become read-only and the WRITE STATUS REGISTER operation will not execute. The only way to exit this hardware-protected mode is to drive WP# HIGH. If the WP# signal of the flash device is not connected or is wrongly tied to GND (that includes internal pull-downs) then status register permanently becomes read-only as the SRWD bit cannot be reset. This boolean flag can be used on such systems to avoid setting the SRWD bit while writing the status register. WP# signal hard strapped to GND can be a valid use case.</p>
</div>

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

### <code>reset&#45;gpios</code> — not listed as required here

<div id="dt-451564af2b6998692dea">
<p style="white-space: pre-wrap">A GPIO line connected to the RESET (active low) signal of the device. If "broken-flash-reset" is present then having this property does not make any difference.</p>
</div>

<a id="dt-5b20c41001654467bdea"></a>

### <code>vcc&#45;supply</code> — not listed as required here

<div id="dt-304923183fea32e69a40">
<p style="white-space: pre-wrap">Supply for the SPI NOR power.</p>
</div>

<a id="dt-27851c8ce8d41152ef35"></a>

### <code>spi&#45;cpol</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

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

### <code>spi&#45;cpha</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

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

## Property dependencies (<code>dependencies</code>)

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

### <code>spi&#45;cpol</code> — applies when this property is present

Also requires: <span id="dt-f62b0830225b4edc59d0"><code>&#34;spi&#45;cpha&#34;</code></span>

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

### <code>spi&#45;cpha</code> — applies when this property is present

Also requires: <span id="dt-a00d999628bebde1818a"><code>&#34;spi&#45;cpol&#34;</code></span>

<a id="dt-63ab525a9812ac23c446"></a>

## Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

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

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

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;
spi {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    flash@0 {
        compatible = "spansion,m25p80", "jedec,spi-nor";
        reg = &lt;0&gt;;
        spi-max-frequency = &lt;40000000&gt;;
        m25p,fast-read;
        reset-gpios = &lt;&amp;gpio 12 GPIO_ACTIVE_LOW&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</span></p>

</details>
