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