xref: /freebsd/sys/contrib/device-tree/Bindings/eeprom/at25.yaml (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1*6be33864SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*6be33864SEmmanuel Vadot%YAML 1.2
3*6be33864SEmmanuel Vadot---
4*6be33864SEmmanuel Vadot$id: "http://devicetree.org/schemas/eeprom/at25.yaml#"
5*6be33864SEmmanuel Vadot$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6*6be33864SEmmanuel Vadot
7*6be33864SEmmanuel Vadottitle: SPI EEPROMs compatible with Atmel's AT25
8*6be33864SEmmanuel Vadot
9*6be33864SEmmanuel Vadotmaintainers:
10*6be33864SEmmanuel Vadot  - Christian Eggers <ceggers@arri.de>
11*6be33864SEmmanuel Vadot
12*6be33864SEmmanuel Vadotproperties:
13*6be33864SEmmanuel Vadot  $nodename:
14*6be33864SEmmanuel Vadot    pattern: "^eeprom@[0-9a-f]{1,2}$"
15*6be33864SEmmanuel Vadot
16*6be33864SEmmanuel Vadot  # There are multiple known vendors who manufacture EEPROM chips compatible
17*6be33864SEmmanuel Vadot  # with Atmel's AT25. The compatible string requires two items where the
18*6be33864SEmmanuel Vadot  # 'vendor' and 'model' parts of the first are the actual chip and the second
19*6be33864SEmmanuel Vadot  # item is fixed to "atmel,at25". Some existing bindings only have the
20*6be33864SEmmanuel Vadot  # "atmel,at25" part and should be fixed by somebody who knows vendor and
21*6be33864SEmmanuel Vadot  # product.
22*6be33864SEmmanuel Vadot  compatible:
23*6be33864SEmmanuel Vadot    oneOf:
24*6be33864SEmmanuel Vadot      - items:
25*6be33864SEmmanuel Vadot          - enum:
26*6be33864SEmmanuel Vadot              - anvo,anv32e61w
27*6be33864SEmmanuel Vadot              - atmel,at25256B
28*6be33864SEmmanuel Vadot              - fujitsu,mb85rs1mt
29*6be33864SEmmanuel Vadot              - fujitsu,mb85rs64
30*6be33864SEmmanuel Vadot              - microchip,at25160bn
31*6be33864SEmmanuel Vadot              - microchip,25lc040
32*6be33864SEmmanuel Vadot              - st,m95m02
33*6be33864SEmmanuel Vadot              - st,m95256
34*6be33864SEmmanuel Vadot
35*6be33864SEmmanuel Vadot          - const: atmel,at25
36*6be33864SEmmanuel Vadot
37*6be33864SEmmanuel Vadot      # Please don't use this alternative for new bindings.
38*6be33864SEmmanuel Vadot      - items:
39*6be33864SEmmanuel Vadot          - const: atmel,at25
40*6be33864SEmmanuel Vadot
41*6be33864SEmmanuel Vadot  reg:
42*6be33864SEmmanuel Vadot    description:
43*6be33864SEmmanuel Vadot      Chip select number.
44*6be33864SEmmanuel Vadot
45*6be33864SEmmanuel Vadot  spi-max-frequency: true
46*6be33864SEmmanuel Vadot
47*6be33864SEmmanuel Vadot  pagesize:
48*6be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#definitions/uint32
49*6be33864SEmmanuel Vadot    enum: [1, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]
50*6be33864SEmmanuel Vadot    description:
51*6be33864SEmmanuel Vadot      Size of the eeprom page.
52*6be33864SEmmanuel Vadot
53*6be33864SEmmanuel Vadot  size:
54*6be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#definitions/uint32
55*6be33864SEmmanuel Vadot    description:
56*6be33864SEmmanuel Vadot      Total eeprom size in bytes.
57*6be33864SEmmanuel Vadot
58*6be33864SEmmanuel Vadot  address-width:
59*6be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
60*6be33864SEmmanuel Vadot    enum: [ 8, 9, 16, 24 ]
61*6be33864SEmmanuel Vadot    description:
62*6be33864SEmmanuel Vadot      Number of address bits.
63*6be33864SEmmanuel Vadot      For 9 bits, the MSB of the address is sent as bit 3 of the instruction
64*6be33864SEmmanuel Vadot      byte, before the address byte.
65*6be33864SEmmanuel Vadot
66*6be33864SEmmanuel Vadot  spi-cpha: true
67*6be33864SEmmanuel Vadot
68*6be33864SEmmanuel Vadot  spi-cpol: true
69*6be33864SEmmanuel Vadot
70*6be33864SEmmanuel Vadot  read-only:
71*6be33864SEmmanuel Vadot    description:
72*6be33864SEmmanuel Vadot      Disable writes to the eeprom.
73*6be33864SEmmanuel Vadot    type: boolean
74*6be33864SEmmanuel Vadot
75*6be33864SEmmanuel Vadot  wp-gpios:
76*6be33864SEmmanuel Vadot    maxItems: 1
77*6be33864SEmmanuel Vadot    description:
78*6be33864SEmmanuel Vadot      GPIO to which the write-protect pin of the chip is connected.
79*6be33864SEmmanuel Vadot
80*6be33864SEmmanuel Vadot  # Deprecated: at25,byte-len, at25,addr-mode, at25,page-size
81*6be33864SEmmanuel Vadot  at25,byte-len:
82*6be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
83*6be33864SEmmanuel Vadot    description:
84*6be33864SEmmanuel Vadot      Total eeprom size in bytes. Deprecated, use "size" property instead.
85*6be33864SEmmanuel Vadot    deprecated: true
86*6be33864SEmmanuel Vadot
87*6be33864SEmmanuel Vadot  at25,addr-mode:
88*6be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
89*6be33864SEmmanuel Vadot    description:
90*6be33864SEmmanuel Vadot      Addr-mode flags, as defined in include/linux/spi/eeprom.h.
91*6be33864SEmmanuel Vadot      Deprecated, use "address-width" property instead.
92*6be33864SEmmanuel Vadot    deprecated: true
93*6be33864SEmmanuel Vadot
94*6be33864SEmmanuel Vadot  at25,page-size:
95*6be33864SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
96*6be33864SEmmanuel Vadot    description:
97*6be33864SEmmanuel Vadot      Size of the eeprom page. Deprecated, use "pagesize" property instead.
98*6be33864SEmmanuel Vadot    deprecated: true
99*6be33864SEmmanuel Vadot
100*6be33864SEmmanuel Vadotrequired:
101*6be33864SEmmanuel Vadot  - compatible
102*6be33864SEmmanuel Vadot  - reg
103*6be33864SEmmanuel Vadot  - spi-max-frequency
104*6be33864SEmmanuel Vadot  - pagesize
105*6be33864SEmmanuel Vadot  - size
106*6be33864SEmmanuel Vadot  - address-width
107*6be33864SEmmanuel Vadot
108*6be33864SEmmanuel VadotadditionalProperties: false
109*6be33864SEmmanuel Vadot
110*6be33864SEmmanuel Vadotexamples:
111*6be33864SEmmanuel Vadot  - |
112*6be33864SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
113*6be33864SEmmanuel Vadot    spi0 {
114*6be33864SEmmanuel Vadot        #address-cells = <1>;
115*6be33864SEmmanuel Vadot        #size-cells = <0>;
116*6be33864SEmmanuel Vadot
117*6be33864SEmmanuel Vadot        eeprom@0 {
118*6be33864SEmmanuel Vadot            compatible = "st,m95256", "atmel,at25";
119*6be33864SEmmanuel Vadot            reg = <0>;
120*6be33864SEmmanuel Vadot            spi-max-frequency = <5000000>;
121*6be33864SEmmanuel Vadot            spi-cpha;
122*6be33864SEmmanuel Vadot            spi-cpol;
123*6be33864SEmmanuel Vadot            wp-gpios = <&gpio1 3 0>;
124*6be33864SEmmanuel Vadot
125*6be33864SEmmanuel Vadot            pagesize = <64>;
126*6be33864SEmmanuel Vadot            size = <32768>;
127*6be33864SEmmanuel Vadot            address-width = <16>;
128*6be33864SEmmanuel Vadot        };
129*6be33864SEmmanuel Vadot    };
130