[adm5120] remove unused empty files
[openwrt.git] / target / linux / aruba-2.6 / files / arch / mips / pci / fixup-aruba.c
1 /**************************************************************************
2  *
3  *  BRIEF MODULE DESCRIPTION
4  *     PCI fixups for IDT EB434 board
5  *
6  *  Copyright 2004 IDT Inc. (rischelp@idt.com)
7  *         
8  *  This program is free software; you can redistribute  it and/or modify it
9  *  under  the terms of  the GNU General  Public License as published by the
10  *  Free Software Foundation;  either version 2 of the  License, or (at your
11  *  option) any later version.
12  *
13  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
14  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
15  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
16  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
17  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
19  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
21  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  *  You should have received a copy of the  GNU General Public License along
25  *  with this program; if not, write  to the Free Software Foundation, Inc.,
26  *  675 Mass Ave, Cambridge, MA 02139, USA.
27  *
28  *
29  **************************************************************************
30  * May 2004 rkt, neb
31  *
32  * Initial Release
33  *
34  * 
35  *
36  **************************************************************************
37  */
38
39 #include <linux/autoconf.h>
40 #include <linux/types.h>
41 #include <linux/pci.h>
42 #include <linux/kernel.h>
43 #include <linux/init.h>
44 #include <asm/idt-boards/rc32434/rc32434.h>
45 #include <asm/idt-boards/rc32434/rc32434_pci.h> 
46
47 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
48 {
49         
50         if (dev->bus->number != 0) {
51                 return 0;
52         }
53         
54         slot = PCI_SLOT(dev->devfn);
55         dev->irq = 0;
56         
57         if (slot > 0 && slot <= 15) {
58 #if 1
59                 if(slot == 10) {
60                         if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 9; // intA
61                 } else if(slot == 11) {
62                         if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 10; // intA
63                         if(pin == 2) dev->irq = GROUP4_IRQ_BASE + 10; // intA
64                         if(pin == 3) dev->irq = GROUP4_IRQ_BASE + 10; // intA
65                 } else if(slot == 12) {
66                         if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 11; // intA
67                         if(pin == 2) dev->irq = GROUP4_IRQ_BASE + 12; // intB
68                 } else if (slot == 13) {
69                         if(pin == 1) dev->irq = GROUP4_IRQ_BASE + 12; // intA
70                         if(pin == 2) dev->irq = GROUP4_IRQ_BASE + 11; // intB
71                 } else {
72                         dev->irq = GROUP4_IRQ_BASE + 11;
73                 }
74 #else
75                                 switch (pin) {
76                                 case 1: /* INTA*/
77                                         dev->irq = GROUP4_IRQ_BASE + 11;
78                                         break;
79                                 case 2: /* INTB */
80                                         dev->irq = GROUP4_IRQ_BASE + 11;
81                                         break;
82                                 case 3: /* INTC */
83                                         dev->irq = GROUP4_IRQ_BASE + 11;
84                                         break;
85                                 case 4: /* INTD */
86                                         dev->irq = GROUP4_IRQ_BASE + 11;
87                                         break;
88                                 default:
89                                         dev->irq = 0xff;
90                                         break;
91                                 }
92 #endif
93 #ifdef DEBUG
94                 printk("irq fixup: slot %d, pin %d, irq %d\n",
95                        slot, pin, dev->irq);
96 #endif
97                 pci_write_config_byte(dev, PCI_INTERRUPT_LINE,dev->irq);
98         }
99         return (dev->irq);
100 }
101
102 struct pci_fixup pcibios_fixups[] = {
103         {0}
104 };
105
106
107
108
109
110
111
112
113
114
115