]> err.no Git - linux-2.6/commitdiff
ide: add ->mwdma_mask and ->swdma_mask to ide_pci_device_t (take 2)
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 18 Oct 2007 22:30:07 +0000 (00:30 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 18 Oct 2007 22:30:07 +0000 (00:30 +0200)
* Add ->mwdma_mask and ->swdma_mask to ide_pci_device_t.

* Set ide_hwif_t DMA masks using DMA masks from ide_pci_device_t in
  setup-pci.c::ide_pci_setup_ports() (iff DMA base is valid and ->init_hwif
  method may still override them).

* Convert IDE PCI host drivers to use ide_pci_device_t DMA masks.

While at it:

* Use ATA_{UDMA,MWDMA,SWDMA}* defines.

* hpt34x.c: add separate ide_pci_device_t instances for HPT343 and HPT345.

* serverworks.c: fix DMA masks being set before checking DMA base.

v2:
* Add missing masks to DECLARE_GENERIC_PCI_DEV() macro.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
32 files changed:
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cs5535.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/generic.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/it8213.c
drivers/ide/pci/it821x.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/opti621.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/piix.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/scc_pata.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/tc86c001.c
drivers/ide/pci/triflex.c
drivers/ide/pci/via82cxxx.c
drivers/ide/setup-pci.c
include/linux/ide.h

index 1c52cb67a26777f2b4bde45ad6cf5d060d81d38a..4906f00cc0c460a5189b3e7d44b9a6bd4963dc15 100644 (file)
@@ -201,9 +201,6 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = hwif->cds->udma_mask;
-       hwif->mwdma_mask = 0x07;
-
        hwif->dma_lost_irq      = &aec62xx_dma_lost_irq;
 
        if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
@@ -247,7 +244,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x07, /* udma0-2 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA2,
        },{     /* 1 */
                .name           = "AEC6260",
                .init_setup     = init_setup_aec62xx,
@@ -256,7 +254,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
                                  IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x1f, /* udma0-4 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA4,
        },{     /* 2 */
                .name           = "AEC6260R",
                .init_setup     = init_setup_aec62xx,
@@ -265,7 +264,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x1f, /* udma0-4 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA4,
        },{     /* 3 */
                .name           = "AEC6280",
                .init_setup     = init_setup_aec6x80,
@@ -273,7 +273,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_aec62xx,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 4 */
                .name           = "AEC6280R",
                .init_setup     = init_setup_aec6x80,
@@ -282,7 +283,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        }
 };
 
index 79f572572ffbc7069d7bf1884b81337b1fd6eefa..9a295e214d5768d97ea33d8591d2febd958f83ea 100644 (file)
@@ -684,16 +684,13 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
        if (m5229_revision <= 0x20)
                hwif->ultra_mask = 0x00; /* no udma */
        else if (m5229_revision < 0xC2)
-               hwif->ultra_mask = 0x07; /* udma0-2 */
+               hwif->ultra_mask = ATA_UDMA2;
        else if (m5229_revision == 0xC2 || m5229_revision == 0xC3)
-               hwif->ultra_mask = 0x1f; /* udma0-4 */
+               hwif->ultra_mask = ATA_UDMA4;
        else if (m5229_revision == 0xC4)
-               hwif->ultra_mask = 0x3f; /* udma0-5 */
+               hwif->ultra_mask = ATA_UDMA5;
        else
-               hwif->ultra_mask = 0x7f; /* udma0-6 */
-
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
+               hwif->ultra_mask = ATA_UDMA6;
 
        hwif->dma_setup = &ali15x3_dma_setup;
 
