xref: /freebsd/sys/contrib/device-tree/Bindings/eeprom/at25.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
16be33864SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
26be33864SEmmanuel Vadot%YAML 1.2
36be33864SEmmanuel Vadot---
4*aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/eeprom/at25.yaml#
5*aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
66be33864SEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: SPI EEPROMs or FRAMs compatible with Atmel's AT25
86be33864SEmmanuel Vadot
96be33864SEmmanuel Vadotmaintainers:
106be33864SEmmanuel Vadot  - Christian Eggers <ceggers@arri.de>
116be33864SEmmanuel Vadot
126be33864SEmmanuel Vadotproperties:
136be33864SEmmanuel Vadot  $nodename:
145956d97fSEmmanuel Vadot    anyOf:
155956d97fSEmmanuel Vadot      - pattern: "^eeprom@[0-9a-f]{1,2}$"
165956d97fSEmmanuel Vadot      - pattern: "^fram@[0-9a-f]{1,2}$"
176be33864SEmmanuel Vadot
186be33864SEmmanuel Vadot  # There are multiple known vendors who manufacture EEPROM chips compatible
196be33864SEmmanuel Vadot  # with Atmel's AT25. The compatible string requires two items where the
206be33864SEmmanuel Vadot  # 'vendor' and 'model' parts of the first are the actual chip and the second
216be33864SEmmanuel Vadot  # item is fixed to "atmel,at25". Some existing bindings only have the
226be33864SEmmanuel Vadot  # "atmel,at25" part and should be fixed by somebody who knows vendor and
236be33864SEmmanuel Vadot  # product.
246be33864SEmmanuel Vadot  compatible:
256be33864SEmmanuel Vadot    oneOf:
266be33864SEmmanuel Vadot      - items:
276be33864SEmmanuel Vadot          - enum:
286be33864SEmmanuel Vadot              - anvo,anv32e61w
296be33864SEmmanuel Vadot              - atmel,at25256B
306be33864SEmmanuel Vadot              - fujitsu,mb85rs1mt
316be33864SEmmanuel Vadot              - fujitsu,mb85rs64
326be33864SEmmanuel Vadot              - microchip,at25160bn
336be33864SEmmanuel Vadot              - microchip,25lc040
346be33864SEmmanuel Vadot              - st,m95m02
356be33864SEmmanuel Vadot              - st,m95256
36f126890aSEmmanuel Vadot              - st,m95640
375956d97fSEmmanuel Vadot              - cypress,fm25
386be33864SEmmanuel Vadot
396be33864SEmmanuel Vadot          - const: atmel,at25
406be33864SEmmanuel Vadot
416be33864SEmmanuel Vadot      # Please don't use this alternative for new bindings.
426be33864SEmmanuel Vadot      - items:
436be33864SEmmanuel Vadot          - const: atmel,at25
446be33864SEmmanuel Vadot
456be33864SEmmanuel Vadot  reg:
465def4c47SEmmanuel Vadot    maxItems: 1
476be33864SEmmanuel Vadot
486be33864SEmmanuel Vadot  pagesize:
495def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
506be33864SEmmanuel Vadot    enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
516be33864SEmmanuel Vadot    description:
525956d97fSEmmanuel Vadot      Size of the eeprom page. FRAMs don't have pages.
536be33864SEmmanuel Vadot
546be33864SEmmanuel Vadot  size:
555def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
566be33864SEmmanuel Vadot    description:
576be33864SEmmanuel Vadot      Total eeprom size in bytes.
586be33864SEmmanuel Vadot
596be33864SEmmanuel Vadot  address-width:
606be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
616be33864SEmmanuel Vadot    enum: [ 8, 9, 16, 24 ]
626be33864SEmmanuel Vadot    description:
636be33864SEmmanuel Vadot      Number of address bits.
646be33864SEmmanuel Vadot      For 9 bits, the MSB of the address is sent as bit 3 of the instruction
656be33864SEmmanuel Vadot      byte, before the address byte.
666be33864SEmmanuel Vadot
676be33864SEmmanuel Vadot  spi-cpha: true
686be33864SEmmanuel Vadot
696be33864SEmmanuel Vadot  spi-cpol: true
706be33864SEmmanuel Vadot
716be33864SEmmanuel Vadot  read-only:
726be33864SEmmanuel Vadot    description:
736be33864SEmmanuel Vadot      Disable writes to the eeprom.
746be33864SEmmanuel Vadot    type: boolean
756be33864SEmmanuel Vadot
766be33864SEmmanuel Vadot  wp-gpios:
776be33864SEmmanuel Vadot    maxItems: 1
786be33864SEmmanuel Vadot    description:
796be33864SEmmanuel Vadot      GPIO to which the write-protect pin of the chip is connected.
806be33864SEmmanuel Vadot
816be33864SEmmanuel Vadot  # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
826be33864SEmmanuel Vadot  at25,byte-len:
836be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
846be33864SEmmanuel Vadot    description:
856be33864SEmmanuel Vadot      Total eeprom size in bytes. Deprecated, use "size" property instead.
866be33864SEmmanuel Vadot    deprecated: true
876be33864SEmmanuel Vadot
886be33864SEmmanuel Vadot  at25,addr-mode:
896be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
906be33864SEmmanuel Vadot    description:
916be33864SEmmanuel Vadot      Addr-mode flags, as defined in include/linux/spi/eeprom.h.
926be33864SEmmanuel Vadot      Deprecated, use "address-width" property instead.
936be33864SEmmanuel Vadot    deprecated: true
946be33864SEmmanuel Vadot
956be33864SEmmanuel Vadot  at25,page-size:
966be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
976be33864SEmmanuel Vadot    description:
986be33864SEmmanuel Vadot      Size of the eeprom page. Deprecated, use "pagesize" property instead.
996be33864SEmmanuel Vadot    deprecated: true
1006be33864SEmmanuel Vadot
1016be33864SEmmanuel Vadotrequired:
1026be33864SEmmanuel Vadot  - compatible
1036be33864SEmmanuel Vadot  - reg
1046be33864SEmmanuel Vadot  - spi-max-frequency
1055956d97fSEmmanuel Vadot
1065956d97fSEmmanuel VadotallOf:
107b97ee269SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
1088bab661aSEmmanuel Vadot  - $ref: /schemas/nvmem/nvmem.yaml
1095956d97fSEmmanuel Vadot  - if:
1105956d97fSEmmanuel Vadot      properties:
1115956d97fSEmmanuel Vadot        compatible:
1125956d97fSEmmanuel Vadot          not:
1135956d97fSEmmanuel Vadot            contains:
1145956d97fSEmmanuel Vadot              const: cypress,fm25
1155956d97fSEmmanuel Vadot    then:
1165956d97fSEmmanuel Vadot      required:
1176be33864SEmmanuel Vadot        - pagesize
1186be33864SEmmanuel Vadot        - size
1196be33864SEmmanuel Vadot        - address-width
1206be33864SEmmanuel Vadot
121b97ee269SEmmanuel VadotunevaluatedProperties: false
1226be33864SEmmanuel Vadot
1236be33864SEmmanuel Vadotexamples:
1246be33864SEmmanuel Vadot  - |
1256be33864SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
126fac71e4eSEmmanuel Vadot    spi {
1276be33864SEmmanuel Vadot        #address-cells = <1>;
1286be33864SEmmanuel Vadot        #size-cells = <0>;
1296be33864SEmmanuel Vadot
1306be33864SEmmanuel Vadot        eeprom@0 {
1316be33864SEmmanuel Vadot            compatible = "st,m95256", "atmel,at25";
1326be33864SEmmanuel Vadot            reg = <0>;
1336be33864SEmmanuel Vadot            spi-max-frequency = <5000000>;
1346be33864SEmmanuel Vadot            spi-cpha;
1356be33864SEmmanuel Vadot            spi-cpol;
1366be33864SEmmanuel Vadot            wp-gpios = <&gpio1 3 0>;
1376be33864SEmmanuel Vadot
1386be33864SEmmanuel Vadot            pagesize = <64>;
1396be33864SEmmanuel Vadot            size = <32768>;
1406be33864SEmmanuel Vadot            address-width = <16>;
1416be33864SEmmanuel Vadot        };
1425956d97fSEmmanuel Vadot
1435956d97fSEmmanuel Vadot        fram@1 {
1445956d97fSEmmanuel Vadot            compatible = "cypress,fm25", "atmel,at25";
1455956d97fSEmmanuel Vadot            reg = <1>;
1465956d97fSEmmanuel Vadot            spi-max-frequency = <40000000>;
1475956d97fSEmmanuel Vadot        };
1486be33864SEmmanuel Vadot    };
149