summaryrefslogtreecommitdiff
path: root/tools/testing/cxl/test/mock.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2023-02-14 11:41:30 -0800
committerDan Williams <dan.j.williams@intel.com>2023-02-14 15:45:21 -0800
commit4474ce565ee4490fb4e6d8443b617a9d98ae10ff (patch)
tree6e95405cb64326700e8af5863425cc9e4ce494d7 /tools/testing/cxl/test/mock.h
parentb777e9bec960a29374dc486d47784c73b7ac4cef (diff)
downloadlwn-4474ce565ee4490fb4e6d8443b617a9d98ae10ff.tar.gz
lwn-4474ce565ee4490fb4e6d8443b617a9d98ae10ff.zip
cxl/hdm: Create emulated cxl_hdm for devices that do not have HDM decoders
CXL rev3 spec 8.1.3 RCDs may not have HDM register blocks. Create a fake HDM with information from the CXL PCIe DVSEC registers. The decoder count will be set to the HDM count retrieved from the DVSEC cap register. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/167640368994.935665.15831225724059704620.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl/test/mock.h')
-rw-r--r--tools/testing/cxl/test/mock.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/cxl/test/mock.h b/tools/testing/cxl/test/mock.h
index e377ced5f1b3..bef8817b01f2 100644
--- a/tools/testing/cxl/test/mock.h
+++ b/tools/testing/cxl/test/mock.h
@@ -23,7 +23,8 @@ struct cxl_mock_ops {
bool (*is_mock_port)(struct device *dev);
bool (*is_mock_dev)(struct device *dev);
int (*devm_cxl_port_enumerate_dports)(struct cxl_port *port);
- struct cxl_hdm *(*devm_cxl_setup_hdm)(struct cxl_port *port);
+ struct cxl_hdm *(*devm_cxl_setup_hdm)(
+ struct cxl_port *port, struct cxl_endpoint_dvsec_info *info);
int (*devm_cxl_add_passthrough_decoder)(struct cxl_port *port);
int (*devm_cxl_enumerate_decoders)(
struct cxl_hdm *hdm, struct cxl_endpoint_dvsec_info *info);