summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2018-03-24 23:01:10 +0000
committerian <ian@FreeBSD.org>2018-03-24 23:01:10 +0000
commit53c86efaf6dffcee96ae56f1bbc8d02cb1737c16 (patch)
treee58434f9c6a85cfd3cc73f1d6c90f7ebdceace4f /sys/modules
parent6014d12316ee0612bd152f38ec40e88f9a5b819d (diff)
downloadFreeBSD-src-53c86efaf6dffcee96ae56f1bbc8d02cb1737c16.zip
FreeBSD-src-53c86efaf6dffcee96ae56f1bbc8d02cb1737c16.tar.gz
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.
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/i2c/Makefile2
-rw-r--r--sys/modules/i2c/ds1672/Makefile19
-rw-r--r--sys/modules/i2c/rtc8583/Makefile19
3 files changed, 40 insertions, 0 deletions
diff --git a/sys/modules/i2c/Makefile b/sys/modules/i2c/Makefile
index fa41c4f..0840032 100644
--- a/sys/modules/i2c/Makefile
+++ b/sys/modules/i2c/Makefile
@@ -5,6 +5,7 @@ SUBDIR = \
cyapa \
ds1307 \
ds13rtc \
+ ds1672 \
ds3231 \
icee \
if_ic \
@@ -17,6 +18,7 @@ SUBDIR = \
jedec_dimm \
jedec_ts \
nxprtc \
+ rtc8583 \
s35390a \
smb \
smbus \
diff --git a/sys/modules/i2c/ds1672/Makefile b/sys/modules/i2c/ds1672/Makefile
new file mode 100644
index 0000000..e420dca
--- /dev/null
+++ b/sys/modules/i2c/ds1672/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = ds1672
+SRCS = ds1672.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/rtc8583/Makefile b/sys/modules/i2c/rtc8583/Makefile
new file mode 100644
index 0000000..db8db82
--- /dev/null
+++ b/sys/modules/i2c/rtc8583/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = rtc8583
+SRCS = rtc8583.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud