From d50263f51eb430a0737367d8bcdacab1476015d6 Mon Sep 17 00:00:00 2001 From: Prachi Gupta Date: Wed, 13 Jun 2018 15:11:48 -0500 Subject: getMBvpdAttr: Updates for DDR3 support 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 Reviewed-by: Louis Stermole Reviewed-by: ANDRE A. MARIN Tested-by: Jenkins Server Tested-by: Hostboot CI Dev-Ready: STEPHEN GLANCY Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60493 Reviewed-by: Daniel M. Crowell --- .../centaur/procedures/vpd_accessors/getMBvpdAttr.C | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/import/chips/centaur/procedures/vpd_accessors/getMBvpdAttr.C b/src/import/chips/centaur/procedures/vpd_accessors/getMBvpdAttr.C index c3dab7b67..6ff3ff90c 100644 --- a/src/import/chips/centaur/procedures/vpd_accessors/getMBvpdAttr.C +++ b/src/import/chips/centaur/procedures/vpd_accessors/getMBvpdAttr.C @@ -403,12 +403,14 @@ extern "C" if( l_version != 0) { o_version = static_cast(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 @@ -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. @@ -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 @@ -483,11 +485,12 @@ extern "C" { o_version = static_cast(o_version | static_cast(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; @@ -508,10 +511,11 @@ extern "C" { o_version = static_cast(o_version | static_cast(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; @@ -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 -- cgit v1.2.1