Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Nov 2018 15:33:40 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Stefan Parvu <sparvu@kronometrix.org>, Oleksandr Tymoshenko <gonzo@bluezbox.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: FreeBSD 12.0 RBPI3B+ and hardware clock support
Message-ID:  <1542839620.56571.93.camel@freebsd.org>
In-Reply-To: <DFB5ABF5-7828-42D5-A561-15AE93686B46@kronometrix.org>
References:  <88AEE740-A64E-4F54-9A43-02DB605CFA2D@kronometrix.org> <1542832617.56571.81.camel@freebsd.org> <FF758714-F388-46FB-96C7-22FE58D1BE86@kronometrix.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> <C0463CB9-1B08-418B-8A4B-6E7166DEACFA@kronometrix.org> <B38D171E-6D22-4421-B53A-D389AF829A0D@kronometrix.org> <20181121215103.GA2412@bluezbox.com> <DFB5ABF5-7828-42D5-A561-15AE93686B46@kronometrix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2018-11-21 at 23:55 +0200, Stefan Parvu wrote:
> root@k50:~ # dmesg | grep ds1307
> ds13070: <Microchip MCP7941x RTC> at addr 0xde on iicbus0
> ds13070: registered as a time-of-day clock, resolution 1.000000s
> 
> 
> root@k50:~ # dmesg | grep clock
> ofw_clkbus0: <OFW clocks bus> on ofwbus0
> clk_fixed0: <Fixed clock> on ofw_clkbus0
> clk_fixed1: <Fixed clock> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1542839620.56571.93.camel>