diff options
Diffstat (limited to 'drivers')
27 files changed, 292 insertions, 206 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 49234e32fd16..5d134bb75ba1 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
| @@ -1023,7 +1023,7 @@ config BLK_DEV_4DRIVES | |||
| 1023 | config BLK_DEV_ALI14XX | 1023 | config BLK_DEV_ALI14XX |
| 1024 | tristate "ALI M14xx support" | 1024 | tristate "ALI M14xx support" |
| 1025 | help | 1025 | help |
| 1026 | This driver is enabled at runtime using the "ide0=ali14xx" kernel | 1026 | This driver is enabled at runtime using the "ali14xx.probe" kernel |
| 1027 | boot parameter. It enables support for the secondary IDE interface | 1027 | boot parameter. It enables support for the secondary IDE interface |
| 1028 | of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster | 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 | 1029 | I/O speeds to be set as well. See the files |
| @@ -1033,7 +1033,7 @@ config BLK_DEV_ALI14XX | |||
| 1033 | config BLK_DEV_DTC2278 | 1033 | config BLK_DEV_DTC2278 |
| 1034 | tristate "DTC-2278 support" | 1034 | tristate "DTC-2278 support" |
| 1035 | help | 1035 | help |
| 1036 | This driver is enabled at runtime using the "ide0=dtc2278" kernel | 1036 | This driver is enabled at runtime using the "dtc2278.probe" kernel |
| 1037 | boot parameter. It enables support for the secondary IDE interface | 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 | 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 | 1039 | well. See the <file:Documentation/ide.txt> and |
| @@ -1042,7 +1042,7 @@ config BLK_DEV_DTC2278 | |||
| 1042 | config BLK_DEV_HT6560B | 1042 | config BLK_DEV_HT6560B |
| 1043 | tristate "Holtek HT6560B support" | 1043 | tristate "Holtek HT6560B support" |
| 1044 | help | 1044 | help |
| 1045 | This driver is enabled at runtime using the "ide0=ht6560b" kernel | 1045 | This driver is enabled at runtime using the "ht6560b.probe" kernel |
| 1046 | boot parameter. It enables support for the secondary IDE interface | 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. | 1047 | of the Holtek card, and permits faster I/O speeds to be set as well. |
| 1048 | See the <file:Documentation/ide.txt> and | 1048 | See the <file:Documentation/ide.txt> and |
| @@ -1051,7 +1051,7 @@ config BLK_DEV_HT6560B | |||
| 1051 | config BLK_DEV_QD65XX | 1051 | config BLK_DEV_QD65XX |
| 1052 | tristate "QDI QD65xx support" | 1052 | tristate "QDI QD65xx support" |
| 1053 | help | 1053 | help |
| 1054 | This driver is enabled at runtime using the "ide0=qd65xx" kernel | 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 | 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 | 1056 | <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> for |
| 1057 | more info. | 1057 | more info. |
| @@ -1059,7 +1059,7 @@ config BLK_DEV_QD65XX | |||
| 1059 | config BLK_DEV_UMC8672 | 1059 | config BLK_DEV_UMC8672 |
| 1060 | tristate "UMC-8672 support" | 1060 | tristate "UMC-8672 support" |
| 1061 | help | 1061 | help |
| 1062 | This driver is enabled at runtime using the "ide0=umc8672" kernel | 1062 | This driver is enabled at runtime using the "umc8672.probe" kernel |
| 1063 | boot parameter. It enables support for the secondary IDE interface | 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. | 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 | 1065 | See the files <file:Documentation/ide.txt> and |
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index 6b2d152351b3..556455fbfa2b 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
| @@ -17,8 +17,6 @@ | |||
| 17 | * device can't do DMA handshaking for some stupid reason. We don't need to do that. | 17 | * device can't do DMA handshaking for some stupid reason. We don't need to do that. |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 21 | |||
| 22 | #include <linux/types.h> | 20 | #include <linux/types.h> |
| 23 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 24 | #include <linux/timer.h> | 22 | #include <linux/timer.h> |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index e2cea1889c4d..37aa6ddd9702 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
| @@ -43,8 +43,6 @@ | |||
| 43 | 43 | ||
| 44 | #define IDEDISK_VERSION "1.18" | 44 | #define IDEDISK_VERSION "1.18" |
| 45 | 45 | ||
| 46 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 47 | |||
| 48 | //#define DEBUG | 46 | //#define DEBUG |
| 49 | 47 | ||
| 50 | #include <linux/module.h> | 48 | #include <linux/module.h> |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index c67b3b1e6f4c..bd513f5a2323 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
| @@ -583,6 +583,8 @@ u8 eighty_ninty_three (ide_drive_t *drive) | |||
| 583 | if(!(drive->id->hw_config & 0x4000)) | 583 | if(!(drive->id->hw_config & 0x4000)) |
| 584 | return 0; | 584 | return 0; |
| 585 | #endif /* CONFIG_IDEDMA_IVB */ | 585 | #endif /* CONFIG_IDEDMA_IVB */ |
| 586 | if (!(drive->id->hw_config & 0x2000)) | ||
| 587 | return 0; | ||
| 586 | return 1; | 588 | return 1; |
| 587 | } | 589 | } |
| 588 | 590 | ||
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 8afce4ceea31..68719314df3f 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
| @@ -345,16 +345,16 @@ static int ide_scan_pio_blacklist (char *model) | |||
| 345 | 345 | ||
| 346 | /** | 346 | /** |
| 347 | * ide_get_best_pio_mode - get PIO mode from drive | 347 | * ide_get_best_pio_mode - get PIO mode from drive |
| 348 | * @driver: drive to consider | 348 | * @drive: drive to consider |
| 349 | * @mode_wanted: preferred mode | 349 | * @mode_wanted: preferred mode |
| 350 | * @max_mode: highest allowed | 350 | * @max_mode: highest allowed mode |
| 351 | * @d: pio data | 351 | * @d: PIO data |
| 352 | * | 352 | * |
| 353 | * This routine returns the recommended PIO settings for a given drive, | 353 | * This routine returns the recommended PIO settings for a given drive, |
| 354 | * based on the drive->id information and the ide_pio_blacklist[]. | 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 | * | 355 | * |
| 357 | * Drive PIO mode auto selection | 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 | */ | 358 | */ |
| 359 | 359 | ||
| 360 | u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d) | 360 | u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d) |
| @@ -367,6 +367,7 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p | |||
| 367 | 367 | ||
| 368 | if (mode_wanted != 255) { | 368 | if (mode_wanted != 255) { |
| 369 | pio_mode = mode_wanted; | 369 | pio_mode = mode_wanted; |
| 370 | use_iordy = (pio_mode > 2); | ||
| 370 | } else if (!drive->id) { | 371 | } else if (!drive->id) { |
| 371 | pio_mode = 0; | 372 | pio_mode = 0; |
| 372 | } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { | 373 | } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { |
| @@ -396,19 +397,12 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p | |||
| 396 | } | 397 | } |
| 397 | } | 398 | } |
| 398 | 399 | ||
| 399 | #if 0 | ||
| 400 | if (drive->id->major_rev_num & 0x0004) printk("ATA-2 "); | ||
| 401 | #endif | ||
| 402 | |||
| 403 | /* | 400 | /* |
| 404 | * Conservative "downgrade" for all pre-ATA2 drives | 401 | * Conservative "downgrade" for all pre-ATA2 drives |
| 405 | */ | 402 | */ |
| 406 | if (pio_mode && pio_mode < 4) { | 403 | if (pio_mode && pio_mode < 4) { |
| 407 | pio_mode--; | 404 | pio_mode--; |
| 408 | overridden = 1; | 405 | overridden = 1; |
| 409 | #if 0 | ||
| 410 | use_iordy = (pio_mode > 2); | ||
| 411 | #endif | ||
| 412 | if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time) | 406 | if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time) |
| 413 | cycle_time = 0; /* use standard timing */ | 407 | cycle_time = 0; /* use standard timing */ |
| 414 | } | 408 | } |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 8afbd6cb94be..8f15c23aa70d 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
| @@ -31,8 +31,6 @@ | |||
| 31 | * valid after probe time even with noprobe | 31 | * valid after probe time even with noprobe |
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 35 | |||
| 36 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 37 | #include <linux/types.h> | 35 | #include <linux/types.h> |
| 38 | #include <linux/string.h> | 36 | #include <linux/string.h> |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index b3c0818c5c6c..dfbd74458522 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
| @@ -126,8 +126,6 @@ | |||
| 126 | #define REVISION "Revision: 7.00alpha2" | 126 | #define REVISION "Revision: 7.00alpha2" |
| 127 | #define VERSION "Id: ide.c 7.00a2 20020906" | 127 | #define VERSION "Id: ide.c 7.00a2 20020906" |
| 128 | 128 | ||
| 129 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 130 | |||
| 131 | #define _IDE_C /* Tell ide.h it's really us */ | 129 | #define _IDE_C /* Tell ide.h it's really us */ |
| 132 | 130 | ||
| 133 | #include <linux/module.h> | 131 | #include <linux/module.h> |
| @@ -1486,23 +1484,23 @@ static int __init match_parm (char *s, const char *keywords[], int vals[], int m | |||
| 1486 | } | 1484 | } |
| 1487 | 1485 | ||
| 1488 | #ifdef CONFIG_BLK_DEV_ALI14XX | 1486 | #ifdef CONFIG_BLK_DEV_ALI14XX |
| 1489 | static int __initdata probe_ali14xx; | 1487 | extern int probe_ali14xx; |
| 1490 | extern int ali14xx_init(void); | 1488 | extern int ali14xx_init(void); |
| 1491 | #endif | 1489 | #endif |
| 1492 | #ifdef CONFIG_BLK_DEV_UMC8672 | 1490 | #ifdef CONFIG_BLK_DEV_UMC8672 |
| 1493 | static int __initdata probe_umc8672; | 1491 | extern int probe_umc8672; |
| 1494 | extern int umc8672_init(void); | 1492 | extern int umc8672_init(void); |
| 1495 | #endif | 1493 | #endif |
| 1496 | #ifdef CONFIG_BLK_DEV_DTC2278 | 1494 | #ifdef CONFIG_BLK_DEV_DTC2278 |
| 1497 | static int __initdata probe_dtc2278; | 1495 | extern int probe_dtc2278; |
| 1498 | extern int dtc2278_init(void); | 1496 | extern int dtc2278_init(void); |
| 1499 | #endif | 1497 | #endif |
| 1500 | #ifdef CONFIG_BLK_DEV_HT6560B | 1498 | #ifdef CONFIG_BLK_DEV_HT6560B |
| 1501 | static int __initdata probe_ht6560b; | 1499 | extern int probe_ht6560b; |
| 1502 | extern int ht6560b_init(void); | 1500 | extern int ht6560b_init(void); |
| 1503 | #endif | 1501 | #endif |
| 1504 | #ifdef CONFIG_BLK_DEV_QD65XX | 1502 | #ifdef CONFIG_BLK_DEV_QD65XX |
| 1505 | static int __initdata probe_qd65xx; | 1503 | extern int probe_qd65xx; |
| 1506 | extern int qd65xx_init(void); | 1504 | extern int qd65xx_init(void); |
| 1507 | #endif | 1505 | #endif |
| 1508 | 1506 | ||
| @@ -1580,7 +1578,7 @@ static int __init ide_setup(char *s) | |||
| 1580 | */ | 1578 | */ |
| 1581 | if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { | 1579 | if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { |
| 1582 | const char *hd_words[] = { | 1580 | const char *hd_words[] = { |
| 1583 | "none", "noprobe", "nowerr", "cdrom", "serialize", | 1581 | "none", "noprobe", "nowerr", "cdrom", "minus5", |
| 1584 | "autotune", "noautotune", "minus8", "swapdata", "bswap", | 1582 | "autotune", "noautotune", "minus8", "swapdata", "bswap", |
| 1585 | "noflush", "remap", "remap63", "scsi", NULL }; | 1583 | "noflush", "remap", "remap63", "scsi", NULL }; |
| 1586 | unit = s[2] - 'a'; | 1584 | unit = s[2] - 'a'; |
| @@ -1608,9 +1606,6 @@ static int __init ide_setup(char *s) | |||
| 1608 | drive->ready_stat = 0; | 1606 | drive->ready_stat = 0; |
| 1609 | hwif->noprobe = 0; | 1607 | hwif->noprobe = 0; |
| 1610 | goto done; | 1608 | goto done; |
| 1611 | case -5: /* "serialize" */ | ||
| 1612 | printk(" -- USE \"ide%d=serialize\" INSTEAD", hw); | ||
| 1613 | goto do_serialize; | ||
| 1614 | case -6: /* "autotune" */ | 1609 | case -6: /* "autotune" */ |
| 1615 | drive->autotune = IDE_TUNE_AUTO; | 1610 | drive->autotune = IDE_TUNE_AUTO; |
| 1616 | goto obsolete_option; | 1611 | goto obsolete_option; |
| @@ -1671,7 +1666,7 @@ static int __init ide_setup(char *s) | |||
| 1671 | * (-8, -9, -10) are reserved to ease the hardcoding. | 1666 | * (-8, -9, -10) are reserved to ease the hardcoding. |
| 1672 | */ | 1667 | */ |
| 1673 | static const char *ide_words[] = { | 1668 | static const char *ide_words[] = { |
| 1674 | "noprobe", "serialize", "autotune", "noautotune", | 1669 | "noprobe", "serialize", "minus3", "minus4", |
| 1675 | "reset", "dma", "ata66", "minus8", "minus9", | 1670 | "reset", "dma", "ata66", "minus8", "minus9", |
| 1676 | "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", | 1671 | "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", |
| 1677 | "dtc2278", "umc8672", "ali14xx", NULL }; | 1672 | "dtc2278", "umc8672", "ali14xx", NULL }; |
| @@ -1742,12 +1737,17 @@ static int __init ide_setup(char *s) | |||
| 1742 | hwif->chipset = mate->chipset = ide_4drives; | 1737 | hwif->chipset = mate->chipset = ide_4drives; |
| 1743 | mate->irq = hwif->irq; | 1738 | mate->irq = hwif->irq; |
| 1744 | memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); | 1739 | memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); |
| 1745 | goto do_serialize; | 1740 | hwif->mate = mate; |
| 1741 | mate->mate = hwif; | ||
| 1742 | hwif->serialized = mate->serialized = 1; | ||
| 1743 | goto obsolete_option; | ||
| 1746 | } | 1744 | } |
| 1747 | #endif /* CONFIG_BLK_DEV_4DRIVES */ | 1745 | #endif /* CONFIG_BLK_DEV_4DRIVES */ |
| 1748 | case -10: /* minus10 */ | 1746 | case -10: /* minus10 */ |
| 1749 | case -9: /* minus9 */ | 1747 | case -9: /* minus9 */ |
| 1750 | case -8: /* minus8 */ | 1748 | case -8: /* minus8 */ |
| 1749 | case -4: | ||
| 1750 | case -3: | ||
| 1751 | goto bad_option; | 1751 | goto bad_option; |
| 1752 | case -7: /* ata66 */ | 1752 | case -7: /* ata66 */ |
| 1753 | #ifdef CONFIG_BLK_DEV_IDEPCI | 1753 | #ifdef CONFIG_BLK_DEV_IDEPCI |
| @@ -1762,16 +1762,7 @@ static int __init ide_setup(char *s) | |||
| 1762 | case -5: /* "reset" */ | 1762 | case -5: /* "reset" */ |
| 1763 | hwif->reset = 1; | 1763 | hwif->reset = 1; |
| 1764 | goto obsolete_option; | 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" */ | 1765 | case -2: /* "serialize" */ |
| 1774 | do_serialize: | ||
| 1775 | hwif->mate = &ide_hwifs[hw^1]; | 1766 | hwif->mate = &ide_hwifs[hw^1]; |
| 1776 | hwif->mate->mate = hwif; | 1767 | hwif->mate->mate = hwif; |
| 1777 | hwif->serialized = hwif->mate->serialized = 1; | 1768 | hwif->serialized = hwif->mate->serialized = 1; |
| @@ -1840,8 +1831,8 @@ static void __init probe_for_hwifs (void) | |||
| 1840 | #endif /* CONFIG_BLK_DEV_CMD640 */ | 1831 | #endif /* CONFIG_BLK_DEV_CMD640 */ |
| 1841 | #ifdef CONFIG_BLK_DEV_IDE_PMAC | 1832 | #ifdef CONFIG_BLK_DEV_IDE_PMAC |
| 1842 | { | 1833 | { |
| 1843 | extern void pmac_ide_probe(void); | 1834 | extern int pmac_ide_probe(void); |
| 1844 | pmac_ide_probe(); | 1835 | (void)pmac_ide_probe(); |
| 1845 | } | 1836 | } |
| 1846 | #endif /* CONFIG_BLK_DEV_IDE_PMAC */ | 1837 | #endif /* CONFIG_BLK_DEV_IDE_PMAC */ |
| 1847 | #ifdef CONFIG_BLK_DEV_GAYLE | 1838 | #ifdef CONFIG_BLK_DEV_GAYLE |
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index 9c544467cb74..91961aa03047 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c | |||
| @@ -37,8 +37,6 @@ | |||
| 37 | * mode 4 for a while now with no trouble.) -Derek | 37 | * mode 4 for a while now with no trouble.) -Derek |
| 38 | */ | 38 | */ |
| 39 | 39 | ||
| 40 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 41 | |||
| 42 | #include <linux/module.h> | 40 | #include <linux/module.h> |
| 43 | #include <linux/types.h> | 41 | #include <linux/types.h> |
| 44 | #include <linux/kernel.h> | 42 | #include <linux/kernel.h> |
| @@ -230,9 +228,17 @@ static int __init ali14xx_probe(void) | |||
| 230 | return 0; | 228 | return 0; |
| 231 | } | 229 | } |
| 232 | 230 | ||
| 231 | int probe_ali14xx = 0; | ||
| 232 | |||
| 233 | module_param_named(probe, probe_ali14xx, bool, 0); | ||
| 234 | MODULE_PARM_DESC(probe, "probe for ALI M14xx chipsets"); | ||
| 235 | |||
| 233 | /* Can be called directly from ide.c. */ | 236 | /* Can be called directly from ide.c. */ |
| 234 | int __init ali14xx_init(void) | 237 | int __init ali14xx_init(void) |
| 235 | { | 238 | { |
| 239 | if (probe_ali14xx == 0) | ||
| 240 | goto out; | ||
| 241 | |||
| 236 | /* auto-detect IDE controller port */ | 242 | /* auto-detect IDE controller port */ |
| 237 | if (findPort()) { | 243 | if (findPort()) { |
| 238 | if (ali14xx_probe()) | 244 | if (ali14xx_probe()) |
| @@ -240,6 +246,7 @@ int __init ali14xx_init(void) | |||
| 240 | return 0; | 246 | return 0; |
| 241 | } | 247 | } |
| 242 | printk(KERN_ERR "ali14xx: not found.\n"); | 248 | printk(KERN_ERR "ali14xx: not found.\n"); |
| 249 | out: | ||
| 243 | return -ENODEV; | 250 | return -ENODEV; |
| 244 | } | 251 | } |
| 245 | 252 | ||
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index 3b1d33baaa2f..0219ffa64db6 100644 --- a/drivers/ide/legacy/dtc2278.c +++ b/drivers/ide/legacy/dtc2278.c | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | * Copyright (C) 1996 Linus Torvalds & author (see below) | 4 | * Copyright (C) 1996 Linus Torvalds & author (see below) |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 8 | |||
| 9 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 10 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 11 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| @@ -94,7 +92,7 @@ static void tune_dtc2278 (ide_drive_t *drive, u8 pio) | |||
| 94 | HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; | 92 | HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; |
| 95 | } | 93 | } |
| 96 | 94 | ||
| 97 | static int __init probe_dtc2278(void) | 95 | static int __init dtc2278_probe(void) |
| 98 | { | 96 | { |
| 99 | unsigned long flags; | 97 | unsigned long flags; |
| 100 | ide_hwif_t *hwif, *mate; | 98 | ide_hwif_t *hwif, *mate; |
| @@ -145,10 +143,18 @@ static int __init probe_dtc2278(void) | |||
| 145 | return 0; | 143 | return 0; |
| 146 | } | 144 | } |
| 147 | 145 | ||
| 146 | int probe_dtc2278 = 0; | ||
| 147 | |||
| 148 | module_param_named(probe, probe_dtc2278, bool, 0); | ||
| 149 | MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets"); | ||
| 150 | |||
| 148 | /* Can be called directly from ide.c. */ | 151 | /* Can be called directly from ide.c. */ |
| 149 | int __init dtc2278_init(void) | 152 | int __init dtc2278_init(void) |
| 150 | { | 153 | { |
| 151 | if (probe_dtc2278()) { | 154 | if (probe_dtc2278 == 0) |
| 155 | return -ENODEV; | ||
| 156 | |||
| 157 | if (dtc2278_probe()) { | ||
| 152 | printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); | 158 | printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); |
| 153 | return -EBUSY; | 159 | return -EBUSY; |
| 154 | } | 160 | } |
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 19ccd006f205..a2832643c522 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c | |||
| @@ -36,8 +36,6 @@ | |||
| 36 | 36 | ||
| 37 | #define HT6560B_VERSION "v0.07" | 37 | #define HT6560B_VERSION "v0.07" |
| 38 | 38 | ||
| 39 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 40 | |||
| 41 | #include <linux/module.h> | 39 | #include <linux/module.h> |
| 42 | #include <linux/types.h> | 40 | #include <linux/types.h> |
| 43 | #include <linux/kernel.h> | 41 | #include <linux/kernel.h> |
| @@ -303,12 +301,20 @@ static void tune_ht6560b (ide_drive_t *drive, u8 pio) | |||
| 303 | #endif | 301 | #endif |
| 304 | } | 302 | } |
| 305 | 303 | ||
| 304 | int probe_ht6560b = 0; | ||
| 305 | |||
| 306 | module_param_named(probe, probe_ht6560b, bool, 0); | ||
| 307 | MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); | ||
| 308 | |||
| 306 | /* Can be called directly from ide.c. */ | 309 | /* Can be called directly from ide.c. */ |
| 307 | int __init ht6560b_init(void) | 310 | int __init ht6560b_init(void) |
| 308 | { | 311 | { |
| 309 | ide_hwif_t *hwif, *mate; | 312 | ide_hwif_t *hwif, *mate; |
| 310 | int t; | 313 | int t; |
| 311 | 314 | ||
| 315 | if (probe_ht6560b == 0) | ||
| 316 | return -ENODEV; | ||
| 317 | |||
| 312 | hwif = &ide_hwifs[0]; | 318 | hwif = &ide_hwifs[0]; |
| 313 | mate = &ide_hwifs[1]; | 319 | mate = &ide_hwifs[1]; |
| 314 | 320 | ||
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index a5023cdbdc58..b08c37c9f956 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
| @@ -359,14 +359,17 @@ void ide_release(struct pcmcia_device *link) | |||
| 359 | static struct pcmcia_device_id ide_ids[] = { | 359 | static struct pcmcia_device_id ide_ids[] = { |
| 360 | PCMCIA_DEVICE_FUNC_ID(4), | 360 | PCMCIA_DEVICE_FUNC_ID(4), |
| 361 | PCMCIA_DEVICE_MANF_CARD(0x0007, 0x0000), /* Hitachi */ | 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 */ | ||
| 362 | PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), | 364 | PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), |
| 363 | PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), | 365 | PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ |
| 364 | PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ | 366 | PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ |
| 365 | PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), | 367 | PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), |
| 366 | PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ | 368 | PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ |
| 367 | PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ | 369 | PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ |
| 368 | PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001), | 370 | PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001), |
| 369 | PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar */ | 371 | PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100), /* Viking CFA */ |
| 372 | PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar, Viking CFA */ | ||
| 370 | PCMCIA_DEVICE_PROD_ID123("Caravelle", "PSC-IDE ", "PSC000", 0x8c36137c, 0xd0693ab8, 0x2768a9f0), | 373 | PCMCIA_DEVICE_PROD_ID123("Caravelle", "PSC-IDE ", "PSC000", 0x8c36137c, 0xd0693ab8, 0x2768a9f0), |
| 371 | PCMCIA_DEVICE_PROD_ID123("CDROM", "IDE", "MCD-601p", 0x1b9179ca, 0xede88951, 0x0d902f74), | 374 | PCMCIA_DEVICE_PROD_ID123("CDROM", "IDE", "MCD-601p", 0x1b9179ca, 0xede88951, 0x0d902f74), |
| 372 | PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9), | 375 | PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9), |
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index d3c3bc2640e7..2fb8f50f1293 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c | |||
| @@ -16,8 +16,8 @@ | |||
| 16 | * Please set local bus speed using kernel parameter idebus | 16 | * Please set local bus speed using kernel parameter idebus |
| 17 | * for example, "idebus=33" stands for 33Mhz VLbus | 17 | * for example, "idebus=33" stands for 33Mhz VLbus |
| 18 | * To activate controller support, use "ide0=qd65xx" | 18 | * To activate controller support, use "ide0=qd65xx" |
| 19 | * To enable tuning, use "ide0=autotune" | 19 | * To enable tuning, use "hda=autotune hdb=autotune" |
| 20 | * To enable second channel tuning (qd6580 only), use "ide1=autotune" | 20 | * To enable 2nd channel tuning (qd6580 only), use "hdc=autotune hdd=autotune" |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| @@ -25,8 +25,6 @@ | |||
| 25 | * Samuel Thibault <samuel.thibault@fnac.net> | 25 | * Samuel Thibault <samuel.thibault@fnac.net> |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 29 | |||
| 30 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 31 | #include <linux/types.h> | 29 | #include <linux/types.h> |
| 32 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
| @@ -490,9 +488,17 @@ static int __init qd_probe(int base) | |||
| 490 | return 1; | 488 | return 1; |
| 491 | } | 489 | } |
| 492 | 490 | ||
| 491 | int probe_qd65xx = 0; | ||
| 492 | |||
| 493 | module_param_named(probe, probe_qd65xx, bool, 0); | ||
| 494 | MODULE_PARM_DESC(probe, "probe for QD65xx chipsets"); | ||
| 495 | |||
| 493 | /* Can be called directly from ide.c. */ | 496 | /* Can be called directly from ide.c. */ |
| 494 | int __init qd65xx_init(void) | 497 | int __init qd65xx_init(void) |
| 495 | { | 498 | { |
| 499 | if (probe_qd65xx == 0) | ||
| 500 | return -ENODEV; | ||
| 501 | |||
| 496 | if (qd_probe(0x30)) | 502 | if (qd_probe(0x30)) |
| 497 | qd_probe(0xb0); | 503 | qd_probe(0xb0); |
| 498 | if (ide_hwifs[0].chipset != ide_qd65xx && | 504 | if (ide_hwifs[0].chipset != ide_qd65xx && |
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c index 6e2c58c5f6a2..ca7974455578 100644 --- a/drivers/ide/legacy/umc8672.c +++ b/drivers/ide/legacy/umc8672.c | |||
| @@ -165,12 +165,21 @@ static int __init umc8672_probe(void) | |||
| 165 | return 0; | 165 | return 0; |
| 166 | } | 166 | } |
| 167 | 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 | |||
| 168 | /* Can be called directly from ide.c. */ | 173 | /* Can be called directly from ide.c. */ |
| 169 | int __init umc8672_init(void) | 174 | int __init umc8672_init(void) |
| 170 | { | 175 | { |
| 171 | if (umc8672_probe()) | 176 | if (probe_umc8672 == 0) |
| 172 | return -ENODEV; | 177 | goto out; |
| 173 | return 0; | 178 | |
| 179 | if (umc8672_probe() == 0) | ||
| 180 | return 0;; | ||
| 181 | out: | ||
| 182 | return -ENODEV;; | ||
| 174 | } | 183 | } |
| 175 | 184 | ||
| 176 | #ifdef MODULE | 185 | #ifdef MODULE |
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 0a59d5ef1599..b2dc028dc8ca 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
| @@ -29,8 +29,6 @@ | |||
| 29 | * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE | 29 | * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE |
| 30 | * Interface and Linux Device Driver" Application Note. | 30 | * Interface and Linux Device Driver" Application Note. |
| 31 | */ | 31 | */ |
| 32 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 33 | |||
| 34 | #include <linux/types.h> | 32 | #include <linux/types.h> |
| 35 | #include <linux/module.h> | 33 | #include <linux/module.h> |
| 36 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 4debd18d52f8..83e0aa65a431 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/drivers/ide/pci/alim15x3.c Version 0.17 2003/01/02 | 2 | * linux/drivers/ide/pci/alim15x3.c Version 0.21 2007/02/03 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 1998-2000 Michel Aubry, Maintainer | 4 | * Copyright (C) 1998-2000 Michel Aubry, Maintainer |
| 5 | * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer | 5 | * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer |
| @@ -9,6 +9,7 @@ | |||
| 9 | * May be copied or modified under the terms of the GNU General Public License | 9 | * May be copied or modified under the terms of the GNU General Public License |
| 10 | * Copyright (C) 2002 Alan Cox <alan@redhat.com> | 10 | * Copyright (C) 2002 Alan Cox <alan@redhat.com> |
| 11 | * ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw> | 11 | * ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw> |
| 12 | * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> | ||
| 12 | * | 13 | * |
| 13 | * (U)DMA capable version of ali 1533/1543(C), 1535(D) | 14 | * (U)DMA capable version of ali 1533/1543(C), 1535(D) |
| 14 | * | 15 | * |
| @@ -280,15 +281,17 @@ static int ali_get_info (char *buffer, char **addr, off_t offset, int count) | |||
| 280 | #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ | 281 | #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ |
| 281 | 282 | ||
| 282 | /** | 283 | /** |
| 283 | * ali15x3_tune_drive - set up a drive | 284 | * ali15x3_tune_pio - set up chipset for PIO mode |
| 284 | * @drive: drive to tune | 285 | * @drive: drive to tune |
| 285 | * @pio: unused | 286 | * @pio: desired mode |
| 286 | * | 287 | * |
| 287 | * Select the best PIO timing for the drive in question. Then | 288 | * Select the best PIO mode for the drive in question. |
| 288 | * program the controller for this drive set up | 289 | * Then program the controller for this mode. |
| 290 | * | ||
| 291 | * Returns the PIO mode programmed. | ||
| 289 | */ | 292 | */ |
| 290 | 293 | ||
| 291 | static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) | 294 | static u8 ali15x3_tune_pio (ide_drive_t *drive, u8 pio) |
| 292 | { | 295 | { |
| 293 | ide_pio_data_t d; | 296 | ide_pio_data_t d; |
| 294 | ide_hwif_t *hwif = HWIF(drive); | 297 | ide_hwif_t *hwif = HWIF(drive); |
| @@ -356,6 +359,22 @@ static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 356 | * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) | 359 | * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) |
| 357 | */ | 360 | */ |
| 358 | 361 | ||
| 362 | return pio; | ||
| 363 | } | ||
| 364 | |||
| 365 | /** | ||
| 366 | * ali15x3_tune_drive - set up drive for PIO mode | ||
| 367 | * @drive: drive to tune | ||
| 368 | * @pio: desired mode | ||
| 369 | * | ||
| 370 | * Program the controller with the best PIO timing for the given drive. | ||
| 371 | * Then set up the drive itself. | ||
| 372 | */ | ||
| 373 | |||
| 374 | static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) | ||
| 375 | { | ||
| 376 | pio = ali15x3_tune_pio(drive, pio); | ||
| 377 | (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); | ||
| 359 | } | 378 | } |
| 360 | 379 | ||
| 361 | /** | 380 | /** |
| @@ -430,7 +449,7 @@ static u8 ali15x3_ratemask (ide_drive_t *drive) | |||
| 430 | } | 449 | } |
| 431 | 450 | ||
| 432 | /** | 451 | /** |
| 433 | * ali15x3_tune_chipset - set up chiset for new speed | 452 | * ali15x3_tune_chipset - set up chipset/drive for new speed |
| 434 | * @drive: drive to configure for | 453 | * @drive: drive to configure for |
| 435 | * @xferspeed: desired speed | 454 | * @xferspeed: desired speed |
| 436 | * | 455 | * |
| @@ -461,7 +480,7 @@ static int ali15x3_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
| 461 | pci_write_config_byte(dev, m5229_udma, tmpbyte); | 480 | pci_write_config_byte(dev, m5229_udma, tmpbyte); |
| 462 | 481 | ||
| 463 | if (speed < XFER_SW_DMA_0) | 482 | if (speed < XFER_SW_DMA_0) |
| 464 | ali15x3_tune_drive(drive, speed); | 483 | (void) ali15x3_tune_pio(drive, speed - XFER_PIO_0); |
| 465 | } else { | 484 | } else { |
| 466 | pci_read_config_byte(dev, m5229_udma, &tmpbyte); | 485 | pci_read_config_byte(dev, m5229_udma, &tmpbyte); |
| 467 | tmpbyte &= (0x0f << ((1-unit) << 2)); | 486 | tmpbyte &= (0x0f << ((1-unit) << 2)); |
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index 61b5f9c0b2f4..dc43f009acab 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
| @@ -98,7 +98,6 @@ | |||
| 98 | * (patch courtesy of Zoltan Hidvegi) | 98 | * (patch courtesy of Zoltan Hidvegi) |
| 99 | */ | 99 | */ |
| 100 | 100 | ||
| 101 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 102 | #define CMD640_PREFETCH_MASKS 1 | 101 | #define CMD640_PREFETCH_MASKS 1 |
| 103 | 102 | ||
| 104 | //#define CMD640_DUMP_REGS | 103 | //#define CMD640_DUMP_REGS |
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 49df27513da7..b0d4825c56a9 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 | 1 | /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 |
| 2 | * | 2 | * |
| 3 | * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002 | 3 | * linux/drivers/ide/pci/cmd64x.c Version 1.41 Feb 3, 2007 |
| 4 | * | 4 | * |
| 5 | * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. | 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 | 6 | * Note, this driver is not used at all on other systems because |
| @@ -12,6 +12,7 @@ | |||
| 12 | * Copyright (C) 1998 David S. Miller (davem@redhat.com) | 12 | * Copyright (C) 1998 David S. Miller (davem@redhat.com) |
| 13 | * | 13 | * |
| 14 | * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> | 14 | * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> |
| 15 | * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> | ||
| 15 | */ | 16 | */ |
| 16 | 17 | ||
| 17 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| @@ -262,43 +263,25 @@ static void program_drive_counts (ide_drive_t *drive, int setup_count, int activ | |||
| 262 | } | 263 | } |
| 263 | 264 | ||
| 264 | /* | 265 | /* |
| 265 | * Attempts to set the interface PIO mode. | 266 | * This routine selects drive's best PIO mode, calculates setup/active/recovery |
| 266 | * The preferred method of selecting PIO modes (e.g. mode 4) is | 267 | * counts, and then writes them into the chipset registers. |
| 267 | * "echo 'piomode:4' > /proc/ide/hdx/settings". Special cases are | ||
| 268 | * 8: prefetch off, 9: prefetch on, 255: auto-select best mode. | ||
| 269 | * Called with 255 at boot time. | ||
| 270 | */ | 268 | */ |
| 271 | 269 | static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) | |
| 272 | static void cmd64x_tuneproc (ide_drive_t *drive, u8 mode_wanted) | ||
| 273 | { | 270 | { |
| 274 | int setup_time, active_time, recovery_time; | 271 | int setup_time, active_time, recovery_time; |
| 275 | int clock_time, pio_mode, cycle_time; | 272 | int clock_time, pio_mode, cycle_time; |
| 276 | u8 recovery_count2, cycle_count; | 273 | u8 recovery_count2, cycle_count; |
| 277 | int setup_count, active_count, recovery_count; | 274 | int setup_count, active_count, recovery_count; |
| 278 | int bus_speed = system_bus_clock(); | 275 | int bus_speed = system_bus_clock(); |
| 279 | /*byte b;*/ | ||
| 280 | ide_pio_data_t d; | 276 | ide_pio_data_t d; |
| 281 | 277 | ||
| 282 | switch (mode_wanted) { | 278 | pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d); |
| 283 | case 8: /* set prefetch off */ | ||
| 284 | case 9: /* set prefetch on */ | ||
| 285 | mode_wanted &= 1; | ||
| 286 | /*set_prefetch_mode(index, mode_wanted);*/ | ||
| 287 | cmdprintk("%s: %sabled cmd640 prefetch\n", | ||
| 288 | drive->name, mode_wanted ? "en" : "dis"); | ||
| 289 | return; | ||
| 290 | } | ||
| 291 | |||
| 292 | mode_wanted = ide_get_best_pio_mode (drive, mode_wanted, 5, &d); | ||
| 293 | pio_mode = d.pio_mode; | ||
| 294 | cycle_time = d.cycle_time; | 279 | cycle_time = d.cycle_time; |
| 295 | 280 | ||
| 296 | /* | 281 | /* |
| 297 | * I copied all this complicated stuff from cmd640.c and made a few | 282 | * I copied all this complicated stuff from cmd640.c and made a few |
| 298 | * minor changes. For now I am just going to pray that it is correct. | 283 | * minor changes. For now I am just going to pray that it is correct. |
| 299 | */ | 284 | */ |
| 300 | if (pio_mode > 5) | ||
| 301 | pio_mode = 5; | ||
| 302 | setup_time = ide_pio_timings[pio_mode].setup_time; | 285 | setup_time = ide_pio_timings[pio_mode].setup_time; |
| 303 | active_time = ide_pio_timings[pio_mode].active_time; | 286 | active_time = ide_pio_timings[pio_mode].active_time; |
| 304 | recovery_time = cycle_time - (setup_time + active_time); | 287 | recovery_time = cycle_time - (setup_time + active_time); |
| @@ -320,22 +303,33 @@ static void cmd64x_tuneproc (ide_drive_t *drive, u8 mode_wanted) | |||
| 320 | if (active_count > 16) | 303 | if (active_count > 16) |
| 321 | active_count = 16; /* maximum allowed by cmd646 */ | 304 | active_count = 16; /* maximum allowed by cmd646 */ |
| 322 | 305 | ||
| 323 | /* | ||
| 324 | * In a perfect world, we might set the drive pio mode here | ||
| 325 | * (using WIN_SETFEATURE) before continuing. | ||
| 326 | * | ||
| 327 | * But we do not, because: | ||
| 328 | * 1) this is the wrong place to do it | ||
| 329 | * (proper is do_special() in ide.c) | ||
| 330 | * 2) in practice this is rarely, if ever, necessary | ||
| 331 | */ | ||
| 332 | program_drive_counts (drive, setup_count, active_count, recovery_count); | 306 | program_drive_counts (drive, setup_count, active_count, recovery_count); |
| 333 | 307 | ||
| 334 | cmdprintk("%s: selected cmd646 PIO mode%d : %d (%dns)%s, " | 308 | cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " |
| 335 | "clocks=%d/%d/%d\n", | 309 | "clocks=%d/%d/%d\n", |
| 336 | drive->name, pio_mode, mode_wanted, cycle_time, | 310 | drive->name, mode_wanted, pio_mode, cycle_time, |
| 337 | d.overridden ? " (overriding vendor mode)" : "", | 311 | d.overridden ? " (overriding vendor mode)" : "", |
| 338 | setup_count, active_count, recovery_count); | 312 | setup_count, active_count, recovery_count); |
| 313 | |||
| 314 | return pio_mode; | ||
| 315 | } | ||
| 316 | |||
| 317 | /* | ||
| 318 | * Attempts to set drive's PIO mode. | ||
| 319 | * Special cases are 8: prefetch off, 9: prefetch on (both never worked), | ||
| 320 | * and 255: auto-select best mode (used at boot time). | ||
| 321 | */ | ||
| 322 | static void cmd64x_tune_drive (ide_drive_t *drive, u8 pio) | ||
| 323 | { | ||
| 324 | /* | ||
| 325 | * Filter out the prefetch control values | ||
| 326 | * to prevent PIO5 from being programmed | ||
| 327 | */ | ||
| 328 | if (pio == 8 || pio == 9) | ||
| 329 | return; | ||
| 330 | |||
| 331 | pio = cmd64x_tune_pio(drive, pio); | ||
| 332 | (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); | ||
| 339 | } | 333 | } |
| 340 | 334 | ||
| 341 | static u8 cmd64x_ratemask (ide_drive_t *drive) | 335 | static u8 cmd64x_ratemask (ide_drive_t *drive) |
| @@ -387,22 +381,6 @@ static u8 cmd64x_ratemask (ide_drive_t *drive) | |||
| 387 | return mode; | 381 | return mode; |
| 388 | } | 382 | } |
| 389 | 383 | ||
| 390 | static void config_cmd64x_chipset_for_pio (ide_drive_t *drive, u8 set_speed) | ||
| 391 | { | ||
| 392 | u8 speed = 0x00; | ||
| 393 | u8 set_pio = ide_get_best_pio_mode(drive, 4, 5, NULL); | ||
| 394 | |||
| 395 | cmd64x_tuneproc(drive, set_pio); | ||
| 396 | speed = XFER_PIO_0 + set_pio; | ||
| 397 | if (set_speed) | ||
| 398 | (void) ide_config_drive_speed(drive, speed); | ||
| 399 | } | ||
| 400 | |||
| 401 | static void config_chipset_for_pio (ide_drive_t *drive, u8 set_speed) | ||
| 402 | { | ||
| 403 | config_cmd64x_chipset_for_pio(drive, set_speed); | ||
| 404 | } | ||
| 405 | |||
| 406 | static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) | 384 | static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) |
| 407 | { | 385 | { |
| 408 | ide_hwif_t *hwif = HWIF(drive); | 386 | ide_hwif_t *hwif = HWIF(drive); |
| @@ -414,7 +392,7 @@ static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
| 414 | 392 | ||
| 415 | u8 speed = ide_rate_filter(cmd64x_ratemask(drive), xferspeed); | 393 | u8 speed = ide_rate_filter(cmd64x_ratemask(drive), xferspeed); |
| 416 | 394 | ||
| 417 | if (speed > XFER_PIO_4) { | 395 | if (speed >= XFER_SW_DMA_0) { |
| 418 | (void) pci_read_config_byte(dev, pciD, ®D); | 396 | (void) pci_read_config_byte(dev, pciD, ®D); |
| 419 | (void) pci_read_config_byte(dev, pciU, ®U); | 397 | (void) pci_read_config_byte(dev, pciU, ®U); |
| 420 | regD &= ~(unit ? 0x40 : 0x20); | 398 | regD &= ~(unit ? 0x40 : 0x20); |
| @@ -438,17 +416,20 @@ static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
| 438 | case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; | 416 | case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; |
| 439 | case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; | 417 | case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; |
| 440 | case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; | 418 | case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; |
| 441 | case XFER_PIO_4: cmd64x_tuneproc(drive, 4); break; | 419 | case XFER_PIO_5: |
| 442 | case XFER_PIO_3: cmd64x_tuneproc(drive, 3); break; | 420 | case XFER_PIO_4: |
| 443 | case XFER_PIO_2: cmd64x_tuneproc(drive, 2); break; | 421 | case XFER_PIO_3: |
| 444 | case XFER_PIO_1: cmd64x_tuneproc(drive, 1); break; | 422 | case XFER_PIO_2: |
| 445 | case XFER_PIO_0: cmd64x_tuneproc(drive, 0); break; | 423 | case XFER_PIO_1: |
| 424 | case XFER_PIO_0: | ||
| 425 | (void) cmd64x_tune_pio(drive, speed - XFER_PIO_0); | ||
| 426 | break; | ||
| 446 | 427 | ||
| 447 | default: | 428 | default: |
| 448 | return 1; | 429 | return 1; |
| 449 | } | 430 | } |
| 450 | 431 | ||
| 451 | if (speed > XFER_PIO_4) { | 432 | if (speed >= XFER_SW_DMA_0) { |
| 452 | (void) pci_write_config_byte(dev, pciU, regU); | 433 | (void) pci_write_config_byte(dev, pciU, regU); |
| 453 | regD |= (unit ? 0x40 : 0x20); | 434 | regD |= (unit ? 0x40 : 0x20); |
| 454 | (void) pci_write_config_byte(dev, pciD, regD); | 435 | (void) pci_write_config_byte(dev, pciD, regD); |
| @@ -461,8 +442,6 @@ static int config_chipset_for_dma (ide_drive_t *drive) | |||
| 461 | { | 442 | { |
| 462 | u8 speed = ide_dma_speed(drive, cmd64x_ratemask(drive)); | 443 | u8 speed = ide_dma_speed(drive, cmd64x_ratemask(drive)); |
| 463 | 444 | ||
| 464 | config_chipset_for_pio(drive, !speed); | ||
| 465 | |||
| 466 | if (!speed) | 445 | if (!speed) |
| 467 | return 0; | 446 | return 0; |
| 468 | 447 | ||
| @@ -478,7 +457,7 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive) | |||
| 478 | return 0; | 457 | return 0; |
| 479 | 458 | ||
| 480 | if (ide_use_fast_pio(drive)) | 459 | if (ide_use_fast_pio(drive)) |
| 481 | config_chipset_for_pio(drive, 1); | 460 | cmd64x_tune_drive(drive, 255); |
| 482 | 461 | ||
| 483 | return -1; | 462 | return -1; |
| 484 | } | 463 | } |
| @@ -679,14 +658,13 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif) | |||
| 679 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); | 658 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); |
| 680 | class_rev &= 0xff; | 659 | class_rev &= 0xff; |
| 681 | 660 | ||
| 682 | hwif->tuneproc = &cmd64x_tuneproc; | 661 | hwif->tuneproc = &cmd64x_tune_drive; |
| 683 | hwif->speedproc = &cmd64x_tune_chipset; | 662 | hwif->speedproc = &cmd64x_tune_chipset; |
| 684 | 663 | ||
| 685 | if (!hwif->dma_base) { | 664 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; |
| 686 | hwif->drives[0].autotune = 1; | 665 | |
| 687 | hwif->drives[1].autotune = 1; | 666 | if (!hwif->dma_base) |
| 688 | return; | 667 | return; |
| 689 | } | ||
| 690 | 668 | ||
| 691 | hwif->atapi_dma = 1; | 669 | hwif->atapi_dma = 1; |
| 692 | 670 | ||
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index e2672fc65d30..d4b753e70119 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c | |||
| @@ -122,7 +122,7 @@ static struct pci_driver driver = { | |||
| 122 | static int | 122 | static int |
| 123 | delkin_cb_init (void) | 123 | delkin_cb_init (void) |
| 124 | { | 124 | { |
| 125 | return pci_module_init(&driver); | 125 | return pci_register_driver(&driver); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static void | 128 | static void |
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index b408c6c517ea..f2c5a141ca10 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | * are deemed to be part of the source code. | 21 | * are deemed to be part of the source code. |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 25 | |||
| 26 | #include <linux/types.h> | 24 | #include <linux/types.h> |
| 27 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 28 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index 9ca60dd2185e..aede7eee9246 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c | |||
| @@ -57,7 +57,7 @@ | |||
| 57 | * There is a 25/33MHz switch in configuration | 57 | * There is a 25/33MHz switch in configuration |
| 58 | * register, but driver is written for use at any frequency which get | 58 | * register, but driver is written for use at any frequency which get |
| 59 | * (use idebus=xx to select PCI bus speed). | 59 | * (use idebus=xx to select PCI bus speed). |
| 60 | * Use ide0=autotune for automatical tune of the PIO modes. | 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 | 61 | * If you get strange results, do not use this and set PIO manually |
| 62 | * by hdparm. | 62 | * by hdparm. |
| 63 | * | 63 | * |
| @@ -87,7 +87,6 @@ | |||
| 87 | * 0.5 doesn't work. | 87 | * 0.5 doesn't work. |
| 88 | */ | 88 | */ |
| 89 | 89 | ||
| 90 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 91 | #define OPTI621_DEBUG /* define for debug messages */ | 90 | #define OPTI621_DEBUG /* define for debug messages */ |
| 92 | 91 | ||
| 93 | #include <linux/types.h> | 92 | #include <linux/types.h> |
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 569822f4cf55..061d300ab8be 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/drivers/ide/pci/piix.c Version 0.46 December 3, 2006 | 2 | * linux/drivers/ide/pci/piix.c Version 0.47 February 8, 2007 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer | 4 | * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer |
| 5 | * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> | 5 | * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> |
| 6 | * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> | 6 | * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> |
| 7 | * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com> | 7 | * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> |
| 8 | * | 8 | * |
| 9 | * May be copied or modified under the terms of the GNU General Public License | 9 | * May be copied or modified under the terms of the GNU General Public License |
| 10 | * | 10 | * |
| @@ -205,14 +205,13 @@ static u8 piix_dma_2_pio (u8 xfer_rate) { | |||
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | /** | 207 | /** |
| 208 | * piix_tune_drive - tune a drive attached to a PIIX | 208 | * piix_tune_pio - tune PIIX for PIO mode |
| 209 | * @drive: drive to tune | 209 | * @drive: drive to tune |
| 210 | * @pio: desired PIO mode | 210 | * @pio: desired PIO mode |
| 211 | * | 211 | * |
| 212 | * Set the interface PIO mode based upon the settings done by AMI BIOS | 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 | */ | 213 | */ |
| 215 | static void piix_tune_drive (ide_drive_t *drive, u8 pio) | 214 | static void piix_tune_pio (ide_drive_t *drive, u8 pio) |
| 216 | { | 215 | { |
| 217 | ide_hwif_t *hwif = HWIF(drive); | 216 | ide_hwif_t *hwif = HWIF(drive); |
| 218 | struct pci_dev *dev = hwif->pci_dev; | 217 | struct pci_dev *dev = hwif->pci_dev; |
| @@ -233,8 +232,6 @@ static void piix_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 233 | { 2, 1 }, | 232 | { 2, 1 }, |
| 234 | { 2, 3 }, }; | 233 | { 2, 3 }, }; |
| 235 | 234 | ||
| 236 | pio = ide_get_best_pio_mode(drive, pio, 4, NULL); | ||
| 237 | |||
| 238 | /* | 235 | /* |
| 239 | * Master vs slave is synchronized above us but the slave register is | 236 | * Master vs slave is synchronized above us but the slave register is |
| 240 | * shared by the two hwifs so the corner case of two slave timeouts in | 237 | * shared by the two hwifs so the corner case of two slave timeouts in |
| @@ -253,19 +250,20 @@ static void piix_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 253 | master_data |= 0x4000; | 250 | master_data |= 0x4000; |
| 254 | master_data &= ~0x0070; | 251 | master_data &= ~0x0070; |
| 255 | if (pio > 1) { | 252 | if (pio > 1) { |
| 256 | /* enable PPE, IE and TIME */ | 253 | /* Set PPE, IE and TIME */ |
| 257 | master_data = master_data | (control << 4); | 254 | master_data |= control << 4; |
| 258 | } | 255 | } |
| 259 | pci_read_config_byte(dev, slave_port, &slave_data); | 256 | pci_read_config_byte(dev, slave_port, &slave_data); |
| 260 | slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); | 257 | slave_data &= hwif->channel ? 0x0f : 0xf0; |
| 261 | slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); | 258 | slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << |
| 259 | (hwif->channel ? 4 : 0); | ||
| 262 | } else { | 260 | } else { |
| 263 | master_data &= ~0x3307; | 261 | master_data &= ~0x3307; |
| 264 | if (pio > 1) { | 262 | if (pio > 1) { |
| 265 | /* enable PPE, IE and TIME */ | 263 | /* enable PPE, IE and TIME */ |
| 266 | master_data = master_data | control; | 264 | master_data |= control; |
| 267 | } | 265 | } |
| 268 | master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); | 266 | master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); |
| 269 | } | 267 | } |
| 270 | pci_write_config_word(dev, master_port, master_data); | 268 | pci_write_config_word(dev, master_port, master_data); |
| 271 | if (is_slave) | 269 | if (is_slave) |
| @@ -274,6 +272,21 @@ static void piix_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 274 | } | 272 | } |
| 275 | 273 | ||
| 276 | /** | 274 | /** |
| 275 | * piix_tune_drive - tune a drive attached to PIIX | ||
| 276 | * @drive: drive to tune | ||
| 277 | * @pio: desired PIO mode | ||
| 278 | * | ||
| 279 | * Set the drive's PIO mode (might be useful if drive is not registered | ||
| 280 | * in CMOS for any reason). | ||
| 281 | */ | ||
| 282 | static void piix_tune_drive (ide_drive_t *drive, u8 pio) | ||
| 283 | { | ||
| 284 | pio = ide_get_best_pio_mode(drive, pio, 4, NULL); | ||
| 285 | piix_tune_pio(drive, pio); | ||
| 286 | (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); | ||
| 287 | } | ||
| 288 | |||
| 289 | /** | ||
| 277 | * piix_tune_chipset - tune a PIIX interface | 290 | * piix_tune_chipset - tune a PIIX interface |
| 278 | * @drive: IDE drive to tune | 291 | * @drive: IDE drive to tune |
| 279 | * @xferspeed: speed to configure | 292 | * @xferspeed: speed to configure |
| @@ -348,8 +361,8 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
| 348 | pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); | 361 | pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); |
| 349 | } | 362 | } |
| 350 | 363 | ||
| 351 | piix_tune_drive(drive, piix_dma_2_pio(speed)); | 364 | piix_tune_pio(drive, piix_dma_2_pio(speed)); |
| 352 | return (ide_config_drive_speed(drive, speed)); | 365 | return ide_config_drive_speed(drive, speed); |
| 353 | } | 366 | } |
| 354 | 367 | ||
| 355 | /** | 368 | /** |
| @@ -392,9 +405,7 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive) | |||
| 392 | return 0; | 405 | return 0; |
| 393 | 406 | ||
| 394 | if (ide_use_fast_pio(drive)) | 407 | if (ide_use_fast_pio(drive)) |
| 395 | /* Find best PIO mode. */ | 408 | piix_tune_drive(drive, 255); |
| 396 | piix_tune_chipset(drive, XFER_PIO_0 + | ||
| 397 | ide_get_best_pio_mode(drive, 255, 4, NULL)); | ||
| 398 | 409 | ||
| 399 | return -1; | 410 | return -1; |
| 400 | } | 411 | } |
diff --git a/drivers/ide/pci/rz1000.c b/drivers/ide/pci/rz1000.c index c1855311052b..f8c954690142 100644 --- a/drivers/ide/pci/rz1000.c +++ b/drivers/ide/pci/rz1000.c | |||
| @@ -15,8 +15,6 @@ | |||
| 15 | * Dunno if this fixes both ports, or only the primary port (?). | 15 | * Dunno if this fixes both ports, or only the primary port (?). |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #undef REALLY_SLOW_IO /* most systems can safely undef this */ | ||
| 19 | |||
| 20 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 21 | #include <linux/module.h> | 19 | #include <linux/module.h> |
| 22 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 7b4c189a9d99..71eccdf5f817 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
| @@ -26,6 +26,11 @@ | |||
| 26 | * If you have strange problems with nVidia chipset systems please | 26 | * If you have strange problems with nVidia chipset systems please |
| 27 | * see the SI support documentation and update your system BIOS | 27 | * see the SI support documentation and update your system BIOS |
| 28 | * if neccessary | 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. | ||
| 29 | */ | 34 | */ |
| 30 | 35 | ||
| 31 | #include <linux/types.h> | 36 | #include <linux/types.h> |
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index ae7eb58d961c..852ccb36da1d 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/drivers/ide/pci/slc90e66.c Version 0.13 December 30, 2006 | 2 | * linux/drivers/ide/pci/slc90e66.c Version 0.14 February 8, 2007 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> |
| 5 | * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com> | 5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> |
| 6 | * | 6 | * |
| 7 | * This is a look-alike variation of the ICH0 PIIX4 Ultra-66, | 7 | * This is a look-alike variation of the ICH0 PIIX4 Ultra-66, |
| 8 | * but this keeps the ISA-Bridge and slots alive. | 8 | * but this keeps the ISA-Bridge and slots alive. |
| @@ -57,11 +57,7 @@ static u8 slc90e66_dma_2_pio (u8 xfer_rate) { | |||
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | /* | 60 | static void slc90e66_tune_pio (ide_drive_t *drive, u8 pio) |
| 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 | { | 61 | { |
| 66 | ide_hwif_t *hwif = HWIF(drive); | 62 | ide_hwif_t *hwif = HWIF(drive); |
| 67 | struct pci_dev *dev = hwif->pci_dev; | 63 | struct pci_dev *dev = hwif->pci_dev; |
| @@ -80,7 +76,6 @@ static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 80 | { 2, 1 }, | 76 | { 2, 1 }, |
| 81 | { 2, 3 }, }; | 77 | { 2, 3 }, }; |
| 82 | 78 | ||
| 83 | pio = ide_get_best_pio_mode(drive, pio, 4, NULL); | ||
| 84 | spin_lock_irqsave(&ide_lock, flags); | 79 | spin_lock_irqsave(&ide_lock, flags); |
| 85 | pci_read_config_word(dev, master_port, &master_data); | 80 | pci_read_config_word(dev, master_port, &master_data); |
| 86 | 81 | ||
| @@ -94,19 +89,20 @@ static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 94 | master_data |= 0x4000; | 89 | master_data |= 0x4000; |
| 95 | master_data &= ~0x0070; | 90 | master_data &= ~0x0070; |
| 96 | if (pio > 1) { | 91 | if (pio > 1) { |
| 97 | /* enable PPE, IE and TIME */ | 92 | /* Set PPE, IE and TIME */ |
| 98 | master_data = master_data | (control << 4); | 93 | master_data |= control << 4; |
| 99 | } | 94 | } |
| 100 | pci_read_config_byte(dev, slave_port, &slave_data); | 95 | pci_read_config_byte(dev, slave_port, &slave_data); |
| 101 | slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); | 96 | slave_data &= hwif->channel ? 0x0f : 0xf0; |
| 102 | slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); | 97 | slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << |
| 98 | (hwif->channel ? 4 : 0); | ||
| 103 | } else { | 99 | } else { |
| 104 | master_data &= ~0x3307; | 100 | master_data &= ~0x3307; |
| 105 | if (pio > 1) { | 101 | if (pio > 1) { |
| 106 | /* enable PPE, IE and TIME */ | 102 | /* enable PPE, IE and TIME */ |
| 107 | master_data = master_data | control; | 103 | master_data |= control; |
| 108 | } | 104 | } |
| 109 | master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); | 105 | master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); |
| 110 | } | 106 | } |
| 111 | pci_write_config_word(dev, master_port, master_data); | 107 | pci_write_config_word(dev, master_port, master_data); |
| 112 | if (is_slave) | 108 | if (is_slave) |
| @@ -114,6 +110,13 @@ static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) | |||
| 114 | spin_unlock_irqrestore(&ide_lock, flags); | 110 | spin_unlock_irqrestore(&ide_lock, flags); |
| 115 | } | 111 | } |
| 116 | 112 | ||
| 113 | static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) | ||
| 114 | { | ||
| 115 | pio = ide_get_best_pio_mode(drive, pio, 4, NULL); | ||
| 116 | slc90e66_tune_pio(drive, pio); | ||
| 117 | (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); | ||
| 118 | } | ||
| 119 | |||
| 117 | static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) | 120 | static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) |
| 118 | { | 121 | { |
| 119 | ide_hwif_t *hwif = HWIF(drive); | 122 | ide_hwif_t *hwif = HWIF(drive); |
| @@ -162,8 +165,8 @@ static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
| 162 | pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); | 165 | pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); |
| 163 | } | 166 | } |
| 164 | 167 | ||
| 165 | slc90e66_tune_drive(drive, slc90e66_dma_2_pio(speed)); | 168 | slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); |
| 166 | return (ide_config_drive_speed(drive, speed)); | 169 | return ide_config_drive_speed(drive, speed); |
| 167 | } | 170 | } |
| 168 | 171 | ||
| 169 | static int slc90e66_config_drive_for_dma (ide_drive_t *drive) | 172 | static int slc90e66_config_drive_for_dma (ide_drive_t *drive) |
| @@ -185,8 +188,7 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) | |||
| 185 | return 0; | 188 | return 0; |
| 186 | 189 | ||
| 187 | if (ide_use_fast_pio(drive)) | 190 | if (ide_use_fast_pio(drive)) |
| 188 | (void)slc90e66_tune_chipset(drive, XFER_PIO_0 + | 191 | slc90e66_tune_drive(drive, 255); |
| 189 | ide_get_best_pio_mode(drive, 255, 4, NULL)); | ||
| 190 | 192 | ||
| 191 | return -1; | 193 | return -1; |
| 192 | } | 194 | } |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 395d35253d5d..071a030ec26e 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | #include <asm/mediabay.h> | 48 | #include <asm/mediabay.h> |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | #include "ide-timing.h" | 51 | #include "../ide-timing.h" |
| 52 | 52 | ||
| 53 | #undef IDE_PMAC_DEBUG | 53 | #undef IDE_PMAC_DEBUG |
| 54 | 54 | ||
| @@ -1551,19 +1551,34 @@ static struct pci_driver pmac_ide_pci_driver = { | |||
| 1551 | }; | 1551 | }; |
| 1552 | MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); | 1552 | MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); |
| 1553 | 1553 | ||
| 1554 | void __init | 1554 | int __init pmac_ide_probe(void) |
| 1555 | pmac_ide_probe(void) | ||
| 1556 | { | 1555 | { |
| 1556 | int error; | ||
| 1557 | |||
| 1557 | if (!machine_is(powermac)) | 1558 | if (!machine_is(powermac)) |
| 1558 | return; | 1559 | return -ENODEV; |
| 1559 | 1560 | ||
| 1560 | #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST | 1561 | #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST |
| 1561 | pci_register_driver(&pmac_ide_pci_driver); | 1562 | error = pci_register_driver(&pmac_ide_pci_driver); |
| 1562 | macio_register_driver(&pmac_ide_macio_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 | } | ||
| 1563 | #else | 1570 | #else |
| 1564 | macio_register_driver(&pmac_ide_macio_driver); | 1571 | error = macio_register_driver(&pmac_ide_macio_driver); |
| 1565 | pci_register_driver(&pmac_ide_pci_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 | } | ||
| 1566 | #endif | 1579 | #endif |
| 1580 | out: | ||
| 1581 | return error; | ||
| 1567 | } | 1582 | } |
| 1568 | 1583 | ||
| 1569 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | 1584 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC |
| @@ -1983,7 +1998,7 @@ static void pmac_ide_dma_host_off(ide_drive_t *drive) | |||
| 1983 | { | 1998 | { |
| 1984 | } | 1999 | } |
| 1985 | 2000 | ||
| 1986 | static int pmac_ide_dma_host_on(ide_drive_t *drive) | 2001 | static void pmac_ide_dma_host_on(ide_drive_t *drive) |
| 1987 | { | 2002 | { |
| 1988 | } | 2003 | } |
| 1989 | 2004 | ||
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/ppc/scc_pata.c index de64b022478b..f84bf791f72e 100644 --- a/drivers/ide/ppc/scc_pata.c +++ b/drivers/ide/ppc/scc_pata.c | |||
| @@ -509,6 +509,32 @@ static int scc_ide_dma_end(ide_drive_t * drive) | |||
| 509 | return __ide_dma_end(drive); | 509 | return __ide_dma_end(drive); |
| 510 | } | 510 | } |
| 511 | 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 | |||
| 512 | /** | 538 | /** |
| 513 | * setup_mmio_scc - map CTRL/BMID region | 539 | * setup_mmio_scc - map CTRL/BMID region |
| 514 | * @dev: PCI device we are configuring | 540 | * @dev: PCI device we are configuring |
| @@ -712,6 +738,7 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif) | |||
| 712 | hwif->speedproc = scc_tune_chipset; | 738 | hwif->speedproc = scc_tune_chipset; |
| 713 | hwif->tuneproc = scc_tuneproc; | 739 | hwif->tuneproc = scc_tuneproc; |
| 714 | hwif->ide_dma_check = scc_config_drive_for_dma; | 740 | hwif->ide_dma_check = scc_config_drive_for_dma; |
| 741 | hwif->ide_dma_test_irq = scc_dma_test_irq; | ||
| 715 | 742 | ||
| 716 | hwif->drives[0].autotune = IDE_TUNE_AUTO; | 743 | hwif->drives[0].autotune = IDE_TUNE_AUTO; |
| 717 | hwif->drives[1].autotune = IDE_TUNE_AUTO; | 744 | hwif->drives[1].autotune = IDE_TUNE_AUTO; |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 2fe1d690eb13..a4a96826d9e0 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
| @@ -682,7 +682,34 @@ static void pci_read_irq(struct pci_dev *dev) | |||
| 682 | dev->irq = irq; | 682 | dev->irq = irq; |
| 683 | } | 683 | } |
| 684 | 684 | ||
| 685 | #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) | 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 | } | ||
| 686 | 713 | ||
| 687 | /** | 714 | /** |
| 688 | * pci_setup_device - fill in class and map information of a device | 715 | * pci_setup_device - fill in class and map information of a device |
| @@ -735,20 +762,12 @@ static int pci_setup_device(struct pci_dev * dev) | |||
| 735 | u8 progif; | 762 | u8 progif; |
| 736 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); | 763 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); |
| 737 | if ((progif & 1) == 0) { | 764 | if ((progif & 1) == 0) { |
| 738 | dev->resource[0].start = 0x1F0; | 765 | change_legacy_io_resource(dev, 0, 0x1F0, 0x1F7); |
| 739 | dev->resource[0].end = 0x1F7; | 766 | change_legacy_io_resource(dev, 1, 0x3F6, 0x3F6); |
| 740 | dev->resource[0].flags = LEGACY_IO_RESOURCE; | ||
| 741 | dev->resource[1].start = 0x3F6; | ||
| 742 | dev->resource[1].end = 0x3F6; | ||
| 743 | dev->resource[1].flags = LEGACY_IO_RESOURCE; | ||
| 744 | } | 767 | } |
| 745 | if ((progif & 4) == 0) { | 768 | if ((progif & 4) == 0) { |
| 746 | dev->resource[2].start = 0x170; | 769 | change_legacy_io_resource(dev, 2, 0x170, 0x177); |
| 747 | dev->resource[2].end = 0x177; | 770 | change_legacy_io_resource(dev, 3, 0x376, 0x376); |
| 748 | dev->resource[2].flags = LEGACY_IO_RESOURCE; | ||
| 749 | dev->resource[3].start = 0x376; | ||
| 750 | dev->resource[3].end = 0x376; | ||
| 751 | dev->resource[3].flags = LEGACY_IO_RESOURCE; | ||
| 752 | } | 771 | } |
| 753 | } | 772 | } |
| 754 | break; | 773 | break; |