@@ -779,6 +776,8 @@ static ide_pci_device_t ali15x3_chipset __devinitdata = {
        .init_dma       = init_dma_ali15x3,
        .host_flags     = IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO5,
+       .swdma_mask     = ATA_SWDMA2,
+       .mwdma_mask     = ATA_MWDMA2,
 };
 
 /**
index 26263a1894489beabe5f16bc4458a95f73e3b1cf..6f6fadf5a9d8517f31d72f069ee107f42a377f6c 100644 (file)
@@ -261,9 +261,8 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                return;
 
        hwif->ultra_mask = amd_config->udma_mask;
-       hwif->mwdma_mask = 0x07;
-       if ((amd_config->flags & AMD_BAD_SWDMA) == 0)
-               hwif->swdma_mask = 0x07;
+       if (amd_config->flags & AMD_BAD_SWDMA)
+               hwif->swdma_mask = 0x00;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
                if ((amd_80w >> hwif->channel) & 1)
@@ -284,6 +283,8 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                                  IDE_HFLAG_POST_SET_MODE |             \
                                  IDE_HFLAG_BOOTABLE,                   \
                .pio_mask       = ATA_PIO5,                             \
+               .swdma_mask     = ATA_SWDMA2,                           \
+               .mwdma_mask     = ATA_MWDMA2,                           \
        }
 
 #define DECLARE_NV_DEV(name_str)                                       \
@@ -297,6 +298,8 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                                  IDE_HFLAG_POST_SET_MODE |             \
                                  IDE_HFLAG_BOOTABLE,                   \
                .pio_mask       = ATA_PIO5,                             \
+               .swdma_mask     = ATA_SWDMA2,                           \
+               .mwdma_mask     = ATA_MWDMA2,                           \
        }
 
 static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
index 65de9363fc0d0ab8c6810e95fd5beb0122c8577f..18c181bc841b91aa9aff3dce0fe6bf036eed2276 100644 (file)
@@ -183,9 +183,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->ultra_mask = 0x3f;
-       hwif->mwdma_mask = 0x07;
-
        pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode);
 
        if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
@@ -205,12 +202,16 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
                .enablebits     = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
                .host_flags     = IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 1 */
                .name           = "SB600_PATA",
                .init_hwif      = init_hwif_atiixp,
                .enablebits     = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
                .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },
 };
 
index 360ca32a0f7eb55cdde2a91c6e95a2a09fd6db85..0ad57c497b0d1d88e38893adfb19e731cab8a88e 100644 (file)
@@ -517,9 +517,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->mwdma_mask = 0x07;
-       hwif->ultra_mask = hwif->cds->udma_mask;
-
        /*
         * UltraDMA only supported on PCI646U and PCI646U2, which
         * correspond to revisions 0x03, 0x05 and 0x07 respectively.
@@ -586,6 +583,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .enablebits     = {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
                .host_flags     = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO5,
+               .mwdma_mask     = ATA_MWDMA2,
                .udma_mask      = 0x00, /* no udma */
        },{     /* 1 */
                .name           = "CMD646",
@@ -595,7 +593,8 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .enablebits     = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
                .host_flags     = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO5,
-               .udma_mask      = 0x07, /* udma0-2 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA2,
        },{     /* 2 */
                .name           = "CMD648",
                .init_setup     = init_setup_cmd64x,
@@ -604,7 +603,8 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .enablebits     = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
                .host_flags     = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO5,
-               .udma_mask      = 0x1f, /* udma0-4 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA4,
        },{     /* 3 */
                .name           = "CMD649",
                .init_setup     = init_setup_cmd64x,
@@ -613,7 +613,8 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .enablebits     = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
                .host_flags     = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO5,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        }
 };
 
index 4fb43206621a26ddcedd39d7b89310fe49c36b00..6254d7a659aae23ee254eec2e6fc20dadac90475 100644 (file)
@@ -129,10 +129,6 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
        }
 
        hwif->ide_dma_on = &cs5520_dma_on;
-
-       hwif->ultra_mask = 0;
-       hwif->swdma_mask = 0;
-       hwif->mwdma_mask = 0;
 }
 
 #define DECLARE_CS_DEV(name_str)                               \
index 9dfd35f433378434cebd8ccbc977dadc24b0e44e..5e77a3d8e6d0051d815f80c6bce98fbec1869ca2 100644 (file)
@@ -264,9 +264,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = 0x07;
-       hwif->mwdma_mask = 0x07;
-
        hwif->udma_filter = cs5530_udma_filter;
 }
 
@@ -276,6 +273,8 @@ static ide_pci_device_t cs5530_chipset __devinitdata = {
        .init_hwif      = init_hwif_cs5530,
        .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .mwdma_mask     = ATA_MWDMA2,
+       .udma_mask      = ATA_UDMA2,
 };
 
 static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 8d8a9f81d934d14634648e98ca76e2b499ee762b..4360ba30155160e5c5b3f1b9d475033a5dc2ff83 100644 (file)
@@ -185,9 +185,6 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = 0x1F;
-       hwif->mwdma_mask = 0x07;
-
        hwif->cbl = cs5535_cable_detect(hwif->pci_dev);
 }
 
@@ -197,6 +194,8 @@ static ide_pci_device_t cs5535_chipset __devinitdata = {
        .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE |
                          IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .mwdma_mask     = ATA_MWDMA2,
+       .udma_mask      = ATA_UDMA4,
 };
 
 static int __devinit cs5535_init_one(struct pci_dev *dev,
index f841819bc898ef6318163016466dab9fa03c2127..2790206336d3486ffedaa393207a1c16c241ccb6 100644 (file)
@@ -437,9 +437,6 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
                return;
        }
 
