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