diff options
Diffstat (limited to 'arch/mips/pci/fixup-rbtx4938.c')
-rw-r--r-- | arch/mips/pci/fixup-rbtx4938.c | 52 |
1 files changed, 11 insertions, 41 deletions
diff --git a/arch/mips/pci/fixup-rbtx4938.c b/arch/mips/pci/fixup-rbtx4938.c index 64d4510c0265..39c995830384 100644 --- a/arch/mips/pci/fixup-rbtx4938.c +++ b/arch/mips/pci/fixup-rbtx4938.c | |||
@@ -10,45 +10,28 @@ | |||
10 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | 10 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) |
11 | */ | 11 | */ |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/pci.h> | 13 | #include <asm/txx9/pci.h> |
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/txx9/rbtx4938.h> | 14 | #include <asm/txx9/rbtx4938.h> |
18 | 15 | ||
19 | extern struct pci_controller tx4938_pci_controller[]; | 16 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
20 | |||
21 | static int pci_get_irq(const struct pci_dev *dev, int pin) | ||
22 | { | 17 | { |
23 | int irq = pin; | 18 | int irq = tx4938_pcic1_map_irq(dev, slot); |
24 | u8 slot = PCI_SLOT(dev->devfn); | ||
25 | struct pci_controller *controller = (struct pci_controller *)dev->sysdata; | ||
26 | |||
27 | if (controller == &tx4938_pci_controller[1]) { | ||
28 | /* TX4938 PCIC1 */ | ||
29 | switch (slot) { | ||
30 | case TX4938_PCIC_IDSEL_AD_TO_SLOT(31): | ||
31 | if (tx4938_ccfgptr->pcfg & TX4938_PCFG_ETH0_SEL) | ||
32 | return RBTX4938_IRQ_IRC + TX4938_IR_ETH0; | ||
33 | break; | ||
34 | case TX4938_PCIC_IDSEL_AD_TO_SLOT(30): | ||
35 | if (tx4938_ccfgptr->pcfg & TX4938_PCFG_ETH1_SEL) | ||
36 | return RBTX4938_IRQ_IRC + TX4938_IR_ETH1; | ||
37 | break; | ||
38 | } | ||
39 | return 0; | ||
40 | } | ||
41 | 19 | ||
20 | if (irq >= 0) | ||
21 | return irq; | ||
22 | irq = pin; | ||
42 | /* IRQ rotation */ | 23 | /* IRQ rotation */ |
43 | irq--; /* 0-3 */ | 24 | irq--; /* 0-3 */ |
44 | if (dev->bus->parent == NULL && | 25 | if (slot == TX4927_PCIC_IDSEL_AD_TO_SLOT(23)) { |
45 | (slot == TX4938_PCIC_IDSEL_AD_TO_SLOT(23))) { | ||
46 | /* PCI CardSlot (IDSEL=A23) */ | 26 | /* PCI CardSlot (IDSEL=A23) */ |
47 | /* PCIA => PCIA (IDSEL=A23) */ | 27 | /* PCIA => PCIA (IDSEL=A23) */ |
48 | irq = (irq + 0 + slot) % 4; | 28 | irq = (irq + 0 + slot) % 4; |
49 | } else { | 29 | } else { |
50 | /* PCI Backplane */ | 30 | /* PCI Backplane */ |
51 | irq = (irq + 33 - slot) % 4; | 31 | if (txx9_pci_option & TXX9_PCI_OPT_PICMG) |
32 | irq = (irq + 33 - slot) % 4; | ||
33 | else | ||
34 | irq = (irq + 3 + slot) % 4; | ||
52 | } | 35 | } |
53 | irq++; /* 1-4 */ | 36 | irq++; /* 1-4 */ |
54 | 37 | ||
@@ -69,19 +52,6 @@ static int pci_get_irq(const struct pci_dev *dev, int pin) | |||
69 | return irq; | 52 | return irq; |
70 | } | 53 | } |
71 | 54 | ||
72 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | ||
73 | { | ||
74 | unsigned char irq = 0; | ||
75 | |||
76 | irq = pci_get_irq(dev, pin); | ||
77 | |||
78 | printk(KERN_INFO "PCI: 0x%02x:0x%02x(0x%02x,0x%02x) IRQ=%d\n", | ||
79 | dev->bus->number, dev->devfn, PCI_SLOT(dev->devfn), | ||
80 | PCI_FUNC(dev->devfn), irq); | ||
81 | |||
82 | return irq; | ||
83 | } | ||
84 | |||
85 | /* | 55 | /* |
86 | * Do platform specific device initialization at pci_enable_device() time | 56 | * Do platform specific device initialization at pci_enable_device() time |
87 | */ | 57 | */ |