aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/ahci.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 19bd346951dd..2fffc7bf5d96 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -286,6 +286,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
286 board_ahci }, /* ICH8M */ 286 board_ahci }, /* ICH8M */
287 { PCI_VENDOR_ID_INTEL, 0x282a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 287 { PCI_VENDOR_ID_INTEL, 0x282a, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
288 board_ahci }, /* ICH8M */ 288 board_ahci }, /* ICH8M */
289 { 0x197b, 0x2360, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
290 board_ahci }, /* JMicron JMB360 */
289 { } /* terminate list */ 291 { } /* terminate list */
290}; 292};
291 293
@@ -802,7 +804,6 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
802 struct pci_dev *pdev = to_pci_dev(probe_ent->dev); 804 struct pci_dev *pdev = to_pci_dev(probe_ent->dev);
803 void __iomem *mmio = probe_ent->mmio_base; 805 void __iomem *mmio = probe_ent->mmio_base;
804 u32 tmp, cap_save; 806 u32 tmp, cap_save;
805 u16 tmp16;
806 unsigned int i, j, using_dac; 807 unsigned int i, j, using_dac;
807 int rc; 808 int rc;
808 void __iomem *port_mmio; 809 void __iomem *port_mmio;
@@ -836,9 +837,13 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
836 writel(0xf, mmio + HOST_PORTS_IMPL); 837 writel(0xf, mmio + HOST_PORTS_IMPL);
837 (void) readl(mmio + HOST_PORTS_IMPL); /* flush */ 838 (void) readl(mmio + HOST_PORTS_IMPL); /* flush */
838 839
839 pci_read_config_word(pdev, 0x92, &tmp16); 840 if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
840 tmp16 |= 0xf; 841 u16 tmp16;
841 pci_write_config_word(pdev, 0x92, tmp16); 842
843 pci_read_config_word(pdev, 0x92, &tmp16);
844 tmp16 |= 0xf;
845 pci_write_config_word(pdev, 0x92, tmp16);
846 }
842 847
843 hpriv->cap = readl(mmio + HOST_CAP); 848 hpriv->cap = readl(mmio + HOST_CAP);
844 hpriv->port_map = readl(mmio + HOST_PORTS_IMPL); 849 hpriv->port_map = readl(mmio + HOST_PORTS_IMPL);
@@ -1082,6 +1087,10 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1082 if (have_msi) 1087 if (have_msi)
1083 hpriv->flags |= AHCI_FLAG_MSI; 1088 hpriv->flags |= AHCI_FLAG_MSI;
1084 1089
1090 /* JMicron-specific fixup: make sure we're in AHCI mode */
1091 if (pdev->vendor == 0x197b)
1092 pci_write_config_byte(pdev, 0x41, 0xa1);
1093
1085 /* initialize adapter */ 1094 /* initialize adapter */
1086 rc = ahci_host_init(probe_ent); 1095 rc = ahci_host_init(probe_ent);
1087 if (rc) 1096 if (rc)