summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorSven-Ola Tuecke <sven-ola.tuecke@numberfour.eu>2017-10-05 08:46:42 -0300
committerStefano Babic <sbabic@denx.de>2017-10-12 17:56:28 +0200
commitb2915ba25e350caa79a13a1cd3513eb82709e1f9 (patch)
tree62ff9ae3a765ac1673bcad4b6692e46d872390b8 /drivers/pci
parent066d97c73300bbabf7ec63ee2cab6d8bf79b5771 (diff)
drivers: pci: imx: fix imx_pcie_remove function
We have at least a minor count of boards, that failed to re-initialize PCI express in the Linux kernel. Typical failure rate is 20% on affected boards. This is mitigated by commit 6ecbe1375671 ("drivers: pci: imx: add imx_pcie_remove function"). However, at least on some i.MX6 custom boards, when calling assert_core_reset() as part of the first-time PCIe init, read access to PCIE_PL_PFLR simply hangs. Surround this readl() with imx_pcie_fix_dabt_handler() does not help. For this reason, the forced LTSSM detection is only used on the second assert_core_reset() that is called shorly before starting the Linux kernel. Signed-off-by: Sven-Ola Tuecke <sven-ola.tuecke@numberfour.eu> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Tested-by: David Müller <d.mueller@elsoft.ch>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pcie_imx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c
index eab0a2b602..2900c8d9d1 100644
--- a/drivers/pci/pcie_imx.c
+++ b/drivers/pci/pcie_imx.c
@@ -431,7 +431,7 @@ static int imx_pcie_write_config(struct pci_controller *hose, pci_dev_t d,
/*
* Initial bus setup
*/
-static int imx6_pcie_assert_core_reset(void)
+static int imx6_pcie_assert_core_reset(bool prepare_for_boot)
{
struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
@@ -459,7 +459,7 @@ static int imx6_pcie_assert_core_reset(void)
* If both LTSSM_ENABLE and REF_SSP_ENABLE are active we have a strong
* indication that the bootloader activated the link.
*/
- if (is_mx6dq()) {
+ if (is_mx6dq() && prepare_for_boot) {
u32 val, gpr1, gpr12;
gpr1 = readl(&iomuxc_regs->gpr[1]);
@@ -605,7 +605,7 @@ static int imx_pcie_link_up(void)
uint32_t tmp;
int count = 0;
- imx6_pcie_assert_core_reset();
+ imx6_pcie_assert_core_reset(false);
imx6_pcie_init_phy();
imx6_pcie_deassert_core_reset();
@@ -687,7 +687,7 @@ void imx_pcie_init(void)
void imx_pcie_remove(void)
{
- imx6_pcie_assert_core_reset();
+ imx6_pcie_assert_core_reset(true);
}
/* Probe function. */