1f8f79fa6SChristian Eggers# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2f8f79fa6SChristian Eggers%YAML 1.2 3f8f79fa6SChristian Eggers--- 4f8f79fa6SChristian Eggers$id: "http://devicetree.org/schemas/eeprom/at25.yaml#" 5f8f79fa6SChristian Eggers$schema: "http://devicetree.org/meta-schemas/core.yaml#" 6f8f79fa6SChristian Eggers 7fd307a4aSJiri Prchaltitle: SPI EEPROMs or FRAMs compatible with Atmel's AT25 8f8f79fa6SChristian Eggers 9f8f79fa6SChristian Eggersmaintainers: 10f8f79fa6SChristian Eggers - Christian Eggers <ceggers@arri.de> 11f8f79fa6SChristian Eggers 12f8f79fa6SChristian Eggersproperties: 13f8f79fa6SChristian Eggers $nodename: 14fd307a4aSJiri Prchal anyOf: 15fd307a4aSJiri Prchal - pattern: "^eeprom@[0-9a-f]{1,2}$" 16fd307a4aSJiri Prchal - pattern: "^fram@[0-9a-f]{1,2}$" 17f8f79fa6SChristian Eggers 18f8f79fa6SChristian Eggers # There are multiple known vendors who manufacture EEPROM chips compatible 19f8f79fa6SChristian Eggers # with Atmel's AT25. The compatible string requires two items where the 20f8f79fa6SChristian Eggers # 'vendor' and 'model' parts of the first are the actual chip and the second 21f8f79fa6SChristian Eggers # item is fixed to "atmel,at25". Some existing bindings only have the 22f8f79fa6SChristian Eggers # "atmel,at25" part and should be fixed by somebody who knows vendor and 23f8f79fa6SChristian Eggers # product. 24f8f79fa6SChristian Eggers compatible: 25f8f79fa6SChristian Eggers oneOf: 26f8f79fa6SChristian Eggers - items: 27f8f79fa6SChristian Eggers - enum: 28f8f79fa6SChristian Eggers - anvo,anv32e61w 29f8f79fa6SChristian Eggers - atmel,at25256B 30f8f79fa6SChristian Eggers - fujitsu,mb85rs1mt 31f8f79fa6SChristian Eggers - fujitsu,mb85rs64 32f8f79fa6SChristian Eggers - microchip,at25160bn 33f8f79fa6SChristian Eggers - microchip,25lc040 34f8f79fa6SChristian Eggers - st,m95m02 35f8f79fa6SChristian Eggers - st,m95256 36fd307a4aSJiri Prchal - cypress,fm25 37f8f79fa6SChristian Eggers 38f8f79fa6SChristian Eggers - const: atmel,at25 39f8f79fa6SChristian Eggers 40f8f79fa6SChristian Eggers # Please don't use this alternative for new bindings. 41f8f79fa6SChristian Eggers - items: 42f8f79fa6SChristian Eggers - const: atmel,at25 43f8f79fa6SChristian Eggers 44f8f79fa6SChristian Eggers reg: 450499220dSRob Herring maxItems: 1 46f8f79fa6SChristian Eggers 47f8f79fa6SChristian Eggers pagesize: 48d69c6dddSRob Herring $ref: /schemas/types.yaml#/definitions/uint32 49f8f79fa6SChristian Eggers enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072] 50f8f79fa6SChristian Eggers description: 51fd307a4aSJiri Prchal Size of the eeprom page. FRAMs don't have pages. 52f8f79fa6SChristian Eggers 53f8f79fa6SChristian Eggers size: 54d69c6dddSRob Herring $ref: /schemas/types.yaml#/definitions/uint32 55f8f79fa6SChristian Eggers description: 56f8f79fa6SChristian Eggers Total eeprom size in bytes. 57f8f79fa6SChristian Eggers 58f8f79fa6SChristian Eggers address-width: 59f8f79fa6SChristian Eggers $ref: /schemas/types.yaml#/definitions/uint32 60f8f79fa6SChristian Eggers enum: [ 8, 9, 16, 24 ] 61f8f79fa6SChristian Eggers description: 62f8f79fa6SChristian Eggers Number of address bits. 63f8f79fa6SChristian Eggers For 9 bits, the MSB of the address is sent as bit 3 of the instruction 64f8f79fa6SChristian Eggers byte, before the address byte. 65f8f79fa6SChristian Eggers 66f8f79fa6SChristian Eggers spi-cpha: true 67f8f79fa6SChristian Eggers 68f8f79fa6SChristian Eggers spi-cpol: true 69f8f79fa6SChristian Eggers 70f8f79fa6SChristian Eggers read-only: 71f8f79fa6SChristian Eggers description: 72f8f79fa6SChristian Eggers Disable writes to the eeprom. 73f8f79fa6SChristian Eggers type: boolean 74f8f79fa6SChristian Eggers 75f8f79fa6SChristian Eggers wp-gpios: 76f8f79fa6SChristian Eggers maxItems: 1 77f8f79fa6SChristian Eggers description: 78f8f79fa6SChristian Eggers GPIO to which the write-protect pin of the chip is connected. 79f8f79fa6SChristian Eggers 80f8f79fa6SChristian Eggers # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size 81f8f79fa6SChristian Eggers at25,byte-len: 82f8f79fa6SChristian Eggers $ref: /schemas/types.yaml#/definitions/uint32 83f8f79fa6SChristian Eggers description: 84f8f79fa6SChristian Eggers Total eeprom size in bytes. Deprecated, use "size" property instead. 85f8f79fa6SChristian Eggers deprecated: true 86f8f79fa6SChristian Eggers 87f8f79fa6SChristian Eggers at25,addr-mode: 88f8f79fa6SChristian Eggers $ref: /schemas/types.yaml#/definitions/uint32 89f8f79fa6SChristian Eggers description: 90f8f79fa6SChristian Eggers Addr-mode flags, as defined in include/linux/spi/eeprom.h. 91f8f79fa6SChristian Eggers Deprecated, use "address-width" property instead. 92f8f79fa6SChristian Eggers deprecated: true 93f8f79fa6SChristian Eggers 94f8f79fa6SChristian Eggers at25,page-size: 95f8f79fa6SChristian Eggers $ref: /schemas/types.yaml#/definitions/uint32 96f8f79fa6SChristian Eggers description: 97f8f79fa6SChristian Eggers Size of the eeprom page. Deprecated, use "pagesize" property instead. 98f8f79fa6SChristian Eggers deprecated: true 99f8f79fa6SChristian Eggers 100f8f79fa6SChristian Eggersrequired: 101f8f79fa6SChristian Eggers - compatible 102f8f79fa6SChristian Eggers - reg 103f8f79fa6SChristian Eggers - spi-max-frequency 104fd307a4aSJiri Prchal 105fd307a4aSJiri PrchalallOf: 106532b04d8SKrzysztof Kozlowski - $ref: /schemas/spi/spi-peripheral-props.yaml# 107ca104926SMiquel Raynal - $ref: /schemas/nvmem/nvmem.yaml 108fd307a4aSJiri Prchal - if: 109fd307a4aSJiri Prchal properties: 110fd307a4aSJiri Prchal compatible: 111fd307a4aSJiri Prchal not: 112fd307a4aSJiri Prchal contains: 113fd307a4aSJiri Prchal const: cypress,fm25 114fd307a4aSJiri Prchal then: 115fd307a4aSJiri Prchal required: 116f8f79fa6SChristian Eggers - pagesize 117f8f79fa6SChristian Eggers - size 118f8f79fa6SChristian Eggers - address-width 119f8f79fa6SChristian Eggers 120532b04d8SKrzysztof KozlowskiunevaluatedProperties: false 121f8f79fa6SChristian Eggers 122f8f79fa6SChristian Eggersexamples: 123f8f79fa6SChristian Eggers - | 124f8f79fa6SChristian Eggers #include <dt-bindings/gpio/gpio.h> 125*20a72af1SRob Herring spi { 126f8f79fa6SChristian Eggers #address-cells = <1>; 127f8f79fa6SChristian Eggers #size-cells = <0>; 128f8f79fa6SChristian Eggers 129f8f79fa6SChristian Eggers eeprom@0 { 130f8f79fa6SChristian Eggers compatible = "st,m95256", "atmel,at25"; 131f8f79fa6SChristian Eggers reg = <0>; 132f8f79fa6SChristian Eggers spi-max-frequency = <5000000>; 133f8f79fa6SChristian Eggers spi-cpha; 134f8f79fa6SChristian Eggers spi-cpol; 135f8f79fa6SChristian Eggers wp-gpios = <&gpio1 3 0>; 136f8f79fa6SChristian Eggers 137f8f79fa6SChristian Eggers pagesize = <64>; 138f8f79fa6SChristian Eggers size = <32768>; 139f8f79fa6SChristian Eggers address-width = <16>; 140f8f79fa6SChristian Eggers }; 141fd307a4aSJiri Prchal 142fd307a4aSJiri Prchal fram@1 { 143fd307a4aSJiri Prchal compatible = "cypress,fm25", "atmel,at25"; 144fd307a4aSJiri Prchal reg = <1>; 145fd307a4aSJiri Prchal spi-max-frequency = <40000000>; 146fd307a4aSJiri Prchal }; 147f8f79fa6SChristian Eggers }; 148