PCI: mobiveil: Add callback function for interrupt initialization

The Mobiveil GPEX internal MSI/INTx controller is not implemented
in all platforms in which the Mobiveil GPEX is integrated.

Allow platforms to implement their specific interrupt initialization.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Andrew Murray <amurray@thegoodpenguin.co.uk>
This commit is contained in:
Hou Zhiqiang 2020-02-13 12:06:36 +08:00 committed by Lorenzo Pieralisi
parent 03bdc38840
commit ed620e9654
2 changed files with 18 additions and 1 deletions

View File

@ -499,7 +499,7 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
return 0;
}
static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
static int mobiveil_pcie_integrated_interrupt_init(struct mobiveil_pcie *pcie)
{
struct platform_device *pdev = pcie->pdev;
struct device *dev = &pdev->dev;
@ -539,6 +539,16 @@ static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
return 0;
}
static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
{
struct mobiveil_root_port *rp = &pcie->rp;
if (rp->ops->interrupt_init)
return rp->ops->interrupt_init(pcie);
return mobiveil_pcie_integrated_interrupt_init(pcie);
}
int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie)
{
struct mobiveil_root_port *rp = &pcie->rp;

View File

@ -130,10 +130,17 @@ struct mobiveil_msi { /* MSI information */
DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI);
};
struct mobiveil_pcie;
struct mobiveil_rp_ops {
int (*interrupt_init)(struct mobiveil_pcie *pcie);
};
struct mobiveil_root_port {
char root_bus_nr;
void __iomem *config_axi_slave_base; /* endpoint config base */
struct resource *ob_io_res;
struct mobiveil_rp_ops *ops;
int irq;
raw_spinlock_t intx_mask_lock;
struct irq_domain *intx_domain;