From nobody Mon Feb 21 11:20:40 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7216E19CFAA4 for ; Mon, 21 Feb 2022 11:20:53 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K2Kc455dbz4q0P for ; Mon, 21 Feb 2022 11:20:52 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: by mail-ed1-x533.google.com with SMTP id h15so11646577edv.7 for ; Mon, 21 Feb 2022 03:20:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AMUsWczkQeHVwE0N9JOid2UWWIQ3WkiNyGdAYrnetTg=; b=e9hB01NfiZnt16ztymmhEB7MIXV6xlO7kV8iGyfKr8oTILPu+xsOiCT7kgmiJ2tY92 /xE/LDLKE0zuSi/ezbS3gYEHan4ygtgyDJe5ppyFo3QNIdJoGiMygpJUbwLEjhDcHCIM +rCXKYmE8mxRxflfMdMkUsvml1SjwAgY41C+8FZOOMk8MbQ84Ox6mW82fkziF4e70seZ OmTTLAHe18JcItdEKjq2T4fD/mWT+P2/uOZYfVO+83bx52YvmW151qcHPXXcdTzg56aU YVFoCSVOsmJLVbkAP6OBNJbg5vbpwBvWcCLEUR6BgdMVeX+oTCxrw3DoHKsy/K0PgWyk JkxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AMUsWczkQeHVwE0N9JOid2UWWIQ3WkiNyGdAYrnetTg=; b=dhkVD3ZWmj+mlnPRBmG6KMSCS2A+SXRkLeblCFVjLN6q1YZVXqYfvYH5BgF0H2FoS1 UCsS/Ijn5X0tcB3bUuPSDBcPXoxckAYVh7U4Qr/BYJRkI+CWhC9WImLLPoiNpL3a+tNb dQGQpx/ErV+ENfNnMUx7mHDVqxCCEAekjMLoUZZ99yU6ARdYFoNL5MCGKqwDvjH/jGdp G0Ks/Avhzb0esqpf0NnGyGgnBVB38ymiQJQ2oZ24KPgm+VAj9LdA4zwiAsjKgNsmbTaL yrTuEbdXCtyZUqWP3Gf7xUnRJ6H68NzPNYV/imYTuwyyquooNjvCj9+SMr88DGUwT6Ep K+PA== X-Gm-Message-State: AOAM532Ou1VodpmAoCtWlRO4hn52PBSf1CCGp4f4+YNovwccMbDEbQj2 263iU7yGWSHcwQBb5pcNd7MDAFSIpFd3IewKJLHb0GH2Be9tBQ== X-Google-Smtp-Source: ABdhPJzHgDoCJ5ehbEEtbi39D+Q9qs+IEGuQHyyP57xnIkvqToUjai40Vn9ZD0yZZCFkl5J8VLc5x5aK5ceLwfUMvmA= X-Received: by 2002:a05:6402:d0d:b0:412:d49c:74d3 with SMTP id eb13-20020a0564020d0d00b00412d49c74d3mr12370986edb.207.1645442451633; Mon, 21 Feb 2022 03:20:51 -0800 (PST) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: <2DF482A7-FEFC-4833-A16B-A7A01B8713DD@dons.net.au> <94C3A304-B821-4885-A50D-32BD1FBED43D@dons.net.au> <76D58677-D12C-4F0D-A0E0-F28E300FE39B@dons.net.au> In-Reply-To: <76D58677-D12C-4F0D-A0E0-F28E300FE39B@dons.net.au> From: Archimedes Gaviola Date: Mon, 21 Feb 2022 19:20:40 +0800 Message-ID: Subject: Re: DS3231 RTC module not detected To: "Daniel O'Connor" Cc: freebsd-arm@freebsd.org Content-Type: multipart/alternative; boundary="000000000000d3f8f805d8856c02" X-Rspamd-Queue-Id: 4K2Kc455dbz4q0P X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=e9hB01Nf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of archimedesgaviola@gmail.com designates 2a00:1450:4864:20::533 as permitted sender) smtp.mailfrom=archimedesgaviola@gmail.com X-Spamd-Result: default: False [-3.84 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.84)[-0.844]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::533:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000d3f8f805d8856c02 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 21, 2022 at 4:01 PM Daniel O'Connor 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



include =C2=A0 =C2=A0 =C2=A0 =C2=A0 GENERIC
ident =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 GENERIC-PI
nooptions =C2=A0 =C2=A0 SOC_NVIDIA= _TEGRA210

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 "kldload ds1307" and see if it's detected. Add a line into= your /boot/loader.conf with ds1307_enable=3D"YES" if necessary. = Lastly, kindly backup your data before recompiling for safety.

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

Thanks,
=
Archimedes
=
=C2=A0
--000000000000d3f8f805d8856c02--