aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/piix.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:07 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:07 -0400
commit18137207236285989dfc0ee7f929b954199228f3 (patch)
treed55f1287ae64318190e18cb7a64ca514c76c3414 /drivers/ide/pci/piix.c
parentde372ecd80a42c4fb485c7232475301a18d05184 (diff)
ide: fix UDMA/MWDMA/SWDMA masks (v3)
* use 0x00 instead of 0x80 to disable ->{ultra,mwdma,swdma}_mask * add udma_mask field to ide_pci_device_t and use it to initialize ->ultra_mask in aec62xx, cmd64x, pdc202xx_{new,old} and piix drivers * fix UDMA masks to match with chipset specific *_ratemask() (alim15x3, hpt366, serverworks and siimage drivers need UDMA mask filtering method - done in the next patch) v2: * piix: fix cable detection for 82801AA_1 and 82372FB_1 [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] * cmd64x: use hwif->cds->udma_mask [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] * aec62xx: fix newly introduced bug - check DMA status not command register [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] v3: * piix: use hwif->cds->udma_mask [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/piix.c')
-rw-r--r--drivers/ide/pci/piix.c73
1 files changed, 31 insertions, 42 deletions
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 061d300ab8be..17ea44edb4eb 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -524,26 +524,14 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
524 hwif->ide_dma_clear_irq = &piix_dma_clear_irq; 524 hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
525 525
526 hwif->atapi_dma = 1; 526 hwif->atapi_dma = 1;
527 hwif->ultra_mask = 0x3f; 527
528 hwif->ultra_mask = hwif->cds->udma_mask;
528 hwif->mwdma_mask = 0x06; 529 hwif->mwdma_mask = 0x06;
529 hwif->swdma_mask = 0x04; 530 hwif->swdma_mask = 0x04;
530 531
531 switch(hwif->pci_dev->device) { 532 if (hwif->ultra_mask & 0x78) {
532 case PCI_DEVICE_ID_INTEL_82371FB_0: 533 if (!hwif->udma_four)
533 case PCI_DEVICE_ID_INTEL_82371FB_1: 534 hwif->udma_four = piix_cable_detect(hwif);
534 case PCI_DEVICE_ID_INTEL_82371SB_1:
535 hwif->ultra_mask = 0x80;
536 break;
537 case PCI_DEVICE_ID_INTEL_82371AB:
538 case PCI_DEVICE_ID_INTEL_82443MX_1:
539 case PCI_DEVICE_ID_INTEL_82451NX:
540 case PCI_DEVICE_ID_INTEL_82801AB_1:
541 hwif->ultra_mask = 0x07;
542 break;
543 default:
544 if (!hwif->udma_four)
545 hwif->udma_four = piix_cable_detect(hwif);
546 break;
547 } 535 }
548 536
549 if (no_piix_dma) 537 if (no_piix_dma)
@@ -557,7 +545,7 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
557 hwif->drives[0].autodma = hwif->autodma; 545 hwif->drives[0].autodma = hwif->autodma;
558} 546}
559 547
560#define DECLARE_PIIX_DEV(name_str) \ 548#define DECLARE_PIIX_DEV(name_str, udma) \
561 { \ 549 { \
562 .name = name_str, \ 550 .name = name_str, \
563 .init_chipset = init_chipset_piix, \ 551 .init_chipset = init_chipset_piix, \
@@ -566,11 +554,12 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
566 .autodma = AUTODMA, \ 554 .autodma = AUTODMA, \
567 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ 555 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
568 .bootable = ON_BOARD, \ 556 .bootable = ON_BOARD, \
557 .udma_mask = udma, \
569 } 558 }
570 559
571static ide_pci_device_t piix_pci_info[] __devinitdata = { 560static ide_pci_device_t piix_pci_info[] __devinitdata = {
572 /* 0 */ DECLARE_PIIX_DEV("PIIXa"), 561 /* 0 */ DECLARE_PIIX_DEV("PIIXa", 0x00), /* no udma */
573 /* 1 */ DECLARE_PIIX_DEV("PIIXb"), 562 /* 1 */ DECLARE_PIIX_DEV("PIIXb", 0x00), /* no udma */
574 563
575 /* 2 */ 564 /* 2 */
576 { /* 565 { /*
@@ -587,28 +576,28 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
587 .flags = IDEPCI_FLAG_ISA_PORTS 576 .flags = IDEPCI_FLAG_ISA_PORTS
588 }, 577 },
589 578
590 /* 3 */ DECLARE_PIIX_DEV("PIIX3"), 579 /* 3 */ DECLARE_PIIX_DEV("PIIX3", 0x00), /* no udma */
591 /* 4 */ DECLARE_PIIX_DEV("PIIX4"), 580 /* 4 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */
592 /* 5 */ DECLARE_PIIX_DEV("ICH0"), 581 /* 5 */ DECLARE_PIIX_DEV("ICH0", 0x07), /* udma0-2 */
593 /* 6 */ DECLARE_PIIX_DEV("PIIX4"), 582 /* 6 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */
594 /* 7 */ DECLARE_PIIX_DEV("ICH"), 583 /* 7 */ DECLARE_PIIX_DEV("ICH", 0x1f), /* udma0-4 */
595 /* 8 */ DECLARE_PIIX_DEV("PIIX4"), 584 /* 8 */ DECLARE_PIIX_DEV("PIIX4", 0x1f), /* udma0-4 */
596 /* 9 */ DECLARE_PIIX_DEV("PIIX4"), 585 /* 9 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */
597 /* 10 */ DECLARE_PIIX_DEV("ICH2"), 586 /* 10 */ DECLARE_PIIX_DEV("ICH2", 0x3f), /* udma0-5 */
598 /* 11 */ DECLARE_PIIX_DEV("ICH2M"), 587 /* 11 */ DECLARE_PIIX_DEV("ICH2M", 0x3f), /* udma0-5 */
599 /* 12 */ DECLARE_PIIX_DEV("ICH3M"), 588 /* 12 */ DECLARE_PIIX_DEV("ICH3M", 0x3f), /* udma0-5 */
600 /* 13 */ DECLARE_PIIX_DEV("ICH3"), 589 /* 13 */ DECLARE_PIIX_DEV("ICH3", 0x3f), /* udma0-5 */
601 /* 14 */ DECLARE_PIIX_DEV("ICH4"), 590 /* 14 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */
602 /* 15 */ DECLARE_PIIX_DEV("ICH5"), 591 /* 15 */ DECLARE_PIIX_DEV("ICH5", 0x3f), /* udma0-5 */
603 /* 16 */ DECLARE_PIIX_DEV("C-ICH"), 592 /* 16 */ DECLARE_PIIX_DEV("C-ICH", 0x3f), /* udma0-5 */
604 /* 17 */ DECLARE_PIIX_DEV("ICH4"), 593 /* 17 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */
605 /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA"), 594 /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA", 0x3f), /* udma0-5 */
606 /* 19 */ DECLARE_PIIX_DEV("ICH5"), 595 /* 19 */ DECLARE_PIIX_DEV("ICH5", 0x3f), /* udma0-5 */
607 /* 20 */ DECLARE_PIIX_DEV("ICH6"), 596 /* 20 */ DECLARE_PIIX_DEV("ICH6", 0x3f), /* udma0-5 */
608 /* 21 */ DECLARE_PIIX_DEV("ICH7"), 597 /* 21 */ DECLARE_PIIX_DEV("ICH7", 0x3f), /* udma0-5 */
609 /* 22 */ DECLARE_PIIX_DEV("ICH4"), 598 /* 22 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */
610 /* 23 */ DECLARE_PIIX_DEV("ESB2"), 599 /* 23 */ DECLARE_PIIX_DEV("ESB2", 0x3f), /* udma0-5 */
611 /* 24 */ DECLARE_PIIX_DEV("ICH8M"), 600 /* 24 */ DECLARE_PIIX_DEV("ICH8M", 0x3f), /* udma0-5 */
612}; 601};
613 602
614/** 603/**