Commit 318893e1429a9d50569a0379d1e20b0ecc45c555
Committed by
Jeff Garzik
1 parent
909fefc251
Exists in
master
and in
6 other branches
ahci: support the STA2X11 I/O Hub
The AHCI controller found in the STA2X11 chip uses BAR number 0 instead of 5. Also, the chip's fixup code sets a special DMA mask for all of its PCI functions, and the mask must be preserved here. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Showing 1 changed file with 21 additions and 5 deletions Side-by-side Diff
drivers/ata/ahci.c
... | ... | @@ -52,7 +52,8 @@ |
52 | 52 | #define DRV_VERSION "3.0" |
53 | 53 | |
54 | 54 | enum { |
55 | - AHCI_PCI_BAR = 5, | |
55 | + AHCI_PCI_BAR_STA2X11 = 0, | |
56 | + AHCI_PCI_BAR_STANDARD = 5, | |
56 | 57 | }; |
57 | 58 | |
58 | 59 | enum board_ids { |
... | ... | @@ -375,6 +376,9 @@ |
375 | 376 | { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 968 */ |
376 | 377 | { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */ |
377 | 378 | |
379 | + /* ST Microelectronics */ | |
380 | + { PCI_VDEVICE(STMICRO, 0xCC06), board_ahci }, /* ST ConneXt */ | |
381 | + | |
378 | 382 | /* Marvell */ |
379 | 383 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ |
380 | 384 | { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ |
... | ... | @@ -622,6 +626,13 @@ |
622 | 626 | { |
623 | 627 | int rc; |
624 | 628 | |
629 | + /* | |
630 | + * If the device fixup already set the dma_mask to some non-standard | |
631 | + * value, don't extend it here. This happens on STA2X11, for example. | |
632 | + */ | |
633 | + if (pdev->dma_mask && pdev->dma_mask < DMA_BIT_MASK(32)) | |
634 | + return 0; | |
635 | + | |
625 | 636 | if (using_dac && |
626 | 637 | !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
627 | 638 | rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
... | ... | @@ -1026,6 +1037,7 @@ |
1026 | 1037 | struct ahci_host_priv *hpriv; |
1027 | 1038 | struct ata_host *host; |
1028 | 1039 | int n_ports, i, rc; |
1040 | + int ahci_pci_bar = AHCI_PCI_BAR_STANDARD; | |
1029 | 1041 | |
1030 | 1042 | VPRINTK("ENTER\n"); |
1031 | 1043 | |
... | ... | @@ -1057,6 +1069,10 @@ |
1057 | 1069 | dev_info(&pdev->dev, |
1058 | 1070 | "PDC42819 can only drive SATA devices with this driver\n"); |
1059 | 1071 | |
1072 | + /* The Connext uses non-standard BAR */ | |
1073 | + if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == 0xCC06) | |
1074 | + ahci_pci_bar = AHCI_PCI_BAR_STA2X11; | |
1075 | + | |
1060 | 1076 | /* acquire resources */ |
1061 | 1077 | rc = pcim_enable_device(pdev); |
1062 | 1078 | if (rc) |
... | ... | @@ -1065,7 +1081,7 @@ |
1065 | 1081 | /* AHCI controllers often implement SFF compatible interface. |
1066 | 1082 | * Grab all PCI BARs just in case. |
1067 | 1083 | */ |
1068 | - rc = pcim_iomap_regions_request_all(pdev, 1 << AHCI_PCI_BAR, DRV_NAME); | |
1084 | + rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME); | |
1069 | 1085 | if (rc == -EBUSY) |
1070 | 1086 | pcim_pin_device(pdev); |
1071 | 1087 | if (rc) |
... | ... | @@ -1108,7 +1124,7 @@ |
1108 | 1124 | if ((hpriv->flags & AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev)) |
1109 | 1125 | pci_intx(pdev, 1); |
1110 | 1126 | |
1111 | - hpriv->mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR]; | |
1127 | + hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar]; | |
1112 | 1128 | |
1113 | 1129 | /* save initial config */ |
1114 | 1130 | ahci_pci_save_initial_config(pdev, hpriv); |
... | ... | @@ -1172,8 +1188,8 @@ |
1172 | 1188 | for (i = 0; i < host->n_ports; i++) { |
1173 | 1189 | struct ata_port *ap = host->ports[i]; |
1174 | 1190 | |
1175 | - ata_port_pbar_desc(ap, AHCI_PCI_BAR, -1, "abar"); | |
1176 | - ata_port_pbar_desc(ap, AHCI_PCI_BAR, | |
1191 | + ata_port_pbar_desc(ap, ahci_pci_bar, -1, "abar"); | |
1192 | + ata_port_pbar_desc(ap, ahci_pci_bar, | |
1177 | 1193 | 0x100 + ap->port_no * 0x80, "port"); |
1178 | 1194 | |
1179 | 1195 | /* set enclosure management message type */ |