]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
lspci: Add support for Non-CXL Function Map DVSEC
authorJaxon Haws <jaxon.haws@amd.com>
Mon, 24 Oct 2022 17:51:54 +0000 (12:51 -0500)
committerJaxon Haws <jaxon.haws@amd.com>
Wed, 16 Nov 2022 18:32:22 +0000 (12:32 -0600)
Add Non-CXL Function Map DVSEC Registers 0-7 decoding according to
DVSEC Revision ID 0.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
lib/header.h
ls-ecaps.c

index 84600b5e18ddefe0ecb7e99c58aa8327cf730281..63ee03c895a7e15e97b181615096f0028bb992c6 100644 (file)
 #define PCI_CXL_MLD_NUM_LD  0xa
 #define PCI_CXL_MLD_MAX_LD  0x10
 
+/* PCIe CXL Designated Vendor-Specific Capabilities for Non-CXL Function Map */
+#define PCI_CXL_FUN_MAP_LEN     0x2c
+#define PCI_CXL_FUN_MAP_REG_0   0x0c
+#define PCI_CXL_FUN_MAP_REG_1   0x10
+#define PCI_CXL_FUN_MAP_REG_2   0x14
+#define PCI_CXL_FUN_MAP_REG_3   0x18
+#define PCI_CXL_FUN_MAP_REG_4   0x1c
+#define PCI_CXL_FUN_MAP_REG_5   0x20
+#define PCI_CXL_FUN_MAP_REG_6   0x24
+#define PCI_CXL_FUN_MAP_REG_7   0x28
+
 /* Access Control Services */
 #define PCI_ACS_CAP            0x04    /* ACS Capability Register */
 #define PCI_ACS_CAP_VALID      0x0001  /* ACS Source Validation */
index b4e6a630ee05e2eb71f9b62986bd27ad9f2b1cbc..df41626f69e1ffdba001285d6087903cdde00c1b 100644 (file)
@@ -1026,6 +1026,35 @@ dvsec_cxl_mld(struct device *d, int where)
     printf("\t\tNumLogDevs: %d\n", w);
 }
 
+static void
+dvsec_cxl_function_map(struct device *d, int where)
+{
+
+  printf("\t\tFuncMap 0: %08x\n",
+      (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_0)));
+
+  printf("\t\tFuncMap 1: %08x\n",
+    (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_1)));
+
+  printf("\t\tFuncMap 2: %08x\n",
+    (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_2)));
+
+  printf("\t\tFuncMap 3: %08x\n",
+      (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_3)));
+
+  printf("\t\tFuncMap 4: %08x\n",
+      (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_4)));
+
+  printf("\t\tFuncMap 5: %08x\n",
+      (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_5)));
+
+  printf("\t\tFuncMap 6: %08x\n",
+      (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_6)));
+
+  printf("\t\tFuncMap 7: %08x\n",
+      (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_7)));
+}
+
 static void
 cap_dvsec_cxl(struct device *d, int id, int rev, int where, int len)
 {
@@ -1042,7 +1071,7 @@ cap_dvsec_cxl(struct device *d, int id, int rev, int where, int len)
       dvsec_cxl_device(d, rev, where, len);
       break;
     case 2:
-      printf("\t\tNon-CXL Function Map DVSEC\n");
+      dvsec_cxl_function_map(d, where);
       break;
     case 3:
       dvsec_cxl_port(d, where, len);