xref: /freebsd/sys/contrib/device-tree/Bindings/eeprom/at24.yaml (revision dd41de95a84d979615a2ef11df6850622bf6184e)
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
13select:
14  properties:
15    compatible:
16      contains:
17        pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
18  required:
19    - compatible
20
21properties:
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: rohm,br24t01
100          - const: atmel,24c01
101      - items:
102          - const: nxp,se97b
103          - const: atmel,24c02
104      - items:
105          - const: renesas,r1ex24002
106          - const: atmel,24c02
107      - items:
108          - const: renesas,r1ex24016
109          - const: atmel,24c16
110      - items:
111          - const: giantec,gt24c32a
112          - const: atmel,24c32
113      - items:
114          - const: renesas,r1ex24128
115          - const: atmel,24c128
116
117  label:
118    description: Descriptive name of the EEPROM.
119
120  reg:
121    maxItems: 1
122
123  pagesize:
124    description:
125      The length of the pagesize for writing. Please consult the
126      manual of your device, that value varies a lot. A wrong value
127      may result in data loss! If not specified, a safety value of
128      '1' is used which will be very slow.
129    $ref: /schemas/types.yaml#/definitions/uint32
130    enum: [1, 8, 16, 32, 64, 128, 256]
131    default: 1
132
133  read-only:
134    $ref: /schemas/types.yaml#definitions/flag
135    description:
136      Disables writes to the eeprom.
137
138  size:
139    $ref: /schemas/types.yaml#/definitions/uint32
140    description:
141      Total eeprom size in bytes.
142
143  no-read-rollover:
144    $ref: /schemas/types.yaml#definitions/flag
145    description:
146      Indicates that the multi-address eeprom does not automatically roll
147      over reads to the next slave address. Please consult the manual of
148      your device.
149
150  wp-gpios: true
151
152  address-width:
153    description:
154      Number of address bits.
155    $ref: /schemas/types.yaml#/definitions/uint32
156    default: 8
157    enum: [ 8, 16 ]
158
159  num-addresses:
160    description:
161      Total number of i2c slave addresses this device takes.
162    $ref: /schemas/types.yaml#/definitions/uint32
163    default: 1
164    minimum: 1
165    maximum: 8
166
167  vcc-supply:
168    description:
169      phandle of the regulator that provides the supply voltage.
170
171required:
172  - compatible
173  - reg
174
175additionalProperties: false
176
177examples:
178  - |
179    i2c {
180      #address-cells = <1>;
181      #size-cells = <0>;
182
183      eeprom@52 {
184          compatible = "microchip,24c32", "atmel,24c32";
185          reg = <0x52>;
186          pagesize = <32>;
187          wp-gpios = <&gpio1 3 0>;
188          num-addresses = <8>;
189      };
190    };
191...
192