-       hwif->mwdma_mask = 0x04;
-       hwif->swdma_mask = 0x04;
-
        hwif->ide_dma_on = &cy82c693_ide_dma_on;
 }
 
@@ -463,6 +460,8 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = {
        .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA |
                          IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .swdma_mask     = ATA_SWDMA2_ONLY,
+       .mwdma_mask     = ATA_MWDMA2_ONLY,
 };
 
 static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 88fa2963d1e3a629c317459d8ab5709a345021aa..51165832e7f2bd11f3f2601a2b7121d37b931b9a 100644 (file)
@@ -65,13 +65,6 @@ static void __devinit init_hwif_generic (ide_hwif_t *hwif)
                default:
                        break;
        }
-
-       if (!(hwif->dma_base))
-               return;
-
-       hwif->ultra_mask = 0x7f;
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
 }
 
 #define DECLARE_GENERIC_PCI_DEV(name_str, dma_setting) \
@@ -81,6 +74,9 @@ static void __devinit init_hwif_generic (ide_hwif_t *hwif)
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
                                  dma_setting | \
                                  IDE_HFLAG_BOOTABLE, \
+               .swdma_mask     = ATA_SWDMA2, \
+               .mwdma_mask     = ATA_MWDMA2, \
+               .udma_mask      = ATA_UDMA6, \
        }
 
 static ide_pci_device_t generic_chipsets[] __devinitdata = {
@@ -92,6 +88,9 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
                .enablebits     = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
                                  IDE_HFLAG_BOOTABLE,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        },
 
        /*  2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI",     0),
@@ -108,6 +107,9 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_generic,
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
                                  IDE_HFLAG_OFF_BOARD,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        },
 
        /* 11 */ DECLARE_GENERIC_PCI_DEV("Piccolo0102", IDE_HFLAG_NO_AUTODMA),
@@ -119,6 +121,9 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_generic,
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
                                  IDE_HFLAG_OFF_BOARD,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        }
 };
 
index 470e06bd3f2d166ce5b3070ab0c364369e1a1b1c..0b0c08298348c2f147ede0d3bc9932b146e77d73 100644 (file)
@@ -125,51 +125,48 @@ static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const cha
 
 static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
 {
-       u16 pcicmd = 0;
-
        hwif->set_pio_mode = &hpt34x_set_pio_mode;
        hwif->set_dma_mode = &hpt34x_set_mode;
 
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
+}
 
-       pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd);
-
-       if (!hwif->dma_base)
-               return;
-
+static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
+       { /* 0 */
+               .name           = "HPT343",
+               .init_chipset   = init_chipset_hpt34x,
+               .init_hwif      = init_hwif_hpt34x,
+               .extra          = 16,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA |
+                                 IDE_HFLAG_NO_AUTODMA,
+               .pio_mask       = ATA_PIO5,
+       },
+       { /* 1 */
+               .name           = "HPT345",
+               .init_chipset   = init_chipset_hpt34x,
+               .init_hwif      = init_hwif_hpt34x,
+               .extra          = 16,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA |
+                                 IDE_HFLAG_NO_AUTODMA |
+                                 IDE_HFLAG_OFF_BOARD,
+               .pio_mask       = ATA_PIO5,
 #ifdef CONFIG_HPT34X_AUTODMA
-       if ((pcicmd & PCI_COMMAND_MEMORY) == 0)
-               return;
-
-       hwif->ultra_mask = 0x07;
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA2,
 #endif
-}
-
-static ide_pci_device_t hpt34x_chipset __devinitdata = {
-       .name           = "HPT34X",
-       .init_chipset   = init_chipset_hpt34x,
-       .init_hwif      = init_hwif_hpt34x,
-       .extra          = 16,
-       .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA,
-       .pio_mask       = ATA_PIO5,
+       }
 };
 
 static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       ide_pci_device_t *d = &hpt34x_chipset;
-       static char *chipset_names[] = {"HPT343", "HPT345"};
+       ide_pci_device_t *d;
        u16 pcicmd = 0;
 
        pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
 
-       d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
-       if (pcicmd & PCI_COMMAND_MEMORY)
-               d->host_flags |= IDE_HFLAG_OFF_BOARD;
-       else
-               d->host_flags &= ~IDE_HFLAG_OFF_BOARD;
+       d = &hpt34x_chipsets[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
 
        return ide_setup_pci_device(dev, d);
 }
index a805236bbae6c9854eea2680576d84b7d9c724e9..e643b9654c75655156b7e6cb4659ba53c9ea54ab 100644 (file)
@@ -1296,9 +1296,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = hwif->cds->udma_mask;
-       hwif->mwdma_mask = 0x07;
-
        /*
         * The HPT37x uses the CBLID pins as outputs for MA15/MA16
         * address lines to access an external EEPROM.  To read valid
@@ -1555,6 +1552,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .extra          = 240,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 1 */
                .name           = "HPT372A",
                .init_setup     = init_setup_hpt372a,
