2 * arch/arm/mach-ixp4xx/gtwx5715-pci.c
4 * Gemtek GTWX5715 (Linksys WRV54G) board setup
6 * Copyright (C) 2004 George T. Joseph
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include <linux/pci.h>
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/irq.h>
29 #include <asm/mach-types.h>
30 #include <mach/hardware.h>
31 #include <asm/mach/pci.h>
35 #define INTA 10 /* slot 1 has INTA and INTB crossed */
39 * Slot 0 isn't actually populated with a card connector but
40 * we initialize it anyway in case a future version has the
41 * slot populated or someone with good soldering skills has
44 void __init
gtwx5715_pci_preinit(void)
46 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA
), IRQ_TYPE_LEVEL_LOW
);
47 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB
), IRQ_TYPE_LEVEL_LOW
);
52 static int __init
gtwx5715_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
56 if ((slot
== SLOT0_DEVID
&& pin
== 1) ||
57 (slot
== SLOT1_DEVID
&& pin
== 2))
58 rc
= IXP4XX_GPIO_IRQ(INTA
);
59 else if ((slot
== SLOT0_DEVID
&& pin
== 2) ||
60 (slot
== SLOT1_DEVID
&& pin
== 1))
61 rc
= IXP4XX_GPIO_IRQ(INTB
);
63 printk(KERN_INFO
"%s: Mapped slot %d pin %d to IRQ %d\n",
64 __func__
, slot
, pin
, rc
);
68 struct hw_pci gtwx5715_pci __initdata
= {
71 .preinit
= gtwx5715_pci_preinit
,
72 .setup
= ixp4xx_setup
,
73 .map_irq
= gtwx5715_map_irq
,
76 int __init
gtwx5715_pci_init(void)
78 if (machine_is_gtwx5715())
79 pci_common_init(>wx5715_pci
);
84 subsys_initcall(gtwx5715_pci_init
);