]>
Commit | Line | Data |
---|---|---|
1a59d1b8 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
1da177e4 LT |
2 | /* |
3 | * arch/arm/mach-ixp4xx/gtwx5715-pci.c | |
4 | * | |
5 | * Gemtek GTWX5715 (Linksys WRV54G) board setup | |
6 | * | |
7 | * Copyright (C) 2004 George T. Joseph | |
8 | * Derived from Coyote | |
1da177e4 LT |
9 | */ |
10 | ||
11 | #include <linux/pci.h> | |
12 | #include <linux/init.h> | |
13 | #include <linux/delay.h> | |
ddaca4a2 | 14 | #include <linux/irq.h> |
1da177e4 | 15 | #include <asm/mach-types.h> |
a09e64fb | 16 | #include <mach/hardware.h> |
1da177e4 LT |
17 | #include <asm/mach/pci.h> |
18 | ||
dc8ef8cd LW |
19 | #include "irqs.h" |
20 | ||
8d3fdf31 | 21 | #define SLOT0_DEVID 0 |
8d3fdf31 | 22 | #define SLOT1_DEVID 1 |
0fd7dc7f KH |
23 | #define INTA 10 /* slot 1 has INTA and INTB crossed */ |
24 | #define INTB 11 | |
a8b7b340 | 25 | |
bdf82b59 | 26 | /* |
bdf82b59 DS |
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. | |
31 | */ | |
1da177e4 LT |
32 | void __init gtwx5715_pci_preinit(void) |
33 | { | |
6845664a TG |
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); | |
1da177e4 LT |
36 | ixp4xx_pci_preinit(); |
37 | } | |
38 | ||
39 | ||
d5341942 | 40 | static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
1da177e4 | 41 | { |
0fd7dc7f | 42 | int rc = -1; |
1da177e4 | 43 | |
0fd7dc7f KH |
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); | |
1da177e4 | 50 | |
8d3fdf31 KH |
51 | printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", |
52 | __func__, slot, pin, rc); | |
53 | return rc; | |
1da177e4 LT |
54 | } |
55 | ||
56 | struct hw_pci gtwx5715_pci __initdata = { | |
57 | .nr_controllers = 1, | |
c23bfc38 | 58 | .ops = &ixp4xx_ops, |
1da177e4 | 59 | .preinit = gtwx5715_pci_preinit, |
1da177e4 | 60 | .setup = ixp4xx_setup, |
1da177e4 LT |
61 | .map_irq = gtwx5715_map_irq, |
62 | }; | |
63 | ||
64 | int __init gtwx5715_pci_init(void) | |
65 | { | |
66 | if (machine_is_gtwx5715()) | |
1da177e4 | 67 | pci_common_init(>wx5715_pci); |
1da177e4 LT |
68 | |
69 | return 0; | |
70 | } | |
71 | ||
72 | subsys_initcall(gtwx5715_pci_init); |