Skip to content

Commit

Permalink
Improvements to testing NVDIMM update path
Browse files Browse the repository at this point in the history
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 <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>
Reviewed-by: Matthew Raybuck <matthew.raybuck@ibm.com>
Reviewed-by: Corey V Swenson <cswenson@us.ibm.com>
Reviewed-by: TSUNG K YEUNG <tyeung@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Mar 24, 2020
1 parent 5412005 commit 10a8363
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
34 changes: 32 additions & 2 deletions src/usr/isteps/nvdimm/nvdimm_update.C
Expand Up @@ -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<TARGETING::ATTR_NVDIMM_UPDATE_I2C_BLOCK_SIZE>();
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;
Expand Down Expand Up @@ -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<TARGETING::ATTR_NVDIMM_FORCE_FW_UPDATE>();

errlHndl_t l_err = nullptr;
for (auto pInstalledImage : i_list)
{
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
31 changes: 31 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Expand Up @@ -5423,6 +5423,37 @@
<writeable/>
</attribute>

<attribute>
<id>NVDIMM_FORCE_FW_UPDATE</id>
<description>
If non-zero then just update FW level on all NVDIMMs
</description>
<simpleType>
<uint8_t>
<default>0</default>
</uint8_t>
</simpleType>
<persistency>volatile-zeroed</persistency>
<readable/>
<no_export/>
</attribute>

<attribute>
<id>NVDIMM_UPDATE_I2C_BLOCK_SIZE</id>
<description>
If non-zero, use this block size when updating FPGA code of NVDIMM
Valid sizes are 0, 2, 32
</description>
<simpleType>
<uint8_t>
<default>0</default>
</uint8_t>
</simpleType>
<persistency>volatile-zeroed</persistency>
<readable/>
<no_export/>
</attribute>

<attribute>
<id>NV_OPS_TIMEOUT_MSEC</id>
<description>
Expand Down
8 changes: 7 additions & 1 deletion src/usr/targeting/common/xmltohb/target_types.xml
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2012,2019 -->
<!-- Contributors Listed Below - COPYRIGHT 2012,2020 -->
<!-- [+] Google Inc. -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
Expand Down Expand Up @@ -2127,6 +2127,12 @@
<attribute>
<id>NVDIMM_ENCRYPTION_KEYS_FW</id>
</attribute>
<attribute>
<id>NVDIMM_FORCE_FW_UPDATE</id>
</attribute>
<attribute>
<id>NVDIMM_UPDATE_I2C_BLOCK_SIZE</id>
</attribute>
<attribute>
<id>OCMB_FW_UPDATE_OVERRIDE</id>
</attribute>
Expand Down

0 comments on commit 10a8363

Please sign in to comment.