* [PATCH 0/2] rtc: pcf8563: HYM8563 support and unreliable-time reporting
@ 2026-07-19 1:49 Daniel Golle
2026-07-19 1:49 ` [PATCH 1/2] rtc: pcf8563: add haoyu,hym8563 compatible Daniel Golle
2026-07-19 1:49 ` [PATCH 2/2] rtc: pcf8563: return -EINVAL when the voltage-low flag is set Daniel Golle
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Golle @ 2026-07-19 1:49 UTC (permalink / raw)
To: Tom Rini, Daniel Golle, u-boot
The Haoyu HYM8563, found for example on the Radxa ROCK 5B, is a clone of
the NXP PCF8563 with an identical timekeeping register layout, but the
pcf8563 driver does not match its compatible used in upstream DT.
Boards fitted with it end up without DM_RTC and, as a consequence,
without usable EFI GetTime and SetTime runtime services. On top of
that, when the chip reports that the time may be unreliable after a
supply voltage drop, the driver returns a bare -1, which callers
interpret as -EPERM rather than as invalid data.
This series makes the existing driver serve the HYM8563 and lets callers
distinguish an unreliable time from a permission problem.
The driver gains the additional compatible string and returns -EINVAL
when the voltage-low flag is set, matching the rv3032 driver and the
behaviour of the Linux driver for the same chips.
Daniel Golle (2):
rtc: pcf8563: add haoyu,hym8563 compatible
rtc: pcf8563: return -EINVAL when the voltage-low flag is set
drivers/rtc/pcf8563.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
base-commit: ece349ade2973e220f524ce59e59711cc919263f
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] rtc: pcf8563: add haoyu,hym8563 compatible
2026-07-19 1:49 [PATCH 0/2] rtc: pcf8563: HYM8563 support and unreliable-time reporting Daniel Golle
@ 2026-07-19 1:49 ` Daniel Golle
2026-07-19 1:49 ` [PATCH 2/2] rtc: pcf8563: return -EINVAL when the voltage-low flag is set Daniel Golle
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Golle @ 2026-07-19 1:49 UTC (permalink / raw)
To: Tom Rini, Daniel Golle, u-boot
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 <daniel@makrotopia.org>
---
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" },
{ }
};
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] rtc: pcf8563: return -EINVAL when the voltage-low flag is set
2026-07-19 1:49 [PATCH 0/2] rtc: pcf8563: HYM8563 support and unreliable-time reporting Daniel Golle
2026-07-19 1:49 ` [PATCH 1/2] rtc: pcf8563: add haoyu,hym8563 compatible Daniel Golle
@ 2026-07-19 1:49 ` Daniel Golle
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Golle @ 2026-07-19 1:49 UTC (permalink / raw)
To: Tom Rini, Daniel Golle, u-boot
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 <daniel@makrotopia.org>
---
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 <log.h>
#include <rtc.h>
#include <i2c.h>
+#include <linux/errno.h>
#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);
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-19 1:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-19 1:49 [PATCH 0/2] rtc: pcf8563: HYM8563 support and unreliable-time reporting Daniel Golle
2026-07-19 1:49 ` [PATCH 1/2] rtc: pcf8563: add haoyu,hym8563 compatible Daniel Golle
2026-07-19 1:49 ` [PATCH 2/2] rtc: pcf8563: return -EINVAL when the voltage-low flag is set Daniel Golle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.