xref: /freebsd/sys/contrib/device-tree/Bindings/eeprom/at25.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
16be33864SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
26be33864SEmmanuel Vadot%YAML 1.2
36be33864SEmmanuel Vadot---
46be33864SEmmanuel Vadot$id: "http://devicetree.org/schemas/eeprom/at25.yaml#"
56be33864SEmmanuel 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
365956d97fSEmmanuel Vadot              - cypress,fm25
376be33864SEmmanuel Vadot
386be33864SEmmanuel Vadot          - const: atmel,at25
396be33864SEmmanuel Vadot
406be33864SEmmanuel Vadot      # Please don't use this alternative for new bindings.
416be33864SEmmanuel Vadot      - items:
426be33864SEmmanuel Vadot          - const: atmel,at25
436be33864SEmmanuel Vadot
446be33864SEmmanuel Vadot  reg:
455def4c47SEmmanuel Vadot    maxItems: 1
466be33864SEmmanuel Vadot
476be33864SEmmanuel Vadot  pagesize:
485def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
496be33864SEmmanuel Vadot    enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
506be33864SEmmanuel Vadot    description:
515956d97fSEmmanuel Vadot      Size of the eeprom page. FRAMs don't have pages.
526be33864SEmmanuel Vadot
536be33864SEmmanuel Vadot  size:
545def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
556be33864SEmmanuel Vadot    description:
566be33864SEmmanuel Vadot      Total eeprom size in bytes.
576be33864SEmmanuel Vadot
586be33864SEmmanuel Vadot  address-width:
596be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
606be33864SEmmanuel Vadot    enum: [ 8, 9, 16, 24 ]
616be33864SEmmanuel Vadot    description:
626be33864SEmmanuel Vadot      Number of address bits.
636be33864SEmmanuel Vadot      For 9 bits, the MSB of the address is sent as bit 3 of the instruction
646be33864SEmmanuel Vadot      byte, before the address byte.
656be33864SEmmanuel Vadot
666be33864SEmmanuel Vadot  spi-cpha: true
676be33864SEmmanuel Vadot
686be33864SEmmanuel Vadot  spi-cpol: true
696be33864SEmmanuel Vadot
706be33864SEmmanuel Vadot  read-only:
716be33864SEmmanuel Vadot    description:
726be33864SEmmanuel Vadot      Disable writes to the eeprom.
736be33864SEmmanuel Vadot    type: boolean
746be33864SEmmanuel Vadot
756be33864SEmmanuel Vadot  wp-gpios:
766be33864SEmmanuel Vadot    maxItems: 1
776be33864SEmmanuel Vadot    description:
786be33864SEmmanuel Vadot      GPIO to which the write-protect pin of the chip is connected.
796be33864SEmmanuel Vadot
806be33864SEmmanuel Vadot  # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
816be33864SEmmanuel Vadot  at25,byte-len:
826be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
836be33864SEmmanuel Vadot    description:
846be33864SEmmanuel Vadot      Total eeprom size in bytes. Deprecated, use "size" property instead.
856be33864SEmmanuel Vadot    deprecated: true
866be33864SEmmanuel Vadot
876be33864SEmmanuel Vadot  at25,addr-mode:
886be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
896be33864SEmmanuel Vadot    description:
906be33864SEmmanuel Vadot      Addr-mode flags, as defined in include/linux/spi/eeprom.h.
916be33864SEmmanuel Vadot      Deprecated, use "address-width" property instead.
926be33864SEmmanuel Vadot    deprecated: true
936be33864SEmmanuel Vadot
946be33864SEmmanuel Vadot  at25,page-size:
956be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
966be33864SEmmanuel Vadot    description:
976be33864SEmmanuel Vadot      Size of the eeprom page. Deprecated, use "pagesize" property instead.
986be33864SEmmanuel Vadot    deprecated: true
996be33864SEmmanuel Vadot
1006be33864SEmmanuel Vadotrequired:
1016be33864SEmmanuel Vadot  - compatible
1026be33864SEmmanuel Vadot  - reg
1036be33864SEmmanuel Vadot  - spi-max-frequency
1045956d97fSEmmanuel Vadot
1055956d97fSEmmanuel VadotallOf:
106*b97ee269SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
1075956d97fSEmmanuel Vadot  - if:
1085956d97fSEmmanuel Vadot      properties:
1095956d97fSEmmanuel Vadot        compatible:
1105956d97fSEmmanuel Vadot          not:
1115956d97fSEmmanuel Vadot            contains:
1125956d97fSEmmanuel Vadot              const: cypress,fm25
1135956d97fSEmmanuel Vadot    then:
1145956d97fSEmmanuel Vadot      required:
1156be33864SEmmanuel Vadot        - pagesize
1166be33864SEmmanuel Vadot        - size
1176be33864SEmmanuel Vadot        - address-width
1186be33864SEmmanuel Vadot
119*b97ee269SEmmanuel VadotunevaluatedProperties: false
1206be33864SEmmanuel Vadot
1216be33864SEmmanuel Vadotexamples:
1226be33864SEmmanuel Vadot  - |
1236be33864SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1246be33864SEmmanuel Vadot    spi0 {
1256be33864SEmmanuel Vadot        #address-cells = <1>;
1266be33864SEmmanuel Vadot        #size-cells = <0>;
1276be33864SEmmanuel Vadot
1286be33864SEmmanuel Vadot        eeprom@0 {
1296be33864SEmmanuel Vadot            compatible = "st,m95256", "atmel,at25";
1306be33864SEmmanuel Vadot            reg = <0>;
1316be33864SEmmanuel Vadot            spi-max-frequency = <5000000>;
1326be33864SEmmanuel Vadot            spi-cpha;
1336be33864SEmmanuel Vadot            spi-cpol;
1346be33864SEmmanuel Vadot            wp-gpios = <&gpio1 3 0>;
1356be33864SEmmanuel Vadot
1366be33864SEmmanuel Vadot            pagesize = <64>;
1376be33864SEmmanuel Vadot            size = <32768>;
1386be33864SEmmanuel Vadot            address-width = <16>;
1396be33864SEmmanuel Vadot        };
1405956d97fSEmmanuel Vadot
1415956d97fSEmmanuel Vadot        fram@1 {
1425956d97fSEmmanuel Vadot            compatible = "cypress,fm25", "atmel,at25";
1435956d97fSEmmanuel Vadot            reg = <1>;
1445956d97fSEmmanuel Vadot            spi-max-frequency = <40000000>;
1455956d97fSEmmanuel Vadot        };
1466be33864SEmmanuel Vadot    };
147