Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
0002 %YAML 1.2
0003 ---
0004 $id: "http://devicetree.org/schemas/eeprom/at25.yaml#"
0005 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
0006 
0007 title: SPI EEPROMs or FRAMs compatible with Atmel's AT25
0008 
0009 maintainers:
0010   - Christian Eggers <ceggers@arri.de>
0011 
0012 properties:
0013   $nodename:
0014     anyOf:
0015       - pattern: "^eeprom@[0-9a-f]{1,2}$"
0016       - pattern: "^fram@[0-9a-f]{1,2}$"
0017 
0018   # There are multiple known vendors who manufacture EEPROM chips compatible
0019   # with Atmel's AT25. The compatible string requires two items where the
0020   # 'vendor' and 'model' parts of the first are the actual chip and the second
0021   # item is fixed to "atmel,at25". Some existing bindings only have the
0022   # "atmel,at25" part and should be fixed by somebody who knows vendor and
0023   # product.
0024   compatible:
0025     oneOf:
0026       - items:
0027           - enum:
0028               - anvo,anv32e61w
0029               - atmel,at25256B
0030               - fujitsu,mb85rs1mt
0031               - fujitsu,mb85rs64
0032               - microchip,at25160bn
0033               - microchip,25lc040
0034               - st,m95m02
0035               - st,m95256
0036               - cypress,fm25
0037 
0038           - const: atmel,at25
0039 
0040       # Please don't use this alternative for new bindings.
0041       - items:
0042           - const: atmel,at25
0043 
0044   reg:
0045     maxItems: 1
0046 
0047   pagesize:
0048     $ref: /schemas/types.yaml#/definitions/uint32
0049     enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
0050     description:
0051       Size of the eeprom page. FRAMs don't have pages.
0052 
0053   size:
0054     $ref: /schemas/types.yaml#/definitions/uint32
0055     description:
0056       Total eeprom size in bytes.
0057 
0058   address-width:
0059     $ref: /schemas/types.yaml#/definitions/uint32
0060     enum: [ 8, 9, 16, 24 ]
0061     description:
0062       Number of address bits.
0063       For 9 bits, the MSB of the address is sent as bit 3 of the instruction
0064       byte, before the address byte.
0065 
0066   spi-cpha: true
0067 
0068   spi-cpol: true
0069 
0070   read-only:
0071     description:
0072       Disable writes to the eeprom.
0073     type: boolean
0074 
0075   wp-gpios:
0076     maxItems: 1
0077     description:
0078       GPIO to which the write-protect pin of the chip is connected.
0079 
0080   # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
0081   at25,byte-len:
0082     $ref: /schemas/types.yaml#/definitions/uint32
0083     description:
0084       Total eeprom size in bytes. Deprecated, use "size" property instead.
0085     deprecated: true
0086 
0087   at25,addr-mode:
0088     $ref: /schemas/types.yaml#/definitions/uint32
0089     description:
0090       Addr-mode flags, as defined in include/linux/spi/eeprom.h.
0091       Deprecated, use "address-width" property instead.
0092     deprecated: true
0093 
0094   at25,page-size:
0095     $ref: /schemas/types.yaml#/definitions/uint32
0096     description:
0097       Size of the eeprom page. Deprecated, use "pagesize" property instead.
0098     deprecated: true
0099 
0100 required:
0101   - compatible
0102   - reg
0103   - spi-max-frequency
0104 
0105 allOf:
0106   - $ref: /schemas/spi/spi-peripheral-props.yaml#
0107   - if:
0108       properties:
0109         compatible:
0110           not:
0111             contains:
0112               const: cypress,fm25
0113     then:
0114       required:
0115         - pagesize
0116         - size
0117         - address-width
0118 
0119 unevaluatedProperties: false
0120 
0121 examples:
0122   - |
0123     #include <dt-bindings/gpio/gpio.h>
0124     spi0 {
0125         #address-cells = <1>;
0126         #size-cells = <0>;
0127 
0128         eeprom@0 {
0129             compatible = "st,m95256", "atmel,at25";
0130             reg = <0>;
0131             spi-max-frequency = <5000000>;
0132             spi-cpha;
0133             spi-cpol;
0134             wp-gpios = <&gpio1 3 0>;
0135 
0136             pagesize = <64>;
0137             size = <32768>;
0138             address-width = <16>;
0139         };
0140 
0141         fram@1 {
0142             compatible = "cypress,fm25", "atmel,at25";
0143             reg = <1>;
0144             spi-max-frequency = <40000000>;
0145         };
0146     };