diff options
author | Dave Jiang <dave.jiang@intel.com> | 2023-02-14 22:41:24 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-02-15 02:45:21 +0300 |
commit | b777e9bec960a29374dc486d47784c73b7ac4cef (patch) | |
tree | 0d44be3bf53ba1d04929297e5955f380c26c59f6 /tools | |
parent | 9de321e93c3b3fd7fd2621a2557c42fa7d43e314 (diff) | |
download | linux-b777e9bec960a29374dc486d47784c73b7ac4cef.tar.xz |
cxl/hdm: Emulate HDM decoder from DVSEC range registers
In the case where HDM decoder register block exists but is not programmed
and at the same time the DVSEC range register range is active, populate the
CXL decoder object 'cxl_decoder' with info from DVSEC range registers.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/167640368454.935665.13806415120298330717.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/cxl/test/cxl.c | 3 | ||||
-rw-r--r-- | tools/testing/cxl/test/mock.c | 7 | ||||
-rw-r--r-- | tools/testing/cxl/test/mock.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c index 30ee680d38ff..3b4916adf29c 100644 --- a/tools/testing/cxl/test/cxl.c +++ b/tools/testing/cxl/test/cxl.c @@ -701,7 +701,8 @@ static int mock_decoder_reset(struct cxl_decoder *cxld) return 0; } -static int mock_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm) +static int mock_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm, + struct cxl_endpoint_dvsec_info *info) { struct cxl_port *port = cxlhdm->port; struct cxl_port *parent_port = to_cxl_port(port->dev.parent); diff --git a/tools/testing/cxl/test/mock.c b/tools/testing/cxl/test/mock.c index 2a13f4722891..3116c9f07c5d 100644 --- a/tools/testing/cxl/test/mock.c +++ b/tools/testing/cxl/test/mock.c @@ -162,16 +162,17 @@ int __wrap_devm_cxl_add_passthrough_decoder(struct cxl_port *port) } EXPORT_SYMBOL_NS_GPL(__wrap_devm_cxl_add_passthrough_decoder, CXL); -int __wrap_devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm) +int __wrap_devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm, + struct cxl_endpoint_dvsec_info *info) { int rc, index; struct cxl_port *port = cxlhdm->port; struct cxl_mock_ops *ops = get_cxl_mock_ops(&index); if (ops && ops->is_mock_port(port->uport)) - rc = ops->devm_cxl_enumerate_decoders(cxlhdm); + rc = ops->devm_cxl_enumerate_decoders(cxlhdm, info); else - rc = devm_cxl_enumerate_decoders(cxlhdm); + rc = devm_cxl_enumerate_decoders(cxlhdm, info); put_cxl_mock_ops(index); return rc; diff --git a/tools/testing/cxl/test/mock.h b/tools/testing/cxl/test/mock.h index ef33f159375e..e377ced5f1b3 100644 --- a/tools/testing/cxl/test/mock.h +++ b/tools/testing/cxl/test/mock.h @@ -25,7 +25,8 @@ struct cxl_mock_ops { int (*devm_cxl_port_enumerate_dports)(struct cxl_port *port); struct cxl_hdm *(*devm_cxl_setup_hdm)(struct cxl_port *port); int (*devm_cxl_add_passthrough_decoder)(struct cxl_port *port); - int (*devm_cxl_enumerate_decoders)(struct cxl_hdm *hdm); + int (*devm_cxl_enumerate_decoders)( + struct cxl_hdm *hdm, struct cxl_endpoint_dvsec_info *info); }; void register_cxl_mock_ops(struct cxl_mock_ops *ops); |