From 10a83636b4526e80ae7c3a20a262140c84782459 Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Fri, 31 Jan 2020 14:21:39 -0600 Subject: [PATCH] Improvements to testing NVDIMM update path Create ATTR_NVDIMM_FORCE_FW_UPDATE and update each NVDIMM if this attribute is set to non-zero. Create ATTR_NVDIMM_UPDATE_I2C_BLOCK_SIZE to allow updating using specified block size. CQ:SW486545 Change-Id: I7f05cab2fc3ef89560d6a055123184a5e1cab73b Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90728 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Matthew Raybuck Reviewed-by: Corey V Swenson Reviewed-by: TSUNG K YEUNG Reviewed-by: Daniel M Crowell --- src/usr/isteps/nvdimm/nvdimm_update.C | 34 +++++++++++++++++-- .../common/xmltohb/attribute_types.xml | 31 +++++++++++++++++ .../targeting/common/xmltohb/target_types.xml | 8 ++++- 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/usr/isteps/nvdimm/nvdimm_update.C b/src/usr/isteps/nvdimm/nvdimm_update.C index f620a4ed6c7..a28846ed06e 100644 --- a/src/usr/isteps/nvdimm/nvdimm_update.C +++ b/src/usr/isteps/nvdimm/nvdimm_update.C @@ -392,6 +392,27 @@ errlHndl_t NvdimmInstalledImage::getBlockWriteSizeSupported(uint64_t & o_blockSi "block size %d supported for 0x%.8X NVDIMM (version 0x%04X)", iv_blockSizeSupported, TARGETING::get_huid(iv_dimm), version ); + + // Get the sys target to check for attribute overrides + TARGETING::Target* sys = nullptr; + TARGETING::targetService().getTopLevelTarget(sys); + auto l_blockSize = sys->getAttr(); + if (l_blockSize) + { + // only support 32 byte and word size + if ((l_blockSize == 32) || (l_blockSize == sizeof(uint16_t))) + { + TRACFCOMP( g_trac_nvdimm_upd, "getBlockWriteSizeSupported: " + "ATTR_NVDIMM_UPDATE_I2C_BLOCK_SIZE override block size: %d", l_blockSize ); + iv_blockSizeSupported = l_blockSize; + } + else + { + TRACFCOMP( g_trac_nvdimm_upd, "getBlockWriteSizeSupported: " + "ATTR_NVDIMM_UPDATE_I2C_BLOCK_SIZE has invalid size (%d)", + l_blockSize ); + } + } } } while (0); o_blockSize = iv_blockSizeSupported; @@ -1996,6 +2017,13 @@ bool NvdimmsUpdate::runUpdateUsingLid(NvdimmLidImage * i_lidImage, { bool o_no_error_found = true; + // Get the sys target to check for attribute overrides. + TARGETING::Target* sys = nullptr; + TARGETING::targetService().getTopLevelTarget(sys); + + auto l_forceFwUpdate = + sys->getAttr(); + errlHndl_t l_err = nullptr; for (auto pInstalledImage : i_list) { @@ -2016,7 +2044,8 @@ bool NvdimmsUpdate::runUpdateUsingLid(NvdimmLidImage * i_lidImage, o_no_error_found = false; continue; } - else if (updateNeeded) + + if (updateNeeded || l_forceFwUpdate) { // shared trace variables uint32_t l_installed_type = INVALID_TYPE; @@ -2053,7 +2082,8 @@ bool NvdimmsUpdate::runUpdateUsingLid(NvdimmLidImage * i_lidImage, // perform update for this DIMM with the current LID image TRACFCOMP(g_trac_nvdimm_upd, "NvdimmsUpdate::runUpdateUsingLid() - " - "now update nvdimm[0x%.8X]", l_nvdimm_huid); + "now update nvdimm[0x%.8X] -- force: %d, updateNeeded: %d", + l_nvdimm_huid, l_forceFwUpdate, updateNeeded); TRACFCOMP(g_trac_nvdimm_upd,"Updating with flash size: 0x%08X", i_lidImage->getFlashImageSize()); diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 4a96b73135b..9da11452079 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -5423,6 +5423,37 @@ + + NVDIMM_FORCE_FW_UPDATE + + If non-zero then just update FW level on all NVDIMMs + + + + 0 + + + volatile-zeroed + + + + + + NVDIMM_UPDATE_I2C_BLOCK_SIZE + + If non-zero, use this block size when updating FPGA code of NVDIMM + Valid sizes are 0, 2, 32 + + + + 0 + + + volatile-zeroed + + + + NV_OPS_TIMEOUT_MSEC diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index f87b8fa6e85..a7dfe32ae36 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -5,7 +5,7 @@ - + @@ -2127,6 +2127,12 @@ NVDIMM_ENCRYPTION_KEYS_FW + + NVDIMM_FORCE_FW_UPDATE + + + NVDIMM_UPDATE_I2C_BLOCK_SIZE + OCMB_FW_UPDATE_OVERRIDE