summaryrefslogtreecommitdiffstats
path: root/drivers/cxl/bus.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2021-02-16 20:09:52 -0800
committerDan Williams <dan.j.williams@intel.com>2021-02-16 20:36:38 -0800
commitb39cb1052a5cf41bc12201ec1c0ddae5cb8be868 (patch)
tree13079eddea29561e8e20cd7f388e143ec97494ca /drivers/cxl/bus.c
parent8adaf747c9f0b470aea1b0c88583aa0a344e1540 (diff)
downloadlinux-stable-b39cb1052a5cf41bc12201ec1c0ddae5cb8be868.tar.gz
linux-stable-b39cb1052a5cf41bc12201ec1c0ddae5cb8be868.tar.bz2
linux-stable-b39cb1052a5cf41bc12201ec1c0ddae5cb8be868.zip
cxl/mem: Register CXL memX devices
Create the /sys/bus/cxl hierarchy to enumerate: * Memory Devices (per-endpoint control devices) * Memory Address Space Devices (platform address ranges with interleaving, performance, and persistence attributes) * Memory Regions (active provisioned memory from an address space device that is in use as System RAM or delegated to libnvdimm as Persistent Memory regions). For now, only the per-endpoint control devices are registered on the 'cxl' bus. However, going forward it will provide a mechanism to coordinate cross-device interleave. Signed-off-by: Ben Widawsky <ben.widawsky@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> (v2) Link: https://lore.kernel.org/r/20210217040958.1354670-4-ben.widawsky@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/bus.c')
-rw-r--r--drivers/cxl/bus.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/cxl/bus.c b/drivers/cxl/bus.c
new file mode 100644
index 000000000000..58f74796d525
--- /dev/null
+++ b/drivers/cxl/bus.c
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright(c) 2020 Intel Corporation. All rights reserved. */
+#include <linux/device.h>
+#include <linux/module.h>
+
+/**
+ * DOC: cxl bus
+ *
+ * The CXL bus provides namespace for control devices and a rendezvous
+ * point for cross-device interleave coordination.
+ */
+struct bus_type cxl_bus_type = {
+ .name = "cxl",
+};
+EXPORT_SYMBOL_GPL(cxl_bus_type);
+
+static __init int cxl_bus_init(void)
+{
+ return bus_register(&cxl_bus_type);
+}
+
+static void cxl_bus_exit(void)
+{
+ bus_unregister(&cxl_bus_type);
+}
+
+module_init(cxl_bus_init);
+module_exit(cxl_bus_exit);
+MODULE_LICENSE("GPL v2");