xref: /linux/Documentation/devicetree/bindings/eeprom/at25.yaml (revision b6ca07fa9a19a2fc067eccd6bf1250c51061b436)
1f8f79fa6SChristian Eggers# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2f8f79fa6SChristian Eggers%YAML 1.2
3f8f79fa6SChristian Eggers---
4f8f79fa6SChristian Eggers$id: "http://devicetree.org/schemas/eeprom/at25.yaml#"
5f8f79fa6SChristian Eggers$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
31f8f79fa6SChristian Eggers              - fujitsu,mb85rs64
32f8f79fa6SChristian Eggers              - microchip,at25160bn
33f8f79fa6SChristian Eggers              - microchip,25lc040
34f8f79fa6SChristian Eggers              - st,m95m02
35f8f79fa6SChristian Eggers              - st,m95256
36*b6ca07faSRasmus Villemoes              - st,m95640
37fd307a4aSJiri Prchal              - cypress,fm25
38f8f79fa6SChristian Eggers
39f8f79fa6SChristian Eggers          - const: atmel,at25
40f8f79fa6SChristian Eggers
41f8f79fa6SChristian Eggers      # Please don't use this alternative for new bindings.
42f8f79fa6SChristian Eggers      - items:
43f8f79fa6SChristian Eggers          - const: atmel,at25
44f8f79fa6SChristian Eggers
45f8f79fa6SChristian Eggers  reg:
460499220dSRob Herring    maxItems: 1
47f8f79fa6SChristian Eggers
48f8f79fa6SChristian Eggers  pagesize:
49d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
50f8f79fa6SChristian Eggers    enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
51f8f79fa6SChristian Eggers    description:
52fd307a4aSJiri Prchal      Size of the eeprom page. FRAMs don't have pages.
53f8f79fa6SChristian Eggers
54f8f79fa6SChristian Eggers  size:
55d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
56f8f79fa6SChristian Eggers    description:
57f8f79fa6SChristian Eggers      Total eeprom size in bytes.
58f8f79fa6SChristian Eggers
59f8f79fa6SChristian Eggers  address-width:
60f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
61f8f79fa6SChristian Eggers    enum: [ 8, 9, 16, 24 ]
62f8f79fa6SChristian Eggers    description:
63f8f79fa6SChristian Eggers      Number of address bits.
64f8f79fa6SChristian Eggers      For 9 bits, the MSB of the address is sent as bit 3 of the instruction
65f8f79fa6SChristian Eggers      byte, before the address byte.
66f8f79fa6SChristian Eggers
67f8f79fa6SChristian Eggers  spi-cpha: true
68f8f79fa6SChristian Eggers
69f8f79fa6SChristian Eggers  spi-cpol: true
70f8f79fa6SChristian Eggers
71f8f79fa6SChristian Eggers  read-only:
72f8f79fa6SChristian Eggers    description:
73f8f79fa6SChristian Eggers      Disable writes to the eeprom.
74f8f79fa6SChristian Eggers    type: boolean
75f8f79fa6SChristian Eggers
76f8f79fa6SChristian Eggers  wp-gpios:
77f8f79fa6SChristian Eggers    maxItems: 1
78f8f79fa6SChristian Eggers    description:
79f8f79fa6SChristian Eggers      GPIO to which the write-protect pin of the chip is connected.
80f8f79fa6SChristian Eggers
81f8f79fa6SChristian Eggers  # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
82f8f79fa6SChristian Eggers  at25,byte-len:
83f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
84f8f79fa6SChristian Eggers    description:
85f8f79fa6SChristian Eggers      Total eeprom size in bytes. Deprecated, use "size" property instead.
86f8f79fa6SChristian Eggers    deprecated: true
87f8f79fa6SChristian Eggers
88f8f79fa6SChristian Eggers  at25,addr-mode:
89f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
90f8f79fa6SChristian Eggers    description:
91f8f79fa6SChristian Eggers      Addr-mode flags, as defined in include/linux/spi/eeprom.h.
92f8f79fa6SChristian Eggers      Deprecated, use "address-width" property instead.
93f8f79fa6SChristian Eggers    deprecated: true
94f8f79fa6SChristian Eggers
95f8f79fa6SChristian Eggers  at25,page-size:
96f8f79fa6SChristian Eggers    $ref: /schemas/types.yaml#/definitions/uint32
97f8f79fa6SChristian Eggers    description:
98f8f79fa6SChristian Eggers      Size of the eeprom page. Deprecated, use "pagesize" property instead.
99f8f79fa6SChristian Eggers    deprecated: true
100f8f79fa6SChristian Eggers
101f8f79fa6SChristian Eggersrequired:
102f8f79fa6SChristian Eggers  - compatible
103f8f79fa6SChristian Eggers  - reg
104f8f79fa6SChristian Eggers  - spi-max-frequency
105fd307a4aSJiri Prchal
106fd307a4aSJiri PrchalallOf:
107532b04d8SKrzysztof Kozlowski  - $ref: /schemas/spi/spi-peripheral-props.yaml#
108ca104926SMiquel Raynal  - $ref: /schemas/nvmem/nvmem.yaml
109fd307a4aSJiri Prchal  - if:
110fd307a4aSJiri Prchal      properties:
111fd307a4aSJiri Prchal        compatible:
112fd307a4aSJiri Prchal          not:
113fd307a4aSJiri Prchal            contains:
114fd307a4aSJiri Prchal              const: cypress,fm25
115fd307a4aSJiri Prchal    then:
116fd307a4aSJiri Prchal      required:
117f8f79fa6SChristian Eggers        - pagesize
118f8f79fa6SChristian Eggers        - size
119f8f79fa6SChristian Eggers        - address-width
120f8f79fa6SChristian Eggers
121532b04d8SKrzysztof KozlowskiunevaluatedProperties: false
122f8f79fa6SChristian Eggers
123f8f79fa6SChristian Eggersexamples:
124f8f79fa6SChristian Eggers  - |
125f8f79fa6SChristian Eggers    #include <dt-bindings/gpio/gpio.h>
12620a72af1SRob Herring    spi {
127f8f79fa6SChristian Eggers        #address-cells = <1>;
128f8f79fa6SChristian Eggers        #size-cells = <0>;
129f8f79fa6SChristian Eggers
130f8f79fa6SChristian Eggers        eeprom@0 {
131f8f79fa6SChristian Eggers            compatible = "st,m95256", "atmel,at25";
132f8f79fa6SChristian Eggers            reg = <0>;
133f8f79fa6SChristian Eggers            spi-max-frequency = <5000000>;
134f8f79fa6SChristian Eggers            spi-cpha;
135f8f79fa6SChristian Eggers            spi-cpol;
136f8f79fa6SChristian Eggers            wp-gpios = <&gpio1 3 0>;
137f8f79fa6SChristian Eggers
138f8f79fa6SChristian Eggers            pagesize = <64>;
139f8f79fa6SChristian Eggers            size = <32768>;
140f8f79fa6SChristian Eggers            address-width = <16>;
141f8f79fa6SChristian Eggers        };
142fd307a4aSJiri Prchal
143fd307a4aSJiri Prchal        fram@1 {
144fd307a4aSJiri Prchal            compatible = "cypress,fm25", "atmel,at25";
145fd307a4aSJiri Prchal            reg = <1>;
146fd307a4aSJiri Prchal            spi-max-frequency = <40000000>;
147fd307a4aSJiri Prchal        };
148f8f79fa6SChristian Eggers    };
149