summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/mvpd_accessors
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2013-10-29 19:16:43 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-11-08 15:21:50 -0600
commitc811df7983a6dbb0d56b96badb58ed785ddd0b72 (patch)
treefc7c1dccec5b4a282be1df4e446e43b1f73fb066 /src/usr/hwpf/hwp/mvpd_accessors
parent06fdca58e18f8a6dae366a12e03b97c7b28d5742 (diff)
downloadblackbird-hostboot-c811df7983a6dbb0d56b96badb58ed785ddd0b72.tar.gz
blackbird-hostboot-c811df7983a6dbb0d56b96badb58ed785ddd0b72.zip
Centaur VPD Attributes: Version, 2N_Mode_Enabled, and Address Mirroring
ATTR_VPD_VERSION - add attribute and hwp accessor to return Record VINI Keyword VZ ATTR_VPD_DRAM_2N_MODE_ENABLED - add attribute and new HWP accessor using MR hwp accessor to retrieve DRAM_2N_MODE. ATTR_VPD_DRAM_ADDRESS_MIRRORING - Change from DIMM to MBA target Change-Id: I05875c5e89966906a928d3c82925e33507962db9 RTC: 89859 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/6949 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/mvpd_accessors')
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C11
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C94
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C34
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C102
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk4
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml11
6 files changed, 225 insertions, 31 deletions
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C
index 0c46c0bca..6d4d3b2cd 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C
@@ -50,8 +50,7 @@ fapi::ReturnCode getMBvpdAddrMirrorData(
const uint8_t NUM_PORTS = 2; //Each MBA has 2 ports
struct port_attributes
{
- uint8_t dimm0 : 4 ;
- uint8_t dimm1 : 4 ;
+ uint8_t iv_dimm ; // bits 0:3 DIMM 0 bits 4:7 DIMM 1
};
struct mba_attributes
{
@@ -125,10 +124,10 @@ fapi::ReturnCode getMBvpdAddrMirrorData(
// of the 4 DIMMs for the requested mba from the AM keyword buffer
for (uint8_t l_port=0; l_port<NUM_PORTS; l_port++)
{
- o_val[l_port][0]= l_pMaBuffer->
- mb_mba[l_mbaPos].mba_port[l_port].dimm0;
- o_val[l_port][1]= l_pMaBuffer->
- mb_mba[l_mbaPos].mba_port[l_port].dimm1;
+ uint8_t l_dimm = l_pMaBuffer->
+ mb_mba[l_mbaPos].mba_port[l_port].iv_dimm;
+ o_val[l_port][0]= ((l_dimm & 0xF0)>>4);
+ o_val[l_port][1]= l_dimm & 0x0F;
}
} while (0);
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C
new file mode 100644
index 000000000..b5140e2e0
--- /dev/null
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C
@@ -0,0 +1,94 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+// $Id: getMBvpdDram2NModeEnabled.C,v 1.2 2013/10/31 18:06:17 whs Exp $
+/**
+ * @file getMBvpdDram2NModeEnabled.C
+ *
+ * @brief get the Dram 2N Mode value from MBvpd keyword MR
+ * and return whether 2N mode is enabled
+ *
+ */
+
+#include <stdint.h>
+
+// fapi support
+#include <fapi.H>
+#include <fapiUtil.H>
+#include <getMBvpdDram2NModeEnabled.H>
+#include <getMBvpdPhaseRotatorData.H>
+
+extern "C"
+{
+using namespace fapi;
+
+fapi::ReturnCode getMBvpdDram2NModeEnabled(
+ const fapi::Target &i_mbaTarget,
+ uint8_t & o_val)
+{
+ fapi::ReturnCode l_fapirc;
+ uint8_t l_dram2NMode [2] = {0,0};
+
+ FAPI_DBG("getMBvpdDram2NModeEnabled: entry ");
+
+ do {
+ // Retrieve the Dram 2N Mode from the MR keyword
+ FAPI_EXEC_HWP(l_fapirc,
+ getMBvpdPhaseRotatorData,
+ i_mbaTarget,
+ fapi::PHASE_ROT_DRAM_2N_MODE,
+ l_dram2NMode);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdDram2NModeEnabled: Read of VZ keyword failed");
+ break; // break out with fapirc
+ }
+ // ensure values match
+ if (l_dram2NMode[0] != l_dram2NMode[1]) {
+ FAPI_ERR("getMBvpdDram2NModeEnabled:"
+ " ports should have same value 0x%02x != 0x%02x",
+ l_dram2NMode[0],l_dram2NMode[1]);
+ const uint32_t & PORT0 = l_dram2NMode[0];
+ const uint32_t & PORT1 = l_dram2NMode[1];
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_DRAM_2N_MODE_NOT_EQUAL);
+ break; // break out with fapirc
+ }
+ // return value
+ const uint8_t DRAM_2N_MODE = 0x02;
+ if (DRAM_2N_MODE == l_dram2NMode[0] )
+ {
+ o_val=fapi::ENUM_ATTR_VPD_DRAM_2N_MODE_ENABLED_TRUE;
+ }
+ else
+ {
+ o_val=fapi::ENUM_ATTR_VPD_DRAM_2N_MODE_ENABLED_FALSE;
+ }
+
+ } while (0);
+
+ FAPI_DBG("getMBvpdDram2NModeEnabled: exit rc=0x%08x)",
+ static_cast<uint32_t>(l_fapirc));
+
+ return l_fapirc;
+}
+
+} // extern "C"
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
index da1c3b5bd..365986955 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: getMBvpdTermData.C,v 1.4 2013/10/21 18:55:40 whs Exp $
+// $Id: getMBvpdTermData.C,v 1.6 2013/10/31 18:03:28 whs Exp $
/**
* @file getMBvpdTermData.C
*
@@ -35,6 +35,7 @@
#include <fapiUtil.H>
#include <getMBvpdTermData.H>
#include <getMBvpdPhaseRotatorData.H>
+#include <getMBvpdVersion.H>
// Used to ensure attribute enums are equal at compile time
class Error_ConstantsDoNotMatch;
@@ -256,36 +257,23 @@ fapi::ReturnCode getMBvpdTermData(
// Check if the old vpd layout is different for this attr
if (TERM_DATA_CHK60 & i_attr) // need to check vpd version for this attr
{
- uint16_t l_vpdVersion = 0;
- uint32_t l_bufSize = sizeof(l_vpdVersion);
- const uint16_t VPD_VERSION_V60=0x3130; // Version 6.0 is ascii "10"
+ uint32_t l_vpdVersion = 0;
+ const uint32_t VPD_VERSION_V60=0x3130; // Version 6.0 is ascii "10"
+
+ // get vpd version
+ FAPI_EXEC_HWP(l_fapirc,
+ getMBvpdVersion,
+ i_mbaTarget,
+ l_vpdVersion);
- // get vpd version from record VINI keyword VZ
- l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VINI,
- fapi::MBVPD_KEYWORD_VZ,
- l_mbTarget,
- reinterpret_cast<uint8_t *>(&l_vpdVersion),
- l_bufSize);
if (l_fapirc)
{
- FAPI_ERR("getMBvpdTermData: Read of VZ keyword failed");
+ FAPI_ERR("getMBvpdTermData: getMBvpdVersion failed");
break; // break out with fapirc
}
FAPI_DBG("getMBvpdTermData: vpd version=0x%08x",
l_vpdVersion);
- // Check that sufficient size was returned.
- if (l_bufSize < sizeof(l_vpdVersion) )
- {
- FAPI_ERR("getMBvpdTermData:"
- " less keyword data returned than expected %d < %d",
- l_bufSize, sizeof(l_vpdVersion));
- const uint32_t & KEYWORD = sizeof(l_vpdVersion);
- const uint32_t & RETURNED_SIZE = l_bufSize;
- FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
- break; // break out with fapirc
- }
-
// Check if work around needed
if (l_vpdVersion < VPD_VERSION_V60)
{
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C
new file mode 100644
index 000000000..55f17291a
--- /dev/null
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C
@@ -0,0 +1,102 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+// $Id: getMBvpdVersion.C,v 1.1 2013/10/30 21:07:58 whs Exp $
+/**
+ * @file getMBvpdVersion.C
+ *
+ * @brief get the vpd version from MBvpd record VINI keyword VZ
+ *
+ */
+
+#include <stdint.h>
+
+// fapi support
+#include <fapi.H>
+#include <fapiUtil.H>
+#include <getMBvpdVersion.H>
+
+extern "C"
+{
+using namespace fapi;
+
+fapi::ReturnCode getMBvpdVersion(
+ const fapi::Target &i_mbaTarget,
+ uint32_t & o_val)
+{
+ fapi::ReturnCode l_fapirc;
+ fapi::Target l_mbTarget;
+ uint16_t l_vpdVersion = 0;
+ uint32_t l_bufSize = sizeof(l_vpdVersion);
+
+ FAPI_DBG("getMBvpdVersion: entry ");
+
+ do {
+ // find the Centaur memory buffer from the passed MBA
+ l_fapirc = fapiGetParentChip (i_mbaTarget,l_mbTarget);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdVersion: Finding the parent mb failed ");
+ break; // break out with fapirc
+ }
+ FAPI_DBG("getMBvpdVersion: parent path=%s ",
+ l_mbTarget.toEcmdString() );
+
+ // get vpd version from record VINI keyword VZ
+ l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VINI,
+ fapi::MBVPD_KEYWORD_VZ,
+ l_mbTarget,
+ reinterpret_cast<uint8_t *>(&l_vpdVersion),
+ l_bufSize);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdVersion: Read of VZ keyword failed");
+ break; // break out with fapirc
+ }
+
+ // Check that sufficient size was returned.
+ if (l_bufSize < sizeof(l_vpdVersion) )
+ {
+ FAPI_ERR("getMBvpdVersion:"
+ " less keyword data returned than expected %d < %d",
+ l_bufSize, sizeof(l_vpdVersion));
+ const uint32_t & KEYWORD = sizeof(l_vpdVersion);
+ const uint32_t & RETURNED_SIZE = l_bufSize;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
+ break; // break out with fapirc
+ }
+ // return value
+ o_val = static_cast<uint32_t>(FAPI_BE16TOH(l_vpdVersion));
+
+ FAPI_DBG("getMBvpdVersion: vpd version=0x%08x",
+ o_val);
+
+
+ } while (0);
+
+ FAPI_DBG("getMBvpdVersion: exit rc=0x%08x)",
+ static_cast<uint32_t>(l_fapirc));
+
+ return l_fapirc;
+}
+
+} // extern "C"
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk
index 592431034..d90544f73 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk
+++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk
@@ -34,5 +34,7 @@ OBJS += getMvpdRing.o \
getMBvpdAddrMirrorData.o \
getMBvpdTermData.o \
getMBvpdSlopeInterceptData.o \
- getMBvpdSpareDramData.o
+ getMBvpdSpareDramData.o \
+ getMBvpdVersion.o \
+ getMBvpdDram2NModeEnabled.o
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
index c9d8f7b71..69cebc849 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
+++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
@@ -20,7 +20,7 @@
<!-- Origin: 30 -->
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
-<!-- $Id: mvpd_errors.xml,v 1.9 2013/10/22 14:02:13 whs Exp $ -->
+<!-- $Id: mvpd_errors.xml,v 1.11 2013/10/30 21:14:03 whs Exp $ -->
<hwpErrors>
<!-- ********************************************************************* -->
<hwpError>
@@ -132,4 +132,13 @@
<ffdc>ATTR_ID</ffdc>
<ffdc>VPD_VALUE</ffdc>
</hwpError>
+ <!-- ********************************************************************* -->
+ <hwpError>
+ <rc>RC_MBVPD_DRAM_2N_MODE_NOT_EQUAL</rc>
+ <description>
+ The 2 ports of DRAM 2N MODE should be equal.
+ </description>
+ <ffdc>PORT0</ffdc>
+ <ffdc>PORT1</ffdc>
+ </hwpError>
</hwpErrors>
OpenPOWER on IntegriCloud