From owner-freebsd-arm@freebsd.org Mon Jul 15 21:57:24 2019 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 D2B99C4EB3 for ; Mon, 15 Jul 2019 21:57:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62A4981931 for ; Mon, 15 Jul 2019 21:57:24 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1563227837; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=rizT1dJVkGWdHADacfGU/9L7I6T9QCIUw5dcQY+4teLH5i4pzeI/TAn36PKZM2AxCKfpruiYlVt1b Fm+f9QQov3WUyqmOXUf+pFyibGp1qo55oH7Pi5ZeaHr5fg11WQiN2mg9dWw1Q718r0BzTqcL3HU6W2 R4d5unkesIr/NVYI9RbMxPy8Nndnd+B1U6D4ik5p8l/OD1ECGMttrIoNHnGnj38eC7ywAko502yYiT 8DWf9gOskLXtofT0jxmvyTuedKOo/ppHztSVjyw76Ii9gLgnVIiJ4/yHlFmSU0KyOnk8HFSA6Z2JJ3 yQTCuYgiRe5bMXC9TGkMzNtEsB9r7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=rT4uosgHeEfLhRW/CLHf28jyZQHqTfV/94UtuDb8Nlg=; b=CDSWZojH188huogOKYtIfLjSK+nBwpSwNjVP6L9p9ZlOCX1KETbaDuFjsDYsXhy9+GekxeW9BguS4 0dnOCcw5950LKUN0QYoxoC4fWGk0msCW23bI+JcXN1n31avL3/jx1vifQBTMBTiTFxa2MulZN8+ksW 34n+Sb1PbvzPi1U9WMVI7cGpv0fhXQ8DflGowt63vFMd2n2eyswYDsbmZX9b9JzNKlJjXtI6EdAwCl JqvAAMZCG1EPYlJRb8aVQdLqJLkly3zsHo8yD4zbMqxlywO1rgoO1bfTAeTDb2HJne4aKfgkAAYtqO q3SStgjHjn9YI+Vx6gz2RyjAgra+E6g== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=rT4uosgHeEfLhRW/CLHf28jyZQHqTfV/94UtuDb8Nlg=; b=BsDTkXOpb/5FVet6RLqYRTHLEj0noqmf80F0aDKnapLvGA1Ria/3pNzITFEu6bVF++6xcisZ78aCD ORA1Vj88DMjXS7oriymNTkP2s3OxhrGXdZp64BACnBzUvQwpVeyq6r6SedauuxXVvWtRInCGynxDRL jGoDJbJ2SHN7pUqfg+7Qdz3Y38B5dTWTRYGbSk1kwA7+/k02X4hgrbHk9hQvd1wjsHD7N1TR/VLLkQ guGrtPJdMgia/HYU8LteX9AXhaTluJdbKUn4DXgIG6hTJF9Jm61+q2dfg/UVlImO0WKRUpuvezcfdw 0IClk6nkBw3ifpJhwI/8h8D7LpX3YQA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 814ad42b-a74b-11e9-9d30-d9f4e14f47a7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 814ad42b-a74b-11e9-9d30-d9f4e14f47a7; Mon, 15 Jul 2019 21:57:16 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x6FLvEVF033571; Mon, 15 Jul 2019 15:57:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <790afcb5f0809a89b45982958a85f1539fec05c7.camel@freebsd.org> Subject: Re: Rasclock (PCF2127 ) Hardware Clock FreeBSD 12.0 From: Ian Lepore To: Stefan Parvu , freebsd-arm@freebsd.org Date: Mon, 15 Jul 2019 15:57:14 -0600 In-Reply-To: <74E3E782-8481-4B5B-A0AF-A04590C27D6D@kronometrix.org> References: <41A4CA5C-B487-490F-8A19-2D51F43E1004@kronometrix.org> <95616620-bbaf-dbc3-49eb-3e2562638d49@bunyatech.com.au> <74E3E782-8481-4B5B-A0AF-A04590C27D6D@kronometrix.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 62A4981931 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2019 21:57:24 -0000 On Mon, 2019-07-15 at 18:46 +0300, Stefan Parvu wrote: > Another comment: these 3 Rasclocks are ver 4.0, they been used on Raspbian > for some time back but they have been off for some good months, except one. I > changed the batteries on all of them. All of them behave the same on FBSD 12.0. > > Stefan Parvu > sparvu@kronometrix.org > Okay, this should be fixed as of r350016. It turns out the PCF2129 chip isn't fully compliant with the i2c spec... an obscure footnote in the datasheet mentions that it doesn't support i2c repeat-start operations. Back when I originally wrote and tested the driver I was using an rpi for testing, and the rpi i2c driver didn't support repeated-start, it just silently turned them into a stop-then-start. Some time last year, I fixed the rpi i2c driver to handle repeat-start properly, and at that point the nxprtc driver would have stopped working because I had missed that footnote when I first wrote it. Now the nxprtc driver doesn't try to do repeat-start transactions, and it should work right on all boards. Another thing I noticed is that the rpi dtbo file activates a PCF2127 chip, so the driver was trying to treat that 2129 as if it were a 2127. The major difference between the models is that the 2129 doesn't have a sub-second countdown timer for better resolution. So that should have made the 2129 fail on an rpi after I fixed the repeat-start thing, but it didn't fail, it just worked fine. It turns out the 2129 chip has the countdown timer hardware too, even though the datasheet says it doesn't. You just can't use it to toggle an output pin or trigger an interrupt. But our driver only uses it to read the sub-second time. So I made that less accidental; the driver now treats the 2127 and 2129 the same, and gets .015 second resolution on both of them. -- Ian