summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2019-05-13 20:00:13 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-06-06 10:22:06 -0500
commit7aa27e142c26ec4d068af9c8d451d779fe0e9e80 (patch)
treef88542b179d7132c49e00d77792bebb3ddbbcb60 /src/include
parent57b59e9d788fd2613c1470e7c4f9df9d5e5b36e7 (diff)
downloadtalos-hostboot-7aa27e142c26ec4d068af9c8d451d779fe0e9e80.tar.gz
talos-hostboot-7aa27e142c26ec4d068af9c8d451d779fe0e9e80.zip
Implementing PHYP to HBRT NVDIMM message to issue an NVDIMM operation
-- Created interface hostInterfaces::hbrt_fw_msg::nvdimm_operation_t that will be used to send operation (disarm, disable encryption, remove keys, arm and enable encryption) for all processors or a single processor as specified by the caller. -- Added method doNvdimmOperation that is called by firmware_notify, when an nvdimm_operation_t message is received, to execute the operation(s) request. Change-Id: I22e2d49de87e1fdd2784b6f77a74a24c45dc3206 RTC:207162 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77318 Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/runtime/interface.h58
1 files changed, 49 insertions, 9 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 261e7e42f..7d66f0ff6 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -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).
@@ -549,15 +553,16 @@ 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_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
};
// NVDIMM protection state enum
@@ -567,6 +572,37 @@ 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
+ {
+ // 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,
+ };
+
+ // 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));
+
struct hbrt_fw_msg // define struct hbrt_fw_msg
{
hbrt_fw_msg() { req_hcode_update = { 0 }; }; // ctor
@@ -637,6 +673,10 @@ 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 HBRT with
// io_type set to HBRT_FW_MSG_HBRT_FSP_REQ or
// HBRT_FW_MSG_HBRT_FSP_RESP
OpenPOWER on IntegriCloud