Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8cdf92a98fa0f91068615443f2a8597b7f2c34ca
Commit:     8cdf92a98fa0f91068615443f2a8597b7f2c34ca
Parent:     dfd7a3db3898e299bdc25f0c77081a8632b3a73c
Author:     David Woodhouse <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 1 19:31:15 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Jan 26 17:27:40 2007 -0500

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 arch/powerpc/Kconfig                 |    1 +
 drivers/ata/Kconfig                  |    4 ++++
 drivers/ata/libata-sff.c             |    6 +++---
 include/asm-generic/libata-portmap.h |    4 ++--
 include/asm-powerpc/libata-portmap.h |   12 ++++++++++++
 5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0855d55..b268c41 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -484,6 +484,7 @@ config PPC_MAPLE
        select PPC_970_NAP
        select PPC_NATIVE
        select PPC_RTAS
+       select ATA_NONSTANDARD if ATA
        default n
        help
           This option enables support for the Maple 970FX Evaluation Board.
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index da21552..1c94b43 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -19,6 +19,10 @@ config ATA
 
 if ATA
 
+config ATA_NONSTANDARD
+       bool
+       default n
+
 config SATA_AHCI
        tristate "AHCI SATA support"
        depends on PCI
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 942aeba..12c88c5 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,
        probe_ent->irq_flags = IRQF_SHARED;
 
        if (port_mask & ATA_PORT_PRIMARY) {
-               probe_ent->irq = ATA_PRIMARY_IRQ;
+               probe_ent->irq = ATA_PRIMARY_IRQ(pdev);
                probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD;
                probe_ent->port[0].altstatus_addr =
                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,
 
        if (port_mask & ATA_PORT_SECONDARY) {
                if (probe_ent->irq)
-                       probe_ent->irq2 = ATA_SECONDARY_IRQ;
+                       probe_ent->irq2 = ATA_SECONDARY_IRQ(pdev);
                else
-                       probe_ent->irq = ATA_SECONDARY_IRQ;
+                       probe_ent->irq = ATA_SECONDARY_IRQ(pdev);
                probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD;
                probe_ent->port[1].altstatus_addr =
                probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL;
diff --git a/include/asm-generic/libata-portmap.h 
b/include/asm-generic/libata-portmap.h
index 9202fd0..62fb361 100644
--- a/include/asm-generic/libata-portmap.h
+++ b/include/asm-generic/libata-portmap.h
@@ -3,10 +3,10 @@
 
 #define ATA_PRIMARY_CMD                0x1F0
 #define ATA_PRIMARY_CTL                0x3F6
-#define ATA_PRIMARY_IRQ                14
+#define ATA_PRIMARY_IRQ(dev)   14
 
 #define ATA_SECONDARY_CMD      0x170
 #define ATA_SECONDARY_CTL      0x376
-#define ATA_SECONDARY_IRQ      15
+#define ATA_SECONDARY_IRQ(dev) 15
 
 #endif
diff --git a/include/asm-powerpc/libata-portmap.h 
b/include/asm-powerpc/libata-portmap.h
new file mode 100644
index 0000000..4d85180
--- /dev/null
+++ b/include/asm-powerpc/libata-portmap.h
@@ -0,0 +1,12 @@
+#ifndef __ASM_POWERPC_LIBATA_PORTMAP_H
+#define __ASM_POWERPC_LIBATA_PORTMAP_H
+
+#define ATA_PRIMARY_CMD        0x1F0
+#define ATA_PRIMARY_CTL        0x3F6
+#define ATA_PRIMARY_IRQ(dev)   pci_get_legacy_ide_irq(dev, 0)
+
+#define ATA_SECONDARY_CMD      0x170
+#define ATA_SECONDARY_CTL      0x376
+#define ATA_SECONDARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 1)
+
+#endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to