@@ -1566,6 +1564,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .extra          = 240,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 2 */
                .name           = "HPT302",
                .init_setup     = init_setup_hpt302,
@@ -1577,6 +1576,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .extra          = 240,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 3 */
                .name           = "HPT371",
                .init_setup     = init_setup_hpt371,
@@ -1588,6 +1588,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .extra          = 240,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 4 */
                .name           = "HPT374",
                .init_setup     = init_setup_hpt374,
@@ -1599,6 +1600,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .extra          = 240,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 5 */
                .name           = "HPT372N",
                .init_setup     = init_setup_hpt372n,
@@ -1610,6 +1612,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .extra          = 240,
                .host_flags     = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
        }
 };
 
index f161836709ff6c61d3e128d8196d8a1209ef6bd2..e0c1d50e50d47cc48151bb91e0c8fe31cbd59c96 100644 (file)
@@ -176,10 +176,6 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->ultra_mask = 0x7f;
-       hwif->mwdma_mask = 0x06;
-       hwif->swdma_mask = 0x04;
-
        pci_read_config_byte(hwif->pci_dev, 0x42, &reg42h);
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
@@ -195,6 +191,9 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
                .host_flags     = IDE_HFLAG_SINGLE |    \
                                  IDE_HFLAG_BOOTABLE,   \
                .pio_mask       = ATA_PIO4,             \
+               .swdma_mask     = ATA_SWDMA2_ONLY,      \
+               .mwdma_mask     = ATA_MWDMA12_ONLY,     \
+               .udma_mask      = ATA_UDMA6,            \
        }
 
 static ide_pci_device_t it8213_chipsets[] __devinitdata = {
index 3596ec3501af93e67bca48a9fcfb4aa7467962db..611d0f272fbe6e991ee040da87d7222f0986ceb6 100644 (file)
@@ -591,8 +591,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = 0x7f;
-       hwif->mwdma_mask = 0x07;
+       hwif->ultra_mask = ATA_UDMA6;
+       hwif->mwdma_mask = ATA_MWDMA2;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_it821x(hwif);
index 5b0a136c879e786454185d3145f471dc49ac08c9..b058b3a01b30463396970de5302e12997d6f4787 100644 (file)
@@ -117,9 +117,6 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = 0x7f;
-       hwif->mwdma_mask = 0x07;
-
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_jmicron(hwif);
 }
@@ -130,6 +127,8 @@ static ide_pci_device_t jmicron_chipset __devinitdata = {
        .host_flags     = IDE_HFLAG_BOOTABLE,
        .enablebits     = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } },
        .pio_mask       = ATA_PIO5,
+       .mwdma_mask     = ATA_MWDMA2,
+       .udma_mask      = ATA_UDMA6,
 };
 
 /**
index 558cab537db8ba8688b059338f3793048864f37c..24059c1b21df1d38fed64cb9a252b1d03d6ddc20 100644 (file)
@@ -332,12 +332,6 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
        hwif->drives[1].drive_data = PIO_DONT_KNOW;
 
        hwif->set_pio_mode = &opti621_set_pio_mode;
-
-       if (!(hwif->dma_base))
-               return;
-
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
 }
 
 static ide_pci_device_t opti621_chipsets[] __devinitdata = {
@@ -348,6 +342,8 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
                                  IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO3,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 1 */
                .name           = "OPTI621X",
                .init_hwif      = init_hwif_opti621,
@@ -355,6 +351,8 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
                .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
                                  IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO3,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
        }
 };
 
index 24efda25c03469da23a8e7b44049d80ada5e5d98..a3443fce40f10bd75c5fe6c47e27962c2805123d 100644 (file)
@@ -482,9 +482,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = hwif->cds->udma_mask;
-       hwif->mwdma_mask = 0x07;
-
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = pdcnew_cable_detect(hwif);
 }
@@ -553,7 +550,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 1 */
                .name           = "PDC20269",
                .init_setup     = init_setup_pdcnew,
@@ -561,7 +559,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x7f, /* udma0-6*/
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        },{     /* 2 */
                .name           = "PDC20270",
                .init_setup     = init_setup_pdc20270,
@@ -569,7 +568,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 3 */
                .name           = "PDC20271",
                .init_setup     = init_setup_pdcnew,
@@ -577,7 +577,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x7f, /* udma0-6*/
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        },{     /* 4 */
                .name           = "PDC20275",
                .init_setup     = init_setup_pdcnew,
@@ -585,7 +586,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x7f, /* udma0-6*/
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        },{     /* 5 */
                .name           = "PDC20276",
                .init_setup     = init_setup_pdc20276,
@@ -593,7 +595,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x7f, /* udma0-6*/
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        },{     /* 6 */
                .name           = "PDC20277",
                .init_setup     = init_setup_pdcnew,
@@ -601,7 +604,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_pdc202new,
                .host_flags     = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x7f, /* udma0-6*/
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA6,
        }
 };
 
