diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-10-10 17:28:11 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-01 22:40:25 -0500 |
commit | fc085150b491bfc186efbca90a14cf907a3060a9 (patch) | |
tree | b5bf8b6eb6d0dabd8699e6b41c239619590659e2 /drivers | |
parent | 2f27ce03628acdb81ead4abe914c713e04a3229e (diff) |
[PATCH] libata: add 40pin "short" cable support, honour drive side speed detection
[deweerdt@free.fr: build fix]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Frederik Deweerdt <deweerdt@free.fr>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/ata_piix.c | 31 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 7 | ||||
-rw-r--r-- | drivers/ata/pata_ali.c | 2 |
3 files changed, 38 insertions, 2 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 720174d628fa..14b726b9f985 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -93,7 +93,7 @@ | |||
93 | #include <linux/libata.h> | 93 | #include <linux/libata.h> |
94 | 94 | ||
95 | #define DRV_NAME "ata_piix" | 95 | #define DRV_NAME "ata_piix" |
96 | #define DRV_VERSION "2.00ac6" | 96 | #define DRV_VERSION "2.00ac7" |
97 | 97 | ||
98 | enum { | 98 | enum { |
99 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ | 99 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ |
@@ -571,6 +571,23 @@ module_param(force_pcs, int, 0444); | |||
571 | MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around " | 571 | MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around " |
572 | "device mis-detection (0=default, 1=ignore PCS, 2=honor PCS)"); | 572 | "device mis-detection (0=default, 1=ignore PCS, 2=honor PCS)"); |
573 | 573 | ||
574 | struct ich_laptop { | ||
575 | u16 device; | ||
576 | u16 subvendor; | ||
577 | u16 subdevice; | ||
578 | }; | ||
579 | |||
580 | /* | ||
581 | * List of laptops that use short cables rather than 80 wire | ||
582 | */ | ||
583 | |||
584 | static const struct ich_laptop ich_laptop[] = { | ||
585 | /* devid, subvendor, subdev */ | ||
586 | { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ | ||
587 | /* end marker */ | ||
588 | { 0, } | ||
589 | }; | ||
590 | |||
574 | /** | 591 | /** |
575 | * piix_pata_cbl_detect - Probe host controller cable detect info | 592 | * piix_pata_cbl_detect - Probe host controller cable detect info |
576 | * @ap: Port for which cable detect info is desired | 593 | * @ap: Port for which cable detect info is desired |
@@ -585,12 +602,24 @@ MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around " | |||
585 | static void ich_pata_cbl_detect(struct ata_port *ap) | 602 | static void ich_pata_cbl_detect(struct ata_port *ap) |
586 | { | 603 | { |
587 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 604 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
605 | const struct ich_laptop *lap = &ich_laptop[0]; | ||
588 | u8 tmp, mask; | 606 | u8 tmp, mask; |
589 | 607 | ||
590 | /* no 80c support in host controller? */ | 608 | /* no 80c support in host controller? */ |
591 | if ((ap->udma_mask & ~ATA_UDMA_MASK_40C) == 0) | 609 | if ((ap->udma_mask & ~ATA_UDMA_MASK_40C) == 0) |
592 | goto cbl40; | 610 | goto cbl40; |
593 | 611 | ||
612 | /* Check for specials - Acer Aspire 5602WLMi */ | ||
613 | while (lap->device) { | ||
614 | if (lap->device == pdev->device && | ||
615 | lap->subvendor == pdev->subsystem_vendor && | ||
616 | lap->subdevice == pdev->subsystem_device) { | ||
617 | ap->cbl = ATA_CBL_PATA40_SHORT; | ||
618 | return; | ||
619 | } | ||
620 | lap++; | ||
621 | } | ||
622 | |||
594 | /* check BIOS cable detect results */ | 623 | /* check BIOS cable detect results */ |
595 | mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC; | 624 | mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC; |
596 | pci_read_config_byte(pdev, PIIX_IOCFG, &tmp); | 625 | pci_read_config_byte(pdev, PIIX_IOCFG, &tmp); |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 915a55a6cc14..b896119cccd3 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -3119,6 +3119,13 @@ static void ata_dev_xfermask(struct ata_device *dev) | |||
3119 | */ | 3119 | */ |
3120 | if (ap->cbl == ATA_CBL_PATA40) | 3120 | if (ap->cbl == ATA_CBL_PATA40) |
3121 | xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); | 3121 | xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); |
3122 | /* Apply drive side cable rule. Unknown or 80 pin cables reported | ||
3123 | * host side are checked drive side as well. Cases where we know a | ||
3124 | * 40wire cable is used safely for 80 are not checked here. | ||
3125 | */ | ||
3126 | if (ata_drive_40wire(dev->id) && (ap->cbl == ATA_CBL_PATA_UNK || ap->cbl == ATA_CBL_PATA80)) | ||
3127 | xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); | ||
3128 | |||
3122 | 3129 | ||
3123 | xfer_mask &= ata_pack_xfermask(dev->pio_mask, | 3130 | xfer_mask &= ata_pack_xfermask(dev->pio_mask, |
3124 | dev->mwdma_mask, dev->udma_mask); | 3131 | dev->mwdma_mask, dev->udma_mask); |
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index 64eed99f6814..e6d2b840e870 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c | |||
@@ -78,7 +78,7 @@ static int ali_c2_cable_detect(struct ata_port *ap) | |||
78 | implement the detect logic */ | 78 | implement the detect logic */ |
79 | 79 | ||
80 | if (ali_cable_override(pdev)) | 80 | if (ali_cable_override(pdev)) |
81 | return ATA_CBL_PATA80; | 81 | return ATA_CBL_PATA40_SHORT; |
82 | 82 | ||
83 | /* Host view cable detect 0x4A bit 0 primary bit 1 secondary | 83 | /* Host view cable detect 0x4A bit 0 primary bit 1 secondary |
84 | Bit set for 40 pin */ | 84 | Bit set for 40 pin */ |