xref: /freebsd/sys/contrib/device-tree/Bindings/mtd/jedec,spi-nor.yaml (revision 01950c46b8155250f64374fb72fc11faa44bf099)
15def4c47SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only
25def4c47SEmmanuel Vadot%YAML 1.2
35def4c47SEmmanuel Vadot---
45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/jedec,spi-nor.yaml#
55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65def4c47SEmmanuel Vadot
75def4c47SEmmanuel Vadottitle: SPI NOR flash ST M25Pxx (and similar) serial flash chips
85def4c47SEmmanuel Vadot
95def4c47SEmmanuel Vadotmaintainers:
105def4c47SEmmanuel Vadot  - Rob Herring <robh@kernel.org>
115def4c47SEmmanuel Vadot
125956d97fSEmmanuel VadotallOf:
13fac71e4eSEmmanuel Vadot  - $ref: mtd.yaml#
14e67e8565SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
155956d97fSEmmanuel Vadot
165def4c47SEmmanuel Vadotproperties:
175def4c47SEmmanuel Vadot  compatible:
185def4c47SEmmanuel Vadot    oneOf:
195def4c47SEmmanuel Vadot      - items:
205def4c47SEmmanuel Vadot          - pattern: "^((((micron|spansion|st),)?\
215def4c47SEmmanuel Vadot              (m25p(40|80|16|32|64|128)|\
225def4c47SEmmanuel Vadot              n25q(32b|064|128a11|128a13|256a|512a|164k)))|\
235def4c47SEmmanuel Vadot              atmel,at25df(321a|641|081a)|\
245def4c47SEmmanuel Vadot              everspin,mr25h(10|40|128|256)|\
255def4c47SEmmanuel Vadot              (mxicy|macronix),mx25l(4005a|1606e|6405d|8005|12805d|25635e)|\
265def4c47SEmmanuel Vadot              (mxicy|macronix),mx25u(4033|4035)|\
275def4c47SEmmanuel Vadot              (spansion,)?s25fl(128s|256s1|512s|008k|064k|164k)|\
285def4c47SEmmanuel Vadot              (sst|microchip),sst25vf(016b|032b|040b)|\
295def4c47SEmmanuel Vadot              (sst,)?sst26wf016b|\
305def4c47SEmmanuel Vadot              (sst,)?sst25wf(040b|080)|\
315def4c47SEmmanuel Vadot              winbond,w25x(80|32)|\
325def4c47SEmmanuel Vadot              (winbond,)?w25q(16|32(w|dw)?|64(dw)?|80bl|128(fw)?|256))$"
335def4c47SEmmanuel Vadot          - const: jedec,spi-nor
345def4c47SEmmanuel Vadot      - items:
355def4c47SEmmanuel Vadot          - enum:
365def4c47SEmmanuel Vadot              - issi,is25lp016d
375def4c47SEmmanuel Vadot              - micron,mt25qu02g
385def4c47SEmmanuel Vadot              - mxicy,mx25r1635f
395def4c47SEmmanuel Vadot              - mxicy,mx25u6435f
405def4c47SEmmanuel Vadot              - mxicy,mx25v8035f
415def4c47SEmmanuel Vadot              - spansion,s25sl12801
425def4c47SEmmanuel Vadot              - spansion,s25fs512s
435def4c47SEmmanuel Vadot          - const: jedec,spi-nor
445def4c47SEmmanuel Vadot      - const: jedec,spi-nor
455def4c47SEmmanuel Vadot    description:
46aa1a8ff2SEmmanuel Vadot      SPI NOR flashes compatible with the JEDEC SFDP standard or which may be
47aa1a8ff2SEmmanuel Vadot      identified with the READ ID opcode (0x9F) do not deserve a specific
48aa1a8ff2SEmmanuel Vadot      compatible. They should instead only be matched against the generic
49aa1a8ff2SEmmanuel Vadot      "jedec,spi-nor" compatible.
505def4c47SEmmanuel Vadot
515def4c47SEmmanuel Vadot  reg:
52c9ccf3a3SEmmanuel Vadot    minItems: 1
53c9ccf3a3SEmmanuel Vadot    maxItems: 2
545def4c47SEmmanuel Vadot
55*01950c46SEmmanuel Vadot  interrupts:
56*01950c46SEmmanuel Vadot    maxItems: 1
57*01950c46SEmmanuel Vadot
585def4c47SEmmanuel Vadot  m25p,fast-read:
595def4c47SEmmanuel Vadot    type: boolean
605def4c47SEmmanuel Vadot    description:
615def4c47SEmmanuel Vadot      Use the "fast read" opcode to read data from the chip instead of the usual
625def4c47SEmmanuel Vadot      "read" opcode. This opcode is not supported by all chips and support for
635def4c47SEmmanuel Vadot      it can not be detected at runtime. Refer to your chips' datasheet to check
645def4c47SEmmanuel Vadot      if this is supported by your chip.
655def4c47SEmmanuel Vadot
665def4c47SEmmanuel Vadot  broken-flash-reset:
675def4c47SEmmanuel Vadot    type: boolean
685def4c47SEmmanuel Vadot    description:
695def4c47SEmmanuel Vadot      Some flash devices utilize stateful addressing modes (e.g., for 32-bit
705def4c47SEmmanuel Vadot      addressing) which need to be managed carefully by a system. Because these
715def4c47SEmmanuel Vadot      sorts of flash don't have a standardized software reset command, and
725def4c47SEmmanuel Vadot      because some systems don't toggle the flash RESET# pin upon system reset
735def4c47SEmmanuel Vadot      (if the pin even exists at all), there are systems which cannot reboot
745def4c47SEmmanuel Vadot      properly if the flash is left in the "wrong" state. This boolean flag can
755def4c47SEmmanuel Vadot      be used on such systems, to denote the absence of a reliable reset
765def4c47SEmmanuel Vadot      mechanism.
775def4c47SEmmanuel Vadot
78aa1a8ff2SEmmanuel Vadot  no-wp:
79aa1a8ff2SEmmanuel Vadot    type: boolean
80aa1a8ff2SEmmanuel Vadot    description:
81aa1a8ff2SEmmanuel Vadot      The status register write disable (SRWD) bit in status register, combined
82aa1a8ff2SEmmanuel Vadot      with the WP# signal, provides hardware data protection for the device. When
83aa1a8ff2SEmmanuel Vadot      the SRWD bit is set to 1, and the WP# signal is either driven LOW or hard
84aa1a8ff2SEmmanuel Vadot      strapped to LOW, the status register nonvolatile bits become read-only and
85aa1a8ff2SEmmanuel Vadot      the WRITE STATUS REGISTER operation will not execute. The only way to exit
86aa1a8ff2SEmmanuel Vadot      this hardware-protected mode is to drive WP# HIGH. If the WP# signal of the
87aa1a8ff2SEmmanuel Vadot      flash device is not connected or is wrongly tied to GND (that includes internal
88aa1a8ff2SEmmanuel Vadot      pull-downs) then status register permanently becomes read-only as the SRWD bit
89aa1a8ff2SEmmanuel Vadot      cannot be reset. This boolean flag can be used on such systems to avoid setting
90aa1a8ff2SEmmanuel Vadot      the SRWD bit while writing the status register. WP# signal hard strapped to GND
91aa1a8ff2SEmmanuel Vadot      can be a valid use case.
92aa1a8ff2SEmmanuel Vadot
938bab661aSEmmanuel Vadot  reset-gpios:
948bab661aSEmmanuel Vadot    description:
958bab661aSEmmanuel Vadot      A GPIO line connected to the RESET (active low) signal of the device.
968bab661aSEmmanuel Vadot      If "broken-flash-reset" is present then having this property does not
978bab661aSEmmanuel Vadot      make any difference.
985956d97fSEmmanuel Vadot
99cb7aa33aSEmmanuel Vadot  spi-cpol: true
100cb7aa33aSEmmanuel Vadot  spi-cpha: true
101cb7aa33aSEmmanuel Vadot
102cb7aa33aSEmmanuel Vadotdependencies:
103cb7aa33aSEmmanuel Vadot  spi-cpol: [ spi-cpha ]
104cb7aa33aSEmmanuel Vadot  spi-cpha: [ spi-cpol ]
105cb7aa33aSEmmanuel Vadot
106e67e8565SEmmanuel VadotunevaluatedProperties: false
1075def4c47SEmmanuel Vadot
1085def4c47SEmmanuel Vadotexamples:
1095def4c47SEmmanuel Vadot  - |
1108bab661aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1115def4c47SEmmanuel Vadot    spi {
1125def4c47SEmmanuel Vadot        #address-cells = <1>;
1135def4c47SEmmanuel Vadot        #size-cells = <0>;
1145def4c47SEmmanuel Vadot
1155def4c47SEmmanuel Vadot        flash@0 {
1165def4c47SEmmanuel Vadot            compatible = "spansion,m25p80", "jedec,spi-nor";
1175def4c47SEmmanuel Vadot            reg = <0>;
1185def4c47SEmmanuel Vadot            spi-max-frequency = <40000000>;
1195def4c47SEmmanuel Vadot            m25p,fast-read;
1208bab661aSEmmanuel Vadot            reset-gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
1215def4c47SEmmanuel Vadot        };
1225def4c47SEmmanuel Vadot    };
1235def4c47SEmmanuel Vadot...
124