index d8622be22875858a57be331f04a458e2c2e2d946..570259093ce41d7937c3e90727eb5b427a8d390c 100644 (file)
@@ -324,9 +324,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = hwif->cds->udma_mask;
-       hwif->mwdma_mask = 0x07;
-
        hwif->dma_lost_irq = &pdc202xx_dma_lost_irq;
        hwif->dma_timeout = &pdc202xx_dma_timeout;
 
@@ -420,7 +417,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .extra          = 16,
                .host_flags     = IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x07, /* udma0-2 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA2,
        },{     /* 1 */
                .name           = "PDC20262",
                .init_setup     = init_setup_pdc202ata4,
@@ -430,7 +428,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .extra          = 48,
                .host_flags     = IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x1f, /* udma0-4 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA4,
        },{     /* 2 */
                .name           = "PDC20263",
                .init_setup     = init_setup_pdc202ata4,
@@ -440,7 +439,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .extra          = 48,
                .host_flags     = IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x1f, /* udma0-4 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA4,
        },{     /* 3 */
                .name           = "PDC20265",
                .init_setup     = init_setup_pdc20265,
@@ -450,7 +450,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .extra          = 48,
                .host_flags     = IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 4 */
                .name           = "PDC20267",
                .init_setup     = init_setup_pdc202xx,
@@ -460,7 +461,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .extra          = 48,
                .host_flags     = IDE_HFLAG_OFF_BOARD,
                .pio_mask       = ATA_PIO4,
-               .udma_mask      = 0x3f, /* udma0-5 */
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        }
 };
 
index 692623892cbc0dc615e9d88d8d7eb9b057b69828..cbfc27b92ede03a3c49e35f7b1f23ef7761cd79e 100644 (file)
@@ -397,10 +397,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
        if (piix_is_ichx(hwif->pci_dev))
                hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
 
