Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * linux/arch/arm/mach-footbridge/netwinder-pci.c
0004  *
0005  * PCI bios-type initialisation for PCI machines
0006  *
0007  * Bits taken from various places.
0008  */
0009 #include <linux/kernel.h>
0010 #include <linux/pci.h>
0011 #include <linux/init.h>
0012 
0013 #include <asm/irq.h>
0014 #include <asm/mach/pci.h>
0015 #include <asm/mach-types.h>
0016 
0017 /*
0018  * We now use the slot ID instead of the device identifiers to select
0019  * which interrupt is routed where.
0020  */
0021 static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
0022 {
0023     switch (slot) {
0024     case 0:  /* host bridge */
0025         return 0;
0026 
0027     case 9:  /* CyberPro */
0028         return IRQ_NETWINDER_VGA;
0029 
0030     case 10: /* DC21143 */
0031         return IRQ_NETWINDER_ETHER100;
0032 
0033     case 12: /* Winbond 553 */
0034         return IRQ_ISA_HARDDISK1;
0035 
0036     case 13: /* Winbond 89C940F */
0037         return IRQ_NETWINDER_ETHER10;
0038 
0039     default:
0040         printk(KERN_ERR "PCI: unknown device in slot %s\n",
0041             pci_name(dev));
0042         return 0;
0043     }
0044 }
0045 
0046 static struct hw_pci netwinder_pci __initdata = {
0047     .map_irq        = netwinder_map_irq,
0048     .nr_controllers     = 1,
0049     .ops            = &dc21285_ops,
0050     .setup          = dc21285_setup,
0051     .preinit        = dc21285_preinit,
0052     .postinit       = dc21285_postinit,
0053 };
0054 
0055 static int __init netwinder_pci_init(void)
0056 {
0057     if (machine_is_netwinder())
0058         pci_common_init(&netwinder_pci);
0059     return 0;
0060 }
0061 
0062 subsys_initcall(netwinder_pci_init);