From 153dcaa15050071e25b0177618ad0c9d829606e2 Mon Sep 17 00:00:00 2001 From: Roland Veloz Date: Tue, 13 Aug 2019 19:47:39 -0500 Subject: Implement an HBRT interface to log a gard event from PHYP/OPAL Added a firmware notify interface, gard_event_t, to accept a gard event message, from PHYP/OPAL, to log that event. Change-Id: I9bcf684f0850c9a07ab7d46635aa07a2c1e9917c RTC: 210201 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82199 Tested-by: Jenkins Server Reviewed-by: Matt Derksen Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Christian R Geddes Reviewed-by: Daniel M Crowell --- src/include/runtime/interface.h | 58 ++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 10 deletions(-) (limited to 'src/include/runtime/interface.h') diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index 9a0cb478e..152226d54 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -552,17 +552,18 @@ typedef struct hostInterfaces enum // hbrt_fw_msg::io_type the struct associated with io_type { - HBRT_FW_MSG_TYPE_REQ_NOP = 0, - HBRT_FW_MSG_TYPE_RESP_NOP = 1, // struct resp_generic - HBRT_FW_MSG_TYPE_RESP_GENERIC = 2, // struct resp_generic - HBRT_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3, // struct req_hcode_update - HBRT_FW_MSG_HBRT_FSP_REQ = 4, // struct GenericFspMboxMessage_t - HBRT_FW_MSG_TYPE_ERROR_LOG = 5, // struct error_log - HBRT_FW_MSG_HBRT_FSP_RESP = 6, // struct GenericFspMboxMessage_t - HBRT_FW_MSG_TYPE_I2C_LOCK = 7, // struct req_i2c_lock - HBRT_FW_MSG_TYPE_SBE_STATE = 8, // struct sbe_state - HBRT_FW_MSG_TYPE_NVDIMM_PROTECTION = 9, // struct nvdimm_protection_state + HBRT_FW_MSG_TYPE_REQ_NOP = 0, + HBRT_FW_MSG_TYPE_RESP_NOP = 1, // struct resp_generic + HBRT_FW_MSG_TYPE_RESP_GENERIC = 2, // struct resp_generic + HBRT_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3, // struct req_hcode_update + HBRT_FW_MSG_HBRT_FSP_REQ = 4, // struct GenericFspMboxMessage_t + HBRT_FW_MSG_TYPE_ERROR_LOG = 5, // struct error_log + HBRT_FW_MSG_HBRT_FSP_RESP = 6, // struct GenericFspMboxMessage_t + HBRT_FW_MSG_TYPE_I2C_LOCK = 7, // struct req_i2c_lock + HBRT_FW_MSG_TYPE_SBE_STATE = 8, // struct sbe_state + HBRT_FW_MSG_TYPE_NVDIMM_PROTECTION = 9, // struct nvdimm_protection_state HBRT_FW_MSG_TYPE_NVDIMM_OPERATION = 10, // struct nvdimm_operation_t + HBRT_FW_MSG_TYPE_GARD_EVENT = 11, // struct gard_event_t }; // NVDIMM protection state enum @@ -611,6 +612,39 @@ typedef struct hostInterfaces // see @note associated with NVDIMM_Op_t above } __attribute__ ((packed)); + // Gard event error type + // @note This needs to stay in sync with the FSP Mailbox specification for + // command : Gard-able Error Detected - cmd 0xCE, s/c 0x63, mod 01 + enum GARD_ERROR_t: uint32_t + { + HBRT_GARD_ERROR_UNKNOWN = 0x0000, + HBRT_GARD_ERROR_COMPUTATION_TEST_FAILURE = 0x0001, + HBRT_GARD_ERROR_SLB = 0x0002, + HBRT_GARD_ERROR_CHIP_TOD_FAILURE = 0x0003, + HBRT_GARD_ERROR_TIMEFAC_FAILURE = 0x0004, + HBRT_GARD_ERROR_PROC_RECOVERY_THRESHOLD = 0x0005, + HBRT_GARD_ERROR_NX = 0x0008, + HBRT_GARD_ERROR_SLW = 0x0009, + HBRT_GARD_ERROR_CAPP_UNIT = 0x000A, + + // Mark the end of the gard error types. + // This is not valid, just a marker + HBRT_GARD_ERROR_LAST, + }; + + // Gard event (PHYP/OPAL -> HBRT) + struct gard_event_t + { + GARD_ERROR_t i_error_type; // Gard event error type enum + uint32_t i_procId; // Processor ID for + // error types 0x0001 to 0x0005 + // Chip ID for + // error types 0x0008 to 0x000A + uint32_t i_plid; // Platform log identifier + uint16_t i_sub_unit_mask; // Currently not being used + uint16_t i_recovery_level; // Currently not being used + } __attribute__ ((packed)); + struct hbrt_fw_msg // define struct hbrt_fw_msg { hbrt_fw_msg() { req_hcode_update = { 0 }; }; // ctor @@ -685,6 +719,10 @@ typedef struct hostInterfaces // io_type set to HBRT_FW_MSG_TYPE_NVDIMM_OPERATION struct nvdimm_operation_t nvdimm_operation; + // This struct is sent from PHYP/OPAL to HBRT with + // io_type set to HBRT_FW_MSG_TYPE_GARD_EVENT + struct gard_event_t gard_event; + // This struct is sent from HBRT with // io_type set to HBRT_FW_MSG_HBRT_FSP_REQ or // HBRT_FW_MSG_HBRT_FSP_RESP -- cgit v1.2.1