Has anyone attempted to add i.MX6 PCIe support to U-Boot?

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

Has anyone attempted to add i.MX6 PCIe support to U-Boot?

8,975 Views
kitz36
Contributor III

We're working on a custom board that uses the i.MX6 to interface to a single endpoint via PCIe.  The link will mostly be used in Linux, but I would like to bring the link up and play with the endpoint from U-Boot in board bring-up.  I don't see any i.MX6 PCIe support in the ARM2 or SabreLite U-boot trees.  Has anyone tried to get this going in U-Boot?

Labels (1)
25 Replies

3,684 Views
YixingKong
Senior Contributor IV


Charles

It seem your issue had been resolved. If you are fine I will close the discussion in 3 days.

Thanks,

Yixing

0 Kudos
Reply

3,690 Views
OtavioSalvador
Senior Contributor II

You can use the 2014.01 U-Boot version which includes MarekVasut patches for PCIe.

3,690 Views
MarekVasut
Senior Contributor I

You're wrong, they're scheduled for 2014.04 . See git.denx.de Git - u-boot/u-boot-imx.git/shortlog .

I tested this with XHCI PCIe card, Intel 82574L NIC , Intel i210 NIC , PCIe SATA controller and a few others.

0 Kudos
Reply

3,690 Views
MarekVasut
Senior Contributor I

Even better, here's a bundle with V2 of the patches which contain LTSSM fixes U-Boot - Patchwork . Stefano will push them into u-boot-imx/master this weekend I heard ...

0 Kudos
Reply

3,690 Views
MarekVasut
Senior Contributor I

You will also want [U-Boot] pci: mx6: Implement reset callback - Patchwork and you _WILL_ want to reimplement the imx6_pcie_toggle_reset() with proper GPIO reset for the PCIe, otherwise you _WILL_ have issues with the bus not coming up.

3,690 Views
wallyyeh
Contributor V

after talk to Marek, I compare patches v1 and v2.

and find out v2 patch will check return of imx_pcie_link_up() before doing pci_hose_scan().

I guess that fix empty device on bridge issue.

and I so excited that I accidentally break my DC adapter... so I have to wait for tomorrow morning to get new one.

orz...

0 Kudos
Reply

3,690 Views
MarekVasut
Senior Contributor I

Yes, if the device is not populated, you must not touch the IO space, otherwise the entire CPU will freeze. Even worse, you won't be able to break the CPU with a debugger. The V2 of the patches do fix it. It also fixes the problem where the link was considered ready too early.

And like I said, you _MUST_ implement the reset callback, like so:

gpio_set_value(..., 1);

mdelay(100);

gpio_set_value(..., 0);

mdelay(100);

These mdelay() calls might be shorter, I didn't research how short the delay should be here. 100mS is a safe value.

3,690 Views
rajniks
Contributor I

Hi Marek,

I am working with LTIB from Freescale and it supports u-boot-2009-08. Will your patch work for that version as well.

Regards

Raj

0 Kudos
Reply

3,689 Views
OtavioSalvador
Senior Contributor II

No.

I just double checked and his patches didn't make 2014.01.

The pointers for the patches:

[U-Boot,1/4] ARM: armv7: Make indirect vector addresses globl - Patchwork

[U-Boot,V3,2/4] ARM: mx6: Add PCI express clock configuration - Patchwork

[U-Boot,V2,3/4] ARM: mx6: Add PCI express driver - Patchwork

[U-Boot,V2,4/4] ARM: mx6: Enable PCIe on Sabrelite - Patchwork

The 2014.10 is ever nicer so I suggest you to move for this version and enjoy a PCIe working support.

0 Kudos
Reply

3,687 Views
fabio_estevam
NXP Employee
NXP Employee

Yes, U-boot 2014.10 has PCI support 'out of the box' on mx6 sabresd boards.

0 Kudos
Reply

3,684 Views
lmhdoms
Contributor III

I take the liberty to append to this thread... I am trying to get SabreSD detect the Exar PCIe eval. board XR17V354. No luck with daisy (U-Boot or kernel 3.10.17). I tried with no PCI enabled in U-Boot, the kernel knows the PCIe root, but no device is detected (lspci lists only the root).

Reading this thread I have build the U-Boot 2014.10 to check if it can detect the eval. board. But it fails:

=> pci

Scanning PCI devices on bus 0

BusDevFun  VendorId   DeviceId   Device Class       Sub-Class

_____________________________________________________________

pci_bus_to_hose() failed

Am I missing something in the configuration? The power LED on the eval board lights up, so its not a power issue.

Thanks,

Lars

0 Kudos
Reply

3,684 Views
wallyyeh
Contributor V

Hi, Imhdoms:

    the error message indicate that the board didn't get initialized correctly.

have you set the correct "CONFIG_PCIE_IMX_POWER_GPIO" and "CONFIG_PCIE_IMX_PERST_GPIO" in <u-boot dir>/include/configs/mx6sabresd.h ?

0 Kudos
Reply

3,684 Views
lmhdoms
Contributor III

Hi Wally,

I am using the mx6sabresd.h just as it is. This is the PCI part:

#define CONFIG_CMD_PCI

#ifdef CONFIG_CMD_PCI

#define CONFIG_PCI

#define CONFIG_PCI_PNP

#define CONFIG_PCI_SCAN_SHOW

#define CONFIG_PCIE_IMX

#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12)

#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(3, 19)

#endif

0 Kudos
Reply

3,684 Views
wallyyeh
Contributor V

Hi, Imhdoms:

    that's weird. it should work for SabreSD board with this uboot.

maybe you should also ask on meta-freescale maillist, I think may Fabio know the answer.

0 Kudos
Reply

3,690 Views
sinanakman
Senior Contributor III

Wally, if you do test his patches with mainline 2014.01 u-boot, please let me know what your findings are and I won't have to do the same thing.

Thanks

Sinan Akman

0 Kudos
Reply

3,690 Views
sinanakman
Senior Contributor III

All good, thanks for all that.

-- sinan

0 Kudos
Reply

3,690 Views
OtavioSalvador
Senior Contributor II

Yes; same patches I passed for Sinan as can be seen in the thread.   

0 Kudos
Reply

3,690 Views
sinanakman
Senior Contributor III

Hi Otavio, I am aware of his patches, I was just trying to see if anyone tested them on sabresd since last time I worked on this. It was not clear from your post whether you were referring to Marek patches or confirming that you tested them on sabresd.  Wally said he had pcie working on sabresd but this wasn't mainline. So I assume you haven't tested Marek patches on sabresd too. Let me know if I misunderstood. I will then continue on trying to make Marek patches working on sabre sd.

Thanks

Sinan Akman

0 Kudos
Reply

3,690 Views
sinanakman
Senior Contributor III

Wally thanks for the update.

Otavio, did you test 2014.01 with any pcie device on an sabre sd board ?

Thanks

Sinan Akman

0 Kudos
Reply