|
48 | 48 | enum board_ids {
|
49 | 49 | /* board IDs by feature in alphabetical order */
|
50 | 50 | board_ahci,
|
| 51 | + board_ahci_43bit_dma, |
51 | 52 | board_ahci_ign_iferr,
|
52 | 53 | board_ahci_low_power,
|
53 | 54 | board_ahci_no_debounce_delay,
|
@@ -128,6 +129,13 @@ static const struct ata_port_info ahci_port_info[] = {
|
128 | 129 | .udma_mask = ATA_UDMA6,
|
129 | 130 | .port_ops = &ahci_ops,
|
130 | 131 | },
|
| 132 | + [board_ahci_43bit_dma] = { |
| 133 | + AHCI_HFLAGS (AHCI_HFLAG_43BIT_ONLY), |
| 134 | + .flags = AHCI_FLAG_COMMON, |
| 135 | + .pio_mask = ATA_PIO4, |
| 136 | + .udma_mask = ATA_UDMA6, |
| 137 | + .port_ops = &ahci_ops, |
| 138 | + }, |
131 | 139 | [board_ahci_ign_iferr] = {
|
132 | 140 | AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR),
|
133 | 141 | .flags = AHCI_FLAG_COMMON,
|
@@ -597,11 +605,11 @@ static const struct pci_device_id ahci_pci_tbl[] = {
|
597 | 605 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
|
598 | 606 | { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */
|
599 | 607 |
|
600 |
| - /* Asmedia */ |
| 608 | + /* ASMedia */ |
601 | 609 | { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */
|
602 | 610 | { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */
|
603 |
| - { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ |
604 |
| - { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ |
| 611 | + { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci_43bit_dma }, /* ASM1061 */ |
| 612 | + { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci_43bit_dma }, /* ASM1061/1062 */ |
605 | 613 | { PCI_VDEVICE(ASMEDIA, 0x0621), board_ahci }, /* ASM1061R */
|
606 | 614 | { PCI_VDEVICE(ASMEDIA, 0x0622), board_ahci }, /* ASM1062R */
|
607 | 615 | { PCI_VDEVICE(ASMEDIA, 0x0624), board_ahci }, /* ASM1062+JMB575 */
|
@@ -663,6 +671,11 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
|
663 | 671 | static void ahci_pci_save_initial_config(struct pci_dev *pdev,
|
664 | 672 | struct ahci_host_priv *hpriv)
|
665 | 673 | {
|
| 674 | + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == 0x1166) { |
| 675 | + dev_info(&pdev->dev, "ASM1166 has only six ports\n"); |
| 676 | + hpriv->saved_port_map = 0x3f; |
| 677 | + } |
| 678 | + |
666 | 679 | if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {
|
667 | 680 | dev_info(&pdev->dev, "JMB361 has only one port\n");
|
668 | 681 | hpriv->saved_port_map = 1;
|
@@ -949,11 +962,20 @@ static int ahci_pci_device_resume(struct device *dev)
|
949 | 962 |
|
950 | 963 | #endif /* CONFIG_PM */
|
951 | 964 |
|
952 |
| -static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac) |
| 965 | +static int ahci_configure_dma_masks(struct pci_dev *pdev, |
| 966 | + struct ahci_host_priv *hpriv) |
953 | 967 | {
|
954 |
| - const int dma_bits = using_dac ? 64 : 32; |
| 968 | + int dma_bits; |
955 | 969 | int rc;
|
956 | 970 |
|
| 971 | + if (hpriv->cap & HOST_CAP_64) { |
| 972 | + dma_bits = 64; |
| 973 | + if (hpriv->flags & AHCI_HFLAG_43BIT_ONLY) |
| 974 | + dma_bits = 43; |
| 975 | + } else { |
| 976 | + dma_bits = 32; |
| 977 | + } |
| 978 | + |
957 | 979 | /*
|
958 | 980 | * If the device fixup already set the dma_mask to some non-standard
|
959 | 981 | * value, don't extend it here. This happens on STA2X11, for example.
|
@@ -1926,7 +1948,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
1926 | 1948 | ahci_gtf_filter_workaround(host);
|
1927 | 1949 |
|
1928 | 1950 | /* initialize adapter */
|
1929 |
| - rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64); |
| 1951 | + rc = ahci_configure_dma_masks(pdev, hpriv); |
1930 | 1952 | if (rc)
|
1931 | 1953 | return rc;
|
1932 | 1954 |
|
|
0 commit comments