<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/modules/i2c, branch release/11.3.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F11.3.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F11.3.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2018-04-06T16:48:07Z</updated>
<entry>
<title>MFC r331868:</title>
<updated>2018-04-06T16:48:07Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-04-06T16:48:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=ba2d2e5648cdee457124ebbeccad144320378070'/>
<id>urn:sha1:ba2d2e5648cdee457124ebbeccad144320378070</id>
<content type='text'>
Add opt_platform.h for several modules that have #ifdef FDT in the source.

Submitted by:	Andre Albsmeier &lt;Andre.Albsmeier@siemens.com&gt;

PR:		227322 227323
</content>
</entry>
<entry>
<title>MFC r325233, r328956, r329170, r329172-r329173, r329224, r330403-r330407,</title>
<updated>2018-03-24T23:01:10Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-03-24T23:01:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=b5bc29ddb9c6b21af4454c5fb5ac4a442afb3ce2'/>
<id>urn:sha1:b5bc29ddb9c6b21af4454c5fb5ac4a442afb3ce2</id>
<content type='text'>
    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 &lt;yamori83@yahoo.co.jp&gt;
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 &lt;jonlooney@gmail.com&gt;
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.
</content>
</entry>
<entry>
<title>MFC r329534-r329535</title>
<updated>2018-03-24T22:50:59Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-03-24T22:50:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=2d47d4d978723f9e1d76c8334e239e60235185e7'/>
<id>urn:sha1:2d47d4d978723f9e1d76c8334e239e60235185e7</id>
<content type='text'>
r329534:
Arrange SRCS= as 1 file per line, alphabetical, so it's easier to maintain.
Whitespace only, no functional changes.

r329535:
Add iic_recover_bus.c, now part of iicbus.  This should have been added
as part of r320463.
</content>
</entry>
<entry>
<title>MFC r329479-r329480, r329483, r329506-r329507, r329526, r329529, r329536,</title>
<updated>2018-03-24T22:39:38Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-03-24T22:39:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=15358f1adff4f7fe8aa863f617ec04b53698abb1'/>
<id>urn:sha1:15358f1adff4f7fe8aa863f617ec04b53698abb1</id>
<content type='text'>
    r329541, r329730, r329841, r329988, r330397

r329479:
Do not try to deallocate memory that wasn't allocated (you'd think that
would be safe, but the function also tries to destroy mutexes that never
got created).

I guess this can only happen when imx_ehci_detach() is called on the
error-exit path from imx_ehci_attach(), and that path never got exercised
before today.

r329480:
Don't call sdhci_cleanup_slot() if sdhci_init_slot() never got called.
Also, do callout_init() very early in attach, so that callout_drain()
can be called in detach without worrying about whether it ever got init'd.

r329483:
Fix fallout from the import of fresh dts source files from linux 4.15.  It
appears that node names no longer include leading zeroes in the @address
qualifiers, so we have to search for the nodes involved in interrupt fixup
using both flavors of name to be compatible with old and new .dtb files.

(You know you're in a bad place when you're applying a workaround to code
that exists only as a workaround for another problem.)

r329506:
Add a detach method so that this can be a kldunload-friendly module.

r329507:
Build modules specific to imx5/imx6 only when building those kernels.

This adds sys/modules/imx with a SUBDIR makefile to make the whole
collection of modules that are specific to these SoCs.  Initially, that
"whole collection" consists of the if_ffec and imx_i2c drivers.

The if_ffec driver is referenced in its existing home in ../ffec rather
than moving it into the imx directory, because it's used by powerpc too,
but it is no longer built for all armv6/7 systems.

The imx_i2c driver is newly added as a module.

r329526:
Allow i2c hardware drivers to declare their own relationships to ofw_iicbus
rather than relying on a set of canned EARLY_DRIVER_MODULE() statements in
the ofw_iicbus source.  This means hw drivers will no longer be required to
use one of a few predefined driver names.  They will also now be able to
decide themselves if they want to use DRIVER_MODULE or EARLY_DRIVER_MODULE
and to set which pass to attach on for early modules.

Mainly, this adds extern declarations for the driver and devclass variables.
It also renames ofwiicbus_devclass to ofw_iicbus_devclass to be consistant
with the way we use ofw_ prefixes on this stuff.

r329529:
Give the imx_i2c driver its own name, set up its relationship to ofw_iicbus.
Previously it called itself 'iichb' to link up with the EARLY_DRIVER_MODULE
declaration in ofw_iicbus.c.

r329536:
Add the MODULE_DEPEND()s needed so that the kernel linker can resolve all
the symbols at load time when iicbus is not compiled into the kernel.

r329541:
Build ofw_iicbus as a module if OPT_FDT is defined.

r329730:
Add required header files.

Reported by:	andreast@

r329841:
Add a missing line continuation.

How many commits does it take to get a simple module makefile working?
Apparently at least three.

Pointy hat to:  ian

r329988:
Instead of building ofw_iicbus as a separate module, just compile it in to
the iicbus module for FDT-based systems.

The primary motivation for this is that host controller drivers which
declare DRIVER_MODULE(ofw_iicbus, thisdriver, etc, etc) now only need a
single MODULE_DEPEND(thisdriver, ofw_iicbus) for runtime linking to resolve
all the symbols.  With ofw_iicbus and iicbus in separate modules, drivers
would need to declare a MODULE_DEPEND() on both, because symbol lookup is
non-recursive through the dependency chain.  Requiring a driver to have
MODULE_DEPENDS() on both amounts to requiring the drivers to understand the
kobj inheritence details of how ofw_iicbus is implemented, which seems like
something they shouldn't have to know (and could even change some day).

