aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>2007-11-08 16:09:11 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-11-15 18:21:50 -0500
commitfcee3faf8339bb65660c9a22123f71aa0cc30514 (patch)
treecd0f28ed904d6b52f613e6ef117838e8820215dc
parentf6771dbb27c704ce837ba3bb1dcaa53f48f76ea8 (diff)
[MIPS] SNI PCIT CPLUS: workaround for b0rked irq wiring of onboard PCI bus 1
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/pci/fixup-sni.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c
index a45bedd17233..5c8a79bb2661 100644
--- a/arch/mips/pci/fixup-sni.c
+++ b/arch/mips/pci/fixup-sni.c
@@ -113,6 +113,16 @@ static char irq_tab_pcit[13][5] __initdata = {
113 { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */ 113 { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */
114}; 114};
115 115
116static char irq_tab_pcit_cplus[13][5] __initdata = {
117 /* INTA INTB INTC INTD */
118 { 0, 0, 0, 0, 0 }, /* HOST bridge */
119 { 0, INTB, INTC, INTD, INTA }, /* PCI Slot 9 */
120 { 0, 0, 0, 0, 0 }, /* PCI-EISA */
121 { 0, 0, 0, 0, 0 }, /* Unused */
122 { 0, INTA, INTB, INTC, INTD }, /* PCI-PCI bridge */
123 { 0, INTB, INTC, INTD, INTA }, /* fixup */
124};
125
116static inline int is_rm300_revd(void) 126static inline int is_rm300_revd(void)
117{ 127{
118 unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR; 128 unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
@@ -123,8 +133,19 @@ static inline int is_rm300_revd(void)
123int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 133int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
124{ 134{
125 switch (sni_brd_type) { 135 switch (sni_brd_type) {
126 case SNI_BRD_PCI_TOWER:
127 case SNI_BRD_PCI_TOWER_CPLUS: 136 case SNI_BRD_PCI_TOWER_CPLUS:
137 if (slot == 4) {
138 /*
139 * SNI messed up interrupt wiring for onboard
140 * PCI bus 1; we need to fix this up here
141 */
142 while (dev && dev->bus->number != 1)
143 dev = dev->bus->self;
144 if (dev && dev->devfn >= PCI_DEVFN(4, 0))
145 slot = 5;
146 }
147 return irq_tab_pcit_cplus[slot][pin];
148 case SNI_BRD_PCI_TOWER:
128 return irq_tab_pcit[slot][pin]; 149 return irq_tab_pcit[slot][pin];
129 150
130 case SNI_BRD_PCI_MTOWER: 151 case SNI_BRD_PCI_MTOWER: