aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/gtwx5715-pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-12 18:22:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-12 18:22:22 -0500
commitf40542532e96dda5506eb76badea322f2ae4731c (patch)
tree157b37de0c375aaebe73dc68762beb7ffe998e76 /arch/arm/mach-ixp4xx/gtwx5715-pci.c
parentf01eb3640308c005d31b29d0a8bc2b7acb4e3f75 (diff)
parent0fd7dc7f6c88ba4a46ff472a30d175facc8b6292 (diff)
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
* 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6: IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four. IXP4xx: Introduce IXP4XX_GPIO_IRQ(n) macro and convert IXP4xx platform files. IXP4xx: move Gemtek GTWX5715 platform macros to the platform code. IXP4xx: Remove unused Motorola PrPMC1100 platform macros. IXP4xx: move FSG platform macros to the platform code. IXP4xx: move DSM G600 platform macros to the platform code. IXP4xx: move NAS100D platform macros to the platform code. IXP4xx: move NSLU2 platform macros to the platform code. IXP4xx: move Coyote platform macros to the platform code. IXP4xx: move AVILA platform macros to the platform code. IXP4xx: move IXDP425 platform macros to the platform code. IXP4xx: Extend PCI MMIO indirect address space to 1 GB. IXP4xx: Fix compilation failure with CONFIG_IXP4XX_INDIRECT_PCI. IXP4xx: Drop "__ixp4xx_" prefix from in/out/ioread/iowrite functions for clarity. IXP4xx: Rename indirect MMIO primitives from __ixp4xx_* to __indirect_*. IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request(). ARM: fix insl() and outsl() endianness on IXP4xx architecture. IXP4xx: Fix normally-disabled debugging text in drivers/net/arm/ixp4xx_eth.c. IXP4xx: change the timer base frequency to 66.666000 MHz.
Diffstat (limited to 'arch/arm/mach-ixp4xx/gtwx5715-pci.c')
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-pci.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
index 7b8a2c323840..25d2c333c204 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-pci.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
@@ -26,14 +26,16 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/irq.h> 28#include <linux/irq.h>
29
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31#include <mach/hardware.h> 30#include <mach/hardware.h>
32#include <mach/gtwx5715.h>
33#include <asm/mach/pci.h> 31#include <asm/mach/pci.h>
34 32
33#define SLOT0_DEVID 0
34#define SLOT1_DEVID 1
35#define INTA 10 /* slot 1 has INTA and INTB crossed */
36#define INTB 11
37
35/* 38/*
36 * The exact GPIO pins and IRQs are defined in arch-ixp4xx/gtwx5715.h
37 * Slot 0 isn't actually populated with a card connector but 39 * Slot 0 isn't actually populated with a card connector but
38 * we initialize it anyway in case a future version has the 40 * we initialize it anyway in case a future version has the
39 * slot populated or someone with good soldering skills has 41 * slot populated or someone with good soldering skills has
@@ -41,32 +43,26 @@
41 */ 43 */
42void __init gtwx5715_pci_preinit(void) 44void __init gtwx5715_pci_preinit(void)
43{ 45{
44 set_irq_type(GTWX5715_PCI_SLOT0_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); 46 set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
45 set_irq_type(GTWX5715_PCI_SLOT0_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); 47 set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
46 set_irq_type(GTWX5715_PCI_SLOT1_INTA_IRQ, IRQ_TYPE_LEVEL_LOW);
47 set_irq_type(GTWX5715_PCI_SLOT1_INTB_IRQ, IRQ_TYPE_LEVEL_LOW);
48
49 ixp4xx_pci_preinit(); 48 ixp4xx_pci_preinit();
50} 49}
51 50
52 51
53static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 52static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
54{ 53{
55 int rc; 54 int rc = -1;
56 static int gtwx5715_irqmap
57 [GTWX5715_PCI_SLOT_COUNT]
58 [GTWX5715_PCI_INT_PIN_COUNT] = {
59 {GTWX5715_PCI_SLOT0_INTA_IRQ, GTWX5715_PCI_SLOT0_INTB_IRQ},
60 {GTWX5715_PCI_SLOT1_INTA_IRQ, GTWX5715_PCI_SLOT1_INTB_IRQ},
61};
62 55
63 if (slot >= GTWX5715_PCI_SLOT_COUNT || 56 if ((slot == SLOT0_DEVID && pin == 1) ||
64 pin >= GTWX5715_PCI_INT_PIN_COUNT) rc = -1; 57 (slot == SLOT1_DEVID && pin == 2))
65 else 58 rc = IXP4XX_GPIO_IRQ(INTA);
66 rc = gtwx5715_irqmap[slot][pin-1]; 59 else if ((slot == SLOT0_DEVID && pin == 2) ||
60 (slot == SLOT1_DEVID && pin == 1))
61 rc = IXP4XX_GPIO_IRQ(INTB);
67 62
68 printk("%s: Mapped slot %d pin %d to IRQ %d\n", __func__, slot, pin, rc); 63 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
69 return(rc); 64 __func__, slot, pin, rc);
65 return rc;
70} 66}
71 67
72struct hw_pci gtwx5715_pci __initdata = { 68struct hw_pci gtwx5715_pci __initdata = {
@@ -81,9 +77,7 @@ struct hw_pci gtwx5715_pci __initdata = {
81int __init gtwx5715_pci_init(void) 77int __init gtwx5715_pci_init(void)
82{ 78{
83 if (machine_is_gtwx5715()) 79 if (machine_is_gtwx5715())
84 {
85 pci_common_init(&gtwx5715_pci); 80 pci_common_init(&gtwx5715_pci);
86 }
87 81
88 return 0; 82 return 0;
89} 83}