aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci/fixup-sni.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/pci/fixup-sni.c')
-rw-r--r--arch/mips/pci/fixup-sni.c66
1 files changed, 62 insertions, 4 deletions
diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c
index a176f2ca8656..0c9a4732d455 100644
--- a/arch/mips/pci/fixup-sni.c
+++ b/arch/mips/pci/fixup-sni.c
@@ -15,7 +15,7 @@
15#include <asm/sni.h> 15#include <asm/sni.h>
16 16
17/* 17/*
18 * Shortcuts ... 18 * PCIMT Shortcuts ...
19 */ 19 */
20#define SCSI PCIMT_IRQ_SCSI 20#define SCSI PCIMT_IRQ_SCSI
21#define ETH PCIMT_IRQ_ETHERNET 21#define ETH PCIMT_IRQ_ETHERNET
@@ -67,6 +67,50 @@ static char irq_tab_rm300d[8][5] __initdata = {
67 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */ 67 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
68}; 68};
69 69
70static char irq_tab_rm300e[5][5] __initdata = {
71 /* INTA INTB INTC INTD */
72 { 0, 0, 0, 0, 0 }, /* HOST bridge */
73 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
74 { 0, INTC, INTD, INTA, INTB }, /* Bridge/i960 */
75 { 0, INTD, INTA, INTB, INTC }, /* Slot 1 */
76 { 0, INTA, INTB, INTC, INTD }, /* Slot 2 */
77};
78#undef SCSI
79#undef ETH
80#undef INTA
81#undef INTB
82#undef INTC
83#undef INTD
84
85
86/*
87 * PCIT Shortcuts ...
88 */
89#define SCSI0 PCIT_IRQ_SCSI0
90#define SCSI1 PCIT_IRQ_SCSI1
91#define ETH PCIT_IRQ_ETHERNET
92#define INTA PCIT_IRQ_INTA
93#define INTB PCIT_IRQ_INTB
94#define INTC PCIT_IRQ_INTC
95#define INTD PCIT_IRQ_INTD
96
97static char irq_tab_pcit[13][5] __initdata = {
98 /* INTA INTB INTC INTD */
99 { 0, 0, 0, 0, 0 }, /* HOST bridge */
100 { SCSI0, SCSI0, SCSI0, SCSI0, SCSI0 }, /* SCSI */
101 { SCSI1, SCSI1, SCSI1, SCSI1, SCSI1 }, /* SCSI */
102 { ETH, ETH, ETH, ETH, ETH }, /* Ethernet */
103 { 0, INTA, INTB, INTC, INTD }, /* PCI-PCI bridge */
104 { 0, 0, 0, 0, 0 }, /* Unused */
105 { 0, 0, 0, 0, 0 }, /* Unused */
106 { 0, 0, 0, 0, 0 }, /* Unused */
107 { 0, INTA, INTB, INTC, INTD }, /* Slot 1 */
108 { 0, INTB, INTC, INTD, INTA }, /* Slot 2 */
109 { 0, INTC, INTD, INTA, INTB }, /* Slot 3 */
110 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
111 { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */
112};
113
70static inline int is_rm300_revd(void) 114static inline int is_rm300_revd(void)
71{ 115{
72 unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR; 116 unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
@@ -76,10 +120,24 @@ static inline int is_rm300_revd(void)
76 120
77int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 121int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
78{ 122{
79 if (is_rm300_revd()) 123 switch (sni_brd_type) {
80 return irq_tab_rm300d[slot][pin]; 124 case SNI_BRD_PCI_TOWER:
125 case SNI_BRD_PCI_TOWER_CPLUS:
126 return irq_tab_pcit[slot][pin];
127
128 case SNI_BRD_PCI_MTOWER:
129 if (is_rm300_revd())
130 return irq_tab_rm300d[slot][pin];
131 /* fall through */
81 132
82 return irq_tab_rm200[slot][pin]; 133 case SNI_BRD_PCI_DESKTOP:
134 return irq_tab_rm200[slot][pin];
135
136 case SNI_BRD_PCI_MTOWER_CPLUS:
137 return irq_tab_rm300e[slot][pin];
138 }
139
140 return 0;
83} 141}
84 142
85/* Do platform specific device initialization at pci_enable_device() time */ 143/* Do platform specific device initialization at pci_enable_device() time */