Attention is currently required from: Shelly Chang.
Hello Shelly Chang,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/69147
to review the following change.
Change subject: drivers/ocp/ewl: Add sending Meta's BMC SEL for memory training error ......................................................................
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.
Change-Id: I664e9d3da7910b47260881c0df64159c8dbe2dca Signed-off-by: Shelly Chang Shelly_Chang@wiwynn.com Signed-off-by: Johnny Lin johnny_lin@wiwynn.com --- M src/drivers/ipmi/ocp/Makefile.inc M src/drivers/ipmi/ocp/ipmi_ocp.h M src/drivers/ocp/ewl/ewl.c 3 files changed, 70 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/69147/1
diff --git a/src/drivers/ipmi/ocp/Makefile.inc b/src/drivers/ipmi/ocp/Makefile.inc index 2b492e1..3d5e69e 100644 --- a/src/drivers/ipmi/ocp/Makefile.inc +++ b/src/drivers/ipmi/ocp/Makefile.inc @@ -1,5 +1,5 @@ ramstage-$(CONFIG_IPMI_OCP) += ipmi_ocp.c ipmi_sel.c ifeq ($(CONFIG_IPMI_OCP),y) -romstage-$(CONFIG_IPMI_KCS_ROMSTAGE) += ipmi_ocp_romstage.c +romstage-$(CONFIG_IPMI_KCS_ROMSTAGE) += ipmi_ocp_romstage.c ipmi_sel.c smm-$(CONFIG_IPMI_BMC_SEL) += ipmi_sel.c endif diff --git a/src/drivers/ipmi/ocp/ipmi_ocp.h b/src/drivers/ipmi/ocp/ipmi_ocp.h index 571eafc..4bd2492 100644 --- a/src/drivers/ipmi/ocp/ipmi_ocp.h +++ b/src/drivers/ipmi/ocp/ipmi_ocp.h @@ -89,6 +89,16 @@ PCIE_ECRC_EVNT = 5, };
+enum sel_err_type { + MEM_TRAINING_ERR = 0, + MEM_CORR_ERR = 1, + MEM_UNCORR_ERR = 2, + MEM_CORR_ERR_PATROL = 3, + MEM_UNCORR_ERR_PATROL = 4, + MEM_PARITY_ERR = 5, + MEM_UNDEFINED = 0xF, +}; + struct ipmi_sel_pcie_dev_fail { uint16_t record_id; uint8_t record_type; @@ -102,6 +112,21 @@ uint8_t rsvd2; } __packed;
+struct ipmi_sel_mem_err { + uint16_t record_id; + uint8_t record_type; + uint8_t general_info; + uint32_t timestamp; + uint8_t socket; + uint8_t channel; + uint8_t dimm_slot; + uint8_t rsvd1; + uint8_t dimm_failure_type; + uint8_t major_code; + uint8_t minor_code; + uint8_t rsvd2; +} __packed; + struct ipmi_config_rsp { uint8_t board_sku_id; uint8_t board_rev_id; @@ -167,6 +192,8 @@ #define PERR_NON_AER 0xA0 #define SERR_NON_AER 0xA1
+#define INTEL_MEMORY_ERROR 0x21 + enum cb_err ipmi_set_post_start(const int port); enum cb_err ipmi_set_cmos_clear(void);
diff --git a/src/drivers/ocp/ewl/ewl.c b/src/drivers/ocp/ewl/ewl.c index d70a23f..5448c30 100644 --- a/src/drivers/ocp/ewl/ewl.c +++ b/src/drivers/ocp/ewl/ewl.c @@ -2,8 +2,35 @@
#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 = 0xff; + EWL_ENTRY_TYPE3 *basic_warning; + basic_warning = (EWL_ENTRY_TYPE3 *)header; + + memset(&sel, 0, sizeof(struct ipmi_sel_mem_err)); + sel.record_id = 0x0000; + sel.record_type = 0xfb; + sel.general_info = 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 */ @@ -44,6 +71,7 @@ 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,