Lines Matching +full:conf +full:- +full:rst

1 /*-
2 * Copyright (c) 2009-2012 Alexander Motin <mav@FreeBSD.org>
32 #include <sys/conf.h>
78 {0x78001022, 0x00, "AMD Hudson-2", 0},
79 {0x78011022, 0x00, "AMD Hudson-2", 0},
80 {0x78021022, 0x00, "AMD Hudson-2", 0},
81 {0x78031022, 0x00, "AMD Hudson-2", 0},
82 {0x78041022, 0x00, "AMD Hudson-2", 0},
139 {0x3b298086, 0x00, "Intel Ibex Peak-M", 0},
140 {0x3b2c8086, 0x00, "Intel Ibex Peak-M (RAID)", 0},
141 {0x3b2f8086, 0x00, "Intel Ibex Peak-M", 0},
225 {0x9c028086, 0x00, "Intel Lynx Point-LP", 0},
226 {0x9c038086, 0x00, "Intel Lynx Point-LP", 0},
227 {0x9c048086, 0x00, "Intel Lynx Point-LP (RAID)", 0},
228 {0x9c058086, 0x00, "Intel Lynx Point-LP (RAID)", 0},
229 {0x9c068086, 0x00, "Intel Lynx Point-LP (RAID)", 0},
230 {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0},
231 {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0},
232 {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0},
233 {0x9c838086, 0x00, "Intel Wildcat Point-LP", 0},
234 {0x9c858086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
235 {0x9c878086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
236 {0x9c8f8086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
237 {0x9d038086, 0x00, "Intel Sunrise Point-LP", 0},
238 {0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0},
239 {0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0},
269 {0x01221c28, 0x00, "Lite-On Plextor M6E (Marvell 88SS9183)",
509 ctlr->quirks = ahci_ids[i].quirks; in ahci_pci_attach()
511 if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) { in ahci_pci_attach()
525 ctlr->quirks |= AHCI_Q_SATA1_UNIT0; in ahci_pci_attach()
527 "quirks", &ctlr->quirks); in ahci_pci_attach()
528 ctlr->vendorid = pci_get_vendor(dev); in ahci_pci_attach()
529 ctlr->deviceid = pci_get_device(dev); in ahci_pci_attach()
530 ctlr->subvendorid = pci_get_subvendor(dev); in ahci_pci_attach()
531 ctlr->subdeviceid = pci_get_subdevice(dev); in ahci_pci_attach()
534 if (ctlr->quirks & AHCI_Q_ABAR0) in ahci_pci_attach()
535 ctlr->r_rid = PCIR_BAR(0); in ahci_pci_attach()
537 ctlr->r_rid = PCIR_BAR(5); in ahci_pci_attach()
538 if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in ahci_pci_attach()
539 &ctlr->r_rid, RF_ACTIVE))) in ahci_pci_attach()
546 * from RST to AHCI. in ahci_pci_attach()
551 vscap = ATA_INL(ctlr->r_mem, AHCI_VSCAP); in ahci_pci_attach()
553 uint32_t cap = ATA_INL(ctlr->r_mem, 0x800); /* Intel's REMAP CAP */ in ahci_pci_attach()
556 ctlr->remap_offset = 0x4000; in ahci_pci_attach()
557 ctlr->remap_size = 0x4000; in ahci_pci_attach()
566 (ATA_INL(ctlr->r_mem, 0x880 + i * 0x80) == in ahci_pci_attach()
570 ctlr->remapped_devices++; in ahci_pci_attach()
575 if (ctlr->remapped_devices > 0) { in ahci_pci_attach()
577 ctlr->remapped_devices); in ahci_pci_attach()
578 ctlr->quirks |= (AHCI_Q_NOMSIX | AHCI_Q_NOMSI); in ahci_pci_attach()
583 if (ctlr->quirks & AHCI_Q_NOMSIX) in ahci_pci_attach()
586 /* Read MSI-x BAR IDs if supported */ in ahci_pci_attach()
590 ctlr->r_msix_tab_rid = table_bar; in ahci_pci_attach()
591 ctlr->r_msix_pba_rid = pba_bar; in ahci_pci_attach()
593 /* Failed to read BARs, disable MSI-x */ in ahci_pci_attach()
598 /* Allocate resources for MSI-x table and PBA */ in ahci_pci_attach()
601 * Allocate new MSI-x table only if not in ahci_pci_attach()
604 ctlr->r_msix_table = NULL; in ahci_pci_attach()
605 if (ctlr->r_msix_tab_rid != ctlr->r_rid) { in ahci_pci_attach()
606 /* Separate BAR for MSI-x */ in ahci_pci_attach()
607 ctlr->r_msix_table = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in ahci_pci_attach()
608 &ctlr->r_msix_tab_rid, RF_ACTIVE); in ahci_pci_attach()
609 if (ctlr->r_msix_table == NULL) { in ahci_pci_attach()
619 ctlr->r_msix_pba = NULL; in ahci_pci_attach()
620 if ((ctlr->r_msix_pba_rid != ctlr->r_msix_tab_rid) && in ahci_pci_attach()
621 (ctlr->r_msix_pba_rid != ctlr->r_rid)) { in ahci_pci_attach()
623 ctlr->r_msix_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in ahci_pci_attach()
624 &ctlr->r_msix_pba_rid, RF_ACTIVE); in ahci_pci_attach()
625 if (ctlr->r_msix_pba == NULL) { in ahci_pci_attach()
643 caps = ATA_INL(ctlr->r_mem, AHCI_CAP); in ahci_pci_attach()
644 pi = ATA_INL(ctlr->r_mem, AHCI_PI); in ahci_pci_attach()
645 if (ctlr->quirks & AHCI_Q_NOMSI) in ahci_pci_attach()
646 ctlr->msi = 0; in ahci_pci_attach()
647 else if ((ctlr->quirks & AHCI_Q_1MSI) || in ahci_pci_attach()
649 ctlr->msi = 1; in ahci_pci_attach()
651 ctlr->msi = 2; in ahci_pci_attach()
653 device_get_unit(dev), "msi", &ctlr->msi); in ahci_pci_attach()
654 ctlr->numirqs = 1; in ahci_pci_attach()
656 ctlr->msi = 0; in ahci_pci_attach()
657 if (ctlr->msi < 0) in ahci_pci_attach()
658 ctlr->msi = 0; in ahci_pci_attach()
659 else if (ctlr->msi == 1) { in ahci_pci_attach()
662 } else if (ctlr->msi > 1) in ahci_pci_attach()
663 ctlr->msi = 2; in ahci_pci_attach()
665 /* Allocate MSI/MSI-x if needed/present. */ in ahci_pci_attach()
666 if (ctlr->msi > 0) { in ahci_pci_attach()
669 /* Try to allocate MSI-x first */ in ahci_pci_attach()
673 ctlr->numirqs = msix_count; in ahci_pci_attach()
678 * and if MSI-x allocation failed. in ahci_pci_attach()
683 ctlr->numirqs = msi_count; in ahci_pci_attach()
686 /* Both MSI and MSI-x allocations failed */ in ahci_pci_attach()
688 ctlr->msi = 0; in ahci_pci_attach()
689 device_printf(dev, "Failed to allocate MSI/MSI-x, " in ahci_pci_attach()
696 if (ctlr->msi > 0) in ahci_pci_attach()
719 ATA_OUTL(ctlr->r_mem, AHCI_GHC, in ahci_pci_suspend()
720 ATA_INL(ctlr->r_mem, AHCI_GHC) & (~AHCI_GHC_IE)); in ahci_pci_suspend()
760 nitems(ahci_ids) - 1);