initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / mips / pci / fixup-sni.c
blob563fb2c8922c49c11e5c66fbd05d742c657abb16
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 Ralf Baechle
9 */
10 #include <linux/kernel.h>
11 #include <linux/init.h>
12 #include <linux/pci.h>
14 #include <asm/mipsregs.h>
15 #include <asm/pci_channel.h>
16 #include <asm/sni.h>
19 * Shortcuts ...
21 #define SCSI PCIMT_IRQ_SCSI
22 #define ETH PCIMT_IRQ_ETHERNET
23 #define INTA PCIMT_IRQ_INTA
24 #define INTB PCIMT_IRQ_INTB
25 #define INTC PCIMT_IRQ_INTC
26 #define INTD PCIMT_IRQ_INTD
29 * Device 0: PCI EISA Bridge (directly routed)
30 * Device 1: NCR53c810 SCSI (directly routed)
31 * Device 2: PCnet32 Ethernet (directly routed)
32 * Device 3: VGA (routed to INTB)
33 * Device 4: Unused
34 * Device 5: Slot 2
35 * Device 6: Slot 3
36 * Device 7: Slot 4
38 * Documentation says the VGA is device 5 and device 3 is unused but that
39 * seem to be a documentation error. At least on my RM200C the Cirrus
40 * Logic CL-GD5434 VGA is device 3.
42 static char irq_tab_rm200[8][5] __initdata = {
43 /* INTA INTB INTC INTD */
44 { 0, 0, 0, 0, 0 }, /* EISA bridge */
45 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
46 { ETH, ETH, ETH, ETH, ETH }, /* Ethernet */
47 { INTB, INTB, INTB, INTB, INTB }, /* VGA */
48 { 0, 0, 0, 0, 0 }, /* Unused */
49 { 0, INTB, INTC, INTD, INTA }, /* Slot 2 */
50 { 0, INTC, INTD, INTA, INTB }, /* Slot 3 */
51 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
55 * In Revision D of the RM300 Device 2 has become a normal purpose Slot 1
57 * The VGA card is optional for RM300 systems.
59 static char irq_tab_rm300d[8][5] __initdata = {
60 /* INTA INTB INTC INTD */
61 { 0, 0, 0, 0, 0 }, /* EISA bridge */
62 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
63 { 0, INTC, INTD, INTA, INTB }, /* Slot 1 */
64 { INTB, INTB, INTB, INTB, INTB }, /* VGA */
65 { 0, 0, 0, 0, 0 }, /* Unused */
66 { 0, INTB, INTC, INTD, INTA }, /* Slot 2 */
67 { 0, INTC, INTD, INTA, INTB }, /* Slot 3 */
68 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
71 static inline int is_rm300_revd(void)
73 unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
75 return (csmsr & 0xa0) == 0x20;
78 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
80 if (is_rm300_revd())
81 return irq_tab_rm300d[slot][pin];
83 return irq_tab_rm200[slot][pin];