Skip to content

Commit 5d6a6c7

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: qcom-ep: Disable MHI RAM data parity error interrupt for SA8775P SoC
SA8775P SoC has support for the hardware parity check feature on the MHI RAM (entity that holds MHI registers, etc.) But due to a hardware bug in the parity check logic, the data parity error interrupt is getting generated all the time when using MHI. So the hardware team has suggested disabling the parity check error to work around the hardware bug. Mask the parity error interrupt in PARF_INT_ALL_5_MASK register. Fixes: 58d0d3e ("PCI: qcom-ep: Add support for SA8775P SOC") Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 054308a commit 5d6a6c7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/pci/controller/dwc/pcie-qcom-ep.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define PARF_DEBUG_CNT_AUX_CLK_IN_L1SUB_L2 0xc88
5959
#define PARF_DEVICE_TYPE 0x1000
6060
#define PARF_BDF_TO_SID_CFG 0x2c00
61+
#define PARF_INT_ALL_5_MASK 0x2dcc
6162

6263
/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
6364
#define PARF_INT_ALL_LINK_DOWN BIT(1)
@@ -127,6 +128,9 @@
127128
/* PARF_CFG_BITS register fields */
128129
#define PARF_CFG_BITS_REQ_EXIT_L1SS_MSI_LTR_EN BIT(1)
129130

131+
/* PARF_INT_ALL_5_MASK fields */
132+
#define PARF_INT_ALL_5_MHI_RAM_DATA_PARITY_ERR BIT(0)
133+
130134
/* ELBI registers */
131135
#define ELBI_SYS_STTS 0x08
132136
#define ELBI_CS2_ENABLE 0xa4
@@ -158,10 +162,12 @@ enum qcom_pcie_ep_link_status {
158162
* struct qcom_pcie_ep_cfg - Per SoC config struct
159163
* @hdma_support: HDMA support on this SoC
160164
* @override_no_snoop: Override NO_SNOOP attribute in TLP to enable cache snooping
165+
* @disable_mhi_ram_parity_check: Disable MHI RAM data parity error check
161166
*/
162167
struct qcom_pcie_ep_cfg {
163168
bool hdma_support;
164169
bool override_no_snoop;
170+
bool disable_mhi_ram_parity_check;
165171
};
166172

167173
/**
@@ -480,6 +486,12 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci)
480486
PARF_INT_ALL_LINK_UP | PARF_INT_ALL_EDMA;
481487
writel_relaxed(val, pcie_ep->parf + PARF_INT_ALL_MASK);
482488

489+
if (pcie_ep->cfg && pcie_ep->cfg->disable_mhi_ram_parity_check) {
490+
val = readl_relaxed(pcie_ep->parf + PARF_INT_ALL_5_MASK);
491+
val &= ~PARF_INT_ALL_5_MHI_RAM_DATA_PARITY_ERR;
492+
writel_relaxed(val, pcie_ep->parf + PARF_INT_ALL_5_MASK);
493+
}
494+
483495
ret = dw_pcie_ep_init_registers(&pcie_ep->pci.ep);
484496
if (ret) {
485497
dev_err(dev, "Failed to complete initialization: %d\n", ret);
@@ -901,6 +913,7 @@ static void qcom_pcie_ep_remove(struct platform_device *pdev)
901913
static const struct qcom_pcie_ep_cfg cfg_1_34_0 = {
902914
.hdma_support = true,
903915
.override_no_snoop = true,
916+
.disable_mhi_ram_parity_check = true,
904917
};
905918

906919
static const struct of_device_id qcom_pcie_ep_match[] = {

0 commit comments

Comments
 (0)