AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
- ATA_FLAG_ACPI_SATA,
+ ATA_FLAG_ACPI_SATA | ATA_FLAG_AN,
AHCI_LFLAG_COMMON = ATA_LFLAG_SKIP_D2H_BSY,
};
.tf_read = ahci_tf_read,
+ .qc_defer = ata_std_qc_defer,
.qc_prep = ahci_qc_prep,
.qc_issue = ahci_qc_issue,
.tf_read = ahci_tf_read,
+ .qc_defer = ata_std_qc_defer,
.qc_prep = ahci_qc_prep,
.qc_issue = ahci_qc_issue,
{ PCI_VDEVICE(INTEL, 0x292f), board_ahci }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x294d), board_ahci }, /* ICH9 */
{ PCI_VDEVICE(INTEL, 0x294e), board_ahci }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */
+ { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
void __iomem *mmio = host->iomap[AHCI_PCI_BAR];
u32 tmp;
- /* global controller reset */
+ /* we must be in AHCI mode, before using anything
+ * AHCI-specific, such as HOST_RESET.
+ */
tmp = readl(mmio + HOST_CTL);
+ if (!(tmp & HOST_AHCI_EN))
+ writel(tmp | HOST_AHCI_EN, mmio + HOST_CTL);
+
+ /* global controller reset */
if ((tmp & HOST_RESET) == 0) {
writel(tmp | HOST_RESET, mmio + HOST_CTL);
readl(mmio + HOST_CTL); /* flush */
}
if (status & PORT_IRQ_SDB_FIS) {
- /*
- * if this is an ATAPI device with AN turned on,
- * then we should interrogate the device to
- * determine the cause of the interrupt
- *
- * for AN - this we should check the SDB FIS
- * and find the I and N bits set
+ /* If the 'N' bit in word 0 of the FIS is set, we just
+ * received asynchronous notification. Tell libata
+ * about it. Note that as the SDB FIS itself is
+ * accessible, SNotification can be emulated by the
+ * driver but don't bother for the time being.
*/
const __le32 *f = pp->rx_fis + RX_FIS_SDB;
u32 f0 = le32_to_cpu(f[0]);
- /* check the 'N' bit in word 0 of the FIS */
- if (f0 & (1 << 15)) {
- int port_addr = ((f0 & 0x00000f00) >> 8);
- struct ata_device *adev;
- if (port_addr < ATA_MAX_DEVICES) {
- adev = &ap->link.device[port_addr];
- if (adev->flags & ATA_DFLAG_AN)
- ata_scsi_media_change_notify(adev);
- }
- }
+ if (f0 & (1 << 15))
+ sata_async_notification(ap);
}
if (ap->link.sactive)