aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahci
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add Hygon PCI ID and description for AHCI SATA controller.Alexander Motin2020-02-141-0/+1
| | | | | | | | | Submitted by: Pu Wen <puwen@hygon.cn> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23556 Notes: svn path=/head/; revision=357919
* Use a void * argument to callout handlers instead of timeout_t casts.John Baldwin2019-12-051-5/+6
| | | | | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22684 Notes: svn path=/head/; revision=355426
* Add some IDs of Intel Wildcat Point-LP.Alexander Motin2019-11-261-0/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=355113
* Fix AHCI Enclosure Management, broken by r351356.Alexander Motin2019-08-282-20/+24
| | | | | | | | ivars value of -1 was used to distinguish EM device, and r351356 left some wrong checks for it. Give EM device separate flag there instead. Notes: svn path=/head/; revision=351589
* Create a AHCI attachment for nvme.Warner Losh2019-08-213-5/+82
| | | | | | | | | | | | | | | | | | | | | | | | | Intel has created RST and many laptops from vendors like Lenovo and Asus. It's a mechanism for creating multiple boot devices under windows. It effectively hides the nvme drive inside of the ahci controller. The details are supposed to be a trade secret. However, there's a reverse engineered Linux driver, and this implements similar operations to allow nvme drives to attach. The ahci driver attaches nvme children that proxy the remapped resources to the child. nvme_ahci is just like nvme_pci, except it doesn't do the PCI specific things. That's moved into ahci where appropriate. When the nvme drive is remapped, MSI-x interrupts aren't forwarded (the linux driver doesn't know how to use this either). INTx interrupts are used instead. This is suboptimal, but usually sufficient for the laptops these parts are in. This is based loosely on https://www.spinics.net/lists/linux-ide/msg53364.html submitted, but not accepted by, Linux. It was written by Dan Williams. These changes were written from scratch by Olivier Houchard. Submitted by: cognet@ (Olivier Houchard) Notes: svn path=/head/; revision=351356
* Improve AHCI Enclosure Management and SES interoperation.Alexander Motin2019-06-233-36/+145
| | | | | | | | | | | | | | | | | | | | | | | | Since SES specs do not define mechanism to map enclosure slots to SATA disks, AHCI EM code I written many years ago appeared quite useless, that always bugged me. I was thinking whether it was a good idea, but if LSI HBAs do that, why I shouldn't? This change introduces simple non-standard mechanism for the mapping into both AHCI EM and SES code, that makes AHCI EM on capable controllers (most of Intel's) a first-class SES citizen, allowing it to report disk physical path to GEOM, show devices inserted into each enclosure slot in `sesutil map` and `getencstat`, control locate and fault LEDs for specific devices with `sesutil locate adaX on` and `sesutil fault adaX on`, etc. I've successfully tested this on Supermicro X10DRH-i motherboard connected with sideband cable of its S-SATA Mini-SAS connector to SAS815TQ backplane. It can indicate with LEDs Locate, Fault and Rebuild/Remap SES statuses for each disk identical to real SES of Supermicro SAS2 backplanes. MFC after: 2 weeks Notes: svn path=/head/; revision=349321
* ahci: Check if bus is cache-coherentEmmanuel Vadot2019-05-101-0/+7
| | | | | | | | | | | | We do this for FDT systems but not for ACPI ones. Check the presence of the _CCA attribute. Sponsored by: Ampere Computing, LLC Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D20144 Notes: svn path=/head/; revision=347440
* Add some Cannon Lake chipset IDs.Alexander Motin2019-03-201-0/+2
| | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=345333
* Fix use of busdma(9) KPI in ahci(4).Konstantin Belousov2019-01-071-16/+24
| | | | | | | | | | | | | | | Use BUS_DMA_NOWAIT for loads at initialization time. Report actual numeric error code if any problem occurs at the initialization. Reported and tested by: pho Reviewed by: mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18741 Notes: svn path=/head/; revision=342826
* Remove questionable initialization for ICH8M, rely on BIOS to properlyXin LI2018-12-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | initialize the controller. According to the datasheet, the old code checks if port 2 (P2E, 0x4) was the only enabled port (except port 0, which was ignored by mask 0xfe), and issue a write to the PCS register to disable all but port 0, right before ahci_ctlr_reset. Some other operating systems would issue a port enable to all ports, but since the current code only does the special initialization for ICH8M, it entirely and rely on BIOS to do the right thing (the alternative would be https://reviews.freebsd.org/D18300?id=50922 , should we see reports that we really need to do it). Reviewed by: mav MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D18300 Notes: svn path=/head/; revision=341811
* Implement ability to turn on/off PHYs for AHCI devices.Warner Losh2018-11-032-3/+49
| | | | | | | | | | | | | | | | | | As part of Chuck's work on fixing kernel crashes caused by disk I/O errors, it is useful to be able to trigger various kinds of errors. This patch allows causing an AHCI-attached disk to disappear, by having the driver keep the PHY disabled when the driver would otherwise enable the PHY. It also allows making the disk reappear by having the driver go back to setting the PHY enable/disable state as it normal would and simulating the hardware event that causes a bus rescan. Submitted by: Chuck Silvers Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D16043 Notes: svn path=/head/; revision=340092
* - Add quirk for Samsung on Mac Mini 7,1Martin Wilke2018-11-021-0/+1
| | | | | | | | | | | | PR: 201676 Submitted by: Ruben Kerkhof Approved by: araujo (mentor) Obtained from: TrueOS Sponsored by: iXsystems Inc. Differential Revision: https://review.freebsd.org/D17815 Notes: svn path=/head/; revision=340041
* Reapply, with minor tweaks, r338025, from the original commit:Warner Losh2018-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
* Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer2018-08-191-1/+1
| | | | | | | | | | I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
* Remove unused and easy to misuse PNP macro parameterConrad Meyer2018-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
* Fixed endianess issue in AHCI driverLeandro Lupori2018-07-271-3/+5
| | | | | | | | | | | | | There were some bits that were being set in cmd_flags (a field of AHCI's command list structure) after cmd_flags was converted to little endian. On a big endian host, such as PowerPC, this would set the wrong bits. This was preventing AHCI driver from working on these hosts. Reviewed by: jhibbits Approved by: jhibbits (mentor) Notes: svn path=/head/; revision=336760
* Add PCI IDs for AMD X370 AHCI and XHCI.Mark Johnston2018-07-121-1/+2
| | | | | | | | | Submitted by: Greg V <greg@unrelenting.technology> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15398 Notes: svn path=/head/; revision=336225
* Add PNP info to the PCI attachment of the ahci driverWarner Losh2018-06-131-0/+3
| | | | | | | | | | | | Mark the PNP table, but still need to handle the CLASS / SUBCLASS / REVID matching. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Notes: svn path=/head/; revision=335079
* Fix kernel modules names for Marvell armv7Marcin Wojtas2018-04-031-2/+2
| | | | | | | | | | | | | | | | Two modules with the same name cannot be loaded, so Marvell specific drivers cannot have the same name as the generic drivers. Files with the same name, even in different folders overlaps their .o files, so in order to prepare for supporting Marvell platforms in GENERIC armv7 config, modify conflicting names. Submitted by: Rafal Kozik <rk@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14743 Notes: svn path=/head/; revision=331966
* Add AHCI/XHCI device IDs found on AMD 1950X+X399 systemConrad Meyer2017-12-291-0/+1
| | | | | | | | | A follow-up to r327094. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327364
* Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system.Alexander Motin2017-12-221-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=327094
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-0/+6
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Add some PCI IDs found on AMD Epyc system.Alexander Motin2017-11-091-0/+5
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=325571
* Define a single instance of ahci_devclass and reference it from all theIan Lepore2017-10-024-2/+6
| | | | | | | | | | | attachment code for various SOCs and busses. Remove all the static and should-have-been-static and named-differently instances of it. This should eliminate the recently-grown build warnings about multiple definitions when building arm kernels. Notes: svn path=/head/; revision=324186
* Add support for AHCI in Armada 3700Marcin Wojtas2017-09-091-3/+4
| | | | | | | | | | | | This patch simply AHCI generic driver by extending compatible list. Submitted by: Patryk Duda <pdk@semihalf.com> Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12254 Notes: svn path=/head/; revision=323356
* Missing remanant of 322309.Alexander Motin2017-08-091-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=322316
* Use "Ibex Peak" codename for "5 Series/3400 Series" chipsets.Alexander Motin2017-08-091-6/+6
| | | | | | | | | This is shorter and unifies naming with later chipsets. MFC after: 1 week Notes: svn path=/head/; revision=322309
* Add new Intel Lewisburg and Union Point chipset PCI IDs.Alexander Motin2017-08-091-11/+23
| | | | | | | | | While there, polish some old AHCI ones, since they are still reused. MFC after: 1 week Notes: svn path=/head/; revision=322308
* Add some device IDs for Intel Denverton SoCs.Alexander Motin2017-06-211-0/+20
| | | | Notes: svn path=/head/; revision=320178
* Check if the device is marked as dma-coherent in the FDT, and if so, letOlivier Houchard2017-04-263-1/+7
| | | | | | | | | | busdma know, so that on architectures where dma isn't always coherent, we know we don't have to write-back/invalidates cachelines on DMA operations. Reviewed by: andrew, mav Notes: svn path=/head/; revision=317441
* Block FPDMA TRIM for ASMedia HBAs.Alexander Motin2017-04-183-11/+15
| | | | | | | | | | Experiments show FPDMA TRIM command timeouts on ASMedia HBAs, while the same SSDs working fine on Intel HBAs. MFC after: 2 weeks Notes: svn path=/head/; revision=317080
* Remove dead mentions of CAM target mode APIs from drivers.Alexander Motin2017-02-191-4/+0
| | | | | | | This makes grepping kernel for target mode implementation much easier. Notes: svn path=/head/; revision=313949
* Partially workaround ASMedia HBA error recovery.Alexander Motin2017-01-253-13/+26
| | | | | | | | | | | | Taking closer look on my ASM1062 I found that it has bunch of issues around error recovery: reported wrong CCS, failed commands reported as completed, READ LOG EXT times out after NCQ error. This patch workarounds first two problems, that were making ATAPI devices close to unusable on these HBAs. MFC after: 2 weeks Notes: svn path=/head/; revision=312767
* Extend AHCI_Q_BIT_STRING after adding new quirk for softWojciech Macek2017-01-251-1/+2
| | | | | | | | | | | | | | | reset delay Adding new quirk (AHCI_Q_MRVL_SR_DEL) requires according extention of AHCI_Q_BIT_STRING. Submitted by: Marcin Wojtas <mw@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: wma Notes: svn path=/head/; revision=312751
* Add support for AHCI on ARMADA38XWojciech Macek2017-01-251-0/+156
| | | | | | | | | | | | | | This file provides support for AHCI mode on Armada38x and adds new optional AHCI device to arm/mv/files.mv. Submitted by: Konrad Adamczyk <ka@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D9222 Notes: svn path=/head/; revision=312749
* Enable optional soft reset in AHCIWojciech Macek2017-01-252-0/+9
| | | | | | | | | | | | | | | | It occurred that some Marvell integrated controllers require additional time after soft reset to work properly. Introduce new quirk (AHCI_Q_MRVL_SR_DEL), that enable such operation. Submitted by: Konrad Adamczyk <ka@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: mav Differential revision: https://reviews.freebsd.org/D9221 Notes: svn path=/head/; revision=312748
* Add an ACPI attachment to the existing ahci_generic driver. This is usedAndrew Turner2017-01-101-14/+74
| | | | | | | | | | | | in some arm64 hardware, for example the AMD Opteron A1100. Reviewed by: mav Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8852 Notes: svn path=/head/; revision=311874
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-042-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* Add more ASMedia PCI IDs from different sources.Alexander Motin2016-11-281-2/+9
| | | | | | | | | Exact device names are not clear, but its better then nothing at all. MFC after: 1 month Notes: svn path=/head/; revision=309252
* Process port interrupt even is PxIS register is zero.Alexander Motin2016-11-281-4/+0
| | | | | | | | | | | | ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too. MFC after: 1 month Notes: svn path=/head/; revision=309251
* Fix channel initialization in FBS mode.Alexander Motin2016-09-071-15/+15
| | | | | | | | | | | | Due to reading initialized variable, FIS receive area was always allocated as 256 bytes, suitable for command-based switching, instead of 4096 bytes, required for FIS-based switching. This caused memory corruption in case of port multipliers used on FBS-capable HBAs (Marvell). MFC after: 1 week Notes: svn path=/head/; revision=305536
* JMicron JMB361 has only a single SATA portAndriy Gapon2016-08-201-1/+1
| | | | | | | | Discussed with: mav MFC after: 3 days Notes: svn path=/head/; revision=304521
* In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.Alexander Motin2016-07-171-0/+1
| | | | | | | | | This is probably a NOP change since IS register is not activery used for interrupts below the shared, but it looked odd to clear interrupts we did not handle. Notes: svn path=/head/; revision=302947
* Do not consider the last interrupt shared if there are enough interruptsAlexander Motin2016-07-171-1/+2
| | | | | | | for all channels. Notes: svn path=/head/; revision=302946
* Fix ahci(4) driver attach to controller with 32 ports.Alexander Motin2016-07-072-4/+4
| | | | | | | | | | | | | Incorrect sign expansion in variables that supposed to be a bit fields caused infinite loop. Fixing this allows system properly detect maximal possible 32 devices configured on AHCI HBA of BHyVe. That case did not happen in a wild before due to lack of hardware AHCI HBAs with 32 ports. Approved by: re (gjb@) MFC after: 1 week Notes: svn path=/head/; revision=302402
* Add support for managing Shingled Magnetic Recording (SMR) drives.Kenneth D. Merry2016-05-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change includes support for SCSI SMR drives (which conform to the Zoned Block Commands or ZBC spec) and ATA SMR drives (which conform to the Zoned ATA Command Set or ZAC spec) behind SAS expanders. This includes full management support through the GEOM BIO interface, and through a new userland utility, zonectl(8), and through camcontrol(8). This is now ready for filesystems to use to detect and manage zoned drives. (There is no work in progress that I know of to use this for ZFS or UFS, if anyone is interested, let me know and I may have some suggestions.) Also, improve ATA command passthrough and dispatch support, both via ATA and ATA passthrough over SCSI. Also, add support to camcontrol(8) for the ATA Extended Power Conditions feature set. You can now manage ATA device power states, and set various idle time thresholds for a drive to enter lower power states. Note that this change cannot be MFCed in full, because it depends on changes to the struct bio API that break compatilibity. In order to avoid breaking the stable API, only changes that don't touch or depend on the struct bio changes can be merged. For example, the camcontrol(8) changes don't depend on the new bio API, but zonectl(8) and the probe changes to the da(4) and ada(4) drivers do depend on it. Also note that the SMR changes have not yet been tested with an actual SCSI ZBC device, or a SCSI to ATA translation layer (SAT) that supports ZBC to ZAC translation. I have not yet gotten a suitable drive or SAT layer, so any testing help would be appreciated. These changes have been tested with Seagate Host Aware SATA drives attached to both SAS and SATA controllers. Also, I do not have any SATA Host Managed devices, and I suspect that it may take additional (hopefully minor) changes to support them. Thanks to Seagate for supplying the test hardware and answering questions. sbin/camcontrol/Makefile: Add epc.c and zone.c. sbin/camcontrol/camcontrol.8: Document the zone and epc subcommands. sbin/camcontrol/camcontrol.c: Add the zone and epc subcommands. Add auxiliary register support to build_ata_cmd(). Make sure to set the CAM_ATAIO_NEEDRESULT, CAM_ATAIO_DMA, and CAM_ATAIO_FPDMA flags as appropriate for ATA commands. Add a new get_ata_status() function to parse ATA result from SCSI sense descriptors (for ATA passthrough over SCSI) and ATA I/O requests. sbin/camcontrol/camcontrol.h: Update the build_ata_cmd() prototype Add get_ata_status(), zone(), and epc(). sbin/camcontrol/epc.c: Support for ATA Extended Power Conditions features. This includes support for all features documented in the ACS-4 Revision 12 specification from t13.org (dated February 18, 2016). The EPC feature set allows putting a drive into a power power mode immediately, or setting timeouts so that the drive will automatically enter progressively lower power states after various idle times. sbin/camcontrol/fwdownload.c: Update the firmware download code for the new build_ata_cmd() arguments. sbin/camcontrol/zone.c: Implement support for Shingled Magnetic Recording (SMR) drives via SCSI Zoned Block Commands (ZBC) and ATA Zoned Device ATA Command Set (ZAC). These specs were developed in concert, and are functionally identical. The primary differences are due to SCSI and ATA differences. (SCSI is big endian, ATA is little endian, for example.) This includes support for all commands defined in the ZBC and ZAC specs. sys/cam/ata/ata_all.c: Decode a number of additional ATA command names in ata_op_string(). Add a new CCB building function, ata_read_log(). Add ata_zac_mgmt_in() and ata_zac_mgmt_out() CCB building functions. These support both DMA and NCQ encapsulation. sys/cam/ata/ata_all.h: Add prototypes for ata_read_log(), ata_zac_mgmt_out(), and ata_zac_mgmt_in(). sys/cam/ata/ata_da.c: Revamp the ada(4) driver to support zoned devices. Add four new probe states to gather information needed for zone support. Add a new adasetflags() function to avoid duplication of large blocks of flag setting between the async handler and register functions. Add new sysctl variables that describe zone support and paramters. Add support for the new BIO_ZONE bio, and all of its subcommands: DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP, DISK_ZONE_REPORT_ZONES, and DISK_ZONE_GET_PARAMS. sys/cam/scsi/scsi_all.c: Add command descriptions for the ZBC IN/OUT commands. Add descriptions for ZBC Host Managed devices. Add a new function, scsi_ata_pass() to do ATA passthrough over SCSI. This will eventually replace scsi_ata_pass_16() -- it can create the 12, 16, and 32-byte variants of the ATA PASS-THROUGH command, and supports setting all of the registers defined as of SAT-4, Revision 5 (March 11, 2016). Change scsi_ata_identify() to use scsi_ata_pass() instead of scsi_ata_pass_16(). Add a new scsi_ata_read_log() function to facilitate reading ATA logs via SCSI. sys/cam/scsi/scsi_all.h: Add the new ATA PASS-THROUGH(32) command CDB. Add extended and variable CDB opcodes. Add Zoned Block Device Characteristics VPD page. Add ATA Return SCSI sense descriptor. Add prototypes for scsi_ata_read_log() and scsi_ata_pass(). sys/cam/scsi/scsi_da.c: Revamp the da(4) driver to support zoned devices. Add five new probe states, four of which are needed for ATA devices. Add five new sysctl variables that describe zone support and parameters. The da(4) driver supports SCSI ZBC devices, as well as ATA ZAC devices when they are attached via a SCSI to ATA Translation (SAT) layer. Since ZBC -> ZAC translation is a new feature in the T10 SAT-4 spec, most SATA drives will be supported via ATA commands sent via the SCSI ATA PASS-THROUGH command. The da(4) driver will prefer the ZBC interface, if it is available, for performance reasons, but will use the ATA PASS-THROUGH interface to the ZAC command set if the SAT layer doesn't support translation yet. As I mentioned above, ZBC command support is untested. Add support for the new BIO_ZONE bio, and all of its subcommands: DISK_ZONE_OPEN, DISK_ZONE_CLOSE, DISK_ZONE_FINISH, DISK_ZONE_RWP, DISK_ZONE_REPORT_ZONES, and DISK_ZONE_GET_PARAMS. Add scsi_zbc_in() and scsi_zbc_out() CCB building functions. Add scsi_ata_zac_mgmt_out() and scsi_ata_zac_mgmt_in() CCB/CDB building functions. Note that these have return values, unlike almost all other CCB building functions in CAM. The reason is that they can fail, depending upon the particular combination of input parameters. The primary failure case is if the user wants NCQ, but fails to specify additional CDB storage. NCQ requires using the 32-byte version of the SCSI ATA PASS-THROUGH command, and the current CAM CDB size is 16 bytes. sys/cam/scsi/scsi_da.h: Add ZBC IN and ZBC OUT CDBs and opcodes. Add SCSI Report Zones data structures. Add scsi_zbc_in(), scsi_zbc_out(), scsi_ata_zac_mgmt_out(), and scsi_ata_zac_mgmt_in() prototypes. sys/dev/ahci/ahci.c: Fix SEND / RECEIVE FPDMA QUEUED in the ahci(4) driver. ahci_setup_fis() previously set the top bits of the sector count register in the FIS to 0 for FPDMA commands. This is okay for read and write, because the PRIO field is in the only thing in those bits, and we don't implement that further up the stack. But, for SEND and RECEIVE FPDMA QUEUED, the subcommand is in that byte, so it needs to be transmitted to the drive. In ahci_setup_fis(), always set the the top 8 bits of the sector count register. We need it in both the standard and NCQ / FPDMA cases. sys/geom/eli/g_eli.c: Pass BIO_ZONE commands through the GELI class. sys/geom/geom.h: Add g_io_zonecmd() prototype. sys/geom/geom_dev.c: Add new DIOCZONECMD ioctl, which allows sending zone commands to disks. sys/geom/geom_disk.c: Add support for BIO_ZONE commands. sys/geom/geom_disk.h: Add a new flag, DISKFLAG_CANZONE, that indicates that a given GEOM disk client can handle BIO_ZONE commands. sys/geom/geom_io.c: Add a new function, g_io_zonecmd(), that handles execution of BIO_ZONE commands. Add permissions check for BIO_ZONE commands. Add command decoding for BIO_ZONE commands. sys/geom/geom_subr.c: Add DDB command decoding for BIO_ZONE commands. sys/kern/subr_devstat.c: Record statistics for REPORT ZONES commands. Note that the number of bytes transferred for REPORT ZONES won't quite match what is received from the harware. This is because we're necessarily counting bytes coming from the da(4) / ada(4) drivers, which are using the disk_zone.h interface to communicate up the stack. The structure sizes it uses are slightly different than the SCSI and ATA structure sizes. sys/sys/ata.h: Add many bit and structure definitions for ZAC, NCQ, and EPC command support. sys/sys/bio.h: Convert the bio_cmd field to a straight enumeration. This will yield more space for additional commands in the future. After change r297955 and other related changes, this is now possible. Converting to an enumeration will also prevent use as a bitmask in the future. sys/sys/disk.h: Define the DIOCZONECMD ioctl. sys/sys/disk_zone.h: Add a new API for managing zoned disks. This is very close to the SCSI ZBC and ATA ZAC standards, but uses integers in native byte order instead of big endian (SCSI) or little endian (ATA) byte arrays. This is intended to offer to the complete feature set of the ZBC and ZAC disk management without requiring the application developer to include SCSI or ATA headers. We also use one set of headers for ioctl consumers and kernel bio-level consumers. sys/sys/param.h: Bump __FreeBSD_version for sys/bio.h command changes, and inclusion of SMR support. usr.sbin/Makefile: Add the zonectl utility. usr.sbin/diskinfo/diskinfo.c Add disk zoning capability to the 'diskinfo -v' output. usr.sbin/zonectl/Makefile: Add zonectl makefile. usr.sbin/zonectl/zonectl.8 zonectl(8) man page. usr.sbin/zonectl/zonectl.c The zonectl(8) utility. This allows managing SCSI or ATA zoned disks via the disk_zone.h API. You can report zones, reset write pointers, get parameters, etc. Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D6147 Reviewed by: wblock (documentation) Notes: svn path=/head/; revision=300207
* Add some device IDs from Intel Sunrise Point chipsets.Alexander Motin2016-05-031-0/+9
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=298983
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-032-3/+3
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Implement Auxiliary register. Add PIM_ATA_EXT flag to flag that a SIMWarner Losh2016-04-171-4/+7
| | | | | | | | | | | | can handle it, and add the code to add it to the FIS that's sent to the drive. The mvs driver is the only other ATA driver in the system, and its hardware doesn't appear to support setting the Auxiliary register. Differential Revision: https://reviews.freebsd.org/D5598 Notes: svn path=/head/; revision=298143