Skip to content

Commit 21cd921

Browse files
zaidal-ampererafaeljw
authored andcommitted
ACPI: APEI: EINJ: Add einjv2 extension struct
Add einjv2 extension struct and EINJv2 error types to prepare the driver for EINJv2 support. ACPI specifications[1] enables EINJv2 by extending set_error_type_with_address struct. Link: https://uefi.org/specs/ACPI/6.6/18_Platform_Error_Interfaces.html#einjv2-extension-structure [1] Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Zaid Alali <zaidal@os.amperecomputing.com> Link: https://patch.msgid.link/20250617193026.637510-4-zaidal@os.amperecomputing.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0c6176e commit 21cd921

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

drivers/acpi/apei/einj-core.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#define SLEEP_UNIT_MAX 5000 /* 5ms */
3434
/* Firmware should respond within 1 seconds */
3535
#define FIRMWARE_TIMEOUT (1 * USEC_PER_SEC)
36+
#define COMPONENT_LEN 16
3637
#define ACPI65_EINJV2_SUPP BIT(30)
3738
#define ACPI5_VENDOR_BIT BIT(31)
3839
#define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \
@@ -50,6 +51,28 @@
5051
*/
5152
static int acpi5;
5253

54+
struct syndrome_array {
55+
union {
56+
u8 acpi_id[COMPONENT_LEN];
57+
u8 device_id[COMPONENT_LEN];
58+
u8 pcie_sbdf[COMPONENT_LEN];
59+
u8 vendor_id[COMPONENT_LEN];
60+
} comp_id;
61+
union {
62+
u8 proc_synd[COMPONENT_LEN];
63+
u8 mem_synd[COMPONENT_LEN];
64+
u8 pcie_synd[COMPONENT_LEN];
65+
u8 vendor_synd[COMPONENT_LEN];
66+
} comp_synd;
67+
};
68+
69+
struct einjv2_extension_struct {
70+
u32 length;
71+
u16 revision;
72+
u16 component_arr_count;
73+
struct syndrome_array component_arr[] __counted_by(component_arr_count);
74+
};
75+
5376
struct set_error_type_with_address {
5477
u32 type;
5578
u32 vendor_extension;
@@ -58,6 +81,7 @@ struct set_error_type_with_address {
5881
u64 memory_address;
5982
u64 memory_address_range;
6083
u32 pcie_sbdf;
84+
struct einjv2_extension_struct einjv2_struct;
6185
};
6286
enum {
6387
SETWA_FLAGS_APICID = 1,

0 commit comments

Comments
 (0)