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