-       hwif->ultra_mask = hwif->cds->udma_mask;
-       hwif->mwdma_mask = 0x06;
-       hwif->swdma_mask = 0x04;
-
        if (hwif->ultra_mask & 0x78) {
                if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                        hwif->cbl = piix_cable_detect(hwif);
@@ -418,12 +414,14 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
                .enablebits     = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
                .host_flags     = IDE_HFLAG_BOOTABLE,   \
                .pio_mask       = ATA_PIO4,             \
+               .swdma_mask     = ATA_SWDMA2_ONLY,      \
+               .mwdma_mask     = ATA_MWDMA12_ONLY,     \
                .udma_mask      = udma,                 \
        }
 
 static ide_pci_device_t piix_pci_info[] __devinitdata = {
-       /*  0 */ DECLARE_PIIX_DEV("PIIXa", 0x00),       /* no udma */
-       /*  1 */ DECLARE_PIIX_DEV("PIIXb", 0x00),       /* no udma */
+       /*  0 */ DECLARE_PIIX_DEV("PIIXa",      0x00),  /* no udma */
+       /*  1 */ DECLARE_PIIX_DEV("PIIXb",      0x00),  /* no udma */
 
        /*  2 */
        {       /*
@@ -439,28 +437,28 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
                .pio_mask       = ATA_PIO4,
        },
 
-       /*  3 */ DECLARE_PIIX_DEV("PIIX3", 0x00),       /* no udma */
-       /*  4 */ DECLARE_PIIX_DEV("PIIX4", 0x07),       /* udma0-2 */
-       /*  5 */ DECLARE_PIIX_DEV("ICH0",  0x07),       /* udma0-2 */
-       /*  6 */ DECLARE_PIIX_DEV("PIIX4", 0x07),       /* udma0-2 */
-       /*  7 */ DECLARE_PIIX_DEV("ICH",   0x1f),       /* udma0-4 */
-       /*  8 */ DECLARE_PIIX_DEV("PIIX4", 0x1f),       /* udma0-4 */
-       /*  9 */ DECLARE_PIIX_DEV("PIIX4", 0x07),       /* udma0-2 */
-       /* 10 */ DECLARE_PIIX_DEV("ICH2",  0x3f),       /* udma0-5 */
-       /* 11 */ DECLARE_PIIX_DEV("ICH2M", 0x3f),       /* udma0-5 */
-       /* 12 */ DECLARE_PIIX_DEV("ICH3M", 0x3f),       /* udma0-5 */
-       /* 13 */ DECLARE_PIIX_DEV("ICH3",  0x3f),       /* udma0-5 */
-       /* 14 */ DECLARE_PIIX_DEV("ICH4",  0x3f),       /* udma0-5 */
-       /* 15 */ DECLARE_PIIX_DEV("ICH5",  0x3f),       /* udma0-5 */
-       /* 16 */ DECLARE_PIIX_DEV("C-ICH", 0x3f),       /* udma0-5 */
-       /* 17 */ DECLARE_PIIX_DEV("ICH4",  0x3f),       /* udma0-5 */
-       /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA", 0x3f),   /* udma0-5 */
-       /* 19 */ DECLARE_PIIX_DEV("ICH5",  0x3f),       /* udma0-5 */
-       /* 20 */ DECLARE_PIIX_DEV("ICH6",  0x3f),       /* udma0-5 */
-       /* 21 */ DECLARE_PIIX_DEV("ICH7",  0x3f),       /* udma0-5 */
-       /* 22 */ DECLARE_PIIX_DEV("ICH4",  0x3f),       /* udma0-5 */
-       /* 23 */ DECLARE_PIIX_DEV("ESB2",  0x3f),       /* udma0-5 */
-       /* 24 */ DECLARE_PIIX_DEV("ICH8M", 0x3f),       /* udma0-5 */
+       /*  3 */ DECLARE_PIIX_DEV("PIIX3",      0x00),  /* no udma */
+       /*  4 */ DECLARE_PIIX_DEV("PIIX4",      ATA_UDMA2),
+       /*  5 */ DECLARE_PIIX_DEV("ICH0",       ATA_UDMA2),
+       /*  6 */ DECLARE_PIIX_DEV("PIIX4",      ATA_UDMA2),
+       /*  7 */ DECLARE_PIIX_DEV("ICH",        ATA_UDMA4),
+       /*  8 */ DECLARE_PIIX_DEV("PIIX4",      ATA_UDMA4),
+       /*  9 */ DECLARE_PIIX_DEV("PIIX4",      ATA_UDMA2),
+       /* 10 */ DECLARE_PIIX_DEV("ICH2",       ATA_UDMA5),
+       /* 11 */ DECLARE_PIIX_DEV("ICH2M",      ATA_UDMA5),
+       /* 12 */ DECLARE_PIIX_DEV("ICH3M",      ATA_UDMA5),
+       /* 13 */ DECLARE_PIIX_DEV("ICH3",       ATA_UDMA5),
+       /* 14 */ DECLARE_PIIX_DEV("ICH4",       ATA_UDMA5),
+       /* 15 */ DECLARE_PIIX_DEV("ICH5",       ATA_UDMA5),
+       /* 16 */ DECLARE_PIIX_DEV("C-ICH",      ATA_UDMA5),
+       /* 17 */ DECLARE_PIIX_DEV("ICH4",       ATA_UDMA5),
+       /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA",  ATA_UDMA5),
+       /* 19 */ DECLARE_PIIX_DEV("ICH5",       ATA_UDMA5),
+       /* 20 */ DECLARE_PIIX_DEV("ICH6",       ATA_UDMA5),
+       /* 21 */ DECLARE_PIIX_DEV("ICH7",       ATA_UDMA5),
+       /* 22 */ DECLARE_PIIX_DEV("ICH4",       ATA_UDMA5),
+       /* 23 */ DECLARE_PIIX_DEV("ESB2",       ATA_UDMA5),
+       /* 24 */ DECLARE_PIIX_DEV("ICH8M",      ATA_UDMA5),
 };
 
 /**
index 1a1c0ef0ed5bd00d372b5c7f83ac285fcf03c1f3..252b12f9c9541dde05c91dcfdf68b1cf8f3c4e11 100644 (file)
@@ -376,9 +376,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
 
        hwif->udma_filter = sc1200_udma_filter;
        hwif->ide_dma_end   = &sc1200_ide_dma_end;
-
-        hwif->ultra_mask = 0x07;
-        hwif->mwdma_mask = 0x07;
 }
 
 static ide_pci_device_t sc1200_chipset __devinitdata = {
@@ -387,6 +384,8 @@ static ide_pci_device_t sc1200_chipset __devinitdata = {
        .host_flags     = IDE_HFLAG_ABUSE_DMA_MODES | IDE_HFLAG_POST_SET_MODE |
                          IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .mwdma_mask     = ATA_MWDMA2,
+       .udma_mask      = ATA_UDMA2,
 };
 
 static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index bfddc42708270ab621fd48944fa2a208dbd2c401..2b1d5bd0009f30abc4f788154705e7445536aba3 100644 (file)
@@ -472,7 +472,7 @@ static u8 scc_udma_filter(ide_drive_t *drive)
        if ((drive->media != ide_disk) && (mask & 0xE0)) {
                printk(KERN_INFO "%s: limit %s to UDMA4\n",
                       SCC_PATA_NAME, drive->name);
-               mask = 0x1F;
+               mask = ATA_UDMA4;
        }
 
        return mask;
@@ -686,13 +686,10 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
        hwif->drives[0].autotune = IDE_TUNE_AUTO;
        hwif->drives[1].autotune = IDE_TUNE_AUTO;
 
-       if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN) {
-               hwif->ultra_mask = 0x7f; /* 133MHz */
-       } else {
-               hwif->ultra_mask = 0x3f; /* 100MHz */
-       }
-       hwif->mwdma_mask = 0x00;
-       hwif->swdma_mask = 0x00;
+       if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN)
+               hwif->ultra_mask = ATA_UDMA6; /* 133MHz */
+       else
+               hwif->ultra_mask = ATA_UDMA5; /* 100MHz */
 
        /* we support 80c cable only. */
        hwif->cbl = ATA_CBL_PATA80;
