From owner-freebsd-arm@freebsd.org Sun Jul 19 21:12:58 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B369D369C31 for ; Sun, 19 Jul 2020 21:12:58 +0000 (UTC) (envelope-from freebsd-rj@obsigna.com) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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.rzone.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8yHs0D5wz43jc; Sun, 19 Jul 2020 21:12:56 +0000 (UTC) (envelope-from freebsd-rj@obsigna.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1595193174; s=strato-dkim-0002; d=obsigna.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=EC+HnTWSVf5olAFVlf54zsVv7alBjh1k6UQPEB7Pxp4=; b=DsQXIpd4zMhKSqJaKuCV0d+587+KrmfQ4kQpg6M+5kkugLAY+f4xHHM5Aw3T4tH01R 3p0tOIGxGKBy9C6YLA+xDEdlVeoyoqnGsQY67MW4OacKTgVISan53yS4nPAU4w6rJbqu FfvUYsLxoeMmhdo+Wz1SS60NnCu7vh9IEg5ks+lmNGfvaAGTWsYaWmeYCXS5Sa28VISS 4OzZTlsFWREInDyjKyBrWt0F+U+fVDTZ01Lx0JLBYTC0qSE6qzJqQjuZEFmpRug+fiQx upc2mgrgYuKGy/vmLSRbyMwunKqsTLJEgByVCks+YCz4vtNzclKvS4GlN8j9gDGKoSfC WVBA== X-RZG-AUTH: ":O2kGeEG7b/pS1F2rRHW2isrKl4DV03XBEi+I6ZuztdvN9wS3wFGySS4Lw+ldTBio0dVbInGjc9PbZFAm0A==" X-RZG-CLASS-ID: mo00 Received: from mail.obsigna.com by smtp.strato.de (RZmta 46.10.5 DYNA|AUTH) with ESMTPSA id 006e94w6JLCsh59 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 19 Jul 2020 23:12:54 +0200 (CEST) Received: from rolf-mini.obsigna.com (rolf-mini.obsigna.com [192.168.222.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.obsigna.com (Postfix) with ESMTPSA id 930FD1350F91D; Sun, 19 Jul 2020 18:12:49 -0300 (-03) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: DS3231 on BeagleBone Black with FreeBSD 13-CURRENT exactly 20 h off backwards From: "Dr. Rolf Jansen" In-Reply-To: <4ede9edaf4638ba5d8e8bcb75662bf9c096e5e39.camel@freebsd.org> Date: Sun, 19 Jul 2020 18:12:48 -0300 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <3BE2A8B4-AD53-4DFE-8C38-D5BB4063CFE9@obsigna.com> <4ede9edaf4638ba5d8e8bcb75662bf9c096e5e39.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3445.104.14) X-Rspamd-Queue-Id: 4B8yHs0D5wz43jc X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=obsigna.com header.s=strato-dkim-0002 header.b=DsQXIpd4; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-rj@obsigna.com designates 85.215.255.25 as permitted sender) smtp.mailfrom=freebsd-rj@obsigna.com X-Spamd-Result: default: False [-0.91 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[obsigna.com:s=strato-dkim-0002]; NEURAL_HAM_MEDIUM(-1.03)[-1.035]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:85.215.255.0/24]; DMARC_NA(0.00)[obsigna.com]; NEURAL_SPAM_SHORT(0.11)[0.107]; NEURAL_HAM_LONG(-0.98)[-0.983]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[obsigna.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[85.215.255.25:from]; FROM_NAME_HAS_TITLE(1.00)[dr]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_VERYGOOD(0.00)[85.215.255.25:from]; ASN(0.00)[asn:6724, ipnet:85.215.255.0/24, country:DE]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2020 21:12:58 -0000 > Am 19.07.2020 um 15:57 schrieb Ian Lepore : >=20 > On Wed, 2020-07-15 at 12:15 -0300, Dr. Rolf Jansen wrote: >>> BTW: the following looks strange: >>>=20 >>>=20 > = https://github.com/freebsd/freebsd/blob/b2d136be8c26e5efaf82b7bb25432207a6= 82e250/sys/dev/iicbus/ds3231.c#L526 >>> 6 >> 25432207a682e250/sys/dev/iicbus/ds3231.c#L526> >>>=20 >>> This would add 256 instead of 100 when rolling over the century, >>> really? On real world systems this will let to a Year-2100 problem, >>> better we solve this quickly, since the time is running, and 80 >>> years compares to nothing on the geologic time scale :-D >=20 > I overlooked this part of your message previously. Actually, the = value > 0x100 is correct because the numbers here are expressed in bcd. So 99 > years is 0x099 and 100 years is 0x100. In practice, all this century > rollover stuff is moot, because the next century rollover is = 2099->2100=20 > and the datasheet says they only handle leap years correctly through > 2099. >=20 >> DS3231_HOUR_MASK_24HR is definitely wrong, since this prevents the >> setting of times above 20 h. Reading said data sheet, I am almost >> sure, that DS3231_HOUR_MASK_24HR must be the same as >> DS3231_HOUR_MASK_12HR =3D 0x3f. >=20 > Actually, it looks like the entire problem is that I simply swapped = the > values for DS3231_HOUR_MASK_12HR and DS3231_HOUR_MASK_24HR when I = added > those constants. Fixed in r363330. It does work now. Thank you very much for fixing it that quickly. I didn't recognize that the century rollover was done in BCD. You are = correct of course. Sorry for the false alarm. Stay healthy! Best regards Rolf=20