at24.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. # Copyright 2019 BayLibre SAS
  3. %YAML 1.2
  4. ---
  5. $id: http://devicetree.org/schemas/eeprom/at24.yaml#
  6. $schema: http://devicetree.org/meta-schemas/core.yaml#
  7. title: I2C EEPROMs compatible with Atmel's AT24
  8. maintainers:
  9. - Bartosz Golaszewski <bgolaszewski@baylibre.com>
  10. allOf:
  11. - $ref: /schemas/nvmem/nvmem.yaml
  12. - $ref: /schemas/nvmem/nvmem-deprecated-cells.yaml
  13. select:
  14. properties:
  15. compatible:
  16. contains:
  17. anyOf:
  18. - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
  19. - enum: ["microchip,24aa025e48", "microchip,24aa025e64"]
  20. required:
  21. - compatible
  22. properties:
  23. $nodename:
  24. pattern: "^eeprom@[0-9a-f]{1,2}$"
  25. # There are multiple known vendors who manufacture EEPROM chips compatible
  26. # with Atmel's AT24. The compatible string requires either a single item
  27. # if the memory comes from Atmel (in which case the vendor part must be
  28. # 'atmel') or two items with the same 'model' part where the vendor part of
  29. # the first one is the actual manufacturer and the second item is the
  30. # corresponding 'atmel,<model>' from Atmel.
  31. compatible:
  32. oneOf:
  33. - allOf:
  34. - minItems: 1
  35. items:
  36. - pattern: "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|lc|mac)[0-9]+|spd)$"
  37. - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
  38. - oneOf:
  39. - items:
  40. pattern: c00$
  41. - items:
  42. pattern: c01$
  43. - items:
  44. pattern: cs01$
  45. - items:
  46. pattern: c02$
  47. - items:
  48. pattern: cs02$
  49. - items:
  50. pattern: mac402$
  51. - items:
  52. pattern: mac602$
  53. - items:
  54. pattern: c04$
  55. - items:
  56. pattern: cs04$
  57. - items:
  58. pattern: c08$
  59. - items:
  60. pattern: cs08$
  61. - items:
  62. pattern: c16$
  63. - items:
  64. pattern: cs16$
  65. - items:
  66. pattern: c32$
  67. - items:
  68. pattern: cs32$
  69. - items:
  70. pattern: c64$
  71. - items:
  72. pattern: cs64$
  73. - items:
  74. pattern: c128$
  75. - items:
  76. pattern: cs128$
  77. - items:
  78. pattern: c256$
  79. - items:
  80. pattern: cs256$
  81. - items:
  82. pattern: c512$
  83. - items:
  84. pattern: cs512$
  85. - items:
  86. pattern: c1024$
  87. - items:
  88. pattern: cs1024$
  89. - items:
  90. pattern: c1025$
  91. - items:
  92. pattern: cs1025$
  93. - items:
  94. pattern: c2048$
  95. - items:
  96. pattern: cs2048$
  97. - items:
  98. pattern: spd$
  99. # These are special cases that don't conform to the above pattern.
  100. # Each requires a standard at24 model as fallback.
  101. - items:
  102. - enum:
  103. - rohm,br24g01
  104. - rohm,br24t01
  105. - const: atmel,24c01
  106. - items:
  107. - enum:
  108. - nxp,se97b
  109. - renesas,r1ex24002
  110. - const: atmel,24c02
  111. - items:
  112. - enum:
  113. - giantec,gt24c04a
  114. - onnn,cat24c04
  115. - onnn,cat24c05
  116. - rohm,br24g04
  117. - const: atmel,24c04
  118. - items:
  119. - enum:
  120. - belling,bl24c16a
  121. - renesas,r1ex24016
  122. - const: atmel,24c16
  123. - items:
  124. - const: giantec,gt24c32a
  125. - const: atmel,24c32
  126. - items:
  127. - const: onnn,n24s64b
  128. - const: atmel,24c64
  129. - items:
  130. - enum:
  131. - renesas,r1ex24128
  132. - samsung,s524ad0xd1
  133. - const: atmel,24c128
  134. - items:
  135. - const: microchip,24aa025e48
  136. - items:
  137. - const: microchip,24aa025e64
  138. - pattern: '^atmel,24c(32|64)d-wl$' # Actual vendor is st
  139. label:
  140. description: Descriptive name of the EEPROM.
  141. reg:
  142. maxItems: 1
  143. pagesize:
  144. description:
  145. The length of the pagesize for writing. Please consult the
  146. manual of your device, that value varies a lot. A wrong value
  147. may result in data loss! If not specified, a safety value of
  148. '1' is used which will be very slow.
  149. $ref: /schemas/types.yaml#/definitions/uint32
  150. enum: [1, 8, 16, 32, 64, 128, 256]
  151. default: 1
  152. read-only:
  153. $ref: /schemas/types.yaml#/definitions/flag
  154. description:
  155. Disables writes to the eeprom.
  156. size:
  157. $ref: /schemas/types.yaml#/definitions/uint32
  158. description:
  159. Total eeprom size in bytes.
  160. no-read-rollover:
  161. $ref: /schemas/types.yaml#/definitions/flag
  162. description:
  163. Indicates that the multi-address eeprom does not automatically roll
  164. over reads to the next slave address. Please consult the manual of
  165. your device.
  166. wp-gpios: true
  167. address-width:
  168. description:
  169. Number of address bits.
  170. $ref: /schemas/types.yaml#/definitions/uint32
  171. default: 8
  172. enum: [ 8, 16 ]
  173. num-addresses:
  174. description:
  175. Total number of i2c slave addresses this device takes.
  176. $ref: /schemas/types.yaml#/definitions/uint32
  177. default: 1
  178. minimum: 1
  179. maximum: 8
  180. vcc-supply:
  181. description:
  182. phandle of the regulator that provides the supply voltage.
  183. required:
  184. - compatible
  185. - reg
  186. unevaluatedProperties: false
  187. examples:
  188. - |
  189. i2c {
  190. #address-cells = <1>;
  191. #size-cells = <0>;
  192. eeprom@52 {
  193. compatible = "microchip,24c32", "atmel,24c32";
  194. reg = <0x52>;
  195. pagesize = <32>;
  196. wp-gpios = <&gpio1 3 0>;
  197. num-addresses = <8>;
  198. };
  199. };
  200. ...