aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_sis.c
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2011-09-07 12:23:20 -0400
committerJeff Garzik <jgarzik@redhat.com>2011-10-08 00:07:16 -0400
commit14004f044bef275ac911375a8157e6773da4260a (patch)
tree0232dd54b5f57a0be7e4f10298bb63f5fc4867bb /drivers/ata/pata_sis.c
parentf30f9a5e7bc130c727712342dd064ae8d188b170 (diff)
pata_sis: enable MWDMA for UDMA 133 chipset
This ports the timing values over from the old IDE driver into the new PATA-based one. The comment was lying when it stated the old driver was not MWDMA capable. Boot tested on actual hardware using 'libata.force=mwdma2'. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_sis.c')
-rw-r--r--drivers/ata/pata_sis.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index fb4e90f6d749..a42668bd48f8 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -485,21 +485,30 @@ static void sis_133_set_dmamode (struct ata_port *ap, struct ata_device *adev)
485 int port; 485 int port;
486 u32 t1; 486 u32 t1;
487 487
488 /* bits 4- cycle time 8 - cvs time */
489 static const u32 timing_u100[] = { 0x6B0, 0x470, 0x350, 0x140, 0x120, 0x110, 0x000 };
490 static const u32 timing_u133[] = { 0x9F0, 0x6A0, 0x470, 0x250, 0x230, 0x220, 0x210 };
491
492 port = sis_port_base(adev); 488 port = sis_port_base(adev);
493 pci_read_config_dword(pdev, port, &t1); 489 pci_read_config_dword(pdev, port, &t1);
494 490
495 if (adev->dma_mode < XFER_UDMA_0) { 491 if (adev->dma_mode < XFER_UDMA_0) {
492 /* Recovery << 24 | Act << 16 | Ini << 12, like PIO modes */
493 static const u32 timing_u100[] = { 0x19154000, 0x06072000, 0x04062000 };
494 static const u32 timing_u133[] = { 0x221C6000, 0x0C0A3000, 0x05093000 };
495 int speed = adev->dma_mode - XFER_MW_DMA_0;
496
497 t1 &= 0xC0C00FFF;
498 /* disable UDMA */
496 t1 &= ~0x00000004; 499 t1 &= ~0x00000004;
497 /* FIXME: need data sheet to add MWDMA here. Also lacking on 500 if (t1 & 0x08)
498 ide/pci driver */ 501 t1 |= timing_u133[speed];
502 else
503 t1 |= timing_u100[speed];
499 } else { 504 } else {
505 /* bits 4- cycle time 8 - cvs time */
506 static const u32 timing_u100[] = { 0x6B0, 0x470, 0x350, 0x140, 0x120, 0x110, 0x000 };
507 static const u32 timing_u133[] = { 0x9F0, 0x6A0, 0x470, 0x250, 0x230, 0x220, 0x210 };
500 int speed = adev->dma_mode - XFER_UDMA_0; 508 int speed = adev->dma_mode - XFER_UDMA_0;
501 /* if & 8 no UDMA133 - need info for ... */ 509
502 t1 &= ~0x00000FF0; 510 t1 &= ~0x00000FF0;
511 /* enable UDMA */
503 t1 |= 0x00000004; 512 t1 |= 0x00000004;
504 if (t1 & 0x08) 513 if (t1 & 0x08)
505 t1 |= timing_u133[speed]; 514 t1 |= timing_u133[speed];
@@ -620,7 +629,7 @@ static const struct ata_port_info sis_info100_early = {
620static const struct ata_port_info sis_info133 = { 629static const struct ata_port_info sis_info133 = {
621 .flags = ATA_FLAG_SLAVE_POSS, 630 .flags = ATA_FLAG_SLAVE_POSS,
622 .pio_mask = ATA_PIO4, 631 .pio_mask = ATA_PIO4,
623 /* No MWDMA */ 632 .mwdma_mask = ATA_MWDMA2,
624 .udma_mask = ATA_UDMA6, 633 .udma_mask = ATA_UDMA6,
625 .port_ops = &sis_133_ops, 634 .port_ops = &sis_133_ops,
626}; 635};