Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Feb 2022 19:20:40 +0800
From:      Archimedes Gaviola <archimedes.gaviola@gmail.com>
To:        "Daniel O'Connor" <darius@dons.net.au>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: DS3231 RTC module not detected
Message-ID:  <CAJFbk7HdJDSNU0R1nNNMJsOePLpRb2=q9%2BOJOBTB8Boe6Ba6Ow@mail.gmail.com>
In-Reply-To: <76D58677-D12C-4F0D-A0E0-F28E300FE39B@dons.net.au>
References:  <CAJFbk7EtkjnFBJgr-L3faxaQ2saNgEQ%2BLRPWbRySpwY8wJRh=Q@mail.gmail.com> <F2EFEDCC-1E00-4221-8AF9-3744A7AC359C@dons.net.au> <CAJFbk7Ed2R8M2xAkJQAjiivZie=8Ca_Rt50YEG4P3yWzQLQhrg@mail.gmail.com> <2DF482A7-FEFC-4833-A16B-A7A01B8713DD@dons.net.au> <CAJFbk7GRjq-MheWRhVN1TkLOkAiYx5_NH6K%2B3umN0SMjExyB8Q@mail.gmail.com> <94C3A304-B821-4885-A50D-32BD1FBED43D@dons.net.au> <CAJFbk7F7HvJGrf2UJn6hQ-PqfWKmttWLzqmqKHLfHGkJKS=kgg@mail.gmail.com> <76D58677-D12C-4F0D-A0E0-F28E300FE39B@dons.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000d3f8f805d8856c02
Content-Type: text/plain; charset="UTF-8"

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

--000000000000d3f8f805d8856c02
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Feb 21, 2022 at 4:01 PM Danie=
l O&#39;Connor &lt;<a href=3D"mailto:darius@dons.net.au" target=3D"_blank">=
darius@dons.net.au</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex"><br>
<br>
&gt; On 20 Feb 2022, at 14:59, Archimedes Gaviola &lt;<a href=3D"mailto:arc=
himedes.gaviola@gmail.com" target=3D"_blank">archimedes.gaviola@gmail.com</=
a>&gt; wrote:<br>
&gt;&gt; When you say &quot;with the exact DS3231 driver..&quot; what do yo=
u mean?<br>
&gt; <br>
&gt; 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-CU=
RRENT 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 b=
ehavior is observable when my RPi system is rebooted or shutdown. With the =
loadable=C2=A0 ds3231 driver, this behavior is no longer observed and worki=
ng as expected. For your DS1307, there&#39;s also an equivalent and perhaps=
 the appropriate driver as described in the manual ds1307(4), it can be loa=
ded as well via kldload.<br>
<br>
I tried loading ds1307.ko in the loader but it has no effect on the result =
- still shows up as a MAX77620 for me.<br>
<br>
I haven&#39;t tested pulling the power yet as I&#39;m remote from it.<br></=
blockquote><div><br></div>Did you re-compile your kernel? Brian has shared =
his resolution on customizing the GENERIC kernel here <a href=3D"https://li=
sts.freebsd.org/archives/freebsd-arm/2022-February/001024.html" target=3D"_=
blank">https://lists.freebsd.org/archives/freebsd-arm/2022-February/001024.=
html</a> which allows to free-up the i2c address 0x68 which by default is b=
eing used by the=20
MAX77620 RTC

driver from the SOC_NVIDIA_TEGRA210. So, you need to add these lines in you=
r kernel (I assume it&#39;s still the GENERIC otherwise use your existing c=
onfig),</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote=
">include =C2=A0 =C2=A0 =C2=A0 =C2=A0 GENERIC<br>ident =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0=C2=A0=C2=A0 GENERIC-PI<br>nooptions =C2=A0 =C2=A0 SOC_NVIDIA=
_TEGRA210</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quo=
te">and then recompile. Keep your /boot/msdos/config.txt and=20
/boot/msdos/overlays/ds1307.dtbo files intact. After recompiling and reboot=
ing, you can check the dmesg if the ds1307 driver is loaded, otherwise invo=
ke &quot;kldload ds1307&quot; and see if it&#39;s detected. Add a line into=
 your /boot/loader.conf with ds1307_enable=3D&quot;YES&quot; if necessary. =
Lastly, kindly backup your data before recompiling for safety.<br></div><di=
v class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">This is the wa=
y I do it with my ds3231 driver, hope you will get the same result.</div><d=
iv class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">Thanks,</div>=
<div class=3D"gmail_quote">Archimedes <br></div><div class=3D"gmail_quote">=
<br></div><div class=3D"gmail_quote">=C2=A0 </div></div>

--000000000000d3f8f805d8856c02--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJFbk7HdJDSNU0R1nNNMJsOePLpRb2=q9%2BOJOBTB8Boe6Ba6Ow>