Commit graph

43768 commits

Author SHA1 Message Date
Jari Sihvola
cd92dd2324 eqos: Add StarFive JH7110 variant
Found on the VisionFive v2 SBC, and similar.

Reviewed by:	mhorne
Tested by:	mhorne
Discussed with:	sos
Differential Revision:	https://reviews.freebsd.org/D45600
2025-04-02 13:56:38 -03:00
Jari Sihvola
e69623451e mccomphy: add support for YT8531
Reviewed by:	mhorne
Tested by:	mhorne
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45600
2025-04-02 13:56:36 -03:00
Kyle Evans
ba2336d304 arm64: add a driver for the uart found on Apple Silicon machines
This is a revival of the old exynos4210 driver, with some additional
bits to configure the apple "s5l" uart (which is actually slightly
different to operate).

This hasn't been tested on anything that would hit the non-s5l path, so
banish it off to the apple/ domain until someone cares to confirm that
none of the other hardware is broken -- it may be that nobody does, but
the complexity isn't too bad: mostly the driver1 construct added to the
uart_bas that we use to avoid having a whole bunch of shims for uart
driver methods and hardcoded references to the cfg structs.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D48120
2025-04-01 21:57:17 -05:00
Konstantin Belousov
45f70f98fc iommu_gas_map_region(): add comment explaining the ma array shift
and the difference between start and entry->start values at this point.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-04-02 01:23:17 +03:00
Nia Alarie
426f4e5e2e if_run: Add sitecom device id
Reviewed by:	thj, adrian
Obtained from:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D49588
2025-04-01 09:00:07 +01:00
Nia Alarie
9f3e7b7597 if_rsu: Add sitecom device id
Approved by:	thj, adrian
Obtained from:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D49588
2025-04-01 08:59:42 +01:00
Colin Percival
680d34896c Revert "pci: Only re-route IRQs based on firmware on x86"
This reverts commit 0e33c2e6df.
2025-03-31 14:01:09 -07:00
Konstantin Belousov
f0adc907fc mlx5en: sync channel close with the rq completion processing
Without the wait, mlx5e_destroy_rq() might free mbuf that is passed up
to the network stack on receive in mlx5e_poll_rx_cq().

Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-31 21:59:50 +03:00
Tom Jones
2ad0f7e915 Import iwx as ported from OpenBSD by Future Crew.
This driver originates from OpenBSD and was ported to FreeBSD by Future
Crew LLC who kindly provided a source release.

iwx supports many recent Intel WiFi card and this driver should support running
these cards with legacy, HT and VHT rates. There are some issues remaining in
the port, but at this point wider testing is sought.

To avoid breaking deployed WiFi configurations iwx probes with a lower
priority than iwlwifi. This can be changed by blocking iwlwifi with
devmatch.

Reviewed by:	adrian
Obtained from:	Future Crew LLC
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49259
2025-03-31 13:42:31 +01:00
Mark Johnston
54a3920dc9 hyperv/storvsc: Avoid conditional asserts in storvsc_xferbuf_prepare()
whu@ cannot reproduce the assertion failure which led to these ifdefs
being added in the first place, and since they appear wrong, i.e., the
assertions ought to apply to all platforms, let's remove them.

This reverts commits 0af5a0cd27 and
6f7b1310b6.

PR:		285681
Tested by:	whu
MFC after:	2 weeks
2025-03-31 07:15:45 -04:00
Mark Johnston
a319ba6945 hyperv/storvsc: Fix busdma constraints
- The BUS_DMA_KEEP_PG_OFFSET flag is needed, since
  storvsc_xferbuf_prepare() assumes that only the first segment may have
  a non-zero offset, and that all following segments are page-sized and
  -aligned.
- storvsc_xferbuf_prepare() handles 64-bit bus addresses, so avoid
  unneeded bouncing on i386.

