aboutsummaryrefslogtreecommitdiffstats
path: root/sys/modules
Commit message (Collapse)AuthorAgeFilesLines
* MFS r365937, which merged r365861 and r365872 from head to stable/12.Navdeep Parhar2020-09-213-3/+3
| | | | | | | | | | | | | | r365861: cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0. r365872: cxgbe(4): add the firmware binaries instead of the empty files that were added in r365861. Approved by: re@ (gjb@) Notes: svn path=/releng/12.2/; revision=365961
* ice(4): Add Intel 100GbE Ethernet Driver to kernelEric Joyner2020-09-143-0/+30
| | | | | | | | | | | | | | This also adds the "package" file that's loaded by the device for configuration, used in the included ice_ddp kernel module. MFS of r365612 and r365731. Approved by: re (gjb@) Relnotes: yes Sponsored by: Intel Corporation Notes: svn path=/releng/12.2/; revision=365733
* MFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE'John Baldwin2020-09-081-1/+1
| | | | Notes: svn path=/stable/12/; revision=365470
* Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds.John Baldwin2020-09-081-2/+1
| | | | | | | | | | | | | This was included in the original commit to head that added use of KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk hadn't been MFC'd at the time. It has since been merged. This is a direct commit to stable/11 and stable/12. Reported by: Eugene Grosbein <eugen@grosbein.net> Notes: svn path=/stable/12/; revision=365469
* Partial MFC 357275: if_vlan grew a dependency on opt_inet6.h in r356993John Baldwin2020-09-081-1/+1
| | | | Notes: svn path=/stable/12/; revision=365468
* MFC 361634: Add opt_ipsec.h to fix standalone builds after r361633.John Baldwin2020-09-081-1/+1
| | | | Notes: svn path=/stable/12/; revision=365467
* MFC: ENA netmap support and bug fixesMarcin Wojtas2020-09-061-1/+2
| | | | | | | | | | | | | | | | | | | r363638 Fix ENA build when integrated into kernel r354242 Make valdiate_rx_req_id static inline because it uses other static r354225 Update ENA version to v2.1.0 r354224 Add support for ENA NETMAP partial initialization r354223 Add support for ENA NETMAP Tx r354222 Add support for ENA NETMAP Rx r354221 Introduce NETMAP support in ENA r354220 Split Rx/Tx from initialization code in ENA driver r354219 Fix ENA keep-alive timeout due to prolonged reset r354218 Add WC support for arm64 in the ENA driver Obtained from: Semihalf Sponsored by: Amazon, Inc. Notes: svn path=/stable/12/; revision=365380
* MFC: Merge ENA v2.0.0 driverMarcin Wojtas2020-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r348416 Update ENA version to v2.0.0 r348414 Fix ENA manual issues r348413 Improve ENA reset handling r348412 Fix NULL pointer dereference in ena_up() r348411 Unify new line characters in the ENA driver r348410 Fix Tx offloads for fragmented pkt headers in ENA r348409 Split ENA reset routine into restore and destroy stages r348408 Use bitfield for storing global ENA device states r348407 Fix error handling when ENA reset fails r348406 Fill bdf field of the host_info structure in ENA r348405 Add additional doorbells on ENA Tx path r348404 Limit maximum size of Rx refill threshold in ENA r348403 Add support for the LLQv2 and WC in ENA r348402 Lock optimization in ENA r348401 Add tuneable drbr ring size and hw queues depth for ENA r348400 Fix error in validate_tx_req_id() in ENA r348399 Change attach order to prevent crash upon failure in ENA r348398 Change order of ifp release on ENA detach r348397 Check for number of MSI-x upon partial allocation in ENA r348396 Set error value when allocation of IO irq fails in ENA r348395 Set vaddr and paddr as NULL when DMA alloc fails in ENA r348394 Fix DMA synchronization in the ENA driver Tx and Rx paths r348393 Check for missing MSI-x and Tx completions in ENA r348392 Fill number of CPUs field on ENA host_info structure r348391 Print ENA Tx error conditionally r348390 Trigger reset in ENA if there are too many Rx descriptors r348389 Remove RSS support in ENA r348388 Add notification AENQ handler for ENA r348387 Print information when ENA admin error occurs r348386 Do not specify active media type in ENA r348385 Adjust ENA driver to the new ena-com Obtained from: Semihalf Sponsored by: Amazon, Inc. Notes: svn path=/stable/12/; revision=365379
* MFC r364973:Marko Zec2020-09-062-0/+11
| | | | | | | | | | | | | Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME development board. Submitted by: Denis Salopek <denis.salopek AT fer.hr> Reviewed by: zec, bz (src); rgrimes, bcr (manpages) Sponsored by: Google Summer of Code 2020 Differential Revision: https://reviews.freebsd.org/D26074 Notes: svn path=/stable/12/; revision=365374
* MFC r360035-r360037: Split XDR off, minimize ZFS dependencyKyle Evans2020-09-053-8/+14
| | | | | | | | | | | | | | | | | | __FreeBSD_version bumped to indicate the change. r360035: Move M_RPC malloc type into XDR. Both RPC and XDR libraries use this type, but since RPC depends on XDR (not vice versa) we need it defined in XDR to make the module loadable without RPC. r360036: Split XDR into separate kernel module. Make krpc depend on xdr. r360037: Make ZFS depend on xdr.ko only. It doesn't need kernel RPC. Notes: svn path=/stable/12/; revision=365356
* MFC 361638,361712: Only build ipsec modules for kernels with IPSEC_SUPPORT.John Baldwin2020-09-022-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 361638: Only build ipsec modules if the kernel includes IPSEC_SUPPORT. Honoring the kernel-supplied opt_ipsec.h in r361632 causes builds of ipsec modules to fail if the kernel doesn't include IPSEC_SUPPORT. However, the module can never be loaded into such a kernel, so only build the modules if the kernel includes IPSEC_SUPPORT. 361712: (kevans) modules: don't build ipsec/tcpmd5 if the kernel is configured for IPSEC IPSEC_SUPPORT can currently only cope with either IPSEC || IPSEC_SUPPORT, not both. Refrain from building if IPSEC is set, as the resulting module won't be able to load anyways if it's built into the kernel. KERN_OPTS is safe here; for tied modules, it will reflect the kernel configuration. For untied modules, it will defer to whatever is set in ^/sys/conf/config.mk, which doesn't set IPSEC for modules. The latter situation has some risk to it for uncommon scenarios, but such is the life of untied kernel modules. Notes: svn path=/stable/12/; revision=365281
* MFC 361632: Honor opt_ipsec.h from kernel builds.John Baldwin2020-09-022-6/+0
| | | | | | | | To make this simpler, set the default contents of opt_ipsec.h for standalone modules in sys/conf/config.mk. Notes: svn path=/stable/12/; revision=365270
* MFC r364269 by eugen: Unbreak building cp2112(8) as a module...Andriy Gapon2020-08-281-1/+1
| | | | | | | outside of kernel build environment. Notes: svn path=/stable/12/; revision=364913
* MFC r363951,r364143,r364144: cp2112: driver for the namesake GPIO and I2C ↵Andriy Gapon2020-08-282-0/+38
| | | | | | | master gadget Notes: svn path=/stable/12/; revision=364912
* MFC r347538 by dchagin:Edward Tomasz Napierala2020-08-243-27/+0
| | | | | | | | | | | | | | | | | | | | Linuxulator depends on a fundamental kernel settings such as SMP. Many of them listed in opt_global.h which is not generated while building modules outside of a kernel and such modules never match real cofigured kernel. So, we should prevent our users from building obviously defective modules. Therefore, remove the root cause of the building of modules outside of a kernel - the possibility of building modules with DEBUG or KTR flags. And remove all of DEBUG printfs as it is incomplete and in threaded programms not informative, also a half of system call does not have DEBUG printf. For debuging Linux programms we have dtrace, ktr and ktrace ability. PR: 222861 Notes: svn path=/stable/12/; revision=364712
* MFC r347533 by dchagin:Edward Tomasz Napierala2020-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functions alter the userspace sockaddr to convert the format between linux and BSD versions. That's the minimum 3 of copyin/copyout operations for one syscall. Also some syscall uses linux_sa_put() and linux_getsockaddr() when load sockaddr to userspace or from userspace accordingly. To avoid this chaos, especially converting sockaddr in the userspace, rewrite these 4 functions to convert sockaddr only in kernel and leave only 2 of this functions. Also in order to reduce duplication between MD parts of the Linuxulator put struct sockaddr conversion functions that are MI out into linux_common module. PR: 232920 Notes: svn path=/stable/12/; revision=364693
* MFC r350451 by emaste:Edward Tomasz Napierala2020-08-231-1/+1
| | | | | | | | | | | | | | | | | linuxulator: rename linux_locore.s to .asm It is assembled using "${CC} -x assembler-with-cpp", which by convention (bsd.suffixes.mk) uses the .asm extension. This is a portion of the review referenced below (D18344). That review also renamed linux_support.s to .S, but that is a functional change (using the compiler's integrated assembler instead of as) and will be revisited separately. Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/12/; revision=364552
* MFC r361992: ixl(4): Add FW recovery mode support and other thingsEric Joyner2020-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update the iflib version of ixl driver based on the OOT version ixl-1.11.29. Major changes: - Extract iflib specific functions from ixl_pf_main.c to ixl_pf_iflib.c to simplify code sharing between legacy and iflib version of driver - Add support for most recent FW API version (1.10), which extends FW LLDP Agent control by user to X722 devices - Improve handling of device global reset - Add support for the FW recovery mode - Use virtchnl function to validate virtual channel messages instead of using separate checks - Fix MAC/VLAN filters accounting Relnotes: yes Sponsored by: Intel Corporation Notes: svn path=/stable/12/; revision=363876
* MFC r358908: Enable ixl device on PowerPC64Eric Joyner2020-07-301-0/+2
| | | | | | | Relnotes: yes Notes: svn path=/stable/12/; revision=363712
* MFC r363232: build DTS for Orange Pi PC Plus as wellAndriy Gapon2020-07-301-0/+1
| | | | Notes: svn path=/stable/12/; revision=363695
* MFC r362530: teach ena driver about RSS kernel optionAndriy Gapon2020-07-301-0/+1
| | | | | | | | | | | | | | | Networking is broken if the driver configures its (virtual) hardware to use a hash algorithm (or a key) different from the one that the network stack (software RSS) uses. This can be seen with connections initiated from the host. The PCB will be placed into the hash table based on the hash value calculated by the software. The hardware-calculated hash value in reponse packets will be different, so the PCB won't be found. Tested with a kernel compiled with 'options RSS' on an instance with ena driver. Notes: svn path=/stable/12/; revision=363694
* Update the expression used to decide whether to build sctp.ko.Mark Johnston2020-07-271-1/+1
| | | | | | | | | This is a direct commit to stable/12. Reported by: Jenkins Notes: svn path=/stable/12/; revision=363610
* MFC r363079, r363080, r363129, r363133:Mark Johnston2020-07-272-0/+34
| | | | | | | Provide support for building SCTP as a loadable module. Notes: svn path=/stable/12/; revision=363609
* MFC r363180, r363182, r363251:Mark Johnston2020-07-222-0/+10
| | | | | | | Add a driver for the SafeXcel EIP-97. Notes: svn path=/stable/12/; revision=363418
* MFC r349893:Michael Tuexen2020-07-011-1/+1
| | | | | | | | | | | | | | | | | This commit updates rack to what is basically being used at NF as well as sets in some of the groundwork for committing BBR. The hpts system is updated as well as some other needed utilities for the entrance of BBR. This is actually part 1 of 3 more needed commits which will finally complete with BBRv1 being added as a new tcp stack. Merge conflics were manually resolved. Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D20834 Notes: svn path=/stable/12/; revision=362880
* MFC r358430, r359934-r359936, r359939, r359969, r360093Emmanuel Vadot2020-06-191-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r358430: dts: Update our copy for arm, arm64 and riscv dts to Linux 5.5 r359934: dts: Import DTS from Linux 5.6 r359935: allwinner: aw_thermal: Cope with DTS changes The upstream DTS now include the thermal device node and the SID calibration entry. Update our driver to cope with this change and remove the DTB overlays that aren't needed anymore. X-MFC-With: r359934 r359936: modules: dtb: allwinner: Remove non existant files Those files have been removed in r359935. X-MFC-With: r359935 r359939: modules: dtb: allwinner: Remove sun50i-a64-sid.dtso File was removed in r359935 X-MFC-With: r359935 r359969: arm: allwinner: aw_sid: Fix thermal calibration size for A64 This fixes the aw_thermal driver on A64 SoC. X-MFC-With: r359935 r360093: release: arm64: Remove DTSO for Allwinner boards Both SID and THS dts node are now in the main dts and the DTSO have been removed in r359935 X-MFC-With: r359935 Notes: svn path=/stable/12/; revision=362408
* MFC r360008-r360009, r360011Emmanuel Vadot2020-06-192-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | r360008: mmc_fdt_helpers: Always init the timout We use the taskqueue to schedule card detection so always init it. This is a proper solution instead of r359965. MFH: r359924 r360009: mmc_fdt_helpers: Drain the cd pin taskqueue in mmc_fdt_gpio_teardown We have no use for it now. r360011: arm: allwinner: aw_mmc: Make it possible to unload the module While here, add a makefile in sys/modules/allwinner so it is built. Also add the PNP info so devmatch will load this module automatically. Notes: svn path=/stable/12/; revision=362401
* MFC r356276, r356609-r356610, r356637, r356798-r356800, r356802Emmanuel Vadot2020-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r356276: arm: allwinner: aw_spi: Call bus_generic_attach This is needed when the driver is compiled into the kernel. When compiled as a module this will be called from another code path as we also depend on ofw_spibus. r356609: twsi: Rework how we handle the i2c messages We use to handle each message separately in i2c_transfer but that cannot work with message with NOSTOP as it confuses the controller that we disable the interrupts and start a new message. Handle every message in the interrupt handler and fire a new start condition if the previous message have NOSTOP, the controller understand this as a repeated start. This fixes booting on Allwinner A10/A20 platform where before the i2c controller used to write 0 to the PMIC register that control the regulators as it though that this was the continuation of the write message. Tested on: A20 BananaPi, Cubieboard 1 (kevans) Reported by: kevans r356610: arm: allwinner: axp209: Add regnode_status method This allow consumers to check if the regulator is enable or not. r356637: arm64: allwinner: dtso: Add spi0 spigen DTSO This overlays can be used on A64 board to use spigen and spi(8) on the spi0 pins. Tested On: Pine64-LTS, A64-Olinuxino Submitted by: Gary Otten <gdotten@gmail.com> r356798: axp8xx: Add missing voltage regulators offset This lead to writing the desired voltage value to the wrong register. r356799: axp8xx: Add a regnode_init method This method will set the desired voltaged based on values in the DTS. It will not enable the regulator, this is the job of either a consumer or regnode_set_constraint SYSINIT if the regulator is boot_on or always_on. r356800: arm: allwinner: Add support for bank supply Each GPIO bank is powered by a different pin and so can be powered at different voltage from different regulators. Add a new config that now hold the pinmux data and the banks available on each SoCs. Since the aw_gpio driver being also the pinmux one it's attached before the PMIC so add a config_intrhook_oneshot function that will enable the needed regulators when the system is fully functional. r356802: arm: allwinner: ahci: target-supply is optional The target-supply regulator is optional so don't fail if it's not present. While here disable the clock on detach. X-MFC-With: 356600 Notes: svn path=/stable/12/; revision=362350
* MFC r354117:Emmanuel Vadot2020-06-161-0/+3
| | | | | | | | | | | | arm64: rockchip: dts: Build the Khadas board DTS We boot on thoses boards so build them. Submitted by: s199p.wa1k9r@gmail.com Differential Revision: https://reviews.freebsd.org/D22158 Notes: svn path=/stable/12/; revision=362244
* MFC r351144:Emmanuel Vadot2020-06-161-0/+6
| | | | | | | | | | arm64: Add EspressoBin DTB to the build This will compile the espressobin dts to a dtb file and this will be install in /boot/dtb/marvell/ during installkernel. Notes: svn path=/stable/12/; revision=362241
* MFC 354667,354686: Share routines for dealing with T6 key contexts.John Baldwin2020-05-061-1/+2
| | | | | | | | | | | | | | | | | | | 354667: Create a file to hold shared routines for dealing with T6 key contexts. ccr(4) and TLS support in cxgbe(4) construct key contexts used by the crypto engine in the T6. This consolidates some duplicated code for helper functions used to build key contexts. 354686: Add t4_keyctx.c to sys/conf/files for the non-module build. Missed in r354667. Sponsored by: Chelsio Communications Notes: svn path=/stable/12/; revision=360717
* MFC r360071-r360072: force -fcommon in kernel/modules where neededKyle Evans2020-04-303-4/+4
| | | | | | | | | | | | | | | | | | This contains some extra bits over the original commits, as things are slightly different in earlier branches. r360071: Allow kernel modules to build with a compiler that defaults to -fno-common This uses the same approach as r359691. r360072: More fixes to build the kernel with a compiler that defaults to -fno-common Using the same approach as the last commit for the files used by genassym.sh. Notes: svn path=/stable/12/; revision=360496
* MFC r359100:Konstantin Belousov2020-04-011-0/+1
| | | | | | | mlx5: Restore eswitch management code from attic. Notes: svn path=/stable/12/; revision=359532
* MFC r358818:Vladimir Kondratyev2020-03-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi: Fix stalled value returned by acpi_get_device() after device deletion Newbus device reference attached to ACPI handle is not cleared when newbus device is deleted with devctl(8) delete command. Fix that with calling of AcpiDetachData() from "child_deleted" bus method like acpi_pci driver does. MFC r358819: acpi: Export functions required by upcoming acpi_iicbus driver. MFC r358820: iicbus(4): Add support for ACPI-based children enumeration 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 Differential Revision: https://reviews.freebsd.org/D22901 Notes: svn path=/stable/12/; revision=359431
* MFC r359185:Konstantin Belousov2020-03-2717-61/+40
| | | | | | | | | | | | Introduce LINUXKPI_GENSRCS. For MFC, pci_iov_if.h is excluded from the list. It will be readded when linuxkpi support for SRIOV is merged. Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=359378
* MFC r355046, r355579, r355595, and r357793.Navdeep Parhar2020-03-133-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r355046: cxgbe(4): Update the firmware interface header. This allows the driver to be updated for the next firmware without waiting for it to be released. r355579: cxgbe(4): Update T4/5/6 firmwares to 1.24.11.0. These were obtained from the Chelsio Unified Wire v3.12.0.1 beta release. Note that the firmwares are not uuencoded any more. r355595: cxgbe(4): Simplify the firmware version checks a bit. No functional change. r357793: cxgbe(4): Update T4/5/6 firmwares to 1.24.12.0. Sponsored by: Chelsio Communications Notes: svn path=/stable/12/; revision=358970
* MFC r355626 (manu):Glen Barber2020-03-061-0/+14
| | | | | | | | | | | | | | arm64: rockchip: Add a module for rk_dwmmc This is mostly needed for dev/debug as most users will have their root on the sdcard or emmc. * This should fix the stable/12 aarch64 build after r358648. Sponsored by: Rubicon Communications, LLC (netgate.com) Notes: svn path=/stable/12/; revision=358701
* MFC r356148-r356149, r356277Emmanuel Vadot2020-03-042-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r356148: arm64: rockchip: rk808: Add remaining regulators The RK808 driver was missing the LDO and switch regulators. Add support for them. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D22852 r356149: arm64: rockchip: Add driver for the io domain This driver configure the registers in the GRF according to the value of the regulators for the platform. Some IP can run with either 3.0V or 1.8V, if we don't configure them correctly according to the external voltage used they will not work. It's only done at boot time for now and might be needed at runtime for IP like sdmmc. Reviewed by: mmel Tested On: RockPro64, Firefly-RK3399 (gonzo), AIO-3288 (mmel) Differential Revision: https://reviews.freebsd.org/D22854 r356277: arm64: rockchip: Add a module for rk_spi The spi node doesn't lives under a simple-bus compatible node so we need OFWBUS_PNP_INFO instead of SIMPLEBUS_PNP_INFO. Notes: svn path=/stable/12/; revision=358648
* MFC r357042: vmxnet3: add support for RSS kernel optionAndriy Gapon2020-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | We observe at least one problem: if a UDP socket is connect(2)-ed, then a received packet that matches the connection cannot be matched to the corresponding PCB because of an incorrect flow ID. That was oberved for DNS requests from the libc resolver. We got this problem because FreeBSD r343291 enabled code that can set rsstype of received packets to values other than M_HASHTYPE_OPAQUE_HASH. Earlier that code was under 'ifdef notyet'. The essence of this change is to use the system-wide RSS key instead of some historic hardcoded key when the software RSS is enabled and it is configured to use Toeplitz algorithm (the default). In all other cases, the driver reports the opaque hash type for received packets while still using Toeplitz algorithm with the internal key. PR: 242890 Sponsored by: Panzura Notes: svn path=/stable/12/; revision=358386
* MFC r357874:Dimitry Andric2020-02-182-1/+4
| | | | | | | | | | | | | Merge r357872 from the clang1000-import branch: Disable new clang 10.0.0 warnings about misleading indentation in ce(4) and cp(4). These are false positives, since some of the driver source has been deliberately obfuscated. Notes: svn path=/stable/12/; revision=358077
* MFC r357041:Hans Petter Selasky2020-02-031-1/+6
| | | | | | | | | Fix build of stand/usb . Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=357433
* MFC r356086, r356278, r356294, r356519, r356521-r356522, r356525-r356526Ian Lepore2020-01-175-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r356086: Add comments to a couple i2c device lines in NOTES. r356278: Add support for i2c bus mux hardware. 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). r356294: Explicitly include sys/rman.h instead of relying on getting it via some other header. r356519: Ensure any reserved gpio pins get released if an early exit is taken from the attach function. r356521: Init sc->maxbus to -1, not 0. It represents the highest array index that has a non-NULL child bus stored in it, so the "none" value can't be zero since that's a valid array index. Also, when adding all possible buses because there is no specific per-bus config, there's no need to reset sc->maxbus on each loop iteration, it can be set once after the loop. r356522: Change some KASSERT to device_printf + return EINVAL. There's no need to bring the whole kernel down due to a configuration error detected when a module is loaded, it suffices to just not attach the device. r356525: Split the code to find and add iicbus children out to its own function. Move the decision to take an early exit from that function after adding children based on FDT data into the #ifdef FDT block, so that it doesn't offend coverity's notion of how the code should be written. (What's the point of compilers optimizing away dead code if static analyzers won't let you use the feature in conjuction with an #ifdef block?) Reported by: coverity via vangyzen@ r356526: Remove some trailing whitespace; no functional changes. Notes: svn path=/stable/12/; revision=356838
* MFC r355940:Dimitry Andric2020-01-072-2/+2
| | | | | | | | | | | | | | | Move all sources from the llvm project into contrib/llvm-project. This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Notes: svn path=/stable/12/; revision=356462
* MFC r355650:Andrey V. Elsukov2019-12-261-0/+1
| | | | | | | | | | | | | | | | | Follow RFC 4443 p2.2 and always use own addresses for reflected ICMPv6 datagrams. Previously destination address from original datagram was used. That looked confusing, especially in the traceroute6 output. Also honor IPSTEALTH kernel option and do TTL/HLIM decrementing only when stealth mode is disabled. Reported by: Marco van Tol <marco at tols org> Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D22631 Notes: svn path=/stable/12/; revision=356093
* MFC r356030:Mark Johnston2019-12-251-1/+2
| | | | | | | | | Compile uart_cpu_acpi.c, added in r348195, into uart.ko. PR: 242771 Notes: svn path=/stable/12/; revision=356068
* MFC r355467, r355499, r355531-r355533, r355535, r355540, r355548-r355551, ↵Ian Lepore2019-12-222-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r355565 r355467: Implement bus_rescan for gpiobus(4). This allows on-the-fly reconfiguration of gpio devices by using kenv to add hints for a new device and then do 'devctl rescan gpiobus4' to make the new device(s) attach. It's not particularly easy to detect whether the 'at' hint has been deleted for a child device that's currently attached, so this doesn't handle that. But the user can use devctl commands to manually detach an existing device. r355499: Add module build stuff for gpioths(4), a driver for DHT11/DHT22 sensors. r355531: Several small fixes for the gpioths (temp/humidity sensor) driver. At the end of a read cycle, set the gpio pin to INPUT rather than OUTPUT. The state of the single-wire "bus" when idle should be high; setting the pin to input allows the external pullup to pull the line high. Setting it to output (and leaving it driving low) was leading a good read cycle followed by one that would fail, and it just continued like that forever, effectively reading the sensor once every 10 seconds instead of 5. In the attach function, do an initial read from the device before registering the sysctls for accessing the last-read values, to prevent reading spurious values for the first 5 seconds after the driver attaches. Do a callout_drain() in the detach function to prevent crashes after unloading the module. r355532: Simplify sysctl stuff in the gpioths driver. There is no need to use local functions to handle the sysctls, they all just access simple readonly integer variables. There's no need to track the oids of the ones we add, since the teardown is done by newbus code, not the driver itself. Also remove the DDB code, because it just provides access to the same data that the sysctls already provide. r355533: Add support for more chips to the gpioths driver. Previously the driver supported the DHT11 sensor. Now it supports DHT11, DHT12, DHT21, DHT22, AM3201, AM3202. All these chips are similar, differing primarily in supported temperature and humidity ranges and accuracy (and, presumably, cost). There are two basic data formats reported by the various chips, and it is possible to figure out at runtime which format to use for decoding the data based on the range of values in a single byte of the humidity measurement. (which is detailed in a comment block, so I won't recapitulate it here). r355535: Add a MODULE_DEPEND() for the gpioths driver. Also, note that the prior commit changed the sysctl format for the temperature from "I" to "IK", and correspondingly changed the units from integer degrees C to decikelvin. For access via sysctl(8) the output will be the same except that now decimal fractions will be shown when available. r355540: Add FDT support to the gpioths driver. It now uses the newer gpio_pin_*() API and can attach based on either hints or fdt data. r355548: Add a man page for the gpioths(4) driver. r355549: Add myself to the copyright list. Also add an SPDX tag. And finally, fix a missing word and a spelling error in a comment. r355550: Paste things correctly so that I'm added to the *end* of the copyright list. r355551: Connect the gpioths(4) manpage to the build. r355565: Switch gpioths(4) from using a callout to a taskqueue for periodic polling of the sensor hardware. Part of the polling process involves signalling the chip then waiting 20 milliseconds. This was being done with DELAY(), which is a pretty rude thing to do in a callout. Now a taskqueue_thread task is scheduled to do the polling, and because sleeping is allowed in the task context, pause_sbt() replaces DELAY() for the 20ms wait. Notes: svn path=/stable/12/; revision=356018
* MFC r355738:Ian Lepore2019-12-221-1/+4
| | | | | | | Include ofw_bus_if.h in SRCS only on systems configured with the FDT option. Notes: svn path=/stable/12/; revision=356017
* MFC r354253, r354254, r354264, r354265Toomas Soome2019-12-021-0/+3
| | | | | | | | | | | | | | | Remove duplicate lz4 implementations Port illumos change: https://www.illumos.org/issues/11667 Move lz4.c out of zfs tree to opensolaris/common/lz4, adjust it to be usable from kernel/stand/userland builds, so we can use just one single source. Add lz4.h to declare lz4_compress() and lz4_decompress(). Differential Revision: https://reviews.freebsd.org/D22037 Notes: svn path=/stable/12/; revision=355285
* MFC r350180, r351100Emmanuel Vadot2019-11-281-0/+1
| | | | | | | | | | | | | | r350180: dtso: allwinner: Add an overlay for H3 i2c0 Most of the H3 boards don't enable i2c as it is unused. Add an overlay so it's easier for user to use i2c device. r351100: twsi: Fix build when DEBUG is used on 32bits arch. Notes: svn path=/stable/12/; revision=355175
* MFC r354201, r354276, r354492-r354517, r354562:Mark Johnston2019-11-214-2/+17
| | | | | | | Add firmware images and support for Intel 9000-series devices. Notes: svn path=/stable/12/; revision=354927