26 #include <linux/pci.h>
30 #include <linux/export.h>
31 #include <linux/kernel.h>
33 #include <asm/hw_irq.h>
39 #define PEIH_TERMADH 0x00
40 #define PEIH_TERMADL 0x08
41 #define PEIH_MSIED 0x10
42 #define PEIH_MSIMK 0x18
43 #define PEIH_MSIASS 0x20
44 #define PEIH_FLUSH0 0x30
45 #define PEIH_FLUSH1 0x38
46 #define PEIH_CNTRST 0x48
80 static int ppc4xx_setup_msi_irqs(
struct pci_dev *dev,
int nvec,
int type)
98 pr_debug(
"%s: fail allocating msi interrupt\n",
103 dev_err(&dev->
dev,
"%s: fail mapping irq\n", __func__);
107 dev_dbg(&dev->
dev,
"%s: virq = %d\n", __func__, virq);
125 dev_dbg(&dev->
dev,
"PCIE-MSI: tearing down msi irqs\n");
137 static int ppc4xx_msi_check_device(
struct pci_dev *pdev,
int nvec,
int type)
139 dev_dbg(&pdev->
dev,
"PCIE-MSI:%s called. vec %x type %d\n",
140 __func__, nvec, type);
142 pr_debug(
"ppc4xx msi: MSI-X untested, trying anyway.\n");
169 dev_err(&dev->
dev,
"of_iomap problem failed\n");
172 dev_dbg(&dev->
dev,
"PCIE-MSI: msi register mapped 0x%x 0x%x\n",
180 dev_dbg(&dev->
dev,
"PCIE-MSI: msi address high 0x%x, low 0x%x\n",
208 for (i = 0; i < msi_irqs; i++) {
229 dev_dbg(&dev->
dev,
"PCIE-MSI: Setting up MSI support...\n");
233 dev_err(&dev->
dev,
"No memory for MSI structure\n");
236 dev->
dev.platform_data = msi;
242 dev->
dev.of_node->full_name);
250 if (ppc4xx_setup_pcieh_hw(dev, res, msi))
253 err = ppc4xx_msi_init_allocator(dev, msi);
255 dev_err(&dev->
dev,
"Error allocating MSI bitmap\n");
260 ppc_md.setup_msi_irqs = ppc4xx_setup_msi_irqs;
262 ppc_md.msi_check_device = ppc4xx_msi_check_device;
266 ppc4xx_of_msi_remove(dev);
271 .compatible =
"amcc,ppc4xx-msi",
276 .probe = ppc4xx_msi_probe,
277 .remove = ppc4xx_of_msi_remove,
279 .name =
"ppc4xx-msi",
281 .of_match_table = ppc4xx_msi_ids,
286 static __init int ppc4xx_msi_init(
void)