x86: fix bogus KERN_ALERT on oops
[wrt350n-kernel.git] / arch / mips / pci / fixup-sni.c
bloba45bedd17233ce36b5959c3e533ddd24f41b4dc5
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * SNI specific PCI support for RM200/RM300.
8 * Copyright (C) 1997 - 2000, 2003, 04 Ralf Baechle (ralf@linux-mips.org)
9 */
10 #include <linux/kernel.h>
11 #include <linux/init.h>
12 #include <linux/pci.h>
14 #include <asm/mipsregs.h>
15 #include <asm/sni.h>
17 #include <irq.h>
20 * PCIMT Shortcuts ...
22 #define SCSI PCIMT_IRQ_SCSI
23 #define ETH PCIMT_IRQ_ETHERNET
24 #define INTA PCIMT_IRQ_INTA
25 #define INTB PCIMT_IRQ_INTB
26 #define INTC PCIMT_IRQ_INTC
27 #define INTD PCIMT_IRQ_INTD
30 * Device 0: PCI EISA Bridge (directly routed)
31 * Device 1: NCR53c810 SCSI (directly routed)
32 * Device 2: PCnet32 Ethernet (directly routed)
33 * Device 3: VGA (routed to INTB)
34 * Device 4: Unused
35 * Device 5: Slot 2
36 * Device 6: Slot 3
37 * Device 7: Slot 4
39 * Documentation says the VGA is device 5 and device 3 is unused but that
40 * seem to be a documentation error. At least on my RM200C the Cirrus
41 * Logic CL-GD5434 VGA is device 3.
43 static char irq_tab_rm200[8][5] __initdata = {
44 /* INTA INTB INTC INTD */
45 { 0, 0, 0, 0, 0 }, /* EISA bridge */
46 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
47 { ETH, ETH, ETH, ETH, ETH }, /* Ethernet */
48 { INTB, INTB, INTB, INTB, INTB }, /* VGA */
49 { 0, 0, 0, 0, 0 }, /* Unused */
50 { 0, INTB, INTC, INTD, INTA }, /* Slot 2 */
51 { 0, INTC, INTD, INTA, INTB }, /* Slot 3 */
52 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
56 * In Revision D of the RM300 Device 2 has become a normal purpose Slot 1
58 * The VGA card is optional for RM300 systems.
60 static char irq_tab_rm300d[8][5] __initdata = {
61 /* INTA INTB INTC INTD */
62 { 0, 0, 0, 0, 0 }, /* EISA bridge */
63 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
64 { 0, INTC, INTD, INTA, INTB }, /* Slot 1 */
65 { INTB, INTB, INTB, INTB, INTB }, /* VGA */
66 { 0, 0, 0, 0, 0 }, /* Unused */
67 { 0, INTB, INTC, INTD, INTA }, /* Slot 2 */
68 { 0, INTC, INTD, INTA, INTB }, /* Slot 3 */
69 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
72 static char irq_tab_rm300e[5][5] __initdata = {
73 /* INTA INTB INTC INTD */
74 { 0, 0, 0, 0, 0 }, /* HOST bridge */
75 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
76 { 0, INTC, INTD, INTA, INTB }, /* Bridge/i960 */
77 { 0, INTD, INTA, INTB, INTC }, /* Slot 1 */
78 { 0, INTA, INTB, INTC, INTD }, /* Slot 2 */
80 #undef SCSI
81 #undef ETH
82 #undef INTA
83 #undef INTB
84 #undef INTC
85 #undef INTD
89 * PCIT Shortcuts ...
91 #define SCSI0 PCIT_IRQ_SCSI0
92 #define SCSI1 PCIT_IRQ_SCSI1
93 #define ETH PCIT_IRQ_ETHERNET
94 #define INTA PCIT_IRQ_INTA
95 #define INTB PCIT_IRQ_INTB
96 #define INTC PCIT_IRQ_INTC
97 #define INTD PCIT_IRQ_INTD
99 static char irq_tab_pcit[13][5] __initdata = {
100 /* INTA INTB INTC INTD */
101 { 0, 0, 0, 0, 0 }, /* HOST bridge */
102 { SCSI0, SCSI0, SCSI0, SCSI0, SCSI0 }, /* SCSI */
103 { SCSI1, SCSI1, SCSI1, SCSI1, SCSI1 }, /* SCSI */
104 { ETH, ETH, ETH, ETH, ETH }, /* Ethernet */
105 { 0, INTA, INTB, INTC, INTD }, /* PCI-PCI bridge */
106 { 0, 0, 0, 0, 0 }, /* Unused */
107 { 0, 0, 0, 0, 0 }, /* Unused */
108 { 0, 0, 0, 0, 0 }, /* Unused */
109 { 0, INTA, INTB, INTC, INTD }, /* Slot 1 */
110 { 0, INTB, INTC, INTD, INTA }, /* Slot 2 */
111 { 0, INTC, INTD, INTA, INTB }, /* Slot 3 */
112 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
113 { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */
116 static inline int is_rm300_revd(void)
118 unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
120 return (csmsr & 0xa0) == 0x20;
123 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
125 switch (sni_brd_type) {
126 case SNI_BRD_PCI_TOWER:
127 case SNI_BRD_PCI_TOWER_CPLUS:
128 return irq_tab_pcit[slot][pin];
130 case SNI_BRD_PCI_MTOWER:
131 if (is_rm300_revd())
132 return irq_tab_rm300d[slot][pin];
133 /* fall through */
135 case SNI_BRD_PCI_DESKTOP:
136 return irq_tab_rm200[slot][pin];
138 case SNI_BRD_PCI_MTOWER_CPLUS:
139 return irq_tab_rm300e[slot][pin];
142 return 0;
145 /* Do platform specific device initialization at pci_enable_device() time */
146 int pcibios_plat_dev_init(struct pci_dev *dev)
148 return 0;