index 338eee81f021c58ba0ec2a2fa1cf5bbd39cabffb..760e0e3e118ef0bdec44d521460680dbb0b5ecbd 100644 (file)
@@ -367,11 +367,6 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
        hwif->set_dma_mode = &svwks_set_dma_mode;
        hwif->udma_filter = &svwks_udma_filter;
 
-       if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE)
-               hwif->ultra_mask = 0x3f;
-
-       hwif->mwdma_mask = 0x07;
-
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
@@ -416,6 +411,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_svwks,
                .host_flags     = IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = 0x00, /* UDMA is problematic on OSB4 */
        },{     /* 1 */
                .name           = "SvrWks CSB5",
                .init_setup     = init_setup_svwks,
@@ -423,6 +420,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_svwks,
                .host_flags     = IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 2 */
                .name           = "SvrWks CSB6",
                .init_setup     = init_setup_csb6,
@@ -430,6 +429,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_svwks,
                .host_flags     = IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 3 */
                .name           = "SvrWks CSB6",
                .init_setup     = init_setup_csb6,
@@ -437,6 +438,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_svwks,
                .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        },{     /* 4 */
                .name           = "SvrWks HT1000",
                .init_setup     = init_setup_svwks,
@@ -444,6 +447,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_svwks,
                .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO4,
+               .mwdma_mask     = ATA_MWDMA2,
+               .udma_mask      = ATA_UDMA5,
        }
 };
 
index 9122cb71bcc9b113b3536066ad3f5392e09372e0..b0cf6add691de3d2646bd4dda317999ea400a9c6 100644 (file)
@@ -592,7 +592,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->mwdma_mask = 0x04;
+       hwif->mwdma_mask = ATA_MWDMA2_ONLY;
 
        hwif->dma_setup = &sgiioc4_ide_dma_setup;
        hwif->dma_start = &sgiioc4_ide_dma_start;
index f3ed91006f3f629a1a21dd621e7f1929a6162e9d..eda11050a02dd15c88f0c6ed52037b0ffa814e3b 100644 (file)
@@ -896,9 +896,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = 0x7f;
-       hwif->mwdma_mask = 0x07;
-
        if (is_sata(hwif))
                hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
 
@@ -921,6 +918,8 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
                .fixup          = siimage_fixup,        \
                .host_flags     = IDE_HFLAG_BOOTABLE,   \
                .pio_mask       = ATA_PIO4,             \
+               .mwdma_mask     = ATA_MWDMA2,           \
+               .udma_mask      = ATA_UDMA6,            \
        }
 
 static ide_pci_device_t siimage_chipsets[] __devinitdata = {
index 5c30759ad008a478e0731b738d98347f4bbb268e..d38b2039e2aa498166b30e3c510aec4558aeb7e8 100644 (file)
@@ -580,7 +580,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
                return;
 
        hwif->ultra_mask = udma_rates[chipset_family];
-       hwif->mwdma_mask = 0x07;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_sis5513(hwif);
@@ -593,6 +592,7 @@ static ide_pci_device_t sis5513_chipset __devinitdata = {
        .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
        .host_flags     = IDE_HFLAG_NO_AUTODMA | IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .mwdma_mask     = ATA_MWDMA2,
 };
 
 static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index e6eb5c7de7aed0a3d9ecbab02bc73f9adbddb664..ea6d925ac573ff8d490a043ee6c606815b673f4e 100644 (file)
@@ -388,7 +388,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
                return;
        }
 
