Lines Matching +full:msi +full:- +full:x

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
9 #include <linux/msi.h>
12 #include <asm/ppc-pci.h>
39 .name = "MPIC-U3MSI",
66 for (bus = pdev->bus; bus && bus->self; bus = bus->parent) { in find_ht_magic_addr()
67 pos = pci_find_ht_capability(bus->self, HT_CAPTYPE_MSI_MAPPING); in find_ht_magic_addr()
69 return read_ht_magic_addr(bus->self, pos); in find_ht_magic_addr()
77 struct pci_controller *hose = pci_bus_to_host(pdev->bus); in find_u4_magic_addr()
82 * the MSI number and that triggers the right interrupt, but in find_u4_magic_addr()
90 * This will not work if we ever use more than one legacy MSI in in find_u4_magic_addr()
91 * a block but we never do. For one MSI or multiple MSI-X where in find_u4_magic_addr()
95 if (of_device_is_compatible(hose->dn, "u4-pcie") || in find_u4_magic_addr()
96 of_device_is_compatible(hose->dn, "U4-pcie")) in find_u4_magic_addr()
107 msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) { in u3msi_teardown_msi_irqs()
108 hwirq = virq_to_hw(entry->irq); in u3msi_teardown_msi_irqs()
109 irq_set_msi_desc(entry->irq, NULL); in u3msi_teardown_msi_irqs()
110 irq_dispose_mapping(entry->irq); in u3msi_teardown_msi_irqs()
111 entry->irq = 0; in u3msi_teardown_msi_irqs()
112 msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); in u3msi_teardown_msi_irqs()
125 pr_debug("u3msi: MSI-X untested, trying anyway.\n"); in u3msi_setup_msi_irqs()
127 /* If we can't find a magic address then MSI ain't gonna work */ in u3msi_setup_msi_irqs()
132 return -ENXIO; in u3msi_setup_msi_irqs()
135 msi_for_each_desc(entry, &pdev->dev, MSI_DESC_NOTASSOCIATED) { in u3msi_setup_msi_irqs()
136 hwirq = msi_bitmap_alloc_hwirqs(&msi_mpic->msi_bitmap, 1); in u3msi_setup_msi_irqs()
148 virq = irq_create_mapping(msi_mpic->irqhost, hwirq); in u3msi_setup_msi_irqs()
150 pr_debug("u3msi: failed mapping hwirq 0x%x\n", hwirq); in u3msi_setup_msi_irqs()
151 msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); in u3msi_setup_msi_irqs()
152 return -ENOSPC; in u3msi_setup_msi_irqs()
159 pr_debug("u3msi: allocated virq 0x%x (hw 0x%x) addr 0x%lx\n", in u3msi_setup_msi_irqs()
162 printk("u3msi: allocated virq 0x%x (hw 0x%x) addr 0x%lx\n", in u3msi_setup_msi_irqs()
184 pr_debug("u3msi: Registering MPIC U3 MSI callbacks.\n"); in mpic_u3msi_init()
190 WARN_ON(phb->controller_ops.setup_msi_irqs); in mpic_u3msi_init()
191 phb->controller_ops.setup_msi_irqs = u3msi_setup_msi_irqs; in mpic_u3msi_init()
192 phb->controller_ops.teardown_msi_irqs = u3msi_teardown_msi_irqs; in mpic_u3msi_init()