xref: /linux/Documentation/devicetree/bindings/eeprom/at24.yaml (revision 4569820881c6eb0e273d7f584ee511b825b98601)
17f3bf420SBartosz Golaszewski# SPDX-License-Identifier: GPL-2.0-only
27f3bf420SBartosz Golaszewski# Copyright 2019 BayLibre SAS
37f3bf420SBartosz Golaszewski%YAML 1.2
47f3bf420SBartosz Golaszewski---
5*45698208SRob Herring$id: http://devicetree.org/schemas/eeprom/at24.yaml#
6*45698208SRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
77f3bf420SBartosz Golaszewski
87f3bf420SBartosz Golaszewskititle: I2C EEPROMs compatible with Atmel's AT24
97f3bf420SBartosz Golaszewski
107f3bf420SBartosz Golaszewskimaintainers:
117f3bf420SBartosz Golaszewski  - Bartosz Golaszewski <bgolaszewski@baylibre.com>
127f3bf420SBartosz Golaszewski
13ca104926SMiquel RaynalallOf:
14ca104926SMiquel Raynal  - $ref: /schemas/nvmem/nvmem.yaml
15ca104926SMiquel Raynal
167f3bf420SBartosz Golaszewskiselect:
177f3bf420SBartosz Golaszewski  properties:
187f3bf420SBartosz Golaszewski    compatible:
197f3bf420SBartosz Golaszewski      contains:
207f3bf420SBartosz Golaszewski        pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
217f3bf420SBartosz Golaszewski  required:
227f3bf420SBartosz Golaszewski    - compatible
237f3bf420SBartosz Golaszewski
247f3bf420SBartosz Golaszewskiproperties:
257f3bf420SBartosz Golaszewski  $nodename:
267f3bf420SBartosz Golaszewski    pattern: "^eeprom@[0-9a-f]{1,2}$"
277f3bf420SBartosz Golaszewski
287f3bf420SBartosz Golaszewski  # There are multiple known vendors who manufacture EEPROM chips compatible
297f3bf420SBartosz Golaszewski  # with Atmel's AT24. The compatible string requires either a single item
307f3bf420SBartosz Golaszewski  # if the memory comes from Atmel (in which case the vendor part must be
317f3bf420SBartosz Golaszewski  # 'atmel') or two items with the same 'model' part where the vendor part of
327f3bf420SBartosz Golaszewski  # the first one is the actual manufacturer and the second item is the
337f3bf420SBartosz Golaszewski  # corresponding 'atmel,<model>' from Atmel.
347f3bf420SBartosz Golaszewski  compatible:
357f3bf420SBartosz Golaszewski    oneOf:
367f3bf420SBartosz Golaszewski      - allOf:
377f3bf420SBartosz Golaszewski          - minItems: 1
387f3bf420SBartosz Golaszewski            items:
39410dcdc2SMasahiro Yamada              - pattern: "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|lc|mac)[0-9]+|spd)$"
407f3bf420SBartosz Golaszewski              - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
417f3bf420SBartosz Golaszewski          - oneOf:
427f3bf420SBartosz Golaszewski              - items:
437f3bf420SBartosz Golaszewski                  pattern: c00$
447f3bf420SBartosz Golaszewski              - items:
457f3bf420SBartosz Golaszewski                  pattern: c01$
467f3bf420SBartosz Golaszewski              - items:
477f3bf420SBartosz Golaszewski                  pattern: cs01$
487f3bf420SBartosz Golaszewski              - items:
497f3bf420SBartosz Golaszewski                  pattern: c02$
507f3bf420SBartosz Golaszewski              - items:
517f3bf420SBartosz Golaszewski                  pattern: cs02$
527f3bf420SBartosz Golaszewski              - items:
537f3bf420SBartosz Golaszewski                  pattern: mac402$
547f3bf420SBartosz Golaszewski              - items:
557f3bf420SBartosz Golaszewski                  pattern: mac602$
567f3bf420SBartosz Golaszewski              - items:
577f3bf420SBartosz Golaszewski                  pattern: c04$
587f3bf420SBartosz Golaszewski              - items:
597f3bf420SBartosz Golaszewski                  pattern: cs04$
607f3bf420SBartosz Golaszewski              - items:
617f3bf420SBartosz Golaszewski                  pattern: c08$
627f3bf420SBartosz Golaszewski              - items:
637f3bf420SBartosz Golaszewski                  pattern: cs08$
647f3bf420SBartosz Golaszewski              - items:
657f3bf420SBartosz Golaszewski                  pattern: c16$
667f3bf420SBartosz Golaszewski              - items:
677f3bf420SBartosz Golaszewski                  pattern: cs16$
687f3bf420SBartosz Golaszewski              - items:
697f3bf420SBartosz Golaszewski                  pattern: c32$
707f3bf420SBartosz Golaszewski              - items:
717f3bf420SBartosz Golaszewski                  pattern: cs32$
727f3bf420SBartosz Golaszewski              - items:
737f3bf420SBartosz Golaszewski                  pattern: c64$
747f3bf420SBartosz Golaszewski              - items:
757f3bf420SBartosz Golaszewski                  pattern: cs64$
767f3bf420SBartosz Golaszewski              - items:
777f3bf420SBartosz Golaszewski                  pattern: c128$
787f3bf420SBartosz Golaszewski              - items:
797f3bf420SBartosz Golaszewski                  pattern: cs128$
807f3bf420SBartosz Golaszewski              - items:
817f3bf420SBartosz Golaszewski                  pattern: c256$
827f3bf420SBartosz Golaszewski              - items:
837f3bf420SBartosz Golaszewski                  pattern: cs256$
847f3bf420SBartosz Golaszewski              - items:
857f3bf420SBartosz Golaszewski                  pattern: c512$
867f3bf420SBartosz Golaszewski              - items:
877f3bf420SBartosz Golaszewski                  pattern: cs512$
887f3bf420SBartosz Golaszewski              - items:
897f3bf420SBartosz Golaszewski                  pattern: c1024$
907f3bf420SBartosz Golaszewski              - items:
917f3bf420SBartosz Golaszewski                  pattern: cs1024$
927f3bf420SBartosz Golaszewski              - items:
93151a1523SMaxim Kochetkov                  pattern: c1025$
94151a1523SMaxim Kochetkov              - items:
95151a1523SMaxim Kochetkov                  pattern: cs1025$
96151a1523SMaxim Kochetkov              - items:
977f3bf420SBartosz Golaszewski                  pattern: c2048$
987f3bf420SBartosz Golaszewski              - items:
997f3bf420SBartosz Golaszewski                  pattern: cs2048$
1007f3bf420SBartosz Golaszewski              - items:
1017f3bf420SBartosz Golaszewski                  pattern: spd$
1027f3bf420SBartosz Golaszewski      # These are special cases that don't conform to the above pattern.
1037f3bf420SBartosz Golaszewski      # Each requires a standard at24 model as fallback.
1047f3bf420SBartosz Golaszewski      - items:
1056f89f413SGeert Uytterhoeven          - enum:
1066f89f413SGeert Uytterhoeven              - rohm,br24g01
1076f89f413SGeert Uytterhoeven              - rohm,br24t01
1086f89f413SGeert Uytterhoeven          - const: atmel,24c01
1096f89f413SGeert Uytterhoeven      - items:
1106f89f413SGeert Uytterhoeven          - enum:
1116f89f413SGeert Uytterhoeven              - nxp,se97b
1126f89f413SGeert Uytterhoeven              - renesas,r1ex24002
1137f3bf420SBartosz Golaszewski          - const: atmel,24c02
1147f3bf420SBartosz Golaszewski      - items:
1156f89f413SGeert Uytterhoeven          - enum:
1166f89f413SGeert Uytterhoeven              - onnn,cat24c04
1176f89f413SGeert Uytterhoeven              - onnn,cat24c05
11876292540SRaag Jadav          - const: atmel,24c04
11976292540SRaag Jadav      - items:
1207f3bf420SBartosz Golaszewski          - const: renesas,r1ex24016
1217f3bf420SBartosz Golaszewski          - const: atmel,24c16
1227f3bf420SBartosz Golaszewski      - items:
12361a48006SBartosz Golaszewski          - const: giantec,gt24c32a
12461a48006SBartosz Golaszewski          - const: atmel,24c32
12561a48006SBartosz Golaszewski      - items:
126dedf10f4SRob Herring          - enum:
127dedf10f4SRob Herring              - renesas,r1ex24128
128dedf10f4SRob Herring              - samsung,s524ad0xd1
1297f3bf420SBartosz Golaszewski          - const: atmel,24c128
1307f3bf420SBartosz Golaszewski
131412b7a52SJon Hunter  label:
132412b7a52SJon Hunter    description: Descriptive name of the EEPROM.
133412b7a52SJon Hunter
1347f3bf420SBartosz Golaszewski  reg:
1357f3bf420SBartosz Golaszewski    maxItems: 1
1367f3bf420SBartosz Golaszewski
1377f3bf420SBartosz Golaszewski  pagesize:
1387f3bf420SBartosz Golaszewski    description:
1397f3bf420SBartosz Golaszewski      The length of the pagesize for writing. Please consult the
1407f3bf420SBartosz Golaszewski      manual of your device, that value varies a lot. A wrong value
1417f3bf420SBartosz Golaszewski      may result in data loss! If not specified, a safety value of
1427f3bf420SBartosz Golaszewski      '1' is used which will be very slow.
1433d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
144cf4bc468SGeert Uytterhoeven    enum: [1, 8, 16, 32, 64, 128, 256]
1457f3bf420SBartosz Golaszewski    default: 1
1467f3bf420SBartosz Golaszewski
1477f3bf420SBartosz Golaszewski  read-only:
148d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
1497f3bf420SBartosz Golaszewski    description:
1507f3bf420SBartosz Golaszewski      Disables writes to the eeprom.
1517f3bf420SBartosz Golaszewski
1527f3bf420SBartosz Golaszewski  size:
1537f3bf420SBartosz Golaszewski    $ref: /schemas/types.yaml#/definitions/uint32
1547f3bf420SBartosz Golaszewski    description:
1557f3bf420SBartosz Golaszewski      Total eeprom size in bytes.
1567f3bf420SBartosz Golaszewski
1577f3bf420SBartosz Golaszewski  no-read-rollover:
158d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
1597f3bf420SBartosz Golaszewski    description:
1607f3bf420SBartosz Golaszewski      Indicates that the multi-address eeprom does not automatically roll
1617f3bf420SBartosz Golaszewski      over reads to the next slave address. Please consult the manual of
1627f3bf420SBartosz Golaszewski      your device.
1637f3bf420SBartosz Golaszewski
1646c57a664SKhouloud Touil  wp-gpios: true
1657f3bf420SBartosz Golaszewski
1667f3bf420SBartosz Golaszewski  address-width:
1677f3bf420SBartosz Golaszewski    description:
1687f3bf420SBartosz Golaszewski      Number of address bits.
1693d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1707f3bf420SBartosz Golaszewski    default: 8
1717f3bf420SBartosz Golaszewski    enum: [ 8, 16 ]
1727f3bf420SBartosz Golaszewski
1737f3bf420SBartosz Golaszewski  num-addresses:
1747f3bf420SBartosz Golaszewski    description:
1757f3bf420SBartosz Golaszewski      Total number of i2c slave addresses this device takes.
1763d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1777f3bf420SBartosz Golaszewski    default: 1
1787f3bf420SBartosz Golaszewski    minimum: 1
1797f3bf420SBartosz Golaszewski    maximum: 8
1807f3bf420SBartosz Golaszewski
181c6cadc75SBibby Hsieh  vcc-supply:
182c6cadc75SBibby Hsieh    description:
183c6cadc75SBibby Hsieh      phandle of the regulator that provides the supply voltage.
184c6cadc75SBibby Hsieh
1857f3bf420SBartosz Golaszewskirequired:
1867f3bf420SBartosz Golaszewski  - compatible
1877f3bf420SBartosz Golaszewski  - reg
1887f3bf420SBartosz Golaszewski
189ca104926SMiquel RaynalunevaluatedProperties: false
1907f464532SRob Herring
1917f3bf420SBartosz Golaszewskiexamples:
1927f3bf420SBartosz Golaszewski  - |
1937f3bf420SBartosz Golaszewski    i2c {
1947f3bf420SBartosz Golaszewski      #address-cells = <1>;
1957f3bf420SBartosz Golaszewski      #size-cells = <0>;
1967f3bf420SBartosz Golaszewski
1977f3bf420SBartosz Golaszewski      eeprom@52 {
1987f3bf420SBartosz Golaszewski          compatible = "microchip,24c32", "atmel,24c32";
1997f3bf420SBartosz Golaszewski          reg = <0x52>;
2007f3bf420SBartosz Golaszewski          pagesize = <32>;
2017f3bf420SBartosz Golaszewski          wp-gpios = <&gpio1 3 0>;
2027f3bf420SBartosz Golaszewski          num-addresses = <8>;
2037f3bf420SBartosz Golaszewski      };
2047f3bf420SBartosz Golaszewski    };
2057f3bf420SBartosz Golaszewski...
206