diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2019-06-20 12:05:59 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-06-21 19:12:16 -0500 |
commit | 926ec6f90b177df59e7b8aa9534aa3e6ec003183 (patch) | |
tree | aaf6db56ba22dcb0c54f51c9fa1a5f319311f9ee /src | |
parent | fd59bd865bfb0fae22e0eba5c9187eb0660b0732 (diff) | |
download | talos-hostboot-926ec6f90b177df59e7b8aa9534aa3e6ec003183.tar.gz talos-hostboot-926ec6f90b177df59e7b8aa9534aa3e6ec003183.zip |
Handle unsupported status bit for NVDIMM Encrytion Status
The new NVDIMM FW level added an additional bit to the status
register. We don't care about this bit so added a check mask
to ignore it when we check the status of the encryption
operations.
Change-Id: I67ddd087ff8d04d7af81ee41549f1522f717d974
CQ: SW468004
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/79335
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')
-rw-r--r-- | src/usr/isteps/nvdimm/nvdimm.C | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/usr/isteps/nvdimm/nvdimm.C b/src/usr/isteps/nvdimm/nvdimm.C index 7ae805df5..577528a4d 100644 --- a/src/usr/isteps/nvdimm/nvdimm.C +++ b/src/usr/isteps/nvdimm/nvdimm.C @@ -94,7 +94,8 @@ typedef union { uint8_t whole; struct { - uint8_t reserved : 2; // [7:6 + uint8_t reserved : 1; // [7] + uint8_t unsupported_field : 1; // [6] uint8_t erase_pending : 1; // [5] uint8_t encryption_unlocked : 1; // [4] uint8_t encryption_enabled : 1; // [3] @@ -104,6 +105,9 @@ typedef union { } PACKED; } encryption_config_status_t; +// Valid bits to check against (skips reserved and unsupported) +static constexpr uint8_t ENCRYPTION_STATUS_CHECK_MASK = 0x3F; + // Definition of ENCRYPTION_KEY_VALIDATION -- page 5 offset 0x2A typedef union { uint8_t whole; @@ -2435,7 +2439,8 @@ bool nvdimm_encrypt_enable(TargetHandleList &i_nvdimmList) } // Need to handle these cases? - if (!(l_encStatus.whole == 0x01)) + if (!((l_encStatus.whole & ENCRYPTION_STATUS_CHECK_MASK) + == 0x01)) { TRACFCOMP(g_trac_nvdimm, "nvdimm_encrypt_enable() nvdimm[%X] unsupported state 0x%.02X",get_huid(l_nvdimm),l_encStatus.whole); continue; @@ -2497,7 +2502,8 @@ bool nvdimm_encrypt_enable(TargetHandleList &i_nvdimmList) l_success = false; continue; } - if (!(l_encStatus.whole == 0x1F)) + if (!((l_encStatus.whole & ENCRYPTION_STATUS_CHECK_MASK) + == 0x1F)) { TRACFCOMP(g_trac_nvdimm, ERR_MRK"nvdimm_encrypt_enable() nvdimm[%X] encryption enable failed, ENCRYPTION_CONFIG_STATUS=0x%.02X, expected=0x1F ",get_huid(l_nvdimm),l_encStatus.whole); /*@ |