From: Alexander Feilke Date: Fri, 22 May 2026 15:39:24 +0000 (+0200) Subject: rtc: pcf85063: add support for NXP PCF85063 family X-Git-Tag: v2026.10-rc1~48^2~41^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f04246641079ccf64c29ac53891ddc41d1b1694;p=thirdparty%2Fu-boot.git rtc: pcf85063: add support for NXP PCF85063 family Supported devices: - generic PCF85063 / PCF85063TP (no alarm regs) - PCF85063A / PCF85073A (alarm regs) Tested with TQMa8MPxL SOM from TQ-Systems GmbH. Also add missing .data field to rv8263 which represents the number of available registers (= linux `pcf85063_config.max_register + 1`). Signed-off-by: Markus Niebel Reviewed-by: Alexander Sverdlin Signed-off-by: Alexander Feilke --- diff --git a/drivers/rtc/pcf85063.c b/drivers/rtc/pcf85063.c index 21640b039c1..183a214a3e9 100644 --- a/drivers/rtc/pcf85063.c +++ b/drivers/rtc/pcf85063.c @@ -80,12 +80,18 @@ static int pcf85063_reset(struct udevice *dev) static int pcf85063_read(struct udevice *dev, unsigned int offset, u8 *buf, unsigned int len) { + if (offset + len > dev->driver_data) + return -EINVAL; + return dm_i2c_read(dev, offset, buf, len); } static int pcf85063_write(struct udevice *dev, unsigned int offset, const u8 *buf, unsigned int len) { + if (offset + len > dev->driver_data) + return -EINVAL; + return dm_i2c_write(dev, offset, buf, len); } @@ -105,7 +111,11 @@ static int pcf85063_probe(struct udevice *dev) } static const struct udevice_id pcf85063_of_id[] = { - { .compatible = "microcrystal,rv8263" }, + { .compatible = "microcrystal,rv8263", .data = 0x12 }, + { .compatible = "nxp,pcf85063", .data = 0xb }, + { .compatible = "nxp,pcf85063a", .data = 0x12 }, + { .compatible = "nxp,pcf85063tp", .data = 0xb }, + { .compatible = "nxp,pcf85073a", .data = 0x12 }, { } };