Skip to content

Commit

Permalink
getMBvpdAttr: Updates for DDR3 support
Browse files Browse the repository at this point in the history
Changed the check from if (rc == false) to if (rc != success).
This way we are not relying on plat code to return a specific
rc in case VPD rec/kw is not found. This HWP relies on a few
VPD rec/kw combinations that will not work and we need to
ignore errors in that case. The HWP tries the combinations in
the following order: VSPD+VM, VSPD+VD, VINI+VZ. For DDR3, first
two combinations do not work.

Change-Id: I43966493a1d7e9e2f6d9447dd3fda9c3206de417
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60488
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60493
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Prachi Gupta authored and dcrowell77 committed Jun 14, 2018
1 parent 36b343d commit d50263f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/import/chips/centaur/procedures/vpd_accessors/getMBvpdAttr.C
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,14 @@ extern "C"
if( l_version != 0)
{
o_version = static_cast<VpdVersion>(l_version);
FAPI_DBG("getVersion: vpd version=0x%x,", o_version);
FAPI_DBG("%s getVersion: vpd version=0x%x,", mss::c_str(i_mbaTarget),
o_version);
return fapi2::FAPI2_RC_SUCCESS;
}
else
{
FAPI_INF("getVersion: read of MBVPD_VERSION attribute failed");
FAPI_INF("%s getVersion: read of MBVPD_VERSION attribute failed",
mss::c_str(i_mbaTarget));
}

// Couldn't get the Version from attribute
Expand All @@ -434,8 +436,8 @@ extern "C"

if((fapi2::current_err == fapi2::FAPI2_RC_SUCCESS) && (!l_sizeMismatch))
{
FAPI_INF("getVersion:"
" returned vm data : 0x%x ",
FAPI_INF("getVersion: %s"
" returned vm data : 0x%x ", mss::c_str(i_mbaTarget),
l_vmVersionBuf.iv_version);

// Get the first byte from VM keyword which has version value.
Expand All @@ -461,7 +463,7 @@ extern "C"
// Get the VD in case of VM read error or
// VM returned size is fine but with value 0, then the Version is in
// VD format.
if((fapi2::current_err == fapi2::FAPI2_RC_FALSE) ||
if((fapi2::current_err != fapi2::FAPI2_RC_SUCCESS) ||
((!l_sizeMismatch) && (l_versionBuf == VM_NOT_SUPPORTED)))
{
o_version = VD_VER; // initialize to finding VD keyword
Expand All @@ -483,11 +485,12 @@ extern "C"
{
o_version = static_cast<VpdVersion>(o_version |
static_cast<VpdVersion>(be16toh(l_versionBuf)));
l_sizeMismatch = false;
}
}

// try record VINI keyword VZ (should work)
if (fapi2::current_err == fapi2::FAPI2_RC_FALSE)
if (fapi2::current_err != fapi2::FAPI2_RC_SUCCESS)
{
o_version = VZ_VER; // VZ keyword
l_record = fapi2::MBVPD_RECORD_VINI;
Expand All @@ -508,10 +511,11 @@ extern "C"
{
o_version = static_cast<VpdVersion>(o_version |
static_cast<VpdVersion>(be16toh(l_versionBuf)));
l_sizeMismatch = false;
}
}

if (fapi2::current_err == fapi2::FAPI2_RC_FALSE)
if (fapi2::current_err != fapi2::FAPI2_RC_SUCCESS)
{
FAPI_ERR("getVersion: Read of VM,VD and VZ keyword failed");
return fapi2::current_err;
Expand All @@ -529,7 +533,8 @@ extern "C"
l_bufSize, sizeof(l_versionBuf));
}

FAPI_INF("getVersion: vpd version=0x%x keyword=%d",
FAPI_INF("getVersion: %s vpd version=0x%x keyword=%d",
mss::c_str(i_mbaTarget),
o_version, l_keyword);

// cache the version value by updating attribute
Expand Down

0 comments on commit d50263f

Please sign in to comment.