at24.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. - belling,bl24c04a
  114. - giantec,gt24c04a
  115. - onnn,cat24c04
  116. - onnn,cat24c05
  117. - rohm,br24g04
  118. - const: atmel,24c04
  119. - items:
  120. - enum:
  121. - belling,bl24c16a
  122. - belling,bl24c16f
  123. - renesas,r1ex24016
  124. - const: atmel,24c16
  125. - items:
  126. - const: giantec,gt24c32a
  127. - const: atmel,24c32
  128. - items:
  129. - enum:
  130. - belling,bl24s64
  131. - giantec,gt24p64a
  132. - onnn,n24s64b
  133. - puya,p24c64f
  134. - const: atmel,24c64
  135. - items:
  136. - enum:
  137. - giantec,gt24p128e
  138. - giantec,gt24p128f
  139. - puya,p24c128f
  140. - renesas,r1ex24128
  141. - samsung,s524ad0xd1
  142. - const: atmel,24c128
  143. - items:
  144. - enum:
  145. - giantec,gt24c256c
  146. - puya,p24c256c
  147. - const: atmel,24c256
  148. - items:
  149. - const: microchip,24aa025e48
  150. - items:
  151. - const: microchip,24aa025e64
  152. - items:
  153. - const: st,24256e-wl
  154. - pattern: '^atmel,24c(32|64)d-wl$' # Actual vendor is st
  155. label:
  156. description: Descriptive name of the EEPROM.
  157. reg:
  158. maxItems: 1
  159. pagesize:
  160. description:
  161. The length of the pagesize for writing. Please consult the
  162. manual of your device, that value varies a lot. A wrong value
  163. may result in data loss! If not specified, a safety value of
  164. '1' is used which will be very slow.
  165. $ref: /schemas/types.yaml#/definitions/uint32
  166. enum: [1, 8, 16, 32, 64, 128, 256]
  167. default: 1
  168. read-only:
  169. $ref: /schemas/types.yaml#/definitions/flag
  170. description:
  171. Disables writes to the eeprom.
  172. size:
  173. $ref: /schemas/types.yaml#/definitions/uint32
  174. description:
  175. Total eeprom size in bytes.
  176. no-read-rollover:
  177. $ref: /schemas/types.yaml#/definitions/flag
  178. description:
  179. Indicates that the multi-address eeprom does not automatically roll
  180. over reads to the next slave address. Please consult the manual of
  181. your device.
  182. wp-gpios: true
  183. address-width:
  184. description:
  185. Number of address bits.
  186. $ref: /schemas/types.yaml#/definitions/uint32
  187. default: 8
  188. enum: [ 8, 16 ]
  189. num-addresses:
  190. description:
  191. Total number of i2c slave addresses this device takes.
  192. $ref: /schemas/types.yaml#/definitions/uint32
  193. default: 1
  194. minimum: 1
  195. maximum: 8
  196. vcc-supply:
  197. description:
  198. phandle of the regulator that provides the supply voltage.
  199. required:
  200. - compatible
  201. - reg
  202. unevaluatedProperties: false
  203. examples:
  204. - |
  205. i2c {
  206. #address-cells = <1>;
  207. #size-cells = <0>;
  208. eeprom@52 {
  209. compatible = "microchip,24c32", "atmel,24c32";
  210. reg = <0x52>;
  211. pagesize = <32>;
  212. wp-gpios = <&gpio1 3 0>;
  213. num-addresses = <8>;
  214. };
  215. };
  216. ...