PR:		285681
Reported by:	dim
Tested by:	dim, whu
MFC after:	2 weeks
2025-03-31 07:14:42 -04:00
Christos Margiolis
b6420b5ea5 sound: Fix regression in pcm/feeder_mixer.c
This call was meant to be the default case in the first place, but
somehow missed this.

Reported by:	glebius
Fixes:		4021fa32d9 ("sound: Simplify pcm/feeder_mixer.c")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2025-03-30 23:27:09 +02:00
Christos Margiolis
35400672df sound: Use bus_topo_lock() where appropriate
Lock around uses of devclass_*() and replace leftover
CTLFLAG_NEEDGIANTs with CTLFLAG_MPSAFE.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D46700
2025-03-30 19:46:14 +02:00
Christos Margiolis
a4aff024fd sound: Improve afmt_tab
Reduce ifdefs, and add aliases for the unsigned formats.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D48009
2025-03-30 19:45:53 +02:00
Christos Margiolis
e1bbaa71d6 sound: Implement AFMT_FLOAT support
Even though the OSS manual [1] advises against using AFMT_FLOAT, there
are applications that expect the sound driver to support it, and might
not work properly without it.

This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS
compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE <->
AFMT_S32_LE|BE conversion functions. As a result, applications can
write/read floats to/from sound(4), but internally, because sound(4)
works with integers, we convert floating point samples to integer ones,
before doing any processing.

The reason for encoding/decoding IEEE754s manually, instead of using
fpu_kern(9), is that fpu_kern(9) is not supported by all architectures,
and also introduces significant overhead.

The IEEE754 encoding/decoding implementation has been written by Ariff
Abdullah [2].

[1] http://manuals.opensound.com/developer/AFMT_FLOAT.html
[2] https://people.freebsd.org/~ariff/utils/ieee754.c

PR:		157050, 184380, 264973, 280612, 281390
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D47638
2025-03-30 19:45:38 +02:00
Christos Margiolis
e372211be5 sound: Fix vchanrate and vchanformat
Make vchanrate and vchanformat reflect the primary channel's software
buffer's rate and format respectively. Fix previous inconsistencies.

Get rid of the initializations in vchan_create() and move them to
chn_init().

Without the feeder_rate_round check in sysctl_dev_pcm_vchanrate(), we
can set the software rate to anything between feeder_rate_min and
feeder_rate_max. If we keep the check, however, the rate is limited to
whatever the driver's min/max is, which can be a problem if, for
example, the driver supports only a single rate, in which case we won't
be able to set anything other than the driver rate.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48961
2025-03-30 19:45:34 +02:00
Colin Percival
0e33c2e6df pci: Only re-route IRQs based on firmware on x86
There is a (very historical) call to pci_assign_interrupt for the
purpose of routing IRQs which may have been set up wrong by x86 BIOS
or firmware.  On non-x86 systems, this is unnecessary; and on INTRNG
systems it results in a (synthetic) IRQ leak and ultimately a kernel
panic after many hotplug/unplug cycles.

Suggested by:	jhb
Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D49560
2025-03-29 13:17:29 -07:00
Norbert Ciosek
1580f8d9c1 ixgbe: fix mailbox ack handling
Check if CTS bit is set in the mailbox message before waiting for ACK.
Otherwise ACK will never be received causing the function to timeout. Add
a note for ixgbe_write_mbx that it should be called while holding a lock.

Fixes: 6d243d2 ("net/ixgbe/base: introduce new mailbox API")
Cc: stable@dpdk.org

Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Obtained from:	DPDK (1f119e4)
MFC after:	1 week
2025-03-28 17:02:37 -07:00
Adrian Chadd
8b0acd8538 mtw: fix compilation with IEEE80211_SUPPORT_SUPERG enabled
It looks like this was missed during the driver development and
porting.

Differential Revision:	https://reviews.freebsd.org/D49512
Reviewed by:	thj
2025-03-28 11:59:35 -07:00
John Baldwin
86dd379d3e pci: Use a single variable for the offset of the power management registers
This is the more typical pattern for other capability register sets,
and two of these variables weren't used.

