From a9a289a211f7e6b479afc3e5f0c07c56e5d6ff7d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 19 Jul 2026 02:49:27 +0100 Subject: rtc: pcf8563: add haoyu,hym8563 compatible The HYM8563 is a PCF8563 clone with an identical timekeeping register layout and is found e.g. on the Radxa ROCK 5B. Match its compatible so DM_RTC (and with it the EFI GetTime/SetTime runtime services) can use the existing driver with upstream DT. Signed-off-by: Daniel Golle Reviewed-by: Tom Rini --- drivers/rtc/pcf8563.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/pcf8563.c b/drivers/rtc/pcf8563.c index 03bef68051b..83d60dc9b55 100644 --- a/drivers/rtc/pcf8563.c +++ b/drivers/rtc/pcf8563.c @@ -213,6 +213,7 @@ static const struct rtc_ops pcf8563_rtc_ops = { static const struct udevice_id pcf8563_rtc_ids[] = { { .compatible = "nxp,pcf8563" }, + { .compatible = "haoyu,hym8563" }, { } }; -- cgit v1.3.1 From 9811c57b2e01398c6f8ba29a63d93edd4ffe6482 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 19 Jul 2026 02:49:33 +0100 Subject: rtc: pcf8563: return -EINVAL when the voltage-low flag is set Return a proper error code instead of a bare -1 (-EPERM) when VL indicates the time is not reliable, matching rv3032 and the Linux driver behaviour. Signed-off-by: Daniel Golle --- drivers/rtc/pcf8563.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/pcf8563.c b/drivers/rtc/pcf8563.c index 83d60dc9b55..b20666e8b4a 100644 --- a/drivers/rtc/pcf8563.c +++ b/drivers/rtc/pcf8563.c @@ -16,6 +16,7 @@ #include #include #include +#include #if !CONFIG_IS_ENABLED(DM_RTC) static uchar rtc_read (uchar reg); @@ -144,7 +145,7 @@ static int pcf8563_rtc_get(struct udevice *dev, struct rtc_time *tmp) if (sec & 0x80) { puts("### Warning: RTC Low Voltage - date/time not reliable\n"); - rel = -1; + rel = -EINVAL; } tmp->tm_sec = bcd2bin(sec & 0x7F); -- cgit v1.3.1