Also, this is somewhat analogous to how the drivers get built when compiled
into the kernel.  You don't have to ask for ofw_iicbus separately, it just
gets built in along with iicbus when option FDT is in effect.

r330397:
Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's.
</content>
</entry>
<entry>
<title>MFC r330304: imcsmb(4): Intel integrated Memory Controller (iMC) SMBus</title>
<updated>2018-03-09T02:55:22Z</updated>
<author>
<name>Ravi Pokala</name>
<email>rpokala@FreeBSD.org</email>
</author>
<published>2018-03-09T02:55:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=4a4277f839d8505ac11be5e0fb3a0228efdec4a5'/>
<id>urn:sha1:4a4277f839d8505ac11be5e0fb3a0228efdec4a5</id>
<content type='text'>
controller driver

imcsmb(4) provides smbus(4) support for the SMBus controller functionality
in the integrated Memory Controllers (iMCs) embedded in Intel Sandybridge-
Xeon, Ivybridge-Xeon, Haswell-Xeon, and Broadwell-Xeon CPUs. Each CPU
implements one or more iMCs, depending on the number of cores; each iMC
implements two SMBus controllers (iMC-SMBs).

*** IMPORTANT NOTE ***
Because motherboard firmware or the BMC might try to use the iMC-SMBs for
monitoring DIMM temperatures and/or managing an NVDIMM, the driver might
need to temporarily disable those functions, or take a hardware interlock,
before using the iMC-SMBs. Details on how to do this may vary from board to
board, and the procedure may be proprietary. It is strongly suggested that
anyone wishing to use this driver contact their motherboard vendor, and
modify the driver as described in the manual page and in the driver itself.
(For what it's worth, the driver as-is has been tested on various SuperMicro
motherboards.)
</content>
</entry>
<entry>
<title>MFC r329843:</title>
<updated>2018-02-28T09:59:44Z</updated>
<author>
<name>Ravi Pokala</name>
<email>rpokala@FreeBSD.org</email>
</author>
<published>2018-02-28T09:59:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=aacc39268530aabc3a1b078db9458f8a96a6f802'/>
<id>urn:sha1:aacc39268530aabc3a1b078db9458f8a96a6f802</id>
<content type='text'>
jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs

A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset
information (Part Number, Serial Number) encoded in the "Serial Presence
Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and
reports the memory capacity of the DIMM, in megabytes. If the DIMM includes
a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported.
</content>
</entry>
<entry>
<title>MFC r323474, r323553, r323691</title>
<updated>2017-09-22T15:53:22Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2017-09-22T15:53:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=0b61667cf310489e72ea5e2f094223b4ad7d6579'/>
<id>urn:sha1:0b61667cf310489e72ea5e2f094223b4ad7d6579</id>
<content type='text'>
r323474:
Add a default implementation that returns ENODEV for start, repeat_start,
stop, read, and write methods.  Some controllers don't implement these
individual operations and have only a transfer method.  In that case, we
should return an indication that the device is present but doesn't support
the method, as opposed to the kobj default error ENXIO which makes it
look like the whole device is missing.  Userland tools such as i2c(8) can
use the differing return values to switch between the two different i2c
IO mechanisms.

r323553:
Defer attaching and probing iicbus and its children until interrupts are
available, in i2c controller drivers that require interrupts for transfers.

This is the result of auditing all 22 existing drivers that attach iicbus.
These drivers were the only ones remaining that require interrupts and were
not using config_intrhook to defer attachment.  That has led, over the
years, to various i2c slave device drivers needing to use config_intrhook
themselves rather than performing bus transactions in their probe() and
attach() methods, just in case they were attached too early.

r323691:
Give icee(4) a detach() method so it can be used as a module.  Add a
module makefile for it.
</content>
</entry>
<entry>
<title>MFC r323642:</title>
<updated>2017-09-22T15:40:56Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2017-09-22T15:40:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=e03a9d442840466e76757d5e40cc8b5439e1860c'/>
<id>urn:sha1:e03a9d442840466e76757d5e40cc8b5439e1860c</id>
<content type='text'>
Add a missing header file to SRCS to fix out-of-kernel builds.

PR:		222354
Submitted by:	eugen@
Pointy hat:	ian@
</content>
</entry>
<entry>
<title>MFC r321708-r321712, r321721, r321726-r321727, r321746, r321751,</title>
<updated>2017-09-11T22:21:15Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2017-09-11T22:21:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=45c004d0a94262e9ac1b8c1cf8aae3cc4f36106c'/>
<id>urn:sha1:45c004d0a94262e9ac1b8c1cf8aae3cc4f36106c</id>
<content type='text'>
    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-&gt;0, it rolls over 12-&gt;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.
</content>
</entry>
<entry>
<title>MFC r314651,r318439,r318440:</title>
<updated>2017-05-30T04:11:12Z</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2017-05-30T04:11:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=cad800042f49286971db31b628d86a2be5d134ea'/>
<id>urn:sha1:cad800042f49286971db31b628d86a2be5d134ea</id>
<content type='text'>
r314651:

sys/modules: normalize .CURDIR-relative paths to SRCTOP

This simplifies make output/logic

Tested with:	`cd sys/modules; make ALL_MODULES=` on amd64

r318439:

Normalize .PATH on SRCTOP

This will help Jenkins dedupe 9 warnings between the static build and
the module build of ipsec(4).

Missed in SRCTOP conversion in r314651.

MFC with:	r314651

r318440:

Normalize SYSDIR on SRCTOP instead of .CURDIR

This is being done to simplify pathing for CFLAGS and source files.
</content>
</entry>
</feed>
