aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:11 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:11 -0400
commit3985ee3b4c5f9e1d73623b92715375b089c54353 (patch)
tree13741edc5575b3ebb436f94b04e338b3b0701e9f /drivers
parent1c51361a9867021dd7444b56d87834003d4ca67d (diff)
ide: add IDE_HFLAG_LEGACY_IRQS host flag
Add IDE_HFLAG_LEGACY_IRQS host flag to tell ide_pci_setup_ports() to set hwif->irq to legacy IRQ 14/15 (iff hwif->irq is not already set) and convert atiixp, piix, serverworks, sis5513 and slc90e66 host drivers to use it. While at it: * In piix.c add IDE_HFLAGS_PIIX define and don't use ->init_hwif for MPIIX. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/pci/atiixp.c8
-rw-r--r--drivers/ide/pci/piix.c24
-rw-r--r--drivers/ide/pci/serverworks.c15
-rw-r--r--drivers/ide/pci/sis5513.c6
-rw-r--r--drivers/ide/pci/slc90e66.c5
-rw-r--r--drivers/ide/setup-pci.c3
6 files changed, 26 insertions, 35 deletions
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 18c181bc841b..47e95806c07f 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -172,9 +172,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
172 u8 ch = hwif->channel; 172 u8 ch = hwif->channel;
173 struct pci_dev *pdev = hwif->pci_dev; 173 struct pci_dev *pdev = hwif->pci_dev;
174 174
175 if (!hwif->irq)
176 hwif->irq = ch ? 15 : 14;
177
178 hwif->set_pio_mode = &atiixp_set_pio_mode; 175 hwif->set_pio_mode = &atiixp_set_pio_mode;
179 hwif->set_dma_mode = &atiixp_set_dma_mode; 176 hwif->set_dma_mode = &atiixp_set_dma_mode;
180 hwif->drives[0].autotune = 1; 177 hwif->drives[0].autotune = 1;
@@ -200,7 +197,7 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
200 .name = "ATIIXP", 197 .name = "ATIIXP",
201 .init_hwif = init_hwif_atiixp, 198 .init_hwif = init_hwif_atiixp,
202 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, 199 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
203 .host_flags = IDE_HFLAG_BOOTABLE, 200 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE,
204 .pio_mask = ATA_PIO4, 201 .pio_mask = ATA_PIO4,
205 .mwdma_mask = ATA_MWDMA2, 202 .mwdma_mask = ATA_MWDMA2,
206 .udma_mask = ATA_UDMA5, 203 .udma_mask = ATA_UDMA5,
@@ -208,7 +205,8 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
208 .name = "SB600_PATA", 205 .name = "SB600_PATA",
209 .init_hwif = init_hwif_atiixp, 206 .init_hwif = init_hwif_atiixp,
210 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, 207 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
211 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE, 208 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_LEGACY_IRQS |
209 IDE_HFLAG_BOOTABLE,
212 .pio_mask = ATA_PIO4, 210 .pio_mask = ATA_PIO4,
213 .mwdma_mask = ATA_MWDMA2, 211 .mwdma_mask = ATA_MWDMA2,
214 .udma_mask = ATA_UDMA5, 212 .udma_mask = ATA_UDMA5,
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index bcdf8c17b90b..2e29543acff9 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -341,16 +341,6 @@ static u8 __devinit piix_cable_detect(ide_hwif_t *hwif)
341 341
342static void __devinit init_hwif_piix(ide_hwif_t *hwif) 342static void __devinit init_hwif_piix(ide_hwif_t *hwif)
343{ 343{
344#ifndef CONFIG_IA64
345 if (!hwif->irq)
346 hwif->irq = hwif->channel ? 15 : 14;
347#endif /* CONFIG_IA64 */
348
349 if (hwif->pci_dev->device == PCI_DEVICE_ID_INTEL_82371MX) {
350 /* This is a painful system best to let it self tune for now */
351 return;
352 }
353
354 hwif->set_pio_mode = &piix_set_pio_mode; 344 hwif->set_pio_mode = &piix_set_pio_mode;
355 hwif->set_dma_mode = &piix_set_dma_mode; 345 hwif->set_dma_mode = &piix_set_dma_mode;
356 346
@@ -378,12 +368,18 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif)
378 hwif->ide_dma_clear_irq = &piix_dma_clear_irq; 368 hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
379} 369}
380 370
371#ifndef CONFIG_IA64
372 #define IDE_HFLAGS_PIIX (IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE)
373#else
374 #define IDE_HFLAGS_PIIX IDE_HFLAG_BOOTABLE
375#endif
376
381#define DECLARE_PIIX_DEV(name_str, udma) \ 377#define DECLARE_PIIX_DEV(name_str, udma) \
382 { \ 378 { \
383 .name = name_str, \ 379 .name = name_str, \
384 .init_hwif = init_hwif_piix, \ 380 .init_hwif = init_hwif_piix, \
385 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ 381 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
386 .host_flags = IDE_HFLAG_BOOTABLE, \ 382 .host_flags = IDE_HFLAGS_PIIX, \
387 .pio_mask = ATA_PIO4, \ 383 .pio_mask = ATA_PIO4, \
388 .swdma_mask = ATA_SWDMA2_ONLY, \ 384 .swdma_mask = ATA_SWDMA2_ONLY, \
389 .mwdma_mask = ATA_MWDMA12_ONLY, \ 385 .mwdma_mask = ATA_MWDMA12_ONLY, \
@@ -396,7 +392,7 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif)
396 .init_chipset = init_chipset_ich, \ 392 .init_chipset = init_chipset_ich, \
397 .init_hwif = init_hwif_ich, \ 393 .init_hwif = init_hwif_ich, \
398 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ 394 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
399 .host_flags = IDE_HFLAG_BOOTABLE, \ 395 .host_flags = IDE_HFLAGS_PIIX, \
400 .pio_mask = ATA_PIO4, \ 396 .pio_mask = ATA_PIO4, \
401 .swdma_mask = ATA_SWDMA2_ONLY, \ 397 .swdma_mask = ATA_SWDMA2_ONLY, \
402 .mwdma_mask = ATA_MWDMA12_ONLY, \ 398 .mwdma_mask = ATA_MWDMA12_ONLY, \
@@ -414,11 +410,11 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
414 * of the bit 14 of the IDETIM register at offset 0x6c 410 * of the bit 14 of the IDETIM register at offset 0x6c
415 */ 411 */
416 .name = "MPIIX", 412 .name = "MPIIX",
417 .init_hwif = init_hwif_piix,
418 .enablebits = {{0x6d,0xc0,0x80}, {0x6d,0xc0,0xc0}}, 413 .enablebits = {{0x6d,0xc0,0x80}, {0x6d,0xc0,0xc0}},
419 .host_flags = IDE_HFLAG_ISA_PORTS | IDE_HFLAG_NO_DMA | 414 .host_flags = IDE_HFLAG_ISA_PORTS | IDE_HFLAG_NO_DMA |
420 IDE_HFLAG_BOOTABLE, 415 IDE_HFLAGS_PIIX,
421 .pio_mask = ATA_PIO4, 416 .pio_mask = ATA_PIO4,
417 /* This is a painful system best to let it self tune for now */
422 }, 418 },
423 419
424 /* 3 */ DECLARE_PIIX_DEV("PIIX3", 0x00), /* no udma */ 420 /* 3 */ DECLARE_PIIX_DEV("PIIX3", 0x00), /* no udma */
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index c506b8bc4bcd..6f95cd292927 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -360,9 +360,6 @@ static u8 __devinit ata66_svwks(ide_hwif_t *hwif)
360 360
361static void __devinit init_hwif_svwks (ide_hwif_t *hwif) 361static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
362{ 362{
363 if (!hwif->irq)
364 hwif->irq = hwif->channel ? 15 : 14;
365
366 hwif->set_pio_mode = &svwks_set_pio_mode; 363 hwif->set_pio_mode = &svwks_set_pio_mode;
367 hwif->set_dma_mode = &svwks_set_dma_mode; 364 hwif->set_dma_mode = &svwks_set_dma_mode;
368 hwif->udma_filter = &svwks_udma_filter; 365 hwif->udma_filter = &svwks_udma_filter;
@@ -384,7 +381,7 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
384 .name = "SvrWks OSB4", 381 .name = "SvrWks OSB4",
385 .init_chipset = init_chipset_svwks, 382 .init_chipset = init_chipset_svwks,
386 .init_hwif = init_hwif_svwks, 383 .init_hwif = init_hwif_svwks,
387 .host_flags = IDE_HFLAG_BOOTABLE, 384 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE,
388 .pio_mask = ATA_PIO4, 385 .pio_mask = ATA_PIO4,
389 .mwdma_mask = ATA_MWDMA2, 386 .mwdma_mask = ATA_MWDMA2,
390 .udma_mask = 0x00, /* UDMA is problematic on OSB4 */ 387 .udma_mask = 0x00, /* UDMA is problematic on OSB4 */
@@ -392,7 +389,7 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
392 .name = "SvrWks CSB5", 389 .name = "SvrWks CSB5",
393 .init_chipset = init_chipset_svwks, 390 .init_chipset = init_chipset_svwks,
394 .init_hwif = init_hwif_svwks, 391 .init_hwif = init_hwif_svwks,
395 .host_flags = IDE_HFLAG_BOOTABLE, 392 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE,
396 .pio_mask = ATA_PIO4, 393 .pio_mask = ATA_PIO4,
397 .mwdma_mask = ATA_MWDMA2, 394 .mwdma_mask = ATA_MWDMA2,
398 .udma_mask = ATA_UDMA5, 395 .udma_mask = ATA_UDMA5,
@@ -400,7 +397,7 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
400 .name = "SvrWks CSB6", 397 .name = "SvrWks CSB6",
401 .init_chipset = init_chipset_svwks, 398 .init_chipset = init_chipset_svwks,
402 .init_hwif = init_hwif_svwks, 399 .init_hwif = init_hwif_svwks,
403 .host_flags = IDE_HFLAG_BOOTABLE, 400 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE,
404 .pio_mask = ATA_PIO4, 401 .pio_mask = ATA_PIO4,
405 .mwdma_mask = ATA_MWDMA2, 402 .mwdma_mask = ATA_MWDMA2,
406 .udma_mask = ATA_UDMA5, 403 .udma_mask = ATA_UDMA5,
@@ -408,7 +405,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
408 .name = "SvrWks CSB6", 405 .name = "SvrWks CSB6",
409 .init_chipset = init_chipset_svwks, 406 .init_chipset = init_chipset_svwks,
410 .init_hwif = init_hwif_svwks, 407 .init_hwif = init_hwif_svwks,
411 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE, 408 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_SINGLE |
409 IDE_HFLAG_BOOTABLE,
412 .pio_mask = ATA_PIO4, 410 .pio_mask = ATA_PIO4,
413 .mwdma_mask = ATA_MWDMA2, 411 .mwdma_mask = ATA_MWDMA2,
414 .udma_mask = ATA_UDMA5, 412 .udma_mask = ATA_UDMA5,
@@ -416,7 +414,8 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
416 .name = "SvrWks HT1000", 414 .name = "SvrWks HT1000",
417 .init_chipset = init_chipset_svwks, 415 .init_chipset = init_chipset_svwks,
418 .init_hwif = init_hwif_svwks, 416 .init_hwif = init_hwif_svwks,
419 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_BOOTABLE, 417 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_SINGLE |
418 IDE_HFLAG_BOOTABLE,
420 .pio_mask = ATA_PIO4, 419 .pio_mask = ATA_PIO4,
421 .mwdma_mask = ATA_MWDMA2, 420 .mwdma_mask = ATA_MWDMA2,
422 .udma_mask = ATA_UDMA5, 421 .udma_mask = ATA_UDMA5,
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index d38b2039e2aa..674a5bb79550 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -564,9 +564,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
564{ 564{
565 u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; 565 u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f };
566 566
567 if (!hwif->irq)
568 hwif->irq = hwif->channel ? 15 : 14;
569
570 hwif->set_pio_mode = &sis_set_pio_mode; 567 hwif->set_pio_mode = &sis_set_pio_mode;
571 hwif->set_dma_mode = &sis_set_dma_mode; 568 hwif->set_dma_mode = &sis_set_dma_mode;
572 569
@@ -590,7 +587,8 @@ static ide_pci_device_t sis5513_chipset __devinitdata = {
590 .init_chipset = init_chipset_sis5513, 587 .init_chipset = init_chipset_sis5513,
591 .init_hwif = init_hwif_sis5513, 588 .init_hwif = init_hwif_sis5513,
592 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 589 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
593 .host_flags = IDE_HFLAG_NO_AUTODMA | IDE_HFLAG_BOOTABLE, 590 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_NO_AUTODMA |
591 IDE_HFLAG_BOOTABLE,
594 .pio_mask = ATA_PIO4, 592 .pio_mask = ATA_PIO4,
595 .mwdma_mask = ATA_MWDMA2, 593 .mwdma_mask = ATA_MWDMA2,
596}; 594};
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 416fbab2ed36..d85a48e7deba 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -133,9 +133,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
133 u8 reg47 = 0; 133 u8 reg47 = 0;
134 u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ 134 u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */
135 135
136 if (!hwif->irq)
137 hwif->irq = hwif->channel ? 15 : 14;
138
139 hwif->set_pio_mode = &slc90e66_set_pio_mode; 136 hwif->set_pio_mode = &slc90e66_set_pio_mode;
140 hwif->set_dma_mode = &slc90e66_set_dma_mode; 137 hwif->set_dma_mode = &slc90e66_set_dma_mode;
141 138
@@ -156,7 +153,7 @@ static ide_pci_device_t slc90e66_chipset __devinitdata = {
156 .name = "SLC90E66", 153 .name = "SLC90E66",
157 .init_hwif = init_hwif_slc90e66, 154 .init_hwif = init_hwif_slc90e66,
158 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, 155 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
159 .host_flags = IDE_HFLAG_BOOTABLE, 156 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE,
160 .pio_mask = ATA_PIO4, 157 .pio_mask = ATA_PIO4,
161 .swdma_mask = ATA_SWDMA2_ONLY, 158 .swdma_mask = ATA_SWDMA2_ONLY,
162 .mwdma_mask = ATA_MWDMA12_ONLY, 159 .mwdma_mask = ATA_MWDMA12_ONLY,
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index aae4806f0603..7989f521b801 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -562,6 +562,9 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
562 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) 562 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0)
563 ide_hwif_setup_dma(dev, d, hwif); 563 ide_hwif_setup_dma(dev, d, hwif);
564 564
565 if ((d->host_flags & IDE_HFLAG_LEGACY_IRQS) && hwif->irq == 0)
566 hwif->irq = port ? 15 : 14;
567
565 hwif->host_flags = d->host_flags; 568 hwif->host_flags = d->host_flags;
566 hwif->pio_mask = d->pio_mask; 569 hwif->pio_mask = d->pio_mask;
567 570