at25.yaml 4.1 KB

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