FreeBSD 12.0 RBPI3B+ and hardware clock support

Ian Lepore ian at freebsd.org
Wed Nov 21 22:33:48 UTC 2018


On Wed, 2018-11-21 at 23:55 +0200, Stefan Parvu wrote:
> root at 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 at 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



More information about the freebsd-arm mailing list