Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <linux/init.h>
0003 #include <linux/kernel.h>
0004 #include <linux/pci.h>
0005 #include <asm/ip32/ip32_ints.h>
0006 /*
0007  * O2 has up to 5 PCI devices connected into the MACE bridge.  The device
0008  * map looks like this:
0009  *
0010  * 0  aic7xxx 0
0011  * 1  aic7xxx 1
0012  * 2  expansion slot
0013  * 3  N/C
0014  * 4  N/C
0015  */
0016 
0017 #define SCSI0  MACEPCI_SCSI0_IRQ
0018 #define SCSI1  MACEPCI_SCSI1_IRQ
0019 #define INTA0  MACEPCI_SLOT0_IRQ
0020 #define INTA1  MACEPCI_SLOT1_IRQ
0021 #define INTA2  MACEPCI_SLOT2_IRQ
0022 #define INTB   MACEPCI_SHARED0_IRQ
0023 #define INTC   MACEPCI_SHARED1_IRQ
0024 #define INTD   MACEPCI_SHARED2_IRQ
0025 static char irq_tab_mace[][5] = {
0026       /* Dummy  INT#A  INT#B  INT#C  INT#D */
0027     {0,     0,     0,     0,     0}, /* This is placeholder row - never used */
0028     {0, SCSI0, SCSI0, SCSI0, SCSI0},
0029     {0, SCSI1, SCSI1, SCSI1, SCSI1},
0030     {0, INTA0,  INTB,  INTC,  INTD},
0031     {0, INTA1,  INTC,  INTD,  INTB},
0032     {0, INTA2,  INTD,  INTB,  INTC},
0033 };
0034 
0035 
0036 /*
0037  * Given a PCI slot number (a la PCI_SLOT(...)) and the interrupt pin of
0038  * the device (1-4 => A-D), tell what irq to use.  Note that we don't
0039  * in theory have slots 4 and 5, and we never normally use the shared
0040  * irqs.  I suppose a device without a pin A will thank us for doing it
0041  * right if there exists such a broken piece of crap.
0042  */
0043 int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
0044 {
0045     return irq_tab_mace[slot][pin];
0046 }
0047 
0048 /* Do platform specific device initialization at pci_enable_device() time */
0049 int pcibios_plat_dev_init(struct pci_dev *dev)
0050 {
0051     return 0;
0052 }