From owner-freebsd-arm@freebsd.org Wed Jul 15 12:53:03 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 3B67A3656E8 for ; Wed, 15 Jul 2020 12:53:03 +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.23]) (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 4B6HNr4f9yz3Yxx for ; Wed, 15 Jul 2020 12:53:00 +0000 (UTC) (envelope-from freebsd-rj@obsigna.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1594817578; s=strato-dkim-0002; d=obsigna.com; h=To:Date:Message-Id:Subject:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=fy1AitpawtMND1/+GY1EW7kiwVd6tZL0Cc5Z7QjE7Sc=; b=Um/p4gmrO9vqdoljr2CjjszMqG4DGm3UHju5wxS4fuAn3s8fyXiXpHO+6ENDTBJxZW 4rJyerD/ZhNXEl3cKDbny0FM1WI6htBmfMEuPupFsDjygIi2ZUV4BiaY8uDc5tNoRGqk zLz262stsPt84BWbPiJYUiD7Wj8fBa583D3UYxFI5DLrl0TLSdOfkFj6QqbbC1VbNHGK mVbbaJwHLB/6Fje1j6R07+ECXc2wNh3pAlOfd/KB3kJcDP3l7NGP3FzJ2Z+1b5XVIi+e NK1qoZli4ccyWQ207kIAj80WBWfV/bZS2hNI5DlVnbibQgSFcDIUn9BFPJg861X+4Uw/ pqdg== 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 006e94w6FCqvVAJ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Wed, 15 Jul 2020 14:52:57 +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 413361350F91D for ; Wed, 15 Jul 2020 09:52:53 -0300 (-03) From: Dr. Rolf Jansen Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: DS3231 on BeagleBone Black with FreeBSD 13-CURRENT exactly 20 h off backwards Message-Id: <3BE2A8B4-AD53-4DFE-8C38-D5BB4063CFE9@obsigna.com> Date: Wed, 15 Jul 2020 09:52:52 -0300 To: freebsd-arm@freebsd.org X-Mailer: Apple Mail (2.3445.104.14) X-Rspamd-Queue-Id: 4B6HNr4f9yz3Yxx X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=obsigna.com header.s=strato-dkim-0002 header.b=Um/p4gmr; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-rj@obsigna.com designates 85.215.255.23 as permitted sender) smtp.mailfrom=freebsd-rj@obsigna.com X-Spamd-Result: default: False [-1.12 / 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.04)[-1.044]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[85.215.255.23:from]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.987]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[obsigna.com]; R_SPF_ALLOW(-0.20)[+ip4:85.215.255.0/24]; DKIM_TRACE(0.00)[obsigna.com:+]; NEURAL_HAM_SHORT(-0.08)[-0.083]; RCVD_IN_DNSWL_NONE(0.00)[85.215.255.23:from]; FROM_NAME_HAS_TITLE(1.00)[dr]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:6724, ipnet:85.215.255.0/24, country:DE]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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: Wed, 15 Jul 2020 12:53:03 -0000 I added a DS3231 module to the i2c2 bus of the BBB running 13-CURRENT. = Everything work fine, except that when I set a time in the range of = 20:00 to 24:00 UTC, then on starting up the RTC reports a date/time of = exactly 20 hours off backwards. While, when I set a time in the range = from 0:00 to 19:59 UTC, it would be correctly stored by the RTC. Looking at the Maxim DS3231 datasheet = (https://datasheets.maximintegrated.com/en/ds/DS3231.pdf#page=3D11), it = might be that something gets mixed-up when setting bits 5 and 6 of the = hours register. In the history of ds3231.c, I saw that 24 hour mode is = not more forced anymore. Perhaps an unresolved ambiguity was introduced = by this change. BTW: the following looks strange: = https://github.com/freebsd/freebsd/blob/b2d136be8c26e5efaf82b7bb25432207a6= 82e250/sys/dev/iicbus/ds3231.c#L526 = 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 Best regards Rolf=