xref: /linux/Documentation/devicetree/bindings/eeprom/at24.yaml (revision c6cadc7538bb6df746f1613ee317b646230b2f5e)
17f3bf420SBartosz Golaszewski# SPDX-License-Identifier: GPL-2.0-only
27f3bf420SBartosz Golaszewski# Copyright 2019 BayLibre SAS
37f3bf420SBartosz Golaszewski%YAML 1.2
47f3bf420SBartosz Golaszewski---
57f3bf420SBartosz Golaszewski$id: "http://devicetree.org/schemas/eeprom/at24.yaml#"
67f3bf420SBartosz Golaszewski$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
137f3bf420SBartosz Golaszewskiselect:
147f3bf420SBartosz Golaszewski  properties:
157f3bf420SBartosz Golaszewski    compatible:
167f3bf420SBartosz Golaszewski      contains:
177f3bf420SBartosz Golaszewski        pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
187f3bf420SBartosz Golaszewski  required:
197f3bf420SBartosz Golaszewski    - compatible
207f3bf420SBartosz Golaszewski
217f3bf420SBartosz Golaszewskiproperties:
227f3bf420SBartosz Golaszewski  $nodename:
237f3bf420SBartosz Golaszewski    pattern: "^eeprom@[0-9a-f]{1,2}$"
247f3bf420SBartosz Golaszewski
257f3bf420SBartosz Golaszewski  # There are multiple known vendors who manufacture EEPROM chips compatible
267f3bf420SBartosz Golaszewski  # with Atmel's AT24. The compatible string requires either a single item
277f3bf420SBartosz Golaszewski  # if the memory comes from Atmel (in which case the vendor part must be
287f3bf420SBartosz Golaszewski  # 'atmel') or two items with the same 'model' part where the vendor part of
297f3bf420SBartosz Golaszewski  # the first one is the actual manufacturer and the second item is the
307f3bf420SBartosz Golaszewski  # corresponding 'atmel,<model>' from Atmel.
317f3bf420SBartosz Golaszewski  compatible:
327f3bf420SBartosz Golaszewski    oneOf:
337f3bf420SBartosz Golaszewski      - allOf:
347f3bf420SBartosz Golaszewski          - minItems: 1
357f3bf420SBartosz Golaszewski            maxItems: 2
367f3bf420SBartosz Golaszewski            items:
377f3bf420SBartosz Golaszewski              - pattern: "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|mac)[0-9]+|spd)$"
387f3bf420SBartosz Golaszewski              - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
397f3bf420SBartosz Golaszewski          - oneOf:
407f3bf420SBartosz Golaszewski              - items:
417f3bf420SBartosz Golaszewski                  pattern: c00$
427f3bf420SBartosz Golaszewski              - items:
437f3bf420SBartosz Golaszewski                  pattern: c01$
447f3bf420SBartosz Golaszewski              - items:
457f3bf420SBartosz Golaszewski                  pattern: cs01$
467f3bf420SBartosz Golaszewski              - items:
477f3bf420SBartosz Golaszewski                  pattern: c02$
487f3bf420SBartosz Golaszewski              - items:
497f3bf420SBartosz Golaszewski                  pattern: cs02$
507f3bf420SBartosz Golaszewski              - items:
517f3bf420SBartosz Golaszewski                  pattern: mac402$
527f3bf420SBartosz Golaszewski              - items:
537f3bf420SBartosz Golaszewski                  pattern: mac602$
547f3bf420SBartosz Golaszewski              - items:
557f3bf420SBartosz Golaszewski                  pattern: c04$
567f3bf420SBartosz Golaszewski              - items:
577f3bf420SBartosz Golaszewski                  pattern: cs04$
587f3bf420SBartosz Golaszewski              - items:
597f3bf420SBartosz Golaszewski                  pattern: c08$
607f3bf420SBartosz Golaszewski              - items:
617f3bf420SBartosz Golaszewski                  pattern: cs08$
627f3bf420SBartosz Golaszewski              - items:
637f3bf420SBartosz Golaszewski                  pattern: c16$
647f3bf420SBartosz Golaszewski              - items:
657f3bf420SBartosz Golaszewski                  pattern: cs16$
667f3bf420SBartosz Golaszewski              - items:
677f3bf420SBartosz Golaszewski                  pattern: c32$
687f3bf420SBartosz Golaszewski              - items:
697f3bf420SBartosz Golaszewski                  pattern: cs32$
707f3bf420SBartosz Golaszewski              - items:
717f3bf420SBartosz Golaszewski                  pattern: c64$
727f3bf420SBartosz Golaszewski              - items:
737f3bf420SBartosz Golaszewski                  pattern: cs64$
747f3bf420SBartosz Golaszewski              - items:
757f3bf420SBartosz Golaszewski                  pattern: c128$
767f3bf420SBartosz Golaszewski              - items:
777f3bf420SBartosz Golaszewski                  pattern: cs128$
787f3bf420SBartosz Golaszewski              - items:
797f3bf420SBartosz Golaszewski                  pattern: c256$
807f3bf420SBartosz Golaszewski              - items:
817f3bf420SBartosz Golaszewski                  pattern: cs256$
827f3bf420SBartosz Golaszewski              - items:
837f3bf420SBartosz Golaszewski                  pattern: c512$
847f3bf420SBartosz Golaszewski              - items:
857f3bf420SBartosz Golaszewski                  pattern: cs512$
867f3bf420SBartosz Golaszewski              - items:
877f3bf420SBartosz Golaszewski                  pattern: c1024$
887f3bf420SBartosz Golaszewski              - items:
897f3bf420SBartosz Golaszewski                  pattern: cs1024$
907f3bf420SBartosz Golaszewski              - items:
917f3bf420SBartosz Golaszewski                  pattern: c2048$
927f3bf420SBartosz Golaszewski              - items:
937f3bf420SBartosz Golaszewski                  pattern: cs2048$
947f3bf420SBartosz Golaszewski              - items:
957f3bf420SBartosz Golaszewski                  pattern: spd$
967f3bf420SBartosz Golaszewski      # These are special cases that don't conform to the above pattern.
977f3bf420SBartosz Golaszewski      # Each requires a standard at24 model as fallback.
987f3bf420SBartosz Golaszewski      - items:
997f3bf420SBartosz Golaszewski          - const: rohm,br24t01
1007f3bf420SBartosz Golaszewski          - const: atmel,24c01
1017f3bf420SBartosz Golaszewski      - items:
1027f3bf420SBartosz Golaszewski          - const: nxp,se97b
1037f3bf420SBartosz Golaszewski          - const: atmel,24c02
1047f3bf420SBartosz Golaszewski      - items:
1057f3bf420SBartosz Golaszewski          - const: renesas,r1ex24002
1067f3bf420SBartosz Golaszewski          - const: atmel,24c02
1077f3bf420SBartosz Golaszewski      - items:
1087f3bf420SBartosz Golaszewski          - const: renesas,r1ex24016
1097f3bf420SBartosz Golaszewski          - const: atmel,24c16
1107f3bf420SBartosz Golaszewski      - items:
11161a48006SBartosz Golaszewski          - const: giantec,gt24c32a
11261a48006SBartosz Golaszewski          - const: atmel,24c32
11361a48006SBartosz Golaszewski      - items:
1147f3bf420SBartosz Golaszewski          - const: renesas,r1ex24128
1157f3bf420SBartosz Golaszewski          - const: atmel,24c128
1167f3bf420SBartosz Golaszewski
1177f3bf420SBartosz Golaszewski  reg:
1187f3bf420SBartosz Golaszewski    maxItems: 1
1197f3bf420SBartosz Golaszewski
1207f3bf420SBartosz Golaszewski  pagesize:
1217f3bf420SBartosz Golaszewski    allOf:
1227f3bf420SBartosz Golaszewski      - $ref: /schemas/types.yaml#/definitions/uint32
1237f3bf420SBartosz Golaszewski    description:
1247f3bf420SBartosz Golaszewski      The length of the pagesize for writing. Please consult the
1257f3bf420SBartosz Golaszewski      manual of your device, that value varies a lot. A wrong value
1267f3bf420SBartosz Golaszewski      may result in data loss! If not specified, a safety value of
1277f3bf420SBartosz Golaszewski      '1' is used which will be very slow.
1287f3bf420SBartosz Golaszewski    enum: [ 1, 8, 16, 32, 64, 128, 258 ]
1297f3bf420SBartosz Golaszewski    default: 1
1307f3bf420SBartosz Golaszewski
1317f3bf420SBartosz Golaszewski  read-only:
1327f3bf420SBartosz Golaszewski    $ref: /schemas/types.yaml#definitions/flag
1337f3bf420SBartosz Golaszewski    description:
1347f3bf420SBartosz Golaszewski      Disables writes to the eeprom.
1357f3bf420SBartosz Golaszewski
1367f3bf420SBartosz Golaszewski  size:
1377f3bf420SBartosz Golaszewski    $ref: /schemas/types.yaml#/definitions/uint32
1387f3bf420SBartosz Golaszewski    description:
1397f3bf420SBartosz Golaszewski      Total eeprom size in bytes.
1407f3bf420SBartosz Golaszewski
1417f3bf420SBartosz Golaszewski  no-read-rollover:
1427f3bf420SBartosz Golaszewski    $ref: /schemas/types.yaml#definitions/flag
1437f3bf420SBartosz Golaszewski    description:
1447f3bf420SBartosz Golaszewski      Indicates that the multi-address eeprom does not automatically roll
1457f3bf420SBartosz Golaszewski      over reads to the next slave address. Please consult the manual of
1467f3bf420SBartosz Golaszewski      your device.
1477f3bf420SBartosz Golaszewski
1486c57a664SKhouloud Touil  wp-gpios: true
1497f3bf420SBartosz Golaszewski
1507f3bf420SBartosz Golaszewski  address-width:
1517f3bf420SBartosz Golaszewski    allOf:
1527f3bf420SBartosz Golaszewski      - $ref: /schemas/types.yaml#/definitions/uint32
1537f3bf420SBartosz Golaszewski    description:
1547f3bf420SBartosz Golaszewski      Number of address bits.
1557f3bf420SBartosz Golaszewski    default: 8
1567f3bf420SBartosz Golaszewski    enum: [ 8, 16 ]
1577f3bf420SBartosz Golaszewski
1587f3bf420SBartosz Golaszewski  num-addresses:
1597f3bf420SBartosz Golaszewski    allOf:
1607f3bf420SBartosz Golaszewski      - $ref: /schemas/types.yaml#/definitions/uint32
1617f3bf420SBartosz Golaszewski    description:
1627f3bf420SBartosz Golaszewski      Total number of i2c slave addresses this device takes.
1637f3bf420SBartosz Golaszewski    default: 1
1647f3bf420SBartosz Golaszewski    minimum: 1
1657f3bf420SBartosz Golaszewski    maximum: 8
1667f3bf420SBartosz Golaszewski
167*c6cadc75SBibby Hsieh  vcc-supply:
168*c6cadc75SBibby Hsieh    description:
169*c6cadc75SBibby Hsieh      phandle of the regulator that provides the supply voltage.
170*c6cadc75SBibby Hsieh
1717f3bf420SBartosz Golaszewskirequired:
1727f3bf420SBartosz Golaszewski  - compatible
1737f3bf420SBartosz Golaszewski  - reg
1747f3bf420SBartosz Golaszewski
1757f3bf420SBartosz Golaszewskiexamples:
1767f3bf420SBartosz Golaszewski  - |
1777f3bf420SBartosz Golaszewski    i2c {
1787f3bf420SBartosz Golaszewski      #address-cells = <1>;
1797f3bf420SBartosz Golaszewski      #size-cells = <0>;
1807f3bf420SBartosz Golaszewski
1817f3bf420SBartosz Golaszewski      eeprom@52 {
1827f3bf420SBartosz Golaszewski          compatible = "microchip,24c32", "atmel,24c32";
1837f3bf420SBartosz Golaszewski          reg = <0x52>;
1847f3bf420SBartosz Golaszewski          pagesize = <32>;
1857f3bf420SBartosz Golaszewski          wp-gpios = <&gpio1 3 0>;
1867f3bf420SBartosz Golaszewski          num-addresses = <8>;
1877f3bf420SBartosz Golaszewski      };
1887f3bf420SBartosz Golaszewski    };
1897f3bf420SBartosz Golaszewski...
190