From owner-freebsd-arm@freebsd.org Wed Nov 21 22:33:48 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4E441148C60 for ; Wed, 21 Nov 2018 22:33:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5D87ACBB for ; Wed, 21 Nov 2018 22:33:47 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1542839625; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=aFIBNGLP+f+J+NzxDoN2+q4hSv4GxF6JW3wd+syiasSuaMsCNS3XhBFEOBA2NuZZIppsum+c2LVym QkfPF4Ysz+6H8Yr1dC2XGBapu9R4WehPJ945ibRZX3/ncwQ12COdIR/GrFQZIYG5HzoT0fLE6EkYcP Qgj5wvHbwwBRQ7r+y0aSTwcwiONXtyc1qR4JP4GQFUVE81Lnox5EaZxAUxZ9pkMeyHHnqcOAEwDv3S VxQgeW8BBMrmTGUBLPutjlttuFIdeQC2prF9UI1SFDC727JC076v++zdVWwqL52EZQ7I3RR27Q1KyK qlA8DCyVN82HKMrza+vsh1Nwaq8icdA== 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:cc:to:from:subject:message-id:dkim-signature:from; bh=XK0TOPlomogLkLyDLa2okJ3x5o6ZH9SAxUqbtSnP8WA=; b=pSs3vLcsuVgKuJzsjFmM+YumbqTo3CX1bEEhENa1QNpppiMbn3cncHO302Wd5o5QFKZ8xJv17iF3K /GY+oSfT6a4Rn+/N+bsUQQ7DCnx6m2AGtbXETmywUKSplhf1++QwQYFPtNqHbnJ0Ju0PpGeyiwPL9W WVd9lpMUlGbcbEz2RwUuXzRWLhJD6wqvjVuG1z+O/XDVjEamYFYG4Jo/FEzqla0Xyvu38maYxvYDig S1OudfvxG01zfRdO/ehtIMHp7qIcyMqA/TCJf7nBmSgfO11DLqzj2euZBncen6zGJSmvD+J05Wg/to zTEFzSWjMVeBHaNfHRhomCo+aBO4New== ARC-Authentication-Results: i=1; outbound3.eu.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:cc:to:from:subject:message-id:from; bh=XK0TOPlomogLkLyDLa2okJ3x5o6ZH9SAxUqbtSnP8WA=; b=cko0A4M2jK8g7Z13YITaA35FG+Oy3oMFilgN0yzXrvCExIt530AMsIDLupBmcRkBhWD58xZozcbwo 7V//zb8gxapnLwbWDd4zmgkQT2bye+ifxwLtfE6GzceKLDQ4rMyJzYc7CYpiiWezcJSHsqKo2IshCn 6onWDBWGB3tQs080kkDOxfbULhGHLZwoHDLbgZbKp1IwC7wsDn1+uDB5xXQZi+GwIwbMFpIxLOw9hQ xReepB1aZ450HsdT5Wz3hzIp6UN6BdILAfPwswRCCXxAZ9Av1skjcef39tjfHkPCo3m3cfZ+JMVOdm ncx+7lXBpcVb1sMx9PV7XiR4F5Rd72Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 7eff7d23-eddd-11e8-8a28-a1efd8da9a94 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.eu.mailhop.org (Halon) with ESMTPSA id 7eff7d23-eddd-11e8-8a28-a1efd8da9a94; Wed, 21 Nov 2018 22:33:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wALMXe86018159; Wed, 21 Nov 2018 15:33:40 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1542839620.56571.93.camel@freebsd.org> Subject: Re: FreeBSD 12.0 RBPI3B+ and hardware clock support From: Ian Lepore To: Stefan Parvu , Oleksandr Tymoshenko Cc: freebsd-arm@freebsd.org Date: Wed, 21 Nov 2018 15:33:40 -0700 In-Reply-To: References: <88AEE740-A64E-4F54-9A43-02DB605CFA2D@kronometrix.org> <1542832617.56571.81.camel@freebsd.org> <1542833504.56571.87.camel@freebsd.org> <370FE06A-C2F8-4294-8DD1-F2EF76E63B94@kronometrix.org> <20181121210909.GA1580@bluezbox.com> <84BB6519-3CF7-4ACC-847C-7AB82567A9BD@kronometrix.org> <20181121212939.GA1900@bluezbox.com> <20181121215103.GA2412@bluezbox.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C5D87ACBB X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.10)[-0.102,0]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; NEURAL_SPAM_SHORT(0.37)[0.371,0]; NEURAL_HAM_LONG(-0.07)[-0.067,0] X-Rspamd-Server: mx1.freebsd.org 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: Wed, 21 Nov 2018 22:33:48 -0000 On Wed, 2018-11-21 at 23:55 +0200, Stefan Parvu wrote: > root@k50:~ # dmesg | grep ds1307 > ds13070: at addr 0xde on iicbus0 > ds13070: registered as a time-of-day clock, resolution 1.000000s > > > root@k50:~ # dmesg | grep clock > ofw_clkbus0: on ofwbus0 > clk_fixed0: on ofw_clkbus0 > clk_fixed1: on ofw_clkbus0 > bcm2835_cpufreq0: can't get clock rate (id=8) > ds13070: registered as a time-of-day clock, resolution 1.000000s > > Looks good. Correct ? > > Stefan You can directly test reading and writing the clock hardware with some sysctls... First set      sysctl debug.clock_show_io=3 to enable the output. The output goes to the console and dmesg. Next:    sysctl debug.clock_do_io=1 to trigger a read and    sysctl debug.clock_do_io=2 to trigger a write.  The read is a no-op (it reads and discards the value) but the write will actually write the current system time to the rtc hardware.  When you're all done, set clock_show_io=0. If you leave the debug output enabled, you'll also see it doing the automatic update every 30 minutes if ntpd has set the clock. -- Ian