aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:07 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:07 -0400
commit5f8b6c34854a966fe5eb7241fde0419d47d5d408 (patch)
tree052afd508d9cd314f503d938182db55355f1b392
parent9adf768a398745c539623210502b521e671c59d7 (diff)
ide: add ->mwdma_mask and ->swdma_mask to ide_pci_device_t (take 2)
* 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>
-rw-r--r--drivers/ide/pci/aec62xx.c18
-rw-r--r--drivers/ide/pci/alim15x3.c13
-rw-r--r--drivers/ide/pci/amd74xx.c9
-rw-r--r--drivers/ide/pci/atiixp.c7
-rw-r--r--drivers/ide/pci/cmd64x.c13
-rw-r--r--drivers/ide/pci/cs5520.c4
-rw-r--r--drivers/ide/pci/cs5530.c5
-rw-r--r--drivers/ide/pci/cs5535.c5
-rw-r--r--drivers/ide/pci/cy82c693.c5
-rw-r--r--drivers/ide/pci/generic.c19
-rw-r--r--drivers/ide/pci/hpt34x.c55
-rw-r--r--drivers/ide/pci/hpt366.c9
-rw-r--r--drivers/ide/pci/it8213.c7
-rw-r--r--drivers/ide/pci/it821x.c4
-rw-r--r--drivers/ide/pci/jmicron.c5
-rw-r--r--drivers/ide/pci/opti621.c10
-rw-r--r--drivers/ide/pci/pdc202xx_new.c24
-rw-r--r--drivers/ide/pci/pdc202xx_old.c18
-rw-r--r--drivers/ide/pci/piix.c54
-rw-r--r--drivers/ide/pci/sc1200.c5
-rw-r--r--drivers/ide/pci/scc_pata.c13
-rw-r--r--drivers/ide/pci/serverworks.c15
-rw-r--r--drivers/ide/pci/sgiioc4.c2
-rw-r--r--drivers/ide/pci/siimage.c5
-rw-r--r--drivers/ide/pci/sis5513.c2
-rw-r--r--drivers/ide/pci/sl82c105.c2
-rw-r--r--drivers/ide/pci/slc90e66.c7
-rw-r--r--drivers/ide/pci/tc86c001.c5
-rw-r--r--drivers/ide/pci/triflex.c8
-rw-r--r--drivers/ide/pci/via82cxxx.c6
-rw-r--r--drivers/ide/setup-pci.c6
-rw-r--r--include/linux/ide.h2
32 files changed, 185 insertions, 177 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 1c52cb67a267..4906f00cc0c4 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -201,9 +201,6 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
201 if (hwif->dma_base == 0) 201 if (hwif->dma_base == 0)
202 return; 202 return;
203 203
204 hwif->ultra_mask = hwif->cds->udma_mask;
205 hwif->mwdma_mask = 0x07;
206
207 hwif->dma_lost_irq = &aec62xx_dma_lost_irq; 204 hwif->dma_lost_irq = &aec62xx_dma_lost_irq;
208 205
209 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { 206 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
@@ -247,7 +244,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
247 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 244 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
248 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 245 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
249 .pio_mask = ATA_PIO4, 246 .pio_mask = ATA_PIO4,
250 .udma_mask = 0x07, /* udma0-2 */ 247 .mwdma_mask = ATA_MWDMA2,
248 .udma_mask = ATA_UDMA2,
251 },{ /* 1 */ 249 },{ /* 1 */
252 .name = "AEC6260", 250 .name = "AEC6260",
253 .init_setup = init_setup_aec62xx, 251 .init_setup = init_setup_aec62xx,
@@ -256,7 +254,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
256 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA | 254 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
257 IDE_HFLAG_OFF_BOARD, 255 IDE_HFLAG_OFF_BOARD,
258 .pio_mask = ATA_PIO4, 256 .pio_mask = ATA_PIO4,
259 .udma_mask = 0x1f, /* udma0-4 */ 257 .mwdma_mask = ATA_MWDMA2,
258 .udma_mask = ATA_UDMA4,
260 },{ /* 2 */ 259 },{ /* 2 */
261 .name = "AEC6260R", 260 .name = "AEC6260R",
262 .init_setup = init_setup_aec62xx, 261 .init_setup = init_setup_aec62xx,
@@ -265,7 +264,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
265 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 264 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
266 .host_flags = IDE_HFLAG_NO_ATAPI_DMA, 265 .host_flags = IDE_HFLAG_NO_ATAPI_DMA,
267 .pio_mask = ATA_PIO4, 266 .pio_mask = ATA_PIO4,
268 .udma_mask = 0x1f, /* udma0-4 */ 267 .mwdma_mask = ATA_MWDMA2,
268 .udma_mask = ATA_UDMA4,
269 },{ /* 3 */ 269 },{ /* 3 */
270 .name = "AEC6280", 270 .name = "AEC6280",
271 .init_setup = init_setup_aec6x80, 271 .init_setup = init_setup_aec6x80,
@@ -273,7 +273,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
273 .init_hwif = init_hwif_aec62xx, 273 .init_hwif = init_hwif_aec62xx,
274 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 274 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
275 .pio_mask = ATA_PIO4, 275 .pio_mask = ATA_PIO4,
276 .udma_mask = 0x3f, /* udma0-5 */ 276 .mwdma_mask = ATA_MWDMA2,
277 .udma_mask = ATA_UDMA5,
277 },{ /* 4 */ 278 },{ /* 4 */
278 .name = "AEC6280R", 279 .name = "AEC6280R",
279 .init_setup = init_setup_aec6x80, 280 .init_setup = init_setup_aec6x80,
@@ -282,7 +283,8 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
282 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 283 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
283 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 284 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
284 .pio_mask = ATA_PIO4, 285 .pio_mask = ATA_PIO4,
285 .udma_mask = 0x3f, /* udma0-5 */ 286 .mwdma_mask = ATA_MWDMA2,
287 .udma_mask = ATA_UDMA5,
286 } 288 }
287}; 289};
288 290
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 79f572572ffb..9a295e214d57 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -684,16 +684,13 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
684 if (m5229_revision <= 0x20) 684 if (m5229_revision <= 0x20)
685 hwif->ultra_mask = 0x00; /* no udma */ 685 hwif->ultra_mask = 0x00; /* no udma */
686 else if (m5229_revision < 0xC2) 686 else if (m5229_revision < 0xC2)
687 hwif->ultra_mask = 0x07; /* udma0-2 */ 687 hwif->ultra_mask = ATA_UDMA2;
688 else if (m5229_revision == 0xC2 || m5229_revision == 0xC3) 688 else if (m5229_revision == 0xC2 || m5229_revision == 0xC3)
689 hwif->ultra_mask = 0x1f; /* udma0-4 */ 689 hwif->ultra_mask = ATA_UDMA4;
690 else if (m5229_revision == 0xC4) 690 else if (m5229_revision == 0xC4)
691 hwif->ultra_mask = 0x3f; /* udma0-5 */ 691 hwif->ultra_mask = ATA_UDMA5;
692 else 692 else
693 hwif->ultra_mask = 0x7f; /* udma0-6 */ 693 hwif->ultra_mask = ATA_UDMA6;
694
695 hwif->mwdma_mask = 0x07;
696 hwif->swdma_mask = 0x07;
697 694
698 hwif->dma_setup = &ali15x3_dma_setup; 695 hwif->dma_setup = &ali15x3_dma_setup;
699 696
@@ -779,6 +776,8 @@ static ide_pci_device_t ali15x3_chipset __devinitdata = {
779 .init_dma = init_dma_ali15x3, 776 .init_dma = init_dma_ali15x3,
780 .host_flags = IDE_HFLAG_BOOTABLE, 777 .host_flags = IDE_HFLAG_BOOTABLE,
781 .pio_mask = ATA_PIO5, 778 .pio_mask = ATA_PIO5,
779 .swdma_mask = ATA_SWDMA2,
780 .mwdma_mask = ATA_MWDMA2,
782}; 781};
783 782
784/** 783/**
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 26263a189448..6f6fadf5a9d8 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -261,9 +261,8 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
261 return; 261 return;
262 262
263 hwif->ultra_mask = amd_config->udma_mask; 263 hwif->ultra_mask = amd_config->udma_mask;
264 hwif->mwdma_mask = 0x07; 264 if (amd_config->flags & AMD_BAD_SWDMA)
265 if ((amd_config->flags & AMD_BAD_SWDMA) == 0) 265 hwif->swdma_mask = 0x00;
266 hwif->swdma_mask = 0x07;
267 266
268 if (hwif->cbl != ATA_CBL_PATA40_SHORT) { 267 if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
269 if ((amd_80w >> hwif->channel) & 1) 268 if ((amd_80w >> hwif->channel) & 1)
@@ -284,6 +283,8 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
284 IDE_HFLAG_POST_SET_MODE | \ 283 IDE_HFLAG_POST_SET_MODE | \
285 IDE_HFLAG_BOOTABLE, \ 284 IDE_HFLAG_BOOTABLE, \
286 .pio_mask = ATA_PIO5, \ 285 .pio_mask = ATA_PIO5, \
286 .swdma_mask = ATA_SWDMA2, \
287 .mwdma_mask = ATA_MWDMA2, \
287 } 288 }
288 289
289#define DECLARE_NV_DEV(name_str) \ 290#define DECLARE_NV_DEV(name_str) \
@@ -297,6 +298,8 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
297 IDE_HFLAG_POST_SET_MODE | \ 298 IDE_HFLAG_POST_SET_MODE | \
298 IDE_HFLAG_BOOTABLE, \ 299 IDE_HFLAG_BOOTABLE, \
299 .pio_mask = ATA_PIO5, \ 300 .pio_mask = ATA_PIO5, \
301 .swdma_mask = ATA_SWDMA2, \
302 .mwdma_mask = ATA_MWDMA2, \
300 } 303 }
301 304
302static ide_pci_device_t amd74xx_chipsets[] __devinitdata = { 305static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 65de9363fc0d..18c181bc841b 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -183,9 +183,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
183 if (!hwif->dma_base) 183 if (!hwif->dma_base)
184 return; 184 return;
185 185
186 hwif->ultra_mask = 0x3f;
187 hwif->mwdma_mask = 0x07;
188
189 pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode); 186 pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode);
190 187
191 if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40) 188 if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
@@ -205,12 +202,16 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
205 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, 202 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
206 .host_flags = IDE_HFLAG_BOOTABLE, 203 .host_flags = IDE_HFLAG_BOOTABLE,
207 .pio_mask = ATA_PIO4, 204 .pio_mask = ATA_PIO4,
205 .mwdma_mask = ATA_MWDMA2,
206 .udma_mask = ATA_UDMA5,
208 },{ /* 1 */ 207 },{ /* 1 */
209 .name = "SB600_PATA", 208 .name = "SB600_PATA",
210 .init_hwif = init_hwif_atiixp, 209 .init_hwif = init_hwif_atiixp,
211 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, 210 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
212 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE, 211 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE,
213 .pio_mask = ATA_PIO4, 212 .pio_mask = ATA_PIO4,
213 .mwdma_mask = ATA_MWDMA2,
214 .udma_mask = ATA_UDMA5,
214 }, 215 },
215}; 216};
216 217
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 360ca32a0f7e..0ad57c497b0d 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -517,9 +517,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
517 if (!hwif->dma_base) 517 if (!hwif->dma_base)
518 return; 518 return;
519 519
520 hwif->mwdma_mask = 0x07;
521 hwif->ultra_mask = hwif->cds->udma_mask;
522
523 /* 520 /*
524 * UltraDMA only supported on PCI646U and PCI646U2, which 521 * UltraDMA only supported on PCI646U and PCI646U2, which
525 * correspond to revisions 0x03, 0x05 and 0x07 respectively. 522 * correspond to revisions 0x03, 0x05 and 0x07 respectively.
@@ -586,6 +583,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
586 .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}}, 583 .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
587 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 584 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
588 .pio_mask = ATA_PIO5, 585 .pio_mask = ATA_PIO5,
586 .mwdma_mask = ATA_MWDMA2,
589 .udma_mask = 0x00, /* no udma */ 587 .udma_mask = 0x00, /* no udma */
590 },{ /* 1 */ 588 },{ /* 1 */
591 .name = "CMD646", 589 .name = "CMD646",
@@ -595,7 +593,8 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
595 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 593 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
596 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 594 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
597 .pio_mask = ATA_PIO5, 595 .pio_mask = ATA_PIO5,
598 .udma_mask = 0x07, /* udma0-2 */ 596 .mwdma_mask = ATA_MWDMA2,
597 .udma_mask = ATA_UDMA2,
599 },{ /* 2 */ 598 },{ /* 2 */
600 .name = "CMD648", 599 .name = "CMD648",
601 .init_setup = init_setup_cmd64x, 600 .init_setup = init_setup_cmd64x,
@@ -604,7 +603,8 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
604 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 603 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
605 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 604 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
606 .pio_mask = ATA_PIO5, 605 .pio_mask = ATA_PIO5,
607 .udma_mask = 0x1f, /* udma0-4 */ 606 .mwdma_mask = ATA_MWDMA2,
607 .udma_mask = ATA_UDMA4,
608 },{ /* 3 */ 608 },{ /* 3 */
609 .name = "CMD649", 609 .name = "CMD649",
610 .init_setup = init_setup_cmd64x, 610 .init_setup = init_setup_cmd64x,
@@ -613,7 +613,8 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
613 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 613 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
614 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 614 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
615 .pio_mask = ATA_PIO5, 615 .pio_mask = ATA_PIO5,
616 .udma_mask = 0x3f, /* udma0-5 */ 616 .mwdma_mask = ATA_MWDMA2,
617 .udma_mask = ATA_UDMA5,
617 } 618 }
618}; 619};
619 620
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index 4fb43206621a..6254d7a659aa 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -129,10 +129,6 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
129 } 129 }
130 130
131 hwif->ide_dma_on = &cs5520_dma_on; 131 hwif->ide_dma_on = &cs5520_dma_on;
132
133 hwif->ultra_mask = 0;
134 hwif->swdma_mask = 0;
135 hwif->mwdma_mask = 0;
136} 132}
137 133
138#define DECLARE_CS_DEV(name_str) \ 134#define DECLARE_CS_DEV(name_str) \
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 9dfd35f43337..5e77a3d8e6d0 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -264,9 +264,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
264 if (hwif->dma_base == 0) 264 if (hwif->dma_base == 0)
265 return; 265 return;
266 266
267 hwif->ultra_mask = 0x07;
268 hwif->mwdma_mask = 0x07;
269
270 hwif->udma_filter = cs5530_udma_filter; 267 hwif->udma_filter = cs5530_udma_filter;
271} 268}
272 269
@@ -276,6 +273,8 @@ static ide_pci_device_t cs5530_chipset __devinitdata = {
276 .init_hwif = init_hwif_cs5530, 273 .init_hwif = init_hwif_cs5530,
277 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_BOOTABLE, 274 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_BOOTABLE,
278 .pio_mask = ATA_PIO4, 275 .pio_mask = ATA_PIO4,
276 .mwdma_mask = ATA_MWDMA2,
277 .udma_mask = ATA_UDMA2,
279}; 278};
280 279
281static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id) 280static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index 8d8a9f81d934..4360ba301551 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -185,9 +185,6 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
185 if (hwif->dma_base == 0) 185 if (hwif->dma_base == 0)
186 return; 186 return;
187 187
188 hwif->ultra_mask = 0x1F;
189 hwif->mwdma_mask = 0x07;
190
191 hwif->cbl = cs5535_cable_detect(hwif->pci_dev); 188 hwif->cbl = cs5535_cable_detect(hwif->pci_dev);
192} 189}
193 190
@@ -197,6 +194,8 @@ static ide_pci_device_t cs5535_chipset __devinitdata = {
197 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE | 194 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE |
198 IDE_HFLAG_BOOTABLE, 195 IDE_HFLAG_BOOTABLE,
199 .pio_mask = ATA_PIO4, 196 .pio_mask = ATA_PIO4,
197 .mwdma_mask = ATA_MWDMA2,
198 .udma_mask = ATA_UDMA4,
200}; 199};
201 200
202static int __devinit cs5535_init_one(struct pci_dev *dev, 201static int __devinit cs5535_init_one(struct pci_dev *dev,
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index f841819bc898..2790206336d3 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -437,9 +437,6 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
437 return; 437 return;
438 } 438 }
439 439
440 hwif->mwdma_mask = 0x04;
441 hwif->swdma_mask = 0x04;
442
443 hwif->ide_dma_on = &cy82c693_ide_dma_on; 440 hwif->ide_dma_on = &cy82c693_ide_dma_on;
444} 441}
445 442
@@ -463,6 +460,8 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = {
463 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA | 460 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA |
464 IDE_HFLAG_BOOTABLE, 461 IDE_HFLAG_BOOTABLE,
465 .pio_mask = ATA_PIO4, 462 .pio_mask = ATA_PIO4,
463 .swdma_mask = ATA_SWDMA2_ONLY,
464 .mwdma_mask = ATA_MWDMA2_ONLY,
466}; 465};
467 466
468static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id) 467static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index 88fa2963d1e3..51165832e7f2 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -65,13 +65,6 @@ static void __devinit init_hwif_generic (ide_hwif_t *hwif)
65 default: 65 default:
66 break; 66 break;
67 } 67 }
68
69 if (!(hwif->dma_base))
70 return;
71
72 hwif->ultra_mask = 0x7f;
73 hwif->mwdma_mask = 0x07;
74 hwif->swdma_mask = 0x07;
75} 68}
76 69
77#define DECLARE_GENERIC_PCI_DEV(name_str, dma_setting) \ 70#define DECLARE_GENERIC_PCI_DEV(name_str, dma_setting) \
@@ -81,6 +74,9 @@ static void __devinit init_hwif_generic (ide_hwif_t *hwif)
81 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \ 74 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
82 dma_setting | \ 75 dma_setting | \
83 IDE_HFLAG_BOOTABLE, \ 76 IDE_HFLAG_BOOTABLE, \
77 .swdma_mask = ATA_SWDMA2, \
78 .mwdma_mask = ATA_MWDMA2, \
79 .udma_mask = ATA_UDMA6, \
84 } 80 }
85 81
86static ide_pci_device_t generic_chipsets[] __devinitdata = { 82static ide_pci_device_t generic_chipsets[] __devinitdata = {
@@ -92,6 +88,9 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
92 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, 88 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
93 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 89 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
94 IDE_HFLAG_BOOTABLE, 90 IDE_HFLAG_BOOTABLE,
91 .swdma_mask = ATA_SWDMA2,
92 .mwdma_mask = ATA_MWDMA2,
93 .udma_mask = ATA_UDMA6,
95 }, 94 },
96 95
97 /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0), 96 /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0),
@@ -108,6 +107,9 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
108 .init_hwif = init_hwif_generic, 107 .init_hwif = init_hwif_generic,
109 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 108 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
110 IDE_HFLAG_OFF_BOARD, 109 IDE_HFLAG_OFF_BOARD,
110 .swdma_mask = ATA_SWDMA2,
111 .mwdma_mask = ATA_MWDMA2,
112 .udma_mask = ATA_UDMA6,
111 }, 113 },
112 114
113 /* 11 */ DECLARE_GENERIC_PCI_DEV("Piccolo0102", IDE_HFLAG_NO_AUTODMA), 115 /* 11 */ DECLARE_GENERIC_PCI_DEV("Piccolo0102", IDE_HFLAG_NO_AUTODMA),
@@ -119,6 +121,9 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
119 .init_hwif = init_hwif_generic, 121 .init_hwif = init_hwif_generic,
120 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 122 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
121 IDE_HFLAG_OFF_BOARD, 123 IDE_HFLAG_OFF_BOARD,
124 .swdma_mask = ATA_SWDMA2,
125 .mwdma_mask = ATA_MWDMA2,
126 .udma_mask = ATA_UDMA6,
122 } 127 }
123}; 128};
124 129
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 470e06bd3f2d..0b0c08298348 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -125,51 +125,48 @@ static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const cha
125 125
126static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) 126static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
127{ 127{
128 u16 pcicmd = 0;
129
130 hwif->set_pio_mode = &hpt34x_set_pio_mode; 128 hwif->set_pio_mode = &hpt34x_set_pio_mode;
131 hwif->set_dma_mode = &hpt34x_set_mode; 129 hwif->set_dma_mode = &hpt34x_set_mode;
132 130
133 hwif->drives[0].autotune = 1; 131 hwif->drives[0].autotune = 1;
134 hwif->drives[1].autotune = 1; 132 hwif->drives[1].autotune = 1;
133}
135 134
136 pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd); 135static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
137 136 { /* 0 */
138 if (!hwif->dma_base) 137 .name = "HPT343",
139 return; 138 .init_chipset = init_chipset_hpt34x,
140 139 .init_hwif = init_hwif_hpt34x,
140 .extra = 16,
141 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
142 IDE_HFLAG_NO_AUTODMA,
143 .pio_mask = ATA_PIO5,
144 },
145 { /* 1 */
146 .name = "HPT345",
147 .init_chipset = init_chipset_hpt34x,
148 .init_hwif = init_hwif_hpt34x,
149 .extra = 16,
150 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
151 IDE_HFLAG_NO_AUTODMA |
152 IDE_HFLAG_OFF_BOARD,
153 .pio_mask = ATA_PIO5,
141#ifdef CONFIG_HPT34X_AUTODMA 154#ifdef CONFIG_HPT34X_AUTODMA
142 if ((pcicmd & PCI_COMMAND_MEMORY) == 0) 155 .swdma_mask = ATA_SWDMA2,
143 return; 156 .mwdma_mask = ATA_MWDMA2,
144 157 .udma_mask = ATA_UDMA2,
145 hwif->ultra_mask = 0x07;
146 hwif->mwdma_mask = 0x07;
147 hwif->swdma_mask = 0x07;
148#endif 158#endif
149} 159 }
150
151static ide_pci_device_t hpt34x_chipset __devinitdata = {
152 .name = "HPT34X",
153 .init_chipset = init_chipset_hpt34x,
154 .init_hwif = init_hwif_hpt34x,
155 .extra = 16,
156 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA,
157 .pio_mask = ATA_PIO5,
158}; 160};
159 161
160static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 162static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
161{ 163{
162 ide_pci_device_t *d = &hpt34x_chipset; 164 ide_pci_device_t *d;
163 static char *chipset_names[] = {"HPT343", "HPT345"};
164 u16 pcicmd = 0; 165 u16 pcicmd = 0;
165 166
166 pci_read_config_word(dev, PCI_COMMAND, &pcicmd); 167 pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
167 168
168 d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]; 169 d = &hpt34x_chipsets[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
169 if (pcicmd & PCI_COMMAND_MEMORY)
170 d->host_flags |= IDE_HFLAG_OFF_BOARD;
171 else
172 d->host_flags &= ~IDE_HFLAG_OFF_BOARD;
173 170
174 return ide_setup_pci_device(dev, d); 171 return ide_setup_pci_device(dev, d);
175} 172}
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index a805236bbae6..e643b9654c75 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1296,9 +1296,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1296 if (hwif->dma_base == 0) 1296 if (hwif->dma_base == 0)
1297 return; 1297 return;
1298 1298
1299 hwif->ultra_mask = hwif->cds->udma_mask;
1300 hwif->mwdma_mask = 0x07;
1301
1302 /* 1299 /*
1303 * The HPT37x uses the CBLID pins as outputs for MA15/MA16 1300 * The HPT37x uses the CBLID pins as outputs for MA15/MA16
1304 * address lines to access an external EEPROM. To read valid 1301 * address lines to access an external EEPROM. To read valid
@@ -1555,6 +1552,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1555 .extra = 240, 1552 .extra = 240,
1556 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 1553 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
1557 .pio_mask = ATA_PIO4, 1554 .pio_mask = ATA_PIO4,
1555 .mwdma_mask = ATA_MWDMA2,
1558 },{ /* 1 */ 1556 },{ /* 1 */
1559 .name = "HPT372A", 1557 .name = "HPT372A",
1560 .init_setup = init_setup_hpt372a, 1558 .init_setup = init_setup_hpt372a,
@@ -1566,6 +1564,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1566 .extra = 240, 1564 .extra = 240,
1567 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 1565 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
1568 .pio_mask = ATA_PIO4, 1566 .pio_mask = ATA_PIO4,
1567 .mwdma_mask = ATA_MWDMA2,
1569 },{ /* 2 */ 1568 },{ /* 2 */
1570 .name = "HPT302", 1569 .name = "HPT302",
1571 .init_setup = init_setup_hpt302, 1570 .init_setup = init_setup_hpt302,
@@ -1577,6 +1576,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1577 .extra = 240, 1576 .extra = 240,
1578 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 1577 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
1579 .pio_mask = ATA_PIO4, 1578 .pio_mask = ATA_PIO4,
1579 .mwdma_mask = ATA_MWDMA2,
1580 },{ /* 3 */ 1580 },{ /* 3 */
1581 .name = "HPT371", 1581 .name = "HPT371",
1582 .init_setup = init_setup_hpt371, 1582 .init_setup = init_setup_hpt371,
@@ -1588,6 +1588,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1588 .extra = 240, 1588 .extra = 240,
1589 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 1589 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
1590 .pio_mask = ATA_PIO4, 1590 .pio_mask = ATA_PIO4,
1591 .mwdma_mask = ATA_MWDMA2,
1591 },{ /* 4 */ 1592 },{ /* 4 */
1592 .name = "HPT374", 1593 .name = "HPT374",
1593 .init_setup = init_setup_hpt374, 1594 .init_setup = init_setup_hpt374,
@@ -1599,6 +1600,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1599 .extra = 240, 1600 .extra = 240,
1600 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 1601 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
1601 .pio_mask = ATA_PIO4, 1602 .pio_mask = ATA_PIO4,
1603 .mwdma_mask = ATA_MWDMA2,
1602 },{ /* 5 */ 1604 },{ /* 5 */
1603 .name = "HPT372N", 1605 .name = "HPT372N",
1604 .init_setup = init_setup_hpt372n, 1606 .init_setup = init_setup_hpt372n,
@@ -1610,6 +1612,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1610 .extra = 240, 1612 .extra = 240,
1611 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD, 1613 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
1612 .pio_mask = ATA_PIO4, 1614 .pio_mask = ATA_PIO4,
1615 .mwdma_mask = ATA_MWDMA2,
1613 } 1616 }
1614}; 1617};
1615 1618
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index f161836709ff..e0c1d50e50d4 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -176,10 +176,6 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
176 if (!hwif->dma_base) 176 if (!hwif->dma_base)
177 return; 177 return;
178 178
179 hwif->ultra_mask = 0x7f;
180 hwif->mwdma_mask = 0x06;
181 hwif->swdma_mask = 0x04;
182
183 pci_read_config_byte(hwif->pci_dev, 0x42, &reg42h); 179 pci_read_config_byte(hwif->pci_dev, 0x42, &reg42h);
184 180
185 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 181 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
@@ -195,6 +191,9 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
195 .host_flags = IDE_HFLAG_SINGLE | \ 191 .host_flags = IDE_HFLAG_SINGLE | \
196 IDE_HFLAG_BOOTABLE, \ 192 IDE_HFLAG_BOOTABLE, \
197 .pio_mask = ATA_PIO4, \ 193 .pio_mask = ATA_PIO4, \
194 .swdma_mask = ATA_SWDMA2_ONLY, \
195 .mwdma_mask = ATA_MWDMA12_ONLY, \
196 .udma_mask = ATA_UDMA6, \
198 } 197 }
199 198
200static ide_pci_device_t it8213_chipsets[] __devinitdata = { 199static ide_pci_device_t it8213_chipsets[] __devinitdata = {
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 3596ec3501af..611d0f272fbe 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -591,8 +591,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
591 if (hwif->dma_base == 0) 591 if (hwif->dma_base == 0)
592 return; 592 return;
593 593
594 hwif->ultra_mask = 0x7f; 594 hwif->ultra_mask = ATA_UDMA6;
595 hwif->mwdma_mask = 0x07; 595 hwif->mwdma_mask = ATA_MWDMA2;
596 596
597 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 597 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
598 hwif->cbl = ata66_it821x(hwif); 598 hwif->cbl = ata66_it821x(hwif);
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 5b0a136c879e..b058b3a01b30 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -117,9 +117,6 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
117 if (hwif->dma_base == 0) 117 if (hwif->dma_base == 0)
118 return; 118 return;
119 119
120 hwif->ultra_mask = 0x7f;
121 hwif->mwdma_mask = 0x07;
122
123 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 120 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
124 hwif->cbl = ata66_jmicron(hwif); 121 hwif->cbl = ata66_jmicron(hwif);
125} 122}
@@ -130,6 +127,8 @@ static ide_pci_device_t jmicron_chipset __devinitdata = {
130 .host_flags = IDE_HFLAG_BOOTABLE, 127 .host_flags = IDE_HFLAG_BOOTABLE,
131 .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } }, 128 .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } },
132 .pio_mask = ATA_PIO5, 129 .pio_mask = ATA_PIO5,
130 .mwdma_mask = ATA_MWDMA2,
131 .udma_mask = ATA_UDMA6,
133}; 132};
134 133
135/** 134/**
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
index 558cab537db8..24059c1b21df 100644
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -332,12 +332,6 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
332 hwif->drives[1].drive_data = PIO_DONT_KNOW; 332 hwif->drives[1].drive_data = PIO_DONT_KNOW;
333 333
334 hwif->set_pio_mode = &opti621_set_pio_mode; 334 hwif->set_pio_mode = &opti621_set_pio_mode;
335
336 if (!(hwif->dma_base))
337 return;
338
339 hwif->mwdma_mask = 0x07;
340 hwif->swdma_mask = 0x07;
341} 335}
342 336
343static ide_pci_device_t opti621_chipsets[] __devinitdata = { 337static ide_pci_device_t opti621_chipsets[] __devinitdata = {
@@ -348,6 +342,8 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
348 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 342 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
349 IDE_HFLAG_BOOTABLE, 343 IDE_HFLAG_BOOTABLE,
350 .pio_mask = ATA_PIO3, 344 .pio_mask = ATA_PIO3,
345 .swdma_mask = ATA_SWDMA2,
346 .mwdma_mask = ATA_MWDMA2,
351 },{ /* 1 */ 347 },{ /* 1 */
352 .name = "OPTI621X", 348 .name = "OPTI621X",
353 .init_hwif = init_hwif_opti621, 349 .init_hwif = init_hwif_opti621,
@@ -355,6 +351,8 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
355 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 351 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
356 IDE_HFLAG_BOOTABLE, 352 IDE_HFLAG_BOOTABLE,
357 .pio_mask = ATA_PIO3, 353 .pio_mask = ATA_PIO3,
354 .swdma_mask = ATA_SWDMA2,
355 .mwdma_mask = ATA_MWDMA2,
358 } 356 }
359}; 357};
360 358
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 24efda25c034..a3443fce40f1 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -482,9 +482,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
482 if (hwif->dma_base == 0) 482 if (hwif->dma_base == 0)
483 return; 483 return;
484 484
485 hwif->ultra_mask = hwif->cds->udma_mask;
486 hwif->mwdma_mask = 0x07;
487
488 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 485 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
489 hwif->cbl = pdcnew_cable_detect(hwif); 486 hwif->cbl = pdcnew_cable_detect(hwif);
490} 487}
@@ -553,7 +550,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
553 .init_hwif = init_hwif_pdc202new, 550 .init_hwif = init_hwif_pdc202new,
554 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 551 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
555 .pio_mask = ATA_PIO4, 552 .pio_mask = ATA_PIO4,
556 .udma_mask = 0x3f, /* udma0-5 */ 553 .mwdma_mask = ATA_MWDMA2,
554 .udma_mask = ATA_UDMA5,
557 },{ /* 1 */ 555 },{ /* 1 */
558 .name = "PDC20269", 556 .name = "PDC20269",
559 .init_setup = init_setup_pdcnew, 557 .init_setup = init_setup_pdcnew,
@@ -561,7 +559,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
561 .init_hwif = init_hwif_pdc202new, 559 .init_hwif = init_hwif_pdc202new,
562 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 560 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
563 .pio_mask = ATA_PIO4, 561 .pio_mask = ATA_PIO4,
564 .udma_mask = 0x7f, /* udma0-6*/ 562 .mwdma_mask = ATA_MWDMA2,
563 .udma_mask = ATA_UDMA6,
565 },{ /* 2 */ 564 },{ /* 2 */
566 .name = "PDC20270", 565 .name = "PDC20270",
567 .init_setup = init_setup_pdc20270, 566 .init_setup = init_setup_pdc20270,
@@ -569,7 +568,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
569 .init_hwif = init_hwif_pdc202new, 568 .init_hwif = init_hwif_pdc202new,
570 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 569 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
571 .pio_mask = ATA_PIO4, 570 .pio_mask = ATA_PIO4,
572 .udma_mask = 0x3f, /* udma0-5 */ 571 .mwdma_mask = ATA_MWDMA2,
572 .udma_mask = ATA_UDMA5,
573 },{ /* 3 */ 573 },{ /* 3 */
574 .name = "PDC20271", 574 .name = "PDC20271",
575 .init_setup = init_setup_pdcnew, 575 .init_setup = init_setup_pdcnew,
@@ -577,7 +577,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
577 .init_hwif = init_hwif_pdc202new, 577 .init_hwif = init_hwif_pdc202new,
578 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 578 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
579 .pio_mask = ATA_PIO4, 579 .pio_mask = ATA_PIO4,
580 .udma_mask = 0x7f, /* udma0-6*/ 580 .mwdma_mask = ATA_MWDMA2,
581 .udma_mask = ATA_UDMA6,
581 },{ /* 4 */ 582 },{ /* 4 */
582 .name = "PDC20275", 583 .name = "PDC20275",
583 .init_setup = init_setup_pdcnew, 584 .init_setup = init_setup_pdcnew,
@@ -585,7 +586,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
585 .init_hwif = init_hwif_pdc202new, 586 .init_hwif = init_hwif_pdc202new,
586 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 587 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
587 .pio_mask = ATA_PIO4, 588 .pio_mask = ATA_PIO4,
588 .udma_mask = 0x7f, /* udma0-6*/ 589 .mwdma_mask = ATA_MWDMA2,
590 .udma_mask = ATA_UDMA6,
589 },{ /* 5 */ 591 },{ /* 5 */
590 .name = "PDC20276", 592 .name = "PDC20276",
591 .init_setup = init_setup_pdc20276, 593 .init_setup = init_setup_pdc20276,
@@ -593,7 +595,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
593 .init_hwif = init_hwif_pdc202new, 595 .init_hwif = init_hwif_pdc202new,
594 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 596 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
595 .pio_mask = ATA_PIO4, 597 .pio_mask = ATA_PIO4,
596 .udma_mask = 0x7f, /* udma0-6*/ 598 .mwdma_mask = ATA_MWDMA2,
599 .udma_mask = ATA_UDMA6,
597 },{ /* 6 */ 600 },{ /* 6 */
598 .name = "PDC20277", 601 .name = "PDC20277",
599 .init_setup = init_setup_pdcnew, 602 .init_setup = init_setup_pdcnew,
@@ -601,7 +604,8 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
601 .init_hwif = init_hwif_pdc202new, 604 .init_hwif = init_hwif_pdc202new,
602 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD, 605 .host_flags = IDE_HFLAG_POST_SET_MODE | IDE_HFLAG_OFF_BOARD,
603 .pio_mask = ATA_PIO4, 606 .pio_mask = ATA_PIO4,
604 .udma_mask = 0x7f, /* udma0-6*/ 607 .mwdma_mask = ATA_MWDMA2,
608 .udma_mask = ATA_UDMA6,
605 } 609 }
606}; 610};
607 611
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index d8622be22875..570259093ce4 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -324,9 +324,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
324 if (hwif->dma_base == 0) 324 if (hwif->dma_base == 0)
325 return; 325 return;
326 326
327 hwif->ultra_mask = hwif->cds->udma_mask;
328 hwif->mwdma_mask = 0x07;
329
330 hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; 327 hwif->dma_lost_irq = &pdc202xx_dma_lost_irq;
331 hwif->dma_timeout = &pdc202xx_dma_timeout; 328 hwif->dma_timeout = &pdc202xx_dma_timeout;
332 329
@@ -420,7 +417,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
420 .extra = 16, 417 .extra = 16,
421 .host_flags = IDE_HFLAG_OFF_BOARD, 418 .host_flags = IDE_HFLAG_OFF_BOARD,
422 .pio_mask = ATA_PIO4, 419 .pio_mask = ATA_PIO4,
423 .udma_mask = 0x07, /* udma0-2 */ 420 .mwdma_mask = ATA_MWDMA2,
421 .udma_mask = ATA_UDMA2,
424 },{ /* 1 */ 422 },{ /* 1 */
425 .name = "PDC20262", 423 .name = "PDC20262",
426 .init_setup = init_setup_pdc202ata4, 424 .init_setup = init_setup_pdc202ata4,
@@ -430,7 +428,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
430 .extra = 48, 428 .extra = 48,
431 .host_flags = IDE_HFLAG_OFF_BOARD, 429 .host_flags = IDE_HFLAG_OFF_BOARD,
432 .pio_mask = ATA_PIO4, 430 .pio_mask = ATA_PIO4,
433 .udma_mask = 0x1f, /* udma0-4 */ 431 .mwdma_mask = ATA_MWDMA2,
432 .udma_mask = ATA_UDMA4,
434 },{ /* 2 */ 433 },{ /* 2 */
435 .name = "PDC20263", 434 .name = "PDC20263",
436 .init_setup = init_setup_pdc202ata4, 435 .init_setup = init_setup_pdc202ata4,
@@ -440,7 +439,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
440 .extra = 48, 439 .extra = 48,
441 .host_flags = IDE_HFLAG_OFF_BOARD, 440 .host_flags = IDE_HFLAG_OFF_BOARD,
442 .pio_mask = ATA_PIO4, 441 .pio_mask = ATA_PIO4,
443 .udma_mask = 0x1f, /* udma0-4 */ 442 .mwdma_mask = ATA_MWDMA2,
443 .udma_mask = ATA_UDMA4,
444 },{ /* 3 */ 444 },{ /* 3 */
445 .name = "PDC20265", 445 .name = "PDC20265",
446 .init_setup = init_setup_pdc20265, 446 .init_setup = init_setup_pdc20265,
@@ -450,7 +450,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
450 .extra = 48, 450 .extra = 48,
451 .host_flags = IDE_HFLAG_OFF_BOARD, 451 .host_flags = IDE_HFLAG_OFF_BOARD,
452 .pio_mask = ATA_PIO4, 452 .pio_mask = ATA_PIO4,
453 .udma_mask = 0x3f, /* udma0-5 */ 453 .mwdma_mask = ATA_MWDMA2,
454 .udma_mask = ATA_UDMA5,
454 },{ /* 4 */ 455 },{ /* 4 */
455 .name = "PDC20267", 456 .name = "PDC20267",
456 .init_setup = init_setup_pdc202xx, 457 .init_setup = init_setup_pdc202xx,
@@ -460,7 +461,8 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
460 .extra = 48, 461 .extra = 48,
461 .host_flags = IDE_HFLAG_OFF_BOARD, 462 .host_flags = IDE_HFLAG_OFF_BOARD,
462 .pio_mask = ATA_PIO4, 463 .pio_mask = ATA_PIO4,
463 .udma_mask = 0x3f, /* udma0-5 */ 464 .mwdma_mask = ATA_MWDMA2,
465 .udma_mask = ATA_UDMA5,
464 } 466 }
465}; 467};
466 468
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 692623892cbc..cbfc27b92ede 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -397,10 +397,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
397 if (piix_is_ichx(hwif->pci_dev)) 397 if (piix_is_ichx(hwif->pci_dev))
398 hwif->ide_dma_clear_irq = &piix_dma_clear_irq; 398 hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
399 399
400 hwif->ultra_mask = hwif->cds->udma_mask;
401 hwif->mwdma_mask = 0x06;
402 hwif->swdma_mask = 0x04;
403
404 if (hwif->ultra_mask & 0x78) { 400 if (hwif->ultra_mask & 0x78) {
405 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 401 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
406 hwif->cbl = piix_cable_detect(hwif); 402 hwif->cbl = piix_cable_detect(hwif);
@@ -418,12 +414,14 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
418 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ 414 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
419 .host_flags = IDE_HFLAG_BOOTABLE, \ 415 .host_flags = IDE_HFLAG_BOOTABLE, \
420 .pio_mask = ATA_PIO4, \ 416 .pio_mask = ATA_PIO4, \
417 .swdma_mask = ATA_SWDMA2_ONLY, \
418 .mwdma_mask = ATA_MWDMA12_ONLY, \
421 .udma_mask = udma, \ 419 .udma_mask = udma, \
422 } 420 }
423 421
424static ide_pci_device_t piix_pci_info[] __devinitdata = { 422static ide_pci_device_t piix_pci_info[] __devinitdata = {
425 /* 0 */ DECLARE_PIIX_DEV("PIIXa", 0x00), /* no udma */ 423 /* 0 */ DECLARE_PIIX_DEV("PIIXa", 0x00), /* no udma */
426 /* 1 */ DECLARE_PIIX_DEV("PIIXb", 0x00), /* no udma */ 424 /* 1 */ DECLARE_PIIX_DEV("PIIXb", 0x00), /* no udma */
427 425
428 /* 2 */ 426 /* 2 */
429 { /* 427 { /*
@@ -439,28 +437,28 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
439 .pio_mask = ATA_PIO4, 437 .pio_mask = ATA_PIO4,
440 }, 438 },
441 439
442 /* 3 */ DECLARE_PIIX_DEV("PIIX3", 0x00), /* no udma */ 440 /* 3 */ DECLARE_PIIX_DEV("PIIX3", 0x00), /* no udma */
443 /* 4 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */ 441 /* 4 */ DECLARE_PIIX_DEV("PIIX4", ATA_UDMA2),
444 /* 5 */ DECLARE_PIIX_DEV("ICH0", 0x07), /* udma0-2 */ 442 /* 5 */ DECLARE_PIIX_DEV("ICH0", ATA_UDMA2),
445 /* 6 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */ 443 /* 6 */ DECLARE_PIIX_DEV("PIIX4", ATA_UDMA2),
446 /* 7 */ DECLARE_PIIX_DEV("ICH", 0x1f), /* udma0-4 */ 444 /* 7 */ DECLARE_PIIX_DEV("ICH", ATA_UDMA4),
447 /* 8 */ DECLARE_PIIX_DEV("PIIX4", 0x1f), /* udma0-4 */ 445 /* 8 */ DECLARE_PIIX_DEV("PIIX4", ATA_UDMA4),
448 /* 9 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */ 446 /* 9 */ DECLARE_PIIX_DEV("PIIX4", ATA_UDMA2),
449 /* 10 */ DECLARE_PIIX_DEV("ICH2", 0x3f), /* udma0-5 */ 447 /* 10 */ DECLARE_PIIX_DEV("ICH2", ATA_UDMA5),
450 /* 11 */ DECLARE_PIIX_DEV("ICH2M", 0x3f), /* udma0-5 */ 448 /* 11 */ DECLARE_PIIX_DEV("ICH2M", ATA_UDMA5),
451 /* 12 */ DECLARE_PIIX_DEV("ICH3M", 0x3f), /* udma0-5 */ 449 /* 12 */ DECLARE_PIIX_DEV("ICH3M", ATA_UDMA5),
452 /* 13 */ DECLARE_PIIX_DEV("ICH3", 0x3f), /* udma0-5 */ 450 /* 13 */ DECLARE_PIIX_DEV("ICH3", ATA_UDMA5),
453 /* 14 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */ 451 /* 14 */ DECLARE_PIIX_DEV("ICH4", ATA_UDMA5),
454 /* 15 */ DECLARE_PIIX_DEV("ICH5", 0x3f), /* udma0-5 */ 452 /* 15 */ DECLARE_PIIX_DEV("ICH5", ATA_UDMA5),
455 /* 16 */ DECLARE_PIIX_DEV("C-ICH", 0x3f), /* udma0-5 */ 453 /* 16 */ DECLARE_PIIX_DEV("C-ICH", ATA_UDMA5),
456 /* 17 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */ 454 /* 17 */ DECLARE_PIIX_DEV("ICH4", ATA_UDMA5),
457 /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA", 0x3f), /* udma0-5 */ 455 /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA", ATA_UDMA5),
458 /* 19 */ DECLARE_PIIX_DEV("ICH5", 0x3f), /* udma0-5 */ 456 /* 19 */ DECLARE_PIIX_DEV("ICH5", ATA_UDMA5),
459 /* 20 */ DECLARE_PIIX_DEV("ICH6", 0x3f), /* udma0-5 */ 457 /* 20 */ DECLARE_PIIX_DEV("ICH6", ATA_UDMA5),
460 /* 21 */ DECLARE_PIIX_DEV("ICH7", 0x3f), /* udma0-5 */ 458 /* 21 */ DECLARE_PIIX_DEV("ICH7", ATA_UDMA5),
461 /* 22 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */ 459 /* 22 */ DECLARE_PIIX_DEV("ICH4", ATA_UDMA5),
462 /* 23 */ DECLARE_PIIX_DEV("ESB2", 0x3f), /* udma0-5 */ 460 /* 23 */ DECLARE_PIIX_DEV("ESB2", ATA_UDMA5),
463 /* 24 */ DECLARE_PIIX_DEV("ICH8M", 0x3f), /* udma0-5 */ 461 /* 24 */ DECLARE_PIIX_DEV("ICH8M", ATA_UDMA5),
464}; 462};
465 463
466/** 464/**
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 1a1c0ef0ed5b..252b12f9c954 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -376,9 +376,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
376 376
377 hwif->udma_filter = sc1200_udma_filter; 377 hwif->udma_filter = sc1200_udma_filter;
378 hwif->ide_dma_end = &sc1200_ide_dma_end; 378 hwif->ide_dma_end = &sc1200_ide_dma_end;
379
380 hwif->ultra_mask = 0x07;
381 hwif->mwdma_mask = 0x07;
382} 379}
383 380
384static ide_pci_device_t sc1200_chipset __devinitdata = { 381static ide_pci_device_t sc1200_chipset __devinitdata = {
@@ -387,6 +384,8 @@ static ide_pci_device_t sc1200_chipset __devinitdata = {
387 .host_flags = IDE_HFLAG_ABUSE_DMA_MODES | IDE_HFLAG_POST_SET_MODE | 384 .host_flags = IDE_HFLAG_ABUSE_DMA_MODES | IDE_HFLAG_POST_SET_MODE |
388 IDE_HFLAG_BOOTABLE, 385 IDE_HFLAG_BOOTABLE,
389 .pio_mask = ATA_PIO4, 386 .pio_mask = ATA_PIO4,
387 .mwdma_mask = ATA_MWDMA2,
388 .udma_mask = ATA_UDMA2,
390}; 389};
391 390
392static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) 391static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index bfddc4270827..2b1d5bd0009f 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -472,7 +472,7 @@ static u8 scc_udma_filter(ide_drive_t *drive)
472 if ((drive->media != ide_disk) && (mask & 0xE0)) { 472 if ((drive->media != ide_disk) && (mask & 0xE0)) {
473 printk(KERN_INFO "%s: limit %s to UDMA4\n", 473 printk(KERN_INFO "%s: limit %s to UDMA4\n",
474 SCC_PATA_NAME, drive->name); 474 SCC_PATA_NAME, drive->name);
475 mask = 0x1F; 475 mask = ATA_UDMA4;
476 } 476 }
477 477
478 return mask; 478 return mask;
@@ -686,13 +686,10 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
686 hwif->drives[0].autotune = IDE_TUNE_AUTO; 686 hwif->drives[0].autotune = IDE_TUNE_AUTO;
687 hwif->drives[1].autotune = IDE_TUNE_AUTO; 687 hwif->drives[1].autotune = IDE_TUNE_AUTO;
688 688
689 if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN) { 689 if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN)
690 hwif->ultra_mask = 0x7f; /* 133MHz */ 690 hwif->ultra_mask = ATA_UDMA6; /* 133MHz */
691 } else { 691 else
692 hwif->ultra_mask = 0x3f; /* 100MHz */ 692 hwif->ultra_mask = ATA_UDMA5; /* 100MHz */
693 }
694 hwif->mwdma_mask = 0x00;
695 hwif->swdma_mask = 0x00;
696 693
697 /* we support 80c cable only. */ 694 /* we support 80c cable only. */
698 hwif->cbl = ATA_CBL_PATA80; 695 hwif->cbl = ATA_CBL_PATA80;
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 338eee81f021..760e0e3e118e 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -367,11 +367,6 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
367 hwif->set_dma_mode = &svwks_set_dma_mode; 367 hwif->set_dma_mode = &svwks_set_dma_mode;
368 hwif->udma_filter = &svwks_udma_filter; 368 hwif->udma_filter = &svwks_udma_filter;
369 369
370 if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE)
371 hwif->ultra_mask = 0x3f;
372
373 hwif->mwdma_mask = 0x07;
374
375 hwif->drives[0].autotune = 1; 370 hwif->drives[0].autotune = 1;
376 hwif->drives[1].autotune = 1; 371 hwif->drives[1].autotune = 1;
377 372
@@ -416,6 +411,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
416 .init_hwif = init_hwif_svwks, 411 .init_hwif = init_hwif_svwks,
417 .host_flags = IDE_HFLAG_BOOTABLE, 412 .host_flags = IDE_HFLAG_BOOTABLE,
418 .pio_mask = ATA_PIO4, 413 .pio_mask = ATA_PIO4,
414 .mwdma_mask = ATA_MWDMA2,
415 .udma_mask = 0x00, /* UDMA is problematic on OSB4 */
419 },{ /* 1 */ 416 },{ /* 1 */
420 .name = "SvrWks CSB5", 417 .name = "SvrWks CSB5",
421 .init_setup = init_setup_svwks, 418 .init_setup = init_setup_svwks,
@@ -423,6 +420,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
423 .init_hwif = init_hwif_svwks, 420 .init_hwif = init_hwif_svwks,
424 .host_flags = IDE_HFLAG_BOOTABLE, 421 .host_flags = IDE_HFLAG_BOOTABLE,
425 .pio_mask = ATA_PIO4, 422 .pio_mask = ATA_PIO4,
423 .mwdma_mask = ATA_MWDMA2,
424 .udma_mask = ATA_UDMA5,
426 },{ /* 2 */ 425 },{ /* 2 */
427 .name = "SvrWks CSB6", 426 .name = "SvrWks CSB6",
428 .init_setup = init_setup_csb6, 427 .init_setup = init_setup_csb6,
@@ -430,6 +429,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
430 .init_hwif = init_hwif_svwks, 429 .init_hwif = init_hwif_svwks,
431 .host_flags = IDE_HFLAG_BOOTABLE, 430 .host_flags = IDE_HFLAG_BOOTABLE,
432 .pio_mask = ATA_PIO4, 431 .pio_mask = ATA_PIO4,
432 .mwdma_mask = ATA_MWDMA2,
433 .udma_mask = ATA_UDMA5,
433 },{ /* 3 */ 434 },{ /* 3 */
434 .name = "SvrWks CSB6", 435 .name = "SvrWks CSB6",
435 .init_setup = init_setup_csb6, 436 .init_setup = init_setup_csb6,
@@ -437,6 +438,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
437 .init_hwif = init_hwif_svwks, 438 .init_hwif = init_hwif_svwks,
438 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE, 439 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE,
439 .pio_mask = ATA_PIO4, 440 .pio_mask = ATA_PIO4,
441 .mwdma_mask = ATA_MWDMA2,
442 .udma_mask = ATA_UDMA5,
440 },{ /* 4 */ 443 },{ /* 4 */
441 .name = "SvrWks HT1000", 444 .name = "SvrWks HT1000",
442 .init_setup = init_setup_svwks, 445 .init_setup = init_setup_svwks,
@@ -444,6 +447,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
444 .init_hwif = init_hwif_svwks, 447 .init_hwif = init_hwif_svwks,
445 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE, 448 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE,
446 .pio_mask = ATA_PIO4, 449 .pio_mask = ATA_PIO4,
450 .mwdma_mask = ATA_MWDMA2,
451 .udma_mask = ATA_UDMA5,
447 } 452 }
448}; 453};
449 454
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 9122cb71bcc9..b0cf6add691d 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -592,7 +592,7 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
592 if (hwif->dma_base == 0) 592 if (hwif->dma_base == 0)
593 return; 593 return;
594 594
595 hwif->mwdma_mask = 0x04; 595 hwif->mwdma_mask = ATA_MWDMA2_ONLY;
596 596
597 hwif->dma_setup = &sgiioc4_ide_dma_setup; 597 hwif->dma_setup = &sgiioc4_ide_dma_setup;
598 hwif->dma_start = &sgiioc4_ide_dma_start; 598 hwif->dma_start = &sgiioc4_ide_dma_start;
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index f3ed91006f3f..eda11050a02d 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -896,9 +896,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
896 if (hwif->dma_base == 0) 896 if (hwif->dma_base == 0)
897 return; 897 return;
898 898
899 hwif->ultra_mask = 0x7f;
900 hwif->mwdma_mask = 0x07;
901
902 if (is_sata(hwif)) 899 if (is_sata(hwif))
903 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; 900 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
904 901
@@ -921,6 +918,8 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
921 .fixup = siimage_fixup, \ 918 .fixup = siimage_fixup, \
922 .host_flags = IDE_HFLAG_BOOTABLE, \ 919 .host_flags = IDE_HFLAG_BOOTABLE, \
923 .pio_mask = ATA_PIO4, \ 920 .pio_mask = ATA_PIO4, \
921 .mwdma_mask = ATA_MWDMA2, \
922 .udma_mask = ATA_UDMA6, \
924 } 923 }
925 924
926static ide_pci_device_t siimage_chipsets[] __devinitdata = { 925static ide_pci_device_t siimage_chipsets[] __devinitdata = {
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 5c30759ad008..d38b2039e2aa 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -580,7 +580,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
580 return; 580 return;
581 581
582 hwif->ultra_mask = udma_rates[chipset_family]; 582 hwif->ultra_mask = udma_rates[chipset_family];
583 hwif->mwdma_mask = 0x07;
584 583
585 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 584 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
586 hwif->cbl = ata66_sis5513(hwif); 585 hwif->cbl = ata66_sis5513(hwif);
@@ -593,6 +592,7 @@ static ide_pci_device_t sis5513_chipset __devinitdata = {
593 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 592 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
594 .host_flags = IDE_HFLAG_NO_AUTODMA | IDE_HFLAG_BOOTABLE, 593 .host_flags = IDE_HFLAG_NO_AUTODMA | IDE_HFLAG_BOOTABLE,
595 .pio_mask = ATA_PIO4, 594 .pio_mask = ATA_PIO4,
595 .mwdma_mask = ATA_MWDMA2,
596}; 596};
597 597
598static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id) 598static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index e6eb5c7de7ae..ea6d925ac573 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -388,7 +388,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
388 return; 388 return;
389 } 389 }
390 390
391 hwif->mwdma_mask = 0x07; 391 hwif->mwdma_mask = ATA_MWDMA2;
392 392
393 hwif->ide_dma_on = &sl82c105_ide_dma_on; 393 hwif->ide_dma_on = &sl82c105_ide_dma_on;
394 hwif->dma_off_quietly = &sl82c105_dma_off_quietly; 394 hwif->dma_off_quietly = &sl82c105_dma_off_quietly;
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 4f213e4c0c42..416fbab2ed36 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -147,10 +147,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
147 if (hwif->dma_base == 0) 147 if (hwif->dma_base == 0)
148 return; 148 return;
149 149
150 hwif->ultra_mask = 0x1f;
151 hwif->mwdma_mask = 0x06;
152 hwif->swdma_mask = 0x04;
153
154 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 150 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
155 /* bit[0(1)]: 0:80, 1:40 */ 151 /* bit[0(1)]: 0:80, 1:40 */
156 hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 152 hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
@@ -162,6 +158,9 @@ static ide_pci_device_t slc90e66_chipset __devinitdata = {
162 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, 158 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
163 .host_flags = IDE_HFLAG_BOOTABLE, 159 .host_flags = IDE_HFLAG_BOOTABLE,
164 .pio_mask = ATA_PIO4, 160 .pio_mask = ATA_PIO4,
161 .swdma_mask = ATA_SWDMA2_ONLY,
162 .mwdma_mask = ATA_MWDMA12_ONLY,
163 .udma_mask = ATA_UDMA4,
165}; 164};
166 165
167static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id) 166static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c
index fda8592bf858..9f50927e9098 100644
--- a/drivers/ide/pci/tc86c001.c
+++ b/drivers/ide/pci/tc86c001.c
@@ -198,9 +198,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
198 /* Sector Count Register limit */ 198 /* Sector Count Register limit */
199 hwif->rqsize = 0xffff; 199 hwif->rqsize = 0xffff;
200 200
201 hwif->ultra_mask = 0x1f;
202 hwif->mwdma_mask = 0x07;
203
204 hwif->dma_start = &tc86c001_dma_start; 201 hwif->dma_start = &tc86c001_dma_start;
205 202
206 if (hwif->cbl != ATA_CBL_PATA40_SHORT) { 203 if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
@@ -229,6 +226,8 @@ static ide_pci_device_t tc86c001_chipset __devinitdata = {
229 .init_hwif = init_hwif_tc86c001, 226 .init_hwif = init_hwif_tc86c001,
230 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_OFF_BOARD, 227 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_OFF_BOARD,
231 .pio_mask = ATA_PIO4, 228 .pio_mask = ATA_PIO4,
229 .mwdma_mask = ATA_MWDMA2,
230 .udma_mask = ATA_UDMA4,
232}; 231};
233 232
234static int __devinit tc86c001_init_one(struct pci_dev *dev, 233static int __devinit tc86c001_init_one(struct pci_dev *dev,
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index c5edb1171c10..30b52f62699a 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -100,12 +100,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
100{ 100{
101 hwif->set_pio_mode = &triflex_set_pio_mode; 101 hwif->set_pio_mode = &triflex_set_pio_mode;
102 hwif->set_dma_mode = &triflex_set_mode; 102 hwif->set_dma_mode = &triflex_set_mode;
103
104 if (hwif->dma_base == 0)
105 return;
106
107 hwif->mwdma_mask = 0x07;
108 hwif->swdma_mask = 0x07;
109} 103}
110 104
111static ide_pci_device_t triflex_device __devinitdata = { 105static ide_pci_device_t triflex_device __devinitdata = {
@@ -114,6 +108,8 @@ static ide_pci_device_t triflex_device __devinitdata = {
114 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, 108 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
115 .host_flags = IDE_HFLAG_BOOTABLE, 109 .host_flags = IDE_HFLAG_BOOTABLE,
116 .pio_mask = ATA_PIO4, 110 .pio_mask = ATA_PIO4,
111 .swdma_mask = ATA_SWDMA2,
112 .mwdma_mask = ATA_MWDMA2,
117}; 113};
118 114
119static int __devinit triflex_init_one(struct pci_dev *dev, 115static int __devinit triflex_init_one(struct pci_dev *dev,
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 91bcb6be0d51..70e6c44ec699 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -444,8 +444,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
444 return; 444 return;
445 445
446 hwif->ultra_mask = vdev->via_config->udma_mask; 446 hwif->ultra_mask = vdev->via_config->udma_mask;
447 hwif->mwdma_mask = 0x07;
448 hwif->swdma_mask = 0x07;
449 447
450 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 448 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
451 hwif->cbl = via82cxxx_cable_detect(hwif); 449 hwif->cbl = via82cxxx_cable_detect(hwif);
@@ -463,6 +461,8 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
463 IDE_HFLAG_NO_AUTODMA | 461 IDE_HFLAG_NO_AUTODMA |
464 IDE_HFLAG_BOOTABLE, 462 IDE_HFLAG_BOOTABLE,
465 .pio_mask = ATA_PIO5, 463 .pio_mask = ATA_PIO5,
464 .swdma_mask = ATA_SWDMA2,
465 .mwdma_mask = ATA_MWDMA2,
466 },{ /* 1 */ 466 },{ /* 1 */
467 .name = "VP_IDE", 467 .name = "VP_IDE",
468 .init_chipset = init_chipset_via82cxxx, 468 .init_chipset = init_chipset_via82cxxx,
@@ -473,6 +473,8 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
473 IDE_HFLAG_POST_SET_MODE | 473 IDE_HFLAG_POST_SET_MODE |
474 IDE_HFLAG_BOOTABLE, 474 IDE_HFLAG_BOOTABLE,
475 .pio_mask = ATA_PIO5, 475 .pio_mask = ATA_PIO5,
476 .swdma_mask = ATA_SWDMA2,
477 .mwdma_mask = ATA_MWDMA2,
476 } 478 }
477}; 479};
478 480
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 479add4af499..51b1a9b23a22 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -567,6 +567,12 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
567 hwif->host_flags = d->host_flags; 567 hwif->host_flags = d->host_flags;
568 hwif->pio_mask = d->pio_mask; 568 hwif->pio_mask = d->pio_mask;
569 569
570 if (hwif->dma_base) {
571 hwif->swdma_mask = d->swdma_mask;
572 hwif->mwdma_mask = d->mwdma_mask;
573 hwif->ultra_mask = d->udma_mask;
574 }
575
570 if (d->init_hwif) 576 if (d->init_hwif)
571 /* Call chipset-specific routine 577 /* Call chipset-specific routine
572 * for each enabled hwif 578 * for each enabled hwif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index dced2e176d9f..87662659fb6f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1277,6 +1277,8 @@ typedef struct ide_pci_device_s {
1277 struct ide_pci_device_s *next; 1277 struct ide_pci_device_s *next;
1278 u32 host_flags; 1278 u32 host_flags;
1279 u8 pio_mask; 1279 u8 pio_mask;
1280 u8 swdma_mask;
1281 u8 mwdma_mask;
1280 u8 udma_mask; 1282 u8 udma_mask;
1281} ide_pci_device_t; 1283} ide_pci_device_t;
1282 1284