aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahci
Commit message (Collapse)AuthorAgeFilesLines
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-092-6/+6
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* achiem: quiet gcc -Warray-boundsRyan Libby2025-10-171-1/+1
| | | | | | | | gcc complains about accessing the byte as ads->common.bytes[3] as that field is declared as being one byte. Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D53152
* ahci: Don't fail attach if the MSI-X BARs cannot be allocatedJohn Baldwin2025-10-061-4/+4
| | | | | | | | | | | If the MSI-X table and/or PBA live in separate BAR(s) and those BAR(s) cannot be allocated, fall back to using MSI or INTx instead of failing attach. PR: 289748 Reported by: Vitalij Satanivskij <satan@Ukr.net> Reviewed by: avg, imp Differential Revision: https://reviews.freebsd.org/D52889
* ahci: Use pci_msix_*_bar instead of reading config registers directlyJohn Baldwin2025-10-061-35/+3
| | | | | | Reported by: avg Reviewed by: avg, imp Differential Revision: https://reviews.freebsd.org/D52888
* Add random Intel Elkhart Lake device IDs.Dmitry Luhtionov2025-09-081-0/+1
|
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-113-3/+3
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* Use bus_generic_detach instead of device_delete_children in detachJohn Baldwin2025-01-021-2/+4
| | | | | | | While here, check for errors from bus_generic_detach and move it to the start of detach if necessary. Differential Revision: https://reviews.freebsd.org/D47969
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-3/+3
| | | | Sponsored by: Netflix
* Fix SATA NCQ error recovery after 25375b1415Alexander Motin2024-06-271-1/+1
| | | | | | | | | | Since that commit ahci(4), siis(4) and mvs(4) drivers ended up using wrong command to fetch error information for NCQ commands. Since ATA errors are not very informative to begin with, the only noticeable effect is a lack of retries on those errors by CAM. MFC after: 1 week PR: 279978
* Add some AMD device IDs.Dmitry Luhtionov2024-06-071-0/+3
|
* ahci: Use device_set_desc(f)()Mark Johnston2024-06-024-12/+8
| | | | | | No functional change intended. MFC after: 1 week
* new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin2024-03-132-6/+4
| | | | | | | | | | The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
* clk: Move clock code in dev/clkEmmanuel Vadot2024-01-101-1/+1
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43191
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Add some Intel ICH10 PCI IDs.Dmitry Luhtionov2023-10-301-0/+1
|
* Add IDs for Intel BayTrail SATA.Dmitry Luhtionov2023-10-301-0/+2
|
* ahci: add AMD device id in RAID modeAndrey V. Elsukov2023-09-041-0/+1
| | | | | | Found on Asus ROX Strix X570-F Gaming. MFC after: 1 week
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-166-12/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-124-4/+4
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* ahci: increase timoutMariusz Zaborski2023-02-103-6/+12
| | | | | | | | | | | | | | | | | For some devices, like Marvell 88SE9230, it takes more time to connect to the device. This patch introduces a special flag that extends the timeout from around 100ms to around 500ms. This change is based on the work of: Peter Eriksson <pen@lysator.liu.se> PR: 243401 Reviewed by: imp Tested by: dch MFC after: 3 days Sponsored by: Equinix Sponsored by: SkunkWerks, GmbH Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38413
* ahci(4): Fix a typo in a source code commentGordon Bergling2023-01-111-1/+1
| | | | | | - s/reqests/requests/ MFC after: 3 days
* Add random VMware device IDs.Alexander Motin2022-10-201-0/+1
| | | | | | Just to make dmesg look nicer there. MFC after: 1 week
* ahci: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-064-15/+6
|
* Remove unused ahci_devclass.John Baldwin2022-05-064-8/+9
|
* ahci/siis/mvs: Fix panics after 3394d4239b.Alexander Motin2022-03-051-1/+2
| | | | | | | | Full CCB header overwrites made frees go into wrong zones, causing kernel panics. Instead of copying full header use xpt_setup_ccb(), since the only field I see used from all the header is target_id. PR: 262263
* ahci(4): Allow enclosure emulation without hardware.Alexander Motin2021-12-172-15/+28
| | | | | | | | | | After 53f5ac1310e allowed SATA device mapping to enclosure slots, it may have sense to provide enclosure device emulation even without real hardware interface like SGPIO just for purposes of physical device location tracking (still assuming straight cabling). MFC after: 1 week Sponsored by: iXsystems, Inc.
* ahci: Add Intel Comet Lake RAID/RST controller PCI IDAdrian Chadd2021-12-051-0/+1
| | | | | | | | | | This is needed on my ASUS motherboard / Intel Comet Lake i5-10500 desktop machine. This with some work arounds for nvme behind the RST controller boots and works. Reviewed by: cognet
* Add some of Intel Alder Lake device IDs.Alexander Motin2021-11-061-0/+1
| | | | MFC after: 1 week
* Mark some sysctls as CTLFLAG_MPSAFE.Alexander Motin2021-08-111-1/+1
| | | | MFC after: 2 weeks
* newbus: Move from bus_child_{pnpinfo,location}_src to ↵Warner Losh2021-06-236-11/+10
| | | | | | | | | | | | | | | | | | | | | | bus_child_{pnpinfo,location} with sbuf Now that the upper layers all go through a layer to tie into these information functions that translates an sbuf into char * and len. The current interface suffers issues of what to do in cases of truncation, etc. Instead, migrate all these functions to using struct sbuf and these issues go away. The caller is also in charge of any memory allocation and/or expansion that's needed during this process. Create a bus_generic_child_{pnpinfo,location} and make it default. It just returns success. This is for those busses that have no information for these items. Migrate the now-empty routines to using this as appropriate. Document these new interfaces with man pages, and oversight from before. Reviewed by: jhb, bcr Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29937
* Add IDs for ASMedia ASM116x PCIe 3.0 AHCI controllers.Alexander Motin2021-04-071-0/+5
| | | | MFC after: 1 week
* Add Intel Gemini Lake AHCI ID.Alexander Motin2021-01-151-0/+1
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week
* Add basic support for Freescale LX2160A SoC.Michal Meloun2020-12-051-49/+186
| | | | | | | All peripherals but the network processor are supported. Notes: svn path=/head/; revision=368369
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-283-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Fix stupid math mistake in r366922.Alexander Motin2020-11-211-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=367915
* Add icc (Isochronous Command Completion) ccb_ataio field.Alexander Motin2020-11-021-6/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=367261
* Move the iommu stubs to a generic place, so they are available on all theRuslan Bukin2020-10-231-4/+0
| | | | | | | | | | | | | | | platforms. This allows to not depend on the IOMMU macro in AHCI driver. Requested by: kib Suggested by: andrew Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26887 Notes: svn path=/head/; revision=366980
* Pass lower 3 bits of sector_count for FPDMA commands.Alexander Motin2020-10-221-3/+3
| | | | | | | | | | When this code was written those bits were N/A, but now the lowest bit is Rebuild Assist Recovery Control (RARC). MFC after: 1 month Notes: svn path=/head/; revision=366922
* Fix build: only set iommu buswide flag if IOMMU code is included.Ruslan Bukin2020-10-191-0/+4
| | | | | | | Sponsored by: Innovate DSbD Notes: svn path=/head/; revision=366865
* Add IOMMU_BUSWIDE ahci quirk.Ruslan Bukin2020-10-192-14/+42
| | | | | | | | | | | | | | | | | | | | | | Some controllers use PCI function 1 as the requester ID for DMA transfers, but the controllers are not PCI multifunction. Set the iommu buswide flag for them. This should instruct an IOMMU driver to use the same translation rule for all the devices and functions of a bus. This was discovered on the ARM Neoverse N1 System Development Platform (ARM N1SDP). Bug reference: https://bugzilla.kernel.org/show_bug.cgi?id=42679 Reported by: andrew Reviewed by: kib, mav Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26857 Notes: svn path=/head/; revision=366863
* ahci_generic: add quirk for NXP0004 (NXP Layerscape LX2160A)Emmanuel Vadot2020-09-301-0/+17
| | | | | | | | | | | | | | | This fixes this error : (aprobe3:ahcich3:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 00 00 (aprobe3:ahcich3:0:15:0): CAM status: Command timeout (aprobe3:ahcich3:0:15:0): Error 5, Retries exhausted Submitted by: Greg V <greg@unrelenting.technology> Reviewed by: imp, mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25157 Notes: svn path=/head/; revision=366295
* ahci: clean up empty lines in .c and .h filesMateusz Guzik2020-09-013-4/+0
| | | | Notes: svn path=/head/; revision=365104
* Add Intel Apollo Lake AHCI ID.Alexander Motin2020-08-061-0/+1
| | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=363955
* Limit AHCI to only one MSI if more is not needed.Alexander Motin2020-06-051-1/+5
| | | | | | | | | | | | | | | | My AMD Ryzen system has 4 AHCI controllers, each supporting 16 MSI vectors. Since two of the controllers have only one SATA port, limit to single MSI saves system 30 interrupt vectors for free. It may be possible to also limit number of MSI vectors to 4 and 8 for the other two controllers, but according to the AHCI specification after that controllers may revert to only one vector, that would be a bigger loss to risk. MFC after: 2 weeks Notes: svn path=/head/; revision=361816
* Introduce a driver for NXP LS1046A SoC AHCI.Marcin Wojtas2020-05-251-0/+287
| | | | | | | | | | | | | | Implement support for AHCI controller found in NXP QorIQ Layerscape SoCs. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: manu Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D24466 Notes: svn path=/head/; revision=361464
* Add support for AHCI BIOS/OS Handoff.Alexander Motin2020-04-012-0/+27
| | | | | | | | | | | | This allows clean handoff from BIOS implementing some asynchronous I/O to the OS AHCI driver. During attach driver declares OS ownership request and waits from 25ms to 2s for BIOS to complete operation and release the hardware. MFC after: 2 weeks Notes: svn path=/head/; revision=359500
* Add ID for JMicron JMB582/JMB585 AHCI controller.Alexander Motin2020-04-011-0/+2
| | | | | | | | | | | | JMB582 has 2 6Gbps SATA ports and PCIe 3.0 x1. JMB585 has 5 6Gbps SATA ports and PCIe 3.0 x2. Both chips support AHCI v1.31, Port Multiplier with FBS and 8 MSI vectors. MFC after: 2 weeks Notes: svn path=/head/; revision=359499
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333