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:
ide: make legacy IDE VLB modules check for the "probe" kernel params (v2)
ide: remove some obsoleted kernel params (v2)
ide/pci/delkin_cb.c: pci_module_init to pci_register_driver
scc_pata: bugfix for checking DMA IRQ status
ide: remove a ton of pointless #undef REALLY_SLOW_IO
siimage: DRAC4 note
adjust legacy IDE resource setting (v2)
ide: fix pmac breakage
ide-cs: Update device table
ide: ide_get_best_pio_mode() returns incorrect IORDY setting (take 2)
piix/slc90e66: more tuneproc() fixing (take 2)
ide: fix drive side 80c cable check, take 2
cmd64x: fix PIO mode setup (take 3)
alim15x3: fix PIO mode setup

+306 -224
+12 -17
Documentation/ide.txt
··· 232 233 "hdx=remap63" : remap the drive: add 63 to all sector numbers 234 (for DM OnTrack) 235 - 236 "hdx=autotune" : driver will attempt to tune interface speed 237 to the fastest PIO mode supported, 238 if possible for this drive only. ··· 269 "idex=base,ctl" : specify both base and ctl 270 271 "idex=base,ctl,irq" : specify base, ctl, and irq number 272 - 273 - "idex=autotune" : driver will attempt to tune interface speed 274 - to the fastest PIO mode supported, 275 - for all drives on this interface. 276 - Not fully supported by all chipset types, 277 - and quite likely to cause trouble with 278 - older/odd IDE drives. 279 - 280 - "idex=noautotune" : driver will NOT attempt to tune interface speed 281 - This is the default for most chipsets, 282 - except the cmd640. 283 284 "idex=serialize" : do not overlap operations on idex. Please note 285 that you will have to specify this option for ··· 294 to the first ATA interface found on the particular host, and the defaults for 295 the base,ctl ports must not be altered. 296 297 - "ide0=dtc2278" : probe/support DTC2278 interface 298 - "ide0=ht6560b" : probe/support HT6560B interface 299 "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip 300 (not for PCI -- automatically detected) 301 - "ide0=qd65xx" : probe/support qd65xx interface 302 - "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1443/M1445) 303 - "ide0=umc8672" : probe/support umc8672 chipsets 304 305 "ide=doubler" : probe/support IDE doublers on Amiga 306 307 There may be more options than shown -- use the source, Luke! 308 309 Everything else is rejected with a "BAD OPTION" message. 310 311 ================================================================================ 312
··· 232 233 "hdx=remap63" : remap the drive: add 63 to all sector numbers 234 (for DM OnTrack) 235 + 236 + "idex=noautotune" : driver will NOT attempt to tune interface speed 237 + 238 "hdx=autotune" : driver will attempt to tune interface speed 239 to the fastest PIO mode supported, 240 if possible for this drive only. ··· 267 "idex=base,ctl" : specify both base and ctl 268 269 "idex=base,ctl,irq" : specify base, ctl, and irq number 270 271 "idex=serialize" : do not overlap operations on idex. Please note 272 that you will have to specify this option for ··· 303 to the first ATA interface found on the particular host, and the defaults for 304 the base,ctl ports must not be altered. 305 306 "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip 307 (not for PCI -- automatically detected) 308 309 "ide=doubler" : probe/support IDE doublers on Amiga 310 311 There may be more options than shown -- use the source, Luke! 312 313 Everything else is rejected with a "BAD OPTION" message. 314 + 315 + For legacy IDE VLB host drivers (ali14xx/dtc2278/ht6560b/qd65xx/umc8672) 316 + you need to explicitly enable probing by using "probe" kernel parameter, 317 + i.e. to enable probing for ALI M14xx chipsets (ali14xx host driver) use: 318 + 319 + * "ali14xx.probe" boot option when ali14xx driver is built-in the kernel 320 + 321 + * "probe" module parameter when ali14xx driver is compiled as module 322 + ("modprobe ali14xx probe") 323 324 ================================================================================ 325
+5 -5
drivers/ide/Kconfig
··· 1023 config BLK_DEV_ALI14XX 1024 tristate "ALI M14xx support" 1025 help 1026 - This driver is enabled at runtime using the "ide0=ali14xx" kernel 1027 boot parameter. It enables support for the secondary IDE interface 1028 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster 1029 I/O speeds to be set as well. See the files ··· 1033 config BLK_DEV_DTC2278 1034 tristate "DTC-2278 support" 1035 help 1036 - This driver is enabled at runtime using the "ide0=dtc2278" kernel 1037 boot parameter. It enables support for the secondary IDE interface 1038 of the DTC-2278 card, and permits faster I/O speeds to be set as 1039 well. See the <file:Documentation/ide.txt> and ··· 1042 config BLK_DEV_HT6560B 1043 tristate "Holtek HT6560B support" 1044 help 1045 - This driver is enabled at runtime using the "ide0=ht6560b" kernel 1046 boot parameter. It enables support for the secondary IDE interface 1047 of the Holtek card, and permits faster I/O speeds to be set as well. 1048 See the <file:Documentation/ide.txt> and ··· 1051 config BLK_DEV_QD65XX 1052 tristate "QDI QD65xx support" 1053 help 1054 - This driver is enabled at runtime using the "ide0=qd65xx" kernel 1055 boot parameter. It permits faster I/O speeds to be set. See the 1056 <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> for 1057 more info. ··· 1059 config BLK_DEV_UMC8672 1060 tristate "UMC-8672 support" 1061 help 1062 - This driver is enabled at runtime using the "ide0=umc8672" kernel 1063 boot parameter. It enables support for the secondary IDE interface 1064 of the UMC-8672, and permits faster I/O speeds to be set as well. 1065 See the files <file:Documentation/ide.txt> and
··· 1023 config BLK_DEV_ALI14XX 1024 tristate "ALI M14xx support" 1025 help 1026 + This driver is enabled at runtime using the "ali14xx.probe" kernel 1027 boot parameter. It enables support for the secondary IDE interface 1028 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster 1029 I/O speeds to be set as well. See the files ··· 1033 config BLK_DEV_DTC2278 1034 tristate "DTC-2278 support" 1035 help 1036 + This driver is enabled at runtime using the "dtc2278.probe" kernel 1037 boot parameter. It enables support for the secondary IDE interface 1038 of the DTC-2278 card, and permits faster I/O speeds to be set as 1039 well. See the <file:Documentation/ide.txt> and ··· 1042 config BLK_DEV_HT6560B 1043 tristate "Holtek HT6560B support" 1044 help 1045 + This driver is enabled at runtime using the "ht6560b.probe" kernel 1046 boot parameter. It enables support for the secondary IDE interface 1047 of the Holtek card, and permits faster I/O speeds to be set as well. 1048 See the <file:Documentation/ide.txt> and ··· 1051 config BLK_DEV_QD65XX 1052 tristate "QDI QD65xx support" 1053 help 1054 + This driver is enabled at runtime using the "qd65xx.probe" kernel 1055 boot parameter. It permits faster I/O speeds to be set. See the 1056 <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> for 1057 more info. ··· 1059 config BLK_DEV_UMC8672 1060 tristate "UMC-8672 support" 1061 help 1062 + This driver is enabled at runtime using the "umc8672.probe" kernel 1063 boot parameter. It enables support for the secondary IDE interface 1064 of the UMC-8672, and permits faster I/O speeds to be set as well. 1065 See the files <file:Documentation/ide.txt> and
-2
drivers/ide/cris/ide-cris.c
··· 17 * device can't do DMA handshaking for some stupid reason. We don't need to do that. 18 */ 19 20 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 21 - 22 #include <linux/types.h> 23 #include <linux/kernel.h> 24 #include <linux/timer.h>
··· 17 * device can't do DMA handshaking for some stupid reason. We don't need to do that. 18 */ 19 20 #include <linux/types.h> 21 #include <linux/kernel.h> 22 #include <linux/timer.h>
-2
drivers/ide/ide-disk.c
··· 43 44 #define IDEDISK_VERSION "1.18" 45 46 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 47 - 48 //#define DEBUG 49 50 #include <linux/module.h>
··· 43 44 #define IDEDISK_VERSION "1.18" 45 46 //#define DEBUG 47 48 #include <linux/module.h>
+2
drivers/ide/ide-iops.c
··· 583 if(!(drive->id->hw_config & 0x4000)) 584 return 0; 585 #endif /* CONFIG_IDEDMA_IVB */ 586 return 1; 587 } 588
··· 583 if(!(drive->id->hw_config & 0x4000)) 584 return 0; 585 #endif /* CONFIG_IDEDMA_IVB */ 586 + if (!(drive->id->hw_config & 0x2000)) 587 + return 0; 588 return 1; 589 } 590
+6 -12
drivers/ide/ide-lib.c
··· 345 346 /** 347 * ide_get_best_pio_mode - get PIO mode from drive 348 - * @driver: drive to consider 349 * @mode_wanted: preferred mode 350 - * @max_mode: highest allowed 351 - * @d: pio data 352 * 353 * This routine returns the recommended PIO settings for a given drive, 354 * based on the drive->id information and the ide_pio_blacklist[]. 355 - * This is used by most chipset support modules when "auto-tuning". 356 * 357 - * Drive PIO mode auto selection 358 */ 359 360 u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d) ··· 367 368 if (mode_wanted != 255) { 369 pio_mode = mode_wanted; 370 } else if (!drive->id) { 371 pio_mode = 0; 372 } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { ··· 397 } 398 } 399 400 - #if 0 401 - if (drive->id->major_rev_num & 0x0004) printk("ATA-2 "); 402 - #endif 403 - 404 /* 405 * Conservative "downgrade" for all pre-ATA2 drives 406 */ 407 if (pio_mode && pio_mode < 4) { 408 pio_mode--; 409 overridden = 1; 410 - #if 0 411 - use_iordy = (pio_mode > 2); 412 - #endif 413 if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time) 414 cycle_time = 0; /* use standard timing */ 415 }
··· 345 346 /** 347 * ide_get_best_pio_mode - get PIO mode from drive 348 + * @drive: drive to consider 349 * @mode_wanted: preferred mode 350 + * @max_mode: highest allowed mode 351 + * @d: PIO data 352 * 353 * This routine returns the recommended PIO settings for a given drive, 354 * based on the drive->id information and the ide_pio_blacklist[]. 355 * 356 + * Drive PIO mode is auto-selected if 255 is passed as mode_wanted. 357 + * This is used by most chipset support modules when "auto-tuning". 358 */ 359 360 u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d) ··· 367 368 if (mode_wanted != 255) { 369 pio_mode = mode_wanted; 370 + use_iordy = (pio_mode > 2); 371 } else if (!drive->id) { 372 pio_mode = 0; 373 } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { ··· 396 } 397 } 398 399 /* 400 * Conservative "downgrade" for all pre-ATA2 drives 401 */ 402 if (pio_mode && pio_mode < 4) { 403 pio_mode--; 404 overridden = 1; 405 if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time) 406 cycle_time = 0; /* use standard timing */ 407 }
-2
drivers/ide/ide-probe.c
··· 31 * valid after probe time even with noprobe 32 */ 33 34 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 35 - 36 #include <linux/module.h> 37 #include <linux/types.h> 38 #include <linux/string.h>
··· 31 * valid after probe time even with noprobe 32 */ 33 34 #include <linux/module.h> 35 #include <linux/types.h> 36 #include <linux/string.h>
+15 -24
drivers/ide/ide.c
··· 126 #define REVISION "Revision: 7.00alpha2" 127 #define VERSION "Id: ide.c 7.00a2 20020906" 128 129 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 130 - 131 #define _IDE_C /* Tell ide.h it's really us */ 132 133 #include <linux/module.h> ··· 1484 } 1485 1486 #ifdef CONFIG_BLK_DEV_ALI14XX 1487 - static int __initdata probe_ali14xx; 1488 extern int ali14xx_init(void); 1489 #endif 1490 #ifdef CONFIG_BLK_DEV_UMC8672 1491 - static int __initdata probe_umc8672; 1492 extern int umc8672_init(void); 1493 #endif 1494 #ifdef CONFIG_BLK_DEV_DTC2278 1495 - static int __initdata probe_dtc2278; 1496 extern int dtc2278_init(void); 1497 #endif 1498 #ifdef CONFIG_BLK_DEV_HT6560B 1499 - static int __initdata probe_ht6560b; 1500 extern int ht6560b_init(void); 1501 #endif 1502 #ifdef CONFIG_BLK_DEV_QD65XX 1503 - static int __initdata probe_qd65xx; 1504 extern int qd65xx_init(void); 1505 #endif 1506 ··· 1578 */ 1579 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { 1580 const char *hd_words[] = { 1581 - "none", "noprobe", "nowerr", "cdrom", "serialize", 1582 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1583 "noflush", "remap", "remap63", "scsi", NULL }; 1584 unit = s[2] - 'a'; ··· 1606 drive->ready_stat = 0; 1607 hwif->noprobe = 0; 1608 goto done; 1609 - case -5: /* "serialize" */ 1610 - printk(" -- USE \"ide%d=serialize\" INSTEAD", hw); 1611 - goto do_serialize; 1612 case -6: /* "autotune" */ 1613 drive->autotune = IDE_TUNE_AUTO; 1614 goto obsolete_option; ··· 1666 * (-8, -9, -10) are reserved to ease the hardcoding. 1667 */ 1668 static const char *ide_words[] = { 1669 - "noprobe", "serialize", "autotune", "noautotune", 1670 "reset", "dma", "ata66", "minus8", "minus9", 1671 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", 1672 "dtc2278", "umc8672", "ali14xx", NULL }; ··· 1737 hwif->chipset = mate->chipset = ide_4drives; 1738 mate->irq = hwif->irq; 1739 memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); 1740 - goto do_serialize; 1741 } 1742 #endif /* CONFIG_BLK_DEV_4DRIVES */ 1743 case -10: /* minus10 */ 1744 case -9: /* minus9 */ 1745 case -8: /* minus8 */ 1746 goto bad_option; 1747 case -7: /* ata66 */ 1748 #ifdef CONFIG_BLK_DEV_IDEPCI ··· 1762 case -5: /* "reset" */ 1763 hwif->reset = 1; 1764 goto obsolete_option; 1765 - case -4: /* "noautotune" */ 1766 - hwif->drives[0].autotune = IDE_TUNE_NOAUTO; 1767 - hwif->drives[1].autotune = IDE_TUNE_NOAUTO; 1768 - goto obsolete_option; 1769 - case -3: /* "autotune" */ 1770 - hwif->drives[0].autotune = IDE_TUNE_AUTO; 1771 - hwif->drives[1].autotune = IDE_TUNE_AUTO; 1772 - goto obsolete_option; 1773 case -2: /* "serialize" */ 1774 - do_serialize: 1775 hwif->mate = &ide_hwifs[hw^1]; 1776 hwif->mate->mate = hwif; 1777 hwif->serialized = hwif->mate->serialized = 1; ··· 1831 #endif /* CONFIG_BLK_DEV_CMD640 */ 1832 #ifdef CONFIG_BLK_DEV_IDE_PMAC 1833 { 1834 - extern void pmac_ide_probe(void); 1835 - pmac_ide_probe(); 1836 } 1837 #endif /* CONFIG_BLK_DEV_IDE_PMAC */ 1838 #ifdef CONFIG_BLK_DEV_GAYLE
··· 126 #define REVISION "Revision: 7.00alpha2" 127 #define VERSION "Id: ide.c 7.00a2 20020906" 128 129 #define _IDE_C /* Tell ide.h it's really us */ 130 131 #include <linux/module.h> ··· 1486 } 1487 1488 #ifdef CONFIG_BLK_DEV_ALI14XX 1489 + extern int probe_ali14xx; 1490 extern int ali14xx_init(void); 1491 #endif 1492 #ifdef CONFIG_BLK_DEV_UMC8672 1493 + extern int probe_umc8672; 1494 extern int umc8672_init(void); 1495 #endif 1496 #ifdef CONFIG_BLK_DEV_DTC2278 1497 + extern int probe_dtc2278; 1498 extern int dtc2278_init(void); 1499 #endif 1500 #ifdef CONFIG_BLK_DEV_HT6560B 1501 + extern int probe_ht6560b; 1502 extern int ht6560b_init(void); 1503 #endif 1504 #ifdef CONFIG_BLK_DEV_QD65XX 1505 + extern int probe_qd65xx; 1506 extern int qd65xx_init(void); 1507 #endif 1508 ··· 1580 */ 1581 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { 1582 const char *hd_words[] = { 1583 + "none", "noprobe", "nowerr", "cdrom", "minus5", 1584 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1585 "noflush", "remap", "remap63", "scsi", NULL }; 1586 unit = s[2] - 'a'; ··· 1608 drive->ready_stat = 0; 1609 hwif->noprobe = 0; 1610 goto done; 1611 case -6: /* "autotune" */ 1612 drive->autotune = IDE_TUNE_AUTO; 1613 goto obsolete_option; ··· 1671 * (-8, -9, -10) are reserved to ease the hardcoding. 1672 */ 1673 static const char *ide_words[] = { 1674 + "noprobe", "serialize", "minus3", "minus4", 1675 "reset", "dma", "ata66", "minus8", "minus9", 1676 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", 1677 "dtc2278", "umc8672", "ali14xx", NULL }; ··· 1742 hwif->chipset = mate->chipset = ide_4drives; 1743 mate->irq = hwif->irq; 1744 memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); 1745 + hwif->mate = mate; 1746 + mate->mate = hwif; 1747 + hwif->serialized = mate->serialized = 1; 1748 + goto obsolete_option; 1749 } 1750 #endif /* CONFIG_BLK_DEV_4DRIVES */ 1751 case -10: /* minus10 */ 1752 case -9: /* minus9 */ 1753 case -8: /* minus8 */ 1754 + case -4: 1755 + case -3: 1756 goto bad_option; 1757 case -7: /* ata66 */ 1758 #ifdef CONFIG_BLK_DEV_IDEPCI ··· 1762 case -5: /* "reset" */ 1763 hwif->reset = 1; 1764 goto obsolete_option; 1765 case -2: /* "serialize" */ 1766 hwif->mate = &ide_hwifs[hw^1]; 1767 hwif->mate->mate = hwif; 1768 hwif->serialized = hwif->mate->serialized = 1; ··· 1840 #endif /* CONFIG_BLK_DEV_CMD640 */ 1841 #ifdef CONFIG_BLK_DEV_IDE_PMAC 1842 { 1843 + extern int pmac_ide_probe(void); 1844 + (void)pmac_ide_probe(); 1845 } 1846 #endif /* CONFIG_BLK_DEV_IDE_PMAC */ 1847 #ifdef CONFIG_BLK_DEV_GAYLE
+9 -2
drivers/ide/legacy/ali14xx.c
··· 37 * mode 4 for a while now with no trouble.) -Derek 38 */ 39 40 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 41 - 42 #include <linux/module.h> 43 #include <linux/types.h> 44 #include <linux/kernel.h> ··· 228 return 0; 229 } 230 231 /* Can be called directly from ide.c. */ 232 int __init ali14xx_init(void) 233 { 234 /* auto-detect IDE controller port */ 235 if (findPort()) { 236 if (ali14xx_probe()) ··· 246 return 0; 247 } 248 printk(KERN_ERR "ali14xx: not found.\n"); 249 return -ENODEV; 250 } 251
··· 37 * mode 4 for a while now with no trouble.) -Derek 38 */ 39 40 #include <linux/module.h> 41 #include <linux/types.h> 42 #include <linux/kernel.h> ··· 230 return 0; 231 } 232 233 + int probe_ali14xx = 0; 234 + 235 + module_param_named(probe, probe_ali14xx, bool, 0); 236 + MODULE_PARM_DESC(probe, "probe for ALI M14xx chipsets"); 237 + 238 /* Can be called directly from ide.c. */ 239 int __init ali14xx_init(void) 240 { 241 + if (probe_ali14xx == 0) 242 + goto out; 243 + 244 /* auto-detect IDE controller port */ 245 if (findPort()) { 246 if (ali14xx_probe()) ··· 240 return 0; 241 } 242 printk(KERN_ERR "ali14xx: not found.\n"); 243 + out: 244 return -ENODEV; 245 } 246
+10 -4
drivers/ide/legacy/dtc2278.c
··· 4 * Copyright (C) 1996 Linus Torvalds & author (see below) 5 */ 6 7 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 8 - 9 #include <linux/module.h> 10 #include <linux/types.h> 11 #include <linux/kernel.h> ··· 92 HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; 93 } 94 95 - static int __init probe_dtc2278(void) 96 { 97 unsigned long flags; 98 ide_hwif_t *hwif, *mate; ··· 143 return 0; 144 } 145 146 /* Can be called directly from ide.c. */ 147 int __init dtc2278_init(void) 148 { 149 - if (probe_dtc2278()) { 150 printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); 151 return -EBUSY; 152 }
··· 4 * Copyright (C) 1996 Linus Torvalds & author (see below) 5 */ 6 7 #include <linux/module.h> 8 #include <linux/types.h> 9 #include <linux/kernel.h> ··· 94 HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; 95 } 96 97 + static int __init dtc2278_probe(void) 98 { 99 unsigned long flags; 100 ide_hwif_t *hwif, *mate; ··· 145 return 0; 146 } 147 148 + int probe_dtc2278 = 0; 149 + 150 + module_param_named(probe, probe_dtc2278, bool, 0); 151 + MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets"); 152 + 153 /* Can be called directly from ide.c. */ 154 int __init dtc2278_init(void) 155 { 156 + if (probe_dtc2278 == 0) 157 + return -ENODEV; 158 + 159 + if (dtc2278_probe()) { 160 printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); 161 return -EBUSY; 162 }
+8 -2
drivers/ide/legacy/ht6560b.c
··· 36 37 #define HT6560B_VERSION "v0.07" 38 39 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 40 - 41 #include <linux/module.h> 42 #include <linux/types.h> 43 #include <linux/kernel.h> ··· 301 #endif 302 } 303 304 /* Can be called directly from ide.c. */ 305 int __init ht6560b_init(void) 306 { 307 ide_hwif_t *hwif, *mate; 308 int t; 309 310 hwif = &ide_hwifs[0]; 311 mate = &ide_hwifs[1];
··· 36 37 #define HT6560B_VERSION "v0.07" 38 39 #include <linux/module.h> 40 #include <linux/types.h> 41 #include <linux/kernel.h> ··· 303 #endif 304 } 305 306 + int probe_ht6560b = 0; 307 + 308 + module_param_named(probe, probe_ht6560b, bool, 0); 309 + MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); 310 + 311 /* Can be called directly from ide.c. */ 312 int __init ht6560b_init(void) 313 { 314 ide_hwif_t *hwif, *mate; 315 int t; 316 + 317 + if (probe_ht6560b == 0) 318 + return -ENODEV; 319 320 hwif = &ide_hwifs[0]; 321 mate = &ide_hwifs[1];
+5 -2
drivers/ide/legacy/ide-cs.c
··· 359 static struct pcmcia_device_id ide_ids[] = { 360 PCMCIA_DEVICE_FUNC_ID(4), 361 PCMCIA_DEVICE_MANF_CARD(0x0007, 0x0000), /* Hitachi */ 362 PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), 363 - PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), 364 PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ 365 PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), 366 PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ 367 PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ 368 PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001), 369 - PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar */ 370 PCMCIA_DEVICE_PROD_ID123("Caravelle", "PSC-IDE ", "PSC000", 0x8c36137c, 0xd0693ab8, 0x2768a9f0), 371 PCMCIA_DEVICE_PROD_ID123("CDROM", "IDE", "MCD-601p", 0x1b9179ca, 0xede88951, 0x0d902f74), 372 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9),
··· 359 static struct pcmcia_device_id ide_ids[] = { 360 PCMCIA_DEVICE_FUNC_ID(4), 361 PCMCIA_DEVICE_MANF_CARD(0x0007, 0x0000), /* Hitachi */ 362 + PCMCIA_DEVICE_MANF_CARD(0x000a, 0x0000), /* I-O Data CFA */ 363 + PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ 364 PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), 365 + PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ 366 PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ 367 PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), 368 PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ 369 PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ 370 PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001), 371 + PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100), /* Viking CFA */ 372 + PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar, Viking CFA */ 373 PCMCIA_DEVICE_PROD_ID123("Caravelle", "PSC-IDE ", "PSC000", 0x8c36137c, 0xd0693ab8, 0x2768a9f0), 374 PCMCIA_DEVICE_PROD_ID123("CDROM", "IDE", "MCD-601p", 0x1b9179ca, 0xede88951, 0x0d902f74), 375 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9),
+10 -4
drivers/ide/legacy/qd65xx.c
··· 16 * Please set local bus speed using kernel parameter idebus 17 * for example, "idebus=33" stands for 33Mhz VLbus 18 * To activate controller support, use "ide0=qd65xx" 19 - * To enable tuning, use "ide0=autotune" 20 - * To enable second channel tuning (qd6580 only), use "ide1=autotune" 21 */ 22 23 /* 24 * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by 25 * Samuel Thibault <samuel.thibault@fnac.net> 26 */ 27 - 28 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 29 30 #include <linux/module.h> 31 #include <linux/types.h> ··· 488 return 1; 489 } 490 491 /* Can be called directly from ide.c. */ 492 int __init qd65xx_init(void) 493 { 494 if (qd_probe(0x30)) 495 qd_probe(0xb0); 496 if (ide_hwifs[0].chipset != ide_qd65xx &&
··· 16 * Please set local bus speed using kernel parameter idebus 17 * for example, "idebus=33" stands for 33Mhz VLbus 18 * To activate controller support, use "ide0=qd65xx" 19 + * To enable tuning, use "hda=autotune hdb=autotune" 20 + * To enable 2nd channel tuning (qd6580 only), use "hdc=autotune hdd=autotune" 21 */ 22 23 /* 24 * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by 25 * Samuel Thibault <samuel.thibault@fnac.net> 26 */ 27 28 #include <linux/module.h> 29 #include <linux/types.h> ··· 490 return 1; 491 } 492 493 + int probe_qd65xx = 0; 494 + 495 + module_param_named(probe, probe_qd65xx, bool, 0); 496 + MODULE_PARM_DESC(probe, "probe for QD65xx chipsets"); 497 + 498 /* Can be called directly from ide.c. */ 499 int __init qd65xx_init(void) 500 { 501 + if (probe_qd65xx == 0) 502 + return -ENODEV; 503 + 504 if (qd_probe(0x30)) 505 qd_probe(0xb0); 506 if (ide_hwifs[0].chipset != ide_qd65xx &&
+12 -3
drivers/ide/legacy/umc8672.c
··· 165 return 0; 166 } 167 168 /* Can be called directly from ide.c. */ 169 int __init umc8672_init(void) 170 { 171 - if (umc8672_probe()) 172 - return -ENODEV; 173 - return 0; 174 } 175 176 #ifdef MODULE
··· 165 return 0; 166 } 167 168 + int probe_umc8672 = 0; 169 + 170 + module_param_named(probe, probe_umc8672, bool, 0); 171 + MODULE_PARM_DESC(probe, "probe for UMC8672 chipset"); 172 + 173 /* Can be called directly from ide.c. */ 174 int __init umc8672_init(void) 175 { 176 + if (probe_umc8672 == 0) 177 + goto out; 178 + 179 + if (umc8672_probe() == 0) 180 + return 0;; 181 + out: 182 + return -ENODEV;; 183 } 184 185 #ifdef MODULE
-2
drivers/ide/mips/au1xxx-ide.c
··· 29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE 30 * Interface and Linux Device Driver" Application Note. 31 */ 32 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 33 - 34 #include <linux/types.h> 35 #include <linux/module.h> 36 #include <linux/kernel.h>
··· 29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE 30 * Interface and Linux Device Driver" Application Note. 31 */ 32 #include <linux/types.h> 33 #include <linux/module.h> 34 #include <linux/kernel.h>
+27 -8
drivers/ide/pci/alim15x3.c
··· 1 /* 2 - * linux/drivers/ide/pci/alim15x3.c Version 0.17 2003/01/02 3 * 4 * Copyright (C) 1998-2000 Michel Aubry, Maintainer 5 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer ··· 9 * May be copied or modified under the terms of the GNU General Public License 10 * Copyright (C) 2002 Alan Cox <alan@redhat.com> 11 * ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw> 12 * 13 * (U)DMA capable version of ali 1533/1543(C), 1535(D) 14 * ··· 281 #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ 282 283 /** 284 - * ali15x3_tune_drive - set up a drive 285 * @drive: drive to tune 286 - * @pio: unused 287 * 288 - * Select the best PIO timing for the drive in question. Then 289 - * program the controller for this drive set up 290 */ 291 292 - static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) 293 { 294 ide_pio_data_t d; 295 ide_hwif_t *hwif = HWIF(drive); ··· 359 * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) 360 */ 361 362 } 363 364 /** ··· 449 } 450 451 /** 452 - * ali15x3_tune_chipset - set up chiset for new speed 453 * @drive: drive to configure for 454 * @xferspeed: desired speed 455 * ··· 480 pci_write_config_byte(dev, m5229_udma, tmpbyte); 481 482 if (speed < XFER_SW_DMA_0) 483 - ali15x3_tune_drive(drive, speed); 484 } else { 485 pci_read_config_byte(dev, m5229_udma, &tmpbyte); 486 tmpbyte &= (0x0f << ((1-unit) << 2));
··· 1 /* 2 + * linux/drivers/ide/pci/alim15x3.c Version 0.21 2007/02/03 3 * 4 * Copyright (C) 1998-2000 Michel Aubry, Maintainer 5 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer ··· 9 * May be copied or modified under the terms of the GNU General Public License 10 * Copyright (C) 2002 Alan Cox <alan@redhat.com> 11 * ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw> 12 + * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> 13 * 14 * (U)DMA capable version of ali 1533/1543(C), 1535(D) 15 * ··· 280 #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ 281 282 /** 283 + * ali15x3_tune_pio - set up chipset for PIO mode 284 * @drive: drive to tune 285 + * @pio: desired mode 286 * 287 + * Select the best PIO mode for the drive in question. 288 + * Then program the controller for this mode. 289 + * 290 + * Returns the PIO mode programmed. 291 */ 292 293 + static u8 ali15x3_tune_pio (ide_drive_t *drive, u8 pio) 294 { 295 ide_pio_data_t d; 296 ide_hwif_t *hwif = HWIF(drive); ··· 356 * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) 357 */ 358 359 + return pio; 360 + } 361 + 362 + /** 363 + * ali15x3_tune_drive - set up drive for PIO mode 364 + * @drive: drive to tune 365 + * @pio: desired mode 366 + * 367 + * Program the controller with the best PIO timing for the given drive. 368 + * Then set up the drive itself. 369 + */ 370 + 371 + static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) 372 + { 373 + pio = ali15x3_tune_pio(drive, pio); 374 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 375 } 376 377 /** ··· 430 } 431 432 /** 433 + * ali15x3_tune_chipset - set up chipset/drive for new speed 434 * @drive: drive to configure for 435 * @xferspeed: desired speed 436 * ··· 461 pci_write_config_byte(dev, m5229_udma, tmpbyte); 462 463 if (speed < XFER_SW_DMA_0) 464 + (void) ali15x3_tune_pio(drive, speed - XFER_PIO_0); 465 } else { 466 pci_read_config_byte(dev, m5229_udma, &tmpbyte); 467 tmpbyte &= (0x0f << ((1-unit) << 2));
-1
drivers/ide/pci/cmd640.c
··· 98 * (patch courtesy of Zoltan Hidvegi) 99 */ 100 101 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 102 #define CMD640_PREFETCH_MASKS 1 103 104 //#define CMD640_DUMP_REGS
··· 98 * (patch courtesy of Zoltan Hidvegi) 99 */ 100 101 #define CMD640_PREFETCH_MASKS 1 102 103 //#define CMD640_DUMP_REGS
+43 -65
drivers/ide/pci/cmd64x.c
··· 1 /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 2 * 3 - * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002 4 * 5 * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. 6 * Note, this driver is not used at all on other systems because ··· 12 * Copyright (C) 1998 David S. Miller (davem@redhat.com) 13 * 14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 15 */ 16 17 #include <linux/module.h> ··· 263 } 264 265 /* 266 - * Attempts to set the interface PIO mode. 267 - * The preferred method of selecting PIO modes (e.g. mode 4) is 268 - * "echo 'piomode:4' > /proc/ide/hdx/settings". Special cases are 269 - * 8: prefetch off, 9: prefetch on, 255: auto-select best mode. 270 - * Called with 255 at boot time. 271 */ 272 - 273 - static void cmd64x_tuneproc (ide_drive_t *drive, u8 mode_wanted) 274 { 275 int setup_time, active_time, recovery_time; 276 int clock_time, pio_mode, cycle_time; 277 u8 recovery_count2, cycle_count; 278 int setup_count, active_count, recovery_count; 279 int bus_speed = system_bus_clock(); 280 - /*byte b;*/ 281 ide_pio_data_t d; 282 283 - switch (mode_wanted) { 284 - case 8: /* set prefetch off */ 285 - case 9: /* set prefetch on */ 286 - mode_wanted &= 1; 287 - /*set_prefetch_mode(index, mode_wanted);*/ 288 - cmdprintk("%s: %sabled cmd640 prefetch\n", 289 - drive->name, mode_wanted ? "en" : "dis"); 290 - return; 291 - } 292 - 293 - mode_wanted = ide_get_best_pio_mode (drive, mode_wanted, 5, &d); 294 - pio_mode = d.pio_mode; 295 cycle_time = d.cycle_time; 296 297 /* 298 * I copied all this complicated stuff from cmd640.c and made a few 299 * minor changes. For now I am just going to pray that it is correct. 300 */ 301 - if (pio_mode > 5) 302 - pio_mode = 5; 303 setup_time = ide_pio_timings[pio_mode].setup_time; 304 active_time = ide_pio_timings[pio_mode].active_time; 305 recovery_time = cycle_time - (setup_time + active_time); ··· 303 if (active_count > 16) 304 active_count = 16; /* maximum allowed by cmd646 */ 305 306 - /* 307 - * In a perfect world, we might set the drive pio mode here 308 - * (using WIN_SETFEATURE) before continuing. 309 - * 310 - * But we do not, because: 311 - * 1) this is the wrong place to do it 312 - * (proper is do_special() in ide.c) 313 - * 2) in practice this is rarely, if ever, necessary 314 - */ 315 program_drive_counts (drive, setup_count, active_count, recovery_count); 316 317 - cmdprintk("%s: selected cmd646 PIO mode%d : %d (%dns)%s, " 318 "clocks=%d/%d/%d\n", 319 - drive->name, pio_mode, mode_wanted, cycle_time, 320 d.overridden ? " (overriding vendor mode)" : "", 321 setup_count, active_count, recovery_count); 322 } 323 324 static u8 cmd64x_ratemask (ide_drive_t *drive) ··· 381 return mode; 382 } 383 384 - static void config_cmd64x_chipset_for_pio (ide_drive_t *drive, u8 set_speed) 385 - { 386 - u8 speed = 0x00; 387 - u8 set_pio = ide_get_best_pio_mode(drive, 4, 5, NULL); 388 - 389 - cmd64x_tuneproc(drive, set_pio); 390 - speed = XFER_PIO_0 + set_pio; 391 - if (set_speed) 392 - (void) ide_config_drive_speed(drive, speed); 393 - } 394 - 395 - static void config_chipset_for_pio (ide_drive_t *drive, u8 set_speed) 396 - { 397 - config_cmd64x_chipset_for_pio(drive, set_speed); 398 - } 399 - 400 static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) 401 { 402 ide_hwif_t *hwif = HWIF(drive); ··· 392 393 u8 speed = ide_rate_filter(cmd64x_ratemask(drive), xferspeed); 394 395 - if (speed > XFER_PIO_4) { 396 (void) pci_read_config_byte(dev, pciD, &regD); 397 (void) pci_read_config_byte(dev, pciU, &regU); 398 regD &= ~(unit ? 0x40 : 0x20); ··· 416 case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; 417 case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; 418 case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; 419 - case XFER_PIO_4: cmd64x_tuneproc(drive, 4); break; 420 - case XFER_PIO_3: cmd64x_tuneproc(drive, 3); break; 421 - case XFER_PIO_2: cmd64x_tuneproc(drive, 2); break; 422 - case XFER_PIO_1: cmd64x_tuneproc(drive, 1); break; 423 - case XFER_PIO_0: cmd64x_tuneproc(drive, 0); break; 424 425 default: 426 return 1; 427 } 428 429 - if (speed > XFER_PIO_4) { 430 (void) pci_write_config_byte(dev, pciU, regU); 431 regD |= (unit ? 0x40 : 0x20); 432 (void) pci_write_config_byte(dev, pciD, regD); ··· 441 static int config_chipset_for_dma (ide_drive_t *drive) 442 { 443 u8 speed = ide_dma_speed(drive, cmd64x_ratemask(drive)); 444 - 445 - config_chipset_for_pio(drive, !speed); 446 447 if (!speed) 448 return 0; ··· 457 return 0; 458 459 if (ide_use_fast_pio(drive)) 460 - config_chipset_for_pio(drive, 1); 461 462 return -1; 463 } ··· 658 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); 659 class_rev &= 0xff; 660 661 - hwif->tuneproc = &cmd64x_tuneproc; 662 hwif->speedproc = &cmd64x_tune_chipset; 663 664 - if (!hwif->dma_base) { 665 - hwif->drives[0].autotune = 1; 666 - hwif->drives[1].autotune = 1; 667 return; 668 - } 669 670 hwif->atapi_dma = 1; 671
··· 1 /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 2 * 3 + * linux/drivers/ide/pci/cmd64x.c Version 1.41 Feb 3, 2007 4 * 5 * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. 6 * Note, this driver is not used at all on other systems because ··· 12 * Copyright (C) 1998 David S. Miller (davem@redhat.com) 13 * 14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 15 + * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> 16 */ 17 18 #include <linux/module.h> ··· 262 } 263 264 /* 265 + * This routine selects drive's best PIO mode, calculates setup/active/recovery 266 + * counts, and then writes them into the chipset registers. 267 */ 268 + static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) 269 { 270 int setup_time, active_time, recovery_time; 271 int clock_time, pio_mode, cycle_time; 272 u8 recovery_count2, cycle_count; 273 int setup_count, active_count, recovery_count; 274 int bus_speed = system_bus_clock(); 275 ide_pio_data_t d; 276 277 + pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d); 278 cycle_time = d.cycle_time; 279 280 /* 281 * I copied all this complicated stuff from cmd640.c and made a few 282 * minor changes. For now I am just going to pray that it is correct. 283 */ 284 setup_time = ide_pio_timings[pio_mode].setup_time; 285 active_time = ide_pio_timings[pio_mode].active_time; 286 recovery_time = cycle_time - (setup_time + active_time); ··· 320 if (active_count > 16) 321 active_count = 16; /* maximum allowed by cmd646 */ 322 323 program_drive_counts (drive, setup_count, active_count, recovery_count); 324 325 + cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " 326 "clocks=%d/%d/%d\n", 327 + drive->name, mode_wanted, pio_mode, cycle_time, 328 d.overridden ? " (overriding vendor mode)" : "", 329 setup_count, active_count, recovery_count); 330 + 331 + return pio_mode; 332 + } 333 + 334 + /* 335 + * Attempts to set drive's PIO mode. 336 + * Special cases are 8: prefetch off, 9: prefetch on (both never worked), 337 + * and 255: auto-select best mode (used at boot time). 338 + */ 339 + static void cmd64x_tune_drive (ide_drive_t *drive, u8 pio) 340 + { 341 + /* 342 + * Filter out the prefetch control values 343 + * to prevent PIO5 from being programmed 344 + */ 345 + if (pio == 8 || pio == 9) 346 + return; 347 + 348 + pio = cmd64x_tune_pio(drive, pio); 349 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 350 } 351 352 static u8 cmd64x_ratemask (ide_drive_t *drive) ··· 387 return mode; 388 } 389 390 static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) 391 { 392 ide_hwif_t *hwif = HWIF(drive); ··· 414 415 u8 speed = ide_rate_filter(cmd64x_ratemask(drive), xferspeed); 416 417 + if (speed >= XFER_SW_DMA_0) { 418 (void) pci_read_config_byte(dev, pciD, &regD); 419 (void) pci_read_config_byte(dev, pciU, &regU); 420 regD &= ~(unit ? 0x40 : 0x20); ··· 438 case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; 439 case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; 440 case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; 441 + case XFER_PIO_5: 442 + case XFER_PIO_4: 443 + case XFER_PIO_3: 444 + case XFER_PIO_2: 445 + case XFER_PIO_1: 446 + case XFER_PIO_0: 447 + (void) cmd64x_tune_pio(drive, speed - XFER_PIO_0); 448 + break; 449 450 default: 451 return 1; 452 } 453 454 + if (speed >= XFER_SW_DMA_0) { 455 (void) pci_write_config_byte(dev, pciU, regU); 456 regD |= (unit ? 0x40 : 0x20); 457 (void) pci_write_config_byte(dev, pciD, regD); ··· 460 static int config_chipset_for_dma (ide_drive_t *drive) 461 { 462 u8 speed = ide_dma_speed(drive, cmd64x_ratemask(drive)); 463 464 if (!speed) 465 return 0; ··· 478 return 0; 479 480 if (ide_use_fast_pio(drive)) 481 + cmd64x_tune_drive(drive, 255); 482 483 return -1; 484 } ··· 679 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); 680 class_rev &= 0xff; 681 682 + hwif->tuneproc = &cmd64x_tune_drive; 683 hwif->speedproc = &cmd64x_tune_chipset; 684 685 + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 686 + 687 + if (!hwif->dma_base) 688 return; 689 690 hwif->atapi_dma = 1; 691
+1 -1
drivers/ide/pci/delkin_cb.c
··· 122 static int 123 delkin_cb_init (void) 124 { 125 - return pci_module_init(&driver); 126 } 127 128 static void
··· 122 static int 123 delkin_cb_init (void) 124 { 125 + return pci_register_driver(&driver); 126 } 127 128 static void
-2
drivers/ide/pci/generic.c
··· 21 * are deemed to be part of the source code. 22 */ 23 24 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 25 - 26 #include <linux/types.h> 27 #include <linux/module.h> 28 #include <linux/kernel.h>
··· 21 * are deemed to be part of the source code. 22 */ 23 24 #include <linux/types.h> 25 #include <linux/module.h> 26 #include <linux/kernel.h>
+1 -2
drivers/ide/pci/opti621.c
··· 57 * There is a 25/33MHz switch in configuration 58 * register, but driver is written for use at any frequency which get 59 * (use idebus=xx to select PCI bus speed). 60 - * Use ide0=autotune for automatical tune of the PIO modes. 61 * If you get strange results, do not use this and set PIO manually 62 * by hdparm. 63 * ··· 87 * 0.5 doesn't work. 88 */ 89 90 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 91 #define OPTI621_DEBUG /* define for debug messages */ 92 93 #include <linux/types.h>
··· 57 * There is a 25/33MHz switch in configuration 58 * register, but driver is written for use at any frequency which get 59 * (use idebus=xx to select PCI bus speed). 60 + * Use hda=autotune and hdb=autotune for automatical tune of the PIO modes. 61 * If you get strange results, do not use this and set PIO manually 62 * by hdparm. 63 * ··· 87 * 0.5 doesn't work. 88 */ 89 90 #define OPTI621_DEBUG /* define for debug messages */ 91 92 #include <linux/types.h>
+30 -19
drivers/ide/pci/piix.c
··· 1 /* 2 - * linux/drivers/ide/pci/piix.c Version 0.46 December 3, 2006 3 * 4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer 5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> 6 * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> 7 - * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com> 8 * 9 * May be copied or modified under the terms of the GNU General Public License 10 * ··· 205 } 206 207 /** 208 - * piix_tune_drive - tune a drive attached to a PIIX 209 * @drive: drive to tune 210 * @pio: desired PIO mode 211 * 212 - * Set the interface PIO mode based upon the settings done by AMI BIOS 213 - * (might be useful if drive is not registered in CMOS for any reason). 214 */ 215 - static void piix_tune_drive (ide_drive_t *drive, u8 pio) 216 { 217 ide_hwif_t *hwif = HWIF(drive); 218 struct pci_dev *dev = hwif->pci_dev; ··· 232 { 2, 1 }, 233 { 2, 3 }, }; 234 235 - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 236 - 237 /* 238 * Master vs slave is synchronized above us but the slave register is 239 * shared by the two hwifs so the corner case of two slave timeouts in ··· 250 master_data |= 0x4000; 251 master_data &= ~0x0070; 252 if (pio > 1) { 253 - /* enable PPE, IE and TIME */ 254 - master_data = master_data | (control << 4); 255 } 256 pci_read_config_byte(dev, slave_port, &slave_data); 257 - slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); 258 - slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); 259 } else { 260 master_data &= ~0x3307; 261 if (pio > 1) { 262 /* enable PPE, IE and TIME */ 263 - master_data = master_data | control; 264 } 265 - master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); 266 } 267 pci_write_config_word(dev, master_port, master_data); 268 if (is_slave) 269 pci_write_config_byte(dev, slave_port, slave_data); 270 spin_unlock_irqrestore(&tune_lock, flags); 271 } 272 273 /** ··· 361 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); 362 } 363 364 - piix_tune_drive(drive, piix_dma_2_pio(speed)); 365 - return (ide_config_drive_speed(drive, speed)); 366 } 367 368 /** ··· 405 return 0; 406 407 if (ide_use_fast_pio(drive)) 408 - /* Find best PIO mode. */ 409 - piix_tune_chipset(drive, XFER_PIO_0 + 410 - ide_get_best_pio_mode(drive, 255, 4, NULL)); 411 412 return -1; 413 }
··· 1 /* 2 + * linux/drivers/ide/pci/piix.c Version 0.47 February 8, 2007 3 * 4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer 5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> 6 * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> 7 + * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> 8 * 9 * May be copied or modified under the terms of the GNU General Public License 10 * ··· 205 } 206 207 /** 208 + * piix_tune_pio - tune PIIX for PIO mode 209 * @drive: drive to tune 210 * @pio: desired PIO mode 211 * 212 + * Set the interface PIO mode based upon the settings done by AMI BIOS. 213 */ 214 + static void piix_tune_pio (ide_drive_t *drive, u8 pio) 215 { 216 ide_hwif_t *hwif = HWIF(drive); 217 struct pci_dev *dev = hwif->pci_dev; ··· 233 { 2, 1 }, 234 { 2, 3 }, }; 235 236 /* 237 * Master vs slave is synchronized above us but the slave register is 238 * shared by the two hwifs so the corner case of two slave timeouts in ··· 253 master_data |= 0x4000; 254 master_data &= ~0x0070; 255 if (pio > 1) { 256 + /* Set PPE, IE and TIME */ 257 + master_data |= control << 4; 258 } 259 pci_read_config_byte(dev, slave_port, &slave_data); 260 + slave_data &= hwif->channel ? 0x0f : 0xf0; 261 + slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << 262 + (hwif->channel ? 4 : 0); 263 } else { 264 master_data &= ~0x3307; 265 if (pio > 1) { 266 /* enable PPE, IE and TIME */ 267 + master_data |= control; 268 } 269 + master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); 270 } 271 pci_write_config_word(dev, master_port, master_data); 272 if (is_slave) 273 pci_write_config_byte(dev, slave_port, slave_data); 274 spin_unlock_irqrestore(&tune_lock, flags); 275 + } 276 + 277 + /** 278 + * piix_tune_drive - tune a drive attached to PIIX 279 + * @drive: drive to tune 280 + * @pio: desired PIO mode 281 + * 282 + * Set the drive's PIO mode (might be useful if drive is not registered 283 + * in CMOS for any reason). 284 + */ 285 + static void piix_tune_drive (ide_drive_t *drive, u8 pio) 286 + { 287 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 288 + piix_tune_pio(drive, pio); 289 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 290 } 291 292 /** ··· 348 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); 349 } 350 351 + piix_tune_pio(drive, piix_dma_2_pio(speed)); 352 + return ide_config_drive_speed(drive, speed); 353 } 354 355 /** ··· 392 return 0; 393 394 if (ide_use_fast_pio(drive)) 395 + piix_tune_drive(drive, 255); 396 397 return -1; 398 }
-2
drivers/ide/pci/rz1000.c
··· 15 * Dunno if this fixes both ports, or only the primary port (?). 16 */ 17 18 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 19 - 20 #include <linux/types.h> 21 #include <linux/module.h> 22 #include <linux/kernel.h>
··· 15 * Dunno if this fixes both ports, or only the primary port (?). 16 */ 17 18 #include <linux/types.h> 19 #include <linux/module.h> 20 #include <linux/kernel.h>
+5
drivers/ide/pci/siimage.c
··· 26 * If you have strange problems with nVidia chipset systems please 27 * see the SI support documentation and update your system BIOS 28 * if neccessary 29 */ 30 31 #include <linux/types.h>
··· 26 * If you have strange problems with nVidia chipset systems please 27 * see the SI support documentation and update your system BIOS 28 * if neccessary 29 + * 30 + * The Dell DRAC4 has some interesting features including effectively hot 31 + * unplugging/replugging the virtual CD interface when the DRAC is reset. 32 + * This often causes drivers/ide/siimage to panic but is ok with the rather 33 + * smarter code in libata. 34 */ 35 36 #include <linux/types.h>
+20 -18
drivers/ide/pci/slc90e66.c
··· 1 /* 2 - * linux/drivers/ide/pci/slc90e66.c Version 0.13 December 30, 2006 3 * 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 5 - * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com> 6 * 7 * This is a look-alike variation of the ICH0 PIIX4 Ultra-66, 8 * but this keeps the ISA-Bridge and slots alive. ··· 57 } 58 } 59 60 - /* 61 - * Based on settings done by AMI BIOS 62 - * (might be useful if drive is not registered in CMOS for any reason). 63 - */ 64 - static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) 65 { 66 ide_hwif_t *hwif = HWIF(drive); 67 struct pci_dev *dev = hwif->pci_dev; ··· 76 { 2, 1 }, 77 { 2, 3 }, }; 78 79 - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 80 spin_lock_irqsave(&ide_lock, flags); 81 pci_read_config_word(dev, master_port, &master_data); 82 ··· 89 master_data |= 0x4000; 90 master_data &= ~0x0070; 91 if (pio > 1) { 92 - /* enable PPE, IE and TIME */ 93 - master_data = master_data | (control << 4); 94 } 95 pci_read_config_byte(dev, slave_port, &slave_data); 96 - slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); 97 - slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); 98 } else { 99 master_data &= ~0x3307; 100 if (pio > 1) { 101 /* enable PPE, IE and TIME */ 102 - master_data = master_data | control; 103 } 104 - master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); 105 } 106 pci_write_config_word(dev, master_port, master_data); 107 if (is_slave) 108 pci_write_config_byte(dev, slave_port, slave_data); 109 spin_unlock_irqrestore(&ide_lock, flags); 110 } 111 112 static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) ··· 165 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); 166 } 167 168 - slc90e66_tune_drive(drive, slc90e66_dma_2_pio(speed)); 169 - return (ide_config_drive_speed(drive, speed)); 170 } 171 172 static int slc90e66_config_drive_for_dma (ide_drive_t *drive) ··· 188 return 0; 189 190 if (ide_use_fast_pio(drive)) 191 - (void)slc90e66_tune_chipset(drive, XFER_PIO_0 + 192 - ide_get_best_pio_mode(drive, 255, 4, NULL)); 193 194 return -1; 195 }
··· 1 /* 2 + * linux/drivers/ide/pci/slc90e66.c Version 0.14 February 8, 2007 3 * 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 5 + * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> 6 * 7 * This is a look-alike variation of the ICH0 PIIX4 Ultra-66, 8 * but this keeps the ISA-Bridge and slots alive. ··· 57 } 58 } 59 60 + static void slc90e66_tune_pio (ide_drive_t *drive, u8 pio) 61 { 62 ide_hwif_t *hwif = HWIF(drive); 63 struct pci_dev *dev = hwif->pci_dev; ··· 80 { 2, 1 }, 81 { 2, 3 }, }; 82 83 spin_lock_irqsave(&ide_lock, flags); 84 pci_read_config_word(dev, master_port, &master_data); 85 ··· 94 master_data |= 0x4000; 95 master_data &= ~0x0070; 96 if (pio > 1) { 97 + /* Set PPE, IE and TIME */ 98 + master_data |= control << 4; 99 } 100 pci_read_config_byte(dev, slave_port, &slave_data); 101 + slave_data &= hwif->channel ? 0x0f : 0xf0; 102 + slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << 103 + (hwif->channel ? 4 : 0); 104 } else { 105 master_data &= ~0x3307; 106 if (pio > 1) { 107 /* enable PPE, IE and TIME */ 108 + master_data |= control; 109 } 110 + master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); 111 } 112 pci_write_config_word(dev, master_port, master_data); 113 if (is_slave) 114 pci_write_config_byte(dev, slave_port, slave_data); 115 spin_unlock_irqrestore(&ide_lock, flags); 116 + } 117 + 118 + static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) 119 + { 120 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 121 + slc90e66_tune_pio(drive, pio); 122 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 123 } 124 125 static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) ··· 162 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); 163 } 164 165 + slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); 166 + return ide_config_drive_speed(drive, speed); 167 } 168 169 static int slc90e66_config_drive_for_dma (ide_drive_t *drive) ··· 185 return 0; 186 187 if (ide_use_fast_pio(drive)) 188 + slc90e66_tune_drive(drive, 255); 189 190 return -1; 191 }
+24 -9
drivers/ide/ppc/pmac.c
··· 48 #include <asm/mediabay.h> 49 #endif 50 51 - #include "ide-timing.h" 52 53 #undef IDE_PMAC_DEBUG 54 ··· 1551 }; 1552 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); 1553 1554 - void __init 1555 - pmac_ide_probe(void) 1556 { 1557 if (!machine_is(powermac)) 1558 - return; 1559 1560 #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST 1561 - pci_register_driver(&pmac_ide_pci_driver); 1562 - macio_register_driver(&pmac_ide_macio_driver); 1563 #else 1564 - macio_register_driver(&pmac_ide_macio_driver); 1565 - pci_register_driver(&pmac_ide_pci_driver); 1566 #endif 1567 } 1568 1569 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC ··· 1998 { 1999 } 2000 2001 - static int pmac_ide_dma_host_on(ide_drive_t *drive) 2002 { 2003 } 2004
··· 48 #include <asm/mediabay.h> 49 #endif 50 51 + #include "../ide-timing.h" 52 53 #undef IDE_PMAC_DEBUG 54 ··· 1551 }; 1552 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); 1553 1554 + int __init pmac_ide_probe(void) 1555 { 1556 + int error; 1557 + 1558 if (!machine_is(powermac)) 1559 + return -ENODEV; 1560 1561 #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST 1562 + error = pci_register_driver(&pmac_ide_pci_driver); 1563 + if (error) 1564 + goto out; 1565 + error = macio_register_driver(&pmac_ide_macio_driver); 1566 + if (error) { 1567 + pci_unregister_driver(&pmac_ide_pci_driver); 1568 + goto out; 1569 + } 1570 #else 1571 + error = macio_register_driver(&pmac_ide_macio_driver); 1572 + if (error) 1573 + goto out; 1574 + error = pci_register_driver(&pmac_ide_pci_driver); 1575 + if (error) { 1576 + macio_unregister_driver(&pmac_ide_macio_driver); 1577 + goto out; 1578 + } 1579 #endif 1580 + out: 1581 + return error; 1582 } 1583 1584 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC ··· 1983 { 1984 } 1985 1986 + static void pmac_ide_dma_host_on(ide_drive_t *drive) 1987 { 1988 } 1989
+27
drivers/ide/ppc/scc_pata.c
··· 509 return __ide_dma_end(drive); 510 } 511 512 /** 513 * setup_mmio_scc - map CTRL/BMID region 514 * @dev: PCI device we are configuring ··· 738 hwif->speedproc = scc_tune_chipset; 739 hwif->tuneproc = scc_tuneproc; 740 hwif->ide_dma_check = scc_config_drive_for_dma; 741 742 hwif->drives[0].autotune = IDE_TUNE_AUTO; 743 hwif->drives[1].autotune = IDE_TUNE_AUTO;
··· 509 return __ide_dma_end(drive); 510 } 511 512 + /* returns 1 if dma irq issued, 0 otherwise */ 513 + static int scc_dma_test_irq(ide_drive_t *drive) 514 + { 515 + ide_hwif_t *hwif = HWIF(drive); 516 + u8 dma_stat = hwif->INB(hwif->dma_status); 517 + 518 + /* return 1 if INTR asserted */ 519 + if ((dma_stat & 4) == 4) 520 + return 1; 521 + 522 + /* Workaround for PTERADD: emulate DMA_INTR when 523 + * - IDE_STATUS[ERR] = 1 524 + * - INT_STATUS[INTRQ] = 1 525 + * - DMA_STATUS[IORACTA] = 1 526 + */ 527 + if (in_be32((void __iomem *)IDE_ALTSTATUS_REG) & ERR_STAT && 528 + in_be32((void __iomem *)(hwif->dma_base + 0x014)) & INTSTS_INTRQ && 529 + dma_stat & 1) 530 + return 1; 531 + 532 + if (!drive->waiting_for_dma) 533 + printk(KERN_WARNING "%s: (%s) called while not waiting\n", 534 + drive->name, __FUNCTION__); 535 + return 0; 536 + } 537 + 538 /** 539 * setup_mmio_scc - map CTRL/BMID region 540 * @dev: PCI device we are configuring ··· 712 hwif->speedproc = scc_tune_chipset; 713 hwif->tuneproc = scc_tuneproc; 714 hwif->ide_dma_check = scc_config_drive_for_dma; 715 + hwif->ide_dma_test_irq = scc_dma_test_irq; 716 717 hwif->drives[0].autotune = IDE_TUNE_AUTO; 718 hwif->drives[1].autotune = IDE_TUNE_AUTO;
+32 -13
drivers/pci/probe.c
··· 682 dev->irq = irq; 683 } 684 685 - #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) 686 687 /** 688 * pci_setup_device - fill in class and map information of a device ··· 762 u8 progif; 763 pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); 764 if ((progif & 1) == 0) { 765 - dev->resource[0].start = 0x1F0; 766 - dev->resource[0].end = 0x1F7; 767 - dev->resource[0].flags = LEGACY_IO_RESOURCE; 768 - dev->resource[1].start = 0x3F6; 769 - dev->resource[1].end = 0x3F6; 770 - dev->resource[1].flags = LEGACY_IO_RESOURCE; 771 } 772 if ((progif & 4) == 0) { 773 - dev->resource[2].start = 0x170; 774 - dev->resource[2].end = 0x177; 775 - dev->resource[2].flags = LEGACY_IO_RESOURCE; 776 - dev->resource[3].start = 0x376; 777 - dev->resource[3].end = 0x376; 778 - dev->resource[3].flags = LEGACY_IO_RESOURCE; 779 } 780 } 781 break;
··· 682 dev->irq = irq; 683 } 684 685 + static void change_legacy_io_resource(struct pci_dev * dev, unsigned index, 686 + unsigned start, unsigned end) 687 + { 688 + unsigned base = start & PCI_BASE_ADDRESS_IO_MASK; 689 + unsigned len = (end | ~PCI_BASE_ADDRESS_IO_MASK) - base + 1; 690 + 691 + /* 692 + * Some X versions get confused when the BARs reported through 693 + * /sys or /proc differ from those seen in config space, thus 694 + * try to update the config space values, too. 695 + */ 696 + if (!(pci_resource_flags(dev, index) & IORESOURCE_IO)) 697 + printk(KERN_WARNING "%s: cannot adjust BAR%u (not I/O)\n", 698 + pci_name(dev), index); 699 + else if (pci_resource_len(dev, index) != len) 700 + printk(KERN_WARNING "%s: cannot adjust BAR%u (size %04X)\n", 701 + pci_name(dev), index, (unsigned)pci_resource_len(dev, index)); 702 + else { 703 + printk(KERN_INFO "%s: trying to change BAR%u from %04X to %04X\n", 704 + pci_name(dev), index, 705 + (unsigned)pci_resource_start(dev, index), base); 706 + pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + index * 4, base); 707 + } 708 + pci_resource_start(dev, index) = start; 709 + pci_resource_end(dev, index) = end; 710 + pci_resource_flags(dev, index) = 711 + IORESOURCE_IO | IORESOURCE_PCI_FIXED | PCI_BASE_ADDRESS_SPACE_IO; 712 + } 713 714 /** 715 * pci_setup_device - fill in class and map information of a device ··· 735 u8 progif; 736 pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); 737 if ((progif & 1) == 0) { 738 + change_legacy_io_resource(dev, 0, 0x1F0, 0x1F7); 739 + change_legacy_io_resource(dev, 1, 0x3F6, 0x3F6); 740 } 741 if ((progif & 4) == 0) { 742 + change_legacy_io_resource(dev, 2, 0x170, 0x177); 743 + change_legacy_io_resource(dev, 3, 0x376, 0x376); 744 } 745 } 746 break;
+2 -1
include/linux/ide.h
··· 1359 typedef struct ide_pio_timings_s { 1360 int setup_time; /* Address setup (ns) minimum */ 1361 int active_time; /* Active pulse (ns) minimum */ 1362 - int cycle_time; /* Cycle time (ns) minimum = (setup + active + recovery) */ 1363 } ide_pio_timings_t; 1364 1365 typedef struct ide_pio_data_s {
··· 1359 typedef struct ide_pio_timings_s { 1360 int setup_time; /* Address setup (ns) minimum */ 1361 int active_time; /* Active pulse (ns) minimum */ 1362 + int cycle_time; /* Cycle time (ns) minimum = */ 1363 + /* active + recovery (+ setup for some chips) */ 1364 } ide_pio_timings_t; 1365 1366 typedef struct ide_pio_data_s {