Differential Revision:	https://reviews.freebsd.org/D49267
2025-03-27 16:57:04 -04:00
John Baldwin
931baeb62b acpi_pci: Use pci_has_pm and pci_clear_pme
Differential Revision:	https://reviews.freebsd.org/D49266
2025-03-27 16:56:08 -04:00
John Baldwin
ddaf652468 dev: Use recently added improvements to PME# support to simplify drivers
Depend on the PCI bus driver clearing PME# after resume to remove the
need for clearing PME# from DEVICE_RESUME methods.

Use pci_has_pm and pci_enable_pme.

Reviewed by:	Krzysztof Galazka <krzysztof.galazka@intel.com>
Differential Revision:	https://reviews.freebsd.org/D49251
2025-03-27 16:55:12 -04:00
John Baldwin
e5cbf0e881 pci: Add helper routines to manage PME in device drivers
pci_has_pm is a quick check that returns true if a PCI device supports
the power management capability.

pci_enable_pme can be used in DEVICE_SUSPEND driver methods to enable
PME# during suspend.

Reviewed by:	Krzysztof Galazka <krzysztof.galazka@intel.com>x
Differential Revision:	https://reviews.freebsd.org/D49250
2025-03-27 16:55:03 -04:00
John Baldwin
82d6927712 pci: Clear active PME# and disable PME# generation
The PCI power management specification requires that the OS clear any
pending PME# interrupt and generation of PME# interrupts during
"initial operating system load".  Note that clearing a pending PME#
interrupt requires writing a 1 to the Read/Write-Clear PME bit in the
power management status register.  To handle the boot time case, clear
PME# state in pci_read_cap() when scanning new PCI devices.  This
should also cover hotplug devices.

In addition, clear this state on every PCI device after resume from
sleep in pci_resume_child before invoking the driver's DEVICE_RESUME
method.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D49222
2025-03-27 16:53:24 -04:00
John Baldwin
7a5b9c4abc netmap: Add a cdev_pg_path hook that returns the name of the cdev
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D49337
2025-03-27 16:45:06 -04:00
Andrew Turner
d25a708ba7 arm/mv: Remove pre-armv7 support
Armv4, Armv5, and Armv6 support has been removed. Remove the Marvell
SoCs that used these cores.

Reviewed by:	cognet, imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D49497
2025-03-27 13:47:37 +00:00
Piotr Kubaj
2e16618fe7 ipmi: fix runtime on powerpc64le
Summary:
OPAL runs in big-endian mode, so we need to byteswap msg_len on little-endian.

MFC after:	1 week

Test Plan: ipmitool lan print

Reviewers: #powerpc

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D49530
2025-03-27 12:57:28 +01:00
Adrian Chadd
d342ae6719 uath: add support for GCMP-128 encryption
Explicitly set the software ciphers; add support for GCMP-128.

Locally tested:

* AR5523 11abg NIC, 2/5GHz STA operation, GCMP forced
  in wpa_supplicant.conf

Differential Revision:	https://reviews.freebsd.org/D49370
Reviewed by:	bz
2025-03-26 18:28:47 -07:00
Adrian Chadd
077108d94a rtwn: add support for AES-GCM-128 in the supported software cipher set
I'm testing this with rtwn(4) NICs right now, so enable it here.

Locally tested:

* RTL8812AU / RTL8821AU, STA mode (with some wpa_supplicant.conf
  shenanigans to force GCMP as the pairwise key to an OpenWRT AP
  configured to use GCMP but without requiring MFP.)

Differential Revision:	https://reviews.freebsd.org/D49190
Reviewed by:	bz
2025-03-26 18:28:46 -07:00
Ruslan Bukin
3969b51ffa xilinx axi ethernet: allocate memory for buffers.
The xae(9) driver expects that the "memory-region" property is always
provided in its DTS node, but this is not a case for every platform.

