Re: DS3231 RTC module not detected

From: Archimedes Gaviola <archimedes.gaviola_at_gmail.com>
Date: Mon, 21 Feb 2022 11:20:40 UTC
On Mon, Feb 21, 2022 at 4:01 PM Daniel O'Connor <darius@dons.net.au> wrote:

>
>
> > On 20 Feb 2022, at 14:59, Archimedes Gaviola <
> archimedes.gaviola@gmail.com> wrote:
> >> When you say "with the exact DS3231 driver.." what do you mean?
> >
> > I mean the appropriate DS3231 driver - ds3231(4) for the module which is
> a kernel loadable as the dominating driver with 13.0-RELEASE and
> 14.0-CURRENT which is MAX77620 RTC is the wrong one thus the module will
> not work properly. The clock stops and goes back to the time when you set
> it. This behavior is observable when my RPi system is rebooted or shutdown.
> With the loadable  ds3231 driver, this behavior is no longer observed and
> working as expected. For your DS1307, there's also an equivalent and
> perhaps the appropriate driver as described in the manual ds1307(4), it can
> be loaded as well via kldload.
>
> I tried loading ds1307.ko in the loader but it has no effect on the result
> - still shows up as a MAX77620 for me.
>
> I haven't tested pulling the power yet as I'm remote from it.
>

Did you re-compile your kernel? Brian has shared his resolution on
customizing the GENERIC kernel here
https://lists.freebsd.org/archives/freebsd-arm/2022-February/001024.html
which allows to free-up the i2c address 0x68 which by default is being used
by the MAX77620 RTC driver from the SOC_NVIDIA_TEGRA210. So, you need to
add these lines in your kernel (I assume it's still the GENERIC otherwise
use your existing config),

include         GENERIC
ident             GENERIC-PI
nooptions     SOC_NVIDIA_TEGRA210

and then recompile. Keep your /boot/msdos/config.txt and
/boot/msdos/overlays/ds1307.dtbo files intact. After recompiling and
rebooting, you can check the dmesg if the ds1307 driver is loaded,
otherwise invoke "kldload ds1307" and see if it's detected. Add a line into
your /boot/loader.conf with ds1307_enable="YES" if necessary. Lastly,
kindly backup your data before recompiling for safety.

This is the way I do it with my ds3231 driver, hope you will get the same
result.

Thanks,
Archimedes