[PATCH v2 1/2] dt-bindings: i2c: Add the slave EEPROM backend
From: Arun Iyengar via B4 Relay
Date: Thu Nov 19 2026 - 23:32:33 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
A node with one of the i2c-slave-eeprom names as compatible and
I2C_OWN_SLAVE_ADDRESS in reg already binds to the backend, because the
I2C core names the client after the compatible and matches the I2C id.
The driver also reads firmware-name. None of this is documented.
Document the names without a vendor prefix, as the driver and
Documentation/i2c spell them (ipmb-dev and mctp-i2c-controller are
unprefixed too).
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
.../devicetree/bindings/i2c/slave-eeprom.yaml | 59 ++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/Documentation/devicetree/bindings/i2c/slave-eeprom.yaml b/Documentation/devicetree/bindings/i2c/slave-eeprom.yaml
new file mode 100644
index 000000000000..b7a6e6653a64
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/slave-eeprom.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/slave-eeprom.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: I2C target EEPROM backend
+
+maintainers:
+ - Arun Iyengar <aiyengar1990@xxxxxxxxx>
+
+description:
+ The I2C controller answers on its own address as a target and behaves
+ like a 24Cxx EEPROM towards the other controllers on the bus. The
+ compatible selects the EEPROM type that is simulated. The "ro" variants
+ ignore writes from the bus.
+
+properties:
+ compatible:
+ enum:
+ - slave-24c02
+ - slave-24c02ro
+ - slave-24c32
+ - slave-24c32ro
+ - slave-24c64
+ - slave-24c64ro
+ - slave-24c512
+ - slave-24c512ro
+
+ reg:
+ maxItems: 1
+ description:
+ Own address of the controller on the bus. The I2C_OWN_SLAVE_ADDRESS
+ flag must be set.
+
+ firmware-name:
+ maxItems: 1
+ description:
+ File with the initial content. Without it all bytes start as 0xff.
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/i2c/i2c.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ eeprom@64 {
+ compatible = "slave-24c02";
+ reg = <(0x64 | I2C_OWN_SLAVE_ADDRESS)>;
+ };
+ };
--
2.55.0