aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Douglas <adouglas@cadence.com>2018-10-11 12:15:43 -0400
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2018-10-12 07:09:04 -0400
commit0652d4b6b56f73c81abbdbc7e26f772cb2dfe370 (patch)
tree5d3abbaab28f17e1d3dd656789591386a1c67395
parentaa77e55d48124d0d78456eabf872fffb5decdbe1 (diff)
PCI: cadence: Use AXI region 0 to signal interrupts from EP
The IRQ physical address is allocated from region 0, rather than the highest region. Update the driver to reserve this region in the bitmap and to use region 0 for all types of interrupt. This corrects a problem which prevents the interrupt being signalled correctly if using the first address in the AXI region, since an offset of zero will always be mapped to region 0. Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller") Signed-off-by: Alan Douglas <adouglas@cadence.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r--drivers/pci/controller/pcie-cadence-ep.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/pci/controller/pcie-cadence-ep.c b/drivers/pci/controller/pcie-cadence-ep.c
index 9e87dd7f9ac3..6692654798d4 100644
--- a/drivers/pci/controller/pcie-cadence-ep.c
+++ b/drivers/pci/controller/pcie-cadence-ep.c
@@ -258,7 +258,6 @@ static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn,
258 u8 intx, bool is_asserted) 258 u8 intx, bool is_asserted)
259{ 259{
260 struct cdns_pcie *pcie = &ep->pcie; 260 struct cdns_pcie *pcie = &ep->pcie;
261 u32 r = ep->max_regions - 1;
262 u32 offset; 261 u32 offset;
263 u16 status; 262 u16 status;
264 u8 msg_code; 263 u8 msg_code;
@@ -268,8 +267,8 @@ static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn,
268 /* Set the outbound region if needed. */ 267 /* Set the outbound region if needed. */
269 if (unlikely(ep->irq_pci_addr != CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY || 268 if (unlikely(ep->irq_pci_addr != CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY ||
270 ep->irq_pci_fn != fn)) { 269 ep->irq_pci_fn != fn)) {
271 /* Last region was reserved for IRQ writes. */ 270 /* First region was reserved for IRQ writes. */
272 cdns_pcie_set_outbound_region_for_normal_msg(pcie, fn, r, 271 cdns_pcie_set_outbound_region_for_normal_msg(pcie, fn, 0,
273 ep->irq_phys_addr); 272 ep->irq_phys_addr);
274 ep->irq_pci_addr = CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY; 273 ep->irq_pci_addr = CDNS_PCIE_EP_IRQ_PCI_ADDR_LEGACY;
275 ep->irq_pci_fn = fn; 274 ep->irq_pci_fn = fn;
@@ -347,8 +346,8 @@ static int cdns_pcie_ep_send_msi_irq(struct cdns_pcie_ep *ep, u8 fn,
347 /* Set the outbound region if needed. */ 346 /* Set the outbound region if needed. */
348 if (unlikely(ep->irq_pci_addr != (pci_addr & ~pci_addr_mask) || 347 if (unlikely(ep->irq_pci_addr != (pci_addr & ~pci_addr_mask) ||
349 ep->irq_pci_fn != fn)) { 348 ep->irq_pci_fn != fn)) {
350 /* Last region was reserved for IRQ writes. */ 349 /* First region was reserved for IRQ writes. */
351 cdns_pcie_set_outbound_region(pcie, fn, ep->max_regions - 1, 350 cdns_pcie_set_outbound_region(pcie, fn, 0,
352 false, 351 false,
353 ep->irq_phys_addr, 352 ep->irq_phys_addr,
354 pci_addr & ~pci_addr_mask, 353 pci_addr & ~pci_addr_mask,
@@ -517,6 +516,8 @@ static int cdns_pcie_ep_probe(struct platform_device *pdev)
517 goto free_epc_mem; 516 goto free_epc_mem;
518 } 517 }
519 ep->irq_pci_addr = CDNS_PCIE_EP_IRQ_PCI_ADDR_NONE; 518 ep->irq_pci_addr = CDNS_PCIE_EP_IRQ_PCI_ADDR_NONE;
519 /* Reserve region 0 for IRQs */
520 set_bit(0, &ep->ob_region_map);
520 521
521 return 0; 522 return 0;
522 523