Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * linux/arch/arm/mach-footbridge/ebsa285-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 static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
0018 
0019 static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
0020 {
0021     if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
0022         dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
0023         switch (PCI_FUNC(dev->devfn)) {
0024         case 1: return 14;
0025         case 2: return 15;
0026         case 3: return 12;
0027         }
0028 
0029     return irqmap_ebsa285[(slot + pin) & 3];
0030 }
0031 
0032 static struct hw_pci ebsa285_pci __initdata = {
0033     .map_irq        = ebsa285_map_irq,
0034     .nr_controllers     = 1,
0035     .ops            = &dc21285_ops,
0036     .setup          = dc21285_setup,
0037     .preinit        = dc21285_preinit,
0038     .postinit       = dc21285_postinit,
0039 };
0040 
0041 static int __init ebsa285_init_pci(void)
0042 {
0043     if (machine_is_ebsa285())
0044         pci_common_init(&ebsa285_pci);
0045     return 0;
0046 }
0047 
0048 subsys_initcall(ebsa285_init_pci);