more changes on original files
[linux-2.4.git] / arch / arm / mach-footbridge / netwinder-pci.c
1 /*
2  * linux/arch/arm/mach-footbridge/netwinder-pci.c
3  *
4  * PCI bios-type initialisation for PCI machines
5  *
6  * Bits taken from various places.
7  */
8 #include <linux/kernel.h>
9 #include <linux/pci.h>
10 #include <linux/init.h>
11
12 #include <asm/irq.h>
13 #include <asm/mach/pci.h>
14 #include <asm/hardware/dec21285.h>
15
16 /* netwinder host-specific stuff */
17 static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
18 {
19 #define DEV(v,d) ((v)<<16|(d))
20         switch (DEV(dev->vendor, dev->device)) {
21         case DEV(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142):
22         case DEV(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C885):
23         case DEV(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_YELLOWFIN):
24                 return IRQ_NETWINDER_ETHER100;
25
26         case DEV(PCI_VENDOR_ID_WINBOND2, 0x5a5a):
27                 return IRQ_NETWINDER_ETHER10;
28
29         case DEV(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553):
30                 return 0;
31
32         case DEV(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105):
33                 return IRQ_ISA_HARDDISK1;
34
35         case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000):
36         case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010):
37         case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5000):
38                 return IRQ_NETWINDER_VGA;
39
40         case DEV(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285):
41                 return 0;
42
43         default:
44                 printk(KERN_ERR "PCI: %02X:%02X [%04X:%04X] unknown device\n",
45                         dev->bus->number, dev->devfn,
46                         dev->vendor, dev->device);
47                 return 0;
48         }
49 }
50
51 struct hw_pci netwinder_pci __initdata = {
52         .setup_resources        = dc21285_setup_resources,
53         .init                   = dc21285_init,
54         .mem_offset             = DC21285_PCI_MEM,
55         .swizzle                = no_swizzle,
56         .map_irq                = netwinder_map_irq,
57 };