Release 4.14 arch/powerpc/sysdev/mpic_msi.c
/*
* Copyright 2006-2007, Michael Ellerman, IBM Corporation.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the
* License.
*
*/
#include <linux/irq.h>
#include <linux/bitmap.h>
#include <linux/msi.h>
#include <asm/mpic.h>
#include <asm/prom.h>
#include <asm/hw_irq.h>
#include <asm/ppc-pci.h>
#include <asm/msi_bitmap.h>
#include <sysdev/mpic.h>
void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq)
{
/* The mpic calls this even when there is no allocator setup */
if (!mpic->msi_bitmap.bitmap)
return;
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, hwirq);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Ellerman | 34 | 100.00% | 2 | 100.00% |
Total | 34 | 100.00% | 2 | 100.00% |
#ifdef CONFIG_MPIC_U3_HT_IRQS
static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic)
{
irq_hw_number_t hwirq;
const struct irq_domain_ops *ops = mpic->irqhost->ops;
struct device_node *np;
int flags, index, i;
struct of_phandle_args oirq;
pr_debug("mpic: found U3, guessing msi allocator setup\n");
/* Reserve source numbers we know are reserved in the HW.
*
* This is a bit of a mix of U3 and U4 reserves but that's going
* to work fine, we have plenty enugh numbers left so let's just
* mark anything we don't like reserved.
*/
for (i = 0; i < 8; i++)
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, i);
for (i = 42; i < 46; i++)
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, i);
for (i = 100; i < 105; i++)
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, i);
for (i = 124; i < mpic->num_sources; i++)
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, i);
np = NULL;
while ((np = of_find_all_nodes(np))) {
pr_debug("mpic: mapping hwirqs for %pOF\n", np);
index = 0;
while (of_irq_parse_one(np, index++, &oirq) == 0) {
ops->xlate(mpic->irqhost, NULL, oirq.args,
oirq.args_count, &hwirq, &flags);
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, hwirq);
}
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Ellerman | 192 | 85.33% | 2 | 22.22% |
Benjamin Herrenschmidt | 25 | 11.11% | 1 | 11.11% |
Grant C. Likely | 6 | 2.67% | 4 | 44.44% |
Rob Herring | 1 | 0.44% | 1 | 11.11% |
Kyle Moffett | 1 | 0.44% | 1 | 11.11% |
Total | 225 | 100.00% | 9 | 100.00% |
#else
static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic)
{
return -1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Ellerman | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#endif
int mpic_msi_init_allocator(struct mpic *mpic)
{
int rc;
rc = msi_bitmap_alloc(&mpic->msi_bitmap, mpic->num_sources,
irq_domain_get_of_node(mpic->irqhost));
if (rc)
return rc;
rc = msi_bitmap_reserve_dt_hwirqs(&mpic->msi_bitmap);
if (rc > 0) {
if (mpic->flags & MPIC_U3_HT_IRQS)
rc = mpic_msi_reserve_u3_hwirqs(mpic);
if (rc) {
msi_bitmap_free(&mpic->msi_bitmap);
return rc;
}
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Ellerman | 90 | 95.74% | 2 | 50.00% |
Marc Zyngier | 3 | 3.19% | 1 | 25.00% |
Kyle Moffett | 1 | 1.06% | 1 | 25.00% |
Total | 94 | 100.00% | 4 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Ellerman | 366 | 90.82% | 3 | 27.27% |
Benjamin Herrenschmidt | 25 | 6.20% | 1 | 9.09% |
Grant C. Likely | 6 | 1.49% | 4 | 36.36% |
Marc Zyngier | 3 | 0.74% | 1 | 9.09% |
Kyle Moffett | 2 | 0.50% | 1 | 9.09% |
Rob Herring | 1 | 0.25% | 1 | 9.09% |
Total | 403 | 100.00% | 11 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.