diff options
Diffstat (limited to 'drivers/ide/pci')
32 files changed, 25 insertions, 414 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index 91bf5beba5c..97b39cebe63 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -141,16 +141,6 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio) drive->hwif->set_dma_mode(drive, pio + XFER_PIO_0); } -static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static void aec62xx_dma_lost_irq (ide_drive_t *drive) { switch (HWIF(drive)->pci_dev->device) { @@ -214,7 +204,6 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif) hwif->ultra_mask = hwif->cds->udma_mask; hwif->mwdma_mask = 0x07; - hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate; hwif->dma_lost_irq = &aec62xx_dma_lost_irq; if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 9582794eb65..64b28cadb2b 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c @@ -437,24 +437,6 @@ static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed) } /** - * ali15x3_config_drive_for_dma - configure for DMA - * @drive: drive to configure - * - * Configure a drive for DMA operation. If DMA is not possible we - * drop the drive into PIO mode instead. - */ - -static int ali15x3_config_drive_for_dma(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * ali15x3_dma_setup - begin a DMA phase * @drive: target device * @@ -713,7 +695,6 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; - hwif->ide_dma_check = &ali15x3_config_drive_for_dma; hwif->dma_setup = &ali15x3_dma_setup; if (hwif->cbl != ATA_CBL_PATA40_SHORT) diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 6ff4089a237..6fa5b3f87b8 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c @@ -264,16 +264,6 @@ static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio) amd_set_drive(drive, XFER_PIO_0 + pio); } -static int amd74xx_ide_dma_check(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - /* * The initialization callback. Here we determine the IDE chip type * and initialize its drive independent registers. @@ -415,7 +405,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) hwif->cbl = ATA_CBL_PATA40; } - hwif->ide_dma_check = &amd74xx_ide_dma_check; if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->autodma; diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index b457df883dc..1dfd068daf7 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c @@ -159,24 +159,6 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed) } /** - * atiixp_dma_check - set up an IDE device - * @drive: IDE drive to configure - * - * Set up the ATIIXP interface for the best available speed on this - * interface, preferring DMA to PIO. - */ - -static int atiixp_dma_check(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * init_hwif_atiixp - fill in the hwif for the ATIIXP * @hwif: IDE interface * @@ -215,7 +197,7 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) hwif->dma_host_on = &atiixp_dma_host_on; hwif->dma_host_off = &atiixp_dma_host_off; - hwif->ide_dma_check = &atiixp_dma_check; + if (!noautodma) hwif->autodma = 1; diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 52790cb6bce..5f421deb3f3 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c @@ -330,16 +330,6 @@ static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed) (void) pci_write_config_byte(dev, pciU, regU); } -static int cmd64x_config_drive_for_dma (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static int cmd648_ide_dma_end (ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); @@ -546,8 +536,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif) if (dev->device == PCI_DEVICE_ID_CMD_646 && rev < 5) hwif->ultra_mask = 0x00; - hwif->ide_dma_check = &cmd64x_config_drive_for_dma; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = ata66_cmd64x(hwif); diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index fbce90048ae..74c3e6048ff 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -105,15 +105,6 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed) cs5520_set_pio_mode(drive, 0); } -static int cs5520_config_drive_xfer_rate(ide_drive_t *drive) -{ - /* Tune the drive for PIO modes up to PIO 4 */ - ide_set_max_pio(drive); - - /* Then tell the core to use DMA operations */ - return 0; -} - /* * We provide a callback for our nonstandard DMA location */ @@ -148,7 +139,6 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif) return; } - hwif->ide_dma_check = &cs5520_config_drive_xfer_rate; hwif->ide_dma_on = &cs5520_dma_on; /* ATAPI is harder so leave it for now */ @@ -171,7 +161,8 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif) .init_hwif = init_hwif_cs5520, \ .autodma = AUTODMA, \ .bootable = ON_BOARD, \ - .host_flags = IDE_HFLAG_ISA_PORTS, \ + .host_flags = IDE_HFLAG_ISA_PORTS | \ + IDE_HFLAG_VDMA, \ .pio_mask = ATA_PIO4, \ } diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index 1c82cd51f6d..d37db0d7547 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c @@ -104,24 +104,6 @@ out: return mask; } -/** - * cs5530_config_dma - set DMA/UDMA mode - * @drive: drive to tune - * - * cs5530_config_dma() handles setting of DMA/UDMA mode - * for both the chipset and drive. - */ - -static int cs5530_config_dma(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode) { unsigned long basereg; @@ -288,7 +270,7 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) hwif->mwdma_mask = 0x07; hwif->udma_filter = cs5530_udma_filter; - hwif->ide_dma_check = &cs5530_config_dma; + if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->autodma; diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index 2a72b4f22dd..4692c39c699 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c @@ -157,16 +157,6 @@ static void cs5535_set_pio_mode(ide_drive_t *drive, const u8 pio) cs5535_set_speed(drive, XFER_PIO_0 + pio); } -static int cs5535_dma_check(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static u8 __devinit cs5535_cable_detect(struct pci_dev *dev) { u8 bit; @@ -197,8 +187,6 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif) if (hwif->dma_base == 0) return; - hwif->ide_dma_check = &cs5535_dma_check; - hwif->atapi_dma = 1; hwif->ultra_mask = 0x1F; hwif->mwdma_mask = 0x07; diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index dc278025d31..b8f98426e3e 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c @@ -469,7 +469,7 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = { .init_hwif = init_hwif_cy82c693, .autodma = AUTODMA, .bootable = ON_BOARD, - .host_flags = IDE_HFLAG_SINGLE, + .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA, .pio_mask = ATA_PIO4, }; diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index 48caa468b76..e8156c1ba63 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c @@ -97,77 +97,92 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = { .init_hwif = init_hwif_generic, .autodma = AUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 1 */ .name = "NS87410", .init_hwif = init_hwif_generic, .autodma = AUTODMA, .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 2 */ .name = "SAMURAI", .init_hwif = init_hwif_generic, .autodma = AUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 3 */ .name = "HT6565", .init_hwif = init_hwif_generic, .autodma = AUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 4 */ .name = "UM8673F", .init_hwif = init_hwif_generic, .autodma = NODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 5 */ .name = "UM8886A", .init_hwif = init_hwif_generic, .autodma = NODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 6 */ .name = "UM8886BF", .init_hwif = init_hwif_generic, .autodma = NODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 7 */ .name = "HINT_IDE", .init_hwif = init_hwif_generic, .autodma = AUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 8 */ .name = "VIA_IDE", .init_hwif = init_hwif_generic, .autodma = NOAUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 9 */ .name = "OPTI621V", .init_hwif = init_hwif_generic, .autodma = NOAUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 10 */ .name = "VIA8237SATA", .init_hwif = init_hwif_generic, .autodma = AUTODMA, .bootable = OFF_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 11 */ .name = "Piccolo0102", .init_hwif = init_hwif_generic, .autodma = NOAUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 12 */ .name = "Piccolo0103", .init_hwif = init_hwif_generic, .autodma = NOAUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 13 */ .name = "Piccolo0105", .init_hwif = init_hwif_generic, .autodma = NOAUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 14 */ .name = "Revolution", .init_hwif = init_hwif_generic, .autodma = AUTODMA, .bootable = OFF_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, } }; diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 69724887225..449132583bb 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c @@ -80,16 +80,6 @@ static void hpt34x_set_pio_mode(ide_drive_t *drive, const u8 pio) hpt34x_set_mode(drive, XFER_PIO_0 + pio); } -static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return -1; - - ide_set_max_pio(drive); - - return -1; -} - /* * If the BIOS does not set the IO base addaress to XX00, 343 will fail. */ @@ -156,7 +146,6 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) hwif->swdma_mask = 0x07; #endif - hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate; if (!noautodma) hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0; hwif->drives[0].autodma = hwif->autodma; diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 992b60eeee3..8cb6b74f014 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -713,16 +713,6 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask) IDE_CONTROL_REG); } -static int hpt366_config_drive_xfer_rate(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - /* * This is specific to the HPT366 UDMA chipset * by HighPoint|Triones Technologies, Inc. @@ -1346,8 +1336,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; - hwif->ide_dma_check = &hpt366_config_drive_xfer_rate; - if (chip_type >= HPT374) { hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq; hwif->ide_dma_end = &hpt374_ide_dma_end; diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index 6dab0daf494..069152dd469 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c @@ -158,32 +158,10 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) } /** - * it8213_configure_drive_for_dma - set up for DMA transfers - * @drive: drive we are going to set up - * - * Set up the drive for DMA, tune the controller and drive as - * required. If the drive isn't suitable for DMA or we hit - * other problems then we will drop down to PIO and set up - * PIO appropriately - */ - -static int it8213_config_drive_for_dma (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * init_hwif_it8213 - set up hwif structs * @hwif: interface to set up * - * We do the basic set up of the interface structure. The IT8212 - * requires several custom handlers so we override the default - * ide DMA handlers appropriately + * We do the basic set up of the interface structure. */ static void __devinit init_hwif_it8213(ide_hwif_t *hwif) @@ -208,8 +186,6 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif) pci_read_config_byte(hwif->pci_dev, 0x42, ®42h); - hwif->ide_dma_check = &it8213_config_drive_for_dma; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c index 1b69d82478c..25595acc299 100644 --- a/drivers/ide/pci/it821x.c +++ b/drivers/ide/pci/it821x.c @@ -416,26 +416,6 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed) } /** - * it821x_configure_drive_for_dma - set up for DMA transfers - * @drive: drive we are going to set up - * - * Set up the drive for DMA, tune the controller and drive as - * required. If the drive isn't suitable for DMA or we hit - * other problems then we will drop down to PIO and set up - * PIO appropriately - */ - -static int it821x_config_drive_for_dma (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * ata66_it821x - check for 80 pin cable * @hwif: interface to check * @@ -615,8 +595,6 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) hwif->ultra_mask = 0x7f; hwif->mwdma_mask = 0x07; - hwif->ide_dma_check = &it821x_config_drive_for_dma; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = ata66_it821x(hwif); diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index 582b4cae2b5..e4a4f1fb5be 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c @@ -100,24 +100,6 @@ static void jmicron_set_dma_mode(ide_drive_t *drive, const u8 mode) } /** - * jmicron_configure_drive_for_dma - set up for DMA transfers - * @drive: drive we are going to set up - * - * As the JMicron snoops for timings all we actually need to do is - * make sure we don't set an invalid mode. - */ - -static int jmicron_config_drive_for_dma (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * init_hwif_jmicron - set up hwif structs * @hwif: interface to set up * @@ -139,8 +121,6 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif) hwif->ultra_mask = 0x7f; hwif->mwdma_mask = 0x07; - hwif->ide_dma_check = &jmicron_config_drive_for_dma; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = ata66_jmicron(hwif); diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index 465c935fdf2..422c234d6c9 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c @@ -274,6 +274,7 @@ static ide_pci_device_t ns87415_chipset __devinitdata = { .init_hwif = init_hwif_ns87415, .autodma = AUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, }; static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index 9fa06393469..38f8a4cb91d 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c @@ -355,6 +355,7 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = { .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, .bootable = ON_BOARD, .pio_mask = ATA_PIO3, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, },{ /* 1 */ .name = "OPTI621X", .init_hwif = init_hwif_opti621, @@ -362,6 +363,7 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = { .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, .bootable = ON_BOARD, .pio_mask = ATA_PIO3, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, } }; diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 9767232e2f8..65e460dbe8b 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -223,16 +223,6 @@ static u8 pdcnew_cable_detect(ide_hwif_t *hwif) return ATA_CBL_PATA80; } -static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static int pdcnew_quirkproc(ide_drive_t *drive) { const char **list, *model = drive->id->model; @@ -499,8 +489,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif) hwif->ultra_mask = hwif->cds->udma_mask; hwif->mwdma_mask = 0x07; - hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = pdcnew_cable_detect(hwif); diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index b2c7b6e3edd..4efc758c763 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -179,16 +179,6 @@ static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif) outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); } -static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static int pdc202xx_quirkproc (ide_drive_t *drive) { const char **list, *model = drive->id->model; @@ -344,7 +334,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) hwif->swdma_mask = 0x07; hwif->atapi_dma = 1; - hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; hwif->dma_timeout = &pdc202xx_dma_timeout; diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index dcb0701f10b..d5a31e9f572 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -255,24 +255,6 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed) } /** - * piix_config_drive_xfer_rate - set up an IDE device - * @drive: IDE drive to configure - * - * Set up the PIIX interface for the best available speed on this - * interface, preferring DMA to PIO. - */ - -static int piix_config_drive_xfer_rate (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * piix_is_ichx - check if ICHx * @dev: PCI device to check * @@ -432,7 +414,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif) if (no_piix_dma) hwif->ultra_mask = hwif->mwdma_mask = hwif->swdma_mask = 0; - hwif->ide_dma_check = &piix_config_drive_xfer_rate; if (!noautodma) hwif->autodma = 1; diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index 184249ed125..38cfc8c2ea5 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c @@ -199,21 +199,6 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode) } } -/* - * sc1200_config_dma() handles selection/setting of DMA/UDMA modes - * for both the chipset and drive. - */ -static int sc1200_config_dma (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - - /* Replacement for the standard ide_dma_end action in * dma_proc. * @@ -391,7 +376,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif) return; hwif->udma_filter = sc1200_udma_filter; - hwif->ide_dma_check = &sc1200_config_dma; hwif->ide_dma_end = &sc1200_ide_dma_end; if (!noautodma) diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index f839bdeb903..977b48e95ba 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c @@ -284,27 +284,6 @@ static void scc_set_dma_mode(ide_drive_t *drive, const u8 speed) } /** - * scc_configure_drive_for_dma - set up for DMA transfers - * @drive: drive we are going to set up - * - * Set up the drive for DMA, tune the controller and drive as - * required. - * If the drive isn't suitable for DMA or we hit other problems - * then we will drop down to PIO and set up PIO appropriately. - * (return -1) - */ - -static int scc_config_drive_for_dma(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/** * scc_ide_dma_setup - begin a DMA phase * @drive: target device * @@ -701,7 +680,6 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif) hwif->ide_dma_end = scc_ide_dma_end; hwif->set_pio_mode = scc_set_pio_mode; hwif->set_dma_mode = scc_set_dma_mode; - hwif->ide_dma_check = scc_config_drive_for_dma; hwif->ide_dma_test_irq = scc_dma_test_irq; hwif->udma_filter = scc_udma_filter; diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index 4666e4c1597..c0d82d29058 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c @@ -196,16 +196,6 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed) pci_write_config_byte(dev, 0x54, ultra_enable); } -static int svwks_config_drive_xfer_rate (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name) { unsigned int reg; @@ -392,7 +382,6 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif) if (!hwif->dma_base) return; - hwif->ide_dma_check = &svwks_config_drive_xfer_rate; if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = ata66_svwks(hwif); diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index c74fef6bbc9..210f32d1e93 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -296,20 +296,6 @@ static void sgiioc4_set_dma_mode(ide_drive_t *drive, const u8 speed) { } -static int sgiioc4_ide_dma_check(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - /* - * ->set_pio_mode is not implemented currently - * so this is just for the completness - */ - ide_set_max_pio(drive); - - return -1; -} - /* returns 1 if dma irq issued, 0 otherwise */ static int sgiioc4_ide_dma_test_irq(ide_drive_t * drive) @@ -612,7 +598,6 @@ ide_init_sgiioc4(ide_hwif_t * hwif) hwif->dma_setup = &sgiioc4_ide_dma_setup; hwif->dma_start = &sgiioc4_ide_dma_start; hwif->ide_dma_end = &sgiioc4_ide_dma_end; - hwif->ide_dma_check = &sgiioc4_ide_dma_check; hwif->ide_dma_on = &sgiioc4_ide_dma_on; hwif->dma_off_quietly = &sgiioc4_dma_off_quietly; hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq; diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 8be36f3b69a..9e03bc7c866 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -311,26 +311,6 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed) } } -/** - * siimage_configure_drive_for_dma - set up for DMA transfers - * @drive: drive we are going to set up - * - * Set up the drive for DMA, tune the controller and drive as - * required. If the drive isn't suitable for DMA or we hit - * other problems then we will drop down to PIO and set up - * PIO appropriately - */ - -static int siimage_config_drive_for_dma (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - /* returns 1 if dma irq issued, 0 otherwise */ static int siimage_io_ide_dma_test_irq (ide_drive_t *drive) { @@ -924,8 +904,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif) if (!is_sata(hwif)) hwif->atapi_dma = 1; - hwif->ide_dma_check = &siimage_config_drive_for_dma; - if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = ata66_siimage(hwif); diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 5458c56e69b..45666b45231 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -601,16 +601,6 @@ static void sis_set_dma_mode(ide_drive_t *drive, const u8 speed) } } -static int sis5513_config_xfer_rate(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static u8 sis5513_ata133_udma_filter(ide_drive_t *drive) { struct pci_dev *dev = drive->hwif->pci_dev; @@ -847,8 +837,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif) if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = ata66_sis5513(hwif); - hwif->ide_dma_check = &sis5513_config_xfer_rate; - if (!noautodma) hwif->autodma = 1; diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 245eac05ab1..c9090faf49b 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c @@ -145,21 +145,6 @@ static void sl82c105_set_dma_mode(ide_drive_t *drive, const u8 speed) } /* - * Check to see if the drive and chipset are capable of DMA mode. - */ -static int sl82c105_ide_dma_check(ide_drive_t *drive) -{ - DBG(("sl82c105_ide_dma_check(drive:%s)\n", drive->name)); - - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - -/* * The SL82C105 holds off all IDE interrupts while in DMA mode until * all DMA activity is completed. Sometimes this causes problems (eg, * when the drive wants to report an error condition). @@ -406,7 +391,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) hwif->atapi_dma = 1; hwif->mwdma_mask = 0x07; - hwif->ide_dma_check = &sl82c105_ide_dma_check; hwif->ide_dma_on = &sl82c105_ide_dma_on; hwif->dma_off_quietly = &sl82c105_dma_off_quietly; hwif->dma_lost_irq = &sl82c105_dma_lost_irq; diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 41c5c571f6b..bf21f1dfb7b 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c @@ -130,16 +130,6 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed) slc90e66_set_pio_mode(drive, pio); } -static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) { u8 reg47 = 0; @@ -170,8 +160,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) /* bit[0(1)]: 0:80, 1:40 */ hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; - hwif->ide_dma_check = &slc90e66_config_drive_xfer_rate; - if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->autodma; diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index e66e7883ebe..7df57d4f789 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c @@ -162,16 +162,6 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) return 0; } -static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) { unsigned long sc_base = pci_resource_start(hwif->pci_dev, 5); @@ -212,7 +202,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) hwif->ultra_mask = 0x1f; hwif->mwdma_mask = 0x07; - hwif->ide_dma_check = &tc86c001_config_drive_xfer_rate; hwif->dma_start = &tc86c001_dma_start; if (hwif->cbl != ATA_CBL_PATA40_SHORT) { diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index 54e411d4e56..921c41006df 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -96,16 +96,6 @@ static void triflex_set_pio_mode(ide_drive_t *drive, const u8 pio) triflex_set_mode(drive, XFER_PIO_0 + pio); } -static int triflex_config_drive_xfer_rate(ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static void __devinit init_hwif_triflex(ide_hwif_t *hwif) { hwif->set_pio_mode = &triflex_set_pio_mode; @@ -117,7 +107,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif) hwif->atapi_dma = 1; hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; - hwif->ide_dma_check = &triflex_config_drive_xfer_rate; if (!noautodma) hwif->autodma = 1; diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index dc4f4e298e0..f227a05420e 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c @@ -329,6 +329,7 @@ static ide_pci_device_t trm290_chipset __devinitdata = { .init_hwif = init_hwif_trm290, .autodma = NOAUTODMA, .bootable = ON_BOARD, + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, }; static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 479e4966103..c199f88c420 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -197,24 +197,6 @@ static void via_set_pio_mode(ide_drive_t *drive, const u8 pio) via_set_drive(drive, XFER_PIO_0 + pio); } -/** - * via82cxxx_ide_dma_check - set up for DMA if possible - * @drive: IDE drive to set up - * - * Set up the drive for the highest supported speed considering the - * driver, controller and cable - */ - -static int via82cxxx_ide_dma_check (ide_drive_t *drive) -{ - if (ide_tune_dma(drive)) - return 0; - - ide_set_max_pio(drive); - - return -1; -} - static struct via_isa_bridge *via_config_find(struct pci_dev **isa) { struct via_isa_bridge *via_config; @@ -473,7 +455,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) if (hwif->cbl != ATA_CBL_PATA40_SHORT) hwif->cbl = via82cxxx_cable_detect(hwif); - hwif->ide_dma_check = &via82cxxx_ide_dma_check; if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->autodma; |