summaryrefslogtreecommitdiffstats
path: root/src/usr
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
parent06fdca58e18f8a6dae366a12e03b97c7b28d5742 (diff)
downloadtalos-hostboot-c811df7983a6dbb0d56b96badb58ed785ddd0b72.tar.gz
talos-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')
-rw-r--r--src/usr/hwpf/hwp/dimm_spd_attributes.xml17
-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
-rw-r--r--src/usr/hwpf/plat/fapiPlatAttributeService.C91
-rw-r--r--src/usr/hwpf/test/fapiwinkletest.H202
9 files changed, 474 insertions, 92 deletions
diff --git a/src/usr/hwpf/hwp/dimm_spd_attributes.xml b/src/usr/hwpf/hwp/dimm_spd_attributes.xml
index 64f04a29f..77af0e71d 100644
--- a/src/usr/hwpf/hwp/dimm_spd_attributes.xml
+++ b/src/usr/hwpf/hwp/dimm_spd_attributes.xml
@@ -1211,7 +1211,6 @@ Querying them from DDR3 DIMMs will result in an error
<platInit/>
</attribute>
-<!-- Not yet supported by firmware
<attribute>
<id>ATTR_VPD_VERSION</id>
<targetType>TARGET_TYPE_DIMM</targetType>
@@ -1220,9 +1219,7 @@ Querying them from DDR3 DIMMs will result in an error
</description>
<valueType>uint32</valueType>
<platInit/>
- <writeable/>
</attribute>
--->
<!--
*******************************************************************************
@@ -1397,7 +1394,7 @@ file
<attribute>
<id>ATTR_VPD_DRAM_ADDRESS_MIRRORING</id>
- <targetType>TARGET_TYPE_DIMM</targetType>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
<description>
The C-DIMM ranks that have address mirroring.
This data is in the Record:VSPD, Keyword:AM field in C-DIMM VPD.
@@ -1412,6 +1409,7 @@ file
RANK3_MIRRORED = 0x01
</enum>
<platInit/>
+ <array> 2 2 </array>
</attribute>
<!-- Not yet supported by firmware
@@ -2308,4 +2306,15 @@ This Attribute is to be interpreted as an Integer</description>
<array> 2</array>
</attribute>
+<attribute>
+ <id>ATTR_VPD_DRAM_2N_MODE_ENABLED</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>Describes if this MBA is in 2N address mode. The DIMM attributes associated with this MBA describes if this mode is needed for SI. Come from the VPD and consumed in the mba_def.initfile.</description>
+ <valueType>uint8</valueType>
+ <enum>FALSE = 0, TRUE = 1</enum>
+ <odmVisable/>
+ <odmChangeable/>
+</attribute>
+
+
</attributes>
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>
diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C
index a4c68d653..5a893c4da 100644
--- a/src/usr/hwpf/plat/fapiPlatAttributeService.C
+++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C
@@ -47,6 +47,8 @@
#include <hwpf/hwp/mvpd_accessors/getMBvpdTermData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.H>
+#include <hwpf/hwp/mvpd_accessors/getMBvpdVersion.H>
+#include <hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <fapiPllRingAttr.H>
#include <getPllRingAttr.H>
@@ -1193,49 +1195,77 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData (
}
fapi::ReturnCode fapiPlatGetAddrMirrorData (
+ const fapi::Target * i_pTarget,
+ uint8_t (& o_val) [2][2] )
+{
+ // Get the data using the HWP accessor
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getMBvpdAddrMirrorData, *i_pTarget, o_val);
+ return l_rc;
+}
+
+fapi::ReturnCode fapiPlatGetTermData (
+ const fapi::Target * i_pTarget,
+ const fapi::MBvpdTermData i_attr,
+ void * o_pVal,
+ const uint32_t i_valSize)
+{
+ // Call a VPD Accessor HWP to get the data
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getMBvpdTermData,
+ *i_pTarget, i_attr, o_pVal, i_valSize);
+ return l_rc;
+}
+
+fapi::ReturnCode fapiPlatGetSlopeInterceptData (
+ const fapi::Target * i_pTarget,
+ const fapi::MBvpdSlopeIntercept i_attr,
+ uint32_t & o_Val)
+{
+ // Call a VPD Accessor HWP to get the data
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getMBvpdSlopeInterceptData,
+ *i_pTarget, i_attr, o_Val);
+ return l_rc;
+}
+
+fapi::ReturnCode fapiPlatGetVpdVersion (
const fapi::Target * i_pFapiTarget,
- uint8_t &o_val )
+ uint32_t &o_val )
{
fapi::ReturnCode l_rc;
TARGETING::Target * l_pTarget = NULL;
TARGETING::TargetHandleList l_mbaList;
- uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}};
do {
// Get the Targeting Target
l_rc = getTargetingTarget(i_pFapiTarget, l_pTarget);
if (l_rc)
{
- FAPI_ERR("fapiPlatGetAddrMirrorData:Error from getTargetingTarget");
+ FAPI_ERR("fapiPlatGetVpdVersion: Error from getTargetingTarget");
break;
}
- // Find the port and DIMM position
- TARGETING::ATTR_MBA_PORT_type l_portPos =
- l_pTarget->getAttr<TARGETING::ATTR_MBA_PORT>();
- TARGETING::ATTR_MBA_DIMM_type l_dimmPos =
- l_pTarget->getAttr<TARGETING::ATTR_MBA_DIMM>();
-
// Find MBA target from DIMM target
getParentAffinityTargets (l_mbaList, l_pTarget, TARGETING::CLASS_UNIT,
TARGETING::TYPE_MBA, false);
if (l_mbaList.size () != 1 )
{
- FAPI_ERR("fapiPlatGetAddrMirrorData: expect 1 mba %d ",
+ FAPI_ERR("fapiPlatGetVpdVersion: expect 1 mba %d ",
l_mbaList.size());
/*@
* @errortype
- * @moduleid fapi::MOD_PLAT_ATTR_SVC_GET_MIRR_DATA
+ * @moduleid fapi::MOD_PLAT_ATTR_SVC_GET_VPD_VERSION
* @reasoncode fapi::RC_NO_SINGLE_MBA
* @userdata1 Number of MBAs
- * @devdesc fapiPlatGetAddrMirrorData could not find the
+ * @devdesc fapiPlatGetVpdVersion could not find the
* expected 1 mba from the passed dimm target
*/
errlHndl_t l_pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- fapi::MOD_PLAT_ATTR_SVC_GET_MIRR_DATA,
+ fapi::MOD_PLAT_ATTR_SVC_GET_VPD_VERSION,
fapi::RC_NO_SINGLE_MBA,
l_mbaList.size());
@@ -1249,47 +1279,28 @@ fapi::ReturnCode fapiPlatGetAddrMirrorData (
static_cast<void *>(l_mbaList[0]));
// Get the data using the HWP accessor
- FAPI_EXEC_HWP(l_rc, getMBvpdAddrMirrorData, l_fapiTarget, l_val);
+ FAPI_EXEC_HWP(l_rc, getMBvpdVersion, l_fapiTarget, o_val);
if (l_rc)
{
- FAPI_ERR("fapiPlatGetAddrMirrorData:"
- " Error from getMBvpdAddrMirrorData");
+ FAPI_ERR("fapiPlatGetVpdVersion:"
+ " Error from getMBvpdVersion");
break;
}
- // return the address mirroring data for the passed DIMM
- o_val = l_val[l_portPos][l_dimmPos];
-
} while (0);
return l_rc;
}
-fapi::ReturnCode fapiPlatGetTermData (
- const fapi::Target * i_pTarget,
- const fapi::MBvpdTermData i_attr,
- void * o_pVal,
- const uint32_t i_valSize)
-{
- // Call a VPD Accessor HWP to get the data
- fapi::ReturnCode l_rc;
- FAPI_EXEC_HWP(l_rc, getMBvpdTermData,
- *i_pTarget, i_attr, o_pVal, i_valSize);
- return l_rc;
-}
-
-fapi::ReturnCode fapiPlatGetSlopeInterceptData (
- const fapi::Target * i_pTarget,
- const fapi::MBvpdSlopeIntercept i_attr,
- uint32_t & o_Val)
+fapi::ReturnCode fapiPlatGetDram2NModeEnabled (
+ const fapi::Target * i_pFapiTarget,
+ uint8_t &o_val )
{
- // Call a VPD Accessor HWP to get the data
+ // Get the data using the HWP accessor
fapi::ReturnCode l_rc;
- FAPI_EXEC_HWP(l_rc, getMBvpdSlopeInterceptData,
- *i_pTarget, i_attr, o_Val);
+ FAPI_EXEC_HWP(l_rc, getMBvpdDram2NModeEnabled, * i_pFapiTarget, o_val);
return l_rc;
}
-
fapi::ReturnCode fapiPlatGetEnableAttr ( fapi::AttributeId i_id,
const fapi::Target * i_pFapiTarget, uint8_t & o_enable )
{
diff --git a/src/usr/hwpf/test/fapiwinkletest.H b/src/usr/hwpf/test/fapiwinkletest.H
index aadce24e2..118dccef6 100644
--- a/src/usr/hwpf/test/fapiwinkletest.H
+++ b/src/usr/hwpf/test/fapiwinkletest.H
@@ -48,6 +48,8 @@
#include <mvpd_accessors/getMBvpdAddrMirrorData.H>
#include <mvpd_accessors/getMBvpdTermData.H>
#include <mvpd_accessors/getMBvpdSlopeInterceptData.H>
+#include <mvpd_accessors/getMBvpdVersion.H>
+#include <mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <errl/errlmanager.H>
#include <errl/errlentry.H>
@@ -407,21 +409,21 @@ public:
}
/**
- * @brief call getMBvpdAddrMirrorData to fetch memory buffer AM attributes
+ * @brief call getMBvpdVersion to fetch vpd version
*
*/
- void testGetAddrMirrorData()
+ void testGetVersion()
{
fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS );
- getMBvpdAddrMirrorData_FP_t (l_getMBvpdAddrMirrorData)
- = &getMBvpdAddrMirrorData;
+ getMBvpdVersion_FP_t (l_getMBvpdVersion)
+ = &getMBvpdVersion;
- TS_TRACE( "testGetAddrMirrorData entry" );
+ TS_TRACE( "testGetVersion entry" );
TARGETING::TargetHandleList l_memBufList;
getAllChips(l_memBufList, TYPE_MEMBUF);
- TS_TRACE( "testGetAddrMirrorData l_memBufList.size()=%d",
+ TS_TRACE( "testGetVersion l_memBufList.size()=%d",
l_memBufList.size() );
// loop thru memory buffers
#if UNITTESTfwt
@@ -435,7 +437,7 @@ public:
getChildAffinityTargets(l_mbaList,l_memBufList[l_mbNum],
CLASS_UNIT,TYPE_MBA,false);
- TS_TRACE( "testGetAddrMirrorData l_mbaBufList.size()=%d",
+ TS_TRACE( "testGetVersion l_mbaBufList.size()=%d",
l_mbaList.size());
// loop thru all the mbas (should be 2)
@@ -450,7 +452,7 @@ public:
getChildAffinityTargets(l_dimmList,l_mbaList[l_mbaNum],
CLASS_LOGICAL_CARD,TYPE_DIMM,false);
- TS_TRACE( "testGetAddrMirrorData l_dimmList.size()=%d",
+ TS_TRACE( "testGetVersion l_dimmList.size()=%d",
l_dimmList.size());
// cast OUR type of target to a FAPI type of target.
@@ -458,20 +460,18 @@ public:
(const_cast<TARGETING::Target*>(l_mbaList[l_mbaNum])));
// verify HWP accessor
- uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}};
+ uint32_t l_val = 0xffffffff;
- l_fapirc = (*l_getMBvpdAddrMirrorData)(l_fapi_mba_target,l_val);
+ l_fapirc = (*l_getMBvpdVersion)(l_fapi_mba_target,l_val);
if (l_fapirc)
{
- TS_FAIL( "fapiGetAddrMirrorData: HWP accessor fail rc=0x%x",
+ TS_FAIL( "fapiGetVersion: HWP accessor fail rc=0x%x",
static_cast<uint32_t>(l_fapirc) );
fapiLogError(l_fapirc);
}
else
{
- TS_TRACE( "testGetAddrMirrorData accessor "
- "(0x%02x,0x%02x),(0x%02x,0x%02x)",
- l_val[0][0], l_val[0][1], l_val[1][0], l_val[1][1]);
+ TS_TRACE( "testGetVersion accessor 0x%08x",l_val);
}
// loop thru all the DIMMs (should be 4)
@@ -483,7 +483,7 @@ public:
#endif
for (; l_dimmNum < l_dimmList.size(); l_dimmNum++ )
{
- uint8_t l_val = 0xFF;
+// uint32_t l_val = 0xFFFFFFFF;
// dump physical path to target
EntityPath l_path;
@@ -496,18 +496,186 @@ public:
(const_cast<TARGETING::Target*>(l_dimmList[l_dimmNum])));
// verify getting all attributes
- l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_ADDRESS_MIRRORING,
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_VERSION,
&l_fapi_dimm_target,
l_val);
- TS_TRACE( "testGetAddrMirrorData attribute %d 0x%02x",
+ TS_TRACE( "testGetVersion attribute %d 0x%08x",
l_dimmNum,l_val);
}
if (l_fapirc)
{
+ TS_FAIL( "fapiGetVersion: FAPI_ATTR_GET fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ }
+ }
+
+ TS_TRACE( "testGetVersion exit" );
+
+ }
+
+ /**
+ * @brief call getMBvpdDram2NModeEnabled to retrieve 2N mode
+ *
+ */
+ void testGetDram2NModeEnabled()
+ {
+ fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS );
+ getMBvpdDram2NModeEnabled_FP_t (l_getMBvpdDram2NModeEnabled)
+ = &getMBvpdDram2NModeEnabled;
+
+ TS_TRACE( "testGetDram2NModeEnabled entry" );
+
+ TARGETING::TargetHandleList l_memBufList;
+ getAllChips(l_memBufList, TYPE_MEMBUF);
+
+ TS_TRACE( "testGetDram2NModeEnabled l_memBufList.size()=%d",
+ l_memBufList.size() );
+ // loop thru memory buffers
+#if UNITTESTfwt
+ uint8_t l_mbNum = 0; // check them all in unit test
+#else
+ uint8_t l_mbNum = (l_memBufList.size() > 0) ? l_memBufList.size()-1 : 0;
+#endif
+ for (; l_mbNum < l_memBufList.size(); l_mbNum++ )
+ {
+ TARGETING::TargetHandleList l_mbaList;
+ getChildAffinityTargets(l_mbaList,l_memBufList[l_mbNum],
+ CLASS_UNIT,TYPE_MBA,false);
+
+ TS_TRACE( "testGetDram2NModeEnabled l_mbaBufList.size()=%d",
+ l_mbaList.size());
+
+ // loop thru all the mbas (should be 2)
+#if UNITTESTfwt
+ uint8_t l_mbaNum = 0; // check them all in unit test
+#else
+ uint8_t l_mbaNum = (l_mbaList.size() > 0) ? l_mbaList.size()-1:0 ;
+#endif
+ for (; l_mbaNum < l_mbaList.size(); l_mbaNum++ )
+ {
+ // cast OUR type of target to a FAPI type of target.
+ fapi::Target l_fapi_mba_target( TARGET_TYPE_MBA_CHIPLET,
+ (const_cast<TARGETING::Target*>(l_mbaList[l_mbaNum])));
+
+ // verify HWP accessor
+ uint8_t l_val = 0xFF;
+
+ l_fapirc = (*l_getMBvpdDram2NModeEnabled)
+ (l_fapi_mba_target,l_val);
+ if (l_fapirc)
+ {
+ TS_FAIL("fapiGetDram2NModeEnabled:HWP accessor fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ else
+ {
+ TS_TRACE("testGetDram2NModeEnabled accessor 0x%02x",
+ l_val);
+ }
+ // verify attribute
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_2N_MODE_ENABLED,
+ &l_fapi_mba_target,
+ l_val);
+ if (l_fapirc)
+ {
+ TS_FAIL("fapiGetDram2NModeEnabled:"
+ " FAPI_ATTR_GET fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ else
+ {
+ TS_TRACE( "testGetDram2NModeEnabled attribute 0x%02x",
+ l_val);
+ }
+ }
+ }
+
+ TS_TRACE( "testGetDram2NModeEnabled exit" );
+
+ }
+
+
+ /**
+ * @brief call getMBvpdAddrMirrorData to fetch memory buffer AM attributes
+ *
+ */
+ void testGetAddrMirrorData()
+ {
+ fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS );
+ getMBvpdAddrMirrorData_FP_t (l_getMBvpdAddrMirrorData)
+ = &getMBvpdAddrMirrorData;
+
+ TS_TRACE( "testGetAddrMirrorData entry" );
+
+ TARGETING::TargetHandleList l_memBufList;
+ getAllChips(l_memBufList, TYPE_MEMBUF);
+
+ TS_TRACE( "testGetAddrMirrorData l_memBufList.size()=%d",
+ l_memBufList.size() );
+ // loop thru memory buffers
+#if UNITTESTfwt
+ uint8_t l_mbNum = 0; // check them all in unit test
+#else
+ uint8_t l_mbNum = (l_memBufList.size() > 0) ? l_memBufList.size()-1 : 0;
+#endif
+ for (; l_mbNum < l_memBufList.size(); l_mbNum++ )
+ {
+ TARGETING::TargetHandleList l_mbaList;
+ getChildAffinityTargets(l_mbaList,l_memBufList[l_mbNum],
+ CLASS_UNIT,TYPE_MBA,false);
+
+ TS_TRACE( "testGetAddrMirrorData l_mbaBufList.size()=%d",
+ l_mbaList.size());
+
+ // loop thru all the mbas (should be 2)
+#if UNITTESTfwt
+ uint8_t l_mbaNum = 0; // check them all in unit test
+#else
+ uint8_t l_mbaNum = (l_mbaList.size() > 0) ? l_mbaList.size()-1:0 ;
+#endif
+ for (; l_mbaNum < l_mbaList.size(); l_mbaNum++ )
+ {
+ // cast OUR type of target to a FAPI type of target.
+ fapi::Target l_fapi_mba_target( TARGET_TYPE_MBA_CHIPLET,
+ (const_cast<TARGETING::Target*>(l_mbaList[l_mbaNum])));
+
+ // verify HWP accessor
+ uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}};
+
+ l_fapirc = (*l_getMBvpdAddrMirrorData)(l_fapi_mba_target,l_val);
+ if (l_fapirc)
+ {
+ TS_FAIL( "fapiGetAddrMirrorData: HWP accessor fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ else
+ {
+ TS_TRACE( "testGetAddrMirrorData accessor "
+ "(0x%02x,0x%02x),(0x%02x,0x%02x)",
+ l_val[0][0], l_val[0][1], l_val[1][0], l_val[1][1]);
+ }
+
+ // verify attribute
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_ADDRESS_MIRRORING,
+ &l_fapi_mba_target,
+ l_val);
+ if (l_fapirc)
+ {
TS_FAIL( "fapiGetAddrMirrorData: FAPI_ATTR_GET fail rc=0x%x",
static_cast<uint32_t>(l_fapirc) );
fapiLogError(l_fapirc);
}
+ else
+ {
+ TS_TRACE( "testGetAddrMirrorData attribute "
+ "(0x%02x,0x%02x),(0x%02x,0x%02x)",
+ l_val[0][0], l_val[0][1], l_val[1][0], l_val[1][1]);
+ }
}
}
OpenPOWER on IntegriCloud