diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:07 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:07 -0400 |
commit | 18137207236285989dfc0ee7f929b954199228f3 (patch) | |
tree | d55f1287ae64318190e18cb7a64ca514c76c3414 /drivers/ide/pci/cmd64x.c | |
parent | de372ecd80a42c4fb485c7232475301a18d05184 (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/cmd64x.c')
-rw-r--r-- | drivers/ide/pci/cmd64x.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 77f51ab6d439..610c45f7b4e2 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
@@ -644,15 +644,12 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif) | |||
644 | 644 | ||
645 | hwif->atapi_dma = 1; | 645 | hwif->atapi_dma = 1; |
646 | 646 | ||
647 | hwif->ultra_mask = 0x3f; | 647 | hwif->ultra_mask = hwif->cds->udma_mask; |
648 | hwif->mwdma_mask = 0x07; | 648 | |
649 | if (dev->device == PCI_DEVICE_ID_CMD_646 && class_rev < 5) | ||
650 | hwif->ultra_mask = 0x00; | ||
649 | 651 | ||
650 | if (dev->device == PCI_DEVICE_ID_CMD_643) | 652 | hwif->mwdma_mask = 0x07; |
651 | hwif->ultra_mask = 0x80; | ||
652 | if (dev->device == PCI_DEVICE_ID_CMD_646) | ||
653 | hwif->ultra_mask = (class_rev > 0x04) ? 0x07 : 0x80; | ||
654 | if (dev->device == PCI_DEVICE_ID_CMD_648) | ||
655 | hwif->ultra_mask = 0x1f; | ||
656 | 653 | ||
657 | hwif->ide_dma_check = &cmd64x_config_drive_for_dma; | 654 | hwif->ide_dma_check = &cmd64x_config_drive_for_dma; |
658 | if (!(hwif->udma_four)) | 655 | if (!(hwif->udma_four)) |
@@ -716,6 +713,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { | |||
716 | .autodma = AUTODMA, | 713 | .autodma = AUTODMA, |
717 | .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}}, | 714 | .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}}, |
718 | .bootable = ON_BOARD, | 715 | .bootable = ON_BOARD, |
716 | .udma_mask = 0x00, /* no udma */ | ||
719 | },{ /* 1 */ | 717 | },{ /* 1 */ |
720 | .name = "CMD646", | 718 | .name = "CMD646", |
721 | .init_setup = init_setup_cmd646, | 719 | .init_setup = init_setup_cmd646, |
@@ -725,6 +723,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { | |||
725 | .autodma = AUTODMA, | 723 | .autodma = AUTODMA, |
726 | .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, | 724 | .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, |
727 | .bootable = ON_BOARD, | 725 | .bootable = ON_BOARD, |
726 | .udma_mask = 0x07, /* udma0-2 */ | ||
728 | },{ /* 2 */ | 727 | },{ /* 2 */ |
729 | .name = "CMD648", | 728 | .name = "CMD648", |
730 | .init_setup = init_setup_cmd64x, | 729 | .init_setup = init_setup_cmd64x, |
@@ -734,6 +733,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { | |||
734 | .autodma = AUTODMA, | 733 | .autodma = AUTODMA, |
735 | .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, | 734 | .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, |
736 | .bootable = ON_BOARD, | 735 | .bootable = ON_BOARD, |
736 | .udma_mask = 0x1f, /* udma0-4 */ | ||
737 | },{ /* 3 */ | 737 | },{ /* 3 */ |
738 | .name = "CMD649", | 738 | .name = "CMD649", |
739 | .init_setup = init_setup_cmd64x, | 739 | .init_setup = init_setup_cmd64x, |
@@ -743,6 +743,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { | |||
743 | .autodma = AUTODMA, | 743 | .autodma = AUTODMA, |
744 | .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, | 744 | .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, |
745 | .bootable = ON_BOARD, | 745 | .bootable = ON_BOARD, |
746 | .udma_mask = 0x3f, /* udma0-5 */ | ||
746 | } | 747 | } |
747 | }; | 748 | }; |
748 | 749 | ||