diff options
author | Shelly Chang <Shelly_Chang@wiwynn.com> | 2022-04-11 10:50:40 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-05-22 12:47:33 +0000 |
commit | e17fc5dc0b2e398f0b434a871949f47c1bfa0329 (patch) | |
tree | 19c7acf5f7ad838ce3e254c09b85d2c77c916a2d /src/drivers/ocp | |
parent | 930dbc0d0428e4e7726bd6f23acd3f5115dd85be (diff) |
drivers/ocp/ewl: Add sending Meta's BMC SEL for memory training error
Add sending Meta's BMC SEL for memory training error occurred in EWL
type 3 error.
The detail definition of EWL (Enhanced Warning Log) can be found in the
specification document -- BIOS Data ACPI Table (BDAT) Interface
Specification v4.0 Draft 5:
https://uefi.org/sites/default/files/resources/BDAT%20Specification%20v4.0%20Draft5_0.pdf
Change-Id: I664e9d3da7910b47260881c0df64159c8dbe2dca
Signed-off-by: Shelly Chang <Shelly_Chang@wiwynn.com>
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69147
Reviewed-by: Jonathan Zhang <jon.zhixiong.zhang@gmail.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/ocp')
-rw-r--r-- | src/drivers/ocp/ewl/ewl.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/drivers/ocp/ewl/ewl.c b/src/drivers/ocp/ewl/ewl.c index 871981a28b..244634bcf9 100644 --- a/src/drivers/ocp/ewl/ewl.c +++ b/src/drivers/ocp/ewl/ewl.c @@ -2,8 +2,38 @@ #include <soc/soc_util.h> #include <lib.h> +#include <drivers/ipmi/ocp/ipmi_ocp.h> #include "ocp_ewl.h" +static void ipmi_send_sel_ewl_type3_err(EWL_ENTRY_HEADER *header, + EWL_ENTRY_MEMORY_LOCATION memory_location) +{ + struct ipmi_sel_mem_err sel; + uint8_t socketid; + EWL_ENTRY_TYPE3 *basic_warning; + basic_warning = (EWL_ENTRY_TYPE3 *)header; + + /* Ignore invalid EWL DIMM location before sending SEL */ + if (memory_location.Channel == 0xff || memory_location.Dimm == 0xff) + return; + memset(&sel, 0, sizeof(struct ipmi_sel_mem_err)); + sel.record_id = 0x0000; + sel.record_type = 0xfb; + sel.general_info = SEL_INTEL_MEMORY_ERROR; + sel.timestamp = 0; + socketid = get_blade_id() - 1; + sel.socket = socketid <<= 4; + sel.channel = memory_location.Channel; + sel.dimm_slot = memory_location.Dimm; + sel.rsvd1 = 0xff; + sel.dimm_failure_type = MEM_TRAINING_ERR; + sel.major_code = basic_warning->Context.MajorWarningCode; + sel.minor_code = basic_warning->Context.MinorWarningCode; + sel.rsvd2 = 0xff; + ipmi_send_to_bmc((unsigned char *)&sel, sizeof(sel)); + printk(BIOS_DEBUG, "ipmi send memory training error\n"); +} + static void process_ewl_type3(EWL_ENTRY_HEADER *header, EWL_ENTRY_MEMORY_LOCATION memory_location) { /* Treat warning as type 3, collect basic information and print to serial log */ @@ -47,6 +77,7 @@ void get_ewl(void) type3 = (EWL_ENTRY_TYPE3 *)warning_header; process_ewl_type3(warning_header, type3->MemoryLocation); type3_flag = 1; + ipmi_send_sel_ewl_type3_err(warning_header, type3->MemoryLocation); } else { printk(BIOS_DEBUG, "EWL type: %d size:%d severity level:%d\n", warning_header->Type, |