A pretty hackish MPIC backend, just enough to flesh out the design.
Based on code from Segher.
Signed-off-by: Michael Ellerman <michael@xxxxxxxxxxxxxx>
+static int msi_mpic_check(struct pci_dev *pdev, int num,
+ struct msix_entry *entries, int type)
+{
+ /* The irq allocator needs more work to support MSI-X/multi-MSI */
+ if (type == PCI_CAP_ID_MSIX || num != 1)
+ return 1;
+static int msi_mpic_alloc(struct pci_dev *pdev, int num,
+ struct msix_entry *entries, int type)
+{
+ irq_hw_number_t hwirq;
+ unsigned int virq;
+
+ /* We need a smarter allocator for MSI-X/multi-MSI */
+ hwirq = irq_map[pdev->irq].hwirq;
+ hwirq += 100;
+ set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
+static int msi_mpic_setup_msi_msg(struct pci_dev *pdev,
+ struct msix_entry *entry, struct msi_msg *msg, int type)
+{
+ msg->address_lo = 0xfee00000; /* XXX What is this value? */
+ msg->address_hi = 0;
+ msg->data = pdev->irq | 0x8000;
+static int msi_mpic_init(void)
+{
+ /* XXX Do this in mpic_init ? */
+ pr_debug("mpic_msi_init: Registering MPIC MSI ops.\n");
+ ppc_md.get_msi_ops = mpic_get_msi_ops;