aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2021-09-08 22:11:58 -0700
committerDan Williams <dan.j.williams@intel.com>2021-09-21 13:44:56 -0700
commit540ccaa2e4dd6d44dcd9305a007078fda597af02 (patch)
tree289f3968d339ac3bb0a8face1cfe1a3d5dbf277a /drivers/nvdimm
parent999c993a85f1cab8c37752db71b1f841a5d2c190 (diff)
downloadlinux-540ccaa2e4dd6d44dcd9305a007078fda597af02.tar.gz
libnvdimm/label: Define CXL region labels
Add a definition of the CXL 2.0 region label format. Note this is done as a separate patch to make the next patch that adds namespace label support easier to read. Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/163116431893.2460985.4003511000574373922.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/label.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/nvdimm/label.h b/drivers/nvdimm/label.h
index 7fa757d478464..0519aacc29263 100644
--- a/drivers/nvdimm/label.h
+++ b/drivers/nvdimm/label.h
@@ -67,6 +67,38 @@ struct nd_namespace_index {
};
/**
+ * struct cxl_region_label - CXL 2.0 Table 211
+ * @type: uuid identifying this label format (region)
+ * @uuid: uuid for the region this label describes
+ * @flags: NSLABEL_FLAG_UPDATING (all other flags reserved)
+ * @nlabel: 1 per interleave-way in the region
+ * @position: this label's position in the set
+ * @dpa: start address in device-local capacity for this label
+ * @rawsize: size of this label's contribution to region
+ * @hpa: mandatory system physical address to map this region
+ * @slot: slot id of this label in label area
+ * @ig: interleave granularity (1 << @ig) * 256 bytes
+ * @align: alignment in SZ_256M blocks
+ * @reserved: reserved
+ * @checksum: fletcher64 sum of this label
+ */
+struct cxl_region_label {
+ u8 type[NSLABEL_UUID_LEN];
+ u8 uuid[NSLABEL_UUID_LEN];
+ __le32 flags;
+ __le16 nlabel;
+ __le16 position;
+ __le64 dpa;
+ __le64 rawsize;
+ __le64 hpa;
+ __le32 slot;
+ __le32 ig;
+ __le32 align;
+ u8 reserved[0xac];
+ __le64 checksum;
+};
+
+/**
* struct nd_namespace_label - namespace superblock
* @uuid: UUID per RFC 4122
* @name: optional name (NULL-terminated)