1f08c3bdfSopenharmony_ci/* 2f08c3bdfSopenharmony_ci * cper.h - UEFI Common Platform Error Record 3f08c3bdfSopenharmony_ci * 4f08c3bdfSopenharmony_ci * Copyright (C) 2009, Intel Corp. 5f08c3bdfSopenharmony_ci * Author: Huang Ying <ying.huang@intel.com> 6f08c3bdfSopenharmony_ci * 7f08c3bdfSopenharmony_ci * This file is released under the GPLv2. 8f08c3bdfSopenharmony_ci */ 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_ci#ifndef ACPI_CPER_H 11f08c3bdfSopenharmony_ci#define ACPI_CPER_H 12f08c3bdfSopenharmony_ci 13f08c3bdfSopenharmony_ci#include "uuid.h" 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci#define CPER_SER_RECOVERABLE 0x0 16f08c3bdfSopenharmony_ci#define CPER_SER_FATAL 0x1 17f08c3bdfSopenharmony_ci#define CPER_SER_CORRECTED 0x2 18f08c3bdfSopenharmony_ci#define CPER_SER_INFORMATIONAL 0x3 19f08c3bdfSopenharmony_ci 20f08c3bdfSopenharmony_ci#define CPER_VALID_PLATFORM_ID 0x0001 21f08c3bdfSopenharmony_ci#define CPER_VALID_TIMESTAMP 0x0002 22f08c3bdfSopenharmony_ci#define CPER_VALID_PARTITION_ID 0x0004 23f08c3bdfSopenharmony_ci 24f08c3bdfSopenharmony_ci#define CPER_HW_ERROR_FLAGS_RECOVERED 0x1 25f08c3bdfSopenharmony_ci#define CPER_HW_ERROR_FLAGS_PREVERR 0x2 26f08c3bdfSopenharmony_ci#define CPER_HW_ERROR_FLAGS_SIMULATED 0x4 27f08c3bdfSopenharmony_ci 28f08c3bdfSopenharmony_ci#define CPER_SEC_VALID_FRU_ID 0x1 29f08c3bdfSopenharmony_ci#define CPER_SEC_VALID_FRU_STRING 0x2 30f08c3bdfSopenharmony_ci 31f08c3bdfSopenharmony_ci#define CPER_SEC_PRIMARY 0x0001 32f08c3bdfSopenharmony_ci#define CPER_SEC_CONTAINMENT_WARNING 0x0002 33f08c3bdfSopenharmony_ci#define CPER_SEC_RESET 0x0004 34f08c3bdfSopenharmony_ci#define CPER_SEC_ERROR_THRESHOLD_EXCEEDED 0x0008 35f08c3bdfSopenharmony_ci#define CPER_SEC_RESOURCE_NOT_ACCESSIBLE 0x0010 36f08c3bdfSopenharmony_ci#define CPER_SEC_LATENT_ERROR 0x0020 37f08c3bdfSopenharmony_ci 38f08c3bdfSopenharmony_ci#define CPER_SIG_RECORD "REPC" 39f08c3bdfSopenharmony_ci 40f08c3bdfSopenharmony_ci#define CPER_SIG_SIZE 4 41f08c3bdfSopenharmony_ci 42f08c3bdfSopenharmony_ci#define CPER_NOTIFY_CMC \ 43f08c3bdfSopenharmony_ci LGUID(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ 44f08c3bdfSopenharmony_ci 0xEB, 0xD4, 0xF8, 0x90) 45f08c3bdfSopenharmony_ci#define CPER_NOTIFY_CPE \ 46f08c3bdfSopenharmony_ci LGUID(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \ 47f08c3bdfSopenharmony_ci 0xF2, 0x7E, 0xBE, 0xEE) 48f08c3bdfSopenharmony_ci#define CPER_NOTIFY_MCE \ 49f08c3bdfSopenharmony_ci LGUID(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \ 50f08c3bdfSopenharmony_ci 0xE1, 0x49, 0x13, 0xBB) 51f08c3bdfSopenharmony_ci#define CPER_NOTIFY_PCIE \ 52f08c3bdfSopenharmony_ci LGUID(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \ 53f08c3bdfSopenharmony_ci 0xAF, 0x67, 0xC1, 0x04) 54f08c3bdfSopenharmony_ci#define CPER_NOTIFY_INIT \ 55f08c3bdfSopenharmony_ci LGUID(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \ 56f08c3bdfSopenharmony_ci 0xD3, 0x9B, 0xC9, 0x8E) 57f08c3bdfSopenharmony_ci#define CPER_NOTIFY_NMI \ 58f08c3bdfSopenharmony_ci LGUID(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \ 59f08c3bdfSopenharmony_ci 0x85, 0xD6, 0xE9, 0x8A) 60f08c3bdfSopenharmony_ci#define CPER_NOTIFY_BOOT \ 61f08c3bdfSopenharmony_ci LGUID(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \ 62f08c3bdfSopenharmony_ci 0xD4, 0x64, 0xB3, 0x8F) 63f08c3bdfSopenharmony_ci#define CPER_NOTIFY_DMAR \ 64f08c3bdfSopenharmony_ci LGUID(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \ 65f08c3bdfSopenharmony_ci 0x72, 0x2D, 0xEB, 0x41) 66f08c3bdfSopenharmony_ci 67f08c3bdfSopenharmony_ci#define CPER_SEC_PROC_GENERIC \ 68f08c3bdfSopenharmony_ci LGUID(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ 69f08c3bdfSopenharmony_ci 0x93, 0xC4, 0xF3, 0xDB) 70f08c3bdfSopenharmony_ci#define CPER_SEC_PROC_IA \ 71f08c3bdfSopenharmony_ci LGUID(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \ 72f08c3bdfSopenharmony_ci 0x24, 0x2B, 0x6E, 0x1D) 73f08c3bdfSopenharmony_ci#define CPER_SEC_PROC_IPF \ 74f08c3bdfSopenharmony_ci LGUID(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \ 75f08c3bdfSopenharmony_ci 0x80, 0xC7, 0x3C, 0x88, 0x81) 76f08c3bdfSopenharmony_ci#define CPER_SEC_PLATFORM_MEM \ 77f08c3bdfSopenharmony_ci LGUID(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \ 78f08c3bdfSopenharmony_ci 0xED, 0x7C, 0x83, 0xB1) 79f08c3bdfSopenharmony_ci#define CPER_SEC_PCIE \ 80f08c3bdfSopenharmony_ci LGUID(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \ 81f08c3bdfSopenharmony_ci 0xCB, 0x3C, 0x6F, 0x35) 82f08c3bdfSopenharmony_ci#define CPER_SEC_FW_ERR_REC_REF \ 83f08c3bdfSopenharmony_ci LGUID(0x81212A96, 0x09ED, 0x4996, 0x94, 0x71, 0x8D, 0x72, \ 84f08c3bdfSopenharmony_ci 0x9C, 0x8E, 0x69, 0xED) 85f08c3bdfSopenharmony_ci#define CPER_SEC_PCI_X_BUS \ 86f08c3bdfSopenharmony_ci LGUID(0xC5753963, 0x3B84, 0x4095, 0xBF, 0x78, 0xED, 0xDA, \ 87f08c3bdfSopenharmony_ci 0xD3, 0xF9, 0xC9, 0xDD) 88f08c3bdfSopenharmony_ci#define CPER_SEC_PCI_DEV \ 89f08c3bdfSopenharmony_ci LGUID(0xEB5E4685, 0xCA66, 0x4769, 0xB6, 0xA2, 0x26, 0x06, \ 90f08c3bdfSopenharmony_ci 0x8B, 0x00, 0x13, 0x26) 91f08c3bdfSopenharmony_ci#define CPER_SEC_DMAR_GENERIC \ 92f08c3bdfSopenharmony_ci LGUID(0x5B51FEF7, 0xC79D, 0x4434, 0x8F, 0x1B, 0xAA, 0x62, \ 93f08c3bdfSopenharmony_ci 0xDE, 0x3E, 0x2C, 0x64) 94f08c3bdfSopenharmony_ci#define CPER_SEC_DMAR_VT \ 95f08c3bdfSopenharmony_ci LGUID(0x71761D37, 0x32B2, 0x45cd, 0xA7, 0xD0, 0xB0, 0xFE, \ 96f08c3bdfSopenharmony_ci 0xDD, 0x93, 0xE8, 0xCF) 97f08c3bdfSopenharmony_ci#define CPER_SEC_DMAR_IOMMU \ 98f08c3bdfSopenharmony_ci LGUID(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ 99f08c3bdfSopenharmony_ci 0xDF, 0xAA, 0x84, 0xEC) 100f08c3bdfSopenharmony_ci 101f08c3bdfSopenharmony_ci/* 102f08c3bdfSopenharmony_ci * All tables and structs must be byte-packed to match CPER 103f08c3bdfSopenharmony_ci * specification, since the tables are provided by the system BIOS 104f08c3bdfSopenharmony_ci */ 105f08c3bdfSopenharmony_ci#pragma pack(1) 106f08c3bdfSopenharmony_ci 107f08c3bdfSopenharmony_cistruct cper_record_header 108f08c3bdfSopenharmony_ci{ 109f08c3bdfSopenharmony_ci char signature[CPER_SIG_SIZE]; /* must be "REPC" */ 110f08c3bdfSopenharmony_ci __u16 revision; 111f08c3bdfSopenharmony_ci __u32 signature_end; /* must be 0xffffffff */ 112f08c3bdfSopenharmony_ci __u16 section_count; 113f08c3bdfSopenharmony_ci __u32 error_severity; 114f08c3bdfSopenharmony_ci __u32 validation_bits; 115f08c3bdfSopenharmony_ci __u32 record_length; 116f08c3bdfSopenharmony_ci __u64 timestamp; 117f08c3bdfSopenharmony_ci lguid_t platform_id; 118f08c3bdfSopenharmony_ci lguid_t partition_id; 119f08c3bdfSopenharmony_ci lguid_t creator_id; 120f08c3bdfSopenharmony_ci lguid_t notification_type; 121f08c3bdfSopenharmony_ci __u64 record_id; 122f08c3bdfSopenharmony_ci __u32 flags; 123f08c3bdfSopenharmony_ci __u64 persistence_information; 124f08c3bdfSopenharmony_ci __u8 reserved[12]; /* must be zero */ 125f08c3bdfSopenharmony_ci}; 126f08c3bdfSopenharmony_ci 127f08c3bdfSopenharmony_cistruct cper_section_descriptor 128f08c3bdfSopenharmony_ci{ 129f08c3bdfSopenharmony_ci __u32 section_offset; /* Offset in bytes of the 130f08c3bdfSopenharmony_ci * section body from the base 131f08c3bdfSopenharmony_ci * of the record header */ 132f08c3bdfSopenharmony_ci __u32 section_length; 133f08c3bdfSopenharmony_ci __u16 revision; 134f08c3bdfSopenharmony_ci __u8 validation_bits; 135f08c3bdfSopenharmony_ci __u8 reserved; /* must be zero */ 136f08c3bdfSopenharmony_ci __u32 flags; 137f08c3bdfSopenharmony_ci lguid_t section_type; 138f08c3bdfSopenharmony_ci lguid_t fru_id; 139f08c3bdfSopenharmony_ci __u32 section_severity; 140f08c3bdfSopenharmony_ci __u8 fru_text[20]; 141f08c3bdfSopenharmony_ci}; 142f08c3bdfSopenharmony_ci 143f08c3bdfSopenharmony_cistruct cper_sec_proc_generic 144f08c3bdfSopenharmony_ci{ 145f08c3bdfSopenharmony_ci __u64 validation_bits; 146f08c3bdfSopenharmony_ci __u8 proc_type; 147f08c3bdfSopenharmony_ci __u8 proc_isa; 148f08c3bdfSopenharmony_ci __u8 proc_error_type; 149f08c3bdfSopenharmony_ci __u8 operation; 150f08c3bdfSopenharmony_ci __u8 flags; 151f08c3bdfSopenharmony_ci __u8 level; 152f08c3bdfSopenharmony_ci __u16 reserved; 153f08c3bdfSopenharmony_ci __u64 cpu_version; 154f08c3bdfSopenharmony_ci char cpu_brand[128]; 155f08c3bdfSopenharmony_ci __u64 proc_id; 156f08c3bdfSopenharmony_ci __u64 target_addr; 157f08c3bdfSopenharmony_ci __u64 requestor_id; 158f08c3bdfSopenharmony_ci __u64 responder_id; 159f08c3bdfSopenharmony_ci __u64 ip; 160f08c3bdfSopenharmony_ci}; 161f08c3bdfSopenharmony_ci 162f08c3bdfSopenharmony_cistruct cper_sec_proc_ia 163f08c3bdfSopenharmony_ci{ 164f08c3bdfSopenharmony_ci __u64 validation_bits; 165f08c3bdfSopenharmony_ci __u8 lapic_id; 166f08c3bdfSopenharmony_ci __u8 cpuid[48]; 167f08c3bdfSopenharmony_ci}; 168f08c3bdfSopenharmony_ci 169f08c3bdfSopenharmony_cistruct cper_ia_err_info 170f08c3bdfSopenharmony_ci{ 171f08c3bdfSopenharmony_ci lguid_t err_type; 172f08c3bdfSopenharmony_ci __u64 validation_bits; 173f08c3bdfSopenharmony_ci __u64 check_info; 174f08c3bdfSopenharmony_ci __u64 target_id; 175f08c3bdfSopenharmony_ci __u64 requestor_id; 176f08c3bdfSopenharmony_ci __u64 responder_id; 177f08c3bdfSopenharmony_ci __u64 ip; 178f08c3bdfSopenharmony_ci}; 179f08c3bdfSopenharmony_ci 180f08c3bdfSopenharmony_cistruct cper_ia_proc_ctx 181f08c3bdfSopenharmony_ci{ 182f08c3bdfSopenharmony_ci __u16 reg_ctx_type; 183f08c3bdfSopenharmony_ci __u16 reg_arr_size; 184f08c3bdfSopenharmony_ci __u32 msr_addr; 185f08c3bdfSopenharmony_ci __u64 mm_reg_addr; 186f08c3bdfSopenharmony_ci}; 187f08c3bdfSopenharmony_ci 188f08c3bdfSopenharmony_cistruct cper_sec_mem_err 189f08c3bdfSopenharmony_ci{ 190f08c3bdfSopenharmony_ci __u64 validation_bits; 191f08c3bdfSopenharmony_ci __u64 error_status; 192f08c3bdfSopenharmony_ci __u64 physical_addr; 193f08c3bdfSopenharmony_ci __u64 physical_addr_mask; 194f08c3bdfSopenharmony_ci __u16 node; 195f08c3bdfSopenharmony_ci __u16 card; 196f08c3bdfSopenharmony_ci __u16 module; 197f08c3bdfSopenharmony_ci __u16 bank; 198f08c3bdfSopenharmony_ci __u16 device; 199f08c3bdfSopenharmony_ci __u16 row; 200f08c3bdfSopenharmony_ci __u16 column; 201f08c3bdfSopenharmony_ci __u16 bit_pos; 202f08c3bdfSopenharmony_ci __u64 requestor_id; 203f08c3bdfSopenharmony_ci __u64 responder_id; 204f08c3bdfSopenharmony_ci __u64 target_id; 205f08c3bdfSopenharmony_ci __u8 error_type; 206f08c3bdfSopenharmony_ci}; 207f08c3bdfSopenharmony_ci 208f08c3bdfSopenharmony_ci/* Reset to default packing */ 209f08c3bdfSopenharmony_ci#pragma pack() 210f08c3bdfSopenharmony_ci 211f08c3bdfSopenharmony_ci#endif 212