How to get the link information of PCIe?

I design a board with TK1. I change the extlinux.conf to use pcie 4x.
The 4x pcie connected to a 4x PCIe EP device.
I wonder if the connection is PCIe 4x and what the link speed is(2.5G/S or 5G/s).

Is the “lspci” command possible? Thank you.

So far as I know the Jetson TK1 only makes a single lane available on the mini-PCIe slot.

The lspci command is the correct command. You can get more verbose information with multiple “-v” options, e.g., the most verbose is “lspci -vvv”. In some cases you will need to use sudo to see any details, i.e., information on link speed and errors may not show up without “sudo lspci -vvv”.

Please check the TRM for PCIE Link control and link status registers
T_PCIE2_RP_LINK_CONTROL_STATUS
Offset 0x90

LINK_SPEED
This field indicates the negotiated Link Speed of the given PCI Express Link
define NV_PROJ__PCIE2_RP_LINK_CONTROL_STATUS_LINK_SPEED 19:16 /* R–VF /
define NV_PROJ__PCIE2_RP_LINK_CONTROL_STATUS_LINK_SPEED_GEN1 0x00000001 /
RWI-V /
define NV_PROJ__PCIE2_RP_LINK_CONTROL_STATUS_LINK_SPEED_GEN2 0x00000002 /
RWI-V */

NEG_LINK_WIDTH
.define NV_PROJ__PCIE2_RP_LINK_CONTROL_STATUS_NEG_LINK_WIDTH 25:20 /* R–VF */
| 000001b | x1 |
| 000010b | x2 |
| 000100b | x4 |

Thanks for your help.“sudo” works