include/cper.h: Add CPER Memory Error Section definitions

Add Memory Error Section definitions from UEFI Specification rev 2.10
appendix N.2.5. The structure defined here may be used for machine
check handling.

Signed-off-by: Tim Chu <Tim.Chu@quantatw.com>
Change-Id: I0a165350a16a4cbe4033a3e7c43fa23a5b27c44b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69198
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/src/include/cper.h b/src/include/cper.h
index 576e1d8..af17785 100644
--- a/src/include/cper.h
+++ b/src/include/cper.h
@@ -370,6 +370,38 @@
 	u16 tr;
 } cper_ia32x64_ctx_x64state_t;
 
+/* UEFI Spec 2.10, Appendix N.2.5 Memory Error Types (Table N.31) */
+#define CPER_UNDEFINED			0
+#define CPER_ERR_SINGLE_BIT_ECC		2
+#define CPER_ERR_MULTI_BIT_ECC		3
+#define CPER_ERR_MEM_PARITY_ERR		8
+#define CPER_ERR_MEM_SCRUB_CE_ERR	13
+#define CPER_ERR_MEM_SCRUB_UCE_ERR	14
+
+/* UEFI Spec 2.10, Appendix N.2.5 Memory Error Section (Table N.31) */
+struct cper_memory_section {
+	u64	valid_bits;
+	u64	err_sts;
+	u64	phys_addr;
+	u64	phys_addr_mask;
+	u16	node;
+	u16	card;
+	u16	module;
+	u16	bank;
+	u16	device;
+	u16	row;
+	u16	column;
+	u16	bit_position;
+	u64	requestor_id;
+	u64	responder_id;
+	u64	target_id;
+	u8	mem_err_type;
+	u8	extended;
+	u16	rank_number;
+	u16	card_handle;
+	u16	module_handle;
+};
+
 #define FW_ERR_RECORD_ID_CRASHLOG_GUID				\
 	GUID_INIT(0x8f87f311, 0xc998, 0x4d9e,			\
 		0xa0, 0xc4, 0x60, 0x65, 0x51, 0x8c, 0x4f, 0x6d)