ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / mips / pci / fixup-atlas.c
1 #include <linux/init.h>
2 #include <linux/pci.h>
3 #include <asm/mips-boards/atlasint.h>
4
5 #define INTD            ATLASINT_INTD
6 #define INTC            ATLASINT_INTC
7 #define INTB            ATLASINT_INTB
8 #define INTA            ATLASINT_INTA
9 #define SCSI            ATLASINT_SCSI
10 #define ETH             ATLASINT_ETH
11
12 static char irq_tab[][5] __initdata = {
13         /*      INTA    INTB    INTC    INTD */
14         {0,     0,      0,      0,      0 },    /*  0: Unused */
15         {0,     0,      0,      0,      0 },    /*  1: Unused */
16         {0,     0,      0,      0,      0 },    /*  2: Unused */
17         {0,     0,      0,      0,      0 },    /*  3: Unused */
18         {0,     0,      0,      0,      0 },    /*  4: Unused */
19         {0,     0,      0,      0,      0 },    /*  5: Unused */
20         {0,     0,      0,      0,      0 },    /*  6: Unused */
21         {0,     0,      0,      0,      0 },    /*  7: Unused */
22         {0,     0,      0,      0,      0 },    /*  8: Unused */
23         {0,     0,      0,      0,      0 },    /*  9: Unused */
24         {0,     0,      0,      0,      0 },    /* 10: Unused */
25         {0,     0,      0,      0,      0 },    /* 11: Unused */
26         {0,     0,      0,      0,      0 },    /* 12: Unused */
27         {0,     0,      0,      0,      0 },    /* 13: Unused */
28         {0,     0,      0,      0,      0 },    /* 14: Unused */
29         {0,     0,      0,      0,      0 },    /* 15: Unused */
30         {0,     SCSI,   0,      0,      0 },    /* 16: SYM53C810A SCSI */
31         {0,     0,      0,      0,      0 },    /* 17: Core */
32         {0,     INTA,   INTB,   INTC,   INTD }, /* 18: PCI Slot 1 */
33         {0,     ETH,    0,      0,      0 },    /* 19: SAA9730 Ethernet */
34         {0,     0,      0,      0,      0 },    /* 20: PCI Slot 3 */
35         {0,     0,      0,      0,      0 }     /* 21: PCI Slot 4 */
36 };
37
38 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
39 {
40         return irq_tab[slot][pin];
41 }
42
43 void __init pcibios_fixup_irqs(void)
44 {
45 }
46
47 #if CONFIG_KGDB
48 /*
49  * The PCI scan may have moved the saa9730 I/O address, so reread
50  * the address here.
51  * This does mean that it's not possible to debug the PCI bus configuration
52  * code, but it is better than nothing...
53  */
54
55 static void atlas_saa9730_base_fixup (struct pci_dev *pdev)
56 {
57         extern void *saa9730_base;
58         if (pdev->bus == 0 && PCI_SLOT(pdev->devfn) == 19)
59                 (void) pci_read_config_dword (pdev, 0x14, (u32 *)&saa9730_base);
60         printk ("saa9730_base = %x\n", saa9730_base);
61 }
62
63 #endif
64
65
66 struct pci_fixup pcibios_fixups[] __initdata = {
67 #ifdef CONFIG_KGDB
68         {PCI_FIXUP_HEADER, PCI_VENDOR_ID_PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA9730,
69          atlas_saa9730_base_fixup},
70 #endif
71         { 0 }
72 };