0001 # SPDX-License-Identifier: GPL-2.0-only
0002 # Copyright 2019 BayLibre SAS
0003 %YAML 1.2
0004 ---
0005 $id: "http://devicetree.org/schemas/eeprom/at24.yaml#"
0006 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
0007
0008 title: I2C EEPROMs compatible with Atmel's AT24
0009
0010 maintainers:
0011 - Bartosz Golaszewski <bgolaszewski@baylibre.com>
0012
0013 select:
0014 properties:
0015 compatible:
0016 contains:
0017 pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
0018 required:
0019 - compatible
0020
0021 properties:
0022 $nodename:
0023 pattern: "^eeprom@[0-9a-f]{1,2}$"
0024
0025 # There are multiple known vendors who manufacture EEPROM chips compatible
0026 # with Atmel's AT24. The compatible string requires either a single item
0027 # if the memory comes from Atmel (in which case the vendor part must be
0028 # 'atmel') or two items with the same 'model' part where the vendor part of
0029 # the first one is the actual manufacturer and the second item is the
0030 # corresponding 'atmel,<model>' from Atmel.
0031 compatible:
0032 oneOf:
0033 - allOf:
0034 - minItems: 1
0035 items:
0036 - pattern: "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|lc|mac)[0-9]+|spd)$"
0037 - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
0038 - oneOf:
0039 - items:
0040 pattern: c00$
0041 - items:
0042 pattern: c01$
0043 - items:
0044 pattern: cs01$
0045 - items:
0046 pattern: c02$
0047 - items:
0048 pattern: cs02$
0049 - items:
0050 pattern: mac402$
0051 - items:
0052 pattern: mac602$
0053 - items:
0054 pattern: c04$
0055 - items:
0056 pattern: cs04$
0057 - items:
0058 pattern: c08$
0059 - items:
0060 pattern: cs08$
0061 - items:
0062 pattern: c16$
0063 - items:
0064 pattern: cs16$
0065 - items:
0066 pattern: c32$
0067 - items:
0068 pattern: cs32$
0069 - items:
0070 pattern: c64$
0071 - items:
0072 pattern: cs64$
0073 - items:
0074 pattern: c128$
0075 - items:
0076 pattern: cs128$
0077 - items:
0078 pattern: c256$
0079 - items:
0080 pattern: cs256$
0081 - items:
0082 pattern: c512$
0083 - items:
0084 pattern: cs512$
0085 - items:
0086 pattern: c1024$
0087 - items:
0088 pattern: cs1024$
0089 - items:
0090 pattern: c1025$
0091 - items:
0092 pattern: cs1025$
0093 - items:
0094 pattern: c2048$
0095 - items:
0096 pattern: cs2048$
0097 - items:
0098 pattern: spd$
0099 # These are special cases that don't conform to the above pattern.
0100 # Each requires a standard at24 model as fallback.
0101 - items:
0102 - enum:
0103 - rohm,br24g01
0104 - rohm,br24t01
0105 - const: atmel,24c01
0106 - items:
0107 - enum:
0108 - nxp,se97b
0109 - renesas,r1ex24002
0110 - const: atmel,24c02
0111 - items:
0112 - enum:
0113 - onnn,cat24c04
0114 - onnn,cat24c05
0115 - const: atmel,24c04
0116 - items:
0117 - const: renesas,r1ex24016
0118 - const: atmel,24c16
0119 - items:
0120 - const: giantec,gt24c32a
0121 - const: atmel,24c32
0122 - items:
0123 - enum:
0124 - renesas,r1ex24128
0125 - samsung,s524ad0xd1
0126 - const: atmel,24c128
0127
0128 label:
0129 description: Descriptive name of the EEPROM.
0130
0131 reg:
0132 maxItems: 1
0133
0134 pagesize:
0135 description:
0136 The length of the pagesize for writing. Please consult the
0137 manual of your device, that value varies a lot. A wrong value
0138 may result in data loss! If not specified, a safety value of
0139 '1' is used which will be very slow.
0140 $ref: /schemas/types.yaml#/definitions/uint32
0141 enum: [1, 8, 16, 32, 64, 128, 256]
0142 default: 1
0143
0144 read-only:
0145 $ref: /schemas/types.yaml#/definitions/flag
0146 description:
0147 Disables writes to the eeprom.
0148
0149 size:
0150 $ref: /schemas/types.yaml#/definitions/uint32
0151 description:
0152 Total eeprom size in bytes.
0153
0154 no-read-rollover:
0155 $ref: /schemas/types.yaml#/definitions/flag
0156 description:
0157 Indicates that the multi-address eeprom does not automatically roll
0158 over reads to the next slave address. Please consult the manual of
0159 your device.
0160
0161 wp-gpios: true
0162
0163 address-width:
0164 description:
0165 Number of address bits.
0166 $ref: /schemas/types.yaml#/definitions/uint32
0167 default: 8
0168 enum: [ 8, 16 ]
0169
0170 num-addresses:
0171 description:
0172 Total number of i2c slave addresses this device takes.
0173 $ref: /schemas/types.yaml#/definitions/uint32
0174 default: 1
0175 minimum: 1
0176 maximum: 8
0177
0178 vcc-supply:
0179 description:
0180 phandle of the regulator that provides the supply voltage.
0181
0182 required:
0183 - compatible
0184 - reg
0185
0186 additionalProperties: false
0187
0188 examples:
0189 - |
0190 i2c {
0191 #address-cells = <1>;
0192 #size-cells = <0>;
0193
0194 eeprom@52 {
0195 compatible = "microchip,24c32", "atmel,24c32";
0196 reg = <0x52>;
0197 pagesize = <32>;
0198 wp-gpios = <&gpio1 3 0>;
0199 num-addresses = <8>;
0200 };
0201 };
0202 ...