This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM57xx PCIe link problems when using GPIO reset

Other Parts Discussed in Thread: AM5728

Hi,

I'm using a custom AM5728 hardware with a FPGA connected as PCIe endpoint. In the linux device tree, I enabled the the gpio PCIe reset signal for my hardware:

&pcie1 {
    gpio = <&gpio4 24 GPIO_ACTIVE_HIGH>;
};

With this, the link doesn't come up during kernel boot:

[    0.572949] PCI host bridge /ocp/axi@0/pcie@51000000 ranges:
[    0.572960]   No bus range found for /ocp/axi@0/pcie@51000000, using [bus 00-ff]
[    0.572991]    IO 0x20003000..0x20012fff -> 0x00000000
[    0.573017]   MEM 0x20013000..0x2fffffff -> 0x20013000
[    0.603520] dra7-pcie 51000000.pcie: link is not up

The problem is that the maximum link delay in dra7xx_pcie_establish_link() doesn't seem to satisfy the PCIe specification:

    for (retries = 0; retries < 1000; retries++) {
        if (dw_pcie_link_up(pp))
            return 0;
        usleep_range(10, 20);
    }

Link training can take up to 100ms after the reset. After increasing the delay to usleep_range(100, 200), the link comes up successfully.
I hope someone can re-use this information.

Thanks,
Ralf

  • Hi Ralf,

    Thanks you for sharing this info, it will be in help to the e2e community.

    Ralf Goebel said:
    The problem is that the maximum link delay in dra7xx_pcie_establish_link() doesn't seem to satisfy the PCIe specification

    Ralf Goebel said:
    Link training can take up to 100ms after the reset.

    Can you provide a pointer to that PCIe specification?

    Regards,
    Pavel

  • Hi Pavel,

    I think the PCI Express Base Specification is not publicly available.

    But if I understand it correctly, it requires that the device enters Link Training within 20 ms after the end of the reset, and that the host waits at least 100 ms before sending Configuration Requests. I guess that Link Training can take up to 80 ms.

    Regards,
    Ralf

  • Thanks Ralf.

    I also found in AM57x datasheet a reference to these specs:

    7.20 Peripheral Component Interconnect Express (PCIe)

    The PCIe controller on this device conforms to the PCI Express Base 3.0 Specification, revision 1.0 and the PCI Local Bus Specification, revision 3.0.

    Regards,

    Pavel