ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / mips / pci / fixup-eagle.c
1 /*
2  * arch/mips/vr41xx/nec-eagle/pci_fixup.c
3  *
4  * The NEC Eagle/Hawk Board specific PCI fixups.
5  *
6  * Author: Yoichi Yuasa <you@mvista.com, or source@mvista.com>
7  *
8  * 2001-2002,2004 (c) MontaVista, Software, Inc. This file is licensed under
9  * the terms of the GNU General Public License version 2. This program
10  * is licensed "as is" without any warranty of any kind, whether express
11  * or implied.
12  */
13 #include <linux/init.h>
14 #include <linux/pci.h>
15
16 #include <asm/vr41xx/eagle.h>
17 #include <asm/vr41xx/vrc4173.h>
18
19 /*
20  * Shortcuts
21  */
22 #define INTA    CP_INTA_IRQ
23 #define INTB    CP_INTB_IRQ
24 #define INTC    CP_INTC_IRQ
25 #define INTD    CP_INTD_IRQ
26 #define PCMCIA1 VRC4173_PCMCIA1_IRQ
27 #define PCMCIA2 VRC4173_PCMCIA2_IRQ
28 #define LAN     LANINTA_IRQ
29 #define SLOT    PCISLOT_IRQ
30
31 static char irq_tab_eagle[][5] __initdata = {
32  [ 8] = { 0,    INTA, INTB, INTC, INTD },
33  [ 9] = { 0,    INTD, INTA, INTB, INTC },
34  [10] = { 0,    INTC, INTD, INTA, INTB },
35  [12] = { 0, PCMCIA1,    0,    0,    0 },
36  [13] = { 0, PCMCIA2,    0,    0,    0 },
37  [28] = { 0,     LAN,    0,    0,    0 },
38  [29] = { 0,    SLOT, INTB, INTC, INTD },
39 };
40
41 /*
42  * This is a multifunction device.
43  */
44 static char irq_func_tab[] __initdata = {
45         VRC4173_CASCADE_IRQ,
46         VRC4173_AC97_IRQ,
47         VRC4173_USB_IRQ
48 };
49
50 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
51 {
52         if (slot == 30)
53                 return irq_func_tab[PCI_FUNC(dev->devfn)];
54
55         return irq_tab_eagle[slot][pin];
56 }
57
58 struct pci_fixup pcibios_fixups[] __initdata = {
59         {       .pass = 0,      },
60 };