Commit Graph

39714 Commits

Author SHA1 Message Date
Kornel Duleba
6802a86cb0 enetc: Add support for PHY interrupts
- Replace miibus with newly created miibus_fdt.
- Use generic passthrough resource allocation devmethods.

Obtained from: Semihalf
Sponsored by: Alstom Group
2021-11-24 07:40:37 +01:00
Kornel Duleba
89595c1791 vscphy: Add support for PHY interrupts
They're allocated using standard newbus API,
which means that we rely on miibus to handle the allocation.
Add VSC8504 to the list of supported PHYs, as it is similar enough
to the VSC8501 that is already supported by this driver.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32816
2021-11-24 07:40:37 +01:00
Kornel Duleba
0c9156faec Introduce DP83822 PHY driver
DP83822 is a 10/100 Texas Instruments PHY.
Link status change interrupts are supported by the driver,
however not all boards have the PHY interrupt wired.
Because of that if failure to allocate an IRQ is not treated as an error.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32815
2021-11-24 07:40:36 +01:00
Kornel Duleba
e85c94b8d6 Introduce DP83867 PHY driver
DP83867 is a 10/100/1000 Texas Instruments PHY.
Only SGMII mode is supported.
Link status changes can be checked through an interrupt generated by the PHY,
if available

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32813
2021-11-24 07:40:36 +01:00
Kornel Duleba
9174eab414 miibus: Add support for mapping OFW nodes to PHY devices
Create a new miibus OFW specific layer leveraging miibus_fdt.c code.
PHY drivers can than read the properties using device_get_property(9) API.
Resource(interrupt) allocation is also supported.
In order to enable this each NIC/switch driver will have to be modified,
because of how miibus is attached to the parent driver.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32812
2021-11-24 07:40:36 +01:00
Kornel Duleba
89fb4802f9 vscphy: Fill in new mii_maxspeed field
It is used to limit the max advertised speed.
The value is read from DT by mii_fdt code.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32816
2021-11-24 07:40:35 +01:00
Kornel Duleba
b38de28a77 mii_physubr: Add support for limiting PHY max speed
In some cases we might want to limit the max speed advertised below of what
the PHY is capable of.
This is usually the case when we connect 1G capable PHY to 100M MAC, or when
some exotic physical connection is used.
Add a new mii_maxspeed field to mii_softc and parse it in mii_phy_dev_attach.
Speed limit is normally located in DT.
The property is already parsed in mii_fdt.c, but its value still has to be
passed by the PHY driver.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32727
2021-11-24 07:40:35 +01:00
Ed Maste
c0aa5f6a32 mgb: remove set but not used variables
Sponsored by:	The FreeBSD Foundation
2021-11-23 20:56:53 -05:00
Eric Joyner
9cf1841c4a
ice(4): Update to version 0.29.4-k
Includes various feature improvements and bug fixes.

Notable changes include:
- Firmware logging support
- Link management flow changes
- New sysctl to report aggregated error counts
- Health Status Event reporting from firmware (Use the new read-only
  tunables hw.ice.enable_health_events / dev.ice.#.enable_health_events
  to turn this off)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Sponsored by:	Intel Corporation
2021-11-23 14:09:29 -08:00
Gleb Smirnoff
8a6f38c8ac ifnet: garbage collect drbr_*_drv().
They were left in 62d76917b8 but after years proved not to be useful.
2021-11-22 19:49:57 -08:00
Warner Losh
a8837c77ef mpr: fix freeze / release mismatch in timeout code
So, if we're processing a timeout, and we've sent an ABORT to the
firmware for that timeout, but not yet received the response from the
firmware, AND we get another timeout, we queue the timeout and freeze
the queue. However, when we've finally processed them all, we only
release the queue once. This causes all I/O to halt as the devq remains
frozen forever.

