]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
lspci: Add support for Secondary PCI Express Extended Capability
authorBasavaraja M S <basavam@cadence.com>
Mon, 19 Nov 2018 07:15:08 +0000 (07:15 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 31 Dec 2018 14:12:46 +0000 (15:12 +0100)
Signed-off-by: Basavaraja M S <basavam@cadence.com>
lib/header.h
ls-ecaps.c

index b5630738f8b5d867542b3792bd79d89a0b4b9637..6ca93fedacb3cd49300e4d06e7ef2b819bb24775 100644 (file)
 #define   PCI_LTR_SCALE_MASK   (7)
 #define PCI_LTR_MAX_NOSNOOP    6       /* 16 bit value */
 
+/* Secondary PCI Express Extended Capability */
+#define PCI_SEC_LNKCTL3     4    /* Link Control 3 register*/
+#define  PCI_SEC_LNKCTL3_PERFORM_LINK_EQU       0x01
+#define  PCI_SEC_LNKCTL3_LNK_EQU_REQ_INTR_EN    0x02
+#define  PCI_SEC_LNKCTL3_ENBL_LOWER_SKP_OS_GEN_VEC(x)  ((x >> 8) & 0x7F)
+#define PCI_SEC_LANE_ERR    8   /* Lane Error status register */
+#define PCI_SEC_LANE_EQU_CTRL 12   /* Lane Equalization contol register */
+
 /* Process Address Space ID */
 #define PCI_PASID_CAP          0x04    /* PASID feature register */
 #define  PCI_PASID_CAP_EXEC    0x02    /* Exec permissions Supported */
index 3deb53500bfff712e16fd8586bf46494acc581e6..a26ea035d505a3f058bff1739c00654460d16e0d 100644 (file)
@@ -76,6 +76,37 @@ cap_ltr(struct device *d, int where)
         ((unsigned long long)nosnoop & PCI_LTR_VALUE_MASK) * scale);
 }
 
+static void
+cap_sec(struct device *d, int where, int type)
+{
+  u32 ctrl3, lane_err_stat;
+  u8 lane;
+  printf("Secondary PCI Express\n");
+  if (verbose < 2 && type == 0)
+    return;
+
+  if (!config_fetch(d, where + PCI_SEC_LNKCTL3, 12))
+    return;
+
+  ctrl3 = get_conf_word(d, where + PCI_SEC_LNKCTL3);
+  printf("\t\tLnkCtl3: LnkEquIntrruptEn%c, PerformEqu%c\n",
+       FLAG(ctrl3, PCI_SEC_LNKCTL3_LNK_EQU_REQ_INTR_EN),
+       FLAG(ctrl3, PCI_SEC_LNKCTL3_PERFORM_LINK_EQU));
+
+  lane_err_stat = get_conf_word(d, where + PCI_SEC_LANE_ERR);
+  printf("\t\tLaneErrStat: ");
+  if (lane_err_stat)
+    {
+      printf("LaneErr at Lane:");
+      for (lane = 0; lane_err_stat; lane_err_stat >>= 1, lane += 1)
+        if (BITS(lane_err_stat, 0, 1))
+          printf(" %u", lane);
+    }
+  else
+    printf("0");
+  printf("\n");
+}
+
 static void
 cap_dsn(struct device *d, int where)
 {
@@ -864,7 +895,7 @@ show_ext_caps(struct device *d, int type)
            cap_ltr(d, where);
            break;
          case PCI_EXT_CAP_ID_SECPCI:
-           printf("Secondary PCI Express <?>\n");
+           cap_sec(d, where, type);
            break;
          case PCI_EXT_CAP_ID_PMUX:
            printf("Protocol Multiplexing <?>\n");