1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/eeprom/at25.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: SPI EEPROMs compatible with Atmel's AT25
8
9maintainers:
10  - Christian Eggers <ceggers@arri.de>
11
12properties:
13  $nodename:
14    pattern: "^eeprom@[0-9a-f]{1,2}$"
15
16  # There are multiple known vendors who manufacture EEPROM chips compatible
17  # with Atmel's AT25. The compatible string requires two items where the
18  # 'vendor' and 'model' parts of the first are the actual chip and the second
19  # item is fixed to "atmel,at25". Some existing bindings only have the
20  # "atmel,at25" part and should be fixed by somebody who knows vendor and
21  # product.
22  compatible:
23    oneOf:
24      - items:
25          - enum:
26              - anvo,anv32e61w
27              - atmel,at25256B
28              - fujitsu,mb85rs1mt
29              - fujitsu,mb85rs64
30              - microchip,at25160bn
31              - microchip,25lc040
32              - st,m95m02
33              - st,m95256
34
35          - const: atmel,at25
36
37      # Please don't use this alternative for new bindings.
38      - items:
39          - const: atmel,at25
40
41  reg:
42    maxItems: 1
43
44  spi-max-frequency: true
45
46  pagesize:
47    $ref: /schemas/types.yaml#/definitions/uint32
48    enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
49    description:
50      Size of the eeprom page.
51
52  size:
53    $ref: /schemas/types.yaml#/definitions/uint32
54    description:
55      Total eeprom size in bytes.
56
57  address-width:
58    $ref: /schemas/types.yaml#/definitions/uint32
59    enum: [ 8, 9, 16, 24 ]
60    description:
61      Number of address bits.
62      For 9 bits, the MSB of the address is sent as bit 3 of the instruction
63      byte, before the address byte.
64
65  spi-cpha: true
66
67  spi-cpol: true
68
69  read-only:
70    description:
71      Disable writes to the eeprom.
72    type: boolean
73
74  wp-gpios:
75    maxItems: 1
76    description:
77      GPIO to which the write-protect pin of the chip is connected.
78
79  # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
80  at25,byte-len:
81    $ref: /schemas/types.yaml#/definitions/uint32
82    description:
83      Total eeprom size in bytes. Deprecated, use "size" property instead.
84    deprecated: true
85
86  at25,addr-mode:
87    $ref: /schemas/types.yaml#/definitions/uint32
88    description:
89      Addr-mode flags, as defined in include/linux/spi/eeprom.h.
90      Deprecated, use "address-width" property instead.
91    deprecated: true
92
93  at25,page-size:
94    $ref: /schemas/types.yaml#/definitions/uint32
95    description:
96      Size of the eeprom page. Deprecated, use "pagesize" property instead.
97    deprecated: true
98
99required:
100  - compatible
101  - reg
102  - spi-max-frequency
103  - pagesize
104  - size
105  - address-width
106
107additionalProperties: false
108
109examples:
110  - |
111    #include <dt-bindings/gpio/gpio.h>
112    spi0 {
113        #address-cells = <1>;
114        #size-cells = <0>;
115
116        eeprom@0 {
117            compatible = "st,m95256", "atmel,at25";
118            reg = <0>;
119            spi-max-frequency = <5000000>;
120            spi-cpha;
121            spi-cpol;
122            wp-gpios = <&gpio1 3 0>;
123
124            pagesize = <64>;
125            size = <32768>;
126            address-width = <16>;
127        };
128    };
129