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