1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2023 Intel Corporation. */
3 #ifndef _LINUX_CXL_EVENT_H
4 #define _LINUX_CXL_EVENT_H
7 * Common Event Record Format
8 * CXL rev 3.0 section 8.2.9.2.1; Table 8-42
10 struct cxl_event_record_hdr {
14 __le16 related_handle;
20 #define CXL_EVENT_RECORD_DATA_LENGTH 0x50
21 struct cxl_event_generic {
22 struct cxl_event_record_hdr hdr;
23 u8 data[CXL_EVENT_RECORD_DATA_LENGTH];
27 * General Media Event Record
28 * CXL rev 3.0 Section 8.2.9.2.1.1; Table 8-43
30 #define CXL_EVENT_GEN_MED_COMP_ID_SIZE 0x10
31 struct cxl_event_gen_media {
32 struct cxl_event_record_hdr hdr;
41 u8 component_id[CXL_EVENT_GEN_MED_COMP_ID_SIZE];
46 * DRAM Event Record - DER
47 * CXL rev 3.0 section 8.2.9.2.1.2; Table 3-44
49 #define CXL_EVENT_DER_CORRECTION_MASK_SIZE 0x20
50 struct cxl_event_dram {
51 struct cxl_event_record_hdr hdr;
64 u8 correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE];
69 * Get Health Info Record
70 * CXL rev 3.0 section 8.2.9.8.3.1; Table 8-100
72 struct cxl_get_health_info {
78 u8 dirty_shutdown_cnt[4];
79 u8 cor_vol_err_cnt[4];
80 u8 cor_per_err_cnt[4];
84 * Memory Module Event Record
85 * CXL rev 3.0 section 8.2.9.2.1.3; Table 8-45
87 struct cxl_event_mem_module {
88 struct cxl_event_record_hdr hdr;
90 struct cxl_get_health_info info;
95 struct cxl_event_generic generic;
96 struct cxl_event_gen_media gen_media;
97 struct cxl_event_dram dram;
98 struct cxl_event_mem_module mem_module;
102 * Common Event Record Format; in event logs
103 * CXL rev 3.0 section 8.2.9.2.1; Table 8-42
105 struct cxl_event_record_raw {
107 union cxl_event event;
110 enum cxl_event_type {
111 CXL_CPER_EVENT_GENERIC,
112 CXL_CPER_EVENT_GEN_MEDIA,
114 CXL_CPER_EVENT_MEM_MODULE,
117 #define CPER_CXL_DEVICE_ID_VALID BIT(0)
118 #define CPER_CXL_DEVICE_SN_VALID BIT(1)
119 #define CPER_CXL_COMP_EVENT_LOG_VALID BIT(2)
120 struct cxl_cper_event_rec {
124 struct cper_cxl_event_devid {
131 u16 slot_num; /* bits 2:0 reserved */
133 } __packed device_id;
134 struct cper_cxl_event_sn {
137 } __packed dev_serial_num;
140 union cxl_event event;
143 #endif /* _LINUX_CXL_EVENT_H */