Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (33 commits)
amd74xx: remove /proc/ide/amd74xx
amd74xx/via82cxxx: don't initialize drive->dn
sis5513: remove /proc/ide/sis
ide: remove CONFIG_IDEDMA_ONLYDISK
ide: add "hdx=nodma" kernel parameter
ide: remove hwif->autodma and drive->autodma
ide: remove "idex=dma" kernel parameter
ide: remove CONFIG_BLK_DEV_IDEDMA_FORCED
ide: use PCI_VDEVICE() macro
sis5513: clear prefetch and postwrite for ATAPI devices
it8213/piix/slc90e66: "de-couple" PIO and UDMA modes
ide: unexport noautodma
ide: unexport ide_tune_dma
ide: remove ->ide_dma_check (take 2)
ide-pmac: add PIO autotune fallback to ->ide_dma_check
ide-cris: add PIO autotune fallback to ->ide_dma_check
sl82c105: add PIO autotune fallback to ->ide_dma_check
cs5530/sc1200: add PIO autotune fallback to ->ide_dma_check
ide: remove ide_use_fast_pio()
ide: remove drive->init_speed zeroing
...

+473 -1723
+2 -4
Documentation/ide.txt
··· 242 242 and quite likely to cause trouble with 243 243 older/odd IDE drives. 244 244 245 + "hdx=nodma" : disallow DMA 246 + 245 247 "hdx=swapdata" : when the drive is a disk, byte swap all data 246 248 247 249 "hdx=bswap" : same as above.......... ··· 280 278 "idex=four" : four drives on idex and ide(x^1) share same ports 281 279 282 280 "idex=reset" : reset interface after probe 283 - 284 - "idex=dma" : automatically configure/use DMA if possible. 285 281 286 282 "idex=ata66" : informs the interface that it has an 80c cable 287 283 for chipsets that are ATA-66 capable, but the ··· 287 287 unknown. 288 288 289 289 "ide=reverse" : formerly called to pci sub-system, but now local. 290 - 291 - "ide=nodma" : disable DMA globally for the IDE subsystem. 292 290 293 291 The following are valid ONLY on ide0, which usually corresponds 294 292 to the first ATA interface found on the particular host, and the defaults for
-18
drivers/ide/Kconfig
··· 435 435 bool 436 436 select BLK_DEV_IDEPCI 437 437 438 - config BLK_DEV_IDEDMA_FORCED 439 - bool "Force enable legacy 2.0.X HOSTS to use DMA" 440 - depends on BLK_DEV_IDEDMA_PCI 441 - help 442 - This is an old piece of lost code from Linux 2.0 Kernels. 443 - 444 - Generally say N here. 445 - 446 - # TODO: remove it 447 - config IDEDMA_ONLYDISK 448 - bool "Enable DMA only for disks " 449 - depends on BLK_DEV_IDEDMA_PCI 450 - help 451 - This is used if you know your ATAPI Devices are going to fail DMA 452 - Transfers. 453 - 454 - Generally say N here. 455 - 456 438 config BLK_DEV_AEC62XX 457 439 tristate "AEC62XX chipset support" 458 440 select BLK_DEV_IDEDMA_PCI
-17
drivers/ide/arm/icside.c
··· 309 309 return 0; 310 310 } 311 311 312 - static int icside_dma_check(ide_drive_t *drive) 313 - { 314 - if (ide_tune_dma(drive)) 315 - return 0; 316 - 317 - return -1; 318 - } 319 - 320 312 static int icside_dma_end(ide_drive_t *drive) 321 313 { 322 314 ide_hwif_t *hwif = HWIF(drive); ··· 415 423 416 424 static void icside_dma_init(ide_hwif_t *hwif) 417 425 { 418 - printk(" %s: SG-DMA", hwif->name); 419 - 420 426 hwif->atapi_dma = 1; 421 427 hwif->mwdma_mask = 7; /* MW0..2 */ 422 428 hwif->swdma_mask = 7; /* SW0..2 */ ··· 422 432 hwif->dmatable_cpu = NULL; 423 433 hwif->dmatable_dma = 0; 424 434 hwif->set_dma_mode = icside_set_dma_mode; 425 - hwif->autodma = 1; 426 435 427 - hwif->ide_dma_check = icside_dma_check; 428 436 hwif->dma_host_off = icside_dma_host_off; 429 437 hwif->dma_off_quietly = icside_dma_off_quietly; 430 438 hwif->dma_host_on = icside_dma_host_on; ··· 434 446 hwif->ide_dma_test_irq = icside_dma_test_irq; 435 447 hwif->dma_timeout = icside_dma_timeout; 436 448 hwif->dma_lost_irq = icside_dma_lost_irq; 437 - 438 - hwif->drives[0].autodma = hwif->autodma; 439 - hwif->drives[1].autodma = hwif->autodma; 440 - 441 - printk(" capable%s\n", hwif->autodma ? ", auto-enable" : ""); 442 449 } 443 450 #else 444 451 #define icside_dma_init(hwif) (0)
+2 -13
drivers/ide/cris/ide-cris.c
··· 664 664 return (unsigned char)cris_ide_inw(reg); 665 665 } 666 666 667 - static int cris_dma_check (ide_drive_t *drive); 668 667 static int cris_dma_end (ide_drive_t *drive); 669 668 static int cris_dma_setup (ide_drive_t *drive); 670 669 static void cris_dma_exec_cmd (ide_drive_t *drive, u8 command); ··· 791 792 hwif->ata_output_data = &cris_ide_output_data; 792 793 hwif->atapi_input_bytes = &cris_atapi_input_bytes; 793 794 hwif->atapi_output_bytes = &cris_atapi_output_bytes; 794 - hwif->ide_dma_check = &cris_dma_check; 795 795 hwif->ide_dma_end = &cris_dma_end; 796 796 hwif->dma_setup = &cris_dma_setup; 797 797 hwif->dma_exec_cmd = &cris_dma_exec_cmd; ··· 806 808 hwif->dma_off_quietly = &cris_dma_off; 807 809 hwif->cbl = ATA_CBL_PATA40; 808 810 hwif->pio_mask = ATA_PIO4, 811 + hwif->drives[0].autotune = 1; 812 + hwif->drives[1].autotune = 1; 809 813 hwif->ultra_mask = cris_ultra_mask; 810 814 hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */ 811 - hwif->autodma = 1; 812 - hwif->drives[0].autodma = 1; 813 - hwif->drives[1].autodma = 1; 814 815 } 815 816 816 817 /* Reset pulse */ ··· 1014 1017 * Returns 1 if DMA read/write could not be started, in which case 1015 1018 * the caller should revert to PIO for the current request. 1016 1019 */ 1017 - 1018 - static int cris_dma_check(ide_drive_t *drive) 1019 - { 1020 - if (ide_tune_dma(drive)) 1021 - return 0; 1022 - 1023 - return -1; 1024 - } 1025 1020 1026 1021 static int cris_dma_end(ide_drive_t *drive) 1027 1022 {
+44 -31
drivers/ide/ide-dma.c
··· 338 338 ide_hwif_t *hwif = drive->hwif; 339 339 struct hd_driveid *id = drive->id; 340 340 341 - /* consult the list of known "bad" drives */ 342 - if (__ide_dma_bad_drive(drive)) 343 - return -1; 344 - 345 341 if (drive->media != ide_disk && hwif->atapi_dma == 0) 346 - return -1; 342 + return 0; 347 343 348 - if ((id->capability & 1) && drive->autodma) { 349 - /* 350 - * Enable DMA on any drive that has 351 - * UltraDMA (mode 0/1/2/3/4/5/6) enabled 352 - */ 353 - if ((id->field_valid & 4) && ((id->dma_ultra >> 8) & 0x7f)) 354 - return 0; 355 - /* 356 - * Enable DMA on any drive that has mode2 DMA 357 - * (multi or single) enabled 358 - */ 359 - if (id->field_valid & 2) /* regular DMA */ 360 - if ((id->dma_mword & 0x404) == 0x404 || 361 - (id->dma_1word & 0x404) == 0x404) 362 - return 0; 344 + /* 345 + * Enable DMA on any drive that has 346 + * UltraDMA (mode 0/1/2/3/4/5/6) enabled 347 + */ 348 + if ((id->field_valid & 4) && ((id->dma_ultra >> 8) & 0x7f)) 349 + return 1; 363 350 364 - /* Consult the list of known "good" drives */ 365 - if (ide_dma_good_drive(drive)) 366 - return 0; 367 - } 351 + /* 352 + * Enable DMA on any drive that has mode2 DMA 353 + * (multi or single) enabled 354 + */ 355 + if (id->field_valid & 2) /* regular DMA */ 356 + if ((id->dma_mword & 0x404) == 0x404 || 357 + (id->dma_1word & 0x404) == 0x404) 358 + return 1; 368 359 369 - return -1; 360 + /* Consult the list of known "good" drives */ 361 + if (ide_dma_good_drive(drive)) 362 + return 1; 363 + 364 + return 0; 370 365 } 371 366 372 367 /** ··· 622 627 drive->name, __FUNCTION__); 623 628 return 0; 624 629 } 630 + #else 631 + static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } 625 632 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 626 633 627 634 int __ide_dma_bad_drive (ide_drive_t *drive) ··· 755 758 756 759 EXPORT_SYMBOL_GPL(ide_find_dma_mode); 757 760 758 - int ide_tune_dma(ide_drive_t *drive) 761 + static int ide_tune_dma(ide_drive_t *drive) 759 762 { 760 763 u8 speed; 761 764 762 - if ((drive->id->capability & 1) == 0 || drive->autodma == 0) 765 + if (noautodma || drive->nodma || (drive->id->capability & 1) == 0) 763 766 return 0; 764 767 765 768 /* consult the list of known "bad" drives */ 766 769 if (__ide_dma_bad_drive(drive)) 767 770 return 0; 771 + 772 + if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) 773 + return config_drive_for_dma(drive); 768 774 769 775 speed = ide_max_dma_mode(drive); 770 776 ··· 783 783 return 1; 784 784 } 785 785 786 - EXPORT_SYMBOL_GPL(ide_tune_dma); 786 + static int ide_dma_check(ide_drive_t *drive) 787 + { 788 + ide_hwif_t *hwif = drive->hwif; 789 + int vdma = (hwif->host_flags & IDE_HFLAG_VDMA)? 1 : 0; 790 + 791 + if (!vdma && ide_tune_dma(drive)) 792 + return 0; 793 + 794 + /* TODO: always do PIO fallback */ 795 + if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) 796 + return -1; 797 + 798 + ide_set_max_pio(drive); 799 + 800 + return vdma ? 0 : -1; 801 + } 787 802 788 803 void ide_dma_verbose(ide_drive_t *drive) 789 804 { ··· 857 842 ide_hwif_t *hwif = drive->hwif; 858 843 int rc; 859 844 860 - rc = hwif->ide_dma_check(drive); 845 + rc = ide_dma_check(drive); 861 846 862 847 switch(rc) { 863 848 case -1: /* DMA needs to be disabled */ ··· 1034 1019 hwif->ide_dma_on = &__ide_dma_on; 1035 1020 if (!hwif->dma_host_on) 1036 1021 hwif->dma_host_on = &ide_dma_host_on; 1037 - if (!hwif->ide_dma_check) 1038 - hwif->ide_dma_check = &config_drive_for_dma; 1039 1022 if (!hwif->dma_setup) 1040 1023 hwif->dma_setup = &ide_dma_setup; 1041 1024 if (!hwif->dma_exec_cmd)
+2 -2
drivers/ide/ide-io.c
··· 219 219 220 220 case ide_pm_restore_dma: /* Resume step 3 (restore DMA) */ 221 221 /* 222 - * Right now, all we do is call hwif->ide_dma_check(drive), 222 + * Right now, all we do is call ide_set_dma(drive), 223 223 * we could be smarter and check for current xfer_speed 224 224 * in struct drive etc... 225 225 */ 226 - if (drive->hwif->ide_dma_check == NULL) 226 + if (drive->hwif->ide_dma_on == NULL) 227 227 break; 228 228 drive->hwif->dma_off_quietly(drive); 229 229 /*
+2 -2
drivers/ide/ide-iops.c
··· 776 776 // msleep(50); 777 777 778 778 #ifdef CONFIG_BLK_DEV_IDEDMA 779 - if (hwif->ide_dma_check) /* check if host supports DMA */ 779 + if (hwif->ide_dma_on) /* check if host supports DMA */ 780 780 hwif->dma_host_off(drive); 781 781 #endif 782 782 ··· 830 830 #ifdef CONFIG_BLK_DEV_IDEDMA 831 831 if (speed >= XFER_SW_DMA_0) 832 832 hwif->dma_host_on(drive); 833 - else if (hwif->ide_dma_check) /* check if host supports DMA */ 833 + else if (hwif->ide_dma_on) /* check if host supports DMA */ 834 834 hwif->dma_off_quietly(drive); 835 835 #endif 836 836
-15
drivers/ide/ide-lib.c
··· 96 96 return min(speed, mode); 97 97 } 98 98 99 - int ide_use_fast_pio(ide_drive_t *drive) 100 - { 101 - struct hd_driveid *id = drive->id; 102 - 103 - if ((id->capability & 1) && drive->autodma) 104 - return 1; 105 - 106 - if ((id->capability & 8) || (id->field_valid & 2)) 107 - return 1; 108 - 109 - return 0; 110 - } 111 - 112 - EXPORT_SYMBOL_GPL(ide_use_fast_pio); 113 - 114 99 /* 115 100 * Standard (generic) timings for PIO modes, from ATA2 specification. 116 101 * These timings are for access to the IDE data port register *only*.
+2 -14
drivers/ide/ide-probe.c
··· 835 835 836 836 drive->nice1 = 1; 837 837 838 - /* 839 - * MAJOR HACK BARF :-/ 840 - * 841 - * FIXME: chipsets own this cruft! 842 - */ 843 - /* 844 - * Move here to prevent module loading clashing. 845 - */ 846 - // drive->autodma = hwif->autodma; 847 - if (hwif->ide_dma_check) { 838 + if (hwif->ide_dma_on) { 848 839 /* 849 840 * Force DMAing for the beginning of the check. 850 841 * Some chipsets appear to do interesting ··· 843 852 * PARANOIA!!! 844 853 */ 845 854 hwif->dma_off_quietly(drive); 846 - #ifdef CONFIG_IDEDMA_ONLYDISK 847 - if (drive->media == ide_disk) 848 - #endif 849 - ide_set_dma(drive); 855 + ide_set_dma(drive); 850 856 } 851 857 } 852 858 }
+8 -11
drivers/ide/ide.c
··· 100 100 101 101 int noautodma = 0; 102 102 103 - EXPORT_SYMBOL(noautodma); 104 - 105 103 #ifdef CONFIG_BLK_DEV_IDEACPI 106 104 int ide_noacpi = 0; 107 105 int ide_noacpitfs = 1; ··· 416 418 hwif->dma_exec_cmd = tmp_hwif->dma_exec_cmd; 417 419 hwif->dma_start = tmp_hwif->dma_start; 418 420 hwif->ide_dma_end = tmp_hwif->ide_dma_end; 419 - hwif->ide_dma_check = tmp_hwif->ide_dma_check; 420 421 hwif->ide_dma_on = tmp_hwif->ide_dma_on; 421 422 hwif->dma_off_quietly = tmp_hwif->dma_off_quietly; 422 423 hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq; ··· 458 461 hwif->select_data = tmp_hwif->select_data; 459 462 hwif->extra_base = tmp_hwif->extra_base; 460 463 hwif->extra_ports = tmp_hwif->extra_ports; 461 - hwif->autodma = tmp_hwif->autodma; 462 464 463 465 hwif->hwif_data = tmp_hwif->hwif_data; 464 466 } ··· 819 823 if (!drive->id || !(drive->id->capability & 1)) 820 824 goto out; 821 825 822 - if (hwif->ide_dma_check == NULL) 826 + if (hwif->ide_dma_on == NULL) 823 827 goto out; 824 828 825 829 err = -EBUSY; ··· 1272 1276 if (!strcmp(s, "ide=nodma")) { 1273 1277 printk(" : Prevented DMA\n"); 1274 1278 noautodma = 1; 1275 - return 1; 1279 + goto obsolete_option; 1276 1280 } 1277 1281 1278 1282 #ifdef CONFIG_IDEPCI_PCIBUS_ORDER ··· 1306 1310 */ 1307 1311 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { 1308 1312 const char *hd_words[] = { 1309 - "none", "noprobe", "nowerr", "cdrom", "minus5", 1313 + "none", "noprobe", "nowerr", "cdrom", "nodma", 1310 1314 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1311 1315 "noflush", "remap", "remap63", "scsi", NULL }; 1312 1316 unit = s[2] - 'a'; ··· 1333 1337 /* an ATAPI device ignores DRDY */ 1334 1338 drive->ready_stat = 0; 1335 1339 hwif->noprobe = 0; 1340 + goto done; 1341 + case -5: /* nodma */ 1342 + drive->nodma = 1; 1336 1343 goto done; 1337 1344 case -6: /* "autotune" */ 1338 1345 drive->autotune = IDE_TUNE_AUTO; ··· 1398 1399 */ 1399 1400 static const char *ide_words[] = { 1400 1401 "noprobe", "serialize", "minus3", "minus4", 1401 - "reset", "dma", "ata66", "minus8", "minus9", 1402 + "reset", "minus6", "ata66", "minus8", "minus9", 1402 1403 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", 1403 1404 "dtc2278", "umc8672", "ali14xx", NULL }; 1404 1405 hw = s[3] - '0'; ··· 1477 1478 case -10: /* minus10 */ 1478 1479 case -9: /* minus9 */ 1479 1480 case -8: /* minus8 */ 1481 + case -6: 1480 1482 case -4: 1481 1483 case -3: 1482 1484 goto bad_option; ··· 1492 1492 #else 1493 1493 goto bad_hwif; 1494 1494 #endif 1495 - case -6: /* dma */ 1496 - hwif->autodma = 1; 1497 - goto obsolete_option; 1498 1495 case -5: /* "reset" */ 1499 1496 hwif->reset = 1; 1500 1497 goto obsolete_option;
+7 -5
drivers/ide/legacy/ide-cs.c
··· 28 28 and other provisions required by the GPL. If you do not delete 29 29 the provisions above, a recipient may use your version of this 30 30 file under either the MPL or the GPL. 31 - 31 + 32 32 ======================================================================*/ 33 33 34 34 #include <linux/module.h> ··· 327 327 After a card is removed, ide_release() will unregister the net 328 328 device, and release the PCMCIA configuration. If the device is 329 329 still open, this will be postponed until it is closed. 330 - 330 + 331 331 ======================================================================*/ 332 332 333 333 void ide_release(struct pcmcia_device *link) 334 334 { 335 335 ide_info_t *info = link->priv; 336 - 336 + 337 337 DEBUG(0, "ide_release(0x%p)\n", link); 338 338 339 339 if (info->ndev) { ··· 353 353 stuff to run after an event is received. A CARD_REMOVAL event 354 354 also sets some flags to discourage the ide drivers from 355 355 talking to the ports. 356 - 356 + 357 357 ======================================================================*/ 358 358 359 359 static struct pcmcia_device_id ide_ids[] = { 360 360 PCMCIA_DEVICE_FUNC_ID(4), 361 + PCMCIA_DEVICE_MANF_CARD(0x0000, 0x0000), /* Corsair */ 361 362 PCMCIA_DEVICE_MANF_CARD(0x0007, 0x0000), /* Hitachi */ 362 363 PCMCIA_DEVICE_MANF_CARD(0x000a, 0x0000), /* I-O Data CFA */ 363 364 PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ ··· 367 366 PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ 368 367 PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), 369 368 PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ 370 - PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ 369 + PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ 371 370 PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001), 372 371 PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100), /* Viking CFA */ 373 372 PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar, Viking CFA */ ··· 385 384 PCMCIA_DEVICE_PROD_ID12("FREECOM", "PCCARD-IDE", 0x5714cbf7, 0x48e0ab8e), 386 385 PCMCIA_DEVICE_PROD_ID12("HITACHI", "FLASH", 0xf4f43949, 0x9eb86aae), 387 386 PCMCIA_DEVICE_PROD_ID12("HITACHI", "microdrive", 0xf4f43949, 0xa6d76178), 387 + PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), 388 388 PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), 389 389 PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), 390 390 PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
+15 -23
drivers/ide/mips/au1xxx-ide.c
··· 351 351 return 0; 352 352 } 353 353 354 - static int auide_dma_check(ide_drive_t *drive) 354 + static u8 auide_mdma_filter(ide_drive_t *drive) 355 355 { 356 - u8 speed = ide_max_dma_mode(drive); 356 + /* 357 + * FIXME: ->white_list and ->black_list are based on completely bogus 358 + * ->ide_dma_check implementation which didn't set neither the host 359 + * controller timings nor the device for the desired transfer mode. 360 + * 361 + * They should be either removed or 0x00 MWDMA mask should be 362 + * returned for devices on the ->black_list. 363 + */ 357 364 358 - if( dbdma_init_done == 0 ){ 365 + if (dbdma_init_done == 0) { 359 366 auide_hwif.white_list = ide_in_drive_list(drive->id, 360 367 dma_white_list); 361 368 auide_hwif.black_list = ide_in_drive_list(drive->id, ··· 373 366 } 374 367 375 368 /* Is the drive in our DMA black list? */ 376 - 377 - if ( auide_hwif.black_list ) { 378 - drive->using_dma = 0; 379 - 380 - /* Borrowed the warning message from ide-dma.c */ 381 - 369 + if (auide_hwif.black_list) 382 370 printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n", 383 - drive->name, drive->id->model); 384 - } 385 - else 386 - drive->using_dma = 1; 371 + drive->name, drive->id->model); 387 372 388 - if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) 389 - return 0; 390 - 391 - return -1; 373 + return drive->hwif->mwdma_mask; 392 374 } 393 375 394 376 static int auide_dma_test_irq(ide_drive_t *drive) ··· 688 692 hwif->dma_off_quietly = &auide_dma_off_quietly; 689 693 hwif->dma_timeout = &auide_dma_timeout; 690 694 691 - hwif->ide_dma_check = &auide_dma_check; 695 + hwif->mdma_filter = &auide_mdma_filter; 696 + 692 697 hwif->dma_exec_cmd = &auide_dma_exec_cmd; 693 698 hwif->dma_start = &auide_dma_start; 694 699 hwif->ide_dma_end = &auide_dma_end; ··· 700 703 hwif->dma_lost_irq = &auide_dma_lost_irq; 701 704 hwif->ide_dma_on = &auide_dma_on; 702 705 703 - hwif->autodma = 1; 704 - hwif->drives[0].autodma = hwif->autodma; 705 - hwif->drives[1].autodma = hwif->autodma; 706 706 hwif->atapi_dma = 1; 707 707 708 708 #else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 709 - hwif->autodma = 0; 710 709 hwif->channel = 0; 711 710 hwif->hold = 1; 712 711 hwif->select_data = 0; /* no chipset-specific code */ 713 712 hwif->config_data = 0; /* no chipset-specific code */ 714 713 715 - hwif->drives[0].autodma = 0; 716 714 hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ 717 715 #endif 718 716 hwif->drives[0].no_io_32bit = 1;
+10 -26
drivers/ide/pci/aec62xx.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/aec62xx.c Version 0.24 May 24, 2007 2 + * linux/drivers/ide/pci/aec62xx.c Version 0.25 Aug 1, 2007 3 3 * 4 4 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 5 5 * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> ··· 141 141 drive->hwif->set_dma_mode(drive, pio + XFER_PIO_0); 142 142 } 143 143 144 - static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) 145 - { 146 - if (ide_tune_dma(drive)) 147 - return 0; 148 - 149 - if (ide_use_fast_pio(drive)) 150 - ide_set_max_pio(drive); 151 - 152 - return -1; 153 - } 154 - 155 144 static void aec62xx_dma_lost_irq (ide_drive_t *drive) 156 145 { 157 146 switch (HWIF(drive)->pci_dev->device) { ··· 196 207 } else 197 208 hwif->set_dma_mode = &aec6260_set_mode; 198 209 199 - if (!hwif->dma_base) { 200 - hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 210 + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 211 + 212 + if (hwif->dma_base == 0) 201 213 return; 202 - } 203 214 204 215 hwif->ultra_mask = hwif->cds->udma_mask; 205 216 hwif->mwdma_mask = 0x07; 206 217 207 - hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate; 208 218 hwif->dma_lost_irq = &aec62xx_dma_lost_irq; 209 219 210 220 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { ··· 218 230 219 231 hwif->cbl = (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 220 232 } 221 - 222 - if (!noautodma) 223 - hwif->autodma = 1; 224 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 225 233 } 226 234 227 235 static int __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d) ··· 309 325 return d.init_setup(dev, &d); 310 326 } 311 327 312 - static struct pci_device_id aec62xx_pci_tbl[] = { 313 - { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 314 - { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, 315 - { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 }, 316 - { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 }, 317 - { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, 328 + static const struct pci_device_id aec62xx_pci_tbl[] = { 329 + { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF), 0 }, 330 + { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP860), 1 }, 331 + { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R), 2 }, 332 + { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP865), 3 }, 333 + { PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R), 4 }, 318 334 { 0, }, 319 335 }; 320 336 MODULE_DEVICE_TABLE(pci, aec62xx_pci_tbl);
+3 -31
drivers/ide/pci/alim15x3.c
··· 437 437 } 438 438 439 439 /** 440 - * ali15x3_config_drive_for_dma - configure for DMA 441 - * @drive: drive to configure 442 - * 443 - * Configure a drive for DMA operation. If DMA is not possible we 444 - * drop the drive into PIO mode instead. 445 - */ 446 - 447 - static int ali15x3_config_drive_for_dma(ide_drive_t *drive) 448 - { 449 - drive->init_speed = 0; 450 - 451 - if (ide_tune_dma(drive)) 452 - return 0; 453 - 454 - ide_set_max_pio(drive); 455 - 456 - return -1; 457 - } 458 - 459 - /** 460 440 * ali15x3_dma_setup - begin a DMA phase 461 441 * @drive: target device 462 442 * ··· 660 680 661 681 static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) 662 682 { 663 - hwif->autodma = 0; 664 683 hwif->set_pio_mode = &ali_set_pio_mode; 665 684 hwif->set_dma_mode = &ali_set_dma_mode; 666 685 hwif->udma_filter = &ali_udma_filter; ··· 694 715 hwif->mwdma_mask = 0x07; 695 716 hwif->swdma_mask = 0x07; 696 717 697 - hwif->ide_dma_check = &ali15x3_config_drive_for_dma; 698 718 hwif->dma_setup = &ali15x3_dma_setup; 699 719 700 720 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 701 721 hwif->cbl = ata66_ali15x3(hwif); 702 - 703 - if (!noautodma) 704 - hwif->autodma = 1; 705 - 706 - hwif->drives[0].autodma = hwif->autodma; 707 - hwif->drives[1].autodma = hwif->autodma; 708 722 } 709 723 710 724 /** ··· 808 836 } 809 837 810 838 811 - static struct pci_device_id alim15x3_pci_tbl[] = { 812 - { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 813 - { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5228, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 839 + static const struct pci_device_id alim15x3_pci_tbl[] = { 840 + { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5229), 0 }, 841 + { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), 0 }, 814 842 { 0, }, 815 843 }; 816 844 MODULE_DEVICE_TABLE(pci, alim15x3_pci_tbl);
+25 -172
drivers/ide/pci/amd74xx.c
··· 1 1 /* 2 - * Version 2.23 2 + * Version 2.24 3 3 * 4 4 * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04 5 5 * IDE driver for Linux. ··· 28 28 29 29 #include "ide-timing.h" 30 30 31 - #define DISPLAY_AMD_TIMINGS 32 - 33 - #define AMD_IDE_ENABLE (0x00 + amd_config->base) 34 31 #define AMD_IDE_CONFIG (0x01 + amd_config->base) 35 32 #define AMD_CABLE_DETECT (0x02 + amd_config->base) 36 33 #define AMD_DRIVE_TIMING (0x08 + amd_config->base) ··· 83 86 84 87 static char *amd_dma[] = { "16", "25", "33", "44", "66", "100", "133" }; 85 88 static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7 }; 86 - 87 - /* 88 - * AMD /proc entry. 89 - */ 90 - 91 - #ifdef CONFIG_IDE_PROC_FS 92 - 93 - #include <linux/stat.h> 94 - #include <linux/proc_fs.h> 95 - 96 - static u8 amd74xx_proc; 97 - 98 - static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 15 }; 99 - static unsigned long amd_base; 100 - static struct pci_dev *bmide_dev; 101 - extern int (*amd74xx_display_info)(char *, char **, off_t, int); /* ide-proc.c */ 102 - 103 - #define amd_print(format, arg...) p += sprintf(p, format "\n" , ## arg) 104 - #define amd_print_drive(name, format, arg...)\ 105 - p += sprintf(p, name); for (i = 0; i < 4; i++) p += sprintf(p, format, ## arg); p += sprintf(p, "\n"); 106 - 107 - static int amd74xx_get_info(char *buffer, char **addr, off_t offset, int count) 108 - { 109 - int speed[4], cycle[4], setup[4], active[4], recover[4], den[4], 110 - uen[4], udma[4], active8b[4], recover8b[4]; 111 - struct pci_dev *dev = bmide_dev; 112 - unsigned int v, u, i; 113 - unsigned short c, w; 114 - unsigned char t; 115 - int len; 116 - char *p = buffer; 117 - 118 - amd_print("----------AMD BusMastering IDE Configuration----------------"); 119 - 120 - amd_print("Driver Version: 2.13"); 121 - amd_print("South Bridge: %s", pci_name(bmide_dev)); 122 - 123 - amd_print("Revision: IDE %#x", dev->revision); 124 - amd_print("Highest DMA rate: UDMA%s", amd_dma[fls(amd_config->udma_mask) - 1]); 125 - 126 - amd_print("BM-DMA base: %#lx", amd_base); 127 - amd_print("PCI clock: %d.%dMHz", amd_clock / 1000, amd_clock / 100 % 10); 128 - 129 - amd_print("-----------------------Primary IDE-------Secondary IDE------"); 130 - 131 - pci_read_config_byte(dev, AMD_IDE_CONFIG, &t); 132 - amd_print("Prefetch Buffer: %10s%20s", (t & 0x80) ? "yes" : "no", (t & 0x20) ? "yes" : "no"); 133 - amd_print("Post Write Buffer: %10s%20s", (t & 0x40) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); 134 - 135 - pci_read_config_byte(dev, AMD_IDE_ENABLE, &t); 136 - amd_print("Enabled: %10s%20s", (t & 0x02) ? "yes" : "no", (t & 0x01) ? "yes" : "no"); 137 - 138 - c = inb(amd_base + 0x02) | (inb(amd_base + 0x0a) << 8); 139 - amd_print("Simplex only: %10s%20s", (c & 0x80) ? "yes" : "no", (c & 0x8000) ? "yes" : "no"); 140 - 141 - amd_print("Cable Type: %10s%20s", (amd_80w & 1) ? "80w" : "40w", (amd_80w & 2) ? "80w" : "40w"); 142 - 143 - if (!amd_clock) 144 - return p - buffer; 145 - 146 - amd_print("-------------------drive0----drive1----drive2----drive3-----"); 147 - 148 - pci_read_config_byte(dev, AMD_ADDRESS_SETUP, &t); 149 - pci_read_config_dword(dev, AMD_DRIVE_TIMING, &v); 150 - pci_read_config_word(dev, AMD_8BIT_TIMING, &w); 151 - pci_read_config_dword(dev, AMD_UDMA_TIMING, &u); 152 - 153 - for (i = 0; i < 4; i++) { 154 - setup[i] = ((t >> ((3 - i) << 1)) & 0x3) + 1; 155 - recover8b[i] = ((w >> ((1 - (i >> 1)) << 3)) & 0xf) + 1; 156 - active8b[i] = ((w >> (((1 - (i >> 1)) << 3) + 4)) & 0xf) + 1; 157 - active[i] = ((v >> (((3 - i) << 3) + 4)) & 0xf) + 1; 158 - recover[i] = ((v >> ((3 - i) << 3)) & 0xf) + 1; 159 - 160 - udma[i] = amd_udma2cyc[((u >> ((3 - i) << 3)) & 0x7)]; 161 - uen[i] = ((u >> ((3 - i) << 3)) & 0x40) ? 1 : 0; 162 - den[i] = (c & ((i & 1) ? 0x40 : 0x20) << ((i & 2) << 2)); 163 - 164 - if (den[i] && uen[i] && udma[i] == 1) { 165 - speed[i] = amd_clock * 3; 166 - cycle[i] = 666666 / amd_clock; 167 - continue; 168 - } 169 - 170 - if (den[i] && uen[i] && udma[i] == 15) { 171 - speed[i] = amd_clock * 4; 172 - cycle[i] = 500000 / amd_clock; 173 - continue; 174 - } 175 - 176 - speed[i] = 4 * amd_clock / ((den[i] && uen[i]) ? udma[i] : (active[i] + recover[i]) * 2); 177 - cycle[i] = 1000000 * ((den[i] && uen[i]) ? udma[i] : (active[i] + recover[i]) * 2) / amd_clock / 2; 178 - } 179 - 180 - amd_print_drive("Transfer Mode: ", "%10s", den[i] ? (uen[i] ? "UDMA" : "DMA") : "PIO"); 181 - 182 - amd_print_drive("Address Setup: ", "%8dns", 1000000 * setup[i] / amd_clock); 183 - amd_print_drive("Cmd Active: ", "%8dns", 1000000 * active8b[i] / amd_clock); 184 - amd_print_drive("Cmd Recovery: ", "%8dns", 1000000 * recover8b[i] / amd_clock); 185 - amd_print_drive("Data Active: ", "%8dns", 1000000 * active[i] / amd_clock); 186 - amd_print_drive("Data Recovery: ", "%8dns", 1000000 * recover[i] / amd_clock); 187 - amd_print_drive("Cycle Time: ", "%8dns", cycle[i]); 188 - amd_print_drive("Transfer Rate: ", "%4d.%dMB/s", speed[i] / 1000, speed[i] / 100 % 10); 189 - 190 - /* hoping p - buffer is less than 4K... */ 191 - len = (p - buffer) - offset; 192 - *addr = buffer + offset; 193 - 194 - return len > count ? count : len; 195 - } 196 - 197 - #endif 198 89 199 90 /* 200 91 * amd_set_speed() writes timing values to the chipset registers ··· 147 262 static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio) 148 263 { 149 264 amd_set_drive(drive, XFER_PIO_0 + pio); 150 - } 151 - 152 - static int amd74xx_ide_dma_check(ide_drive_t *drive) 153 - { 154 - if (ide_tune_dma(drive)) 155 - return 0; 156 - 157 - ide_set_max_pio(drive); 158 - 159 - return -1; 160 265 } 161 266 162 267 /* ··· 238 363 amd_chipset->name, pci_name(dev), dev->revision, 239 364 amd_dma[fls(amd_config->udma_mask) - 1]); 240 365 241 - /* 242 - * Register /proc/ide/amd74xx entry 243 - */ 244 - 245 - #if defined(DISPLAY_AMD_TIMINGS) && defined(CONFIG_IDE_PROC_FS) 246 - if (!amd74xx_proc) { 247 - amd_base = pci_resource_start(dev, 4); 248 - bmide_dev = dev; 249 - ide_pci_create_host_proc("amd74xx", amd74xx_get_info); 250 - amd74xx_proc = 1; 251 - } 252 - #endif /* DISPLAY_AMD_TIMINGS && CONFIG_IDE_PROC_FS */ 253 - 254 366 return dev->irq; 255 367 } 256 368 ··· 248 386 if (hwif->irq == 0) /* 0 is bogus but will do for now */ 249 387 hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel); 250 388 251 - hwif->autodma = 0; 252 - 253 389 hwif->set_pio_mode = &amd_set_pio_mode; 254 390 hwif->set_dma_mode = &amd_set_drive; 255 391 ··· 255 395 hwif->drives[i].io_32bit = 1; 256 396 hwif->drives[i].unmask = 1; 257 397 hwif->drives[i].autotune = 1; 258 - hwif->drives[i].dn = hwif->channel * 2 + i; 259 398 } 260 399 261 400 if (!hwif->dma_base) ··· 273 414 else 274 415 hwif->cbl = ATA_CBL_PATA40; 275 416 } 276 - 277 - hwif->ide_dma_check = &amd74xx_ide_dma_check; 278 - if (!noautodma) 279 - hwif->autodma = 1; 280 - hwif->drives[0].autodma = hwif->autodma; 281 - hwif->drives[1].autodma = hwif->autodma; 282 417 } 283 418 284 419 #define DECLARE_AMD_DEV(name_str) \ ··· 342 489 return ide_setup_pci_device(dev, amd_chipset); 343 490 } 344 491 345 - static struct pci_device_id amd74xx_pci_tbl[] = { 346 - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 347 - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, 348 - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7411, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 }, 349 - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 }, 350 - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, 351 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }, 352 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 }, 353 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7 }, 492 + static const struct pci_device_id amd74xx_pci_tbl[] = { 493 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, 494 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 }, 495 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 2 }, 496 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 3 }, 497 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 4 }, 498 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 5 }, 499 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 6 }, 500 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 7 }, 354 501 #ifdef CONFIG_BLK_DEV_IDE_SATA 355 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 }, 502 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA), 8 }, 356 503 #endif 357 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9 }, 358 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10 }, 504 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 9 }, 505 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 10 }, 359 506 #ifdef CONFIG_BLK_DEV_IDE_SATA 360 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11 }, 361 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 }, 507 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA), 11 }, 508 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2), 12 }, 362 509 #endif 363 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, 364 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, 365 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 }, 366 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 }, 367 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 }, 368 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18 }, 369 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19 }, 370 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20 }, 371 - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 21 }, 372 - { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 22 }, 510 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 13 }, 511 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 14 }, 512 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 15 }, 513 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 16 }, 514 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 17 }, 515 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 18 }, 516 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 19 }, 517 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 20 }, 518 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 21 }, 519 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 22 }, 373 520 { 0, }, 374 521 }; 375 522 MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
+11 -82
drivers/ide/pci/atiixp.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/atiixp.c Version 0.02 Jun 16 2007 2 + * linux/drivers/ide/pci/atiixp.c Version 0.03 Aug 3 2007 3 3 * 4 4 * Copyright (C) 2003 ATI Inc. <hyu@ati.com> 5 5 * Copyright (C) 2004,2007 Bartlomiej Zolnierkiewicz ··· 46 46 static int save_mdma_mode[4]; 47 47 48 48 static DEFINE_SPINLOCK(atiixp_lock); 49 - 50 - /** 51 - * atiixp_dma_2_pio - return the PIO mode matching DMA 52 - * @xfer_rate: transfer speed 53 - * 54 - * Returns the nearest equivalent PIO timing for the PIO or DMA 55 - * mode requested by the controller. 56 - */ 57 - 58 - static u8 atiixp_dma_2_pio(u8 xfer_rate) { 59 - switch(xfer_rate) { 60 - case XFER_UDMA_6: 61 - case XFER_UDMA_5: 62 - case XFER_UDMA_4: 63 - case XFER_UDMA_3: 64 - case XFER_UDMA_2: 65 - case XFER_UDMA_1: 66 - case XFER_UDMA_0: 67 - case XFER_MW_DMA_2: 68 - case XFER_PIO_4: 69 - return 4; 70 - case XFER_MW_DMA_1: 71 - case XFER_PIO_3: 72 - return 3; 73 - case XFER_SW_DMA_2: 74 - case XFER_PIO_2: 75 - return 2; 76 - case XFER_MW_DMA_0: 77 - case XFER_SW_DMA_1: 78 - case XFER_SW_DMA_0: 79 - case XFER_PIO_1: 80 - case XFER_PIO_0: 81 - case XFER_PIO_SLOW: 82 - default: 83 - return 0; 84 - } 85 - } 86 49 87 50 static void atiixp_dma_host_on(ide_drive_t *drive) 88 51 { ··· 132 169 int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8; 133 170 u32 tmp32; 134 171 u16 tmp16; 135 - u8 pio; 172 + 173 + if (speed < XFER_MW_DMA_0) 174 + return; 136 175 137 176 spin_lock_irqsave(&atiixp_lock, flags); 138 177 ··· 156 191 } 157 192 158 193 spin_unlock_irqrestore(&atiixp_lock, flags); 159 - 160 - if (speed >= XFER_SW_DMA_0) 161 - pio = atiixp_dma_2_pio(speed); 162 - else 163 - pio = speed - XFER_PIO_0; 164 - 165 - atiixp_set_pio_mode(drive, pio); 166 - } 167 - 168 - /** 169 - * atiixp_dma_check - set up an IDE device 170 - * @drive: IDE drive to configure 171 - * 172 - * Set up the ATIIXP interface for the best available speed on this 173 - * interface, preferring DMA to PIO. 174 - */ 175 - 176 - static int atiixp_dma_check(ide_drive_t *drive) 177 - { 178 - drive->init_speed = 0; 179 - 180 - if (ide_tune_dma(drive)) 181 - return 0; 182 - 183 - if (ide_use_fast_pio(drive)) 184 - ide_set_max_pio(drive); 185 - 186 - return -1; 187 194 } 188 195 189 196 /** ··· 175 238 if (!hwif->irq) 176 239 hwif->irq = ch ? 15 : 14; 177 240 178 - hwif->autodma = 0; 179 241 hwif->set_pio_mode = &atiixp_set_pio_mode; 180 242 hwif->set_dma_mode = &atiixp_set_dma_mode; 181 243 hwif->drives[0].autotune = 1; ··· 185 249 186 250 hwif->atapi_dma = 1; 187 251 hwif->ultra_mask = 0x3f; 188 - hwif->mwdma_mask = 0x06; 189 - hwif->swdma_mask = 0x04; 252 + hwif->mwdma_mask = 0x07; 190 253 191 254 pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode); 192 255 ··· 196 261 197 262 hwif->dma_host_on = &atiixp_dma_host_on; 198 263 hwif->dma_host_off = &atiixp_dma_host_off; 199 - hwif->ide_dma_check = &atiixp_dma_check; 200 - if (!noautodma) 201 - hwif->autodma = 1; 202 - 203 - hwif->drives[1].autodma = hwif->autodma; 204 - hwif->drives[0].autodma = hwif->autodma; 205 264 } 206 265 207 266 ··· 232 303 return ide_setup_pci_device(dev, &atiixp_pci_info[id->driver_data]); 233 304 } 234 305 235 - static struct pci_device_id atiixp_pci_tbl[] = { 236 - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 237 - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 238 - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 239 - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 240 - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 306 + static const struct pci_device_id atiixp_pci_tbl[] = { 307 + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP200_IDE), 0 }, 308 + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP300_IDE), 0 }, 309 + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), 0 }, 310 + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), 1 }, 311 + { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), 0 }, 241 312 { 0, }, 242 313 }; 243 314 MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
+5 -22
drivers/ide/pci/cmd64x.c
··· 330 330 (void) pci_write_config_byte(dev, pciU, regU); 331 331 } 332 332 333 - static int cmd64x_config_drive_for_dma (ide_drive_t *drive) 334 - { 335 - if (ide_tune_dma(drive)) 336 - return 0; 337 - 338 - if (ide_use_fast_pio(drive)) 339 - ide_set_max_pio(drive); 340 - 341 - return -1; 342 - } 343 - 344 333 static int cmd648_ide_dma_end (ide_drive_t *drive) 345 334 { 346 335 ide_hwif_t *hwif = HWIF(drive); ··· 536 547 if (dev->device == PCI_DEVICE_ID_CMD_646 && rev < 5) 537 548 hwif->ultra_mask = 0x00; 538 549 539 - hwif->ide_dma_check = &cmd64x_config_drive_for_dma; 540 - 541 550 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 542 551 hwif->cbl = ata66_cmd64x(hwif); 543 552 ··· 559 572 hwif->ide_dma_test_irq = &cmd64x_ide_dma_test_irq; 560 573 break; 561 574 } 562 - 563 - if (!noautodma) 564 - hwif->autodma = 1; 565 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 566 575 } 567 576 568 577 static int __devinit init_setup_cmd64x(struct pci_dev *dev, ide_pci_device_t *d) ··· 637 654 return d.init_setup(dev, &d); 638 655 } 639 656 640 - static struct pci_device_id cmd64x_pci_tbl[] = { 641 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 642 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 643 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 644 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 657 + static const struct pci_device_id cmd64x_pci_tbl[] = { 658 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_643), 0 }, 659 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_646), 1 }, 660 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_648), 2 }, 661 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_649), 3 }, 645 662 { 0, }, 646 663 }; 647 664 MODULE_DEVICE_TABLE(pci, cmd64x_pci_tbl);
+5 -20
drivers/ide/pci/cs5520.c
··· 105 105 cs5520_set_pio_mode(drive, 0); 106 106 } 107 107 108 - static int cs5520_config_drive_xfer_rate(ide_drive_t *drive) 109 - { 110 - /* Tune the drive for PIO modes up to PIO 4 */ 111 - ide_set_max_pio(drive); 112 - 113 - /* Then tell the core to use DMA operations */ 114 - return 0; 115 - } 116 - 117 108 /* 118 109 * We provide a callback for our nonstandard DMA location 119 110 */ ··· 139 148 return; 140 149 } 141 150 142 - hwif->ide_dma_check = &cs5520_config_drive_xfer_rate; 143 151 hwif->ide_dma_on = &cs5520_dma_on; 144 152 145 153 /* ATAPI is harder so leave it for now */ ··· 146 156 hwif->ultra_mask = 0; 147 157 hwif->swdma_mask = 0; 148 158 hwif->mwdma_mask = 0; 149 - 150 - if (!noautodma) 151 - hwif->autodma = 1; 152 - 153 - hwif->drives[0].autodma = hwif->autodma; 154 - hwif->drives[1].autodma = hwif->autodma; 155 159 } 156 160 157 161 #define DECLARE_CS_DEV(name_str) \ ··· 155 171 .init_hwif = init_hwif_cs5520, \ 156 172 .autodma = AUTODMA, \ 157 173 .bootable = ON_BOARD, \ 158 - .host_flags = IDE_HFLAG_ISA_PORTS, \ 174 + .host_flags = IDE_HFLAG_ISA_PORTS | \ 175 + IDE_HFLAG_VDMA, \ 159 176 .pio_mask = ATA_PIO4, \ 160 177 } 161 178 ··· 218 233 return 0; 219 234 } 220 235 221 - static struct pci_device_id cs5520_pci_tbl[] = { 222 - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 223 - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 236 + static const struct pci_device_id cs5520_pci_tbl[] = { 237 + { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5510), 0 }, 238 + { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5520), 1 }, 224 239 { 0, }, 225 240 }; 226 241 MODULE_DEVICE_TABLE(pci, cs5520_pci_tbl);
+8 -37
drivers/ide/pci/cs5530.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/cs5530.c Version 0.74 Jul 28 2007 2 + * linux/drivers/ide/pci/cs5530.c Version 0.76 Aug 3 2007 3 3 * 4 4 * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> 5 5 * Copyright (C) 2000 Mark Lord <mlord@pobox.com> ··· 102 102 } 103 103 out: 104 104 return mask; 105 - } 106 - 107 - /** 108 - * cs5530_config_dma - set DMA/UDMA mode 109 - * @drive: drive to tune 110 - * 111 - * cs5530_config_dma() handles setting of DMA/UDMA mode 112 - * for both the chipset and drive. 113 - */ 114 - 115 - static int cs5530_config_dma(ide_drive_t *drive) 116 - { 117 - if (ide_tune_dma(drive)) 118 - return 0; 119 - 120 - return 1; 121 105 } 122 106 123 107 static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode) ··· 244 260 { 245 261 unsigned long basereg; 246 262 u32 d0_timings; 247 - hwif->autodma = 0; 248 263 249 264 if (hwif->mate) 250 265 hwif->serialized = hwif->mate->serialized = 1; ··· 253 270 254 271 basereg = CS5530_BASEREG(hwif); 255 272 d0_timings = inl(basereg + 0); 256 - if (CS5530_BAD_PIO(d0_timings)) { 257 - /* PIO timings not initialized? */ 273 + if (CS5530_BAD_PIO(d0_timings)) 258 274 outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0); 259 - if (!hwif->drives[0].autotune) 260 - hwif->drives[0].autotune = 1; 261 - /* needs autotuning later */ 262 - } 263 - if (CS5530_BAD_PIO(inl(basereg + 8))) { 264 - /* PIO timings not initialized? */ 275 + if (CS5530_BAD_PIO(inl(basereg + 8))) 265 276 outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8); 266 - if (!hwif->drives[1].autotune) 267 - hwif->drives[1].autotune = 1; 268 - /* needs autotuning later */ 269 - } 277 + 278 + hwif->drives[0].autotune = 1; 279 + hwif->drives[1].autotune = 1; 270 280 271 281 if (hwif->dma_base == 0) 272 282 return; ··· 269 293 hwif->mwdma_mask = 0x07; 270 294 271 295 hwif->udma_filter = cs5530_udma_filter; 272 - hwif->ide_dma_check = &cs5530_config_dma; 273 - if (!noautodma) 274 - hwif->autodma = 1; 275 - hwif->drives[0].autodma = hwif->autodma; 276 - hwif->drives[1].autodma = hwif->autodma; 277 296 } 278 297 279 298 static ide_pci_device_t cs5530_chipset __devinitdata = { ··· 286 315 return ide_setup_pci_device(dev, &cs5530_chipset); 287 316 } 288 317 289 - static struct pci_device_id cs5530_pci_tbl[] = { 290 - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 318 + static const struct pci_device_id cs5530_pci_tbl[] = { 319 + { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), 0 }, 291 320 { 0, }, 292 321 }; 293 322 MODULE_DEVICE_TABLE(pci, cs5530_pci_tbl);
+2 -26
drivers/ide/pci/cs5535.c
··· 157 157 cs5535_set_speed(drive, XFER_PIO_0 + pio); 158 158 } 159 159 160 - static int cs5535_dma_check(ide_drive_t *drive) 161 - { 162 - drive->init_speed = 0; 163 - 164 - if (ide_tune_dma(drive)) 165 - return 0; 166 - 167 - if (ide_use_fast_pio(drive)) 168 - ide_set_max_pio(drive); 169 - 170 - return -1; 171 - } 172 - 173 160 static u8 __devinit cs5535_cable_detect(struct pci_dev *dev) 174 161 { 175 162 u8 bit; ··· 177 190 */ 178 191 static void __devinit init_hwif_cs5535(ide_hwif_t *hwif) 179 192 { 180 - hwif->autodma = 0; 181 - 182 193 hwif->set_pio_mode = &cs5535_set_pio_mode; 183 194 hwif->set_dma_mode = &cs5535_set_dma_mode; 184 195 ··· 185 200 if (hwif->dma_base == 0) 186 201 return; 187 202 188 - hwif->ide_dma_check = &cs5535_dma_check; 189 - 190 203 hwif->atapi_dma = 1; 191 204 hwif->ultra_mask = 0x1F; 192 205 hwif->mwdma_mask = 0x07; 193 206 194 207 hwif->cbl = cs5535_cable_detect(hwif->pci_dev); 195 - 196 - if (!noautodma) 197 - hwif->autodma = 1; 198 - 199 - hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma; 200 208 } 201 209 202 210 static ide_pci_device_t cs5535_chipset __devinitdata = { ··· 207 229 return ide_setup_pci_device(dev, &cs5535_chipset); 208 230 } 209 231 210 - static struct pci_device_id cs5535_pci_tbl[] = 211 - { 212 - { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_IDE, PCI_ANY_ID, 213 - PCI_ANY_ID, 0, 0, 0}, 232 + static const struct pci_device_id cs5535_pci_tbl[] = { 233 + { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_CS5535_IDE), 0 }, 214 234 { 0, }, 215 235 }; 216 236
+3 -9
drivers/ide/pci/cy82c693.c
··· 428 428 */ 429 429 static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif) 430 430 { 431 - hwif->autodma = 0; 432 - 433 431 hwif->chipset = ide_cy82c693; 434 432 hwif->set_pio_mode = &cy82c693_set_pio_mode; 435 433 ··· 442 444 hwif->swdma_mask = 0x04; 443 445 444 446 hwif->ide_dma_on = &cy82c693_ide_dma_on; 445 - if (!noautodma) 446 - hwif->autodma = 1; 447 - hwif->drives[0].autodma = hwif->autodma; 448 - hwif->drives[1].autodma = hwif->autodma; 449 447 } 450 448 451 449 static __devinitdata ide_hwif_t *primary; ··· 463 469 .init_hwif = init_hwif_cy82c693, 464 470 .autodma = AUTODMA, 465 471 .bootable = ON_BOARD, 466 - .host_flags = IDE_HFLAG_SINGLE, 472 + .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA, 467 473 .pio_mask = ATA_PIO4, 468 474 }; 469 475 ··· 483 489 return ret; 484 490 } 485 491 486 - static struct pci_device_id cy82c693_pci_tbl[] = { 487 - { PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 492 + static const struct pci_device_id cy82c693_pci_tbl[] = { 493 + { PCI_VDEVICE(CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693), 0 }, 488 494 { 0, }, 489 495 }; 490 496 MODULE_DEVICE_TABLE(pci, cy82c693_pci_tbl);
+35 -22
drivers/ide/pci/generic.c
··· 73 73 hwif->ultra_mask = 0x7f; 74 74 hwif->mwdma_mask = 0x07; 75 75 hwif->swdma_mask = 0x07; 76 - 77 - if (!noautodma) 78 - hwif->autodma = 1; 79 - hwif->drives[0].autodma = hwif->autodma; 80 - hwif->drives[1].autodma = hwif->autodma; 81 76 } 82 77 83 78 #if 0 ··· 92 97 .init_hwif = init_hwif_generic, 93 98 .autodma = AUTODMA, 94 99 .bootable = ON_BOARD, 100 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 95 101 },{ /* 1 */ 96 102 .name = "NS87410", 97 103 .init_hwif = init_hwif_generic, 98 104 .autodma = AUTODMA, 99 105 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, 100 106 .bootable = ON_BOARD, 107 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 101 108 },{ /* 2 */ 102 109 .name = "SAMURAI", 103 110 .init_hwif = init_hwif_generic, 104 111 .autodma = AUTODMA, 105 112 .bootable = ON_BOARD, 113 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 106 114 },{ /* 3 */ 107 115 .name = "HT6565", 108 116 .init_hwif = init_hwif_generic, 109 117 .autodma = AUTODMA, 110 118 .bootable = ON_BOARD, 119 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 111 120 },{ /* 4 */ 112 121 .name = "UM8673F", 113 122 .init_hwif = init_hwif_generic, 114 123 .autodma = NODMA, 115 124 .bootable = ON_BOARD, 125 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 116 126 },{ /* 5 */ 117 127 .name = "UM8886A", 118 128 .init_hwif = init_hwif_generic, 119 129 .autodma = NODMA, 120 130 .bootable = ON_BOARD, 131 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 121 132 },{ /* 6 */ 122 133 .name = "UM8886BF", 123 134 .init_hwif = init_hwif_generic, 124 135 .autodma = NODMA, 125 136 .bootable = ON_BOARD, 137 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 126 138 },{ /* 7 */ 127 139 .name = "HINT_IDE", 128 140 .init_hwif = init_hwif_generic, 129 141 .autodma = AUTODMA, 130 142 .bootable = ON_BOARD, 143 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 131 144 },{ /* 8 */ 132 145 .name = "VIA_IDE", 133 146 .init_hwif = init_hwif_generic, 134 147 .autodma = NOAUTODMA, 135 148 .bootable = ON_BOARD, 149 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 136 150 },{ /* 9 */ 137 151 .name = "OPTI621V", 138 152 .init_hwif = init_hwif_generic, 139 153 .autodma = NOAUTODMA, 140 154 .bootable = ON_BOARD, 155 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 141 156 },{ /* 10 */ 142 157 .name = "VIA8237SATA", 143 158 .init_hwif = init_hwif_generic, 144 159 .autodma = AUTODMA, 145 160 .bootable = OFF_BOARD, 161 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 146 162 },{ /* 11 */ 147 163 .name = "Piccolo0102", 148 164 .init_hwif = init_hwif_generic, 149 165 .autodma = NOAUTODMA, 150 166 .bootable = ON_BOARD, 167 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 151 168 },{ /* 12 */ 152 169 .name = "Piccolo0103", 153 170 .init_hwif = init_hwif_generic, 154 171 .autodma = NOAUTODMA, 155 172 .bootable = ON_BOARD, 173 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 156 174 },{ /* 13 */ 157 175 .name = "Piccolo0105", 158 176 .init_hwif = init_hwif_generic, 159 177 .autodma = NOAUTODMA, 160 178 .bootable = ON_BOARD, 179 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 161 180 },{ /* 14 */ 162 181 .name = "Revolution", 163 182 .init_hwif = init_hwif_generic, 164 183 .autodma = AUTODMA, 165 184 .bootable = OFF_BOARD, 185 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 166 186 } 167 187 }; 168 188 ··· 236 226 return ret; 237 227 } 238 228 239 - static struct pci_device_id generic_pci_tbl[] = { 240 - { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 241 - { PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 242 - { PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 243 - { PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 244 - { PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, 245 - { PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, 246 - { PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, 247 - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, 248 - { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, 229 + static const struct pci_device_id generic_pci_tbl[] = { 230 + { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_87410), 1 }, 231 + { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE), 2 }, 232 + { PCI_VDEVICE(HOLTEK, PCI_DEVICE_ID_HOLTEK_6565), 3 }, 233 + { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8673F), 4 }, 234 + { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8886A), 5 }, 235 + { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8886BF), 6 }, 236 + { PCI_VDEVICE(HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE), 7 }, 237 + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C561), 8 }, 238 + { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C558), 9 }, 249 239 #ifdef CONFIG_BLK_DEV_IDE_SATA 250 - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10}, 240 + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237_SATA), 10 }, 251 241 #endif 252 - { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, 253 - { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, 254 - { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, 255 - { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, 256 - /* Must come last. If you add entries adjust this table appropriately and the init_one code */ 257 - { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, 242 + { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO), 11 }, 243 + { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), 12 }, 244 + { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), 13 }, 245 + { PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), 14 }, 246 + /* 247 + * Must come last. If you add entries adjust 248 + * this table and generic_chipsets[] appropriately. 249 + */ 250 + { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0 }, 258 251 { 0, }, 259 252 }; 260 253 MODULE_DEVICE_TABLE(pci, generic_pci_tbl);
+5 -23
drivers/ide/pci/hpt34x.c
··· 80 80 hpt34x_set_mode(drive, XFER_PIO_0 + pio); 81 81 } 82 82 83 - static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) 84 - { 85 - drive->init_speed = 0; 86 - 87 - if (ide_tune_dma(drive)) 88 - return -1; 89 - 90 - if (ide_use_fast_pio(drive)) 91 - ide_set_max_pio(drive); 92 - 93 - return -1; 94 - } 95 - 96 83 /* 97 84 * If the BIOS does not set the IO base addaress to XX00, 343 will fail. 98 85 */ ··· 127 140 { 128 141 u16 pcicmd = 0; 129 142 130 - hwif->autodma = 0; 131 - 132 143 hwif->set_pio_mode = &hpt34x_set_pio_mode; 133 144 hwif->set_dma_mode = &hpt34x_set_mode; 134 145 ··· 139 154 return; 140 155 141 156 #ifdef CONFIG_HPT34X_AUTODMA 157 + if ((pcicmd & PCI_COMMAND_MEMORY) == 0) 158 + return; 159 + 142 160 hwif->ultra_mask = 0x07; 143 161 hwif->mwdma_mask = 0x07; 144 162 hwif->swdma_mask = 0x07; 145 163 #endif 146 - 147 - hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate; 148 - if (!noautodma) 149 - hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0; 150 - hwif->drives[0].autodma = hwif->autodma; 151 - hwif->drives[1].autodma = hwif->autodma; 152 164 } 153 165 154 166 static ide_pci_device_t hpt34x_chipset __devinitdata = { ··· 172 190 return ide_setup_pci_device(dev, d); 173 191 } 174 192 175 - static struct pci_device_id hpt34x_pci_tbl[] = { 176 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 193 + static const struct pci_device_id hpt34x_pci_tbl[] = { 194 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT343), 0 }, 177 195 { 0, }, 178 196 }; 179 197 MODULE_DEVICE_TABLE(pci, hpt34x_pci_tbl);
+11 -30
drivers/ide/pci/hpt366.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/hpt366.c Version 1.13 Sep 29, 2007 2 + * linux/drivers/ide/pci/hpt366.c Version 1.14 Oct 1, 2007 3 3 * 4 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 5 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. ··· 713 713 IDE_CONTROL_REG); 714 714 } 715 715 716 - static int hpt366_config_drive_xfer_rate(ide_drive_t *drive) 717 - { 718 - drive->init_speed = 0; 719 - 720 - if (ide_tune_dma(drive)) 721 - return 0; 722 - 723 - if (ide_use_fast_pio(drive)) 724 - ide_set_max_pio(drive); 725 - 726 - return -1; 727 - } 728 - 729 716 /* 730 717 * This is specific to the HPT366 UDMA chipset 731 718 * by HighPoint|Triones Technologies, Inc. ··· 1291 1304 if (new_mcr != old_mcr) 1292 1305 pci_write_config_byte(dev, hwif->select_data + 1, new_mcr); 1293 1306 1294 - if (!hwif->dma_base) { 1295 - hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 1307 + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 1308 + 1309 + if (hwif->dma_base == 0) 1296 1310 return; 1297 - } 1298 1311 1299 1312 hwif->ultra_mask = hwif->cds->udma_mask; 1300 1313 hwif->mwdma_mask = 0x07; ··· 1336 1349 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 1337 1350 hwif->cbl = (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 1338 1351 1339 - hwif->ide_dma_check = &hpt366_config_drive_xfer_rate; 1340 - 1341 1352 if (chip_type >= HPT374) { 1342 1353 hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq; 1343 1354 hwif->ide_dma_end = &hpt374_ide_dma_end; ··· 1345 1360 hwif->dma_timeout = &hpt370_dma_timeout; 1346 1361 } else 1347 1362 hwif->dma_lost_irq = &hpt366_dma_lost_irq; 1348 - 1349 - if (!noautodma) 1350 - hwif->autodma = 1; 1351 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 1352 1363 } 1353 1364 1354 1365 static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase) ··· 1638 1657 return d.init_setup(dev, &d); 1639 1658 } 1640 1659 1641 - static struct pci_device_id hpt366_pci_tbl[] = { 1642 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1643 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 1644 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 1645 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 1646 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 1647 - { PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372N, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, 1660 + static const struct pci_device_id hpt366_pci_tbl[] = { 1661 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), 0 }, 1662 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), 1 }, 1663 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), 2 }, 1664 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT371), 3 }, 1665 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT374), 4 }, 1666 + { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372N), 5 }, 1648 1667 { 0, }, 1649 1668 }; 1650 1669 MODULE_DEVICE_TABLE(pci, hpt366_pci_tbl);
+13 -73
drivers/ide/pci/it8213.c
··· 18 18 #include <asm/io.h> 19 19 20 20 /** 21 - * it8213_dma_2_pio - return the PIO mode matching DMA 22 - * @xfer_rate: transfer speed 23 - * 24 - * Returns the nearest equivalent PIO timing for the DMA 25 - * mode requested by the controller. 26 - */ 27 - 28 - static u8 it8213_dma_2_pio (u8 xfer_rate) { 29 - switch(xfer_rate) { 30 - case XFER_UDMA_6: 31 - case XFER_UDMA_5: 32 - case XFER_UDMA_4: 33 - case XFER_UDMA_3: 34 - case XFER_UDMA_2: 35 - case XFER_UDMA_1: 36 - case XFER_UDMA_0: 37 - case XFER_MW_DMA_2: 38 - return 4; 39 - case XFER_MW_DMA_1: 40 - return 3; 41 - case XFER_SW_DMA_2: 42 - return 2; 43 - case XFER_MW_DMA_0: 44 - case XFER_SW_DMA_1: 45 - case XFER_SW_DMA_0: 46 - default: 47 - return 0; 48 - } 49 - } 50 - 51 - /** 52 21 * it8213_set_pio_mode - set host controller for PIO mode 53 22 * @drive: drive 54 23 * @pio: PIO mode number ··· 135 166 } else 136 167 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 137 168 } else { 169 + const u8 mwdma_to_pio[] = { 0, 3, 4 }; 170 + u8 pio; 171 + 138 172 if (reg48 & u_flag) 139 173 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); 140 174 if (reg4a & a_speed) ··· 146 174 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 147 175 if (reg55 & w_flag) 148 176 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); 177 + 178 + if (speed >= XFER_MW_DMA_0) 179 + pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 180 + else 181 + pio = 2; /* only SWDMA2 is allowed */ 182 + 183 + it8213_set_pio_mode(drive, pio); 149 184 } 150 - 151 - it8213_set_pio_mode(drive, it8213_dma_2_pio(speed)); 152 - } 153 - 154 - /** 155 - * it8213_configure_drive_for_dma - set up for DMA transfers 156 - * @drive: drive we are going to set up 157 - * 158 - * Set up the drive for DMA, tune the controller and drive as 159 - * required. If the drive isn't suitable for DMA or we hit 160 - * other problems then we will drop down to PIO and set up 161 - * PIO appropriately 162 - */ 163 - 164 - static int it8213_config_drive_for_dma (ide_drive_t *drive) 165 - { 166 - if (ide_tune_dma(drive)) 167 - return 0; 168 - 169 - ide_set_max_pio(drive); 170 - 171 - return -1; 172 185 } 173 186 174 187 /** 175 188 * init_hwif_it8213 - set up hwif structs 176 189 * @hwif: interface to set up 177 190 * 178 - * We do the basic set up of the interface structure. The IT8212 179 - * requires several custom handlers so we override the default 180 - * ide DMA handlers appropriately 191 + * We do the basic set up of the interface structure. 181 192 */ 182 193 183 194 static void __devinit init_hwif_it8213(ide_hwif_t *hwif) ··· 169 214 170 215 hwif->set_dma_mode = &it8213_set_dma_mode; 171 216 hwif->set_pio_mode = &it8213_set_pio_mode; 172 - 173 - hwif->autodma = 0; 174 217 175 218 hwif->drives[0].autotune = 1; 176 219 hwif->drives[1].autotune = 1; ··· 183 230 184 231 pci_read_config_byte(hwif->pci_dev, 0x42, &reg42h); 185 232 186 - hwif->ide_dma_check = &it8213_config_drive_for_dma; 187 - 188 233 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 189 234 hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 190 - 191 - /* 192 - * The BIOS often doesn't set up DMA on this controller 193 - * so we always do it. 194 - */ 195 - if (!noautodma) 196 - hwif->autodma = 1; 197 - 198 - hwif->drives[0].autodma = hwif->autodma; 199 - hwif->drives[1].autodma = hwif->autodma; 200 235 } 201 236 202 237 ··· 220 279 return 0; 221 280 } 222 281 223 - 224 - static struct pci_device_id it8213_pci_tbl[] = { 225 - { PCI_VENDOR_ID_ITE, 0x8213, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 282 + static const struct pci_device_id it8213_pci_tbl[] = { 283 + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8213), 0 }, 226 284 { 0, }, 227 285 }; 228 286
+8 -42
drivers/ide/pci/it821x.c
··· 416 416 } 417 417 418 418 /** 419 - * it821x_configure_drive_for_dma - set up for DMA transfers 420 - * @drive: drive we are going to set up 421 - * 422 - * Set up the drive for DMA, tune the controller and drive as 423 - * required. If the drive isn't suitable for DMA or we hit 424 - * other problems then we will drop down to PIO and set up 425 - * PIO appropriately 426 - */ 427 - 428 - static int it821x_config_drive_for_dma (ide_drive_t *drive) 429 - { 430 - if (ide_tune_dma(drive)) 431 - return 0; 432 - 433 - ide_set_max_pio(drive); 434 - 435 - return -1; 436 - } 437 - 438 - /** 439 419 * ata66_it821x - check for 80 pin cable 440 420 * @hwif: interface to check 441 421 * ··· 537 557 struct it821x_dev *idev = kzalloc(sizeof(struct it821x_dev), GFP_KERNEL); 538 558 u8 conf; 539 559 540 - if(idev == NULL) { 560 + if (idev == NULL) { 541 561 printk(KERN_ERR "it821x: out of memory, falling back to legacy behaviour.\n"); 542 - goto fallback; 562 + return; 543 563 } 564 + 544 565 ide_set_hwifdata(hwif, idev); 545 566 546 567 hwif->atapi_dma = 1; ··· 590 609 hwif->drives[0].autotune = 1; 591 610 hwif->drives[1].autotune = 1; 592 611 593 - if (!hwif->dma_base) 594 - goto fallback; 612 + if (hwif->dma_base == 0) 613 + return; 595 614 596 615 hwif->ultra_mask = 0x7f; 597 616 hwif->mwdma_mask = 0x07; 598 617 599 - hwif->ide_dma_check = &it821x_config_drive_for_dma; 600 - 601 618 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 602 619 hwif->cbl = ata66_it821x(hwif); 603 - 604 - /* 605 - * The BIOS often doesn't set up DMA on this controller 606 - * so we always do it. 607 - */ 608 - 609 - hwif->autodma = 1; 610 - hwif->drives[0].autodma = hwif->autodma; 611 - hwif->drives[1].autodma = hwif->autodma; 612 - return; 613 - fallback: 614 - hwif->autodma = 0; 615 - return; 616 620 } 617 621 618 622 static void __devinit it8212_disable_raid(struct pci_dev *dev) ··· 663 697 return 0; 664 698 } 665 699 666 - static struct pci_device_id it821x_pci_tbl[] = { 667 - { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 668 - { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8212, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 700 + static const struct pci_device_id it821x_pci_tbl[] = { 701 + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 }, 702 + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 }, 669 703 { 0, }, 670 704 }; 671 705
+2 -30
drivers/ide/pci/jmicron.c
··· 100 100 } 101 101 102 102 /** 103 - * jmicron_configure_drive_for_dma - set up for DMA transfers 104 - * @drive: drive we are going to set up 105 - * 106 - * As the JMicron snoops for timings all we actually need to do is 107 - * make sure we don't set an invalid mode. 108 - */ 109 - 110 - static int jmicron_config_drive_for_dma (ide_drive_t *drive) 111 - { 112 - if (ide_tune_dma(drive)) 113 - return 0; 114 - 115 - ide_set_max_pio(drive); 116 - 117 - return -1; 118 - } 119 - 120 - /** 121 103 * init_hwif_jmicron - set up hwif structs 122 104 * @hwif: interface to set up 123 105 * ··· 114 132 hwif->drives[0].autotune = 1; 115 133 hwif->drives[1].autotune = 1; 116 134 117 - if (!hwif->dma_base) 118 - goto fallback; 135 + if (hwif->dma_base == 0) 136 + return; 119 137 120 138 hwif->atapi_dma = 1; 121 139 hwif->ultra_mask = 0x7f; 122 140 hwif->mwdma_mask = 0x07; 123 141 124 - hwif->ide_dma_check = &jmicron_config_drive_for_dma; 125 - 126 142 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 127 143 hwif->cbl = ata66_jmicron(hwif); 128 - 129 - hwif->autodma = 1; 130 - hwif->drives[0].autodma = hwif->autodma; 131 - hwif->drives[1].autodma = hwif->autodma; 132 - return; 133 - fallback: 134 - hwif->autodma = 0; 135 - return; 136 144 } 137 145 138 146 static ide_pci_device_t jmicron_chipset __devinitdata = {
+3 -8
drivers/ide/pci/ns87415.c
··· 197 197 u8 stat; 198 198 #endif 199 199 200 - hwif->autodma = 0; 201 200 hwif->selectproc = &ns87415_selectproc; 202 201 203 202 /* ··· 258 259 outb(0x60, hwif->dma_status); 259 260 hwif->dma_setup = &ns87415_ide_dma_setup; 260 261 hwif->ide_dma_end = &ns87415_ide_dma_end; 261 - 262 - if (!noautodma) 263 - hwif->autodma = 1; 264 - hwif->drives[0].autodma = hwif->autodma; 265 - hwif->drives[1].autodma = hwif->autodma; 266 262 } 267 263 268 264 static ide_pci_device_t ns87415_chipset __devinitdata = { ··· 268 274 .init_hwif = init_hwif_ns87415, 269 275 .autodma = AUTODMA, 270 276 .bootable = ON_BOARD, 277 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 271 278 }; 272 279 273 280 static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id) ··· 276 281 return ide_setup_pci_device(dev, &ns87415_chipset); 277 282 } 278 283 279 - static struct pci_device_id ns87415_pci_tbl[] = { 280 - { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 284 + static const struct pci_device_id ns87415_pci_tbl[] = { 285 + { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_87415), 0 }, 281 286 { 0, }, 282 287 }; 283 288 MODULE_DEVICE_TABLE(pci, ns87415_pci_tbl);
+5 -9
drivers/ide/pci/opti621.c
··· 328 328 */ 329 329 static void __devinit init_hwif_opti621 (ide_hwif_t *hwif) 330 330 { 331 - hwif->autodma = 0; 332 331 hwif->drives[0].drive_data = PIO_DONT_KNOW; 333 332 hwif->drives[1].drive_data = PIO_DONT_KNOW; 334 333 ··· 339 340 hwif->atapi_dma = 1; 340 341 hwif->mwdma_mask = 0x07; 341 342 hwif->swdma_mask = 0x07; 342 - 343 - if (!noautodma) 344 - hwif->autodma = 1; 345 - hwif->drives[0].autodma = hwif->autodma; 346 - hwif->drives[1].autodma = hwif->autodma; 347 343 } 348 344 349 345 static ide_pci_device_t opti621_chipsets[] __devinitdata = { ··· 349 355 .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, 350 356 .bootable = ON_BOARD, 351 357 .pio_mask = ATA_PIO3, 358 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 352 359 },{ /* 1 */ 353 360 .name = "OPTI621X", 354 361 .init_hwif = init_hwif_opti621, ··· 357 362 .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, 358 363 .bootable = ON_BOARD, 359 364 .pio_mask = ATA_PIO3, 365 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 360 366 } 361 367 }; 362 368 ··· 366 370 return ide_setup_pci_device(dev, &opti621_chipsets[id->driver_data]); 367 371 } 368 372 369 - static struct pci_device_id opti621_pci_tbl[] = { 370 - { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 371 - { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 373 + static const struct pci_device_id opti621_pci_tbl[] = { 374 + { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C621), 0 }, 375 + { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C825), 1 }, 372 376 { 0, }, 373 377 }; 374 378 MODULE_DEVICE_TABLE(pci, opti621_pci_tbl);
+8 -29
drivers/ide/pci/pdc202xx_new.c
··· 223 223 return ATA_CBL_PATA80; 224 224 } 225 225 226 - static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive) 227 - { 228 - drive->init_speed = 0; 229 - 230 - if (ide_tune_dma(drive)) 231 - return 0; 232 - 233 - if (ide_use_fast_pio(drive)) 234 - ide_set_max_pio(drive); 235 - 236 - return -1; 237 - } 238 - 239 226 static int pdcnew_quirkproc(ide_drive_t *drive) 240 227 { 241 228 const char **list, *model = drive->id->model; ··· 469 482 470 483 static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif) 471 484 { 472 - hwif->autodma = 0; 473 - 474 485 hwif->set_pio_mode = &pdcnew_set_pio_mode; 475 486 hwif->set_dma_mode = &pdcnew_set_mode; 476 487 ··· 487 502 hwif->ultra_mask = hwif->cds->udma_mask; 488 503 hwif->mwdma_mask = 0x07; 489 504 490 - hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate; 491 - 492 505 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 493 506 hwif->cbl = pdcnew_cable_detect(hwif); 494 - 495 - if (!noautodma) 496 - hwif->autodma = 1; 497 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 498 507 } 499 508 500 509 static int __devinit init_setup_pdcnew(struct pci_dev *dev, ide_pci_device_t *d) ··· 637 658 return d->init_setup(dev, d); 638 659 } 639 660 640 - static struct pci_device_id pdc202new_pci_tbl[] = { 641 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20268, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 642 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20269, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 643 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20270, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 644 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20271, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 645 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20275, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 646 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20276, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, 647 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20277, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, 661 + static const struct pci_device_id pdc202new_pci_tbl[] = { 662 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20268), 0 }, 663 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20269), 1 }, 664 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20270), 2 }, 665 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20271), 3 }, 666 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20275), 4 }, 667 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20276), 5 }, 668 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20277), 6 }, 648 669 { 0, }, 649 670 }; 650 671 MODULE_DEVICE_TABLE(pci, pdc202new_pci_tbl);
+6 -26
drivers/ide/pci/pdc202xx_old.c
··· 179 179 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); 180 180 } 181 181 182 - static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) 183 - { 184 - drive->init_speed = 0; 185 - 186 - if (ide_tune_dma(drive)) 187 - return 0; 188 - 189 - if (ide_use_fast_pio(drive)) 190 - ide_set_max_pio(drive); 191 - 192 - return -1; 193 - } 194 - 195 182 static int pdc202xx_quirkproc (ide_drive_t *drive) 196 183 { 197 184 const char **list, *model = drive->id->model; ··· 312 325 (dev->device == PCI_DEVICE_ID_PROMISE_20265)) 313 326 hwif->rqsize = 256; 314 327 315 - hwif->autodma = 0; 316 - 317 328 hwif->set_pio_mode = &pdc202xx_set_pio_mode; 318 329 hwif->set_dma_mode = &pdc202xx_set_mode; 319 330 ··· 332 347 hwif->swdma_mask = 0x07; 333 348 hwif->atapi_dma = 1; 334 349 335 - hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; 336 350 hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; 337 351 hwif->dma_timeout = &pdc202xx_dma_timeout; 338 352 ··· 343 359 hwif->ide_dma_end = &pdc202xx_old_ide_dma_end; 344 360 } 345 361 hwif->ide_dma_test_irq = &pdc202xx_old_ide_dma_test_irq; 346 - 347 - if (!noautodma) 348 - hwif->autodma = 1; 349 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 350 362 } 351 363 352 364 static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase) ··· 490 510 return d->init_setup(dev, d); 491 511 } 492 512 493 - static struct pci_device_id pdc202xx_pci_tbl[] = { 494 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 495 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 496 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20263, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 497 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20265, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 498 - { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20267, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 513 + static const struct pci_device_id pdc202xx_pci_tbl[] = { 514 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20246), 0 }, 515 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20262), 1 }, 516 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20263), 2 }, 517 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20265), 3 }, 518 + { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20267), 4 }, 499 519 { 0, }, 500 520 }; 501 521 MODULE_DEVICE_TABLE(pci, pdc202xx_pci_tbl);
+37 -90
drivers/ide/pci/piix.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/piix.c Version 0.52 Jul 14, 2007 2 + * linux/drivers/ide/pci/piix.c Version 0.53 Aug 9, 2007 3 3 * 4 4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer 5 5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> ··· 104 104 #include <asm/io.h> 105 105 106 106 static int no_piix_dma; 107 - 108 - /** 109 - * piix_dma_2_pio - return the PIO mode matching DMA 110 - * @xfer_rate: transfer speed 111 - * 112 - * Returns the nearest equivalent PIO timing for the DMA 113 - * mode requested by the controller. 114 - */ 115 - 116 - static u8 piix_dma_2_pio (u8 xfer_rate) { 117 - switch(xfer_rate) { 118 - case XFER_UDMA_6: 119 - case XFER_UDMA_5: 120 - case XFER_UDMA_4: 121 - case XFER_UDMA_3: 122 - case XFER_UDMA_2: 123 - case XFER_UDMA_1: 124 - case XFER_UDMA_0: 125 - case XFER_MW_DMA_2: 126 - return 4; 127 - case XFER_MW_DMA_1: 128 - return 3; 129 - case XFER_SW_DMA_2: 130 - return 2; 131 - case XFER_MW_DMA_0: 132 - case XFER_SW_DMA_1: 133 - case XFER_SW_DMA_0: 134 - default: 135 - return 0; 136 - } 137 - } 138 107 139 108 /** 140 109 * piix_set_pio_mode - set host controller for PIO mode ··· 232 263 } else 233 264 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 234 265 } else { 266 + const u8 mwdma_to_pio[] = { 0, 3, 4 }; 267 + u8 pio; 268 + 235 269 if (reg48 & u_flag) 236 270 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); 237 271 if (reg4a & a_speed) ··· 243 271 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 244 272 if (reg55 & w_flag) 245 273 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); 274 + 275 + if (speed >= XFER_MW_DMA_0) 276 + pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 277 + else 278 + pio = 2; /* only SWDMA2 is allowed */ 279 + 280 + piix_set_pio_mode(drive, pio); 246 281 } 247 - 248 - piix_set_pio_mode(drive, piix_dma_2_pio(speed)); 249 - } 250 - 251 - /** 252 - * piix_config_drive_xfer_rate - set up an IDE device 253 - * @drive: IDE drive to configure 254 - * 255 - * Set up the PIIX interface for the best available speed on this 256 - * interface, preferring DMA to PIO. 257 - */ 258 - 259 - static int piix_config_drive_xfer_rate (ide_drive_t *drive) 260 - { 261 - drive->init_speed = 0; 262 - 263 - if (ide_tune_dma(drive)) 264 - return 0; 265 - 266 - if (ide_use_fast_pio(drive)) 267 - ide_set_max_pio(drive); 268 - 269 - return -1; 270 282 } 271 283 272 284 /** ··· 384 428 return; 385 429 } 386 430 387 - hwif->autodma = 0; 388 - 389 431 hwif->set_pio_mode = &piix_set_pio_mode; 390 432 hwif->set_dma_mode = &piix_set_dma_mode; 391 433 ··· 410 456 411 457 if (no_piix_dma) 412 458 hwif->ultra_mask = hwif->mwdma_mask = hwif->swdma_mask = 0; 413 - 414 - hwif->ide_dma_check = &piix_config_drive_xfer_rate; 415 - if (!noautodma) 416 - hwif->autodma = 1; 417 - 418 - hwif->drives[1].autodma = hwif->autodma; 419 - hwif->drives[0].autodma = hwif->autodma; 420 459 } 421 460 422 461 #define DECLARE_PIIX_DEV(name_str, udma) \ ··· 512 565 printk(KERN_WARNING "piix: A BIOS update may resolve this.\n"); 513 566 } 514 567 515 - static struct pci_device_id piix_pci_tbl[] = { 516 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 517 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 518 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371MX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 519 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 520 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 521 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, 522 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, 523 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, 524 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82372FB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, 525 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, 526 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10}, 527 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, 528 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, 529 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, 530 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, 531 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15}, 532 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16}, 533 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17}, 568 + static const struct pci_device_id piix_pci_tbl[] = { 569 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82371FB_0), 0 }, 570 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82371FB_1), 1 }, 571 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82371MX), 2 }, 572 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82371SB_1), 3 }, 573 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82371AB), 4 }, 574 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801AB_1), 5 }, 575 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82443MX_1), 6 }, 576 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801AA_1), 7 }, 577 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82372FB_1), 8 }, 578 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82451NX), 9 }, 579 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801BA_9), 10 }, 580 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801BA_8), 11 }, 581 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801CA_10), 12 }, 582 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801CA_11), 13 }, 583 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801DB_11), 14 }, 584 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801EB_11), 15 }, 585 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801E_11), 16 }, 586 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801DB_10), 17 }, 534 587 #ifdef CONFIG_BLK_DEV_IDE_SATA 535 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18}, 588 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801EB_1), 18 }, 536 589 #endif 537 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19}, 538 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_19, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20}, 539 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 21}, 540 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 22}, 541 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_18, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 23}, 542 - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 24}, 590 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ESB_2), 19 }, 591 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH6_19), 20 }, 592 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH7_21), 21 }, 593 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801DB_1), 22 }, 594 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ESB2_18), 23 }, 595 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH8_6), 24 }, 543 596 { 0, }, 544 597 }; 545 598 MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
+3 -3
drivers/ide/pci/rz1000.c
··· 61 61 return ide_setup_pci_device(dev, &rz1000_chipset); 62 62 } 63 63 64 - static struct pci_device_id rz1000_pci_tbl[] = { 65 - { PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 66 - { PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 64 + static const struct pci_device_id rz1000_pci_tbl[] = { 65 + { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), 0 }, 66 + { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001), 0 }, 67 67 { 0, }, 68 68 }; 69 69 MODULE_DEVICE_TABLE(pci, rz1000_pci_tbl);
+6 -24
drivers/ide/pci/sc1200.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/sc1200.c Version 0.95 Jun 16 2007 2 + * linux/drivers/ide/pci/sc1200.c Version 0.97 Aug 3 2007 3 3 * 4 4 * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com> 5 5 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz ··· 199 199 } 200 200 } 201 201 202 - /* 203 - * sc1200_config_dma() handles selection/setting of DMA/UDMA modes 204 - * for both the chipset and drive. 205 - */ 206 - static int sc1200_config_dma (ide_drive_t *drive) 207 - { 208 - if (ide_tune_dma(drive)) 209 - return 0; 210 - 211 - return 1; 212 - } 213 - 214 - 215 202 /* Replacement for the standard ide_dma_end action in 216 203 * dma_proc. 217 204 * ··· 364 377 { 365 378 if (hwif->mate) 366 379 hwif->serialized = hwif->mate->serialized = 1; 367 - hwif->autodma = 0; 368 380 369 381 hwif->set_pio_mode = &sc1200_set_pio_mode; 370 382 hwif->set_dma_mode = &sc1200_set_dma_mode; 383 + 384 + hwif->drives[0].autotune = 1; 385 + hwif->drives[1].autotune = 1; 371 386 372 387 if (hwif->dma_base == 0) 373 388 return; 374 389 375 390 hwif->udma_filter = sc1200_udma_filter; 376 - hwif->ide_dma_check = &sc1200_config_dma; 377 391 hwif->ide_dma_end = &sc1200_ide_dma_end; 378 - 379 - if (!noautodma) 380 - hwif->autodma = 1; 381 392 382 393 hwif->atapi_dma = 1; 383 394 hwif->ultra_mask = 0x07; 384 395 hwif->mwdma_mask = 0x07; 385 - 386 - hwif->drives[0].autodma = hwif->autodma; 387 - hwif->drives[1].autodma = hwif->autodma; 388 396 } 389 397 390 398 static ide_pci_device_t sc1200_chipset __devinitdata = { ··· 396 414 return ide_setup_pci_device(dev, &sc1200_chipset); 397 415 } 398 416 399 - static struct pci_device_id sc1200_pci_tbl[] = { 400 - { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_IDE), 0}, 417 + static const struct pci_device_id sc1200_pci_tbl[] = { 418 + { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_SCx200_IDE), 0}, 401 419 { 0, }, 402 420 }; 403 421 MODULE_DEVICE_TABLE(pci, sc1200_pci_tbl);
+2 -31
drivers/ide/pci/scc_pata.c
··· 284 284 } 285 285 286 286 /** 287 - * scc_configure_drive_for_dma - set up for DMA transfers 288 - * @drive: drive we are going to set up 289 - * 290 - * Set up the drive for DMA, tune the controller and drive as 291 - * required. 292 - * If the drive isn't suitable for DMA or we hit other problems 293 - * then we will drop down to PIO and set up PIO appropriately. 294 - * (return -1) 295 - */ 296 - 297 - static int scc_config_drive_for_dma(ide_drive_t *drive) 298 - { 299 - if (ide_tune_dma(drive)) 300 - return 0; 301 - 302 - if (ide_use_fast_pio(drive)) 303 - ide_set_max_pio(drive); 304 - 305 - return -1; 306 - } 307 - 308 - /** 309 287 * scc_ide_dma_setup - begin a DMA phase 310 288 * @drive: target device 311 289 * ··· 680 702 hwif->ide_dma_end = scc_ide_dma_end; 681 703 hwif->set_pio_mode = scc_set_pio_mode; 682 704 hwif->set_dma_mode = scc_set_dma_mode; 683 - hwif->ide_dma_check = scc_config_drive_for_dma; 684 705 hwif->ide_dma_test_irq = scc_dma_test_irq; 685 706 hwif->udma_filter = scc_udma_filter; 686 707 ··· 697 720 698 721 /* we support 80c cable only. */ 699 722 hwif->cbl = ATA_CBL_PATA80; 700 - 701 - hwif->autodma = 0; 702 - if (!noautodma) 703 - hwif->autodma = 1; 704 - hwif->drives[0].autodma = hwif->autodma; 705 - hwif->drives[1].autodma = hwif->autodma; 706 723 } 707 724 708 725 #define DECLARE_SCC_DEV(name_str) \ ··· 764 793 memset(ports, 0, sizeof(*ports)); 765 794 } 766 795 767 - static struct pci_device_id scc_pci_tbl[] = { 768 - { PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_SCC_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 796 + static const struct pci_device_id scc_pci_tbl[] = { 797 + { PCI_VDEVICE(TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_SCC_ATA), 0 }, 769 798 { 0, }, 770 799 }; 771 800 MODULE_DEVICE_TABLE(pci, scc_pci_tbl);
+7 -26
drivers/ide/pci/serverworks.c
··· 97 97 mode = 2; 98 98 99 99 switch(mode) { 100 + case 3: mask = 0x3f; break; 100 101 case 2: mask = 0x1f; break; 101 102 case 1: mask = 0x07; break; 102 103 default: mask = 0x00; break; ··· 194 193 pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing); 195 194 pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing); 196 195 pci_write_config_byte(dev, 0x54, ultra_enable); 197 - } 198 - 199 - static int svwks_config_drive_xfer_rate (ide_drive_t *drive) 200 - { 201 - drive->init_speed = 0; 202 - 203 - if (ide_tune_dma(drive)) 204 - return 0; 205 - 206 - if (ide_use_fast_pio(drive)) 207 - ide_set_max_pio(drive); 208 - 209 - return -1; 210 196 } 211 197 212 198 static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name) ··· 374 386 375 387 hwif->mwdma_mask = 0x07; 376 388 377 - hwif->autodma = 0; 378 - 379 389 hwif->drives[0].autotune = 1; 380 390 hwif->drives[1].autotune = 1; 381 391 382 392 if (!hwif->dma_base) 383 393 return; 384 394 385 - hwif->ide_dma_check = &svwks_config_drive_xfer_rate; 386 395 if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { 387 396 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 388 397 hwif->cbl = ata66_svwks(hwif); 389 398 } 390 - if (!noautodma) 391 - hwif->autodma = 1; 392 - 393 - hwif->drives[0].autodma = hwif->drives[1].autodma = 1; 394 399 } 395 400 396 401 static int __devinit init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d) ··· 471 490 return d->init_setup(dev, d); 472 491 } 473 492 474 - static struct pci_device_id svwks_pci_tbl[] = { 475 - { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 476 - { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 477 - { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 478 - { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 479 - { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 493 + static const struct pci_device_id svwks_pci_tbl[] = { 494 + { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE), 0 }, 495 + { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE), 1 }, 496 + { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE), 2 }, 497 + { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2), 3 }, 498 + { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000IDE), 4 }, 480 499 { 0, }, 481 500 }; 482 501 MODULE_DEVICE_TABLE(pci, svwks_pci_tbl);
+1 -21
drivers/ide/pci/sgiioc4.c
··· 296 296 { 297 297 } 298 298 299 - static int sgiioc4_ide_dma_check(ide_drive_t *drive) 300 - { 301 - if (ide_tune_dma(drive)) 302 - return 0; 303 - 304 - /* 305 - * ->set_pio_mode is not implemented currently 306 - * so this is just for the completness 307 - */ 308 - ide_set_max_pio(drive); 309 - 310 - return -1; 311 - } 312 - 313 299 /* returns 1 if dma irq issued, 0 otherwise */ 314 300 static int 315 301 sgiioc4_ide_dma_test_irq(ide_drive_t * drive) ··· 598 612 hwif->dma_setup = &sgiioc4_ide_dma_setup; 599 613 hwif->dma_start = &sgiioc4_ide_dma_start; 600 614 hwif->ide_dma_end = &sgiioc4_ide_dma_end; 601 - hwif->ide_dma_check = &sgiioc4_ide_dma_check; 602 615 hwif->ide_dma_on = &sgiioc4_ide_dma_on; 603 616 hwif->dma_off_quietly = &sgiioc4_dma_off_quietly; 604 617 hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq; ··· 674 689 /* Initializing chipset IRQ Registers */ 675 690 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); 676 691 677 - hwif->autodma = 0; 678 - 679 - if (dma_base && ide_dma_sgiioc4(hwif, dma_base) == 0) { 680 - hwif->autodma = 1; 681 - hwif->drives[1].autodma = hwif->drives[0].autodma = 1; 682 - } else 692 + if (dma_base == 0 || ide_dma_sgiioc4(hwif, dma_base)) 683 693 printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n", 684 694 hwif->name, DRV_NAME); 685 695
+4 -38
drivers/ide/pci/siimage.c
··· 311 311 } 312 312 } 313 313 314 - /** 315 - * siimage_configure_drive_for_dma - set up for DMA transfers 316 - * @drive: drive we are going to set up 317 - * 318 - * Set up the drive for DMA, tune the controller and drive as 319 - * required. If the drive isn't suitable for DMA or we hit 320 - * other problems then we will drop down to PIO and set up 321 - * PIO appropriately 322 - */ 323 - 324 - static int siimage_config_drive_for_dma (ide_drive_t *drive) 325 - { 326 - if (ide_tune_dma(drive)) 327 - return 0; 328 - 329 - if (ide_use_fast_pio(drive)) 330 - ide_set_max_pio(drive); 331 - 332 - return -1; 333 - } 334 - 335 314 /* returns 1 if dma irq issued, 0 otherwise */ 336 315 static int siimage_io_ide_dma_test_irq (ide_drive_t *drive) 337 316 { ··· 873 894 874 895 static void __devinit init_hwif_siimage(ide_hwif_t *hwif) 875 896 { 876 - hwif->autodma = 0; 877 - 878 897 hwif->resetproc = &siimage_reset; 879 898 hwif->set_pio_mode = &sil_set_pio_mode; 880 899 hwif->set_dma_mode = &sil_set_dma_mode; ··· 902 925 if (!is_sata(hwif)) 903 926 hwif->atapi_dma = 1; 904 927 905 - hwif->ide_dma_check = &siimage_config_drive_for_dma; 906 - 907 928 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 908 929 hwif->cbl = ata66_siimage(hwif); 909 930 ··· 910 935 } else { 911 936 hwif->ide_dma_test_irq = & siimage_io_ide_dma_test_irq; 912 937 } 913 - 914 - /* 915 - * The BIOS often doesn't set up DMA on this controller 916 - * so we always do it. 917 - */ 918 - 919 - hwif->autodma = 1; 920 - hwif->drives[0].autodma = hwif->autodma; 921 - hwif->drives[1].autodma = hwif->autodma; 922 938 } 923 939 924 940 #define DECLARE_SII_DEV(name_str) \ ··· 944 978 return ide_setup_pci_device(dev, &siimage_chipsets[id->driver_data]); 945 979 } 946 980 947 - static struct pci_device_id siimage_pci_tbl[] = { 948 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 981 + static const struct pci_device_id siimage_pci_tbl[] = { 982 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), 0 }, 949 983 #ifdef CONFIG_BLK_DEV_IDE_SATA 950 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 951 - { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_1210SA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 984 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_3112), 1 }, 985 + { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_1210SA), 2 }, 952 986 #endif 953 987 { 0, }, 954 988 };
+114 -392
drivers/ide/pci/sis5513.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/sis5513.c Version 0.27 Jul 14, 2007 2 + * linux/drivers/ide/pci/sis5513.c Version 0.31 Aug 9, 2007 3 3 * 4 4 * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> 5 5 * Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer ··· 64 64 #include <asm/irq.h> 65 65 66 66 #include "ide-timing.h" 67 - 68 - #define DISPLAY_SIS_TIMINGS 69 67 70 68 /* registers layout and init values are chipset family dependant */ 71 69 ··· 191 193 "ATA 133 (1st gen)", "ATA 133 (2nd gen)" 192 194 }; 193 195 194 - #if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_IDE_PROC_FS) 195 - #include <linux/stat.h> 196 - #include <linux/proc_fs.h> 197 - 198 - static u8 sis_proc = 0; 199 - 200 - static struct pci_dev *bmide_dev; 201 - 202 - static char* cable_type[] = { 203 - "80 pins", 204 - "40 pins" 205 - }; 206 - 207 - static char* recovery_time[] ={ 208 - "12 PCICLK", "1 PCICLK", 209 - "2 PCICLK", "3 PCICLK", 210 - "4 PCICLK", "5 PCICLCK", 211 - "6 PCICLK", "7 PCICLCK", 212 - "8 PCICLK", "9 PCICLCK", 213 - "10 PCICLK", "11 PCICLK", 214 - "13 PCICLK", "14 PCICLK", 215 - "15 PCICLK", "15 PCICLK" 216 - }; 217 - 218 - static char* active_time[] = { 219 - "8 PCICLK", "1 PCICLCK", 220 - "2 PCICLK", "3 PCICLK", 221 - "4 PCICLK", "5 PCICLK", 222 - "6 PCICLK", "12 PCICLK" 223 - }; 224 - 225 - static char* cycle_time[] = { 226 - "Reserved", "2 CLK", 227 - "3 CLK", "4 CLK", 228 - "5 CLK", "6 CLK", 229 - "7 CLK", "8 CLK", 230 - "9 CLK", "10 CLK", 231 - "11 CLK", "12 CLK", 232 - "13 CLK", "14 CLK", 233 - "15 CLK", "16 CLK" 234 - }; 235 - 236 - /* Generic add master or slave info function */ 237 - static char* get_drives_info (char *buffer, u8 pos) 238 - { 239 - u8 reg00, reg01, reg10, reg11; /* timing registers */ 240 - u32 regdw0, regdw1; 241 - char* p = buffer; 242 - 243 - /* Postwrite/Prefetch */ 244 - if (chipset_family < ATA_133) { 245 - pci_read_config_byte(bmide_dev, 0x4b, &reg00); 246 - p += sprintf(p, "Drive %d: Postwrite %s \t \t Postwrite %s\n", 247 - pos, (reg00 & (0x10 << pos)) ? "Enabled" : "Disabled", 248 - (reg00 & (0x40 << pos)) ? "Enabled" : "Disabled"); 249 - p += sprintf(p, " Prefetch %s \t \t Prefetch %s\n", 250 - (reg00 & (0x01 << pos)) ? "Enabled" : "Disabled", 251 - (reg00 & (0x04 << pos)) ? "Enabled" : "Disabled"); 252 - pci_read_config_byte(bmide_dev, 0x40+2*pos, &reg00); 253 - pci_read_config_byte(bmide_dev, 0x41+2*pos, &reg01); 254 - pci_read_config_byte(bmide_dev, 0x44+2*pos, &reg10); 255 - pci_read_config_byte(bmide_dev, 0x45+2*pos, &reg11); 256 - } else { 257 - u32 reg54h; 258 - u8 drive_pci = 0x40; 259 - pci_read_config_dword(bmide_dev, 0x54, &reg54h); 260 - if (reg54h & 0x40000000) { 261 - // Configuration space remapped to 0x70 262 - drive_pci = 0x70; 263 - } 264 - pci_read_config_dword(bmide_dev, (unsigned long)drive_pci+4*pos, &regdw0); 265 - pci_read_config_dword(bmide_dev, (unsigned long)drive_pci+4*pos+8, &regdw1); 266 - 267 - p += sprintf(p, "Drive %d:\n", pos); 268 - } 269 - 270 - 271 - /* UDMA */ 272 - if (chipset_family >= ATA_133) { 273 - p += sprintf(p, " UDMA %s \t \t \t UDMA %s\n", 274 - (regdw0 & 0x04) ? "Enabled" : "Disabled", 275 - (regdw1 & 0x04) ? "Enabled" : "Disabled"); 276 - p += sprintf(p, " UDMA Cycle Time %s \t UDMA Cycle Time %s\n", 277 - cycle_time[(regdw0 & 0xF0) >> 4], 278 - cycle_time[(regdw1 & 0xF0) >> 4]); 279 - } else if (chipset_family >= ATA_33) { 280 - p += sprintf(p, " UDMA %s \t \t \t UDMA %s\n", 281 - (reg01 & 0x80) ? "Enabled" : "Disabled", 282 - (reg11 & 0x80) ? "Enabled" : "Disabled"); 283 - 284 - p += sprintf(p, " UDMA Cycle Time "); 285 - switch(chipset_family) { 286 - case ATA_33: p += sprintf(p, cycle_time[(reg01 & 0x60) >> 5]); break; 287 - case ATA_66: 288 - case ATA_100a: p += sprintf(p, cycle_time[(reg01 & 0x70) >> 4]); break; 289 - case ATA_100: 290 - case ATA_133a: p += sprintf(p, cycle_time[reg01 & 0x0F]); break; 291 - default: p += sprintf(p, "?"); break; 292 - } 293 - p += sprintf(p, " \t UDMA Cycle Time "); 294 - switch(chipset_family) { 295 - case ATA_33: p += sprintf(p, cycle_time[(reg11 & 0x60) >> 5]); break; 296 - case ATA_66: 297 - case ATA_100a: p += sprintf(p, cycle_time[(reg11 & 0x70) >> 4]); break; 298 - case ATA_100: 299 - case ATA_133a: p += sprintf(p, cycle_time[reg11 & 0x0F]); break; 300 - default: p += sprintf(p, "?"); break; 301 - } 302 - p += sprintf(p, "\n"); 303 - } 304 - 305 - 306 - if (chipset_family < ATA_133) { /* else case TODO */ 307 - 308 - /* Data Active */ 309 - p += sprintf(p, " Data Active Time "); 310 - switch(chipset_family) { 311 - case ATA_16: /* confirmed */ 312 - case ATA_33: 313 - case ATA_66: 314 - case ATA_100a: p += sprintf(p, active_time[reg01 & 0x07]); break; 315 - case ATA_100: 316 - case ATA_133a: p += sprintf(p, active_time[(reg00 & 0x70) >> 4]); break; 317 - default: p += sprintf(p, "?"); break; 318 - } 319 - p += sprintf(p, " \t Data Active Time "); 320 - switch(chipset_family) { 321 - case ATA_16: 322 - case ATA_33: 323 - case ATA_66: 324 - case ATA_100a: p += sprintf(p, active_time[reg11 & 0x07]); break; 325 - case ATA_100: 326 - case ATA_133a: p += sprintf(p, active_time[(reg10 & 0x70) >> 4]); break; 327 - default: p += sprintf(p, "?"); break; 328 - } 329 - p += sprintf(p, "\n"); 330 - 331 - /* Data Recovery */ 332 - /* warning: may need (reg&0x07) for pre ATA66 chips */ 333 - p += sprintf(p, " Data Recovery Time %s \t Data Recovery Time %s\n", 334 - recovery_time[reg00 & 0x0f], recovery_time[reg10 & 0x0f]); 335 - } 336 - 337 - return p; 338 - } 339 - 340 - static char* get_masters_info(char* buffer) 341 - { 342 - return get_drives_info(buffer, 0); 343 - } 344 - 345 - static char* get_slaves_info(char* buffer) 346 - { 347 - return get_drives_info(buffer, 1); 348 - } 349 - 350 - /* Main get_info, called on /proc/ide/sis reads */ 351 - static int sis_get_info (char *buffer, char **addr, off_t offset, int count) 352 - { 353 - char *p = buffer; 354 - int len; 355 - u8 reg; 356 - u16 reg2, reg3; 357 - 358 - p += sprintf(p, "\nSiS 5513 "); 359 - switch(chipset_family) { 360 - case ATA_16: p += sprintf(p, "DMA 16"); break; 361 - case ATA_33: p += sprintf(p, "Ultra 33"); break; 362 - case ATA_66: p += sprintf(p, "Ultra 66"); break; 363 - case ATA_100a: 364 - case ATA_100: p += sprintf(p, "Ultra 100"); break; 365 - case ATA_133a: 366 - case ATA_133: p += sprintf(p, "Ultra 133"); break; 367 - default: p+= sprintf(p, "Unknown???"); break; 368 - } 369 - p += sprintf(p, " chipset\n"); 370 - p += sprintf(p, "--------------- Primary Channel " 371 - "---------------- Secondary Channel " 372 - "-------------\n"); 373 - 374 - /* Status */ 375 - pci_read_config_byte(bmide_dev, 0x4a, &reg); 376 - if (chipset_family == ATA_133) { 377 - pci_read_config_word(bmide_dev, 0x50, &reg2); 378 - pci_read_config_word(bmide_dev, 0x52, &reg3); 379 - } 380 - p += sprintf(p, "Channel Status: "); 381 - if (chipset_family < ATA_66) { 382 - p += sprintf(p, "%s \t \t \t \t %s\n", 383 - (reg & 0x04) ? "On" : "Off", 384 - (reg & 0x02) ? "On" : "Off"); 385 - } else if (chipset_family < ATA_133) { 386 - p += sprintf(p, "%s \t \t \t \t %s \n", 387 - (reg & 0x02) ? "On" : "Off", 388 - (reg & 0x04) ? "On" : "Off"); 389 - } else { /* ATA_133 */ 390 - p += sprintf(p, "%s \t \t \t \t %s \n", 391 - (reg2 & 0x02) ? "On" : "Off", 392 - (reg3 & 0x02) ? "On" : "Off"); 393 - } 394 - 395 - /* Operation Mode */ 396 - pci_read_config_byte(bmide_dev, 0x09, &reg); 397 - p += sprintf(p, "Operation Mode: %s \t \t \t %s \n", 398 - (reg & 0x01) ? "Native" : "Compatible", 399 - (reg & 0x04) ? "Native" : "Compatible"); 400 - 401 - /* 80-pin cable ? */ 402 - if (chipset_family >= ATA_133) { 403 - p += sprintf(p, "Cable Type: %s \t \t \t %s\n", 404 - (reg2 & 0x01) ? cable_type[1] : cable_type[0], 405 - (reg3 & 0x01) ? cable_type[1] : cable_type[0]); 406 - } else if (chipset_family > ATA_33) { 407 - pci_read_config_byte(bmide_dev, 0x48, &reg); 408 - p += sprintf(p, "Cable Type: %s \t \t \t %s\n", 409 - (reg & 0x10) ? cable_type[1] : cable_type[0], 410 - (reg & 0x20) ? cable_type[1] : cable_type[0]); 411 - } 412 - 413 - /* Prefetch Count */ 414 - if (chipset_family < ATA_133) { 415 - pci_read_config_word(bmide_dev, 0x4c, &reg2); 416 - pci_read_config_word(bmide_dev, 0x4e, &reg3); 417 - p += sprintf(p, "Prefetch Count: %d \t \t \t \t %d\n", 418 - reg2, reg3); 419 - } 420 - 421 - p = get_masters_info(p); 422 - p = get_slaves_info(p); 423 - 424 - len = (p - buffer) - offset; 425 - *addr = buffer + offset; 426 - 427 - return len > count ? count : len; 428 - } 429 - #endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ 430 - 431 196 /* 432 197 * Configuration functions 433 198 */ 434 - /* Enables per-drive prefetch and postwrite */ 199 + 200 + static u8 sis_ata133_get_base(ide_drive_t *drive) 201 + { 202 + struct pci_dev *dev = drive->hwif->pci_dev; 203 + u32 reg54 = 0; 204 + 205 + pci_read_config_dword(dev, 0x54, &reg54); 206 + 207 + return ((reg54 & 0x40000000) ? 0x70 : 0x40) + drive->dn * 4; 208 + } 209 + 210 + static void sis_ata16_program_timings(ide_drive_t *drive, const u8 mode) 211 + { 212 + struct pci_dev *dev = drive->hwif->pci_dev; 213 + u16 t1 = 0; 214 + u8 drive_pci = 0x40 + drive->dn * 2; 215 + 216 + const u16 pio_timings[] = { 0x000, 0x607, 0x404, 0x303, 0x301 }; 217 + const u16 mwdma_timings[] = { 0x008, 0x302, 0x301 }; 218 + 219 + pci_read_config_word(dev, drive_pci, &t1); 220 + 221 + /* clear active/recovery timings */ 222 + t1 &= ~0x070f; 223 + if (mode >= XFER_MW_DMA_0) { 224 + if (chipset_family > ATA_16) 225 + t1 &= ~0x8000; /* disable UDMA */ 226 + t1 |= mwdma_timings[mode - XFER_MW_DMA_0]; 227 + } else 228 + t1 |= pio_timings[mode - XFER_PIO_0]; 229 + 230 + pci_write_config_word(dev, drive_pci, t1); 231 + } 232 + 233 + static void sis_ata100_program_timings(ide_drive_t *drive, const u8 mode) 234 + { 235 + struct pci_dev *dev = drive->hwif->pci_dev; 236 + u8 t1, drive_pci = 0x40 + drive->dn * 2; 237 + 238 + /* timing bits: 7:4 active 3:0 recovery */ 239 + const u8 pio_timings[] = { 0x00, 0x67, 0x44, 0x33, 0x31 }; 240 + const u8 mwdma_timings[] = { 0x08, 0x32, 0x31 }; 241 + 242 + if (mode >= XFER_MW_DMA_0) { 243 + u8 t2 = 0; 244 + 245 + pci_read_config_byte(dev, drive_pci, &t2); 246 + t2 &= ~0x80; /* disable UDMA */ 247 + pci_write_config_byte(dev, drive_pci, t2); 248 + 249 + t1 = mwdma_timings[mode - XFER_MW_DMA_0]; 250 + } else 251 + t1 = pio_timings[mode - XFER_PIO_0]; 252 + 253 + pci_write_config_byte(dev, drive_pci + 1, t1); 254 + } 255 + 256 + static void sis_ata133_program_timings(ide_drive_t *drive, const u8 mode) 257 + { 258 + struct pci_dev *dev = drive->hwif->pci_dev; 259 + u32 t1 = 0; 260 + u8 drive_pci = sis_ata133_get_base(drive), clk, idx; 261 + 262 + pci_read_config_dword(dev, drive_pci, &t1); 263 + 264 + t1 &= 0xc0c00fff; 265 + clk = (t1 & 0x08) ? ATA_133 : ATA_100; 266 + if (mode >= XFER_MW_DMA_0) { 267 + t1 &= ~0x04; /* disable UDMA */ 268 + idx = mode - XFER_MW_DMA_0 + 5; 269 + } 270 + idx = mode - XFER_PIO_0; 271 + t1 |= ini_time_value[clk][idx] << 12; 272 + t1 |= act_time_value[clk][idx] << 16; 273 + t1 |= rco_time_value[clk][idx] << 24; 274 + 275 + pci_write_config_dword(dev, drive_pci, t1); 276 + } 277 + 278 + static void sis_program_timings(ide_drive_t *drive, const u8 mode) 279 + { 280 + if (chipset_family < ATA_100) /* ATA_16/33/66/100a */ 281 + sis_ata16_program_timings(drive, mode); 282 + else if (chipset_family < ATA_133) /* ATA_100/133a */ 283 + sis_ata100_program_timings(drive, mode); 284 + else /* ATA_133 */ 285 + sis_ata133_program_timings(drive, mode); 286 + } 287 + 435 288 static void config_drive_art_rwp (ide_drive_t *drive) 436 289 { 437 290 ide_hwif_t *hwif = HWIF(drive); 438 291 struct pci_dev *dev = hwif->pci_dev; 439 - 440 292 u8 reg4bh = 0; 441 - u8 rw_prefetch = (0x11 << drive->dn); 293 + u8 rw_prefetch = 0; 442 294 443 - if (drive->media != ide_disk) 444 - return; 445 295 pci_read_config_byte(dev, 0x4b, &reg4bh); 446 296 447 - if ((reg4bh & rw_prefetch) != rw_prefetch) 297 + if (drive->media == ide_disk) 298 + rw_prefetch = 0x11 << drive->dn; 299 + 300 + if ((reg4bh & (0x11 << drive->dn)) != rw_prefetch) 448 301 pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch); 449 302 } 450 303 451 - /* Set per-drive active and recovery time */ 452 304 static void sis_set_pio_mode(ide_drive_t *drive, const u8 pio) 453 305 { 454 - ide_hwif_t *hwif = HWIF(drive); 455 - struct pci_dev *dev = hwif->pci_dev; 456 - 457 - u8 drive_pci, test1, test2; 458 - 459 306 config_drive_art_rwp(drive); 460 - 461 - /* In pre ATA_133 case, drives sit at 0x40 + 4*drive->dn */ 462 - drive_pci = 0x40; 463 - /* In SiS962 case drives sit at (0x40 or 0x70) + 8*drive->dn) */ 464 - if (chipset_family >= ATA_133) { 465 - u32 reg54h; 466 - pci_read_config_dword(dev, 0x54, &reg54h); 467 - if (reg54h & 0x40000000) drive_pci = 0x70; 468 - drive_pci += ((drive->dn)*0x4); 469 - } else { 470 - drive_pci += ((drive->dn)*0x2); 471 - } 472 - 473 - /* register layout changed with newer ATA100 chips */ 474 - if (chipset_family < ATA_100) { 475 - pci_read_config_byte(dev, drive_pci, &test1); 476 - pci_read_config_byte(dev, drive_pci+1, &test2); 477 - 478 - /* Clear active and recovery timings */ 479 - test1 &= ~0x0F; 480 - test2 &= ~0x07; 481 - 482 - switch(pio) { 483 - case 4: test1 |= 0x01; test2 |= 0x03; break; 484 - case 3: test1 |= 0x03; test2 |= 0x03; break; 485 - case 2: test1 |= 0x04; test2 |= 0x04; break; 486 - case 1: test1 |= 0x07; test2 |= 0x06; break; 487 - case 0: /* PIO0: register setting == X000 */ 488 - default: break; 489 - } 490 - pci_write_config_byte(dev, drive_pci, test1); 491 - pci_write_config_byte(dev, drive_pci+1, test2); 492 - } else if (chipset_family < ATA_133) { 493 - switch(pio) { /* active recovery 494 - v v */ 495 - case 4: test1 = 0x30|0x01; break; 496 - case 3: test1 = 0x30|0x03; break; 497 - case 2: test1 = 0x40|0x04; break; 498 - case 1: test1 = 0x60|0x07; break; 499 - case 0: test1 = 0x00; break; 500 - default: break; 501 - } 502 - pci_write_config_byte(dev, drive_pci, test1); 503 - } else { /* ATA_133 */ 504 - u32 test3; 505 - pci_read_config_dword(dev, drive_pci, &test3); 506 - test3 &= 0xc0c00fff; 507 - if (test3 & 0x08) { 508 - test3 |= ini_time_value[ATA_133][pio] << 12; 509 - test3 |= act_time_value[ATA_133][pio] << 16; 510 - test3 |= rco_time_value[ATA_133][pio] << 24; 511 - } else { 512 - test3 |= ini_time_value[ATA_100][pio] << 12; 513 - test3 |= act_time_value[ATA_100][pio] << 16; 514 - test3 |= rco_time_value[ATA_100][pio] << 24; 515 - } 516 - pci_write_config_dword(dev, drive_pci, test3); 517 - } 307 + sis_program_timings(drive, XFER_PIO_0 + pio); 518 308 } 519 309 520 310 static void sis_set_dma_mode(ide_drive_t *drive, const u8 speed) 521 311 { 522 312 ide_hwif_t *hwif = HWIF(drive); 523 313 struct pci_dev *dev = hwif->pci_dev; 524 - u32 regdw; 525 - u8 drive_pci, reg; 526 - 527 - /* See sis_set_pio_mode() for drive PCI config registers */ 528 - drive_pci = 0x40; 529 - if (chipset_family >= ATA_133) { 530 - u32 reg54h; 531 - pci_read_config_dword(dev, 0x54, &reg54h); 532 - if (reg54h & 0x40000000) drive_pci = 0x70; 533 - drive_pci += ((drive->dn)*0x4); 534 - pci_read_config_dword(dev, (unsigned long)drive_pci, &regdw); 535 - /* Disable UDMA bit for non UDMA modes on UDMA chips */ 536 - if (speed < XFER_UDMA_0) { 537 - regdw &= 0xfffffffb; 538 - pci_write_config_dword(dev, (unsigned long)drive_pci, regdw); 539 - } 540 - 541 - } else { 542 - drive_pci += ((drive->dn)*0x2); 543 - pci_read_config_byte(dev, drive_pci+1, &reg); 544 - /* Disable UDMA bit for non UDMA modes on UDMA chips */ 545 - if ((speed < XFER_UDMA_0) && (chipset_family > ATA_16)) { 546 - reg &= 0x7F; 547 - pci_write_config_byte(dev, drive_pci+1, reg); 548 - } 549 - } 550 314 551 315 /* Config chip for mode */ 552 316 switch(speed) { ··· 320 560 case XFER_UDMA_1: 321 561 case XFER_UDMA_0: 322 562 if (chipset_family >= ATA_133) { 563 + u32 regdw = 0; 564 + u8 drive_pci = sis_ata133_get_base(drive); 565 + 566 + pci_read_config_dword(dev, drive_pci, &regdw); 323 567 regdw |= 0x04; 324 568 regdw &= 0xfffff00f; 325 569 /* check if ATA133 enable */ ··· 336 572 } 337 573 pci_write_config_dword(dev, (unsigned long)drive_pci, regdw); 338 574 } else { 575 + u8 drive_pci = 0x40 + drive->dn * 2, reg = 0; 576 + 577 + pci_read_config_byte(dev, drive_pci+1, &reg); 339 578 /* Force the UDMA bit on if we want to use UDMA */ 340 579 reg |= 0x80; 341 580 /* clean reg cycle time bits */ ··· 353 586 case XFER_MW_DMA_2: 354 587 case XFER_MW_DMA_1: 355 588 case XFER_MW_DMA_0: 356 - case XFER_SW_DMA_2: 357 - case XFER_SW_DMA_1: 358 - case XFER_SW_DMA_0: 589 + sis_program_timings(drive, speed); 359 590 break; 360 591 default: 361 592 BUG(); ··· 361 596 } 362 597 } 363 598 364 - static int sis5513_config_xfer_rate(ide_drive_t *drive) 365 - { 366 - /* 367 - * TODO: always set PIO mode and remove this 368 - */ 369 - ide_set_max_pio(drive); 370 - 371 - drive->init_speed = 0; 372 - 373 - if (ide_tune_dma(drive)) 374 - return 0; 375 - 376 - if (ide_use_fast_pio(drive)) 377 - ide_set_max_pio(drive); 378 - 379 - return -1; 380 - } 381 - 382 599 static u8 sis5513_ata133_udma_filter(ide_drive_t *drive) 383 600 { 384 601 struct pci_dev *dev = drive->hwif->pci_dev; 385 - int drive_pci; 386 - u32 reg54 = 0, regdw = 0; 602 + u32 regdw = 0; 603 + u8 drive_pci = sis_ata133_get_base(drive); 387 604 388 - pci_read_config_dword(dev, 0x54, &reg54); 389 - drive_pci = ((reg54 & 0x40000000) ? 0x70 : 0x40) + drive->dn * 4; 390 605 pci_read_config_dword(dev, drive_pci, &regdw); 391 606 392 607 /* if ATA133 disable, we should not set speed above UDMA5 */ ··· 512 767 } 513 768 break; 514 769 } 515 - 516 - #if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_IDE_PROC_FS) 517 - if (!sis_proc) { 518 - sis_proc = 1; 519 - bmide_dev = dev; 520 - ide_pci_create_host_proc("sis", sis_get_info); 521 - } 522 - #endif 523 770 } 524 771 525 772 return 0; ··· 564 827 { 565 828 u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; 566 829 567 - hwif->autodma = 0; 568 - 569 830 if (!hwif->irq) 570 831 hwif->irq = hwif->channel ? 15 : 14; 571 832 ··· 573 838 if (chipset_family >= ATA_133) 574 839 hwif->udma_filter = sis5513_ata133_udma_filter; 575 840 576 - if (!(hwif->dma_base)) { 577 - hwif->drives[0].autotune = 1; 578 - hwif->drives[1].autotune = 1; 841 + hwif->drives[0].autotune = 1; 842 + hwif->drives[1].autotune = 1; 843 + 844 + if (hwif->dma_base == 0) 579 845 return; 580 - } 581 846 582 847 hwif->atapi_dma = 1; 583 848 584 849 hwif->ultra_mask = udma_rates[chipset_family]; 585 850 hwif->mwdma_mask = 0x07; 586 - hwif->swdma_mask = 0x07; 587 - 588 - if (!chipset_family) 589 - return; 590 851 591 852 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 592 853 hwif->cbl = ata66_sis5513(hwif); 593 - 594 - if (chipset_family > ATA_16) { 595 - hwif->ide_dma_check = &sis5513_config_xfer_rate; 596 - if (!noautodma) 597 - hwif->autodma = 1; 598 - } 599 - hwif->drives[0].autodma = hwif->autodma; 600 - hwif->drives[1].autodma = hwif->autodma; 601 - return; 602 854 } 603 855 604 856 static ide_pci_device_t sis5513_chipset __devinitdata = { ··· 603 881 return ide_setup_pci_device(dev, &sis5513_chipset); 604 882 } 605 883 606 - static struct pci_device_id sis5513_pci_tbl[] = { 607 - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 608 - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5518, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 609 - { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_1180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 884 + static const struct pci_device_id sis5513_pci_tbl[] = { 885 + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_5513), 0 }, 886 + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_5518), 0 }, 887 + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_1180), 0 }, 610 888 { 0, }, 611 889 }; 612 890 MODULE_DEVICE_TABLE(pci, sis5513_pci_tbl);
+2 -20
drivers/ide/pci/sl82c105.c
··· 145 145 } 146 146 147 147 /* 148 - * Check to see if the drive and chipset are capable of DMA mode. 149 - */ 150 - static int sl82c105_ide_dma_check(ide_drive_t *drive) 151 - { 152 - DBG(("sl82c105_ide_dma_check(drive:%s)\n", drive->name)); 153 - 154 - if (ide_tune_dma(drive)) 155 - return 0; 156 - 157 - return -1; 158 - } 159 - 160 - /* 161 148 * The SL82C105 holds off all IDE interrupts while in DMA mode until 162 149 * all DMA activity is completed. Sometimes this causes problems (eg, 163 150 * when the drive wants to report an error condition). ··· 391 404 hwif->atapi_dma = 1; 392 405 hwif->mwdma_mask = 0x07; 393 406 394 - hwif->ide_dma_check = &sl82c105_ide_dma_check; 395 407 hwif->ide_dma_on = &sl82c105_ide_dma_on; 396 408 hwif->dma_off_quietly = &sl82c105_dma_off_quietly; 397 409 hwif->dma_lost_irq = &sl82c105_dma_lost_irq; 398 410 hwif->dma_start = &sl82c105_dma_start; 399 411 hwif->dma_timeout = &sl82c105_dma_timeout; 400 - 401 - if (!noautodma) 402 - hwif->autodma = 1; 403 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 404 412 405 413 if (hwif->mate) 406 414 hwif->serialized = hwif->mate->serialized = 1; ··· 416 434 return ide_setup_pci_device(dev, &sl82c105_chipset); 417 435 } 418 436 419 - static struct pci_device_id sl82c105_pci_tbl[] = { 420 - { PCI_DEVICE(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105), 0}, 437 + static const struct pci_device_id sl82c105_pci_tbl[] = { 438 + { PCI_VDEVICE(WINBOND, PCI_DEVICE_ID_WINBOND_82C105), 0 }, 421 439 { 0, }, 422 440 }; 423 441 MODULE_DEVICE_TABLE(pci, sl82c105_pci_tbl);
+17 -52
drivers/ide/pci/slc90e66.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/slc90e66.c Version 0.16 Jul 14, 2007 2 + * linux/drivers/ide/pci/slc90e66.c Version 0.18 Aug 9, 2007 3 3 * 4 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 5 5 * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> ··· 20 20 #include <linux/init.h> 21 21 22 22 #include <asm/io.h> 23 - 24 - static u8 slc90e66_dma_2_pio (u8 xfer_rate) { 25 - switch(xfer_rate) { 26 - case XFER_UDMA_4: 27 - case XFER_UDMA_3: 28 - case XFER_UDMA_2: 29 - case XFER_UDMA_1: 30 - case XFER_UDMA_0: 31 - case XFER_MW_DMA_2: 32 - return 4; 33 - case XFER_MW_DMA_1: 34 - return 3; 35 - case XFER_SW_DMA_2: 36 - return 2; 37 - case XFER_MW_DMA_0: 38 - case XFER_SW_DMA_1: 39 - case XFER_SW_DMA_0: 40 - default: 41 - return 0; 42 - } 43 - } 44 23 45 24 static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio) 46 25 { ··· 111 132 pci_write_config_word(dev, 0x4a, reg4a|u_speed); 112 133 } 113 134 } else { 135 + const u8 mwdma_to_pio[] = { 0, 3, 4 }; 136 + u8 pio; 137 + 114 138 if (reg48 & u_flag) 115 139 pci_write_config_word(dev, 0x48, reg48 & ~u_flag); 116 140 if (reg4a & a_speed) 117 141 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); 142 + 143 + if (speed >= XFER_MW_DMA_0) 144 + pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 145 + else 146 + pio = 2; /* only SWDMA2 is allowed */ 147 + 148 + slc90e66_set_pio_mode(drive, pio); 118 149 } 119 - 120 - slc90e66_set_pio_mode(drive, slc90e66_dma_2_pio(speed)); 121 - } 122 - 123 - static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) 124 - { 125 - drive->init_speed = 0; 126 - 127 - if (ide_tune_dma(drive)) 128 - return 0; 129 - 130 - if (ide_use_fast_pio(drive)) 131 - ide_set_max_pio(drive); 132 - 133 - return -1; 134 150 } 135 151 136 152 static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) 137 153 { 138 154 u8 reg47 = 0; 139 155 u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ 140 - 141 - hwif->autodma = 0; 142 156 143 157 if (!hwif->irq) 144 158 hwif->irq = hwif->channel ? 15 : 14; ··· 141 169 142 170 pci_read_config_byte(hwif->pci_dev, 0x47, &reg47); 143 171 144 - if (!hwif->dma_base) { 145 - hwif->drives[0].autotune = 1; 146 - hwif->drives[1].autotune = 1; 172 + hwif->drives[0].autotune = 1; 173 + hwif->drives[1].autotune = 1; 174 + 175 + if (hwif->dma_base == 0) 147 176 return; 148 - } 149 177 150 178 hwif->atapi_dma = 1; 151 179 hwif->ultra_mask = 0x1f; ··· 155 183 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 156 184 /* bit[0(1)]: 0:80, 1:40 */ 157 185 hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 158 - 159 - hwif->ide_dma_check = &slc90e66_config_drive_xfer_rate; 160 - 161 - if (!noautodma) 162 - hwif->autodma = 1; 163 - hwif->drives[0].autodma = hwif->autodma; 164 - hwif->drives[1].autodma = hwif->autodma; 165 186 } 166 187 167 188 static ide_pci_device_t slc90e66_chipset __devinitdata = { ··· 171 206 return ide_setup_pci_device(dev, &slc90e66_chipset); 172 207 } 173 208 174 - static struct pci_device_id slc90e66_pci_tbl[] = { 175 - { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1), 0}, 209 + static const struct pci_device_id slc90e66_pci_tbl[] = { 210 + { PCI_VDEVICE(EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1), 0 }, 176 211 { 0, }, 177 212 }; 178 213 MODULE_DEVICE_TABLE(pci, slc90e66_pci_tbl);
+2 -19
drivers/ide/pci/tc86c001.c
··· 162 162 return 0; 163 163 } 164 164 165 - static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive) 166 - { 167 - if (ide_tune_dma(drive)) 168 - return 0; 169 - 170 - if (ide_use_fast_pio(drive)) 171 - ide_set_max_pio(drive); 172 - 173 - return -1; 174 - } 175 - 176 165 static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) 177 166 { 178 167 unsigned long sc_base = pci_resource_start(hwif->pci_dev, 5); ··· 202 213 hwif->ultra_mask = 0x1f; 203 214 hwif->mwdma_mask = 0x07; 204 215 205 - hwif->ide_dma_check = &tc86c001_config_drive_xfer_rate; 206 216 hwif->dma_start = &tc86c001_dma_start; 207 217 208 218 if (hwif->cbl != ATA_CBL_PATA40_SHORT) { ··· 212 224 scr1 = hwif->INW(sc_base + 0x00); 213 225 hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 214 226 } 215 - 216 - if (!noautodma) 217 - hwif->autodma = 1; 218 - hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; 219 227 } 220 228 221 229 static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev, ··· 240 256 return ide_setup_pci_device(dev, &tc86c001_chipset); 241 257 } 242 258 243 - static struct pci_device_id tc86c001_pci_tbl[] = { 244 - { PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE, 245 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 259 + static const struct pci_device_id tc86c001_pci_tbl[] = { 260 + { PCI_VDEVICE(TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE), 0 }, 246 261 { 0, } 247 262 }; 248 263 MODULE_DEVICE_TABLE(pci, tc86c001_pci_tbl);
+2 -19
drivers/ide/pci/triflex.c
··· 96 96 triflex_set_mode(drive, XFER_PIO_0 + pio); 97 97 } 98 98 99 - static int triflex_config_drive_xfer_rate(ide_drive_t *drive) 100 - { 101 - if (ide_tune_dma(drive)) 102 - return 0; 103 - 104 - ide_set_max_pio(drive); 105 - 106 - return -1; 107 - } 108 - 109 99 static void __devinit init_hwif_triflex(ide_hwif_t *hwif) 110 100 { 111 101 hwif->set_pio_mode = &triflex_set_pio_mode; ··· 107 117 hwif->atapi_dma = 1; 108 118 hwif->mwdma_mask = 0x07; 109 119 hwif->swdma_mask = 0x07; 110 - hwif->ide_dma_check = &triflex_config_drive_xfer_rate; 111 - 112 - if (!noautodma) 113 - hwif->autodma = 1; 114 - hwif->drives[0].autodma = hwif->autodma; 115 - hwif->drives[1].autodma = hwif->autodma; 116 120 } 117 121 118 122 static ide_pci_device_t triflex_device __devinitdata = { ··· 124 140 return ide_setup_pci_device(dev, &triflex_device); 125 141 } 126 142 127 - static struct pci_device_id triflex_pci_tbl[] = { 128 - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE, 129 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 143 + static const struct pci_device_id triflex_pci_tbl[] = { 144 + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE), 0 }, 130 145 { 0, }, 131 146 }; 132 147 MODULE_DEVICE_TABLE(pci, triflex_pci_tbl);
+5 -5
drivers/ide/pci/trm290.c
··· 292 292 hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; 293 293 294 294 hwif->selectproc = &trm290_selectproc; 295 - hwif->autodma = 0; /* play it safe for now */ 296 - hwif->drives[0].autodma = hwif->autodma; 297 - hwif->drives[1].autodma = hwif->autodma; 298 295 #if 1 299 296 { 300 297 /* ··· 326 329 .init_hwif = init_hwif_trm290, 327 330 .autodma = NOAUTODMA, 328 331 .bootable = ON_BOARD, 332 + #if 0 /* play it safe for now */ 333 + .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 334 + #endif 329 335 }; 330 336 331 337 static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id) ··· 336 336 return ide_setup_pci_device(dev, &trm290_chipset); 337 337 } 338 338 339 - static struct pci_device_id trm290_pci_tbl[] = { 340 - { PCI_VENDOR_ID_TEKRAM, PCI_DEVICE_ID_TEKRAM_DC290, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 339 + static const struct pci_device_id trm290_pci_tbl[] = { 340 + { PCI_VDEVICE(TEKRAM, PCI_DEVICE_ID_TEKRAM_DC290), 0 }, 341 341 { 0, }, 342 342 }; 343 343 MODULE_DEVICE_TABLE(pci, trm290_pci_tbl);
+5 -32
drivers/ide/pci/via82cxxx.c
··· 197 197 via_set_drive(drive, XFER_PIO_0 + pio); 198 198 } 199 199 200 - /** 201 - * via82cxxx_ide_dma_check - set up for DMA if possible 202 - * @drive: IDE drive to set up 203 - * 204 - * Set up the drive for the highest supported speed considering the 205 - * driver, controller and cable 206 - */ 207 - 208 - static int via82cxxx_ide_dma_check (ide_drive_t *drive) 209 - { 210 - if (ide_tune_dma(drive)) 211 - return 0; 212 - 213 - ide_set_max_pio(drive); 214 - 215 - return -1; 216 - } 217 - 218 200 static struct via_isa_bridge *via_config_find(struct pci_dev **isa) 219 201 { 220 202 struct via_isa_bridge *via_config; ··· 425 443 struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); 426 444 int i; 427 445 428 - hwif->autodma = 0; 429 - 430 446 hwif->set_pio_mode = &via_set_pio_mode; 431 447 hwif->set_dma_mode = &via_set_drive; 432 448 ··· 438 458 hwif->drives[i].io_32bit = 1; 439 459 hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1; 440 460 hwif->drives[i].autotune = 1; 441 - hwif->drives[i].dn = hwif->channel * 2 + i; 442 461 } 443 462 444 463 if (!hwif->dma_base) ··· 451 472 452 473 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 453 474 hwif->cbl = via82cxxx_cable_detect(hwif); 454 - 455 - hwif->ide_dma_check = &via82cxxx_ide_dma_check; 456 - if (!noautodma) 457 - hwif->autodma = 1; 458 - hwif->drives[0].autodma = hwif->autodma; 459 - hwif->drives[1].autodma = hwif->autodma; 460 475 } 461 476 462 477 static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { ··· 495 522 return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]); 496 523 } 497 524 498 - static struct pci_device_id via_pci_tbl[] = { 499 - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 500 - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 501 - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 502 - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_SATA_EIDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 525 + static const struct pci_device_id via_pci_tbl[] = { 526 + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), 0 }, 527 + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C586_1), 0 }, 528 + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_6410), 1 }, 529 + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_SATA_EIDE), 1 }, 503 530 { 0, }, 504 531 }; 505 532 MODULE_DEVICE_TABLE(pci, via_pci_tbl);
+6 -28
drivers/ide/ppc/pmac.c
··· 1421 1421 .resume = pmac_ide_macio_resume, 1422 1422 }; 1423 1423 1424 - static struct pci_device_id pmac_ide_pci_match[] = { 1425 - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA, 1426 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1427 - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, 1428 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1429 - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, 1430 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1431 - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA, 1432 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1433 - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID2_ATA, 1434 - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 1424 + static const struct pci_device_id pmac_ide_pci_match[] = { 1425 + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA), 0 }, 1426 + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100), 0 }, 1427 + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100), 0 }, 1428 + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_SH_ATA), 0 }, 1429 + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_IPID2_ATA), 0 }, 1435 1430 {}, 1436 1431 }; 1437 1432 ··· 1571 1576 pci_unmap_sg(dev, sg, nents, hwif->sg_dma_direction); 1572 1577 hwif->sg_nents = 0; 1573 1578 } 1574 - } 1575 - 1576 - /* 1577 - * Check what is the best DMA timing setting for the drive and 1578 - * call appropriate functions to apply it. 1579 - */ 1580 - static int 1581 - pmac_ide_dma_check(ide_drive_t *drive) 1582 - { 1583 - if (ide_tune_dma(drive)) 1584 - return 0; 1585 - 1586 - return -1; 1587 1579 } 1588 1580 1589 1581 /* ··· 1770 1788 1771 1789 hwif->dma_off_quietly = &ide_dma_off_quietly; 1772 1790 hwif->ide_dma_on = &__ide_dma_on; 1773 - hwif->ide_dma_check = &pmac_ide_dma_check; 1774 1791 hwif->dma_setup = &pmac_ide_dma_setup; 1775 1792 hwif->dma_exec_cmd = &pmac_ide_dma_exec_cmd; 1776 1793 hwif->dma_start = &pmac_ide_dma_start; ··· 1804 1823 hwif->swdma_mask = 0x00; 1805 1824 break; 1806 1825 } 1807 - 1808 - hwif->autodma = 1; 1809 - hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma; 1810 1826 } 1811 1827 1812 1828 #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
+3 -45
drivers/ide/setup-pci.c
··· 145 145 } 146 146 147 147 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI 148 - 149 - #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED 150 - /* 151 - * Long lost data from 2.0.34 that is now in 2.0.39 152 - * 153 - * This was used in ./drivers/block/triton.c to do DMA Base address setup 154 - * when PnP failed. Oh the things we forget. I believe this was part 155 - * of SFF-8038i that has been withdrawn from public access... :-(( 156 - */ 157 - #define DEFAULT_BMIBA 0xe800 /* in case BIOS did not init it */ 158 - #define DEFAULT_BMCRBA 0xcc00 /* VIA's default value */ 159 - #define DEFAULT_BMALIBA 0xd400 /* ALI's default value */ 160 - #endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ 161 - 162 148 /** 163 149 * ide_get_or_set_dma_base - setup BMIBA 164 150 * @hwif: Interface 165 151 * 166 - * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space: 167 - * If need be we set up the DMA base. Where a device has a partner that 168 - * is already in DMA mode we check and enforce IDE simplex rules. 152 + * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space. 153 + * Where a device has a partner that is already in DMA mode we check 154 + * and enforce IDE simplex rules. 169 155 */ 170 156 171 157 static unsigned long ide_get_or_set_dma_base (ide_hwif_t *hwif) 172 158 { 173 159 unsigned long dma_base = 0; 174 160 struct pci_dev *dev = hwif->pci_dev; 175 - 176 - #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED 177 - int second_chance = 0; 178 - 179 - second_chance_to_dma: 180 - #endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ 181 161 182 162 if (hwif->mmio) 183 163 return hwif->dma_base; ··· 171 191 hwif->cds->name); 172 192 } 173 193 } 174 - 175 - #ifdef CONFIG_BLK_DEV_IDEDMA_FORCED 176 - /* FIXME - should use pci_assign_resource surely */ 177 - if ((!dma_base) && (!second_chance)) { 178 - unsigned long set_bmiba = 0; 179 - second_chance++; 180 - switch(dev->vendor) { 181 - case PCI_VENDOR_ID_AL: 182 - set_bmiba = DEFAULT_BMALIBA; break; 183 - case PCI_VENDOR_ID_VIA: 184 - set_bmiba = DEFAULT_BMCRBA; break; 185 - case PCI_VENDOR_ID_INTEL: 186 - set_bmiba = DEFAULT_BMIBA; break; 187 - default: 188 - return dma_base; 189 - } 190 - pci_write_config_dword(dev, 0x20, set_bmiba|1); 191 - goto second_chance_to_dma; 192 - } 193 - #endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ 194 194 195 195 if (dma_base) { 196 196 u8 simplex_stat = 0; ··· 438 478 * Set up BM-DMA capability 439 479 * (PnP BIOS should have done this) 440 480 */ 441 - /* default DMA off if we had to configure it here */ 442 - hwif->autodma = 0; 443 481 pci_set_master(dev); 444 482 if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) || !(pcicmd & PCI_COMMAND_MASTER)) { 445 483 printk(KERN_ERR "%s: %s error updating PCICMD\n",
+5 -6
include/linux/ide.h
··· 576 576 select_t select; /* basic drive/head select reg value */ 577 577 578 578 u8 keep_settings; /* restore settings after drive reset */ 579 - u8 autodma; /* device can safely use dma on host */ 580 579 u8 using_dma; /* disk is using dma for read/write */ 581 580 u8 retry_pio; /* retrying dma capable host in pio */ 582 581 u8 state; /* retry state */ ··· 599 600 unsigned nice0 : 1; /* give obvious excess bandwidth */ 600 601 unsigned nice2 : 1; /* give a share in our own bandwidth */ 601 602 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ 603 + unsigned nodma : 1; /* disallow DMA */ 602 604 unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */ 603 605 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ 604 606 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ ··· 736 736 void (*dma_exec_cmd)(ide_drive_t *, u8); 737 737 void (*dma_start)(ide_drive_t *); 738 738 int (*ide_dma_end)(ide_drive_t *drive); 739 - int (*ide_dma_check)(ide_drive_t *drive); 740 739 int (*ide_dma_on)(ide_drive_t *drive); 741 740 void (*dma_off_quietly)(ide_drive_t *drive); 742 741 int (*ide_dma_test_irq)(ide_drive_t *drive); ··· 797 798 unsigned serialized : 1; /* serialized all channel operation */ 798 799 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ 799 800 unsigned reset : 1; /* reset after probe */ 800 - unsigned autodma : 1; /* auto-attempt using DMA at boot */ 801 801 unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ 802 802 unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ 803 803 unsigned auto_poll : 1; /* supports nop auto-poll */ ··· 1254 1256 IDE_HFLAG_POST_SET_MODE = (1 << 8), 1255 1257 /* don't program host/device for the transfer mode ("smart" hosts) */ 1256 1258 IDE_HFLAG_NO_SET_MODE = (1 << 9), 1259 + /* trust BIOS for programming chipset/device for DMA */ 1260 + IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10), 1261 + /* host uses VDMA */ 1262 + IDE_HFLAG_VDMA = (1 << 11), 1257 1263 }; 1258 1264 1259 1265 typedef struct ide_pci_device_s { ··· 1305 1303 return ide_find_dma_mode(drive, XFER_UDMA_6); 1306 1304 } 1307 1305 1308 - int ide_tune_dma(ide_drive_t *); 1309 1306 void ide_dma_off(ide_drive_t *); 1310 1307 void ide_dma_verbose(ide_drive_t *); 1311 1308 int ide_set_dma(ide_drive_t *); ··· 1331 1330 #else 1332 1331 static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } 1333 1332 static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1334 - static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } 1335 1333 static inline void ide_dma_off(ide_drive_t *drive) { ; } 1336 1334 static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1337 1335 static inline int ide_set_dma(ide_drive_t *drive) { return 1; } ··· 1380 1380 extern char *ide_xfer_verbose(u8 xfer_rate); 1381 1381 extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1382 1382 extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1383 - int ide_use_fast_pio(ide_drive_t *); 1384 1383 1385 1384 static inline int ide_dev_has_iordy(struct hd_driveid *id) 1386 1385 {