23 #include <asm/hw_irq.h>
34 #define ALLOC_CHUNK 16
36 #define PASEMI_MSI_ADDR 0xfc080000
39 static struct mpic *msi_mpic;
42 static void mpic_pasemi_msi_mask_irq(
struct irq_data *
data)
44 pr_debug(
"mpic_pasemi_msi_mask_irq %d\n", data->
irq);
49 static void mpic_pasemi_msi_unmask_irq(
struct irq_data *
data)
51 pr_debug(
"mpic_pasemi_msi_unmask_irq %d\n", data->
irq);
56 static struct irq_chip mpic_pasemi_msi_chip = {
57 .irq_shutdown = mpic_pasemi_msi_mask_irq,
58 .irq_mask = mpic_pasemi_msi_mask_irq,
59 .irq_unmask = mpic_pasemi_msi_unmask_irq,
66 static int pasemi_msi_check_device(
struct pci_dev *pdev,
int nvec,
int type)
69 pr_debug(
"pasemi_msi: MSI-X untested, trying anyway\n");
74 static void pasemi_msi_teardown_msi_irqs(
struct pci_dev *pdev)
78 pr_debug(
"pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
93 static int pasemi_msi_setup_msi_irqs(
struct pci_dev *pdev,
int nvec,
int type)
100 pr_debug(
"pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
115 pr_debug(
"pasemi_msi: failed allocating hwirq\n");
121 pr_debug(
"pasemi_msi: failed mapping hwirq 0x%x\n",
138 pr_debug(
"pasemi_msi: allocated virq 0x%x (hw 0x%x) " \
139 "addr 0x%x\n", virq, hwirq,
msg.address_lo);
144 msg.data = hwirq-0x200;
155 if (!mpic->irqhost->of_node ||
157 "pasemi,pwrficient-openpic"))
162 pr_debug(
"pasemi_msi: Error allocating bitmap!\n");
166 pr_debug(
"pasemi_msi: Registering PA Semi MPIC MSI callbacks\n");
170 ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs;
171 ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs;
172 ppc_md.msi_check_device = pasemi_msi_check_device;