IMX6 PCIe Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6 PCIe Problem

6,753 Views
valentinafernan
Contributor II

Hi,

 

We are facing a problem enabling PCIe support on a custom imx6 board. There's  a marvel 88W8897 chip connected to the PCIe bus on the custom board.

 

However the following errors are displayed at boot:

 

imx6q-pcie 1ffc000.pcie: phy link never came up

imx6q-pcie 1ffc000.pcie: Failed to bring link up!

imx6q-pcie 1ffc000.pcie: failed to initialize host

imx6q-pcie: probe of 1ffc000.pcie failed with error -22

 

We are using linux imx kernel version 3.14.28.

 

The following are our defconfig and device tree source files

 

What could be the reason for this problem?

 

Thanks

Original Attachment has been moved to: defconfig.zip

Original Attachment has been moved to: imx6qdl-sabreauto.dtsi.zip

Labels (2)
0 Kudos
4 Replies

2,063 Views
georgekellerman
Contributor I

Hey Valentina,

Did you ever figure out a solution for this. We too are connecting to an 88W8897. While most of the time our link works, sometimes we get PHY LINK NEVER CAME UP

0 Kudos

2,063 Views
valentinafernan
Contributor II

Hi George,

We figured out a solution for this. If you still have PCIE problems, you can apply the following patch:

diff -ruN a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c

--- a/drivers/pci/host/pci-imx6.c 2016-01-25 22:42:52.237055875 -0600

+++ b/drivers/pci/host/pci-imx6.c 2016-02-10 20:32:56.552845334 -0600

@@ -342,7 +342,11 @@

  struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);

  if (gpio_is_valid(imx6_pcie->power_on_gpio))

+ {

+ mdelay(50); //Wait 50 ms

  gpio_set_value(imx6_pcie->power_on_gpio, 1);

+ mdelay(50); //Wait 50 ms

+ }

  request_bus_freq(BUS_FREQ_HIGH);

  ret = clk_prepare_enable(imx6_pcie->pcie_phy);

@@ -538,7 +541,7 @@

static int imx6_pcie_wait_for_link(struct pcie_port *pp)

{

- int count = 2000;

+ int count = 10000;

  while (!dw_pcie_link_up(pp)) {

  udelay(100);

@@ -605,7 +608,7 @@

  tmp |= PORT_LOGIC_SPEED_CHANGE;

  writel(tmp, pp->dbi_base + PCIE_LINK_WIDTH_SPEED_CONTROL);

- count = 200;

+ count = 1000;

  while (count--) {

  tmp = readl(pp->dbi_base + PCIE_LINK_WIDTH_SPEED_CONTROL);

  /* Test if the speed change finished. */

Hope it is useful for you.

Best Regards,

Valentina

0 Kudos

2,064 Views
tengri
Contributor IV

Dear Valentina,

Hi, to get the phy link up and running did you also have to change the device tree entry (IRQ related entries) and configuration macros like 'CONFIG_PCI_MSI' in .conf apart from the timing issue you've stated here ?

thanks in advance

Anuradha

0 Kudos

2,064 Views
igorpadykov
NXP Employee
NXP Employee

Hi Valentina

one can try suggestions given on below (in particular adding longer udelay(100))

Re: Has anyone verified PCI driver on yocto 3.14.28-1.0.1 branch?

also had you tried other PCIe cards? Please try to test with official Freescale BSP

from i.MX6Q product page :

Board Support Packages (27)

L3.14.28_1.0.0_iMX6QDLS_BUNDLE (REV L3.14.28_1.0.0)

i.MX 6Quad, i.MX 6Dual, i.MX 6DualLite, i.MX 6Solo Linux Binary Demo Files and Linux BSP Documentation

SABRE Board Reference Design|Freescale

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos