xref: /linux/Documentation/devicetree/bindings/eeprom/at25.yaml (revision fd307a4ad332ef50be5569c92490219e7cd84ce5)
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
7*fd307a4aSJiri 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:
14*fd307a4aSJiri Prchal    anyOf:
15*fd307a4aSJiri Prchal      - pattern: "^eeprom@[0-9a-f]{1,2}$"
16*fd307a4aSJiri 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*fd307a4aSJiri Prchal              - cypress,fm25
37f8f79fa6SChristian Eggers
38f8f79fa6SChristian Eggers          - const: atmel,at25
39f8f79fa6SChristian Eggers
40f8f79fa6SChristian Eggers      # Please don't use this alternative for new bindings.
41f8f79fa6SChristian Eggers      - items:
42f8f79fa6SChristian Eggers          - const: atmel,at25
43f8f79fa6SChristian Eggers
44f8f79fa6SChristian Eggers  reg:
450499220dSRob Herring    maxItems: 1
46f8f79fa6SChristian Eggers
47f8f79fa6SChristian Eggers  spi-max-frequency: true
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:
53*fd307a4aSJiri 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
106*fd307a4aSJiri Prchal
107*fd307a4aSJiri PrchalallOf:
108*fd307a4aSJiri Prchal  - if:
109*fd307a4aSJiri Prchal      properties:
110*fd307a4aSJiri Prchal        compatible:
111*fd307a4aSJiri Prchal          not:
112*fd307a4aSJiri Prchal            contains:
113*fd307a4aSJiri Prchal              const: cypress,fm25
114*fd307a4aSJiri Prchal    then:
115*fd307a4aSJiri Prchal      required:
116f8f79fa6SChristian Eggers        - pagesize
117f8f79fa6SChristian Eggers        - size
118f8f79fa6SChristian Eggers        - address-width
119f8f79fa6SChristian Eggers
120f8f79fa6SChristian EggersadditionalProperties: false
121f8f79fa6SChristian Eggers
122f8f79fa6SChristian Eggersexamples:
123f8f79fa6SChristian Eggers  - |
124f8f79fa6SChristian Eggers    #include <dt-bindings/gpio/gpio.h>
125f8f79fa6SChristian Eggers    spi0 {
126f8f79fa6SChristian Eggers        #address-cells = <1>;
127f8f79fa6SChristian Eggers        #size-cells = <0>;
128f8f79fa6SChristian Eggers
129f8f79fa6SChristian Eggers        eeprom@0 {
130f8f79fa6SChristian Eggers            compatible = "st,m95256", "atmel,at25";
131f8f79fa6SChristian Eggers            reg = <0>;
132f8f79fa6SChristian Eggers            spi-max-frequency = <5000000>;
133f8f79fa6SChristian Eggers            spi-cpha;
134f8f79fa6SChristian Eggers            spi-cpol;
135f8f79fa6SChristian Eggers            wp-gpios = <&gpio1 3 0>;
136f8f79fa6SChristian Eggers
137f8f79fa6SChristian Eggers            pagesize = <64>;
138f8f79fa6SChristian Eggers            size = <32768>;
139f8f79fa6SChristian Eggers            address-width = <16>;
140f8f79fa6SChristian Eggers        };
141*fd307a4aSJiri Prchal
142*fd307a4aSJiri Prchal        fram@1 {
143*fd307a4aSJiri Prchal            compatible = "cypress,fm25", "atmel,at25";
144*fd307a4aSJiri Prchal            reg = <1>;
145*fd307a4aSJiri Prchal            spi-max-frequency = <40000000>;
146*fd307a4aSJiri Prchal        };
147f8f79fa6SChristian Eggers    };
148