What is the RTC part being used?

I’m curious what the RTC part used on the Unmatched is, it doesn’t appear in the BOM or schematics. It’s also too small for me to identify. Looks like it’s on the I2C0 bus according to i2cdetect, but I’m not sure. Any help would be appreciated!

It is on the PMIC chip, the DA9063.

FWIW it seems that Linux doesn’t know about this either, at least in 5.13.9, to use the PMIC chip as RTC it needs a patch to the dts like:

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 9be05644e3c02a89234c71705ad0f75bc713e35d..26b7684a2dcc76b0ae983b73df685bc8506d8945 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -117,6 +117,18 @@ pmic@58 {
                interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+               onkey {
+                       compatible = "dlg,da9063-onkey";
+               };
+               rtc {
+                       compatible = "dlg,da9063-rtc";
+               };
+               wdt {
+                       compatible = "dlg,da9063-watchdog";
+               };
                regulators {
                        vdd_bcore1: bcore1 {
                                regulator-min-microvolt = <1050000>;

That’s unfortunate. I don’t think there is a clean way to make the clock available to the Linux kernel without preventing any other communication to the device (it becomes locked by the kernel). I’ll have to see if there is some other multi-function type device which can serve as a template, but I’m guessing all the various registers will need to be exposed via sysfs in order to allow changes to the PMIC functions while still using the RTC as the kernel’s hwclock.

There was a discussion about the RTC a few months ago in this thread.
I don’t know anything else about the RTC.

1 Like

No idea if it’s useful in your case, but FWIW the kernel lock is advisory only. i2cget and i2cget have a -f flag to override it.

E.g. to read the DA9063_REG_CONTROL_A register

i2cget -f 0 0x58 0x10