xref: /linux/Documentation/devicetree/bindings/eeprom/at25.yaml (revision 2731835f3f2e5b0642ad82a3a0265c98a552283e)
1f8f79fa6SChristian Eggers# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2f8f79fa6SChristian Eggers%YAML 1.2
3f8f79fa6SChristian Eggers---
445698208SRob Herring$id: http://devicetree.org/schemas/eeprom/at25.yaml#
545698208SRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6f8f79fa6SChristian Eggers
7fd307a4aSJiri Prchaltitle: SPI EEPROMs or FRAMs compatible with Atmel's AT25
8f8f79fa6SChristian Eggers
9f8f79fa6SChristian Eggersmaintainers:
10f8f79fa6SChristian Eggers  - Christian Eggers <ceggers@arri.de>
11f8f79fa6SChristian Eggers
12f8f79fa6SChristian Eggersproperties:
13f8f79fa6SChristian Eggers  $nodename:
14fd307a4aSJiri Prchal    anyOf:
15fd307a4aSJiri Prchal      - pattern: "^eeprom@[0-9a-f]{1,2}$"
16fd307a4aSJiri Prchal      - pattern: "^fram@[0-9a-f]{1,2}$"
17f8f79fa6SChristian Eggers
18f8f79fa6SChristian Eggers  # There are multiple known vendors who manufacture EEPROM chips compatible
19f8f79fa6SChristian Eggers  # with Atmel's AT25. The compatible string requires two items where the
20f8f79fa6SChristian Eggers  # 'vendor' and 'model' parts of the first are the actual chip and the second
21f8f79fa6SChristian Eggers  # item is fixed to "atmel,at25". Some existing bindings only have the
22f8f79fa6SChristian Eggers  # "atmel,at25" part and should be fixed by somebody who knows vendor and
23f8f79fa6SChristian Eggers  # product.
24f8f79fa6SChristian Eggers  compatible:
25f8f79fa6SChristian Eggers    oneOf:
26f8f79fa6SChristian Eggers      - items:
27f8f79fa6SChristian Eggers          - enum:
28f8f79fa6SChristian Eggers              - anvo,anv32e61w
29f8f79fa6SChristian Eggers              - atmel,at25256B
30f8f79fa6SChristian Eggers              - fujitsu,mb85rs1mt
31*e1cf752eSFrancesco Dolcini              - fujitsu,mb85rs256
32f8f79fa6SChristian Eggers              - fujitsu,mb85rs64
33f8f79fa6SChristian Eggers              - microchip,at25160bn
34f8f79fa6SChristian Eggers              - microchip,25lc040
35f8f79fa6SChristian Eggers              - st,m95m02
36f8f79fa6SChristian Eggers              - st,m95256
37b6ca07faSRasmus Villemoes              - st,m95640
38fd307a4aSJiri Prchal              - cypress,fm25
39f8f79fa6SChristian Eggers
40f8f79fa6SChristian Eggers          - const: atmel,at25
41f8f79fa6SChristian Eggers
42f8f79fa6SChristian Eggers      # Please don't use this alternative for new bindings.
43f8f79fa6SChristian Eggers      - items:
44f8f79fa6SChristian Eggers          - const: atmel,at25
45f8f79fa6SChristian Eggers
46f8f79fa6SChristian Eggers  reg:
470499220dSRob Herring    maxItems: 1
48f8f79fa6SChristian Eggers
49f8f79fa6SChristian Eggers  pagesize:
50d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
51f8f79fa6SChristian Eggers    enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
52f8f79fa6SChristian Eggers    description:
53fd307a4aSJiri Prchal      Size of the eeprom page. FRAMs don't have pages.
54f8f79fa6SChristian Eggers
55f8f79fa6SChristian Eggers  size:
56d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
57f8f79fa6SChristian Eggers    description:
58f8f79fa6SChristian Eggers      Total eeprom size in bytes.
59f8f79fa6SChristian Eggers
60f8f79fa6SChristian Eggers  address-width:
61f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
62f8f79fa6SChristian Eggers    enum: [ 8, 9, 16, 24 ]
63f8f79fa6SChristian Eggers    description:
64f8f79fa6SChristian Eggers      Number of address bits.
65f8f79fa6SChristian Eggers      For 9 bits, the MSB of the address is sent as bit 3 of the instruction
66f8f79fa6SChristian Eggers      byte, before the address byte.
67f8f79fa6SChristian Eggers
68f8f79fa6SChristian Eggers  spi-cpha: true
69f8f79fa6SChristian Eggers
70f8f79fa6SChristian Eggers  spi-cpol: true
71f8f79fa6SChristian Eggers
72f8f79fa6SChristian Eggers  read-only:
73f8f79fa6SChristian Eggers    description:
74f8f79fa6SChristian Eggers      Disable writes to the eeprom.
75f8f79fa6SChristian Eggers    type: boolean
76f8f79fa6SChristian Eggers
77f8f79fa6SChristian Eggers  wp-gpios:
78f8f79fa6SChristian Eggers    maxItems: 1
79f8f79fa6SChristian Eggers    description:
80f8f79fa6SChristian Eggers      GPIO to which the write-protect pin of the chip is connected.
81f8f79fa6SChristian Eggers
82f8f79fa6SChristian Eggers  # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
83f8f79fa6SChristian Eggers  at25,byte-len:
84f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
85f8f79fa6SChristian Eggers    description:
86f8f79fa6SChristian Eggers      Total eeprom size in bytes. Deprecated, use "size" property instead.
87f8f79fa6SChristian Eggers    deprecated: true
88f8f79fa6SChristian Eggers
89f8f79fa6SChristian Eggers  at25,addr-mode:
90f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
91f8f79fa6SChristian Eggers    description:
92f8f79fa6SChristian Eggers      Addr-mode flags, as defined in include/linux/spi/eeprom.h.
93f8f79fa6SChristian Eggers      Deprecated, use "address-width" property instead.
94f8f79fa6SChristian Eggers    deprecated: true
95f8f79fa6SChristian Eggers
96f8f79fa6SChristian Eggers  at25,page-size:
97f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
98f8f79fa6SChristian Eggers    description:
99f8f79fa6SChristian Eggers      Size of the eeprom page. Deprecated, use "pagesize" property instead.
100f8f79fa6SChristian Eggers    deprecated: true
101f8f79fa6SChristian Eggers
102f8f79fa6SChristian Eggersrequired:
103f8f79fa6SChristian Eggers  - compatible
104f8f79fa6SChristian Eggers  - reg
105f8f79fa6SChristian Eggers  - spi-max-frequency
106fd307a4aSJiri Prchal
107fd307a4aSJiri PrchalallOf:
108532b04d8SKrzysztof Kozlowski  - $ref: /schemas/spi/spi-peripheral-props.yaml#
109ca104926SMiquel Raynal  - $ref: /schemas/nvmem/nvmem.yaml
110fd307a4aSJiri Prchal  - if:
111fd307a4aSJiri Prchal      properties:
112fd307a4aSJiri Prchal        compatible:
113fd307a4aSJiri Prchal          not:
114fd307a4aSJiri Prchal            contains:
115fd307a4aSJiri Prchal              const: cypress,fm25
116fd307a4aSJiri Prchal    then:
117fd307a4aSJiri Prchal      required:
118f8f79fa6SChristian Eggers        - pagesize
119f8f79fa6SChristian Eggers        - size
120f8f79fa6SChristian Eggers        - address-width
121f8f79fa6SChristian Eggers
122532b04d8SKrzysztof KozlowskiunevaluatedProperties: false
123f8f79fa6SChristian Eggers
124f8f79fa6SChristian Eggersexamples:
125f8f79fa6SChristian Eggers  - |
126f8f79fa6SChristian Eggers    #include <dt-bindings/gpio/gpio.h>
12720a72af1SRob Herring    spi {
128f8f79fa6SChristian Eggers        #address-cells = <1>;
129f8f79fa6SChristian Eggers        #size-cells = <0>;
130f8f79fa6SChristian Eggers
131f8f79fa6SChristian Eggers        eeprom@0 {
132f8f79fa6SChristian Eggers            compatible = "st,m95256", "atmel,at25";
133f8f79fa6SChristian Eggers            reg = <0>;
134f8f79fa6SChristian Eggers            spi-max-frequency = <5000000>;
135f8f79fa6SChristian Eggers            spi-cpha;
136f8f79fa6SChristian Eggers            spi-cpol;
137f8f79fa6SChristian Eggers            wp-gpios = <&gpio1 3 0>;
138f8f79fa6SChristian Eggers
139f8f79fa6SChristian Eggers            pagesize = <64>;
140f8f79fa6SChristian Eggers            size = <32768>;
141f8f79fa6SChristian Eggers            address-width = <16>;
142f8f79fa6SChristian Eggers        };
143fd307a4aSJiri Prchal
144fd307a4aSJiri Prchal        fram@1 {
145fd307a4aSJiri Prchal            compatible = "cypress,fm25", "atmel,at25";
146fd307a4aSJiri Prchal            reg = <1>;
147fd307a4aSJiri Prchal            spi-max-frequency = <40000000>;
148fd307a4aSJiri Prchal        };
149f8f79fa6SChristian Eggers    };
150