If the property is not provided, then no restriction on buffer location
is in place and busdma backend could be used.

Since the Xilinx AXI DMA engine driver does not support busdma(9), then
allocate some memory for buffers manually, so we don't panic.

This fixes operation on Codasip A730.
2025-03-26 15:14:13 +00:00
Ruslan Bukin
c7ffe32b1b xilinx quad spi: various fixes.
- add compat table and a string for an older IP
- name driver properly
- depend on ofw_spibus
- add missing ofw_bus_get_node() method
- connect to GENERIC (similar to other Xilinx IP)

Tested on Codasip A730.
2025-03-26 12:08:27 +00:00
Christos Margiolis
2f1f523a45 snd_hda: Patch Framework 16 AMD
Reported by:	jrm
Tested by:	jrm
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	jrm
Differential Revision:	https://reviews.freebsd.org/D49416
2025-03-25 20:13:59 +01:00
Adrian Chadd
23db5fccb6 hda: add macbook air 6,1 and 6,2 GPIO to enable amplifier
GPIO0 needs to be flipped on to enable the amplifier.

The CS4208 looks /sort/ of like previous cirrus logic codecs,
enough for audio to work.  This actually provides working audio
on my mbair 6,2 but it doesn't yet detect the jack.

That requires patches to the pin configs, which is going to
need some further work.

Differential Revision: https://reviews.freebsd.org/D49350
Reviewed by: christos
2025-03-22 08:56:34 -07:00
Christos Margiolis
fc40132603 snd_hda: Support Intel Raptor Lake 0x7a50
PR:		276379
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D49389
2025-03-19 19:18:37 +01:00
Navdeep Parhar
c22b297062 cxgbe(4): Add two new transceiver types.
Future firmwares will report these types to the driver.  These
transceivers work already but are misidentified as a different type.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2025-03-18 11:36:00 -07:00
Stephen Hurd
0f684b5aec Disable HS200 on rockchip_dwmmc in attach
HS200 mode requires tuning, and there is no code to perform this
tuning at present.  Until there is, leave HS200 mode disabled.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D49400
2025-03-18 13:01:21 -04:00
Vladimir Kondratyev
027b93c2f5 acpi_asus_wmi(4): Handle TUF-specific hotkeys internally
- Cycle TUF laptop RGB mode on AURA key press
- Switch TUF 'Throttle Thermal Policy' with 'Fan' key

Sponsored by:	Future Crew LLC
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D48985
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
d5bf6a7245 acpi_asus_wmi(4): Add support for WMI event queue
Event codes are expected to be retrieved from a queue on at least some
models. Specifically, very likely the ACPI WMI devices with _UID ATK are
queued whereas those with ASUSWMI are not.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48984
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
f134662a1a acpi_asus_wmi(4): Improve keyboard backlight support.
- Fix maximal keyboard backlight level, Although Linux source code
  comment says that backlight level is encoded in 3 bits of data,
  actual code limits maximum level to 3.
- Add backlight(9) support for keyboard
- Turn off/on keyboard backlight on suspend/resume

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48983
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
5e41194bfc acpi_asus_wmi(4): Add EVDEV support
Use input event device to export hotkey events.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48982
2025-03-17 18:45:14 +03:00
Warner Losh
b0375f78e3 usb-msctest: Be more conservative setting GETMAXLUN quirk
Only set the GETMAXLUN quirk when it causes an error, but don't set it
when it returns 0. Since we reset the device when we set any quirk, only
set this quirk when it generates an error so umass will avoid it. When
the command works, there's no reason for umass to avoid it at all.

MFC After: 1 week
Sponsored by: Netflix
2025-03-16 13:23:25 -06:00
Warner Losh
9ea38ca4a8 umass/quirk: Remove useless quirk for Transcend flash
I have several of these. They all work without these quirks (either the
auto quirk mechanism does the right thing, or a likely
soon-to-be-removed vendor catch-all does the right thing, or no probing
at all does the right hting).

