summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2017-09-11 22:21:15 +0000
committerian <ian@FreeBSD.org>2017-09-11 22:21:15 +0000
commitce64ae816cc338cd0d507a32e6c38268127da375 (patch)
treee9c103fcb82b8a8222486b70b06f95b0116c5ff7 /sys/modules
parent74f1e217a6338494ae45d545204a3b53683d7654 (diff)
downloadFreeBSD-src-ce64ae816cc338cd0d507a32e6c38268127da375.zip
FreeBSD-src-ce64ae816cc338cd0d507a32e6c38268127da375.tar.gz
MFC r321708-r321712, r321721, r321726-r321727, r321746, r321751,
r321791-r321792, r321795, r321798, r321821, r321823, r321826, r321828, r321841, r321934, r322025-r322026, r322282, r322431, r322473, r322475-r322479 Lots of i2c RTC driver stuff... r321708: Replace the pcf8563 i2c RTC driver with a new nxprtc driver which handles all the chips in the NXP PCA212x and PCA/PCF85xx series. In addition to supporting more chips, this driver uses the countdown timer on the chips as a fractional seconds counter, giving it a resolution of about 15 milliseconds. r321709: Fix building this driver on non-FDT platforms. r321710: Add a few missing i2c devices that build fine on all arches. r321711: Move the device descriptions onto the device lines, so they cut and paste nicely into other config files. r321712: Add the i2c RTC drivers found on various arm systems. r321721: Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so that transfers will be done with proper ownership of the bus. No behavioral changes. r321726: Bugfixes and enhancements... Don't enable the oscillator when it is found to be stopped at init time, just let the first setting of valid time start it. But still report a dead battery if it's stopped at init time. Don't force the chip into 24hr mode, just cope with whatever mode it is already in. Align the RTC clock to top of second when setting it. r321727: Fix AM/PM mode handling. The bits to mask off in the hours register changes between 12/24 hour mode. Also fix conversion between 12 and 24 hour mode. It's not as easy as adding/subtracting 12, because the clock doesn't roll over 11->0, it rolls over 12->1; 0 isn't a valid hour in AM/PM mode. r321746: Use the new clock_schedule() to arrange for clock_settime() to be called at the right time to keep the RTC hardware time in sync, instead of using pause_sbt() to sleep until the right time. r321751: Remove now-unused variable. r321791: Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so that transfers will be done with proper ownership of the bus. No behavioral changes. Also add a detach() method. r321792: Add a detach() method. r321795: Check the clock-halted flag every time the clock is read, not just once at startup. The flag stays set until the clock is loaded with good time, so we need to keep saying the time is invalid until that happens. r321798: Restore a few rather important lines of code that got fumbled in r321746. r321821: No need to call getnanotime() now that the waiting is done by the central subr_rtc code, switch from CLOCKF_SETTIME_NO_TS to CLOCKF_SETTIME_NO_ADJ so that we get fed a timestamp, but it's not adjusted to compensate for inaccuracy in setting time. r321823: Bugfixes and enhancements... Don't enable the oscillator when it is found to be stopped at init time, just let the first setting of valid time start it. But still report a dead battery if it's stopped at init time. Don't force the chip into 24hr mode, just cope with whatever mode it is already in. Schedule the clock_settime() callbacks to align the RTC clock to top of second when setting it. r321826: Restructure the SUBDIR list as 1-per-line and alphabetize, so it will be easier to add new things (and see what changed) in the future. r321828: Build iicbus/{ds1307,ds3231,nxprtc} as modules. r321841: Add a driver for the Intersil ISL12xx family of i2c RTC chips. Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC functionality, not all the other fancy stuff the chips can do). r321934: Add missing ofw_bus_if.h src file. r322025: Switch to iicdev_readfrom/writeto() to do xfers with proper bus ownership. Tested by: manu@ r322026: Add missing header file to SRCS. Reported by: manu@ r322282: Remove the ds133x and s35390a i2c RTC drivers for now. They both do i2c transfers in their probe() or attach() routines, and that doesn't work when the low-level controller requires interrupts to be functional. The DS133x family of chips is nearly identical to the DS1307 and support for them should be added to that driver, then the ds133x driver can be deleted. The s35390a driver just needs a non-trivial workover. In both cases that work will be done and committed separately. r322431: Bid for the device with BUS_PROBE_GENERIC, because this is very much a generic driver with minimal feature support for a large number of chips. More featureful per-chip drivers might exist (especially out-of-tree) and those should win the bidding even if they use BUS_PROBE_DEFAULT. r322473: Add a new driver, ds13rtc, that handles all DS13xx series i2c RTC chips. This driver supports only basic timekeeping functionality. It completely replaces the ds133x driver. It can also replace the ds1374 driver, but that will take a few other changes in MIPS code and config, and will be committed separately. It does NOT replace the existing ds1307 driver, which provides access to some of the extended features on the 1307 chip, such as controlling the square wave output signal. If both ds1307 and ds13rtc drivers are present, the ds1307 driver will outbid and win control of the device. This driver can be configured with FDT data, or by using hints on non-FDT systems. In addition to the standard hints for i2c devices, it requires a "chiptype" string of the form "dallas,ds13xx" where 'xx' is the chip id (i.e., the same format as FDT compat strings). r322475: Change "chiptype" to "compatible". Making the hint name the same as the FDT property name should make it easier to document the list of names accepted by both configuration mechanisms. r322476: Remove the old ds1374 driver and use the ds13rtc driver instead. Adjust several mips config files accordingly. r322477: Minor fixes and enhancements for the s35390a i2c RTC driver... - Add FDT probe code. - Do i2c transfers with exclusive bus ownership. - Use config_intrhook_oneshot() to defer chip setup because some i2c busses can't do transfers without interrupts. - Add a detach() routine. - Add to module build. r322478: Add back the drivers for Dallas/Maxim ds13xx and Seiko S35390x now that they've been rewritten/fixed to not cause panics by doing i2c transfers before interrupts are available. PR: 221227 r322479: Add hinted attachment for non-FDT systems. Also, print a message if setting up the timer fails, because on some types of chips that's the first attempt to access the device. If the chip is missing/non-responsive then you'd get a driver that attached and didn't register the rtc, with no clue about why. On other chip types there are inits that come before timer setup, and they already print messages about errors.
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/i2c/Makefile20
-rw-r--r--sys/modules/i2c/ds1307/Makefile7
-rw-r--r--sys/modules/i2c/ds13rtc/Makefile7
-rw-r--r--sys/modules/i2c/ds3231/Makefile7
-rw-r--r--sys/modules/i2c/isl12xx/Makefile7
-rw-r--r--sys/modules/i2c/nxprtc/Makefile7
-rw-r--r--sys/modules/i2c/s35390a/Makefile7
7 files changed, 60 insertions, 2 deletions
diff --git a/sys/modules/i2c/Makefile b/sys/modules/i2c/Makefile
index 8e9bdf9..34124c6 100644
--- a/sys/modules/i2c/Makefile
+++ b/sys/modules/i2c/Makefile
@@ -1,6 +1,22 @@
# $FreeBSD$
-SUBDIR =
-SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb isl jedec_ts
+SUBDIR = \
+ controllers \
+ cyapa \
+ ds1307 \
+ ds13rtc \
+ ds3231 \
+ if_ic \
+ iic \
+ iicbb \
+ iicbus \
+ iicsmb \
+ isl \
+ isl12xx \
+ jedec_ts \
+ nxprtc \
+ s35390a \
+ smb \
+ smbus \
.include <bsd.subdir.mk>
diff --git a/sys/modules/i2c/ds1307/Makefile b/sys/modules/i2c/ds1307/Makefile
new file mode 100644
index 0000000..32b8039
--- /dev/null
+++ b/sys/modules/i2c/ds1307/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = ds1307
+SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/ds13rtc/Makefile b/sys/modules/i2c/ds13rtc/Makefile
new file mode 100644
index 0000000..e50bc2f
--- /dev/null
+++ b/sys/modules/i2c/ds13rtc/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = ds13rtc
+SRCS = ds13rtc.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/ds3231/Makefile b/sys/modules/i2c/ds3231/Makefile
new file mode 100644
index 0000000..e75c47c
--- /dev/null
+++ b/sys/modules/i2c/ds3231/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = ds3231
+SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/isl12xx/Makefile b/sys/modules/i2c/isl12xx/Makefile
new file mode 100644
index 0000000..5f31317
--- /dev/null
+++ b/sys/modules/i2c/isl12xx/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = isl12xx
+SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/nxprtc/Makefile b/sys/modules/i2c/nxprtc/Makefile
new file mode 100644
index 0000000..d2252b1
--- /dev/null
+++ b/sys/modules/i2c/nxprtc/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = nxprtc
+SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/s35390a/Makefile b/sys/modules/i2c/s35390a/Makefile
new file mode 100644
index 0000000..1e6e93e
--- /dev/null
+++ b/sys/modules/i2c/s35390a/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = s35390a
+SRCS = s35390a.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud