WIP FPC-III support
[linux/fpc-iii.git] / arch / arm / mach-ixp4xx / gtwx5715-pci.c
blob224328dbddb1ab68ee5fbf6df88495083b2011b9
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * arch/arm/mach-ixp4xx/gtwx5715-pci.c
5 * Gemtek GTWX5715 (Linksys WRV54G) board setup
7 * Copyright (C) 2004 George T. Joseph
8 * Derived from Coyote
9 */
11 #include <linux/pci.h>
12 #include <linux/init.h>
13 #include <linux/delay.h>
14 #include <linux/irq.h>
15 #include <asm/mach-types.h>
16 #include <mach/hardware.h>
17 #include <asm/mach/pci.h>
19 #include "irqs.h"
21 #define SLOT0_DEVID 0
22 #define SLOT1_DEVID 1
23 #define INTA 10 /* slot 1 has INTA and INTB crossed */
24 #define INTB 11
27 * Slot 0 isn't actually populated with a card connector but
28 * we initialize it anyway in case a future version has the
29 * slot populated or someone with good soldering skills has
30 * some free time.
32 void __init gtwx5715_pci_preinit(void)
34 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
35 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
36 ixp4xx_pci_preinit();
40 static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
42 int rc = -1;
44 if ((slot == SLOT0_DEVID && pin == 1) ||
45 (slot == SLOT1_DEVID && pin == 2))
46 rc = IXP4XX_GPIO_IRQ(INTA);
47 else if ((slot == SLOT0_DEVID && pin == 2) ||
48 (slot == SLOT1_DEVID && pin == 1))
49 rc = IXP4XX_GPIO_IRQ(INTB);
51 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
52 __func__, slot, pin, rc);
53 return rc;
56 struct hw_pci gtwx5715_pci __initdata = {
57 .nr_controllers = 1,
58 .ops = &ixp4xx_ops,
59 .preinit = gtwx5715_pci_preinit,
60 .setup = ixp4xx_setup,
61 .map_irq = gtwx5715_map_irq,
64 int __init gtwx5715_pci_init(void)
66 if (machine_is_gtwx5715())
67 pci_common_init(&gtwx5715_pci);
69 return 0;
72 subsys_initcall(gtwx5715_pci_init);