diff options
author | Nikita Proshkin <n.proshkin@yadro.com> | 2023-12-27 14:44:52 +0500 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2024-02-17 23:44:30 +0100 |
commit | d016c32df3d07f180485d7349a0d015deb380ecf (patch) | |
tree | 9786adcdf7116c7d5a46ca6e42eedf2c5957d941 | |
parent | 0eebdc1c44f1b418d8a589fba4ff9fe8e8fd8999 (diff) | |
download | pciutils-d016c32df3d07f180485d7349a0d015deb380ecf.tar.gz |
lspci: Add Lane Margining support to the lspci
Gather all the info available without writing to the config space.
Without any commands margining capability exposes only 3 status bits to
read through Margining Port Capabilities and Margining Port Status registers.
It makes sense to show them anyway. For example, Margining Ready bit
indicates whether the device is actually ready for the margining process.
Reviewed-by: Sergei Miroshnichenko <s.miroshnichenko@yadro.com>
Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
-rw-r--r-- | ls-ecaps.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -692,6 +692,26 @@ cap_rcec(struct device *d, int where) } static void +cap_lmr(struct device *d, int where) +{ + printf("Lane Margining at the Receiver\n"); + + if (verbose < 2) + return; + + if (!config_fetch(d, where, 8)) + return; + + u16 port_caps = get_conf_word(d, where + PCI_LMR_CAPS); + u16 port_status = get_conf_word(d, where + PCI_LMR_PORT_STS); + + printf("\t\tPortCap: Uses Driver%c\n", FLAG(port_caps, PCI_LMR_CAPS_DRVR)); + printf("\t\tPortSta: MargReady%c MargSoftReady%c\n", + FLAG(port_status, PCI_LMR_PORT_STS_READY), + FLAG(port_status, PCI_LMR_PORT_STS_SOFT_READY)); +} + +static void cxl_range(u64 base, u64 size, int n) { u32 interleave[] = { 0, 256, 4096, 512, 1024, 2048, 8192, 16384 }; @@ -1607,7 +1627,7 @@ show_ext_caps(struct device *d, int type) printf("Physical Layer 16.0 GT/s <?>\n"); break; case PCI_EXT_CAP_ID_LMR: - printf("Lane Margining at the Receiver <?>\n"); + cap_lmr(d, where); break; case PCI_EXT_CAP_ID_HIER_ID: printf("Hierarchy ID <?>\n"); |