Lines Matching +full:msi +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * MSI support for PPC4xx SoCs using High Speed Transfer Assist (HSTA) for
11 #include <linux/msi.h>
18 #include <asm/ppc-pci.h>
23 /* The ioremapped HSTA MSI IO space */
26 /* Physical address of HSTA MSI IO space */
45 /* We don't support MSI-X */ in hsta_setup_msi_irqs()
47 pr_debug("%s: MSI-X not supported.\n", __func__); in hsta_setup_msi_irqs()
48 return -EINVAL; in hsta_setup_msi_irqs()
51 msi_for_each_desc(entry, &dev->dev, MSI_DESC_NOTASSOCIATED) { in hsta_setup_msi_irqs()
54 pr_debug("%s: Failed to allocate msi interrupt\n", in hsta_setup_msi_irqs()
62 return -EINVAL; in hsta_setup_msi_irqs()
66 * HSTA generates interrupts on writes to 128-bit aligned in hsta_setup_msi_irqs()
84 return -EINVAL; in hsta_setup_msi_irqs()
101 return -EINVAL; in hsta_find_hwirq_offset()
109 msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) { in hsta_teardown_msi_irqs()
110 irq = hsta_find_hwirq_offset(entry->irq); in hsta_teardown_msi_irqs()
112 /* entry->irq should always be in irq_map */ in hsta_teardown_msi_irqs()
114 irq_set_msi_desc(entry->irq, NULL); in hsta_teardown_msi_irqs()
117 entry->irq, irq); in hsta_teardown_msi_irqs()
123 struct device *dev = &pdev->dev; in hsta_msi_probe()
131 return -EINVAL; in hsta_msi_probe()
134 irq_count = of_irq_count(dev->of_node); in hsta_msi_probe()
137 return -EINVAL; in hsta_msi_probe()
141 ppc4xx_hsta_msi.address = mem->start; in hsta_msi_probe()
142 ppc4xx_hsta_msi.data = ioremap(mem->start, resource_size(mem)); in hsta_msi_probe()
145 dev_err(dev, "Unable to map memory\n"); in hsta_msi_probe()
146 return -ENOMEM; in hsta_msi_probe()
149 ret = msi_bitmap_alloc(&ppc4xx_hsta_msi.bmp, irq_count, dev->of_node); in hsta_msi_probe()
156 ret = -ENOMEM; in hsta_msi_probe()
163 irq_of_parse_and_map(dev->of_node, irq); in hsta_msi_probe()
165 dev_err(dev, "Unable to map IRQ\n"); in hsta_msi_probe()
166 ret = -EINVAL; in hsta_msi_probe()
172 phb->controller_ops.setup_msi_irqs = hsta_setup_msi_irqs; in hsta_msi_probe()
173 phb->controller_ops.teardown_msi_irqs = hsta_teardown_msi_irqs; in hsta_msi_probe()
190 .compatible = "ibm,hsta-msi",
198 .name = "hsta-msi",