aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci/fixup-rbtx4938.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 18:01:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 18:01:29 -0400
commit7e2225d860772aaa07e1cebca6a5aa6f93f9aa91 (patch)
tree8a4c3076c2043d011fcf2357835f4f16be7606a7 /arch/mips/pci/fixup-rbtx4938.c
parent3a628b0fd42f7eaf9d052447784d48ceae9ffb8e (diff)
parentb27418aa551a153e8bf1bd16cf93e5786f9590a9 (diff)
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (54 commits) [MIPS] Remove mips_machtype for LASAT machines [MIPS] Remove mips_machtype from EMMA2RH machines [MIPS] Remove mips_machtype from ARC based machines [MIPS] MTX-1 flash partition setup move to platform devices registration [MIPS] TXx9: cleanup and fix some sparse warnings [MIPS] TXx9: rename asm-mips/mach-jmr3927 to asm-mips/mach-tx39xx [MIPS] remove machtype for group Toshiba [MIPS] separate rbtx4927_time_init() and rbtx4937_time_init() [MIPS] separate rbtx4927_arch_init() and rbtx4937_arch_init() [MIPS] txx9_cpu_clock setup move to rbtx4927_time_init() [MIPS] txx9_board_vec set directly without mips_machtype [MIPS] IP22: Add platform device for Indy volume buttons [MIPS] cmbvr4133: Remove support [MIPS] remove wrppmc_machine_power_off() [MIPS] replace inline assembler to cpu_wait() [MIPS] IP22/28: Add platform devices for HAL2 [MIPS] TXx9: Update and merge defconfigs [MIPS] TXx9: Make single kernel can support multiple boards [MIPS] TXx9: Update defconfigs [MIPS] TXx9: Reorganize PCI code ...
Diffstat (limited to 'arch/mips/pci/fixup-rbtx4938.c')
-rw-r--r--arch/mips/pci/fixup-rbtx4938.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/mips/pci/fixup-rbtx4938.c b/arch/mips/pci/fixup-rbtx4938.c
new file mode 100644
index 000000000000..a80579af609b
--- /dev/null
+++ b/arch/mips/pci/fixup-rbtx4938.c
@@ -0,0 +1,53 @@
1/*
2 * Toshiba rbtx4938 pci routines
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
12#include <linux/types.h>
13#include <asm/txx9/pci.h>
14#include <asm/txx9/rbtx4938.h>
15
16int __init rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
17{
18 int irq = tx4938_pcic1_map_irq(dev, slot);
19
20 if (irq >= 0)
21 return irq;
22 irq = pin;
23 /* IRQ rotation */
24 irq--; /* 0-3 */
25 if (slot == TX4927_PCIC_IDSEL_AD_TO_SLOT(23)) {
26 /* PCI CardSlot (IDSEL=A23) */
27 /* PCIA => PCIA (IDSEL=A23) */
28 irq = (irq + 0 + slot) % 4;
29 } else {
30 /* PCI Backplane */
31 if (txx9_pci_option & TXX9_PCI_OPT_PICMG)
32 irq = (irq + 33 - slot) % 4;
33 else
34 irq = (irq + 3 + slot) % 4;
35 }
36 irq++; /* 1-4 */
37
38 switch (irq) {
39 case 1:
40 irq = RBTX4938_IRQ_IOC_PCIA;
41 break;
42 case 2:
43 irq = RBTX4938_IRQ_IOC_PCIB;
44 break;
45 case 3:
46 irq = RBTX4938_IRQ_IOC_PCIC;
47 break;
48 case 4:
49 irq = RBTX4938_IRQ_IOC_PCID;
50 break;
51 }
52 return irq;
53}