/* * Copyright (C) 2017 Marvell * * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied.
*/
fwspec.fwnode = domain->parent->fwnode;
fwspec.param_count = 3;
fwspec.param[0] = GIC_SPI;
fwspec.param[1] = gicp_idx_to_spi(gicp, hwirq) - 32; /* * Assume edge rising for now, it will be properly set when * ->set_type() is called
*/
fwspec.param[2] = IRQ_TYPE_EDGE_RISING;
ret = irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec); if (ret) {
dev_err(gicp->dev, "Cannot allocate parent IRQ\n"); goto free_hwirq;
}
ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
&gicp_irq_chip, gicp); if (ret) goto free_irqs_parent;
for (i = 0; i < gicp->spi_ranges_cnt; i++) {
of_property_read_u32_index(node, "marvell,spi-ranges",
i * 2,
&gicp->spi_ranges[i].start);
of_property_read_u32_index(node, "marvell,spi-ranges",
i * 2 + 1,
&gicp->spi_ranges[i].count);
gicp->spi_cnt += gicp->spi_ranges[i].count;
}
gicp->spi_bitmap = devm_bitmap_zalloc(&pdev->dev, gicp->spi_cnt, GFP_KERNEL); if (!gicp->spi_bitmap) return -ENOMEM;
info.size = gicp->spi_cnt;
info.host_data = gicp;
irq_parent_dn = of_irq_find_parent(node); if (!irq_parent_dn) {
dev_err(&pdev->dev, "failed to find parent IRQ node\n"); return -ENODEV;
}
info.parent = irq_find_host(irq_parent_dn);
of_node_put(irq_parent_dn); if (!info.parent) {
dev_err(&pdev->dev, "failed to find parent IRQ domain\n"); return -ENODEV;
}
base = ioremap(gicp->res->start, resource_size(gicp->res)); if (!base) {
dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
} else { for (i = 0; i < 64; i++)
writel(i, base + GICP_CLRSPI_NSR_OFFSET);
iounmap(base);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.