From: Jaxon Haws Date: Mon, 24 Oct 2022 17:51:54 +0000 (-0500) Subject: lspci: Add support for Non-CXL Function Map DVSEC X-Git-Tag: v3.9.0~9^2~1 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ec4cd47b17c9547612f70f39887eec5cb7e6302f;p=pciutils.git lspci: Add support for Non-CXL Function Map DVSEC Add Non-CXL Function Map DVSEC Registers 0-7 decoding according to DVSEC Revision ID 0. Signed-off-by: Jaxon Haws --- diff --git a/lib/header.h b/lib/header.h index 84600b5..63ee03c 100644 --- a/lib/header.h +++ b/lib/header.h @@ -1198,6 +1198,17 @@ #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 */ diff --git a/ls-ecaps.c b/ls-ecaps.c index b4e6a63..df41626 100644 --- a/ls-ecaps.c +++ b/ls-ecaps.c @@ -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);