diff options
Diffstat (limited to 'drivers/ide')
| -rw-r--r-- | drivers/ide/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/ide/arm/bast-ide.c | 1 | ||||
| -rw-r--r-- | drivers/ide/arm/ide_arm.c | 1 | ||||
| -rw-r--r-- | drivers/ide/arm/palm_bk3710.c | 25 | ||||
| -rw-r--r-- | drivers/ide/ide-generic.c | 10 | ||||
| -rw-r--r-- | drivers/ide/ide-pnp.c | 1 | ||||
| -rw-r--r-- | drivers/ide/ide-probe.c | 8 | ||||
| -rw-r--r-- | drivers/ide/ide-proc.c | 3 | ||||
| -rw-r--r-- | drivers/ide/ide-taskfile.c | 6 | ||||
| -rw-r--r-- | drivers/ide/ide.c | 24 | ||||
| -rw-r--r-- | drivers/ide/legacy/buddha.c | 2 | ||||
| -rw-r--r-- | drivers/ide/legacy/falconide.c | 2 | ||||
| -rw-r--r-- | drivers/ide/legacy/gayle.c | 6 | ||||
| -rw-r--r-- | drivers/ide/legacy/ide-cs.c | 44 | ||||
| -rw-r--r-- | drivers/ide/legacy/macide.c | 2 | ||||
| -rw-r--r-- | drivers/ide/legacy/q40ide.c | 2 | ||||
| -rw-r--r-- | drivers/ide/pci/cmd640.c | 2 | ||||
| -rw-r--r-- | drivers/ide/pci/delkin_cb.c | 28 | ||||
| -rw-r--r-- | drivers/ide/pci/opti621.c | 221 | ||||
| -rw-r--r-- | drivers/ide/pci/sis5513.c | 5 | ||||
| -rw-r--r-- | drivers/ide/ppc/mpc8xx.c | 4 | ||||
| -rw-r--r-- | drivers/ide/ppc/pmac.c | 60 |
22 files changed, 171 insertions, 287 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index b4f3aefa12b6..1607536ff5fb 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
| @@ -1028,6 +1028,7 @@ endif | |||
| 1028 | 1028 | ||
| 1029 | config BLK_DEV_HD_ONLY | 1029 | config BLK_DEV_HD_ONLY |
| 1030 | bool "Old hard disk (MFM/RLL/IDE) driver" | 1030 | bool "Old hard disk (MFM/RLL/IDE) driver" |
| 1031 | depends on !ARM || ARCH_RPC || ARCH_SHARK || BROKEN | ||
| 1031 | help | 1032 | help |
| 1032 | There are two drivers for MFM/RLL/IDE hard disks. Most people use | 1033 | There are two drivers for MFM/RLL/IDE hard disks. Most people use |
| 1033 | the newer enhanced driver, but this old one is still around for two | 1034 | the newer enhanced driver, but this old one is still around for two |
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c index 713cef20622e..8e8c28104b45 100644 --- a/drivers/ide/arm/bast-ide.c +++ b/drivers/ide/arm/bast-ide.c | |||
| @@ -42,6 +42,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq) | |||
| 42 | 42 | ||
| 43 | hw.io_ports.ctl_addr = aux + (6 * 0x20); | 43 | hw.io_ports.ctl_addr = aux + (6 * 0x20); |
| 44 | hw.irq = irq; | 44 | hw.irq = irq; |
| 45 | hw.chipset = ide_generic; | ||
| 45 | 46 | ||
| 46 | hwif = ide_find_port(); | 47 | hwif = ide_find_port(); |
| 47 | if (hwif == NULL) | 48 | if (hwif == NULL) |
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c index 4263ffd4ab20..2f311da4c963 100644 --- a/drivers/ide/arm/ide_arm.c +++ b/drivers/ide/arm/ide_arm.c | |||
| @@ -49,6 +49,7 @@ static int __init ide_arm_init(void) | |||
| 49 | memset(&hw, 0, sizeof(hw)); | 49 | memset(&hw, 0, sizeof(hw)); |
| 50 | ide_std_init_ports(&hw, base, ctl); | 50 | ide_std_init_ports(&hw, base, ctl); |
| 51 | hw.irq = IDE_ARM_IRQ; | 51 | hw.irq = IDE_ARM_IRQ; |
| 52 | hw.chipset = ide_generic; | ||
| 52 | 53 | ||
| 53 | hwif = ide_find_port(); | 54 | hwif = ide_find_port(); |
| 54 | if (hwif) { | 55 | if (hwif) { |
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index 96378ebfb31f..cc24803fadff 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
| @@ -353,8 +353,8 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
| 353 | struct clk *clkp; | 353 | struct clk *clkp; |
| 354 | struct resource *mem, *irq; | 354 | struct resource *mem, *irq; |
| 355 | ide_hwif_t *hwif; | 355 | ide_hwif_t *hwif; |
| 356 | void __iomem *base; | 356 | unsigned long base; |
| 357 | int pribase, i; | 357 | int i; |
| 358 | hw_regs_t hw; | 358 | hw_regs_t hw; |
| 359 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 359 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
| 360 | 360 | ||
| @@ -374,22 +374,27 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
| 374 | printk(KERN_ERR "failed to get memory region resource\n"); | 374 | printk(KERN_ERR "failed to get memory region resource\n"); |
| 375 | return -ENODEV; | 375 | return -ENODEV; |
| 376 | } | 376 | } |
| 377 | |||
| 377 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 378 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
| 378 | if (irq == NULL) { | 379 | if (irq == NULL) { |
| 379 | printk(KERN_ERR "failed to get IRQ resource\n"); | 380 | printk(KERN_ERR "failed to get IRQ resource\n"); |
| 380 | return -ENODEV; | 381 | return -ENODEV; |
| 381 | } | 382 | } |
| 382 | 383 | ||
| 383 | base = (void *)mem->start; | 384 | if (request_mem_region(mem->start, mem->end - mem->start + 1, |
| 385 | "palm_bk3710") == NULL) { | ||
| 386 | printk(KERN_ERR "failed to request memory region\n"); | ||
| 387 | return -EBUSY; | ||
| 388 | } | ||
| 389 | |||
| 390 | base = IO_ADDRESS(mem->start); | ||
| 384 | 391 | ||
| 385 | /* Configure the Palm Chip controller */ | 392 | /* Configure the Palm Chip controller */ |
| 386 | palm_bk3710_chipinit(base); | 393 | palm_bk3710_chipinit((void __iomem *)base); |
| 387 | 394 | ||
| 388 | pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET; | ||
| 389 | for (i = 0; i < IDE_NR_PORTS - 2; i++) | 395 | for (i = 0; i < IDE_NR_PORTS - 2; i++) |
| 390 | hw.io_ports_array[i] = pribase + i; | 396 | hw.io_ports_array[i] = base + IDE_PALM_ATA_PRI_REG_OFFSET + i; |
| 391 | hw.io_ports.ctl_addr = mem->start + | 397 | hw.io_ports.ctl_addr = base + IDE_PALM_ATA_PRI_CTL_OFFSET; |
| 392 | IDE_PALM_ATA_PRI_CTL_OFFSET; | ||
| 393 | hw.irq = irq->start; | 398 | hw.irq = irq->start; |
| 394 | hw.chipset = ide_palm3710; | 399 | hw.chipset = ide_palm3710; |
| 395 | 400 | ||
| @@ -409,9 +414,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
| 409 | 414 | ||
| 410 | ide_device_add(idx, &palm_bk3710_port_info); | 415 | ide_device_add(idx, &palm_bk3710_port_info); |
| 411 | 416 | ||
| 412 | if (!hwif->present) | ||
| 413 | goto out; | ||
| 414 | |||
| 415 | return 0; | 417 | return 0; |
| 416 | out: | 418 | out: |
| 417 | printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); | 419 | printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); |
| @@ -437,4 +439,3 @@ static int __init palm_bk3710_init(void) | |||
| 437 | 439 | ||
| 438 | module_init(palm_bk3710_init); | 440 | module_init(palm_bk3710_init); |
| 439 | MODULE_LICENSE("GPL"); | 441 | MODULE_LICENSE("GPL"); |
| 440 | |||
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index a6073e248f45..2d92214096ab 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c | |||
| @@ -22,6 +22,10 @@ | |||
| 22 | 22 | ||
| 23 | #define DRV_NAME "ide_generic" | 23 | #define DRV_NAME "ide_generic" |
| 24 | 24 | ||
| 25 | static int probe_mask = 0x03; | ||
| 26 | module_param(probe_mask, int, 0); | ||
| 27 | MODULE_PARM_DESC(probe_mask, "probe mask for legacy ISA IDE ports"); | ||
| 28 | |||
| 25 | static ssize_t store_add(struct class *cls, const char *buf, size_t n) | 29 | static ssize_t store_add(struct class *cls, const char *buf, size_t n) |
| 26 | { | 30 | { |
| 27 | ide_hwif_t *hwif; | 31 | ide_hwif_t *hwif; |
| @@ -89,6 +93,9 @@ static int __init ide_generic_init(void) | |||
| 89 | u8 idx[MAX_HWIFS]; | 93 | u8 idx[MAX_HWIFS]; |
| 90 | int i; | 94 | int i; |
| 91 | 95 | ||
| 96 | printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " | ||
| 97 | "parameter for probing all legacy ISA IDE ports\n"); | ||
| 98 | |||
| 92 | for (i = 0; i < MAX_HWIFS; i++) { | 99 | for (i = 0; i < MAX_HWIFS; i++) { |
| 93 | ide_hwif_t *hwif; | 100 | ide_hwif_t *hwif; |
| 94 | unsigned long io_addr = ide_default_io_base(i); | 101 | unsigned long io_addr = ide_default_io_base(i); |
| @@ -96,7 +103,7 @@ static int __init ide_generic_init(void) | |||
| 96 | 103 | ||
| 97 | idx[i] = 0xff; | 104 | idx[i] = 0xff; |
| 98 | 105 | ||
| 99 | if (io_addr) { | 106 | if ((probe_mask & (1 << i)) && io_addr) { |
| 100 | if (!request_region(io_addr, 8, DRV_NAME)) { | 107 | if (!request_region(io_addr, 8, DRV_NAME)) { |
| 101 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX " | 108 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX " |
| 102 | "not free.\n", | 109 | "not free.\n", |
| @@ -125,6 +132,7 @@ static int __init ide_generic_init(void) | |||
| 125 | memset(&hw, 0, sizeof(hw)); | 132 | memset(&hw, 0, sizeof(hw)); |
| 126 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); | 133 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); |
| 127 | hw.irq = ide_default_irq(io_addr); | 134 | hw.irq = ide_default_irq(io_addr); |
| 135 | hw.chipset = ide_generic; | ||
| 128 | ide_init_port_hw(hwif, &hw); | 136 | ide_init_port_hw(hwif, &hw); |
| 129 | 137 | ||
| 130 | idx[i] = i; | 138 | idx[i] = i; |
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index 6a8953f68e9f..adbd01784162 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
| @@ -55,6 +55,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
| 55 | memset(&hw, 0, sizeof(hw)); | 55 | memset(&hw, 0, sizeof(hw)); |
| 56 | ide_std_init_ports(&hw, base, ctl); | 56 | ide_std_init_ports(&hw, base, ctl); |
| 57 | hw.irq = pnp_irq(dev, 0); | 57 | hw.irq = pnp_irq(dev, 0); |
| 58 | hw.chipset = ide_generic; | ||
| 58 | 59 | ||
| 59 | hwif = ide_find_port(); | 60 | hwif = ide_find_port(); |
| 60 | if (hwif) { | 61 | if (hwif) { |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 655ec7ef568a..d27061b39324 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
| @@ -646,8 +646,6 @@ static int ide_register_port(ide_hwif_t *hwif) | |||
| 646 | goto out; | 646 | goto out; |
| 647 | } | 647 | } |
| 648 | 648 | ||
| 649 | get_device(&hwif->gendev); | ||
| 650 | |||
| 651 | hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev, | 649 | hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev, |
| 652 | MKDEV(0, 0), hwif, hwif->name); | 650 | MKDEV(0, 0), hwif, hwif->name); |
| 653 | if (IS_ERR(hwif->portdev)) { | 651 | if (IS_ERR(hwif->portdev)) { |
| @@ -1333,8 +1331,7 @@ static void ide_port_init_devices(ide_hwif_t *hwif) | |||
| 1333 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, | 1331 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, |
| 1334 | const struct ide_port_info *d) | 1332 | const struct ide_port_info *d) |
| 1335 | { | 1333 | { |
| 1336 | if (d->chipset != ide_etrax100) | 1334 | hwif->channel = port; |
| 1337 | hwif->channel = port; | ||
| 1338 | 1335 | ||
| 1339 | if (d->chipset) | 1336 | if (d->chipset) |
| 1340 | hwif->chipset = d->chipset; | 1337 | hwif->chipset = d->chipset; |
| @@ -1519,7 +1516,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
| 1519 | continue; | 1516 | continue; |
| 1520 | } | 1517 | } |
| 1521 | 1518 | ||
| 1522 | if (d->chipset != ide_etrax100 && (i & 1) && mate) { | 1519 | if ((i & 1) && mate) { |
| 1523 | hwif->mate = mate; | 1520 | hwif->mate = mate; |
| 1524 | mate->mate = hwif; | 1521 | mate->mate = hwif; |
| 1525 | } | 1522 | } |
| @@ -1665,6 +1662,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no, | |||
| 1665 | 1662 | ||
| 1666 | ide_std_init_ports(hw, base, ctl); | 1663 | ide_std_init_ports(hw, base, ctl); |
| 1667 | hw->irq = irq; | 1664 | hw->irq = irq; |
| 1665 | hw->chipset = d->chipset; | ||
| 1668 | 1666 | ||
| 1669 | hwif = ide_find_port_slot(d); | 1667 | hwif = ide_find_port_slot(d); |
| 1670 | if (hwif) { | 1668 | if (hwif) { |
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 8d6ad812a014..8af88bf0969b 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
| @@ -63,7 +63,6 @@ static int proc_ide_read_imodel | |||
| 63 | case ide_pmac: name = "mac-io"; break; | 63 | case ide_pmac: name = "mac-io"; break; |
| 64 | case ide_au1xxx: name = "au1xxx"; break; | 64 | case ide_au1xxx: name = "au1xxx"; break; |
| 65 | case ide_palm3710: name = "palm3710"; break; | 65 | case ide_palm3710: name = "palm3710"; break; |
| 66 | case ide_etrax100: name = "etrax100"; break; | ||
| 67 | case ide_acorn: name = "acorn"; break; | 66 | case ide_acorn: name = "acorn"; break; |
| 68 | default: name = "(unknown)"; break; | 67 | default: name = "(unknown)"; break; |
| 69 | } | 68 | } |
| @@ -77,7 +76,7 @@ static int proc_ide_read_mate | |||
| 77 | ide_hwif_t *hwif = (ide_hwif_t *) data; | 76 | ide_hwif_t *hwif = (ide_hwif_t *) data; |
| 78 | int len; | 77 | int len; |
| 79 | 78 | ||
| 80 | if (hwif && hwif->mate && hwif->mate->present) | 79 | if (hwif && hwif->mate) |
| 81 | len = sprintf(page, "%s\n", hwif->mate->name); | 80 | len = sprintf(page, "%s\n", hwif->mate->name); |
| 82 | else | 81 | else |
| 83 | len = sprintf(page, "(none)\n"); | 82 | len = sprintf(page, "(none)\n"); |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 0c908ca3ff79..ab545ffa1549 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
| @@ -225,10 +225,10 @@ static u8 wait_drive_not_busy(ide_drive_t *drive) | |||
| 225 | u8 stat; | 225 | u8 stat; |
| 226 | 226 | ||
| 227 | /* | 227 | /* |
| 228 | * Last sector was transfered, wait until drive is ready. | 228 | * Last sector was transfered, wait until device is ready. This can |
| 229 | * This can take up to 10 usec, but we will wait max 1 ms. | 229 | * take up to 6 ms on some ATAPI devices, so we will wait max 10 ms. |
| 230 | */ | 230 | */ |
| 231 | for (retries = 0; retries < 100; retries++) { | 231 | for (retries = 0; retries < 1000; retries++) { |
| 232 | stat = ide_read_status(drive); | 232 | stat = ide_read_status(drive); |
| 233 | 233 | ||
| 234 | if (stat & BUSY_STAT) | 234 | if (stat & BUSY_STAT) |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index c758dcb13b14..300431d080a9 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
| @@ -315,13 +315,14 @@ void ide_unregister(ide_hwif_t *hwif) | |||
| 315 | 315 | ||
| 316 | BUG_ON(in_interrupt()); | 316 | BUG_ON(in_interrupt()); |
| 317 | BUG_ON(irqs_disabled()); | 317 | BUG_ON(irqs_disabled()); |
| 318 | |||
| 318 | mutex_lock(&ide_cfg_mtx); | 319 | mutex_lock(&ide_cfg_mtx); |
| 319 | spin_lock_irq(&ide_lock); | ||
| 320 | if (!hwif->present) | ||
| 321 | goto abort; | ||
| 322 | __ide_port_unregister_devices(hwif); | ||
| 323 | hwif->present = 0; | ||
| 324 | 320 | ||
| 321 | spin_lock_irq(&ide_lock); | ||
| 322 | if (hwif->present) { | ||
| 323 | __ide_port_unregister_devices(hwif); | ||
| 324 | hwif->present = 0; | ||
| 325 | } | ||
| 325 | spin_unlock_irq(&ide_lock); | 326 | spin_unlock_irq(&ide_lock); |
| 326 | 327 | ||
| 327 | ide_proc_unregister_port(hwif); | 328 | ide_proc_unregister_port(hwif); |
| @@ -351,16 +352,15 @@ void ide_unregister(ide_hwif_t *hwif) | |||
| 351 | blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS); | 352 | blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS); |
| 352 | kfree(hwif->sg_table); | 353 | kfree(hwif->sg_table); |
| 353 | unregister_blkdev(hwif->major, hwif->name); | 354 | unregister_blkdev(hwif->major, hwif->name); |
| 354 | spin_lock_irq(&ide_lock); | ||
| 355 | 355 | ||
| 356 | if (hwif->dma_base) | 356 | if (hwif->dma_base) |
| 357 | ide_release_dma_engine(hwif); | 357 | ide_release_dma_engine(hwif); |
| 358 | 358 | ||
| 359 | spin_lock_irq(&ide_lock); | ||
| 359 | /* restore hwif data to pristine status */ | 360 | /* restore hwif data to pristine status */ |
| 360 | ide_init_port_data(hwif, hwif->index); | 361 | ide_init_port_data(hwif, hwif->index); |
| 361 | |||
| 362 | abort: | ||
| 363 | spin_unlock_irq(&ide_lock); | 362 | spin_unlock_irq(&ide_lock); |
| 363 | |||
| 364 | mutex_unlock(&ide_cfg_mtx); | 364 | mutex_unlock(&ide_cfg_mtx); |
| 365 | } | 365 | } |
| 366 | 366 | ||
| @@ -1094,13 +1094,6 @@ struct bus_type ide_bus_type = { | |||
| 1094 | 1094 | ||
| 1095 | EXPORT_SYMBOL_GPL(ide_bus_type); | 1095 | EXPORT_SYMBOL_GPL(ide_bus_type); |
| 1096 | 1096 | ||
| 1097 | static void ide_port_class_release(struct device *portdev) | ||
| 1098 | { | ||
| 1099 | ide_hwif_t *hwif = dev_get_drvdata(portdev); | ||
| 1100 | |||
| 1101 | put_device(&hwif->gendev); | ||
| 1102 | } | ||
| 1103 | |||
| 1104 | int ide_vlb_clk; | 1097 | int ide_vlb_clk; |
| 1105 | EXPORT_SYMBOL_GPL(ide_vlb_clk); | 1098 | EXPORT_SYMBOL_GPL(ide_vlb_clk); |
| 1106 | 1099 | ||
| @@ -1305,7 +1298,6 @@ static int __init ide_init(void) | |||
| 1305 | ret = PTR_ERR(ide_port_class); | 1298 | ret = PTR_ERR(ide_port_class); |
| 1306 | goto out_port_class; | 1299 | goto out_port_class; |
| 1307 | } | 1300 | } |
| 1308 | ide_port_class->dev_release = ide_port_class_release; | ||
| 1309 | 1301 | ||
| 1310 | init_ide_data(); | 1302 | init_ide_data(); |
| 1311 | 1303 | ||
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c index 5c730e4dd735..9a1d27ef3f8a 100644 --- a/drivers/ide/legacy/buddha.c +++ b/drivers/ide/legacy/buddha.c | |||
| @@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base, | |||
| 138 | 138 | ||
| 139 | hw->irq = IRQ_AMIGA_PORTS; | 139 | hw->irq = IRQ_AMIGA_PORTS; |
| 140 | hw->ack_intr = ack_intr; | 140 | hw->ack_intr = ack_intr; |
| 141 | |||
| 142 | hw->chipset = ide_generic; | ||
| 141 | } | 143 | } |
| 142 | 144 | ||
| 143 | /* | 145 | /* |
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 9e449a0c623f..af11028b4794 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c | |||
| @@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw) | |||
| 81 | 81 | ||
| 82 | hw->irq = IRQ_MFP_IDE; | 82 | hw->irq = IRQ_MFP_IDE; |
| 83 | hw->ack_intr = NULL; | 83 | hw->ack_intr = NULL; |
| 84 | |||
| 85 | hw->chipset = ide_generic; | ||
| 84 | } | 86 | } |
| 85 | 87 | ||
| 86 | /* | 88 | /* |
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index a9c2593a898c..fed7d812761c 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/ide.h> | 16 | #include <linux/ide.h> |
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/zorro.h> | 18 | #include <linux/zorro.h> |
| 19 | #include <linux/module.h> | ||
| 19 | 20 | ||
| 20 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
| 21 | #include <asm/amigahw.h> | 22 | #include <asm/amigahw.h> |
| @@ -62,7 +63,10 @@ | |||
| 62 | GAYLE_NUM_HWIFS-1) | 63 | GAYLE_NUM_HWIFS-1) |
| 63 | #define GAYLE_HAS_CONTROL_REG (!ide_doubler) | 64 | #define GAYLE_HAS_CONTROL_REG (!ide_doubler) |
| 64 | #define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) | 65 | #define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) |
| 66 | |||
| 65 | int ide_doubler = 0; /* support IDE doublers? */ | 67 | int ide_doubler = 0; /* support IDE doublers? */ |
| 68 | EXPORT_SYMBOL_GPL(ide_doubler); | ||
| 69 | |||
| 66 | module_param_named(doubler, ide_doubler, bool, 0); | 70 | module_param_named(doubler, ide_doubler, bool, 0); |
| 67 | MODULE_PARM_DESC(doubler, "enable support for IDE doublers"); | 71 | MODULE_PARM_DESC(doubler, "enable support for IDE doublers"); |
| 68 | #endif /* CONFIG_BLK_DEV_IDEDOUBLER */ | 72 | #endif /* CONFIG_BLK_DEV_IDEDOUBLER */ |
| @@ -112,6 +116,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, | |||
| 112 | 116 | ||
| 113 | hw->irq = IRQ_AMIGA_PORTS; | 117 | hw->irq = IRQ_AMIGA_PORTS; |
| 114 | hw->ack_intr = ack_intr; | 118 | hw->ack_intr = ack_intr; |
| 119 | |||
| 120 | hw->chipset = ide_generic; | ||
| 115 | } | 121 | } |
| 116 | 122 | ||
| 117 | /* | 123 | /* |
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index aa2ea3deac85..3381424d70a1 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
| @@ -135,13 +135,17 @@ static void ide_detach(struct pcmcia_device *link) | |||
| 135 | { | 135 | { |
| 136 | ide_info_t *info = link->priv; | 136 | ide_info_t *info = link->priv; |
| 137 | ide_hwif_t *hwif = info->hwif; | 137 | ide_hwif_t *hwif = info->hwif; |
| 138 | unsigned long data_addr, ctl_addr; | ||
| 138 | 139 | ||
| 139 | DEBUG(0, "ide_detach(0x%p)\n", link); | 140 | DEBUG(0, "ide_detach(0x%p)\n", link); |
| 140 | 141 | ||
| 142 | data_addr = hwif->io_ports.data_addr; | ||
| 143 | ctl_addr = hwif->io_ports.ctl_addr; | ||
| 144 | |||
| 141 | ide_release(link); | 145 | ide_release(link); |
| 142 | 146 | ||
| 143 | release_region(hwif->io_ports.ctl_addr, 1); | 147 | release_region(ctl_addr, 1); |
| 144 | release_region(hwif->io_ports.data_addr, 8); | 148 | release_region(data_addr, 8); |
| 145 | 149 | ||
| 146 | kfree(info); | 150 | kfree(info); |
| 147 | } /* ide_detach */ | 151 | } /* ide_detach */ |
| @@ -194,6 +198,16 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl, | |||
| 194 | if (hwif->present) | 198 | if (hwif->present) |
| 195 | return hwif; | 199 | return hwif; |
| 196 | 200 | ||
| 201 | /* retry registration in case device is still spinning up */ | ||
| 202 | for (i = 0; i < 10; i++) { | ||
| 203 | msleep(100); | ||
| 204 | ide_port_scan(hwif); | ||
| 205 | if (hwif->present) | ||
| 206 | return hwif; | ||
| 207 | } | ||
| 208 | |||
| 209 | return hwif; | ||
| 210 | |||
| 197 | out_release: | 211 | out_release: |
| 198 | release_region(ctl, 1); | 212 | release_region(ctl, 1); |
| 199 | release_region(io, 8); | 213 | release_region(io, 8); |
| @@ -222,7 +236,7 @@ static int ide_config(struct pcmcia_device *link) | |||
| 222 | cistpl_cftable_entry_t dflt; | 236 | cistpl_cftable_entry_t dflt; |
| 223 | } *stk = NULL; | 237 | } *stk = NULL; |
| 224 | cistpl_cftable_entry_t *cfg; | 238 | cistpl_cftable_entry_t *cfg; |
| 225 | int i, pass, last_ret = 0, last_fn = 0, is_kme = 0; | 239 | int pass, last_ret = 0, last_fn = 0, is_kme = 0; |
| 226 | unsigned long io_base, ctl_base; | 240 | unsigned long io_base, ctl_base; |
| 227 | ide_hwif_t *hwif; | 241 | ide_hwif_t *hwif; |
| 228 | 242 | ||
| @@ -319,30 +333,15 @@ static int ide_config(struct pcmcia_device *link) | |||
| 319 | if (is_kme) | 333 | if (is_kme) |
| 320 | outb(0x81, ctl_base+1); | 334 | outb(0x81, ctl_base+1); |
| 321 | 335 | ||
| 322 | /* retry registration in case device is still spinning up */ | 336 | hwif = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); |
| 323 | for (i = 0; i < 10; i++) { | 337 | if (hwif == NULL && link->io.NumPorts1 == 0x20) { |
| 324 | hwif = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); | ||
| 325 | if (hwif) | ||
| 326 | break; | ||
| 327 | if (link->io.NumPorts1 == 0x20) { | ||
| 328 | outb(0x02, ctl_base + 0x10); | 338 | outb(0x02, ctl_base + 0x10); |
| 329 | hwif = idecs_register(io_base + 0x10, ctl_base + 0x10, | 339 | hwif = idecs_register(io_base + 0x10, ctl_base + 0x10, |
| 330 | link->irq.AssignedIRQ, link); | 340 | link->irq.AssignedIRQ, link); |
| 331 | if (hwif) { | ||
| 332 | io_base += 0x10; | ||
| 333 | ctl_base += 0x10; | ||
| 334 | break; | ||
| 335 | } | ||
| 336 | } | ||
| 337 | msleep(100); | ||
| 338 | } | 341 | } |
| 339 | 342 | ||
| 340 | if (hwif == NULL) { | 343 | if (hwif == NULL) |
| 341 | printk(KERN_NOTICE "ide-cs: ide_register() at 0x%3lx & 0x%3lx" | ||
| 342 | ", irq %u failed\n", io_base, ctl_base, | ||
| 343 | link->irq.AssignedIRQ); | ||
| 344 | goto failed; | 344 | goto failed; |
| 345 | } | ||
| 346 | 345 | ||
| 347 | info->ndev = 1; | 346 | info->ndev = 1; |
| 348 | sprintf(info->node.dev_name, "hd%c", 'a' + hwif->index * 2); | 347 | sprintf(info->node.dev_name, "hd%c", 'a' + hwif->index * 2); |
| @@ -411,6 +410,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 411 | PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ | 410 | PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ |
| 412 | PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), | 411 | PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), |
| 413 | PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ | 412 | PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ |
| 413 | PCMCIA_DEVICE_MANF_CARD(0x004f, 0x0000), /* Kingston */ | ||
| 414 | PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ | 414 | PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ |
| 415 | PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), | 415 | PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), |
| 416 | PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ | 416 | PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ |
| @@ -440,6 +440,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 440 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), | 440 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), |
| 441 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), | 441 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDEII", 0x547e66dc, 0xb3662674), |
| 442 | PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), | 442 | PCMCIA_DEVICE_PROD_ID12("LOOKMEET", "CBIDE2 ", 0xe37be2b5, 0x8671043b), |
| 443 | PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF300", 0x7ed2ad87, 0x7e9e78ee), | ||
| 443 | PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), | 444 | PCMCIA_DEVICE_PROD_ID12("M-Systems", "CF500", 0x7ed2ad87, 0x7a13045c), |
| 444 | PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), | 445 | PCMCIA_DEVICE_PROD_ID2("NinjaATA-", 0xebe0bd79), |
| 445 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), | 446 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "CD-ROM", 0x281f1c5d, 0x66536591), |
| @@ -450,6 +451,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 450 | PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), | 451 | PCMCIA_DEVICE_PROD_ID12("SMI VENDOR", "SMI PRODUCT", 0x30896c92, 0x703cc5f6), |
| 451 | PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), | 452 | PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), |
| 452 | PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), | 453 | PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), |
| 454 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF45", 0x709b1bf1, 0xf68b6f32), | ||
| 453 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), | 455 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), |
| 454 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), | 456 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), |
| 455 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), | 457 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), |
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index caa2632dd08e..2e84290d0bcc 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c | |||
| @@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base, | |||
| 78 | 78 | ||
| 79 | hw->irq = irq; | 79 | hw->irq = irq; |
| 80 | hw->ack_intr = ack_intr; | 80 | hw->ack_intr = ack_intr; |
| 81 | |||
| 82 | hw->chipset = ide_generic; | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | static const char *mac_ide_name[] = | 85 | static const char *mac_ide_name[] = |
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index 6f535d00e638..8ff6e2d20834 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c | |||
| @@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base, | |||
| 70 | 70 | ||
| 71 | hw->irq = irq; | 71 | hw->irq = irq; |
| 72 | hw->ack_intr = ack_intr; | 72 | hw->ack_intr = ack_intr; |
| 73 | |||
| 74 | hw->chipset = ide_generic; | ||
| 73 | } | 75 | } |
| 74 | 76 | ||
| 75 | static void q40ide_input_data(ide_drive_t *drive, struct request *rq, | 77 | static void q40ide_input_data(ide_drive_t *drive, struct request *rq, |
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index aaf38109eaec..b38a1980dcd5 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
| @@ -747,9 +747,11 @@ static int __init cmd640x_init(void) | |||
| 747 | 747 | ||
| 748 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | 748 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); |
| 749 | hw[0].irq = 14; | 749 | hw[0].irq = 14; |
| 750 | hw[0].chipset = ide_cmd640; | ||
| 750 | 751 | ||
| 751 | ide_std_init_ports(&hw[1], 0x170, 0x376); | 752 | ide_std_init_ports(&hw[1], 0x170, 0x376); |
| 752 | hw[1].irq = 15; | 753 | hw[1].irq = 15; |
| 754 | hw[1].chipset = ide_cmd640; | ||
| 753 | 755 | ||
| 754 | printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x" | 756 | printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x" |
| 755 | "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr); | 757 | "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr); |
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index b9e457996d0e..af0f30051d5a 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c | |||
| @@ -47,13 +47,18 @@ static const struct ide_port_ops delkin_cb_port_ops = { | |||
| 47 | .quirkproc = ide_undecoded_slave, | 47 | .quirkproc = ide_undecoded_slave, |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | static const struct ide_port_info delkin_cb_port_info = { | ||
| 51 | .port_ops = &delkin_cb_port_ops, | ||
| 52 | .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS | | ||
| 53 | IDE_HFLAG_NO_DMA, | ||
| 54 | }; | ||
| 55 | |||
| 50 | static int __devinit | 56 | static int __devinit |
| 51 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | 57 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) |
| 52 | { | 58 | { |
| 53 | unsigned long base; | 59 | unsigned long base; |
| 54 | hw_regs_t hw; | 60 | hw_regs_t hw; |
| 55 | ide_hwif_t *hwif = NULL; | 61 | ide_hwif_t *hwif = NULL; |
| 56 | ide_drive_t *drive; | ||
| 57 | int i, rc; | 62 | int i, rc; |
| 58 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 63 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
| 59 | 64 | ||
| @@ -79,6 +84,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
| 79 | memset(&hw, 0, sizeof(hw)); | 84 | memset(&hw, 0, sizeof(hw)); |
| 80 | ide_std_init_ports(&hw, base + 0x10, base + 0x1e); | 85 | ide_std_init_ports(&hw, base + 0x10, base + 0x1e); |
| 81 | hw.irq = dev->irq; | 86 | hw.irq = dev->irq; |
| 87 | hw.dev = &dev->dev; | ||
| 82 | hw.chipset = ide_pci; /* this enables IRQ sharing */ | 88 | hw.chipset = ide_pci; /* this enables IRQ sharing */ |
| 83 | 89 | ||
| 84 | hwif = ide_find_port(); | 90 | hwif = ide_find_port(); |
| @@ -89,26 +95,16 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
| 89 | 95 | ||
| 90 | ide_init_port_data(hwif, i); | 96 | ide_init_port_data(hwif, i); |
| 91 | ide_init_port_hw(hwif, &hw); | 97 | ide_init_port_hw(hwif, &hw); |
| 92 | hwif->port_ops = &delkin_cb_port_ops; | ||
| 93 | 98 | ||
| 94 | idx[0] = i; | 99 | idx[0] = i; |
| 95 | 100 | ||
| 96 | ide_device_add(idx, NULL); | 101 | ide_device_add(idx, &delkin_cb_port_info); |
| 97 | |||
| 98 | if (!hwif->present) | ||
| 99 | goto out_disable; | ||
| 100 | 102 | ||
| 101 | pci_set_drvdata(dev, hwif); | 103 | pci_set_drvdata(dev, hwif); |
| 102 | hwif->dev = &dev->dev; | 104 | |
| 103 | drive = &hwif->drives[0]; | ||
| 104 | if (drive->present) { | ||
| 105 | drive->io_32bit = 1; | ||
| 106 | drive->unmask = 1; | ||
| 107 | } | ||
| 108 | return 0; | 105 | return 0; |
| 109 | 106 | ||
| 110 | out_disable: | 107 | out_disable: |
| 111 | printk(KERN_ERR "delkin_cb: no IDE devices found\n"); | ||
| 112 | pci_release_regions(dev); | 108 | pci_release_regions(dev); |
| 113 | pci_disable_device(dev); | 109 | pci_disable_device(dev); |
| 114 | return -ENODEV; | 110 | return -ENODEV; |
| @@ -139,14 +135,12 @@ static struct pci_driver driver = { | |||
| 139 | .remove = delkin_cb_remove, | 135 | .remove = delkin_cb_remove, |
| 140 | }; | 136 | }; |
| 141 | 137 | ||
| 142 | static int | 138 | static int __init delkin_cb_init(void) |
| 143 | delkin_cb_init (void) | ||
| 144 | { | 139 | { |
| 145 | return pci_register_driver(&driver); | 140 | return pci_register_driver(&driver); |
| 146 | } | 141 | } |
| 147 | 142 | ||
| 148 | static void | 143 | static void __exit delkin_cb_exit(void) |
| 149 | delkin_cb_exit (void) | ||
| 150 | { | 144 | { |
| 151 | pci_unregister_driver(&driver); | 145 | pci_unregister_driver(&driver); |
| 152 | } | 146 | } |
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index 6e99080497bf..725c80508d90 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c | |||
| @@ -81,8 +81,6 @@ | |||
| 81 | * 0.5 doesn't work. | 81 | * 0.5 doesn't work. |
| 82 | */ | 82 | */ |
| 83 | 83 | ||
| 84 | #define OPTI621_DEBUG /* define for debug messages */ | ||
| 85 | |||
| 86 | #include <linux/types.h> | 84 | #include <linux/types.h> |
| 87 | #include <linux/module.h> | 85 | #include <linux/module.h> |
| 88 | #include <linux/kernel.h> | 86 | #include <linux/kernel.h> |
| @@ -92,28 +90,6 @@ | |||
| 92 | 90 | ||
| 93 | #include <asm/io.h> | 91 | #include <asm/io.h> |
| 94 | 92 | ||
| 95 | //#define OPTI621_MAX_PIO 3 | ||
| 96 | /* In fact, I do not have any PIO 4 drive | ||
| 97 | * (address: 25 ns, data: 70 ns, recovery: 35 ns), | ||
| 98 | * but OPTi 82C621 is programmable and it can do (minimal values): | ||
| 99 | * on 40MHz PCI bus (pulse 25 ns): | ||
| 100 | * address: 25 ns, data: 25 ns, recovery: 50 ns; | ||
| 101 | * on 20MHz PCI bus (pulse 50 ns): | ||
| 102 | * address: 50 ns, data: 50 ns, recovery: 100 ns. | ||
| 103 | */ | ||
| 104 | |||
| 105 | /* #define READ_PREFETCH 0 */ | ||
| 106 | /* Uncomment for disable read prefetch. | ||
| 107 | * There is some readprefetch capatibility in hdparm, | ||
| 108 | * but when I type hdparm -P 1 /dev/hda, I got errors | ||
| 109 | * and till reset drive is inaccessible. | ||
| 110 | * This (hw) read prefetch is safe on my drive. | ||
| 111 | */ | ||
| 112 | |||
| 113 | #ifndef READ_PREFETCH | ||
| 114 | #define READ_PREFETCH 0x40 /* read prefetch is enabled */ | ||
| 115 | #endif /* else read prefetch is disabled */ | ||
| 116 | |||
| 117 | #define READ_REG 0 /* index of Read cycle timing register */ | 93 | #define READ_REG 0 /* index of Read cycle timing register */ |
| 118 | #define WRITE_REG 1 /* index of Write cycle timing register */ | 94 | #define WRITE_REG 1 /* index of Write cycle timing register */ |
| 119 | #define CNTRL_REG 3 /* index of Control register */ | 95 | #define CNTRL_REG 3 /* index of Control register */ |
| @@ -122,51 +98,8 @@ | |||
| 122 | 98 | ||
| 123 | static int reg_base; | 99 | static int reg_base; |
| 124 | 100 | ||
| 125 | #define PIO_NOT_EXIST 254 | ||
| 126 | #define PIO_DONT_KNOW 255 | ||
| 127 | |||
| 128 | static DEFINE_SPINLOCK(opti621_lock); | 101 | static DEFINE_SPINLOCK(opti621_lock); |
| 129 | 102 | ||
| 130 | /* there are stored pio numbers from other calls of opti621_set_pio_mode */ | ||
| 131 | static void compute_pios(ide_drive_t *drive, const u8 pio) | ||
| 132 | /* Store values into drive->drive_data | ||
| 133 | * second_contr - 0 for primary controller, 1 for secondary | ||
| 134 | * slave_drive - 0 -> pio is for master, 1 -> pio is for slave | ||
| 135 | * pio - PIO mode for selected drive (for other we don't know) | ||
| 136 | */ | ||
| 137 | { | ||
| 138 | int d; | ||
| 139 | ide_hwif_t *hwif = HWIF(drive); | ||
| 140 | |||
| 141 | drive->drive_data = pio; | ||
| 142 | |||
| 143 | for (d = 0; d < 2; ++d) { | ||
| 144 | drive = &hwif->drives[d]; | ||
| 145 | if (drive->present) { | ||
| 146 | if (drive->drive_data == PIO_DONT_KNOW) | ||
| 147 | drive->drive_data = ide_get_best_pio_mode(drive, 255, 3); | ||
| 148 | #ifdef OPTI621_DEBUG | ||
| 149 | printk("%s: Selected PIO mode %d\n", | ||
| 150 | drive->name, drive->drive_data); | ||
| 151 | #endif | ||
| 152 | } else { | ||
| 153 | drive->drive_data = PIO_NOT_EXIST; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 158 | static int cmpt_clk(int time, int bus_speed) | ||
| 159 | /* Returns (rounded up) time in clocks for time in ns, | ||
| 160 | * with bus_speed in MHz. | ||
| 161 | * Example: bus_speed = 40 MHz, time = 80 ns | ||
| 162 | * 1000/40 = 25 ns (clk value), | ||
| 163 | * 80/25 = 3.2, rounded up to 4 (I hope ;-)). | ||
| 164 | * Use idebus=xx to select right frequency. | ||
| 165 | */ | ||
| 166 | { | ||
| 167 | return ((time*bus_speed+999)/1000); | ||
| 168 | } | ||
| 169 | |||
| 170 | /* Write value to register reg, base of register | 103 | /* Write value to register reg, base of register |
| 171 | * is at reg_base (0x1f0 primary, 0x170 secondary, | 104 | * is at reg_base (0x1f0 primary, 0x170 secondary, |
| 172 | * if not changed by PCI configuration). | 105 | * if not changed by PCI configuration). |
| @@ -199,83 +132,29 @@ static u8 read_reg(int reg) | |||
| 199 | return ret; | 132 | return ret; |
| 200 | } | 133 | } |
| 201 | 134 | ||
| 202 | typedef struct pio_clocks_s { | ||
| 203 | int address_time; /* Address setup (clocks) */ | ||
| 204 | int data_time; /* Active/data pulse (clocks) */ | ||
| 205 | int recovery_time; /* Recovery time (clocks) */ | ||
| 206 | } pio_clocks_t; | ||
| 207 | |||
| 208 | static void compute_clocks(int pio, pio_clocks_t *clks) | ||
| 209 | { | ||
| 210 | if (pio != PIO_NOT_EXIST) { | ||
| 211 | int adr_setup, data_pls; | ||
| 212 | int bus_speed = ide_pci_clk ? ide_pci_clk : system_bus_clock(); | ||
| 213 | |||
| 214 | adr_setup = ide_pio_timings[pio].setup_time; | ||
| 215 | data_pls = ide_pio_timings[pio].active_time; | ||
| 216 | clks->address_time = cmpt_clk(adr_setup, bus_speed); | ||
| 217 | clks->data_time = cmpt_clk(data_pls, bus_speed); | ||
| 218 | clks->recovery_time = cmpt_clk(ide_pio_timings[pio].cycle_time | ||
| 219 | - adr_setup-data_pls, bus_speed); | ||
| 220 | if (clks->address_time < 1) | ||
| 221 | clks->address_time = 1; | ||
| 222 | if (clks->address_time > 4) | ||
| 223 | clks->address_time = 4; | ||
| 224 | if (clks->data_time < 1) | ||
| 225 | clks->data_time = 1; | ||
| 226 | if (clks->data_time > 16) | ||
| 227 | clks->data_time = 16; | ||
| 228 | if (clks->recovery_time < 2) | ||
| 229 | clks->recovery_time = 2; | ||
| 230 | if (clks->recovery_time > 17) | ||
| 231 | clks->recovery_time = 17; | ||
| 232 | } else { | ||
| 233 | clks->address_time = 1; | ||
| 234 | clks->data_time = 1; | ||
| 235 | clks->recovery_time = 2; | ||
| 236 | /* minimal values */ | ||
| 237 | } | ||
| 238 | } | ||
| 239 | |||
| 240 | static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) | 135 | static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) |
| 241 | { | 136 | { |
| 242 | /* primary and secondary drives share some registers, | 137 | ide_hwif_t *hwif = drive->hwif; |
| 243 | * so we have to program both drives | 138 | ide_drive_t *pair = ide_get_paired_drive(drive); |
| 244 | */ | ||
| 245 | unsigned long flags; | 139 | unsigned long flags; |
| 246 | u8 pio1 = 0, pio2 = 0; | 140 | u8 tim, misc, addr_pio = pio, clk; |
| 247 | pio_clocks_t first, second; | 141 | |
| 248 | int ax, drdy; | 142 | /* DRDY is default 2 (by OPTi Databook) */ |
| 249 | u8 cycle1, cycle2, misc; | 143 | static const u8 addr_timings[2][5] = { |
| 250 | ide_hwif_t *hwif = HWIF(drive); | 144 | { 0x20, 0x10, 0x00, 0x00, 0x00 }, /* 33 MHz */ |
| 251 | 145 | { 0x10, 0x10, 0x00, 0x00, 0x00 }, /* 25 MHz */ | |
| 252 | /* sets drive->drive_data for both drives */ | 146 | }; |
| 253 | compute_pios(drive, pio); | 147 | static const u8 data_rec_timings[2][5] = { |
| 254 | pio1 = hwif->drives[0].drive_data; | 148 | { 0x5b, 0x45, 0x32, 0x21, 0x20 }, /* 33 MHz */ |
| 255 | pio2 = hwif->drives[1].drive_data; | 149 | { 0x48, 0x34, 0x21, 0x10, 0x10 } /* 25 MHz */ |
| 256 | 150 | }; | |
| 257 | compute_clocks(pio1, &first); | 151 | |
| 258 | compute_clocks(pio2, &second); | 152 | drive->drive_data = XFER_PIO_0 + pio; |
| 259 | 153 | ||
| 260 | /* ax = max(a1,a2) */ | 154 | if (pair->present) { |
| 261 | ax = (first.address_time < second.address_time) ? second.address_time : first.address_time; | 155 | if (pair->drive_data && pair->drive_data < drive->drive_data) |
| 262 | 156 | addr_pio = pair->drive_data - XFER_PIO_0; | |
| 263 | drdy = 2; /* DRDY is default 2 (by OPTi Databook) */ | 157 | } |
| 264 | |||
| 265 | cycle1 = ((first.data_time-1)<<4) | (first.recovery_time-2); | ||
| 266 | cycle2 = ((second.data_time-1)<<4) | (second.recovery_time-2); | ||
| 267 | misc = READ_PREFETCH | ((ax-1)<<4) | ((drdy-2)<<1); | ||
| 268 | |||
| 269 | #ifdef OPTI621_DEBUG | ||
| 270 | printk("%s: master: address: %d, data: %d, " | ||
| 271 | "recovery: %d, drdy: %d [clk]\n", | ||
| 272 | hwif->name, ax, first.data_time, | ||
| 273 | first.recovery_time, drdy); | ||
| 274 | printk("%s: slave: address: %d, data: %d, " | ||
| 275 | "recovery: %d, drdy: %d [clk]\n", | ||
| 276 | hwif->name, ax, second.data_time, | ||
| 277 | second.recovery_time, drdy); | ||
| 278 | #endif | ||
| 279 | 158 | ||
| 280 | spin_lock_irqsave(&opti621_lock, flags); | 159 | spin_lock_irqsave(&opti621_lock, flags); |
| 281 | 160 | ||
| @@ -289,24 +168,21 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
| 289 | (void)inb(reg_base + CNTRL_REG); | 168 | (void)inb(reg_base + CNTRL_REG); |
| 290 | /* if reads 0xc0, no interface exist? */ | 169 | /* if reads 0xc0, no interface exist? */ |
| 291 | read_reg(CNTRL_REG); | 170 | read_reg(CNTRL_REG); |
| 292 | /* read version, probably 0 */ | ||
| 293 | read_reg(STRAP_REG); | ||
| 294 | 171 | ||
| 295 | /* program primary drive */ | 172 | /* check CLK speed */ |
| 296 | /* select Index-0 for Register-A */ | 173 | clk = read_reg(STRAP_REG) & 1; |
| 297 | write_reg(0, MISC_REG); | 174 | |
| 298 | /* set read cycle timings */ | 175 | printk(KERN_INFO "%s: CLK = %d MHz\n", hwif->name, clk ? 25 : 33); |
| 299 | write_reg(cycle1, READ_REG); | ||
| 300 | /* set write cycle timings */ | ||
| 301 | write_reg(cycle1, WRITE_REG); | ||
| 302 | 176 | ||
| 303 | /* program secondary drive */ | 177 | tim = data_rec_timings[clk][pio]; |
| 304 | /* select Index-1 for Register-B */ | 178 | misc = addr_timings[clk][addr_pio]; |
| 305 | write_reg(1, MISC_REG); | 179 | |
| 180 | /* select Index-0/1 for Register-A/B */ | ||
| 181 | write_reg(drive->select.b.unit, MISC_REG); | ||
| 306 | /* set read cycle timings */ | 182 | /* set read cycle timings */ |
| 307 | write_reg(cycle2, READ_REG); | 183 | write_reg(tim, READ_REG); |
| 308 | /* set write cycle timings */ | 184 | /* set write cycle timings */ |
| 309 | write_reg(cycle2, WRITE_REG); | 185 | write_reg(tim, WRITE_REG); |
| 310 | 186 | ||
| 311 | /* use Register-A for drive 0 */ | 187 | /* use Register-A for drive 0 */ |
| 312 | /* use Register-B for drive 1 */ | 188 | /* use Register-B for drive 1 */ |
| @@ -319,45 +195,26 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
| 319 | spin_unlock_irqrestore(&opti621_lock, flags); | 195 | spin_unlock_irqrestore(&opti621_lock, flags); |
| 320 | } | 196 | } |
| 321 | 197 | ||
| 322 | static void __devinit opti621_port_init_devs(ide_hwif_t *hwif) | ||
| 323 | { | ||
| 324 | hwif->drives[0].drive_data = PIO_DONT_KNOW; | ||
| 325 | hwif->drives[1].drive_data = PIO_DONT_KNOW; | ||
| 326 | } | ||
| 327 | |||
| 328 | static const struct ide_port_ops opti621_port_ops = { | 198 | static const struct ide_port_ops opti621_port_ops = { |
| 329 | .port_init_devs = opti621_port_init_devs, | ||
| 330 | .set_pio_mode = opti621_set_pio_mode, | 199 | .set_pio_mode = opti621_set_pio_mode, |
| 331 | }; | 200 | }; |
| 332 | 201 | ||
| 333 | static const struct ide_port_info opti621_chipsets[] __devinitdata = { | 202 | static const struct ide_port_info opti621_chipset __devinitdata = { |
| 334 | { /* 0 */ | 203 | .name = "OPTI621/X", |
| 335 | .name = "OPTI621", | 204 | .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, |
| 336 | .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, | 205 | .port_ops = &opti621_port_ops, |
| 337 | .port_ops = &opti621_port_ops, | 206 | .host_flags = IDE_HFLAG_NO_DMA, |
| 338 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, | 207 | .pio_mask = ATA_PIO4, |
| 339 | .pio_mask = ATA_PIO3, | ||
| 340 | .swdma_mask = ATA_SWDMA2, | ||
| 341 | .mwdma_mask = ATA_MWDMA2, | ||
| 342 | }, { /* 1 */ | ||
| 343 | .name = "OPTI621X", | ||
| 344 | .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, | ||
| 345 | .port_ops = &opti621_port_ops, | ||
| 346 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, | ||
| 347 | .pio_mask = ATA_PIO3, | ||
| 348 | .swdma_mask = ATA_SWDMA2, | ||
| 349 | .mwdma_mask = ATA_MWDMA2, | ||
| 350 | } | ||
| 351 | }; | 208 | }; |
| 352 | 209 | ||
| 353 | static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 210 | static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
| 354 | { | 211 | { |
| 355 | return ide_setup_pci_device(dev, &opti621_chipsets[id->driver_data]); | 212 | return ide_setup_pci_device(dev, &opti621_chipset); |
| 356 | } | 213 | } |
| 357 | 214 | ||
| 358 | static const struct pci_device_id opti621_pci_tbl[] = { | 215 | static const struct pci_device_id opti621_pci_tbl[] = { |
| 359 | { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C621), 0 }, | 216 | { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C621), 0 }, |
| 360 | { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C825), 1 }, | 217 | { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C825), 0 }, |
| 361 | { 0, }, | 218 | { 0, }, |
| 362 | }; | 219 | }; |
| 363 | MODULE_DEVICE_TABLE(pci, opti621_pci_tbl); | 220 | MODULE_DEVICE_TABLE(pci, opti621_pci_tbl); |
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 4b0b85d8faf5..e127eb25ab63 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
| @@ -569,6 +569,11 @@ static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_devi | |||
| 569 | { | 569 | { |
| 570 | struct ide_port_info d = sis5513_chipset; | 570 | struct ide_port_info d = sis5513_chipset; |
| 571 | u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; | 571 | u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; |
| 572 | int rc; | ||
| 573 | |||
| 574 | rc = pci_enable_device(dev); | ||
| 575 | if (rc) | ||
| 576 | return rc; | ||
| 572 | 577 | ||
| 573 | if (sis_find_family(dev) == 0) | 578 | if (sis_find_family(dev) == 0) |
| 574 | return -ENOTSUPP; | 579 | return -ENOTSUPP; |
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c index f0e638dcc3ab..236f9c38e519 100644 --- a/drivers/ide/ppc/mpc8xx.c +++ b/drivers/ide/ppc/mpc8xx.c | |||
| @@ -303,6 +303,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | |||
| 303 | pcmp->pcmc_per = 0x100000 >> (16 * _slot_); | 303 | pcmp->pcmc_per = 0x100000 >> (16 * _slot_); |
| 304 | #endif /* CONFIG_IDE_8xx_PCCARD */ | 304 | #endif /* CONFIG_IDE_8xx_PCCARD */ |
| 305 | 305 | ||
| 306 | hw->chipset = ide_generic; | ||
| 307 | |||
| 306 | return 0; | 308 | return 0; |
| 307 | } | 309 | } |
| 308 | #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ | 310 | #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ |
| @@ -377,6 +379,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | |||
| 377 | ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |= | 379 | ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |= |
| 378 | (0x80000000 >> ioport_dsc[data_port].irq); | 380 | (0x80000000 >> ioport_dsc[data_port].irq); |
| 379 | 381 | ||
| 382 | hw->chipset = ide_generic; | ||
| 383 | |||
| 380 | return 0; | 384 | return 0; |
| 381 | } | 385 | } |
| 382 | #endif /* CONFIG_IDE_8xx_DIRECT */ | 386 | #endif /* CONFIG_IDE_8xx_DIRECT */ |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 48aa019127bc..ba2d58727964 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
| @@ -59,7 +59,6 @@ typedef struct pmac_ide_hwif { | |||
| 59 | int irq; | 59 | int irq; |
| 60 | int kind; | 60 | int kind; |
| 61 | int aapl_bus_id; | 61 | int aapl_bus_id; |
| 62 | unsigned cable_80 : 1; | ||
| 63 | unsigned mediabay : 1; | 62 | unsigned mediabay : 1; |
| 64 | unsigned broken_dma : 1; | 63 | unsigned broken_dma : 1; |
| 65 | unsigned broken_dma_warn : 1; | 64 | unsigned broken_dma_warn : 1; |
| @@ -918,10 +917,40 @@ pmac_ide_do_resume(ide_hwif_t *hwif) | |||
| 918 | return 0; | 917 | return 0; |
| 919 | } | 918 | } |
| 920 | 919 | ||
| 920 | static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) | ||
| 921 | { | ||
| 922 | pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)ide_get_hwifdata(hwif); | ||
| 923 | struct device_node *np = pmif->node; | ||
| 924 | const char *cable = of_get_property(np, "cable-type", NULL); | ||
| 925 | |||
| 926 | /* Get cable type from device-tree. */ | ||
| 927 | if (cable && !strncmp(cable, "80-", 3)) | ||
| 928 | return ATA_CBL_PATA80; | ||
| 929 | |||
| 930 | /* | ||
| 931 | * G5's seem to have incorrect cable type in device-tree. | ||
| 932 | * Let's assume they have a 80 conductor cable, this seem | ||
| 933 | * to be always the case unless the user mucked around. | ||
| 934 | */ | ||
| 935 | if (of_device_is_compatible(np, "K2-UATA") || | ||
| 936 | of_device_is_compatible(np, "shasta-ata")) | ||
| 937 | return ATA_CBL_PATA80; | ||
| 938 | |||
| 939 | return ATA_CBL_PATA40; | ||
| 940 | } | ||
| 941 | |||
| 921 | static const struct ide_port_ops pmac_ide_ata6_port_ops = { | 942 | static const struct ide_port_ops pmac_ide_ata6_port_ops = { |
| 922 | .set_pio_mode = pmac_ide_set_pio_mode, | 943 | .set_pio_mode = pmac_ide_set_pio_mode, |
| 923 | .set_dma_mode = pmac_ide_set_dma_mode, | 944 | .set_dma_mode = pmac_ide_set_dma_mode, |
| 924 | .selectproc = pmac_ide_kauai_selectproc, | 945 | .selectproc = pmac_ide_kauai_selectproc, |
| 946 | .cable_detect = pmac_ide_cable_detect, | ||
| 947 | }; | ||
| 948 | |||
| 949 | static const struct ide_port_ops pmac_ide_ata4_port_ops = { | ||
| 950 | .set_pio_mode = pmac_ide_set_pio_mode, | ||
| 951 | .set_dma_mode = pmac_ide_set_dma_mode, | ||
| 952 | .selectproc = pmac_ide_selectproc, | ||
| 953 | .cable_detect = pmac_ide_cable_detect, | ||
| 925 | }; | 954 | }; |
| 926 | 955 | ||
| 927 | static const struct ide_port_ops pmac_ide_port_ops = { | 956 | static const struct ide_port_ops pmac_ide_port_ops = { |
| @@ -949,10 +978,7 @@ static const struct ide_port_info pmac_port_info = { | |||
| 949 | 978 | ||
| 950 | /* | 979 | /* |
| 951 | * Setup, register & probe an IDE channel driven by this driver, this is | 980 | * Setup, register & probe an IDE channel driven by this driver, this is |
| 952 | * called by one of the 2 probe functions (macio or PCI). Note that a channel | 981 | * called by one of the 2 probe functions (macio or PCI). |
| 953 | * that ends up beeing free of any device is not kept around by this driver | ||
| 954 | * (it is kept in 2.4). This introduce an interface numbering change on some | ||
| 955 | * rare machines unfortunately, but it's better this way. | ||
| 956 | */ | 982 | */ |
| 957 | static int __devinit | 983 | static int __devinit |
| 958 | pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | 984 | pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) |
| @@ -962,7 +988,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | |||
| 962 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 988 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
| 963 | struct ide_port_info d = pmac_port_info; | 989 | struct ide_port_info d = pmac_port_info; |
| 964 | 990 | ||
| 965 | pmif->cable_80 = 0; | ||
| 966 | pmif->broken_dma = pmif->broken_dma_warn = 0; | 991 | pmif->broken_dma = pmif->broken_dma_warn = 0; |
| 967 | if (of_device_is_compatible(np, "shasta-ata")) { | 992 | if (of_device_is_compatible(np, "shasta-ata")) { |
| 968 | pmif->kind = controller_sh_ata6; | 993 | pmif->kind = controller_sh_ata6; |
| @@ -979,6 +1004,7 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | |||
| 979 | } else if (of_device_is_compatible(np, "keylargo-ata")) { | 1004 | } else if (of_device_is_compatible(np, "keylargo-ata")) { |
| 980 | if (strcmp(np->name, "ata-4") == 0) { | 1005 | if (strcmp(np->name, "ata-4") == 0) { |
| 981 | pmif->kind = controller_kl_ata4; | 1006 | pmif->kind = controller_kl_ata4; |
| 1007 | d.port_ops = &pmac_ide_ata4_port_ops; | ||
| 982 | d.udma_mask = ATA_UDMA4; | 1008 | d.udma_mask = ATA_UDMA4; |
| 983 | } else | 1009 | } else |
| 984 | pmif->kind = controller_kl_ata3; | 1010 | pmif->kind = controller_kl_ata3; |
| @@ -992,22 +1018,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | |||
| 992 | bidp = of_get_property(np, "AAPL,bus-id", NULL); | 1018 | bidp = of_get_property(np, "AAPL,bus-id", NULL); |
| 993 | pmif->aapl_bus_id = bidp ? *bidp : 0; | 1019 | pmif->aapl_bus_id = bidp ? *bidp : 0; |
| 994 | 1020 | ||
| 995 | /* Get cable type from device-tree */ | ||
| 996 | if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6 | ||
| 997 | || pmif->kind == controller_k2_ata6 | ||
| 998 | || pmif->kind == controller_sh_ata6) { | ||
| 999 | const char* cable = of_get_property(np, "cable-type", NULL); | ||
| 1000 | if (cable && !strncmp(cable, "80-", 3)) | ||
| 1001 | pmif->cable_80 = 1; | ||
| 1002 | } | ||
| 1003 | /* G5's seem to have incorrect cable type in device-tree. Let's assume | ||
| 1004 | * they have a 80 conductor cable, this seem to be always the case unless | ||
| 1005 | * the user mucked around | ||
| 1006 | */ | ||
| 1007 | if (of_device_is_compatible(np, "K2-UATA") || | ||
| 1008 | of_device_is_compatible(np, "shasta-ata")) | ||
| 1009 | pmif->cable_80 = 1; | ||
| 1010 | |||
| 1011 | /* On Kauai-type controllers, we make sure the FCR is correct */ | 1021 | /* On Kauai-type controllers, we make sure the FCR is correct */ |
| 1012 | if (pmif->kauai_fcr) | 1022 | if (pmif->kauai_fcr) |
| 1013 | writel(KAUAI_FCR_UATA_MAGIC | | 1023 | writel(KAUAI_FCR_UATA_MAGIC | |
| @@ -1053,7 +1063,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | |||
| 1053 | 1063 | ||
| 1054 | hwif->hwif_data = pmif; | 1064 | hwif->hwif_data = pmif; |
| 1055 | ide_init_port_hw(hwif, hw); | 1065 | ide_init_port_hw(hwif, hw); |
| 1056 | hwif->cbl = pmif->cable_80 ? ATA_CBL_PATA80 : ATA_CBL_PATA40; | ||
| 1057 | 1066 | ||
| 1058 | printk(KERN_INFO "ide%d: Found Apple %s controller, bus ID %d%s, irq %d\n", | 1067 | printk(KERN_INFO "ide%d: Found Apple %s controller, bus ID %d%s, irq %d\n", |
| 1059 | hwif->index, model_name[pmif->kind], pmif->aapl_bus_id, | 1068 | hwif->index, model_name[pmif->kind], pmif->aapl_bus_id, |
| @@ -1070,11 +1079,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | |||
| 1070 | } | 1079 | } |
| 1071 | } | 1080 | } |
| 1072 | 1081 | ||
| 1073 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | ||
| 1074 | if (pmif->cable_80 == 0) | ||
| 1075 | d.udma_mask &= ATA_UDMA2; | ||
| 1076 | #endif | ||
| 1077 | |||
| 1078 | idx[0] = hwif->index; | 1082 | idx[0] = hwif->index; |
| 1079 | 1083 | ||
| 1080 | ide_device_add(idx, &d); | 1084 | ide_device_add(idx, &d); |
