Skip to content

Commit 07a9b32

Browse files
Ansuelgregkh
authored andcommitted
PCI: qcom: Make sure PCIe is reset before init for rev 2.1.0
commit d3d4d02 upstream. Qsdk U-Boot can incorrectly leave the PCIe interface in an undefined state if bootm command is used instead of bootipq. This is caused by the not deinit of PCIe when bootm is called. Reset the PCIe before init anyway to fix this U-Boot bug. Link: https://lore.kernel.org/r/20200901124955.137-1-ansuelsmth@gmail.com Fixes: 82a8238 ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5c40486 commit 07a9b32

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie)
302302
reset_control_assert(res->por_reset);
303303
reset_control_assert(res->ext_reset);
304304
reset_control_assert(res->phy_reset);
305+
306+
writel(1, pcie->parf + PCIE20_PARF_PHY_CTRL);
307+
305308
regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies);
306309
}
307310

@@ -314,6 +317,16 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
314317
u32 val;
315318
int ret;
316319

320+
/* reset the PCIe interface as uboot can leave it undefined state */
321+
reset_control_assert(res->pci_reset);
322+
reset_control_assert(res->axi_reset);
323+
reset_control_assert(res->ahb_reset);
324+
reset_control_assert(res->por_reset);
325+
reset_control_assert(res->ext_reset);
326+
reset_control_assert(res->phy_reset);
327+
328+
writel(1, pcie->parf + PCIE20_PARF_PHY_CTRL);
329+
317330
ret = regulator_bulk_enable(ARRAY_SIZE(res->supplies), res->supplies);
318331
if (ret < 0) {
319332
dev_err(dev, "cannot enable regulators\n");

0 commit comments

Comments
 (0)