Lines Matching +full:msi +full:- +full:x
1 // SPDX-License-Identifier: GPL-2.0-only
8 * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
13 #include <linux/msi.h>
16 #include <asm/ppc-pci.h>
23 * needs more than 32 MSI's down the road we'll have to rethink this,
36 pr_debug("mpic_pasemi_msi_mask_irq %d\n", data->irq); in mpic_pasemi_msi_mask_irq()
43 pr_debug("mpic_pasemi_msi_unmask_irq %d\n", data->irq); in mpic_pasemi_msi_unmask_irq()
55 .name = "PASEMI-MSI",
65 msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) { in pasemi_msi_teardown_msi_irqs()
66 hwirq = virq_to_hw(entry->irq); in pasemi_msi_teardown_msi_irqs()
67 irq_set_msi_desc(entry->irq, NULL); in pasemi_msi_teardown_msi_irqs()
68 irq_dispose_mapping(entry->irq); in pasemi_msi_teardown_msi_irqs()
69 entry->irq = 0; in pasemi_msi_teardown_msi_irqs()
70 msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK); in pasemi_msi_teardown_msi_irqs()
82 pr_debug("pasemi_msi: MSI-X untested, trying anyway\n"); in pasemi_msi_setup_msi_irqs()
89 msi_for_each_desc(entry, &pdev->dev, MSI_DESC_NOTASSOCIATED) { in pasemi_msi_setup_msi_irqs()
95 hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap, in pasemi_msi_setup_msi_irqs()
102 virq = irq_create_mapping(msi_mpic->irqhost, hwirq); in pasemi_msi_setup_msi_irqs()
104 pr_debug("pasemi_msi: failed mapping hwirq 0x%x\n", in pasemi_msi_setup_msi_irqs()
106 msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, in pasemi_msi_setup_msi_irqs()
108 return -ENOSPC; in pasemi_msi_setup_msi_irqs()
111 /* Vector on MSI is really an offset, the hardware adds in pasemi_msi_setup_msi_irqs()
121 pr_debug("pasemi_msi: allocated virq 0x%x (hw 0x%x) " \ in pasemi_msi_setup_msi_irqs()
122 "addr 0x%x\n", virq, hwirq, msg.address_lo); in pasemi_msi_setup_msi_irqs()
125 * register to generate MSI [512...1023] in pasemi_msi_setup_msi_irqs()
127 msg.data = hwirq-0x200; in pasemi_msi_setup_msi_irqs()
140 of_node = irq_domain_get_of_node(mpic->irqhost); in mpic_pasemi_msi_init()
143 "pasemi,pwrficient-openpic")) in mpic_pasemi_msi_init()
144 return -ENODEV; in mpic_pasemi_msi_init()
152 pr_debug("pasemi_msi: Registering PA Semi MPIC MSI callbacks\n"); in mpic_pasemi_msi_init()
156 WARN_ON(phb->controller_ops.setup_msi_irqs); in mpic_pasemi_msi_init()
157 phb->controller_ops.setup_msi_irqs = pasemi_msi_setup_msi_irqs; in mpic_pasemi_msi_init()
158 phb->controller_ops.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs; in mpic_pasemi_msi_init()