diff options
Diffstat (limited to 'src/include/runtime/interface.h')
-rw-r--r-- | src/include/runtime/interface.h | 131 |
1 files changed, 118 insertions, 13 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index cd6d0e23a..6304ec6ba 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2019 */ +/* Contributors Listed Below - COPYRIGHT 2013,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -193,6 +193,10 @@ enum MemoryError_t /* Defined Return Codes for wakeup() */ #define HBRT_RC_WAKEUP_INVALID_ON_CORE_XSTOP -12289 /* -0x3001 */ +/* Define a const, for hostInterfaces::nvdimm_operation_t::procId, + * that will flag when to apply the NVDIMM operation(s) to all NVDIMMs + */ +const uint64_t HBRT_NVDIMM_OPERATION_APPLY_TO_ALL_NVDIMMS = 0xFFFFFFFFFFFFFFFF; /** @typedef hostInterfaces_t * @brief Interfaces provided by the underlying environment (ex. Sapphire). @@ -541,19 +545,25 @@ typedef struct hostInterfaces /** * @brief Structure to be sent and received in the * firmware_request call + * + * @note see README.md file on how to create an HBRT to FW + * request message interface */ - enum + + 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, - HBRT_FW_MSG_TYPE_RESP_GENERIC = 2, - HBRT_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3, - HBRT_FW_MSG_HBRT_FSP_REQ = 4, - HBRT_FW_MSG_TYPE_ERROR_LOG = 5, - HBRT_FW_MSG_HBRT_FSP_RESP = 6, - HBRT_FW_MSG_TYPE_I2C_LOCK = 7, - HBRT_FW_MSG_TYPE_SBE_STATE = 8, - HBRT_FW_MSG_TYPE_NVDIMM_PROTECTION = 9, + 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 @@ -563,6 +573,88 @@ typedef struct hostInterfaces HBRT_FW_NVDIMM_PROTECTED = 1 }; + // NVDIMM valid operations + // @note Multiple operations can be triggered at the same time using + // a single NVDIMM operation call. Having said that, operation + // combinations should be sensical. Nonsensical operations will + // error out. + enum NVDIMM_Op_t: uint16_t + { + /// The following operations pertain to arming/disarming + /// the NVDIMM + // Disarm the NV logic such that the next save attempt is a NOOP + HBRT_FW_NVDIMM_DISARM = 0x0001, + // Disable encryption on the NVDIMM and clear saved values from FW + HBRT_FW_NVDIMM_DISABLE_ENCRYPTION = 0x0002, + // Remove keys + HBRT_FW_NVDIMM_REMOVE_KEYS = 0x0004, + // Enable encryption on the NVDIMM + HBRT_FW_NVDIMM_ENABLE_ENCRYPTION = 0x0008, + // Arm the NV logic + HBRT_FW_NVDIMM_ARM = 0x0010, + + /// The following operations pertain to the Health of the NVDIMM + /// This operation can be performed with the arming/disarming + /// operation, these operation types are orthogonal to each other + // Manufacturing(MNFG) energy source(ES) health check request + HBRT_FW_MNFG_ES_HEALTH_CHECK = 0x0020, + // Manufacturing(MNFG) non-volatile memory(NVM) health check request + HBRT_FW_MNFG_NVM_HEALTH_CHECK = 0x0040, + + /// The following operations pertain to the decommission of an NVDIMM + // Factory Default returns the NVDIMM to the factory default state + HBRT_FW_NVDIMM_FACTORY_DEFAULT = 0x0080, + // Secure Erase Verify all NAND flash blocks have been erased + HBRT_FW_NVDIMM_SECURE_EV_START = 0x0100, + // Secure Erase Verify Status checks if SEV operation has completed + HBRT_FW_NVDIMM_SECURE_EV_STATUS = 0x0200, + }; + + // NVDIMM (PHYP -> HBRT) message to request NVDIMM operation(s) + struct nvdimm_operation_t + { + uint64_t procId; // Retrieve all NVDIMMs under the processor ID; all + // FFs (HBRT_NVDIMM_OPERATION_APPLY_TO_ALL_NVDIMMS) + // means operate on all NVDIMMs in the system + uint32_t rsvd1; // reserved + uint16_t rsvd2; // reserved + NVDIMM_Op_t opType; // NVDIMM operation(s) to perform, + // 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 @@ -593,7 +685,7 @@ typedef struct hostInterfaces } req_hcode_update; // This struct is sent from HBRT with - // io_type set to HBRT_FW_MSG_TYPE_ERR_LOG + // io_type set to HBRT_FW_MSG_TYPE_ERROR_LOG // Send an error log to FSP struct { @@ -633,6 +725,14 @@ typedef struct hostInterfaces uint64_t i_state; // NVDIMM protection state enum } __attribute__ ((packed)) nvdimm_protection_state; + // This struct is sent from PHYP to HBRT with + // 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 @@ -1032,6 +1132,11 @@ struct postInitCalls_t */ void (*callCommitRsvdTraceBufErrl)(); + /** + * @brief Sends current NV_STATUS to host + * + */ + void (*callSendNvStatus)(); }; extern hostInterfaces_t* g_hostInterfaces; |