dt-bindings: at24: add ST M24C32-D Additional Write lockable page
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / eeprom / at24.yaml
1 # SPDX-License-Identifier: GPL-2.0-only
2 # Copyright 2019 BayLibre SAS
3 %YAML 1.2
4 ---
5 $id: http://devicetree.org/schemas/eeprom/at24.yaml#
6 $schema: http://devicetree.org/meta-schemas/core.yaml#
7
8 title: I2C EEPROMs compatible with Atmel's AT24
9
10 maintainers:
11   - Bartosz Golaszewski <bgolaszewski@baylibre.com>
12
13 allOf:
14   - $ref: /schemas/nvmem/nvmem.yaml
15
16 select:
17   properties:
18     compatible:
19       contains:
20         pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
21   required:
22     - compatible
23
24 properties:
25   $nodename:
26     pattern: "^eeprom@[0-9a-f]{1,2}$"
27
28   # There are multiple known vendors who manufacture EEPROM chips compatible
29   # with Atmel's AT24. The compatible string requires either a single item
30   # if the memory comes from Atmel (in which case the vendor part must be
31   # 'atmel') or two items with the same 'model' part where the vendor part of
32   # the first one is the actual manufacturer and the second item is the
33   # corresponding 'atmel,<model>' from Atmel.
34   compatible:
35     oneOf:
36       - allOf:
37           - minItems: 1
38             items:
39               - pattern: "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|lc|mac)[0-9]+|spd)$"
40               - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
41           - oneOf:
42               - items:
43                   pattern: c00$
44               - items:
45                   pattern: c01$
46               - items:
47                   pattern: cs01$
48               - items:
49                   pattern: c02$
50               - items:
51                   pattern: cs02$
52               - items:
53                   pattern: mac402$
54               - items:
55                   pattern: mac602$
56               - items:
57                   pattern: c04$
58               - items:
59                   pattern: cs04$
60               - items:
61                   pattern: c08$
62               - items:
63                   pattern: cs08$
64               - items:
65                   pattern: c16$
66               - items:
67                   pattern: cs16$
68               - items:
69                   pattern: c32$
70               - items:
71                   pattern: c32d-wl$
72               - items:
73                   pattern: cs32$
74               - items:
75                   pattern: c64$
76               - items:
77                   pattern: cs64$
78               - items:
79                   pattern: c128$
80               - items:
81                   pattern: cs128$
82               - items:
83                   pattern: c256$
84               - items:
85                   pattern: cs256$
86               - items:
87                   pattern: c512$
88               - items:
89                   pattern: cs512$
90               - items:
91                   pattern: c1024$
92               - items:
93                   pattern: cs1024$
94               - items:
95                   pattern: c1025$
96               - items:
97                   pattern: cs1025$
98               - items:
99                   pattern: c2048$
100               - items:
101                   pattern: cs2048$
102               - items:
103                   pattern: spd$
104       # These are special cases that don't conform to the above pattern.
105       # Each requires a standard at24 model as fallback.
106       - items:
107           - const: belling,bl24c16a
108           - const: atmel,24c16
109       - items:
110           - enum:
111               - rohm,br24g01
112               - rohm,br24t01
113           - const: atmel,24c01
114       - items:
115           - enum:
116               - nxp,se97b
117               - renesas,r1ex24002
118           - const: atmel,24c02
119       - items:
120           - enum:
121               - onnn,cat24c04
122               - onnn,cat24c05
123           - const: atmel,24c04
124       - items:
125           - const: renesas,r1ex24016
126           - const: atmel,24c16
127       - items:
128           - const: giantec,gt24c32a
129           - const: atmel,24c32
130       - items:
131           - enum:
132               - renesas,r1ex24128
133               - samsung,s524ad0xd1
134           - const: atmel,24c128
135
136   label:
137     description: Descriptive name of the EEPROM.
138
139   reg:
140     maxItems: 1
141
142   pagesize:
143     description:
144       The length of the pagesize for writing. Please consult the
145       manual of your device, that value varies a lot. A wrong value
146       may result in data loss! If not specified, a safety value of
147       '1' is used which will be very slow.
148     $ref: /schemas/types.yaml#/definitions/uint32
149     enum: [1, 8, 16, 32, 64, 128, 256]
150     default: 1
151
152   read-only:
153     $ref: /schemas/types.yaml#/definitions/flag
154     description:
155       Disables writes to the eeprom.
156
157   size:
158     $ref: /schemas/types.yaml#/definitions/uint32
159     description:
160       Total eeprom size in bytes.
161
162   no-read-rollover:
163     $ref: /schemas/types.yaml#/definitions/flag
164     description:
165       Indicates that the multi-address eeprom does not automatically roll
166       over reads to the next slave address. Please consult the manual of
167       your device.
168
169   wp-gpios: true
170
171   address-width:
172     description:
173       Number of address bits.
174     $ref: /schemas/types.yaml#/definitions/uint32
175     default: 8
176     enum: [ 8, 16 ]
177
178   num-addresses:
179     description:
180       Total number of i2c slave addresses this device takes.
181     $ref: /schemas/types.yaml#/definitions/uint32
182     default: 1
183     minimum: 1
184     maximum: 8
185
186   vcc-supply:
187     description:
188       phandle of the regulator that provides the supply voltage.
189
190 required:
191   - compatible
192   - reg
193
194 unevaluatedProperties: false
195
196 examples:
197   - |
198     i2c {
199       #address-cells = <1>;
200       #size-cells = <0>;
201
202       eeprom@52 {
203           compatible = "microchip,24c32", "atmel,24c32";
204           reg = <0x52>;
205           pagesize = <32>;
206           wp-gpios = <&gpio1 3 0>;
207           num-addresses = <8>;
208       };
209     };
210 ...