[PATCH] eeprom: at24: add ST M24C32-D Additional Write lockable page support

Marek Vasut marex at denx.de
Mon Oct 16 02:04:33 CEST 2023


The ST M24C32-D behaves as a regular M24C32, except for the -D variant
which uses up another I2C address for Additional Write lockable page.
This page is 32 Bytes long and can contain additional data. Add entry
for it, so users can describe that page in DT. Note that users still
have to describe the main M24C32 area separately as that is on separate
I2C address from this page.

>From Linux kernel commit:
4791146e9055 ("eeprom: at24: add ST M24C32-D Additional Write lockable page support")

Signed-off-by: Marek Vasut <marex at denx.de>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx at nxp.com>
Cc: Fabio Estevam <festevam at gmail.com>
Cc: Stefano Babic <sbabic at denx.de>
Cc: u-boot at dh-electronics.com
---
 drivers/misc/i2c_eeprom.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index bdd7e018cc6..e1d0b8f918a 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -227,6 +227,13 @@ static const struct i2c_eeprom_drv_data atmel24c32_data = {
 	.offset_len = 2,
 };
 
+static const struct i2c_eeprom_drv_data atmel24c32d_wlp_data = {
+	.size = 32,
+	.pagesize = 32,
+	.addr_offset_mask = 0,
+	.offset_len = 2,
+};
+
 static const struct i2c_eeprom_drv_data atmel24c64_data = {
 	.size = 8192,
 	.pagesize = 32,
@@ -266,6 +273,7 @@ static const struct udevice_id i2c_eeprom_std_ids[] = {
 	{ .compatible = "atmel,24c16a", (ulong)&atmel24c16a_data },
 	{ .compatible = "atmel,24mac402", (ulong)&atmel24mac402_data },
 	{ .compatible = "atmel,24c32", (ulong)&atmel24c32_data },
+	{ .compatible = "atmel,24c32d-wl", (ulong)&atmel24c32d_wlp_data },
 	{ .compatible = "atmel,24c64", (ulong)&atmel24c64_data },
 	{ .compatible = "atmel,24c128", (ulong)&atmel24c128_data },
 	{ .compatible = "atmel,24c256", (ulong)&atmel24c256_data },
-- 
2.42.0



More information about the U-Boot mailing list