aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-01-01 14:31:15 -0500
committerJeff Garzik <jeff@garzik.org>2007-01-26 17:27:40 -0500
commit8cdf92a98fa0f91068615443f2a8597b7f2c34ca (patch)
treec33ae8216599533068dbcf2ef46c19a1f5b942a9 /drivers/ata
parentdfd7a3db3898e299bdc25f0c77081a8632b3a73c (diff)
Fix Maple PATA IRQ assignment.
On the Maple board, the AMD8111 IDE is in legacy mode... except that it appears on IRQ 20 instead of IRQ 15. For drivers/ide this was handled by the architecture's "pci_get_legacy_ide_irq()" function, but in libata we just hard-code the numbers 14 and 15. This patch provides asm-powerpc/libata-portmap.h which maps the IRQ as appropriate, having added a pci_dev argument to the ATA_{PRIM,SECOND}ARY_IRQ macros. There's probably a better way to do this -- especially if we observe that the _only_ case in which this seemingly-generic "pci_get_legacy_ide_irq()" function returns anything other than 14 and 15 for primary and secondary respectively is the case of the AMD8111 on the Maple board -- couldn't we handle that with a special case in the pata_amd driver, or perhaps with a PCI quirk for Maple to switch it into native mode during early boot and assign resources properly? Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/Kconfig4
-rw-r--r--drivers/ata/libata-sff.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index da21552d2b1c..1c94b43d2c9b 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -19,6 +19,10 @@ config ATA
19 19
20if ATA 20if ATA
21 21
22config ATA_NONSTANDARD
23 bool
24 default n
25
22config SATA_AHCI 26config SATA_AHCI
23 tristate "AHCI SATA support" 27 tristate "AHCI SATA support"
24 depends on PCI 28 depends on PCI
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 942aeba2940a..12c88c588039 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -917,7 +917,7 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev,
917 probe_ent->irq_flags = IRQF_SHARED; 917 probe_ent->irq_flags = IRQF_SHARED;
918 918
919 if (port_mask & ATA_PORT_PRIMARY) { 919 if (port_mask & ATA_PORT_PRIMARY) {
920 probe_ent->irq = ATA_PRIMARY_IRQ; 920 probe_ent->irq = ATA_PRIMARY_IRQ(pdev);
921 probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD; 921 probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD;
922 probe_ent->port[0].altstatus_addr = 922 probe_ent->port[0].altstatus_addr =
923 probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; 923 probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL;
@@ -933,9 +933,9 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev,
933 933
934 if (port_mask & ATA_PORT_SECONDARY) { 934 if (port_mask & ATA_PORT_SECONDARY) {
935 if (probe_ent->irq) 935 if (probe_ent->irq)
936 probe_ent->irq2 = ATA_SECONDARY_IRQ; 936 probe_ent->irq2 = ATA_SECONDARY_IRQ(pdev);
937 else 937 else
938 probe_ent->irq = ATA_SECONDARY_IRQ; 938 probe_ent->irq = ATA_SECONDARY_IRQ(pdev);
939 probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD; 939 probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD;
940 probe_ent->port[1].altstatus_addr = 940 probe_ent->port[1].altstatus_addr =
941 probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; 941 probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL;