summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Dahle <dedahle@us.ibm.com>2013-09-11 10:09:33 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-12 10:32:33 -0500
commit8c8662a2daf4a57ad704a6642f2f33d560fb8d01 (patch)
tree971ea1a7fb58ef6e3200d88ac01e1b729cc21db9
parent90a1f442e0560ac159e34042cfbed558549e7b6a (diff)
downloadtalos-hostboot-8c8662a2daf4a57ad704a6642f2f33d560fb8d01.tar.gz
talos-hostboot-8c8662a2daf4a57ad704a6642f2f33d560fb8d01.zip
Temporary fix for C-DIMM VPD which does not contain AM Keyword
Change-Id: I61ea36418c1d745b95f63a419759975e7c610a41 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6112 Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C83
1 files changed, 35 insertions, 48 deletions
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C
index 14f3f3187..3bfae7b32 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: getMBvpdSpareDramData.C,v 1.1 2013/08/13 20:35:13 mjjones Exp $
+// $Id: getMBvpdSpareDramData.C,v 1.3 2013/09/12 14:12:39 mjjones Exp $
#include <stdint.h>
// fapi support
@@ -69,9 +69,6 @@ fapi::ReturnCode getMBvpdSpareDramData(const fapi::Target &i_mba,
MbaSpareData iv_mbaSpareData[NUM_MBAS];
};
- // Old VPD without the Spare Data
- const uint8_t VPD_WITHOUT_SPARE_DATA_SIZE = sizeof(MirrorData);
-
// Current VPD AM keyword size
const uint32_t AM_KEYWORD_SIZE = sizeof(AmKeyword);
fapi::ReturnCode l_rc;
@@ -81,6 +78,11 @@ fapi::ReturnCode getMBvpdSpareDramData(const fapi::Target &i_mba,
AmKeyword * l_pAmBuffer = NULL;
uint32_t l_AmBufSize = sizeof(AmKeyword);
+ // For old VPD without spare DRAM data
+ // Store data for all 4 ranks of this DIMM
+ const uint8_t VPD_WITHOUT_SPARE_LOW_NIBBLE = 0x55;
+ const uint8_t VPD_WITHOUT_SPARE_FULL_BYTE = 0xFF;
+
do
{
// Check to see if IS-DIMM
@@ -115,55 +117,40 @@ fapi::ReturnCode getMBvpdSpareDramData(const fapi::Target &i_mba,
reinterpret_cast<uint8_t *>(l_pAmBuffer),
l_AmBufSize);
- if (l_rc)
- {
- FAPI_ERR("getMBvpdSpareDramData: Read of AM keyword failed");
- break;
- }
-
- // Check correct amount of data returned
- if (l_AmBufSize < AM_KEYWORD_SIZE)
+ // Check for error or incorrect amount of data returned
+ if (l_rc || (l_AmBufSize < AM_KEYWORD_SIZE))
{
-
- // If Old VPD
- if (VPD_WITHOUT_SPARE_DATA_SIZE == l_AmBufSize)
+ // This handles two scenarios:
+ // 1. fapiGetMBvpdField has returned an error because
+ // the AM keyword is not present in this DIMM's
+ // VPD.
+ // 2. This DIMM does have the AM Keyword, however it
+ // is in an old version of VPD and does not contain
+ // any spare DRAM information.
+ // In both cases, the ATTR_SPD_DRAM_WIDTH
+ // attribute is used to determine spare DRAM availability.
+ // If x4 configuration, assume LOW_NIBBLE.
+ // Otherwise, FULL_BYTE.
+ // TODO RTC 84278: Undo the workaround for scenario 1 once the
+ // C-DIMM VPD is updated on all DIMMs to the current version.
+ uint8_t l_dramWidth = 0;
+ l_rc = FAPI_ATTR_GET(ATTR_SPD_DRAM_WIDTH, &i_dimm, l_dramWidth);
+ if (l_rc)
{
- // Because prior VPD AM keyword does not contain
- // spare DRAM data, the ATTR_SPD_DRAM_WIDTH
- // attribute is used to determine spare DRAM availability.
- // If x4 configuration, assume LOW_NIBBLE.
- // Otherwise, FULL_BYTE.
- uint8_t l_dramWidth = 0;
- l_rc = FAPI_ATTR_GET(ATTR_SPD_DRAM_WIDTH, &i_dimm, l_dramWidth);
- if (l_rc)
- {
- FAPI_ERR("getMBvpdSpareDramData: "
- "Error getting DRAM spare data");
- break;
- }
- // If x4 configuration, low nibble.
- if (fapi::ENUM_ATTR_SPD_DRAM_WIDTH_W4 == l_dramWidth)
- {
- o_data = fapi::ENUM_ATTR_VPD_DIMM_SPARE_LOW_NIBBLE;
- break;
- }
- // Else, full spare.
- else
- {
- o_data = fapi::ENUM_ATTR_VPD_DIMM_SPARE_FULL_BYTE;
- break;
- }
+ FAPI_ERR("getMBvpdSpareDramData: "
+ "Error getting DRAM spare data");
+ break;
}
-
+ // If x4 configuration, low nibble.
+ if (fapi::ENUM_ATTR_SPD_DRAM_WIDTH_W4 == l_dramWidth)
+ {
+ o_data = VPD_WITHOUT_SPARE_LOW_NIBBLE;
+ break;
+ }
+ // Else, full spare.
else
{
- FAPI_ERR("getMBvpdSpareDramData: "
- "Insufficient amount of data returned:"
- " %u < %u", l_AmBufSize, AM_KEYWORD_SIZE);
- const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_AM;
- const uint32_t & RETURNED_SIZE = l_AmBufSize;
- FAPI_SET_HWP_ERROR(l_rc,
- RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
+ o_data = VPD_WITHOUT_SPARE_FULL_BYTE;
break;
}
}
OpenPOWER on IntegriCloud