-       hwif->mwdma_mask = 0x07;
+       hwif->mwdma_mask = ATA_MWDMA2;
 
        hwif->ide_dma_on                = &sl82c105_ide_dma_on;
        hwif->dma_off_quietly           = &sl82c105_dma_off_quietly;
index 4f213e4c0c423cc5e77f495b2e3a0bbaa8e8493f..416fbab2ed36781f1b5d1f434b38ecd539af52e4 100644 (file)
@@ -147,10 +147,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->ultra_mask = 0x1f;
-       hwif->mwdma_mask = 0x06;
-       hwif->swdma_mask = 0x04;
-
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                /* bit[0(1)]: 0:80, 1:40 */
                hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
@@ -162,6 +158,9 @@ static ide_pci_device_t slc90e66_chipset __devinitdata = {
        .enablebits     = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
        .host_flags     = IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .swdma_mask     = ATA_SWDMA2_ONLY,
+       .mwdma_mask     = ATA_MWDMA12_ONLY,
+       .udma_mask      = ATA_UDMA4,
 };
 
 static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index fda8592bf858089b667f815eaaf39f1126da7ddc..9f50927e90982091be10bc4b4563fe13456130b4 100644 (file)
@@ -198,9 +198,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
        /* Sector Count Register limit */
        hwif->rqsize     = 0xffff;
 
-       hwif->ultra_mask = 0x1f;
-       hwif->mwdma_mask = 0x07;
-
        hwif->dma_start         = &tc86c001_dma_start;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
@@ -229,6 +226,8 @@ static ide_pci_device_t tc86c001_chipset __devinitdata = {
        .init_hwif      = init_hwif_tc86c001,
        .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_OFF_BOARD,
        .pio_mask       = ATA_PIO4,
+       .mwdma_mask     = ATA_MWDMA2,
+       .udma_mask      = ATA_UDMA4,
 };
 
 static int __devinit tc86c001_init_one(struct pci_dev *dev,
index c5edb1171c102257c82f306606a7ab3371e315a2..30b52f62699a9f1fc40121f33109635c06880b88 100644 (file)
@@ -100,12 +100,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
 {
        hwif->set_pio_mode = &triflex_set_pio_mode;
        hwif->set_dma_mode = &triflex_set_mode;
-
-       if (hwif->dma_base == 0)
-               return;
-
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
 }
 
 static ide_pci_device_t triflex_device __devinitdata = {
@@ -114,6 +108,8 @@ static ide_pci_device_t triflex_device __devinitdata = {
        .enablebits     = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
        .host_flags     = IDE_HFLAG_BOOTABLE,
        .pio_mask       = ATA_PIO4,
+       .swdma_mask     = ATA_SWDMA2,
+       .mwdma_mask     = ATA_MWDMA2,
 };
 
 static int __devinit triflex_init_one(struct pci_dev *dev, 
index 91bcb6be0d51c0299093bc736c413f7a9571b724..70e6c44ec69945558616af3fae1b7670075f38f6 100644 (file)
@@ -444,8 +444,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
                return;
 
        hwif->ultra_mask = vdev->via_config->udma_mask;
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = via82cxxx_cable_detect(hwif);
@@ -463,6 +461,8 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
                                  IDE_HFLAG_NO_AUTODMA |
                                  IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO5,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 1 */
                .name           = "VP_IDE",
                .init_chipset   = init_chipset_via82cxxx,
@@ -473,6 +473,8 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
                                  IDE_HFLAG_POST_SET_MODE |
                                  IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO5,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
        }
 };
 
index 479add4af4990bcdcac49076f926e1a1cc43b08a..51b1a9b23a22cb1897bbe65aa5eb75345d4b86bf 100644 (file)
@@ -567,6 +567,12 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
                hwif->host_flags = d->host_flags;
                hwif->pio_mask = d->pio_mask;
 
+               if (hwif->dma_base) {
+                       hwif->swdma_mask = d->swdma_mask;
+                       hwif->mwdma_mask = d->mwdma_mask;
+                       hwif->ultra_mask = d->udma_mask;
+               }
+
                if (d->init_hwif)
                        /* Call chipset-specific routine
                         * for each enabled hwif
index dced2e176d9f1f9f6ff30b7d8b5570e8c56a308f..87662659fb6f59ed06d88052783316a1242490c9 100644 (file)
@@ -1277,6 +1277,8 @@ typedef struct ide_pci_device_s {
        struct ide_pci_device_s *next;
        u32                     host_flags;
        u8                      pio_mask;
+       u8                      swdma_mask;
+       u8                      mwdma_mask;
        u8                      udma_mask;
 } ide_pci_device_t;