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

Schema identifier ($id): "http://devicetree.org/schemas/mtd/jedec,spi-nor.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Rob Herring <robh@kernel.org>"

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): mtd.yaml#

Rule 2 #

Shared schema rule ($ref): /schemas/spi/spi-peripheral-props.yaml#

Properties and child nodes (properties) #

compatible — not listed as required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Array item rules (items)

Item 1

String pattern (pattern): "^((((micron|spansion|st),)?(m25p(40|80|16|32|64|128)|n25q(32b|064|128a11|128a13|256a|512a|164k)))|atmel,at(25|26)df(321a|641|081a)|everspin,mr25h(10|40|128|256)|(mxicy|macronix),mx25l(4005a|1606e|6405d|8005|12805d|25635e)|(mxicy|macronix),mx25u(4033|4035)|(spansion,)?s25fl(128s|256s1|512s|008k|064k|164k)|(sst|microchip),sst25vf(016b|032b|040b)|(sst,)?sst26wf016b|(sst,)?sst25wf(040b|080)|winbond,w25x(80|32)|(winbond,)?w25q(16|32(w|dw)?|64(dw)?|80bl|128(fw)?|256))$"

Item 2

Exact value (const): "jedec,spi-nor"

Rule 2

Array item rules (items)

Item 1

Allowed values (enum): "issi,is25lp016d", "micron,mt25qu02g", "mxicy,mx25r1635f", "mxicy,mx25u6435f", "mxicy,mx25v8035f", "spansion,s25sl12801", "spansion,s25fs512s"

Item 2

Exact value (const): "jedec,spi-nor"

Rule 3

Exact value (const): "jedec,spi-nor"

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.

reg — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

interrupts — not listed as required here #

Maximum number of items (maxItems): 1

m25p,fast-read — not listed as required here #

Value type (type): "boolean"

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.

broken-flash-reset — not listed as required here #

Value type (type): "boolean"

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.

no-wp — not listed as required here #

Value type (type): "boolean"

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.

reset-gpios — not listed as required here #

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.

vcc-supply — not listed as required here #

Supply for the SPI NOR power.

spi-cpol — not listed as required here #

true — No constraints added by this property rule.

spi-cpha — not listed as required here #

true — No constraints added by this property rule.

Property dependencies (dependencies) #

spi-cpol — applies when this property is present #

Also requires: "spi-cpha"

spi-cpha — applies when this property is present #

Also requires: "spi-cpol"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/gpio/gpio.h>
spi {
    #address-cells = <1>;
    #size-cells = <0>;

    flash@0 {
        compatible = "spansion,m25p80", "jedec,spi-nor";
        reg = <0>;
        spi-max-frequency = <40000000>;
        m25p,fast-read;
        reset-gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0-only

Edit this page