aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/i2c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce support for Epson RX-8803 RTC.Marcin Wojtas2020-05-252-1/+18
| | | | | | | | | | | | | | | This patch introduces support for Epson RX-8803 RTC controller accessible over I2C bus. It has a resolution of 1 sec. Support for interrupt based alarm was not implemented. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: manu Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D24364 Notes: svn path=/head/; revision=361463
* Add TCA6416 GPIO expander support.Marcin Wojtas2020-05-252-0/+11
| | | | | | | | | | | | | | | Add basic TCA6416 GPIO expander support over I2C bus. The driver handles enabling and disabling pins, setting pin mode to IN and OUT and toggling the pins. External interrupts are not supported. Submitted by: Dawid Gorecki <dgr@semihalf.com> Reviewed by: manu, mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D24363 Notes: svn path=/head/; revision=361462
* iicbus(4): Add support for ACPI-based children enumerationVladimir Kondratyev2020-03-091-0/+5
| | | | | | | | | | | | | | | | | | | | When iicbus is attached as child of Designware I2C controller it scans all ACPI nodes for "I2C Serial Bus Connection Resource Descriptor" described in section 19.6.57 of ACPI specs. If such a descriptor is found, I2C child is added to iicbus, it's I2C address, IRQ resource and ACPI handle are added to ivars. Existing ACPI bus-hosted child is deleted afterwards. The driver also installs so called "I2C address space handler" which is disabled by default as nontested. Set hw.iicbus.enable_acpi_space_handler loader tunable to 1 to enable it. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22901 Notes: svn path=/head/; revision=358820
* Remove sparc64 kernel supportWarner Losh2020-02-031-8/+2
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* Add support for i2c bus mux hardware.Ian Lepore2020-01-025-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An i2c bus can be divided into segments which can be selectively connected and disconnected from the main bus. This is usually done to enable using multiple slave devices having the same address, by isolating the devices onto separate bus segments, only one of which is connected to the main bus at once. There are several types of i2c bus muxes, which break down into two general categories... - Muxes which are themselves i2c slaves. These devices respond to i2c commands on their upstream bus, and based on those commands, connect various downstream buses to the upstream. In newbus terms, they are both a child of an iicbus and the parent of one or more iicbus instances. - Muxes which are not i2c devices themselves. Such devices are part of the i2c bus electrically, but in newbus terms their parent is some other bus. The association with the upstream bus must be established by separate metadata (such as FDT data). In both cases, the mux driver has one or more iicbus child instances representing the downstream buses. The mux driver implements the iicbus_if interface, as if it were an iichb host bridge/i2c controller driver. It services the IO requests sent to it by forwarding them to the iicbus instance representing the upstream bus, after electrically connecting the upstream bus to the downstream bus that hosts the i2c slave device which made the IO request. The net effect is automatic mux switching which is transparent to slaves on the downstream buses. They just do i2c IO they way they normally do, and the bus is electrically connected for the duration of the IO and then idled when it is complete. The existing iicbus_if callback() method is enhanced so that the parameter passed to it can be a struct which contains a device_t for the requesting bus and slave devices. This change is done by adding a flag that indicates the extra values are present, and making the flags field the first field of a new args struct. If the flag is set, the iichb or mux driver can recast the pointer-to-flags into a pointer-to-struct and access the extra fields. Thus abi compatibility with older drivers is retained (but a mux cannot exist on the bus with the older iicbus driver in use.) A new set of core support routines exists in iicbus.c. This code will help implement mux drivers for any type of mux hardware by supplying all the boilerplate code that forwards IO requests upstream. It also has code for parsing metadata and instantiating the child iicbus instances based on it. Two new hardware mux drivers are added. The ltc430x driver supports the LTC4305/4306 mux chips which are controlled via i2c commands. The iic_gpiomux driver supports any mux hardware which is controlled by manipulating the state of one or more gpio pins. Test Plan Tested locally using a variety of mux'd bus configurations involving both ltc4305 and a homebrew gpio-controlled mux. Tested configurations included cascaded muxes (unlikely in the real world, but useful to prove that 'it all just works' in terms of the automatic switching and upstream forwarding of IO requests). Notes: svn path=/head/; revision=356278
* Include ofw_bus_if.h in SRCS only on systems configured with the FDT option.Ian Lepore2019-12-131-1/+4
| | | | Notes: svn path=/head/; revision=355738
* Add a driver for Texas Instruments ADS101x/ADS111x i2c ADC chips.Ian Lepore2019-08-052-0/+16
| | | | | | | | | | Instances of the device can be configured using hints or FDT data. Interfaces to reconfigure the chip and extract voltage measurements from it are available via sysctl(8). Notes: svn path=/head/; revision=350591
* enable ig4_acpi on aarch64Ed Maste2019-07-241-1/+2
| | | | | | | | | | | The already-listed APMC0D0F ID belongs to the Ampere eMAG aarch64 platform, but ACPI support was not even built on aarch64. Submitted by: Greg V <greg_unrelenting.technology> Differential Revision: https://reviews.freebsd.org/D21059 Notes: svn path=/head/; revision=350303
* Remove jedec_ts(4)Ravi Pokala2018-08-012-8/+0
| | | | | | | | | | | | | | The jedec_ts(4) driver has been marked as deprecated in stable/11, and is now being removed from -HEAD. Add a notice in UPDATING, and update the few remaining references (regarding jedec_dimm(4)'s compatibility and history) to reflect the fact that jedec_ts(4) is now deleted. Reviewed by: avg Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16537 Notes: svn path=/head/; revision=337033
* Add opt_platform.h for several modules that have #ifdef FDT in the source.Ian Lepore2018-04-012-1/+2
| | | | | | | Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> Notes: svn path=/head/; revision=331868
* Build the ds1672 driver as a module. Add a detach() to unregister the rtc.Ian Lepore2018-03-062-0/+20
| | | | Notes: svn path=/head/; revision=330529
* Build iicbus/rtc8583 as a module.Ian Lepore2018-03-042-0/+20
| | | | Notes: svn path=/head/; revision=330412
* imcsmb(4): Intel integrated Memory Controller (iMC) SMBus controller driverRavi Pokala2018-03-032-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.) Reviewed by: avg, jhb MFC after: 1 week Relnotes: yes Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D14447 Discussed with: avg, ian, jhb Tested by: allanjude (previous version), Panasas Notes: svn path=/head/; revision=330304
* Instead of building ofw_iicbus as a separate module, just compile it in toIan Lepore2018-02-253-19/+4
| | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=329988
* jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMsRavi Pokala2018-02-222-0/+8
| | | | | | | | | | | | | | | | | | | 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. Reviewed by: cem MFC after: 1 week Relnotes: yes Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D14392 Discussed with: avg, cem Tested by: avg, cem (previous version, no semantic changes) Notes: svn path=/head/; revision=329843
* Build ofw_iicbus as a module if OPT_FDT is defined.Ian Lepore2018-02-192-0/+19
| | | | Notes: svn path=/head/; revision=329541
* Add iic_recover_bus.c, now part of iicbus. This should have been addedIan Lepore2018-02-181-0/+1
| | | | | | | as part of r320463. Notes: svn path=/head/; revision=329535
* Arrange SRCS= as 1 file per line, alphabetical, so it's easier to maintain.Ian Lepore2018-02-181-4/+12
| | | | | | | Whitespace only, no functional changes. Notes: svn path=/head/; revision=329534
* Give icee(4) a detach() method so it can be used as a module. Add aIan Lepore2017-09-172-0/+15
| | | | | | | module makefile for it. Notes: svn path=/head/; revision=323691
* Add a missing header file to SRCS to fix out-of-kernel builds.Ian Lepore2017-09-166-6/+6
| | | | | | | | | PR: 222354 Submitted by: eugen@ Pointy hat: ian@ Notes: svn path=/head/; revision=323642
* Minor fixes and enhancements for the s35390a i2c RTC driver...Ian Lepore2017-08-142-0/+8
| | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=322477
* Add a new driver, ds13rtc, that handles all DS13xx series i2c RTC chips.Ian Lepore2017-08-132-0/+8
| | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=322473
* Add missing header file to SRCS.Ian Lepore2017-08-031-1/+1
| | | | | | | Reported by: manu@ Notes: svn path=/head/; revision=322026
* Add missing ofw_bus_if.h src file.Ian Lepore2017-08-023-3/+3
| | | | Notes: svn path=/head/; revision=321934
* Add a driver for the Intersil ISL12xx family of i2c RTC chips.Ian Lepore2017-08-012-0/+8
| | | | | | | | Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC functionality, not all the other fancy stuff the chips can do). Notes: svn path=/head/; revision=321841
* Build iicbus/{ds1307,ds3231,nxprtc} as modules.Ian Lepore2017-07-314-0/+24
| | | | Notes: svn path=/head/; revision=321828
* Restructure the SUBDIR list as 1-per-line and alphabetize, so it will beIan Lepore2017-07-311-2/+12
| | | | | | | easier to add new things (and see what changed) in the future. Notes: svn path=/head/; revision=321826
* sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper2017-03-0421-21/+21
| | | | | | | | | | | This simplifies make output/logic Tested with: `cd sys/modules; make ALL_MODULES=` on amd64 MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314651
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-4/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* [ig4] Add ACPI platform support for ig4 driverOleksandr Tymoshenko2016-12-261-2/+7
| | | | | | | | | | | | Add ACPI part for ig4 driver to make it work on Intel BayTrail SoC where ig4 device is available only through ACPI Reviewed by: avg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8742 Notes: svn path=/head/; revision=310621
* add iic interface to ig4 driver, move isl and cyapa to iicbusAndriy Gapon2016-10-303-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The hardware does not expose a classic SMBus interface. Instead it has a lower level interface that can express a far richer I2C protocol than what smbus offers. However, the interface does not provide a way to explicitly generate the I2C stop and start conditions. It's only possible to request that the stop condition is generated after transferring the next byte in either direction. So, at least one data byte must always be transferred. Thus, some I2C sequences are impossible to generate, e.g., an equivalent of smbus quick command (<start>-<slave addr>-<r/w bit>-<stop>). At the same time isl(4) and cyapa(4) are moved to iicbus and now they use iicbus_transfer for communication. Previously they used smbus_trans() interface that is not defined by the SMBus protocol and was implemented only by ig4(4). In fact, that interface was impossible to implement for the typical SMBus controllers like intpm(4) or ichsmb(4) where a type of the SMBus command must be programmed. The plan is to remove smbus_trans() and all its uses. As an aside, the smbus_trans() method deviates from the standard, but perhaps backwards, FreeBSD convention of using 8-bit slave addresses (shifted by 1 bit to the left). The method expects 7-bit addresses. There is a user facing consequence of this change. A user must now provide device hints for isl and cyapa that specify an iicbus to use and a slave address on it. On Chromebook hardware where isl and cyapa devices are commonly found it is also possible to use a new chromebook_platform(4) driver that automatically configures isl and cyapa devices. There is no need to provide the device hints in that case, Right now smbus(4) driver tries to discover all slaves on the bus. That is very dangerous. Fortunately, the probing code uses smbus_trans() to do its job, so it is really enabled for ig4 only. The plan is to remove that auto-probing code and smbus_trans(). Tested by: grembo, Matthias Apitz <guru@unixarea.de> (w/o chromebook_platform) Discussed with: grembo, imp Reviewed by: wblock (docs) MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D8172 Notes: svn path=/head/; revision=308104
* jedec_ts: a driver for thermal sensors on memory modulesAndriy Gapon2016-10-222-1/+8
| | | | | | | | | | | | | | | | | | | | The driver currently supports chips that are fully compliant with the JEDEC SPD / EEPROM / TS standard (JEDEC Standard 21-C, TSE2002 Specification, frequenlty referred to as JEDEC JC 42.4). Additionally some chips from STMicroelectronics are supported as well. They are compliant except for their Device ID pattern. Given the continued lack of any common sensor infrastructure, the driver uses an ad-hoc sysctl to report the temperature. Reviewed by: wblock (documentation) MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D8174 Notes: svn path=/head/; revision=307768
* Build ofw_bus_if.h for modules for RISC-V.Ruslan Bukin2016-07-281-1/+2
| | | | Notes: svn path=/head/; revision=303440
* MIPS also needs ofw_bus_if.h in some cases.Brooks Davis2016-01-201-1/+1
| | | | Notes: svn path=/head/; revision=294461
* Build ofw_bus_if.h for modules that need it on arm64Ed Maste2015-10-211-1/+2
| | | | Notes: svn path=/head/; revision=289710
* isl(4), driver for Intersil I2C ISL29018 Digital Ambient Light SensorMichael Gmelin2015-07-252-1/+8
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2811 Reviewed by: adrian, wblock Approved by: adrian, wblock Relnotes: yes Notes: svn path=/head/; revision=285883
* cyapa(4), driver for the Cypress APA I2C trackpadMichael Gmelin2015-07-252-1/+8
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D3068 Reviewed by: kib, wblock Approved by: kib Relnotes: yes Notes: svn path=/head/; revision=285876
* ig4 - Intel fourth gen integrated I2C SMBus driver.Michael Gmelin2015-05-302-1/+9
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2372 Reviewed by: jhb, wblock, adrian Approved by: jhb, wblock Relnotes: yes Notes: svn path=/head/; revision=283766
* Fix build race on armv6* and powerpc*.Andreas Tobler2015-04-041-1/+4
| | | | | | | | | Tested with cross builds amd64 -> armv6(hf) and powerpc(64). Suggested by: andrew@ Notes: svn path=/head/; revision=281083
* Move all the power management (SMBus) drivers to their own directory,Rui Paulo2014-09-234-4/+4
| | | | | | | away from sys/pci. Notes: svn path=/head/; revision=272017
* Move amdsmb and nfsmb from dev/pci to their own device directory.Rui Paulo2014-09-232-2/+2
| | | | Notes: svn path=/head/; revision=272016
* Add ismt(4) driver.Jim Harris2014-05-202-1/+9
| | | | | | | | | | ismt(4) supports the SMBus Message Transport controller found on Intel C2000 series (Avoton) and S1200 series (Briarwood) Atom SoCs. Sponsored by: Intel Notes: svn path=/head/; revision=266474
* Fix make depend.Li-Wen Hsu2014-02-261-1/+1
| | | | | | | Approved by: uqs Notes: svn path=/head/; revision=262522
* MFtbemd:Warner Losh2010-08-231-2/+2
| | | | | | | | | | | | Use MACHINE_CPUARCH in preference to MACHINE_ARCH. The former is the source code location of the machine, the latter the binary output. In general, we want to use MACHINE_CPUARCH instead of MACHINE_ARCH unless we're tesitng for a specific target. The isn't even moot for i386/amd64 where there's momemntum towards a MACHINE_CPUARCH == x86, although a specific cleanup for that likely would be needed... Notes: svn path=/head/; revision=211690
* The viapm module build had what appear to be some debugging CFLAGS leftNate Lawson2007-06-242-2/+0
| | | | | | | | | | | | | | | around to force the IO port to a fixed address. They were only turned on in the module build and were present since the original import. This breaks soft power-off on the Asus A7V since it reprograms the SMBus base address to a different one than the BIOS expects. A similar issue was found in the alpm(4) module build. PR: kern/113986, i386/97468 MFC after: 3 days Approved by: re Notes: svn path=/head/; revision=171020
* Drivers for AMD-8111 and NVIDIA nForce2/3/4 SMBus 2.0 controllers.Ruslan Ermilov2005-12-213-1/+19
| | | | Notes: svn path=/head/; revision=153618
* - Add ofw_bus_if.h to SRCS on sparc64 as envctrl.c and pcf_ebus.c dependMarius Strobl2005-11-221-8/+11
| | | | | | | | | on it. - Sync with sys/conf/files* and build pcf_isa.c only on i386 for now. - Try to adhere to style.Makefile(5) (sorting, whitespace). Notes: svn path=/head/; revision=152687
* Fix standalone module build for viapm. Note that by default it doesn'tJohn Baldwin2005-11-081-2/+2
| | | | | | | include the ISA bus support even though it probably should. Notes: svn path=/head/; revision=152204
* Finally complete some work on generalizing the PCF8584-based I2CJoerg Wunsch2005-10-281-1/+10
| | | | | | | | | | | | | | drivers I started quite some time before. Retire the old i386-only pcf driver, and activate the new general driver that has been sitting in the tree already for quite some time. Build the i2c modules for sparc64 architectures as well (where I've been developing all this on). Notes: svn path=/head/; revision=151805
* Hook ichsmb to build.Takanori Watanabe2005-06-051-1/+1
| | | | Notes: svn path=/head/; revision=146997