HomeFreeBSD

MFC r325233, r328956, r329170, r329172-r329173, r329224, r330403-r330407,

Description

MFC r325233, r328956, r329170, r329172-r329173, r329224, r330403-r330407,

r330411-r330412, r330416, r330430-r330431, r330433, r330528-r330529,
r330767

r325233:
[i2c/clock] add support for EPSON RTC-8583

RTC-8583 is time-of-day clock used in some SOHO routers. This clock has
only 2 bits for year values, but thanks to user SRAM it's possible to save
year value and keep it up to date via driver code.

Tested on Planex_MZK-W300NAG (SoC is RT2880)

Submitted by: Hiroki Mori <yamori83@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D12833

r328956:
Use const pointers for input data not modified by clock utility functions.

r329170:
Replace the existing print_ct() private debugging function with a set of
three public functions to format and print the three major data structures
used by realtime clock drivers (clocktime, bcd_clocktime, and timespec).

r329172:
Add a set of convenience routines for RTC drivers to use for debug output,
and a debug.clock_show_io sysctl to control debugging output.

r329173:
Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot
read or write of all registered realtime clocks. In the read case, the
values read are simply discarded. For writes, there's no alternative but
to actually write the current system time to the device.

r329224:
Fix bad indentation. Whitespace only, no functional changes.

Reported by: bde@

r330403:
Add calls to the new clock_dbgprint_xxx() functions.

r330404:
Add calls to the new clock_dbgprint_xxx() functions.

r330405:
Oops, fix a paste-o.

r330406:
Add calls to the new clock_dbgprint_xxx() functions.

r330407:
Add calls to the new clock_dbgprint_xxx() functions. Also, stop applying
a local .5 second adjustment to the time, since that is now done by the
code in subr_rtc.c.

r330411:
Convert to the new(ish) bcd_clocktime conversion functions, add calls to
the new debug output functions, and when setting the clock, propagate the
timespec nsecs to the 1/100ths register.

r330412:
Build iicbus/rtc8583 as a module.

r330416:
The year is stored in a single byte in sram, in binary format, as a count
of years since the century, so strip the century out when converting to or
from bcd_clocktime format (the conversion routines will infer century by
pivoting on 70).

r330430:
Switch to the new bcd_clocktime conversion routines, and add calls to the
new clock_dbgprint_xxx() functions.

r330431:
Switch to the new bcd_clocktime conversion routines, and add calls to the
new clock_dbgprint_xxx() functions.

r330433:
Switch to the new bcd_clocktime conversion routines, and add calls to the
new clock_dbgprint_xxx() functions.

r330528:
Fix a paste-o that broke the build. There is no softc pointer here, just
use the dev arg.

Reported by: Jonathan Looney <jonlooney@gmail.com>
Pointy hat: ian@

r330529:
Build the ds1672 driver as a module. Add a detach() to unregister the rtc.

r330767:
Convert atrtc the new style rtc debugging output. Remove the db show
command handler which provided much the same information. Removing the
possibility of accessing the hardware regs from the debugger context
paves the way for simplifying the locking code in the driver.

Details

Provenance
ianAuthored on
Differential Revision
D12833: EPSON RTC-8583 support code on i2c bus
Parents
rS331502: MFC r329534-r329535
Branches
Unknown
Tags
Unknown