From: Elad Nachman <enachman@marvell.com>
To: <thomas.petazzoni@bootlin.com>, <bhelgaas@google.com>,
<lpieralisi@kernel.org>, <robh@kernel.org>, <kw@linux.com>,
<krzysztof.kozlowski+dt@linaro.org>, <linux-pci@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Elad Nachman <enachman@marvell.com>
Subject: [PATCH v4 5/8] PCI: armada8k: support AC5 INTx PCIe interrupts
Date: Mon, 13 Mar 2023 14:40:13 +0200 [thread overview]
Message-ID: <20230313124016.17102-6-enachman@marvell.com> (raw)
In-Reply-To: <20230313124016.17102-1-enachman@marvell.com>
From: Elad Nachman <enachman@marvell.com>
Support message emulation of INTx PCIe interrupts for Marvell AC5/X.
These message emulations require writing an additional status register
with acknowledge bits.
Signed-off-by: Elad Nachman <enachman@marvell.com>
---
v4:
Split the part not handling INTx interrupts to a separate patch
drivers/pci/controller/dwc/pcie-armada8k.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-armada8k.c b/drivers/pci/controller/dwc/pcie-armada8k.c
index 02481ecadd25..2b94e32853ad 100644
--- a/drivers/pci/controller/dwc/pcie-armada8k.c
+++ b/drivers/pci/controller/dwc/pcie-armada8k.c
@@ -61,6 +61,7 @@ struct armada8k_pcie_of_data {
#define PCIE_GLOBAL_INT_CAUSE1_REG (PCIE_VENDOR_REGS_OFFSET + 0x1C)
#define PCIE_GLOBAL_INT_MASK1_REG (PCIE_VENDOR_REGS_OFFSET + 0x20)
+#define PCIE_GLOBAL_INT_CAUSE2_REG (PCIE_VENDOR_REGS_OFFSET + 0x24)
#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSET + 0x28)
#define PCIE_INT_A_ASSERT_MASK BIT(9)
#define PCIE_INT_B_ASSERT_MASK BIT(10)
@@ -267,8 +268,14 @@ static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
*/
val = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_CAUSE1_REG);
dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_CAUSE1_REG, val);
- if ((PCIE_MSI_MASK_AC5 & val) && (pcie->pcie_type == ARMADA8K_PCIE_TYPE_AC5))
- dw_handle_msi_irq(&pci->pp);
+ if (pcie->pcie_type == ARMADA8K_PCIE_TYPE_AC5) {
+ if (PCIE_MSI_MASK_AC5 & val)
+ dw_handle_msi_irq(&pci->pp);
+
+ val = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_CAUSE2_REG);
+ /* Now clear the second interrupt cause. */
+ dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_CAUSE2_REG, val);
+ }
return IRQ_HANDLED;
}
--
2.17.1
next prev parent reply other threads:[~2023-03-13 12:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 12:40 [PATCH v4 0/8] PCI: dwc: Add support for Marvell AC5 SoC Elad Nachman
2023-03-13 12:40 ` [PATCH v4 1/8] dt-bindings: PCI: armada8k: Add compatible string for " Elad Nachman
2023-03-13 12:40 ` [PATCH v4 2/8] PCI: armada8k: Add AC5 SoC support Elad Nachman
2023-03-13 19:43 ` Bjorn Helgaas
2023-03-22 23:19 ` Serge Semin
2023-03-13 12:40 ` [PATCH v4 3/8] PCI: armada8k: Add AC5 MSI support Elad Nachman
2023-03-22 23:23 ` Serge Semin
2023-03-13 12:40 ` [PATCH v4 4/8] dt-bindings: PCI: dwc: Add dma-ranges, region mask Elad Nachman
2023-03-17 18:30 ` Rob Herring
2023-03-13 12:40 ` Elad Nachman [this message]
2023-03-13 12:40 ` [PATCH v4 6/8] PCI: armada8k: support reg regions according to DT Elad Nachman
2023-03-13 12:40 ` [PATCH v4 7/8] PCI: dwc: Introduce configurable DMA mask Elad Nachman
2023-03-17 18:23 ` Rob Herring
2023-03-27 17:01 ` Robin Murphy
2023-03-13 12:40 ` [PATCH v4 8/8] PCI: dwc: Introduce region limit from DT Elad Nachman
2023-03-13 19:48 ` Bjorn Helgaas
2023-03-14 20:48 ` Serge Semin
2023-03-23 0:11 ` Serge Semin
2023-03-13 19:22 ` [PATCH v4 0/8] PCI: dwc: Add support for Marvell AC5 SoC Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230313124016.17102-6-enachman@marvell.com \
--to=enachman@marvell.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).