Instead, only freeze the queue when we start the process (eg set INRESET
on the target). This will allow the release when all the timed out I/Os
have finished ABORTing.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D33054
2021-11-21 08:54:45 -07:00
Mark Johnston
ed6a9452be hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR
This reverts commit 9ef7df022a ("hyperv: Register hyperv_timecounter
later during boot") and adds a comment explaining why the timecounter
needs to be registered as early as it is.

PR:		259878
Fixes:	9ef7df022a ("hyperv: Register hyperv_timecounter later during boot")
Reviewed by:	kib
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33014
2021-11-19 17:30:05 -05:00
Gordon Bergling
d7125850f0 ixl(4): Fix a typo in a sysctl description
MFC after:	3 days
2021-11-19 19:59:28 +01:00
Gordon Bergling
8acb662126 iwm(4): Fix a typo in a source code comment
- s/availabe/available/

MFC after:	3 days
2021-11-19 19:51:55 +01:00
Gordon Bergling
3e5ddef0fd firewire(4): Fix a typo in a source code comment
- s/unavailabe/unavailable/

MFC after:	3 days
2021-11-19 19:50:56 +01:00
Gordon Bergling
5e21882bb4 iscsi(4): Fix a typo in a source code comment
- s/conditon/condition/

MFC after:	3 days
2021-11-19 19:29:21 +01:00
Gordon Bergling
975e2e3f84 ppbus(4): Fix a typo in source code comment
- s/quering/querying/

Obtained from:	NetBSD
MFC after:	3 days
2021-11-19 19:19:36 +01:00
betterentley
f7c32ed617 Fix 'take effect' spelling in menus and comments.
Signed-off-by: John Bentley <johnbentley.public@gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/559
2021-11-18 23:22:12 -07:00
Elyes HAOUAS
9097ac9af4 Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
2021-11-18 23:05:32 -07:00
Roger Pau Monné
50d7d967bb xen/privcmd: fix MMAP_RESOURCE ioctl to copy out results
The current definition for the MMAP_RESOURCE ioctl was wrong as it
didn't copy back the result to the caller. Fix the definition and also
remove the bogus attempt to copy the result in the implementation.

Note such copy back is only needed when querying the size of a
resource.

Sponsored by: Citrix Systems R&D
2021-11-18 09:46:44 +01:00
Colin Percival
57a8fa6f01 kvmclock: Expose implied TSC frequency via sysctl
An interface was added to derive an implied TSC frequency from pvclock
in 2015, but this interface was never exposed anywhere user-visible.

Reviewed by:	kib, bryanv
Differential Revision:	https://reviews.freebsd.org/D32974
2021-11-16 10:27:27 -08:00
Colin Percival
1580afcd6e randomdev: Remove 100 ms sleep from write routine
This was introduced in 2014 along with the comment (which has since
been deleted):
	/* Introduce an annoying delay to stop swamping */

Modern cryptographic random number generators can ingest arbitrarily
large amounts of non-random (or even maliciously selected) input
without losing their security.

Depending on the number of "boot entropy files" present on the system,
this can speed up the boot process by up to 1 second.

Reviewed by:	cem
MFC ater:	1 week
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D32984
2021-11-16 10:27:27 -08:00
Warner Losh
2bbaed4d7f mpr: Minor formatting changes to match mps.
Minor reformatting nits to make mprsas_scsiio_timeout match
mpssas_scsiio_timeout more closely. The differences aren't necessary and
are distracting when comparing the routines. No functional changes.

Sponsored by:		Netflix
2021-11-15 21:27:15 -07:00
Warner Losh
b086bc0bf1 mps: Fix debugging line
Print cm instead of sc here, as is done in mpr. We can get the sc from
cm, but not vice versa.

Sponsored by:		Netflix
2021-11-15 21:27:14 -07:00
Navdeep Parhar
a8eacf9329 cxgbe(4): Change the way t4_shutdown_adapter brings the link(s) down.
Modify the GPIO pins only on the Base-T cards and even there drive all
of them low instead of putting them in hi-z state.  For the rest (this
is the common case), directly power off the PLLs of the high speed
serdes.  This is the simplest method that does not involve or conflict
with the firmware but still works with all T4-T6 cards regardless of
what's plugged into the port.

This fixes a problem where the peer wouldn't always see a link down if
it is connected to the device using a -CR4 copper cable.

MFC after:	3 weeks
Sponsored by:	Chelsio Communications
2021-11-15 12:17:26 -08:00
Navdeep Parhar
8e76bae0b7 cxgbe(4): Keep link configuration compatible with really old firmwares.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-11-15 10:18:04 -08:00
Mark Johnston
1fb99e97e9 bus: Make BUS_TRANSLATE_RESOURCE behave more like other bus methods
- Return an errno value upon failure, instead of 1.
- Provide a bus_translate_resource() wrapper.
- Implement the generic version, which traverses the hierarchy until a
  bus driver with a non-trivial implementation is found, in subr_bus.c
  like other similar default implementations.
- Make ofw_pcib_translate_resource() return an error if a matching PCI
  address range is not found.
- Make generic_pcie_translate_resource_common() return an int instead of
  a bool.  Fix up callers.

No functional change intended.

Reviewed by:	imp, jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32855
2021-11-15 13:01:30 -05:00
Ka Ho Ng
f7523c8a19 iser: Remove redundant linuxkpi MODULE_DEPEND
Since ibcore depends on linuxkpi, there is no need to pull in the
linuxkpi dependency in iser.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Reviewed by:	trasz
Differential Revision:	https://reviews.freebsd.org/D32977
2021-11-15 14:04:08 +08:00
Emmanuel Vadot
91a908e051 pmic: rockchip: Rename the driver with _pmu as it was before 2021-11-14 20:26:33 +01:00
Emmanuel Vadot
c200441872 pmic: rockchip: Name the driver rk80{5,8}
And add the needed relationship with iicbus.
2021-11-14 13:48:10 +01:00
Emmanuel Vadot
98c60dc31f pmic: rockchip: Split the driver in rk805 and rk808
This make the base driver cleaner and the subclassed driver only have
related code.

Kernel config wise this is still only handled by rk805.

No functional changes intended.
2021-11-14 12:31:26 +01:00
Emmanuel Vadot
cb3c3e0a42 pmic: rockchip: Split the clocks part in its own file
No functional changes intended.
2021-11-14 12:31:23 +01:00
Emmanuel Vadot
ad651f176b pmic: rockchip: Split the regulators part in its own file
No functional changes intended.
2021-11-14 12:31:21 +01:00
Emmanuel Vadot
328077bb8f pmic: rockchip: Split the rtc part in its own file
Even if for now all the RTC-related register are at the same offset don't
use some hardcoded values for them but set them based on the PMIC type.

No functional changes intended.
2021-11-14 12:31:18 +01:00
Emmanuel Vadot
c9b101d241 pmic: rockchip: Rename most of rk805 driver to rk8xx
This is in preparation of correctly splitting the driver.

No functional changes intended.
2021-11-14 12:31:15 +01:00
Emmanuel Vadot
43301ad2b6 pmic: rockchip: Add dedicated file for rk808
While here rename registers for rk805 and rk808 based on the names
on the datasheet.

No functional changes intended.
2021-11-14 12:31:12 +01:00
Emmanuel Vadot
51919325ff arm64: rockchip: Move rk805 pmic driver to dev/iicbus/pmic/rockchip
Having all PMIC driver at the same place makes it easier.
2021-11-14 12:31:07 +01:00
Andriy Gapon
c0525ab1d1 pca954x: driver for PCA954x / TCA954x I2C switches
At the moment only PCA9548A is supported and has been tested.

MFC after:	2 weeks
2021-11-13 11:27:41 +02:00
Andriy Gapon
01e3492337 icee: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

MFC after:	2 weeks
2021-11-13 11:24:57 +02:00
Andriy Gapon
27645265c4 ds1307: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

MFC after:	2 weeks
2021-11-13 11:23:10 +02:00
Andriy Gapon
53b356f17a audio_soc: remove useless call to pcm_getbuffersize
Its result was not used and it does not have any side-effects.

MFC after:	2 weeks
2021-11-13 11:20:59 +02:00
Navdeep Parhar
448bcd01dc cxgbe(4): internal knob for flexible control over FEC selection.
Recent firmwares have support for autonomous FEC selection and a "force"
knob to let the driver control this behavior (or not) in a fine grained
manner. This change adds a driver knob so that all the different ways of
configuring the link FEC can be exercised. Note that this controls the
internal driver/firmware interaction for link configuration and is not
meant for general use.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-11-10 15:16:53 -08:00
Navdeep Parhar
f6a2e1100f cxgbe(4): separate sysctls for user-requested and in-use FEC.
Recent firmwares have more leeway in FEC selection and there is a need
to track the FECs requested by the driver separately from the FEC in use
on the link. The existing dev.<port>.<inst>.fec sysctl can read both but
its behavior depends on the link state and it is sometimes hard to find
out what was requested when the link is up.

Split the fec sysctl into two (requested_fec and link_fec) to get access
to both pieces of information regardless of the link state.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-11-10 15:04:37 -08:00
Bjoern A. Zeeb
3987e50611 USB dwc3 controller: add quirk snps,dis_rxdet_inp3_quirk
Add support for the "snps,dis_rxdet_inp3_quirk" quirk needed
at least on SolidRun's HoneyComb.

Reviewed by:	manu, mw
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D32921
2021-11-10 09:44:44 +00:00
Navdeep Parhar
d99b1d83b9 cxgbe(4): sysctl to track the last L1_CFG32 requested by the driver.
dev.<port>.<inst>.rcaps

 # sysctl dev.cc | grep rcaps
 dev.cc.1.rcaps: 581107776
 dev.cc.0.rcaps: 582156414

MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-11-09 15:41:20 -08:00
Bjoern A. Zeeb
8e902c1d21 mii: update URL for OUIs
Update the URL for OUIs as the old one is 404 not even 301 anymore.
2021-11-09 21:48:02 +00:00
Hans Petter Selasky
11f09b17fe snd_uaudio(4): Fix string index computations for iFeature.
This allows the iFeature strings to be properly read by the snd_uaudio(4) driver,
when parsing the audio feature unit descriptors.

Submitted by:	Zhichao1.Li@dell.com
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-11-09 22:11:25 +01:00
John Baldwin
e3ba94d4f3 Don't require the socket lock for sorele().
Previously, sorele() always required the socket lock and dropped the
lock if the released reference was not the last reference.  Many
callers locked the socket lock just before calling sorele() resulting
in a wasted lock/unlock when not dropping the last reference.

Move the previous implementation of sorele() into a new
sorele_locked() function and use it instead of sorele() for various
places in uipc_socket.c that called sorele() while already holding the
socket lock.

The sorele() macro now uses refcount_release_if_not_last() try to drop
the socket reference without locking the socket.  If that shortcut
fails, it locks the socket and calls sorele_locked().

Reviewed by:	kib, markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32741
2021-11-09 10:50:12 -08:00
Mark Johnston
1f960e646b pci: Implement pci_bar_enabled() for SR-IOV VFs
In a VF's configuration space, "memory space enable" is hard-wired to 0,
so the existing implementation always returns false.  We need to read
the SR-IOV control register from the PF device to get the value of the
MSE bit.

Fix pci_bar_enabled() to read this register instead for VFs.  I don't
see any way to access the PF's config space without a backpointer in the
pci device ivars, so I added one.

This fixes a regression where bhyve(8) fails to map the MSI-X table
after commit 7fa2335347 ("bhyve: Map the MSI-X table unconditionally
for passthrough") when a VF is passed through, since with that commit we
use PCIOCBARMMAP to map the table and that ioctl always fails for VFs
without this change.  As a bonus, pciconf(8) now correctly reports the
enablement of BARs for VFs.

Reported and tested by:	Raúl Muñoz <raul.munoz@custos.es>
Reviewed by:	rstone, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32839
2021-11-09 13:13:36 -05:00
Bjoern A. Zeeb
782cd815e1 etherswitch/felix: remove unused function
Remove unused file-local static function felix_phyforport()
which was missed in 29cf6a79ac to avoid compile time warning.

Reviewed by:	Kornel Duleba (mindal semihalf.com)
Differential Revision: https://reviews.freebsd.org/D32906
2021-11-09 15:08:53 +00:00