linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SNI PCIT CPLUS: workaround for messed up PCI irq wiring
@ 2007-11-08 21:09 Thomas Bogendoerfer
  2007-11-08 22:24 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bogendoerfer @ 2007-11-08 21:09 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf


SNI PCIT CPLUS: workaround for messed up irq wiring for onboard PCI bus 1 

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c
index a45bedd..5c8a79b 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 = {
 	{     0,  INTA,  INTB,  INTC,  INTD },	/* Slot 5 */
 };
 
+static char irq_tab_pcit_cplus[13][5] __initdata = {
+	/*       INTA  INTB  INTC  INTD */
+	{     0,     0,     0,     0,     0 },	/* HOST bridge */
+	{     0,  INTB,  INTC,  INTD,  INTA },	/* PCI Slot 9 */
+	{     0,     0,     0,     0,     0 },	/* PCI-EISA */
+	{     0,     0,     0,     0,     0 },	/* Unused */
+	{     0,  INTA,  INTB,  INTC,  INTD },	/* PCI-PCI bridge */
+	{     0,  INTB,  INTC,  INTD,  INTA },	/* fixup */
+};
+
 static inline int is_rm300_revd(void)
 {
 	unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
@@ -123,8 +133,19 @@ static inline int is_rm300_revd(void)
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	switch (sni_brd_type) {
-	case SNI_BRD_PCI_TOWER:
 	case SNI_BRD_PCI_TOWER_CPLUS:
+		if (slot == 4) {
+			/*
+			 * SNI messed up interrupt wiring for onboard
+			 * PCI bus 1; we need to fix this up here
+			 */
+			while (dev && dev->bus->number != 1)
+				dev = dev->bus->self;
+			if (dev && dev->devfn >= PCI_DEVFN(4, 0))
+				slot = 5;
+		}
+		return irq_tab_pcit_cplus[slot][pin];
+	case SNI_BRD_PCI_TOWER:
 	        return irq_tab_pcit[slot][pin];
 
 	case SNI_BRD_PCI_MTOWER:
-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] SNI PCIT CPLUS: workaround for messed up PCI irq wiring
  2007-11-08 21:09 [PATCH] SNI PCIT CPLUS: workaround for messed up PCI irq wiring Thomas Bogendoerfer
@ 2007-11-08 22:24 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2007-11-08 22:24 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips

On Thu, Nov 08, 2007 at 10:09:11PM +0100, Thomas Bogendoerfer wrote:

> SNI PCIT CPLUS: workaround for messed up irq wiring for onboard PCI bus 1 

Oh pleassure.

Thanks & applied,

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-08 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08 21:09 [PATCH] SNI PCIT CPLUS: workaround for messed up PCI irq wiring Thomas Bogendoerfer
2007-11-08 22:24 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).