forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
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) * 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 <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> (v2) Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
- Loading branch information
Showing
6 changed files
with
349 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
What: /sys/bus/cxl/devices/memX/firmware_version | ||
Date: December, 2020 | ||
KernelVersion: v5.12 | ||
Contact: [email protected] | ||
Description: | ||
(RO) "FW Revision" string as reported by the Identify | ||
Memory Device Output Payload in the CXL-2.0 | ||
specification. | ||
|
||
What: /sys/bus/cxl/devices/memX/ram/size | ||
Date: December, 2020 | ||
KernelVersion: v5.12 | ||
Contact: [email protected] | ||
Description: | ||
(RO) "Volatile Only Capacity" as bytes. Represents the | ||
identically named field in the Identify Memory Device Output | ||
Payload in the CXL-2.0 specification. | ||
|
||
What: /sys/bus/cxl/devices/memX/pmem/size | ||
Date: December, 2020 | ||
KernelVersion: v5.12 | ||
Contact: [email protected] | ||
Description: | ||
(RO) "Persistent Only Capacity" as bytes. Represents the | ||
identically named field in the Identify Memory Device Output | ||
Payload in the CXL-2.0 specification. |
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
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,4 +1,7 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
obj-$(CONFIG_CXL_BUS) += cxl_bus.o | ||
obj-$(CONFIG_CXL_MEM) += cxl_mem.o | ||
|
||
ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=CXL | ||
cxl_bus-y := bus.o | ||
cxl_mem-y := mem.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,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"); |
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.