diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2019-11-08 16:29:49 -0600 |
---|---|---|
committer | Daniel M Crowell <dcrowell@us.ibm.com> | 2019-11-18 16:50:04 -0600 |
commit | 7e66117da698293875508fae46de8a8bb5cd9a27 (patch) | |
tree | 1bf0418f80432e64fdf95c8c8a2c9f6b6b7dc3fe | |
parent | d8decc681e7d44711350d4c1407b68a8a80678f7 (diff) | |
download | blackbird-hostboot-7e66117da698293875508fae46de8a8bb5cd9a27.tar.gz blackbird-hostboot-7e66117da698293875508fae46de8a8bb5cd9a27.zip |
Add NVDIMM opertions to rt_cmds
Change-Id: I7b7fbe5c0248d749e80bfc3b8eaa7daa7dbf7a65
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/86759
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@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: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/usr/util/runtime/rt_cmds.C | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/usr/util/runtime/rt_cmds.C b/src/usr/util/runtime/rt_cmds.C index bf0c51749..aa23ae7c0 100644 --- a/src/usr/util/runtime/rt_cmds.C +++ b/src/usr/util/runtime/rt_cmds.C @@ -48,6 +48,7 @@ // switchToFspScomAccess #ifdef CONFIG_NVDIMM #include <isteps/nvdimm/nvdimm.H> // notify NVDIMM protection change +#include <util/runtime/rt_fwnotify.H> #endif extern char hbi_ImageId; @@ -1233,6 +1234,30 @@ void cmd_nvdDmmNvmCheckHealthStatus( char* &o_output) } // end cmd_nvdDmmNvmCheckHealthStatus +/** + * @brief Execute nvdimm operation, see interface.h for operation format + * @param[out] o_output Output display buffer, memory allocated here. + * Will inform caller if nvdimm op passes or fails. + * @param[in] i_op nvdimm operation to perform, see interface.h + */ +void cmd_nvdimm_op( char* &o_output, uint16_t i_op ) +{ + o_output = new char[500]; + + hostInterfaces::nvdimm_operation_t l_operation; + l_operation.procId = HBRT_NVDIMM_OPERATION_APPLY_TO_ALL_NVDIMMS; + l_operation.rsvd1 = 0x0; + l_operation.rsvd2 = 0x0; + l_operation.opType = (hostInterfaces::NVDIMM_Op_t)i_op; + + int rc = doNvDimmOperation(l_operation); + if (rc == -1) + { + sprintf( o_output, "Error on call doNvDimmOperation() op 0x%X",i_op); + } +} + + #endif /** @@ -1555,7 +1580,7 @@ int hbrtCommand( int argc, } } #ifdef CONFIG_NVDIMM - else if( !strcmp( argv[0], "nvdimm_protection" ) ) + else if( !strcmp( argv[0], "nvdimm_protection" ) ) { if (argc >= 3) { @@ -1593,6 +1618,19 @@ int hbrtCommand( int argc, sprintf(*l_output, "Usage: nvdimm_nvm_check_status"); } } + else if( !strcmp( argv[0], "nvdimm_op" ) ) + { + if (argc == 2) + { + uint16_t op = strtou64(argv[1], NULL, 16); + cmd_nvdimm_op( *l_output, op ); + } + else + { + *l_output = new char[100]; + sprintf(*l_output, "ERROR: nvdimm_op <op>"); + } + } #endif else @@ -1638,6 +1676,11 @@ int hbrtCommand( int argc, strcat( *l_output, l_tmpstr ); sprintf( l_tmpstr, "nvdimm_nvm_check_status\n"); strcat( *l_output, l_tmpstr ); + sprintf( l_tmpstr, "nvdimm_op <op>\n" + " 0x1=disarm 0x2=disable_encryption 0x4=remove_keys\n" + " 0x8=enable_encryption 0x10=arm 0x20=es_healthcheck\n" + " 0x40=nvm_healthcheck\n"); + strcat( *l_output, l_tmpstr ); #endif |