SPI-NAND flash controller for MediaTek ARM SoCs

Schema identifier ($id): "http://devicetree.org/schemas/spi/mediatek,spi-mtk-snfi.yaml#"

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

Maintainers (maintainers): "Chuanhong Guo <gch981213@gmail.com>"

The Mediatek SPI-NAND flash controller is an extended version of the Mediatek NAND flash controller. It can perform standard SPI instructions with one continuous write and one read for up-to 0xa0 bytes. It also supports typical SPI-NAND page cache operations in single, dual or quad IO mode with pipelined ECC encoding/decoding using the accompanying ECC engine. There should be only one spi slave device following generic spi bindings.

Properties and child nodes (properties) #

compatible — required here #

Allowed values (enum): "mediatek,mt7622-snand", "mediatek,mt7629-snand", "mediatek,mt7986-snand"

reg — required here #

Array item rules (items) #

Item 1

core registers

interrupts — required here #

Array item rules (items) #

Item 1

NFI interrupt

clocks — required here #

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 3

clock-names — required here #

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 3

nand-ecc-engine — required here #

device-tree node of the accompanying ECC engine.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

mediatek,rx-latch-latency-ns — not listed as required here #

Data read latch latency, unit is nanoseconds.

Required in this object (required): "compatible", "reg", "interrupts", "clocks", "clock-names", "nand-ecc-engine"

All of these rules must match (allOf) #

Rule 1 #

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

Rule 2 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Allowed values (enum): "mediatek,mt7622-snand", "mediatek,mt7629-snand"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

clock used for the controller

Item 2

clock used for the SPI bus

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "nfi_clk"

Item 2

Exact value (const): "pad_clk"

Rule 3 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Allowed values (enum): "mediatek,mt7986-snand"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Array item rules (items)

Item 1

clock used for the controller

Item 2

clock used for the SPI bus

Item 3

clock used for the AHB bus

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "nfi_clk"

Item 2

Exact value (const): "pad_clk"

Item 3

Exact value (const): "nfi_hclk"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt7622-clk.h>
soc {
  #address-cells = <2>;
  #size-cells = <2>;
  snfi: spi@1100d000 {
    compatible = "mediatek,mt7622-snand";
    reg = <0 0x1100d000 0 0x1000>;
    interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
    clocks = <&pericfg CLK_PERI_NFI_PD>, <&pericfg CLK_PERI_SNFI_PD>;
    clock-names = "nfi_clk", "pad_clk";
    nand-ecc-engine = <&bch>;
    #address-cells = <1>;
    #size-cells = <0>;

    flash@0 {
      compatible = "spi-nand";
      reg = <0>;
      spi-tx-bus-width = <4>;
      spi-rx-bus-width = <4>;
      nand-ecc-engine = <&snfi>;
    };
  };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Edit this page