forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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), and 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. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
- Loading branch information
1 parent
8f881aa
commit 69b8720
Showing
5 changed files
with
359 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
obj-$(CONFIG_CXL_ACPI) += cxl_acpi.o | ||
obj-$(CONFIG_CXL_MEM) += cxl_mem.o | ||
obj-$(CONFIG_CXL_BUS_PROVIDER) += cxl_bus.o | ||
|
||
ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=CXL | ||
cxl_acpi-y := acpi.o | ||
cxl_mem-y := mem.o | ||
cxl_bus-y := bus.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
// Copyright(c) 2020 Intel Corporation. All rights reserved. | ||
#include <linux/device.h> | ||
#include <linux/module.h> | ||
|
||
static struct bus_type cxl_bus_type = { | ||
.name = "cxl", | ||
}; | ||
|
||
int cxl_register(struct device *dev) | ||
{ | ||
int rc; | ||
|
||
dev->bus = &cxl_bus_type; | ||
rc = device_add(dev); | ||
if (rc) | ||
put_device(dev); | ||
return rc; | ||
} | ||
EXPORT_SYMBOL_GPL(cxl_register); | ||
|
||
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"); | ||
MODULE_AUTHOR("Intel Corporation"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
// Copyright(c) 2020 Intel Corporation. All rights reserved. | ||
#ifndef __CXL_BUS_H__ | ||
#define __CXL_BUS_H__ | ||
|
||
int cxl_register(struct device *dev); | ||
|
||
#endif /* __CXL_BUS_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.