aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/cxl/test/mock.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2022-02-01 12:24:30 -0800
committerDan Williams <dan.j.williams@intel.com>2022-02-08 22:57:30 -0800
commitd17d0540a0dbf109210f7b57a37571e2978da0fa (patch)
treed7f969f8c73c1134c480484ebb13a72a2950769e /tools/testing/cxl/test/mock.h
parentcxl/core: Generalize dport enumeration in the core (diff)
downloadlinux-dev-d17d0540a0dbf109210f7b57a37571e2978da0fa.tar.xz
linux-dev-d17d0540a0dbf109210f7b57a37571e2978da0fa.zip
cxl/core/hdm: Add CXL standard decoder enumeration to the core
Unlike the decoder enumeration for "root decoders" described by platform firmware, standard decoders can be enumerated from the component registers space once the base address has been identified (via PCI, ACPI, or another mechanism). Add common infrastructure for HDM (Host-managed-Device-Memory) Decoder enumeration and share it between host-bridge, upstream switch port, and cxl_test defined decoders. The locking model for switch level decoders is to hold the port lock over the enumeration. This facilitates moving the dport and decoder enumeration to a 'port' driver. For now, the only enumerator of decoder resources is the cxl_acpi root driver. Co-developed-by: Ben Widawsky <ben.widawsky@intel.com> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/164374688404.395335.9239248252443123526.stgit@dwillia2-desk3.amr.corp.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, 3 insertions, 0 deletions
diff --git a/tools/testing/cxl/test/mock.h b/tools/testing/cxl/test/mock.h
index 99e7ff38090d..15e48063ea4b 100644
--- a/tools/testing/cxl/test/mock.h
+++ b/tools/testing/cxl/test/mock.h
@@ -21,6 +21,9 @@ struct cxl_mock_ops {
bool (*is_mock_dev)(struct device *dev);
int (*devm_cxl_port_enumerate_dports)(struct device *host,
struct cxl_port *port);
+ struct cxl_hdm *(*devm_cxl_setup_hdm)(struct device *host, struct cxl_port *port);
+ int (*devm_cxl_add_passthrough_decoder)(struct device *host, struct cxl_port *port);
+ int (*devm_cxl_enumerate_decoders)(struct device *host, struct cxl_hdm *hdm);
};
void register_cxl_mock_ops(struct cxl_mock_ops *ops);