aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:30 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:30 -0400
commit8acf28c090f0e5e049f56b27bdd7cf1fb40c6b98 (patch)
treecbf910b986d423d030c5917515b3c68368aed70f
parent528a572daea90aa41db92683e5a8756acef514c4 (diff)
ide: add IDE_HFLAG_FORCE_LEGACY_IRQS host flag
Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag to tell ide_pci_setup_ports() to always set hwif->irq to legacy IRQ 14/15 and convert generic IDE PCI and via82cxxx host drivers to use it. While at it: * Add IDE_HFLAGS_UMC define (generic IDE PCI host driver). * Remove no longer needed init_hwif_generic() (generic IDE PCI host driver). * Set d->udma_mask instead of hwif->ultra_mask (via82cxxx host driver). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/pci/generic.c27
-rw-r--r--drivers/ide/pci/via82cxxx.c20
-rw-r--r--drivers/ide/setup-pci.c3
-rw-r--r--include/linux/ide.h2
4 files changed, 21 insertions, 31 deletions
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index 51165832e7f2..b377006d416c 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -54,25 +54,13 @@ __setup("all-generic-ide", ide_generic_all_on);
54module_param_named(all_generic_ide, ide_generic_all, bool, 0444); 54module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
55MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers."); 55MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
56 56
57static void __devinit init_hwif_generic (ide_hwif_t *hwif) 57#define IDE_HFLAGS_UMC (IDE_HFLAG_NO_DMA | IDE_HFLAG_FORCE_LEGACY_IRQS)
58{
59 switch(hwif->pci_dev->device) {
60 case PCI_DEVICE_ID_UMC_UM8673F:
61 case PCI_DEVICE_ID_UMC_UM8886A:
62 case PCI_DEVICE_ID_UMC_UM8886BF:
63 hwif->irq = hwif->channel ? 15 : 14;
64 break;
65 default:
66 break;
67 }
68}
69 58
70#define DECLARE_GENERIC_PCI_DEV(name_str, dma_setting) \ 59#define DECLARE_GENERIC_PCI_DEV(name_str, extra_flags) \
71 { \ 60 { \
72 .name = name_str, \ 61 .name = name_str, \
73 .init_hwif = init_hwif_generic, \
74 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \ 62 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
75 dma_setting | \ 63 extra_flags | \
76 IDE_HFLAG_BOOTABLE, \ 64 IDE_HFLAG_BOOTABLE, \
77 .swdma_mask = ATA_SWDMA2, \ 65 .swdma_mask = ATA_SWDMA2, \
78 .mwdma_mask = ATA_MWDMA2, \ 66 .mwdma_mask = ATA_MWDMA2, \
@@ -84,7 +72,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
84 72
85 { /* 1 */ 73 { /* 1 */
86 .name = "NS87410", 74 .name = "NS87410",
87 .init_hwif = init_hwif_generic,
88 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, 75 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
89 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 76 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
90 IDE_HFLAG_BOOTABLE, 77 IDE_HFLAG_BOOTABLE,
@@ -95,16 +82,15 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
95 82
96 /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0), 83 /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0),
97 /* 3 */ DECLARE_GENERIC_PCI_DEV("HT6565", 0), 84 /* 3 */ DECLARE_GENERIC_PCI_DEV("HT6565", 0),
98 /* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAG_NO_DMA), 85 /* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAGS_UMC),
99 /* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAG_NO_DMA), 86 /* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAGS_UMC),
100 /* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAG_NO_DMA), 87 /* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAGS_UMC),
101 /* 7 */ DECLARE_GENERIC_PCI_DEV("HINT_IDE", 0), 88 /* 7 */ DECLARE_GENERIC_PCI_DEV("HINT_IDE", 0),
102 /* 8 */ DECLARE_GENERIC_PCI_DEV("VIA_IDE", IDE_HFLAG_NO_AUTODMA), 89 /* 8 */ DECLARE_GENERIC_PCI_DEV("VIA_IDE", IDE_HFLAG_NO_AUTODMA),
103 /* 9 */ DECLARE_GENERIC_PCI_DEV("OPTI621V", IDE_HFLAG_NO_AUTODMA), 90 /* 9 */ DECLARE_GENERIC_PCI_DEV("OPTI621V", IDE_HFLAG_NO_AUTODMA),
104 91
105 { /* 10 */ 92 { /* 10 */
106 .name = "VIA8237SATA", 93 .name = "VIA8237SATA",
107 .init_hwif = init_hwif_generic,
108 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 94 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
109 IDE_HFLAG_OFF_BOARD, 95 IDE_HFLAG_OFF_BOARD,
110 .swdma_mask = ATA_SWDMA2, 96 .swdma_mask = ATA_SWDMA2,
@@ -118,7 +104,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
118 104
119 { /* 14 */ 105 { /* 14 */
120 .name = "Revolution", 106 .name = "Revolution",
121 .init_hwif = init_hwif_generic,
122 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 107 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
123 IDE_HFLAG_OFF_BOARD, 108 IDE_HFLAG_OFF_BOARD,
124 .swdma_mask = ATA_SWDMA2, 109 .swdma_mask = ATA_SWDMA2,
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index c8022a92a0e3..27e5b410123a 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -428,12 +428,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
428 hwif->set_pio_mode = &via_set_pio_mode; 428 hwif->set_pio_mode = &via_set_pio_mode;
429 hwif->set_dma_mode = &via_set_drive; 429 hwif->set_dma_mode = &via_set_drive;
430 430
431#ifdef CONFIG_PPC_CHRP
432 if(machine_is(chrp) && _chrp_type == _CHRP_Pegasos) {
433 hwif->irq = hwif->channel ? 15 : 14;
434 }
435#endif
436
437 for (i = 0; i < 2; i++) { 431 for (i = 0; i < 2; i++) {
438 hwif->drives[i].io_32bit = 1; 432 hwif->drives[i].io_32bit = 1;
439 hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1; 433 hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
@@ -442,8 +436,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
442 if (!hwif->dma_base) 436 if (!hwif->dma_base)
443 return; 437 return;
444 438
445 hwif->ultra_mask = vdev->via_config->udma_mask;
446
447 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 439 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
448 hwif->cbl = via82cxxx_cable_detect(hwif); 440 hwif->cbl = via82cxxx_cable_detect(hwif);
449} 441}
@@ -479,8 +471,10 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
479 471
480static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id) 472static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
481{ 473{
474 ide_pci_device_t *d = &via82cxxx_chipsets[id->driver_data];
482 struct pci_dev *isa = NULL; 475 struct pci_dev *isa = NULL;
483 struct via_isa_bridge *via_config; 476 struct via_isa_bridge *via_config;
477
484 /* 478 /*
485 * Find the ISA bridge and check we know what it is. 479 * Find the ISA bridge and check we know what it is.
486 */ 480 */
@@ -490,7 +484,15 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
490 printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n"); 484 printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n");
491 return -ENODEV; 485 return -ENODEV;
492 } 486 }
493 return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]); 487
488#ifdef CONFIG_PPC_CHRP
489 if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos)
490 d->host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
491#endif
492
493 d->udma_mask = via_config->udma_mask;
494
495 return ide_setup_pci_device(dev, d);
494} 496}
495 497
496static const struct pci_device_id via_pci_tbl[] = { 498static const struct pci_device_id via_pci_tbl[] = {
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 30c0741c5e5c..4fa813b96e72 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -563,7 +563,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
563 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) 563 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0)
564 ide_hwif_setup_dma(dev, d, hwif); 564 ide_hwif_setup_dma(dev, d, hwif);
565 565
566 if ((d->host_flags & IDE_HFLAG_LEGACY_IRQS) && hwif->irq == 0) 566 if ((!hwif->irq && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
567 (d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS))
567 hwif->irq = port ? 15 : 14; 568 hwif->irq = port ? 15 : 14;
568 569
569 hwif->host_flags = d->host_flags; 570 hwif->host_flags = d->host_flags;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index b676e51d74f1..ff9d293f9ae9 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1263,6 +1263,8 @@ enum {
1263 IDE_HFLAG_SERIALIZE = (1 << 20), 1263 IDE_HFLAG_SERIALIZE = (1 << 20),
1264 /* use legacy IRQs */ 1264 /* use legacy IRQs */
1265 IDE_HFLAG_LEGACY_IRQS = (1 << 21), 1265 IDE_HFLAG_LEGACY_IRQS = (1 << 21),
1266 /* force use of legacy IRQs */
1267 IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22),
1266}; 1268};
1267 1269
1268#ifdef CONFIG_BLK_DEV_OFFBOARD 1270#ifdef CONFIG_BLK_DEV_OFFBOARD