Commit aaf87f03ad709ff9f00819ef1eb001e878ad0a54

Authored by Fabio Estevam
Committed by Tom Rini
1 parent cb4c833b74

pci: pcie_imx: Fix hang on mx6qp

PCI driver currently hangs on mx6qp.

Toggle the reset bit with the appropriate timings to fix the issue.

Based on the FSL kernel driver implementation.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>

Showing 2 changed files with 10 additions and 0 deletions Side-by-side Diff

arch/arm/include/asm/arch-mx6/iomux.h
... ... @@ -18,6 +18,8 @@
18 18 #define IOMUXC_GPR1_REF_SSP_EN (1 << 16)
19 19 #define IOMUXC_GPR1_TEST_POWERDOWN (1 << 18)
20 20  
  21 +#define IOMUXC_GPR1_PCIE_SW_RST (1 << 29)
  22 +
21 23 /*
22 24 * IOMUXC_GPR5 bit fields
23 25 */
drivers/pci/pcie_imx.c
... ... @@ -19,6 +19,7 @@
19 19 #include <asm/io.h>
20 20 #include <linux/sizes.h>
21 21 #include <errno.h>
  22 +#include <asm/arch/sys_proto.h>
22 23  
23 24 #define PCI_ACCESS_READ 0
24 25 #define PCI_ACCESS_WRITE 1
... ... @@ -430,6 +431,10 @@
430 431 static int imx6_pcie_assert_core_reset(void)
431 432 {
432 433 struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
  434 +
  435 + if (is_mx6dqp())
  436 + setbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_PCIE_SW_RST);
  437 +
433 438 #if defined(CONFIG_MX6SX)
434 439 struct gpc *gpc_regs = (struct gpc *)GPC_BASE_ADDR;
435 440  
... ... @@ -535,6 +540,9 @@
535 540 imx6_pcie_toggle_power();
536 541  
537 542 enable_pcie_clock();
  543 +
  544 + if (is_mx6dqp())
  545 + clrbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_PCIE_SW_RST);
538 546  
539 547 /*
540 548 * Wait for the clock to settle a bit, when the clock are sourced