Both PREVENT ALLOW and SYNCHRONIZE CACHE are (a) unimplemented but (b)
return the proper asc/ascq code so da just does the right thing, quirk
or no. This was a left-over from the days where you'd get scary error
messages, but we'd work just fine. Now that the scary error messages are
gone (and only a calm one under bootverbose), this can be deleted.

Sponsored by:		Netflix
2025-03-15 21:47:44 -06:00
Warner Losh
4804a461b5 umass/quirks: Remove nonsensical NO_GETMAXLUN quirks
We only try to do a GETMAXLUN query of BBB devices. If we're forcing the
device to be CBI, then it's not BBB. Delete the quirks from there. Also,
UFI devices are all CBI as well, so remove the quirk from there as well.
Confirmed this isn't needed with three different floppy disk drives I
have.

Sponsored by:		Netflix
2025-03-15 21:45:31 -06:00
Navdeep Parhar
011e3d0b8b cxgbe(4): Perform Conventional Reset instead of FLR on the device.
The driver uses bus_reset_child on its parent to reset itself but that
performs an FLR whereas the hardware needs a Conventional Reset[1] for
full re-initialization.  Add routines that perform conventional hot
reset and use them instead.  The available reset mechanisms are:
* PCIe secondary bus reset (default)
* PCIe link bounce

hw.cxgbe.reset_method can be used to override the default.  The internal
PL_RST is also available but is for testing only.

[1] 6.6.1 in PCI Express® Base Specification 5.0 version 1.0

MFC after:	1 month
Sponsored by:	Chelsio Communications
2025-03-15 18:16:42 -07:00
Colin Percival
55c3348ed7 acpi_pci: Add quirk for DELAY-after-EJ0
On some EC2 instances, there is a race between removing a device from
the system and making the PCI bus stop reporting the presence of the
device.  As a result, a PCI BUS_RESCAN performed immediately after
the _EJ0 method returns "sees" the device which is being ejected, which
then causes problems later (e.g. we won't recognize a new device being
plugged into that slot because we never knew it was vacant).

On other operating systems the bus is synchronously marked as needing
to be rescanned but the rescan does not occur until O(1) seconds later.

Create a new ACPI_Q_DELAY_BEFORE_EJECT_RESCAN quirk and set it in EC2
AMIs, and add a 10 ms DELAY between _EJ0 and BUS_RESCAN when tht quirk
is set.

Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D49252
2025-03-14 11:35:35 -07:00
Wei Hu
47f4137e44 mana: remove redundant doorbell in mana_poll_rx_cq()
With the last commit to refill the rx mbuf in batch, the doorbell
in mana_poll_rx_cq() becomes redundant. Remove it to save a few
microseconds spent in mmio call.

Reported by:	NetApp
Reviewed by:	Tallamraju, Sai
Tested by:	whu
Fixes:		9b8701b8 ("mana: refill the rx mbuf in batch")
MFC after:	3 days
Sponsored by:	Microsoft
2025-03-14 05:51:34 +00:00
Christos Margiolis
68b6567d09 snd_hda: Patch Framework AMD 13th gen
Redirect sound to headphone jack when plugged in.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D49346
2025-03-13 22:51:45 +01:00
Konstantin Belousov
480fc5b8e5 mlx5en: bump MLX5E_MAX_BUSDMA_RX_SEGS
This is needed to accomodate more data segments in wqes for 64K receive
mbuf chains.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:02:17 +02:00
Konstantin Belousov
016f40466a mlx5en: fix rq->wqe_sz usage
Define it as the size of the single data segment in wqe.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:01:59 +02:00
Konstantin Belousov
c2987d7876 mlx5: bump the max LRO packet size
The belief is that the 7*MCLBYTES limit was set to not hit the segment
limit for wqe busdma tag.  But with the current mbuf allocator it is not
possible, and even if it was, the corresponding wqe fill would simply
fail.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:01:36 +02:00